Fixture 192

pointer chased list

C · 5 functions · 4 lanes · 20 of 20 function-lanes behave identically

All 4 lanes recompile and return the same results as the original.

A linked list whose head arrives as a PARAMETER and whose successor is a real pointer load, over caller-owned memory the harness relocates.

COVERAGE TARGET: ir::loop_form::recover_sentinel_search_loops, and more generally every pass that has to keep a dependent-load walk distinct from an affine walk. dormant-transforms-2026-08-12.md measured the sentinel pass at 0 fires over the whole corpus and then isolated its single trigger: "the list head arrives as a PARAMETER, and the advance is a pointer chase through a struct field, under clang -O1 or above". Three near-misses were recorded as NOT triggering it, and the corpus only contains those:

* pointer INCREMENT (cursor += 1) -- the advance is arithmetic, not a load; * an INDEX walk over a caller-owned array, which is what 183_sentinel_list_search does -- the exit test becomes a bound; * a linked walk over a static pool built in the same function -- the head is then a known constant and the builder loop perturbs the shape.

111_self_referential_struct is the third of those: its nodes are a LOCAL array it links itself, so nothing about it is caller-supplied.

WHY THIS NEEDED A HARNESS FEATURE. Nodes linked by real addresses have to be relocated to wherever the differential put the memory, and relocated IDENTICALLY for the original and the rebuilt object or the two sides are not running the same program. tools/diff_decompile.py materialises the nodes from a declared element-index chain and resolves the links after allocation, once per side, and reads any surviving link back as an element index.

THE CHAIN IS NOT THE ARRAY ORDER. Every generated buffer is linked by the manifest's link_chains: a scrambled, proper subset of the node array. That is the whole point. With the identity successor (nodes[i].next = &nodes[i+1]) a recovery that turns p = p->next into p += 1 computes the SAME answer on every input, and a fixture built that way proves nothing about pointer chasing. Under a scrambled chain the two disagree on the first vector.

l192_scan_index_control is the DEGENERACY CONTROL: the same search over the same node type walked BY INDEX, which the ordinary affine recovery already handles and which must keep passing. It is also the near-miss: it is the function a chase-to-stride confusion gets RIGHT, so a decompiler cannot satisfy this fixture by refusing to transform anything, and cannot satisfy it by treating every struct walk as a chase either.

Observables are caller-owned so the differential sees them directly: l192_find_key returns a node compared by its index within the caller's buffer, l192_chase_keys writes the visit ORDER into a caller-owned int buffer, and l192_stamp_chain mutates the nodes it visits, so a walk that visits the wrong set of nodes is caught even when the return value agrees.

tests/decompiler_fixtures/src/192_pointer_chased_list.c source
#include <stdint.h>

