public static void m68ki_build_opcode_table() {
        opcode_handler_struct ostruct;
        /*uint*/
        int table_length = 0;
        int i, j;
        //for(ostruct = m68k_opcode_handler_table;ostruct->opcode_handler != 0;ostruct++)
        //table_length++;
        table_length = m68k_opcode_handler_table.length;
        System.out.println(table_length);

        //qsort((void *)m68k_opcode_handler_table, table_length, sizeof(m68k_opcode_handler_table[0]), compare_nof_true_bits);
        Arrays.sort(m68k_opcode_handler_table);
        for (i = 0; i < 0x10000; i++) {
            /* default to illegal */
            m68k_instruction_jump_table[i] = m68000_illegal;
        }

        int ostruct_idx = 0;
        ostruct = m68k_opcode_handler_table[ostruct_idx];
        while (ostruct.mask != 0xff00) {
            for (i = 0; i < 0x10000; i++) {
                if ((i & ostruct.mask) == ostruct.match) {
                    m68k_instruction_jump_table[i] = ostruct.opcode_handler;
                }
            }
            ostruct_idx++;
            ostruct = m68k_opcode_handler_table[ostruct_idx];
        }
        while (ostruct.mask == 0xff00) {
            for (i = 0; i <= 0xff; i++) {
                m68k_instruction_jump_table[ostruct.match | i] = ostruct.opcode_handler;
            }
            ostruct_idx++;
            ostruct = m68k_opcode_handler_table[ostruct_idx];
        }
        while (ostruct.mask == 0xf1f8) {
            for (i = 0; i < 8; i++) {
                for (j = 0; j < 8; j++) {
                    m68k_instruction_jump_table[ostruct.match | (i << 9) | j] = ostruct.opcode_handler;
                }
            }
            ostruct_idx++;
            ostruct = m68k_opcode_handler_table[ostruct_idx];
        }
        while (ostruct.mask == 0xfff0) {
            for (i = 0; i <= 0x0f; i++) {
                m68k_instruction_jump_table[ostruct.match | i] = ostruct.opcode_handler;
            }
            ostruct_idx++;
            ostruct = m68k_opcode_handler_table[ostruct_idx];
        }
        while (ostruct.mask == 0xf1ff) {
            for (i = 0; i <= 0x07; i++) {
                m68k_instruction_jump_table[ostruct.match | (i << 9)] = ostruct.opcode_handler;
            }
            ostruct_idx++;
            ostruct = m68k_opcode_handler_table[ostruct_idx];
        }
        while (ostruct.mask == 0xfff8) {
            for (i = 0; i <= 0x07; i++) {
                m68k_instruction_jump_table[ostruct.match | i] = ostruct.opcode_handler;
            }
            ostruct_idx++;
            ostruct = m68k_opcode_handler_table[ostruct_idx];
        }
        while (ostruct.mask == 0xffff) {
            m68k_instruction_jump_table[ostruct.match] = ostruct.opcode_handler;
            ostruct_idx++;
            if (ostruct_idx >= table_length) {
                break;  //shadow : stop when you reach last opcode
            }
            ostruct = m68k_opcode_handler_table[ostruct_idx];
        }
    }