#include #include /* code used by read_mkf function */ const uint8_t table_00483430[256] = { 0x3f, 0x0b, 0x17, 0x03, 0x2f, 0x0a, 0x16, 0x00, 0x2e, 0x09, 0x15, 0x02, 0x2d, 0x01, 0x08, 0x00, 0x3e, 0x07, 0x14, 0x03, 0x2c, 0x06, 0x13, 0x00, 0x2b, 0x05, 0x12, 0x02, 0x2a, 0x01, 0x04, 0x00, 0x3d, 0x0b, 0x11, 0x03, 0x29, 0x0a, 0x10, 0x00, 0x28, 0x09, 0x0f, 0x02, 0x27, 0x01, 0x08, 0x00, 0x3c, 0x07, 0x0e, 0x03, 0x26, 0x06, 0x0d, 0x00, 0x25, 0x05, 0x0c, 0x02, 0x24, 0x01, 0x04, 0x00, 0x3b, 0x0b, 0x17, 0x03, 0x23, 0x0a, 0x16, 0x00, 0x22, 0x09, 0x15, 0x02, 0x21, 0x01, 0x08, 0x00, 0x3a, 0x07, 0x14, 0x03, 0x20, 0x06, 0x13, 0x00, 0x1f, 0x05, 0x12, 0x02, 0x1e, 0x01, 0x04, 0x00, 0x39, 0x0b, 0x11, 0x03, 0x1d, 0x0a, 0x10, 0x00, 0x1c, 0x09, 0x0f, 0x02, 0x1b, 0x01, 0x08, 0x00, 0x38, 0x07, 0x0e, 0x03, 0x1a, 0x06, 0x0d, 0x00, 0x19, 0x05, 0x0c, 0x02, 0x18, 0x01, 0x04, 0x00, 0x37, 0x0b, 0x17, 0x03, 0x2f, 0x0a, 0x16, 0x00, 0x2e, 0x09, 0x15, 0x02, 0x2d, 0x01, 0x08, 0x00, 0x36, 0x07, 0x14, 0x03, 0x2c, 0x06, 0x13, 0x00, 0x2b, 0x05, 0x12, 0x02, 0x2a, 0x01, 0x04, 0x00, 0x35, 0x0b, 0x11, 0x03, 0x29, 0x0a, 0x10, 0x00, 0x28, 0x09, 0x0f, 0x02, 0x27, 0x01, 0x08, 0x00, 0x34, 0x07, 0x0e, 0x03, 0x26, 0x06, 0x0d, 0x00, 0x25, 0x05, 0x0c, 0x02, 0x24, 0x01, 0x04, 0x00, 0x33, 0x0b, 0x17, 0x03, 0x23, 0x0a, 0x16, 0x00, 0x22, 0x09, 0x15, 0x02, 0x21, 0x01, 0x08, 0x00, 0x32, 0x07, 0x14, 0x03, 0x20, 0x06, 0x13, 0x00, 0x1f, 0x05, 0x12, 0x02, 0x1e, 0x01, 0x04, 0x00, 0x31, 0x0b, 0x11, 0x03, 0x1d, 0x0a, 0x10, 0x00, 0x1c, 0x09, 0x0f, 0x02, 0x1b, 0x01, 0x08, 0x00, 0x30, 0x07, 0x0e, 0x03, 0x1a, 0x06, 0x0d, 0x00, 0x19, 0x05, 0x0c, 0x02, 0x18, 0x01, 0x04, 0x00 }; const uint8_t table_00483530[256] = { 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03, 0x08, 0x05, 0x06, 0x04, 0x07, 0x05, 0x06, 0x03, 0x07, 0x05, 0x06, 0x04, 0x07, 0x04, 0x05, 0x03 }; const uint16_t table_483630[642] = { 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0005, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0009, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0011, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0021, 0x0040, 0x0040, 0x0040, 0x0040, 0x0041, 0x0080, 0x0080, 0x00c1, 0x0141, 0xffff }; const uint16_t table_483b34[641] = { 0x0502, 0x0504, 0x0506, 0x0508, 0x050a, 0x050c, 0x050e, 0x0510, 0x0512, 0x0514, 0x0516, 0x0518, 0x051a, 0x051c, 0x051e, 0x0520, 0x0522, 0x0524, 0x0526, 0x0528, 0x052a, 0x052c, 0x052e, 0x0530, 0x0532, 0x0534, 0x0536, 0x0538, 0x053a, 0x053c, 0x053e, 0x0540, 0x0542, 0x0544, 0x0546, 0x0548, 0x054a, 0x054c, 0x054e, 0x0550, 0x0552, 0x0554, 0x0556, 0x0558, 0x055a, 0x055c, 0x055e, 0x0560, 0x0562, 0x0564, 0x0566, 0x0568, 0x056a, 0x056c, 0x056e, 0x0570, 0x0572, 0x0574, 0x0576, 0x0578, 0x057a, 0x057c, 0x057e, 0x0580, 0x0582, 0x0584, 0x0586, 0x0588, 0x058a, 0x058c, 0x058e, 0x0590, 0x0592, 0x0594, 0x0596, 0x0598, 0x059a, 0x059c, 0x059e, 0x05a0, 0x05a2, 0x05a4, 0x05a6, 0x05a8, 0x05aa, 0x05ac, 0x05ae, 0x05b0, 0x05b2, 0x05b4, 0x05b6, 0x05b8, 0x05ba, 0x05bc, 0x05be, 0x05c0, 0x05c2, 0x05c4, 0x05c6, 0x05c8, 0x05ca, 0x05cc, 0x05ce, 0x05d0, 0x05d2, 0x05d4, 0x05d6, 0x05d8, 0x05da, 0x05dc, 0x05de, 0x05e0, 0x05e2, 0x05e4, 0x05e6, 0x05e8, 0x05ea, 0x05ec, 0x05ee, 0x05f0, 0x05f2, 0x05f4, 0x05f6, 0x05f8, 0x05fa, 0x05fc, 0x05fe, 0x0600, 0x0602, 0x0604, 0x0606, 0x0608, 0x060a, 0x060c, 0x060e, 0x0610, 0x0612, 0x0614, 0x0616, 0x0618, 0x061a, 0x061c, 0x061e, 0x0620, 0x0622, 0x0624, 0x0626, 0x0628, 0x062a, 0x062c, 0x062e, 0x0630, 0x0632, 0x0634, 0x0636, 0x0638, 0x063a, 0x063c, 0x063e, 0x0640, 0x0642, 0x0644, 0x0646, 0x0648, 0x064a, 0x064c, 0x064e, 0x0650, 0x0652, 0x0654, 0x0656, 0x0658, 0x065a, 0x065c, 0x065e, 0x0660, 0x0662, 0x0664, 0x0666, 0x0668, 0x066a, 0x066c, 0x066e, 0x0670, 0x0672, 0x0674, 0x0676, 0x0678, 0x067a, 0x067c, 0x067e, 0x0680, 0x0682, 0x0684, 0x0686, 0x0688, 0x068a, 0x068c, 0x068e, 0x0690, 0x0692, 0x0694, 0x0696, 0x0698, 0x069a, 0x069c, 0x069e, 0x06a0, 0x06a2, 0x06a4, 0x06a6, 0x06a8, 0x06aa, 0x06ac, 0x06ae, 0x06b0, 0x06b2, 0x06b4, 0x06b6, 0x06b8, 0x06ba, 0x06bc, 0x06be, 0x06c0, 0x06c2, 0x06c4, 0x06c6, 0x06c8, 0x06ca, 0x06cc, 0x06ce, 0x06d0, 0x06d2, 0x06d4, 0x06d6, 0x06d8, 0x06da, 0x06dc, 0x06de, 0x06e0, 0x06e2, 0x06e4, 0x06e6, 0x06e8, 0x06ea, 0x06ec, 0x06ee, 0x06f0, 0x06f2, 0x06f4, 0x06f6, 0x06f8, 0x06fa, 0x06fc, 0x06fe, 0x0700, 0x0702, 0x0704, 0x0706, 0x0708, 0x070a, 0x070c, 0x070e, 0x0710, 0x0712, 0x0714, 0x0716, 0x0718, 0x071a, 0x071c, 0x071e, 0x0720, 0x0722, 0x0724, 0x0726, 0x0728, 0x072a, 0x072c, 0x072e, 0x0730, 0x0732, 0x0734, 0x0736, 0x0738, 0x073a, 0x073c, 0x073e, 0x0740, 0x0742, 0x0744, 0x0746, 0x0748, 0x074a, 0x074c, 0x074e, 0x0750, 0x0752, 0x0754, 0x0756, 0x0758, 0x075a, 0x075c, 0x075e, 0x0760, 0x0762, 0x0764, 0x0766, 0x0768, 0x076a, 0x076c, 0x076e, 0x0770, 0x0772, 0x0774, 0x0776, 0x0778, 0x077a, 0x077c, 0x077e, 0x0780, 0x0782, 0x0000, 0x0004, 0x0008, 0x000c, 0x0010, 0x0014, 0x0018, 0x001c, 0x0020, 0x0024, 0x0028, 0x002c, 0x0030, 0x0034, 0x0038, 0x003c, 0x0040, 0x0044, 0x0048, 0x004c, 0x0050, 0x0054, 0x0058, 0x005c, 0x0060, 0x0064, 0x0068, 0x006c, 0x0070, 0x0074, 0x0078, 0x007c, 0x0080, 0x0084, 0x0088, 0x008c, 0x0090, 0x0094, 0x0098, 0x009c, 0x00a0, 0x00a4, 0x00a8, 0x00ac, 0x00b0, 0x00b4, 0x00b8, 0x00bc, 0x00c0, 0x00c4, 0x00c8, 0x00cc, 0x00d0, 0x00d4, 0x00d8, 0x00dc, 0x00e0, 0x00e4, 0x00e8, 0x00ec, 0x00f0, 0x00f4, 0x00f8, 0x00fc, 0x0100, 0x0104, 0x0108, 0x010c, 0x0110, 0x0114, 0x0118, 0x011c, 0x0120, 0x0124, 0x0128, 0x012c, 0x0130, 0x0134, 0x0138, 0x013c, 0x0140, 0x0144, 0x0148, 0x014c, 0x0150, 0x0154, 0x0158, 0x015c, 0x0160, 0x0164, 0x0168, 0x016c, 0x0170, 0x0174, 0x0178, 0x017c, 0x0180, 0x0184, 0x0188, 0x018c, 0x0190, 0x0194, 0x0198, 0x019c, 0x01a0, 0x01a4, 0x01a8, 0x01ac, 0x01b0, 0x01b4, 0x01b8, 0x01bc, 0x01c0, 0x01c4, 0x01c8, 0x01cc, 0x01d0, 0x01d4, 0x01d8, 0x01dc, 0x01e0, 0x01e4, 0x01e8, 0x01ec, 0x01f0, 0x01f4, 0x01f8, 0x01fc, 0x0200, 0x0204, 0x0208, 0x020c, 0x0210, 0x0214, 0x0218, 0x021c, 0x0220, 0x0224, 0x0228, 0x022c, 0x0230, 0x0234, 0x0238, 0x023c, 0x0240, 0x0244, 0x0248, 0x024c, 0x0250, 0x0254, 0x0258, 0x025c, 0x0260, 0x0264, 0x0268, 0x026c, 0x0270, 0x0274, 0x0278, 0x027c, 0x0280, 0x0284, 0x0288, 0x028c, 0x0290, 0x0294, 0x0298, 0x029c, 0x02a0, 0x02a4, 0x02a8, 0x02ac, 0x02b0, 0x02b4, 0x02b8, 0x02bc, 0x02c0, 0x02c4, 0x02c8, 0x02cc, 0x02d0, 0x02d4, 0x02d8, 0x02dc, 0x02e0, 0x02e4, 0x02e8, 0x02ec, 0x02f0, 0x02f4, 0x02f8, 0x02fc, 0x0300, 0x0304, 0x0308, 0x030c, 0x0310, 0x0314, 0x0318, 0x031c, 0x0320, 0x0324, 0x0328, 0x032c, 0x0330, 0x0334, 0x0338, 0x033c, 0x0340, 0x0344, 0x0348, 0x034c, 0x0350, 0x0354, 0x0358, 0x035c, 0x0360, 0x0364, 0x0368, 0x036c, 0x0370, 0x0374, 0x0378, 0x037c, 0x0380, 0x0384, 0x0388, 0x038c, 0x0390, 0x0394, 0x0398, 0x039c, 0x03a0, 0x03a4, 0x03a8, 0x03ac, 0x03b0, 0x03b4, 0x03b8, 0x03bc, 0x03c0, 0x03c4, 0x03c8, 0x03cc, 0x03d0, 0x03d4, 0x03d8, 0x03dc, 0x03e0, 0x03e4, 0x03e8, 0x03ec, 0x03f0, 0x03f4, 0x03f8, 0x03fc, 0x0400, 0x0404, 0x0408, 0x040c, 0x0410, 0x0414, 0x0418, 0x041c, 0x0420, 0x0424, 0x0428, 0x042c, 0x0430, 0x0434, 0x0438, 0x043c, 0x0440, 0x0444, 0x0448, 0x044c, 0x0450, 0x0454, 0x0458, 0x045c, 0x0460, 0x0464, 0x0468, 0x046c, 0x0470, 0x0474, 0x0478, 0x047c, 0x0480, 0x0484, 0x0488, 0x048c, 0x0490, 0x0494, 0x0498, 0x049c, 0x04a0, 0x04a4, 0x04a8, 0x04ac, 0x04b0, 0x04b4, 0x04b8, 0x04bc, 0x04c0, 0x04c4, 0x04c8, 0x04cc, 0x04d0, 0x04d4, 0x04d8, 0x04dc, 0x04e0, 0x04e4, 0x04e8, 0x04ec, 0x04f0, 0x04f4, 0x04f8, 0x04fc }; const uint16_t table_484036[641] = { 0x0282, 0x0282, 0x0284, 0x0284, 0x0286, 0x0286, 0x0288, 0x0288, 0x028a, 0x028a, 0x028c, 0x028c, 0x028e, 0x028e, 0x0290, 0x0290, 0x0292, 0x0292, 0x0294, 0x0294, 0x0296, 0x0296, 0x0298, 0x0298, 0x029a, 0x029a, 0x029c, 0x029c, 0x029e, 0x029e, 0x02a0, 0x02a0, 0x02a2, 0x02a2, 0x02a4, 0x02a4, 0x02a6, 0x02a6, 0x02a8, 0x02a8, 0x02aa, 0x02aa, 0x02ac, 0x02ac, 0x02ae, 0x02ae, 0x02b0, 0x02b0, 0x02b2, 0x02b2, 0x02b4, 0x02b4, 0x02b6, 0x02b6, 0x02b8, 0x02b8, 0x02ba, 0x02ba, 0x02bc, 0x02bc, 0x02be, 0x02be, 0x02c0, 0x02c0, 0x02c2, 0x02c2, 0x02c4, 0x02c4, 0x02c6, 0x02c6, 0x02c8, 0x02c8, 0x02ca, 0x02ca, 0x02cc, 0x02cc, 0x02ce, 0x02ce, 0x02d0, 0x02d0, 0x02d2, 0x02d2, 0x02d4, 0x02d4, 0x02d6, 0x02d6, 0x02d8, 0x02d8, 0x02da, 0x02da, 0x02dc, 0x02dc, 0x02de, 0x02de, 0x02e0, 0x02e0, 0x02e2, 0x02e2, 0x02e4, 0x02e4, 0x02e6, 0x02e6, 0x02e8, 0x02e8, 0x02ea, 0x02ea, 0x02ec, 0x02ec, 0x02ee, 0x02ee, 0x02f0, 0x02f0, 0x02f2, 0x02f2, 0x02f4, 0x02f4, 0x02f6, 0x02f6, 0x02f8, 0x02f8, 0x02fa, 0x02fa, 0x02fc, 0x02fc, 0x02fe, 0x02fe, 0x0300, 0x0300, 0x0302, 0x0302, 0x0304, 0x0304, 0x0306, 0x0306, 0x0308, 0x0308, 0x030a, 0x030a, 0x030c, 0x030c, 0x030e, 0x030e, 0x0310, 0x0310, 0x0312, 0x0312, 0x0314, 0x0314, 0x0316, 0x0316, 0x0318, 0x0318, 0x031a, 0x031a, 0x031c, 0x031c, 0x031e, 0x031e, 0x0320, 0x0320, 0x0322, 0x0322, 0x0324, 0x0324, 0x0326, 0x0326, 0x0328, 0x0328, 0x032a, 0x032a, 0x032c, 0x032c, 0x032e, 0x032e, 0x0330, 0x0330, 0x0332, 0x0332, 0x0334, 0x0334, 0x0336, 0x0336, 0x0338, 0x0338, 0x033a, 0x033a, 0x033c, 0x033c, 0x033e, 0x033e, 0x0340, 0x0340, 0x0342, 0x0342, 0x0344, 0x0344, 0x0346, 0x0346, 0x0348, 0x0348, 0x034a, 0x034a, 0x034c, 0x034c, 0x034e, 0x034e, 0x0350, 0x0350, 0x0352, 0x0352, 0x0354, 0x0354, 0x0356, 0x0356, 0x0358, 0x0358, 0x035a, 0x035a, 0x035c, 0x035c, 0x035e, 0x035e, 0x0360, 0x0360, 0x0362, 0x0362, 0x0364, 0x0364, 0x0366, 0x0366, 0x0368, 0x0368, 0x036a, 0x036a, 0x036c, 0x036c, 0x036e, 0x036e, 0x0370, 0x0370, 0x0372, 0x0372, 0x0374, 0x0374, 0x0376, 0x0376, 0x0378, 0x0378, 0x037a, 0x037a, 0x037c, 0x037c, 0x037e, 0x037e, 0x0380, 0x0380, 0x0382, 0x0382, 0x0384, 0x0384, 0x0386, 0x0386, 0x0388, 0x0388, 0x038a, 0x038a, 0x038c, 0x038c, 0x038e, 0x038e, 0x0390, 0x0390, 0x0392, 0x0392, 0x0394, 0x0394, 0x0396, 0x0396, 0x0398, 0x0398, 0x039a, 0x039a, 0x039c, 0x039c, 0x039e, 0x039e, 0x03a0, 0x03a0, 0x03a2, 0x03a2, 0x03a4, 0x03a4, 0x03a6, 0x03a6, 0x03a8, 0x03a8, 0x03aa, 0x03aa, 0x03ac, 0x03ac, 0x03ae, 0x03ae, 0x03b0, 0x03b0, 0x03b2, 0x03b2, 0x03b4, 0x03b4, 0x03b6, 0x03b6, 0x03b8, 0x03b8, 0x03ba, 0x03ba, 0x03bc, 0x03bc, 0x03be, 0x03be, 0x03c0, 0x03c0, 0x03c2, 0x03c2, 0x03c4, 0x03c4, 0x03c6, 0x03c6, 0x03c8, 0x03c8, 0x03ca, 0x03ca, 0x03cc, 0x03cc, 0x03ce, 0x03ce, 0x03d0, 0x03d0, 0x03d2, 0x03d2, 0x03d4, 0x03d4, 0x03d6, 0x03d6, 0x03d8, 0x03d8, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03de, 0x03de, 0x03e0, 0x03e0, 0x03e2, 0x03e2, 0x03e4, 0x03e4, 0x03e6, 0x03e6, 0x03e8, 0x03e8, 0x03ea, 0x03ea, 0x03ec, 0x03ec, 0x03ee, 0x03ee, 0x03f0, 0x03f0, 0x03f2, 0x03f2, 0x03f4, 0x03f4, 0x03f6, 0x03f6, 0x03f8, 0x03f8, 0x03fa, 0x03fa, 0x03fc, 0x03fc, 0x03fe, 0x03fe, 0x0400, 0x0400, 0x0402, 0x0402, 0x0404, 0x0404, 0x0406, 0x0406, 0x0408, 0x0408, 0x040a, 0x040a, 0x040c, 0x040c, 0x040e, 0x040e, 0x0410, 0x0410, 0x0412, 0x0412, 0x0414, 0x0414, 0x0416, 0x0416, 0x0418, 0x0418, 0x041a, 0x041a, 0x041c, 0x041c, 0x041e, 0x041e, 0x0420, 0x0420, 0x0422, 0x0422, 0x0424, 0x0424, 0x0426, 0x0426, 0x0428, 0x0428, 0x042a, 0x042a, 0x042c, 0x042c, 0x042e, 0x042e, 0x0430, 0x0430, 0x0432, 0x0432, 0x0434, 0x0434, 0x0436, 0x0436, 0x0438, 0x0438, 0x043a, 0x043a, 0x043c, 0x043c, 0x043e, 0x043e, 0x0440, 0x0440, 0x0442, 0x0442, 0x0444, 0x0444, 0x0446, 0x0446, 0x0448, 0x0448, 0x044a, 0x044a, 0x044c, 0x044c, 0x044e, 0x044e, 0x0450, 0x0450, 0x0452, 0x0452, 0x0454, 0x0454, 0x0456, 0x0456, 0x0458, 0x0458, 0x045a, 0x045a, 0x045c, 0x045c, 0x045e, 0x045e, 0x0460, 0x0460, 0x0462, 0x0462, 0x0464, 0x0464, 0x0466, 0x0466, 0x0468, 0x0468, 0x046a, 0x046a, 0x046c, 0x046c, 0x046e, 0x046e, 0x0470, 0x0470, 0x0472, 0x0472, 0x0474, 0x0474, 0x0476, 0x0476, 0x0478, 0x0478, 0x047a, 0x047a, 0x047c, 0x047c, 0x047e, 0x047e, 0x0480, 0x0480, 0x0482, 0x0482, 0x0484, 0x0484, 0x0486, 0x0486, 0x0488, 0x0488, 0x048a, 0x048a, 0x048c, 0x048c, 0x048e, 0x048e, 0x0490, 0x0490, 0x0492, 0x0492, 0x0494, 0x0494, 0x0496, 0x0496, 0x0498, 0x0498, 0x049a, 0x049a, 0x049c, 0x049c, 0x049e, 0x049e, 0x04a0, 0x04a0, 0x04a2, 0x04a2, 0x04a4, 0x04a4, 0x04a6, 0x04a6, 0x04a8, 0x04a8, 0x04aa, 0x04aa, 0x04ac, 0x04ac, 0x04ae, 0x04ae, 0x04b0, 0x04b0, 0x04b2, 0x04b2, 0x04b4, 0x04b4, 0x04b6, 0x04b6, 0x04b8, 0x04b8, 0x04ba, 0x04ba, 0x04bc, 0x04bc, 0x04be, 0x04be, 0x04c0, 0x04c0, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8, 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04ce, 0x04d0, 0x04d0, 0x04d2, 0x04d2, 0x04d4, 0x04d4, 0x04d6, 0x04d6, 0x04d8, 0x04d8, 0x04da, 0x04da, 0x04dc, 0x04dc, 0x04de, 0x04de, 0x04e0, 0x04e0, 0x04e2, 0x04e2, 0x04e4, 0x04e4, 0x04e6, 0x04e6, 0x04e8, 0x04e8, 0x04ea, 0x04ea, 0x04ec, 0x04ec, 0x04ee, 0x04ee, 0x04f0, 0x04f0, 0x04f2, 0x04f2, 0x04f4, 0x04f4, 0x04f6, 0x04f6, 0x04f8, 0x04f8, 0x04fa, 0x04fa, 0x04fc, 0x04fc, 0x04fe, 0x04fe, 0x0500, 0x0500, 0x0000 }; const uint16_t table_484538[322] = { 0x0000, 0x0002, 0x0004, 0x0006, 0x0008, 0x000a, 0x000c, 0x000e, 0x0010, 0x0012, 0x0014, 0x0016, 0x0018, 0x001a, 0x001c, 0x001e, 0x0020, 0x0022, 0x0024, 0x0026, 0x0028, 0x002a, 0x002c, 0x002e, 0x0030, 0x0032, 0x0034, 0x0036, 0x0038, 0x003a, 0x003c, 0x003e, 0x0040, 0x0042, 0x0044, 0x0046, 0x0048, 0x004a, 0x004c, 0x004e, 0x0050, 0x0052, 0x0054, 0x0056, 0x0058, 0x005a, 0x005c, 0x005e, 0x0060, 0x0062, 0x0064, 0x0066, 0x0068, 0x006a, 0x006c, 0x006e, 0x0070, 0x0072, 0x0074, 0x0076, 0x0078, 0x007a, 0x007c, 0x007e, 0x0080, 0x0082, 0x0084, 0x0086, 0x0088, 0x008a, 0x008c, 0x008e, 0x0090, 0x0092, 0x0094, 0x0096, 0x0098, 0x009a, 0x009c, 0x009e, 0x00a0, 0x00a2, 0x00a4, 0x00a6, 0x00a8, 0x00aa, 0x00ac, 0x00ae, 0x00b0, 0x00b2, 0x00b4, 0x00b6, 0x00b8, 0x00ba, 0x00bc, 0x00be, 0x00c0, 0x00c2, 0x00c4, 0x00c6, 0x00c8, 0x00ca, 0x00cc, 0x00ce, 0x00d0, 0x00d2, 0x00d4, 0x00d6, 0x00d8, 0x00da, 0x00dc, 0x00de, 0x00e0, 0x00e2, 0x00e4, 0x00e6, 0x00e8, 0x00ea, 0x00ec, 0x00ee, 0x00f0, 0x00f2, 0x00f4, 0x00f6, 0x00f8, 0x00fa, 0x00fc, 0x00fe, 0x0100, 0x0102, 0x0104, 0x0106, 0x0108, 0x010a, 0x010c, 0x010e, 0x0110, 0x0112, 0x0114, 0x0116, 0x0118, 0x011a, 0x011c, 0x011e, 0x0120, 0x0122, 0x0124, 0x0126, 0x0128, 0x012a, 0x012c, 0x012e, 0x0130, 0x0132, 0x0134, 0x0136, 0x0138, 0x013a, 0x013c, 0x013e, 0x0140, 0x0142, 0x0144, 0x0146, 0x0148, 0x014a, 0x014c, 0x014e, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, 0x015a, 0x015c, 0x015e, 0x0160, 0x0162, 0x0164, 0x0166, 0x0168, 0x016a, 0x016c, 0x016e, 0x0170, 0x0172, 0x0174, 0x0176, 0x0178, 0x017a, 0x017c, 0x017e, 0x0180, 0x0182, 0x0184, 0x0186, 0x0188, 0x018a, 0x018c, 0x018e, 0x0190, 0x0192, 0x0194, 0x0196, 0x0198, 0x019a, 0x019c, 0x019e, 0x01a0, 0x01a2, 0x01a4, 0x01a6, 0x01a8, 0x01aa, 0x01ac, 0x01ae, 0x01b0, 0x01b2, 0x01b4, 0x01b6, 0x01b8, 0x01ba, 0x01bc, 0x01be, 0x01c0, 0x01c2, 0x01c4, 0x01c6, 0x01c8, 0x01ca, 0x01cc, 0x01ce, 0x01d0, 0x01d2, 0x01d4, 0x01d6, 0x01d8, 0x01da, 0x01dc, 0x01de, 0x01e0, 0x01e2, 0x01e4, 0x01e6, 0x01e8, 0x01ea, 0x01ec, 0x01ee, 0x01f0, 0x01f2, 0x01f4, 0x01f6, 0x01f8, 0x01fa, 0x01fc, 0x01fe, 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020a, 0x020c, 0x020e, 0x0210, 0x0212, 0x0214, 0x0216, 0x0218, 0x021a, 0x021c, 0x021e, 0x0220, 0x0222, 0x0224, 0x0226, 0x0228, 0x022a, 0x022c, 0x022e, 0x0230, 0x0232, 0x0234, 0x0236, 0x0238, 0x023a, 0x023c, 0x023e, 0x0240, 0x0242, 0x0244, 0x0246, 0x0248, 0x024a, 0x024c, 0x024e, 0x0250, 0x0252, 0x0254, 0x0256, 0x0258, 0x025a, 0x025c, 0x025e, 0x0260, 0x0262, 0x0264, 0x0266, 0x0268, 0x026a, 0x026c, 0x026e, 0x0270, 0x0272, 0x0274, 0x0276, 0x0278, 0x027a, 0x027c, 0x027e, 0x0280, 0x0000 }; struct { uint16_t tab1[642]; /* 0x4847bc, from 0x483630 */ uint16_t tab2[641]; /* 0x484cc0, from 0x483b34 */ uint16_t tab3[641]; /* 0x4851c2, from 0x484036 */ uint16_t tab4[322]; /* 0x4856c4, from 0x484538 */ } gtables; /* 0x4847bc */ void fcn_00455040(char *arg1, char *arg2) { memcpy(0x4847bc, 0x483630, 4492); ecx = 0; /* after a rep movsd */ edi = arg1; esi = arg2; edx = 0; L1: fcn_004551bb(); /* this function changes bx, ecx for return value */ if (bh == 0) { *edi = bl; edi++; goto L1; } eax = ecx; old_ecx = ecx;/* push ecx */ eax <<= 3; ecx &= 7; eax = *(int32_t*)(esi + eax); eax >>= cl; ebp = eax & 0xff; cl = table_00483530[ebp]; dh = table_00483430[ebp]; eax >>= cl; dl = al; dl <<= 2; dx >>= 2; cl += 6; eax = ecx & 0xff; /* pop ecx */ ecx = old_ecx + eax; if (dx == 0) return; ebp = ecx; /* backup ecx */ ebx -= 0xfd; old_esi = esi; /* push esi */ esi = edi - 1 - edx; ecx -= ebx; memcpy(edi, esi, ecx); /* using rep movsb */ edi += ecx; /* by movsb */ esi = old_esi; /* pop esi */ ecx = ebp; /* restore ecx */ goto L1; } /* unknown ABI */ /* argument: esi, ecx changes ebx, ecx doesn't change edi */ int16_t fcn_004551bb(uint16_t *esi, uint32_t *ecx) { ebx = 0x500; L1: /* 0x484cc0-0x4847bc = 0x504 */ /* initial value: [0x483630+0x504+0x500] = 0x4fc */ bx = gtables.tab2[ebx / 2]; if (bx >= 0x502) goto L2; #if BT bool cf = bittest(esi, ecx); /* bt dword [esi], ecx */ #else uint16_t cf = esi[ecx / 16] & (1 << (ecx % 16)); #endif (*ecx)++; if (!cf) goto L1; bx += 2; goto L1; L2: ebx -= 0x502; /* push ebx, ecx, edi */ fcn_00455109(); /* pop edi, ecx, ebx */ bx >>= 1; } /* unknown ABI */ /* argument: ebx, changes eax, ebx, ecx, edi */ void fcn_00455109() { if (gtables.tab1[640] == 0x8000) { /* push ebx */ fcn_004550cc(); /* pop ebx */ } fcn_0045511b(); } /* unknown ABI */ /* argument: ebx, changes eax,edi,ecx,ebx */ void fcn_0045511b() { /* actually the high 16 bits of ebx is 0 */ bx = gtables.tab4[ebx / 2]; L1: gtables.tab1[ebx / 2]++; ax = gtables.tab1[ebx / 2]; if (ax > gtables.tab1[ebx / 2 + 1]) { uint16_t *ptr = >ables.tab1[ebx / 2 + 1]; ecx = 0x282; ax--; while (ecx-- && *ptr == ax) ptr ++; edi = (ptr - >ables.tab1[2]) * sizeof(uint16_t); ax++; /* note that edi may equal to ebx, there's some trap to convert the swap to mov */ #ifdef XCHG swap(gtables.tab1[edi / 2], ax); gtables.tab1[ebx / 2] = ax; #else if (edi != ebx) { gtables.tab1[ebx / 2] = gtables.tab1[edi / 2]; gtables.tab1[edi / 2] = ax; } #endif ax = gtables.tab2[ebx / 2]; cx = gtables.tab2[edi / 2]; if (cx < 0x502) { gtables.tab3[ecx / 2] = bx; gtables.tab3[ecx / 2 + 1] = bx; } else { gtables.tab4[(ecx - 0x502) / 2] = bx; } swap(ax, cx); if (cx < 0x502) { gtables.tab3[ecx / 2] = di; gtables.tab3[ecx / 2 + 1] = di; } else { gtables.tab4[(ecx - 0x502) / 2] = di; } gtables.tab2[ebx / 2] = ax; gtables.tab2[edi / 2] = cx; bx = di; } bx = gtables.tab3[ebx / 2]; if (bx != 0) goto L1; return; } /* unknown ABI */ /* no argument, changes ebx, ecx, edx, ebp */ void fcn_004550cc() { edx = 0x141; ecx = 0; ebp = 0; do { cx = *(int16_t*)(ebp + 0x4856c4); /* 0x4856c4 + 0x141 * 2 = 0x485946 */ if (*(int16_t*)(ecx + 0x4847bc) & 1) { ebx = ebp; fcn_0045511b(); } ebp += 2; edx--; } while(edx); ebx = 0; do { *(uint16_t*)(ebx + 0x4847bc) >>= 1; ebx += 2; } while (ebx < 0x502); return; }