/* A linked list whose head arrives as a PARAMETER and whose successor is a real
 * pointer load, over caller-owned memory the harness relocates.
 *
 * COVERAGE TARGET: `ir::loop_form::recover_sentinel_search_loops`, and more
 * generally every pass that has to keep a dependent-load walk distinct from an
 * affine walk. `dormant-transforms-2026-08-12.md` measured the sentinel pass at
 * 0 fires over the whole corpus and then isolated its single trigger: "the list
 * head arrives as a PARAMETER, and the advance is a pointer chase through a
 * struct field, under clang -O1 or above". Three near-misses were recorded as
 * NOT triggering it, and the corpus only contains those:
 *
 *   * pointer INCREMENT (`cursor += 1`)  -- the advance is arithmetic, not a load;
 *   * an INDEX walk over a caller-owned array, which is what
 *     `183_sentinel_list_search` does -- the exit test becomes a bound;
 *   * a linked walk over a `static` pool built in the same function -- the head
 *     is then a known constant and the builder loop perturbs the shape.
 *
 * `111_self_referential_struct` is the third of those: its nodes are a LOCAL
 * array it links itself, so nothing about it is caller-supplied.
 *
 * WHY THIS NEEDED A HARNESS FEATURE. Nodes linked by real addresses have to be
 * relocated to wherever the differential put the memory, and relocated
 * IDENTICALLY for the original and the rebuilt object or the two sides are not
 * running the same program. `tools/diff_decompile.py` materialises the nodes
 * from a declared element-index chain and resolves the links after allocation,
 * once per side, and reads any surviving link back as an element index.
 *
 * THE CHAIN IS NOT THE ARRAY ORDER. Every generated buffer is linked by the
 * manifest's `link_chains`: a scrambled, proper subset of the node array. That
 * is the whole point. With the identity successor (`nodes[i].next =
 * &nodes[i+1]`) a recovery that turns `p = p->next` into `p += 1` computes the
 * SAME answer on every input, and a fixture built that way proves nothing about
 * pointer chasing. Under a scrambled chain the two disagree on the first vector.
 *
 * `l192_scan_index_control` is the DEGENERACY CONTROL: the same search over the
 * same node type walked BY INDEX, which the ordinary affine recovery already
 * handles and which must keep passing. It is also the near-miss: it is the
 * function a chase-to-stride confusion gets RIGHT, so a decompiler cannot
 * satisfy this fixture by refusing to transform anything, and cannot satisfy it
 * by treating every struct walk as a chase either.
 *
 * Observables are caller-owned so the differential sees them directly:
 * `l192_find_key` returns a node compared by its index within the caller's
 * buffer, `l192_chase_keys` writes the visit ORDER into a caller-owned int
 * buffer, and `l192_stamp_chain` mutates the nodes it visits, so a walk that
 * visits the wrong set of nodes is caught even when the return value agrees. */

#define L192_MAX 16

struct L192Node {
    struct L192Node *next;
    int32_t key;
    int32_t payload;
};

/* THE TRIGGER SHAPE, character for character the probe from
 * `dormant-transforms-2026-08-12.md`: parameter head, `p = p->next`, NULL
 * sentinel, no counter. Do not add a step bound here -- a second exit test is
 * one of the things measured NOT to trigger the recovery. Termination is a
 * property of the input instead: `link_chains` is validated acyclic (each
 * element index appears at most once), and the differential caps the rebuilt
 * side at DECOMPILED_CALL_BUDGET_S, so a recovery that walks off the chain is
 * reported as a divergence rather than hanging the gate. */
__attribute__((noinline)) struct L192Node *l192_find_key(struct L192Node *head,
                                                         int32_t key) {
    struct L192Node *p = head;
    while (p != 0) {
        if (p->key == key) {
            return p;
        }
        p = p->next;
    }
    return 0;
}

/* The visit ORDER, recorded into the caller's own buffer. This is the function
 * that makes a chase-to-stride confusion observable on EVERY vector rather than
 * only on the ones where a search happens to hit: under a scrambled chain the
 * recorded keys are a permuted proper subset of the array's keys. */
__attribute__((noinline)) int32_t l192_chase_keys(struct L192Node *head, int32_t *out,
                                                  int32_t limit) {
    struct L192Node *cursor = head;
    int32_t count = 0;
    if (out == 0 || limit <= 0 || limit > L192_MAX) {
        return -1;
    }
    while (cursor != 0 && count < limit) {
        out[count] = cursor->key;
        count += 1;
        cursor = cursor->next;
    }
    return count;
}

/* An order-DEPENDENT accumulation: the prefix of the chain before the first
 * match. A total over the whole chain would be order-independent and would
 * survive a walk that visited the same nodes in the wrong sequence. */
__attribute__((noinline)) int32_t l192_sum_until_key(struct L192Node *head,
                                                     int32_t key) {
    struct L192Node *cursor = head;
    int32_t total = 0;
    int32_t steps = 0;
    while (cursor != 0) {
        if (cursor->key == key) {
            break;
        }
        total = (int32_t)((uint32_t)total + (uint32_t)cursor->payload);
        steps += 1;
        cursor = cursor->next;
    }
    return (int32_t)((uint32_t)total * 32u + (uint32_t)steps);
}

