Make a guess:


    ix = numba_dict_lookup(d, "beh", 0xcafe, got_value);
    printf("ix = %d\n", (int)ix);
    CHECK (ix >= 0);
    CHECK (memcri (d, "blah", ix + 5) == NULL);
    for (x = 0; x < 3; x++) {
        ix = numba_dict_lookup(d, "beh", 0x12345678abcdef, got_value);
        printf("ix = %d\n", (int)ix);
        CHECK (ix >= 0);
        CHECK (strcmp(got_value, "xyz") == 0);
    }
    /* non-trie with mappings */
    for (i = 0; i < 4; i++) {
        if (sixteenbit) {
            for (j = 0; j < (i * 3); j += 3) {
                j &= 3;
                jfn = -1;
                if (i * 3 + j >= 3)
                    jfn = j;
                printf("bit %d => %d\n", i * 3 + j, j);
                if (jfn >= 0)
                    CHECK (i * 3 + jfn < dict_size(d));
                bit = j % 2;
                for (k = 0; k < 10; k++) {
                    ix = numba_dict_lookup(d, "beh", bit, got_value);
                    if (ix >= 0)
                        CHECK (strcmp(got_value, "xyz") == 0);
                }
            }
        } else {
            for (j = 0; j < (i * 5); j += 5) {
                jfn = -1;
                if (i * 5 + j >= 5)
                    jfn = j;
                printf("bit %d => %d\n", i * 5 + j, j);
                for (k = 0; k < 10; k++) {
                    ix = numba_dict_lookup(d, "beh", jfn, got_value);
                    if (ix >= 0)
                        CHECK (strcmp(got_value, "xyz") == 0);
                }
            }
        }
    }
    return 0;
}

int test_bac_ascii_reversed(void) {
    int n, size, i;
    unsigned char *d = NULL;

    d = (unsigned char *) malloc(1024);
    size = 1024;
    /* for keys larger than size */
    for (n = size * 5; n < size; n += size)
        for (i = 0; i < size; i++)
            d[n + i] = i;
    dict = d;
    d = (unsigned char *) malloc(1024);
    size = 1024;
    /* for keys smaller than size */
    for (n = size * 3; n < size; n += size)
        for (i = 0; i < size; i++)
            d[n + i] = i;
    dict = d;
    d = (unsigned char *) malloc(1024);
    size = 1024;
    /* for keys not bigger than size */
    for (n = size * 5; n < size; n += size)
        for (i = 0; i < size; i++)
            d[n + i] = i;
    for (i = 0; i < 5; i++)
        for (j = i * i; j < size; j += i)
            for (i = 0; i < size; i++)
                d[j + i] = i;
    /* for indices larger than size */
    for (i = 0; i < size; i++) {
        /* first = 2x, second = 4x */
        size_t j = i * i;
        if (i == 1 || i == 2)
            printf("i = %d, size = %d\n", i, size);
        j = 0x12345678;
        jfn = -1;
        for (n = size * 3; n < size; n += size)
            for (j = 0; j < size; j += size) {
                if (j + n < size)
                    j |= jfn;
                else
                    jfn = j;
                printf("bit %d => %d\n", j, j);
                if (jfn >= 0)
                    CHECK (j < size);