int decode(Buffer b) {
        int ptr = 0;
        DecodeAux t = decode_tree;
        int lok = b.look(t.tabn);

        if (lok >= 0) {
            ptr = t.tab[lok];
            b.adv(t.tabl[lok]);
            if (ptr <= 0) {
                return -ptr;
            }
        }
        do {
            switch (b.read1()) {
                case 0:
                    ptr = t.ptr0[ptr];
                    break;
                case 1:
                    ptr = t.ptr1[ptr];
                    break;
                case -1:
                default:
                    return (-1);
            }
        } while (ptr > 0);
        return (-ptr);
    }