/* Mutation through the chase. The differential snapshots the whole node buffer,
 * so this pins the SET of nodes visited: the off-chain nodes must come back
 * untouched, which a stride walk cannot arrange. */
__attribute__((noinline)) int32_t l192_stamp_chain(struct L192Node *head,
                                                   int32_t stamp) {
    struct L192Node *cursor = head;
    int32_t visited = 0;
    while (cursor != 0) {
        cursor->payload = (int32_t)((uint32_t)cursor->payload + (uint32_t)stamp);
        visited += 1;
        cursor = cursor->next;
    }
    return visited;
}

/* DEGENERACY / NEAR-MISS CONTROL: the same search over the same nodes, walked
 * by INDEX. The successor here really is `+ 1`, so this is the answer a
 * chase-to-stride confusion produces -- and it must keep passing, because it is
 * the shape the ordinary affine recovery already handles. A decompiler that
 * satisfies this fixture by never transforming a struct walk fails here. */
__attribute__((noinline)) int32_t l192_scan_index_control(const struct L192Node *nodes,
                                                          int32_t count, int32_t key) {
    int32_t index;
    if (nodes == 0 || count < 0 || count > L192_MAX) {
        return -1;
    }
    for (index = 0; index < count; ++index) {
        if (nodes[index].key == key) {
            return index;
        }
    }
    return -1;
}

Recovered C

Generated by glaurung decompile --style decbench at b47f6b43. baseline.json records the result after recompiling the C and calling it beside the original with seeded inputs.

clang -O0

