+local pow = math.pow
+local kcat_attr_table = {}
+local pow_table = {}
+local fn_table = {} -- used in is_ucs_in_japanese_char_direct
+for i = 0, 31*ATTR_RANGE-1 do
+ kcat_attr_table[i] = luatexbase.attributes['ltj@kcat'..floor(i/31)]
+ pow_table[i] = pow(2, i%31)
+ fn_table[i] = function(p)
+ return floor(has_attr(p, kcat_attr_table[i])/pow_table[i])%2 ~= jcr_noncjk
+ end
+end
+pow_table[31*ATTR_RANGE] = pow(2, 31)