/* It returns the first handler where insn & mask == pattern, or NULL if there is no match. The table is terminated by an empty mask (i.e. 0)  */
static AArch64DecodeFn* lookup_disas_fn(const AArch64DecodeTable *table, uint32_t insn)
/* It returns the first handler where insn & mask == pattern, or NULL if there is no match. The table is terminated by an empty mask (i.e. 0)  */
static AArch64DecodeFn* lookup_disas_fn(const AArch64DecodeTable *table, uint32_t insn)
{
    const AArch64DecodeTable *tptr = table;
    while (tptr->mask) {
        if ((insn & tptr->mask) == tptr->pattern) {
            return tptr->disas_fn;
        }
        tptr++;
    }
    return NULL;
}