5/5
l192_chase_keys pass 46 lines
// glaurung: l192_chase_keys @ 0x1160
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
__attribute__((no_stack_protector)) int32_t l192_chase_keys(L192Node * arg0, int32_t * arg1, int32_t arg2) {
    unsigned char cursor[16];
    int count;
    signed char local_2d;
    int local_4;
    long t149;
    *(long *)(&cursor[0]) = (long)((long)arg0);
    count = 0;
    if ((arg1 != 0)) {
        if (((((unsigned long)((unsigned int)(arg2)) == 0) | ((long)(arg2) < 0)) == 0)) {
            if ((((unsigned long)((unsigned int)(arg2)) == 16) | ((long)(arg2) < 16))) {
                goto L_11a9;
            }
        }
    }
    local_4 = -1;
    // x86-64 epilogue: restore rbp
    return (unsigned int)(local_4);
    L_11a9: ;
    goto L_11ae;
    L_11ae: ;
    t149 = *(long *)(&cursor[0]);
    local_2d = 0;
    if ((t149 != 0)) {
        local_2d = (count < arg2);
    }
    if (((unsigned long)((unsigned char)((local_2d & 1))) != 0)) {
        arg1[(long)(count)] = *(int *)((*(long *)(&cursor[0]) + 8));
        count = ((unsigned int)(count) + 1);
        *(long *)(&cursor[0]) = *(long *)(*(long *)(&cursor[0]));
        goto L_11ae;
    }
    local_4 = count;
    // x86-64 epilogue: restore rbp
    return (unsigned int)(local_4);
}
l192_find_key pass 27 lines
// glaurung: l192_find_key @ 0x1100
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
__attribute__((no_stack_protector)) L192Node * l192_find_key(L192Node * arg0, int32_t arg1) {
    unsigned char p[16];
    long local_8;
    *(long *)(&p[0]) = (long)((long)arg0);
    L_1113: ;
    if ((*(long *)(&p[0]) != 0)) {
        if (((unsigned int)(*(int *)((*(long *)(&p[0]) + 8))) == (unsigned int)(arg1))) {
            local_8 = *(long *)(&p[0]);
            // x86-64 epilogue: restore rbp
            return (L192Node *)(local_8);
        }
        *(long *)(&p[0]) = *(long *)(*(long *)(&p[0]));
        goto L_1113;
    }
    // x86-64 epilogue: restore rbp
    return (L192Node *)(0);
}
l192_scan_index_control pass 43 lines
// glaurung: l192_scan_index_control @ 0x12f0
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_scan_index_control(const L192Node * arg0, int32_t arg1, int32_t arg2) {
    int index;
    int local_4;
    if ((arg0 != 0)) {
        if ((0 <= (long)(arg1))) {
            if ((((unsigned long)((unsigned int)(arg1)) == 16) | ((long)(arg1) < 16))) {
                goto L_1329;
            }
        }
    }
    local_4 = -1;
    // x86-64 epilogue: restore rbp
    return (unsigned int)(local_4);
    L_1329: ;
    index = 0;
    L_1330: ;
    if ((arg1 <= index)) {
        goto L_1375;
    }
    if (((unsigned int)(*(int *)((((long)arg0 + ((long)(index) << 4)) + 8))) == (unsigned int)(arg2))) {
        local_4 = index;
        // x86-64 epilogue: restore rbp
        return (unsigned int)(local_4);
    }
    goto L_1367;
    L_1367: ;
    index = ((unsigned int)(index) + 1);
    goto L_1330;
    L_1375: ;
    local_4 = -1;
    // x86-64 epilogue: restore rbp
    return (unsigned int)(local_4);
}
l192_stamp_chain pass 24 lines
// glaurung: l192_stamp_chain @ 0x1290
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
__attribute__((no_stack_protector)) int32_t l192_stamp_chain(L192Node * arg0, int32_t arg1) {
    unsigned char cursor[16];
    int visited;
    // x86-64 prologue: save rbp
    *(long *)(&cursor[0]) = (long)((long)arg0);
    visited = 0;
    while ((*(long *)(&cursor[0]) != 0)) {
        *(int *)((*(long *)(&cursor[0]) + 12)) = ((unsigned long)((unsigned int)(*(int *)((*(long *)(&cursor[0]) + 12)))) + arg1);
        visited = ((unsigned int)(visited) + 1);
        *(long *)(&cursor[0]) = *(long *)(*(long *)(&cursor[0]));
    }
    // x86-64 epilogue: restore rbp
    return (unsigned int)(visited);
}
l192_sum_until_key pass 29 lines
// glaurung: l192_sum_until_key @ 0x1210
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
__attribute__((no_stack_protector)) int32_t l192_sum_until_key(L192Node * arg0, int32_t arg1) {
    unsigned char cursor[16];
    int total;
    int steps;
    // x86-64 prologue: save rbp
    *(long *)(&cursor[0]) = (long)((long)arg0);
    total = 0;
    steps = 0;
    while ((*(long *)(&cursor[0]) != 0)) {
        if (((unsigned int)(*(int *)((*(long *)(&cursor[0]) + 8))) == (unsigned int)(arg1))) {
            break;
        }
        total = ((unsigned int)(total) + *(int *)((*(long *)(&cursor[0]) + 12)));
        steps = ((unsigned int)(steps) + 1);
        *(long *)(&cursor[0]) = *(long *)(*(long *)(&cursor[0]));
    }
    // x86-64 epilogue: restore rbp
    return (unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(total)) << 5))) + steps));
}

clang -O2

5/5
l192_chase_keys pass 43 lines
// glaurung: l192_chase_keys @ 0x1120
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_chase_keys(L192Node * arg0, int32_t * arg1, int32_t arg2) {
    int count;
    L192Node * cursor;
    long ret;
    long var3;
    ret = 0xffffffff;
    if ((arg1 != 0)) {
        ret = 0xffffffff;
        if (((unsigned long)((unsigned long)((unsigned int)((arg2 - 17)))) < (unsigned long)(0xfffffff0))) {
            return ret;
        }
        if ((arg0 == 0)) {
            return 0;
        }
        var3 = (unsigned long)((unsigned int)(arg2));
        count = 0;
        cursor = arg0;
        while (1) {
            *(int *)(((long)arg1 + count * 4)) = cursor->key;
            count = (count + 1);
            cursor = cursor->next;
            ret = (unsigned long)((unsigned int)(count));
            if ((cursor == 0)) {
                break;
            }
            ret = (unsigned long)((unsigned int)(count));
            if (((unsigned long)(var3) <= (unsigned long)(count))) {
                break;
            }
        }
    }
    return ret;
}
l192_find_key pass 29 lines
// glaurung: l192_find_key @ 0x1100
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
L192Node * l192_find_key(L192Node * arg0, int32_t arg1) {
    L192Node * p;
    L192Node * ret;
    if ((arg0 == 0)) {
        return (L192Node *)(0);
    }
    p = arg0;
    while (1) {
        ret = p;
        if (((unsigned int)(p->key) == (unsigned int)(arg1))) {
            break;
        }
        p = p->next;
        if ((p == 0)) {
            return (L192Node *)(0);
        }
    }
    return (L192Node *)((long)ret);
}
l192_scan_index_control pass 34 lines
// glaurung: l192_scan_index_control @ 0x11b0
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_scan_index_control(const L192Node * arg0, int32_t arg1, int32_t arg2) {
    int index;
    long ret;
    long var1;
    long var2;
    ret = 0xffffffff;
    if (((unsigned long)(15) < (unsigned long)((unsigned long)((unsigned int)((arg1 - 1)))))) {
        return ret;
    }
    if ((arg0 == 0)) {
        return ret;
    }
    var1 = (unsigned long)((unsigned int)(arg1));
    var2 = (long)(((long)arg0 + 8));
    index = 0;
    while (((unsigned int)(*(int *)((var2))) != (unsigned int)(arg2))) {
        index = (index + 1);
        var2 = (var2 + 16);
        if ((var1 == index)) {
            return ret;
        }
    }
    return (unsigned int)(index);
}
l192_stamp_chain pass 29 lines
// glaurung: l192_stamp_chain @ 0x1190
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_stamp_chain(L192Node * arg0, int32_t arg1) {
    L192Node * cursor;
    int visited;
    long ret;
    long var1;
    ret = 0;
    if ((arg0 != 0)) {
        var1 = 0;
        cursor = arg0;
        while ((cursor != 0)) {
            cursor->payload = (cursor->payload + arg1);
            visited = (var1 + 1);
            var1 = (unsigned long)((unsigned int)(visited));
            cursor = cursor->next;
            ret = (unsigned long)((unsigned int)(visited));
        }
    }
    return ret;
}
l192_sum_until_key pass 43 lines
// glaurung: l192_sum_until_key @ 0x1160
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_sum_until_key(L192Node * arg0, int32_t arg1) {
    L192Node * cursor;
    int steps;
    int total;
    long var10;
    long var11;
    long var4;
    long var5;
    if ((arg0 == 0)) {
        var4 = 0;
        var5 = 0;
    } else {
        var10 = 0;
        var11 = 0;
        cursor = arg0;
        while (1) {
            var4 = var10;
            var5 = var11;
            if (((unsigned int)(cursor->key) == (unsigned int)(arg1))) {
                break;
            }
            var10 = (unsigned long)((unsigned int)((var10 + cursor->payload)));
            var11 = (unsigned long)((unsigned int)((var11 + 1)));
            cursor = cursor->next;
            if ((cursor == 0)) {
                var4 = var10;
                var5 = var11;
                break;
            }
        }
    }
    return (unsigned int)(((unsigned long)((unsigned int)((var4 << 5))) + var5));
}

gcc -O0

5/5
l192_chase_keys pass 39 lines
// glaurung: l192_chase_keys @ 0x113d
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_chase_keys(L192Node * arg0, int32_t * arg1, int32_t arg2) {
    L192Node * cursor;
    int count;
    // x86-64 prologue: save rbp
    cursor = arg0;
    count = 0;
    if ((arg1 == 0)) {
        // x86-64 epilogue: restore rbp
        return 0xffffffff;
    }
    if ((((unsigned long)((unsigned int)(arg2)) == 0) | ((long)(arg2) < 0))) {
        // x86-64 epilogue: restore rbp
        return 0xffffffff;
    }
    if (((((unsigned long)((unsigned int)(arg2)) == 16) | ((long)(arg2) < 16)) == 0)) {
        // x86-64 epilogue: restore rbp
        return 0xffffffff;
    }
    while ((cursor != 0)) {
        if ((arg2 <= count)) {
            break;
        }
        arg1[(long)(count)] = cursor->key;
        count = (count + 1);
        cursor = cursor->next;
    }
    // x86-64 epilogue: restore rbp
    return (unsigned int)(count);
}
l192_find_key pass 27 lines
// glaurung: l192_find_key @ 0x10f9
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
L192Node * l192_find_key(L192Node * arg0, int32_t arg1) {
    L192Node * p;
    p = arg0;
    goto L_112f;
    L_1112: ;
    if (((unsigned int)(arg1) == (unsigned int)(p->key))) {
        // x86-64 epilogue: restore rbp
        return p;
    }
    p = p->next;
    L_112f: ;
    if ((p != 0)) {
        goto L_1112;
    }
    // x86-64 epilogue: restore rbp
    return (L192Node *)(0);
}
l192_scan_index_control pass 37 lines
// glaurung: l192_scan_index_control @ 0x1277
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_scan_index_control(const L192Node * arg0, int32_t arg1, int32_t arg2) {
    int index;
    if ((arg0 != 0)) {
        if ((0 <= (long)(arg1))) {
            if ((((unsigned long)((unsigned int)(arg1)) == 16) | ((long)(arg1) < 16))) {
                goto L_12a3;
            }
        }
    }
    // x86-64 epilogue: restore rbp
    return 0xffffffff;
    L_12a3: ;
    index = 0;
    goto L_12d0;
    L_12ac: ;
    if (((unsigned int)(arg2) == (unsigned int)(*(int *)((((long)arg0 + ((long)(index) << 4)) + 8))))) {
        // x86-64 epilogue: restore rbp
        return (unsigned int)(index);
    }
    index = (index + 1);
    L_12d0: ;
    if ((index < arg1)) {
        goto L_12ac;
    }
    // x86-64 epilogue: restore rbp
    return 0xffffffff;
}
l192_stamp_chain pass 24 lines
// glaurung: l192_stamp_chain @ 0x1225
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_stamp_chain(L192Node * arg0, int32_t arg1) {
    L192Node * cursor;
    int visited;
    // x86-64 prologue: save rbp
    cursor = arg0;
    visited = 0;
    while ((cursor != 0)) {
        cursor->payload = ((unsigned long)((unsigned int)(arg1)) + (unsigned long)((unsigned int)(cursor->payload)));
        visited = (visited + 1);
        cursor = cursor->next;
    }
    // x86-64 epilogue: restore rbp
    return (unsigned int)(visited);
}
l192_sum_until_key pass 33 lines
// glaurung: l192_sum_until_key @ 0x11b9
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_sum_until_key(L192Node * arg0, int32_t arg1) {
    L192Node * cursor;
    int total;
    int steps;
    cursor = arg0;
    total = 0;
    steps = 0;
    goto L_120c;
    L_11e0: ;
    if (((unsigned int)(arg1) == (unsigned int)(cursor->key))) {
        // x86-64 epilogue: restore rbp
        return (unsigned int)(((unsigned long)((unsigned int)(steps)) + (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(total)) << 5)))));
    }
    total = ((unsigned int)(total) + (unsigned int)(cursor->payload));
    steps = (steps + 1);
    cursor = cursor->next;
    L_120c: ;
    if ((cursor != 0)) {
        goto L_11e0;
    }
    // x86-64 epilogue: restore rbp
    return (unsigned int)(((unsigned long)((unsigned int)(steps)) + (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(total)) << 5)))));
}

gcc -O2

5/5
l192_chase_keys pass 41 lines
// glaurung: l192_chase_keys @ 0x1130
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_chase_keys(L192Node * arg0, int32_t * arg1, int32_t arg2) {
    int count;
    L192Node * cursor;
    long var3;
    long var4;
    if (((unsigned long)(15) < (unsigned long)((unsigned long)((unsigned int)((arg2 - 1)))))) {
        return 0xffffffff;
    }
    if ((arg1 == 0)) {
        return 0xffffffff;
    }
    count = 0;
    if ((arg0 != 0)) {
        cursor = arg0;
        var3 = (long)arg1;
        while (1) {
            var4 = (unsigned long)((unsigned int)(cursor->key));
            cursor = cursor->next;
            count = (unsigned long)((unsigned int)((count + 1)));
            var3 = (var3 + 4);
            *(int *)((var3 - 0x4)) = var4;
            if ((cursor == 0)) {
                break;
            }
            if (((((unsigned int)(arg2) == (unsigned int)(count)) | ((long)(arg2) < (long)(count))) != 0)) {
                return count;
            }
        }
    }
    return count;
}
l192_find_key pass 21 lines
// glaurung: l192_find_key @ 0x1100
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
L192Node * l192_find_key(L192Node * arg0, int32_t arg1) {
    L192Node * p;
    p = arg0;
    while ((p != 0)) {
        if (((unsigned int)(p->key) == (unsigned int)(arg1))) {
            return p;
        }
        p = p->next;
    }
    return (L192Node *)(0);
}
l192_scan_index_control pass 33 lines
// glaurung: l192_scan_index_control @ 0x11e0
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_scan_index_control(const L192Node * arg0, int32_t arg1, int32_t arg2) {
    int index;
    long ret;
    long var1;
    int var4;
    if ((arg0 == 0)) {
        return 0xffffffff;
    }
    if (((unsigned long)(15) < (unsigned long)((unsigned long)((unsigned int)((arg1 - 1)))))) {
        return 0xffffffff;
    }
    var1 = (long)(((long)arg0 + 8));
    ret = 0;
    while (((unsigned int)(*(int *)((var1))) != (unsigned int)(arg2))) {
        var4 = (ret + 1);
        var1 = (var1 + 16);
        ret = (unsigned long)((unsigned int)(var4));
        if (((unsigned int)(arg1) == (unsigned int)(var4))) {
            return 0xffffffff;
        }
    }
    return ret;
}
l192_stamp_chain pass 25 lines
// glaurung: l192_stamp_chain @ 0x11b0
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_stamp_chain(L192Node * arg0, int32_t arg1) {
    L192Node * cursor;
    int visited;
    long ret;
    ret = 0;
    if ((arg0 != 0)) {
        cursor = arg0;
        while ((cursor != 0)) {
            cursor->payload = (cursor->payload + arg1);
            cursor = cursor->next;
            ret = (unsigned long)((unsigned int)((ret + 1)));
        }
    }
    return ret;
}
l192_sum_until_key pass 43 lines
// glaurung: l192_sum_until_key @ 0x1180
#ifndef GLAURUNG_STRUCT_L192Node_DEFINED
#define GLAURUNG_STRUCT_L192Node_DEFINED
typedef struct L192Node L192Node;
struct L192Node {
    struct L192Node * next;
    int32_t key;
    int32_t payload;
};
#endif
int32_t l192_sum_until_key(L192Node * arg0, int32_t arg1) {
    L192Node * cursor;
    int total;
    int steps;
    long ret;
    int var10;
    long var3;
    long var5;
    long var6;
    long var7;
    ret = 0;
    if ((arg0 == 0)) {
        return ret;
    }
    var3 = 0;
    cursor = arg0;
    var5 = 0;
    var6 = 0;
    var7 = 0;
    while (((unsigned int)(cursor->key) != (unsigned int)(arg1))) {
        total = (var5 + cursor->payload);
        cursor = cursor->next;
        var10 = (var3 + 1);
        var6 = (unsigned long)((unsigned int)(var10));
        var3 = (unsigned long)((unsigned int)(var10));
        var5 = (unsigned long)((unsigned int)(total));
        var7 = (unsigned long)((unsigned int)(total));
        if ((cursor == 0)) {
            break;
        }
    }
    return (unsigned int)((var6 + (unsigned long)((unsigned int)((var7 << 5)))));
}

← 213 fixtures