LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: bank_length
uint32_t bank_length(uint8_t *src, size_t len) {
    if (len >= 6 && (amos_leek(src) == ID_AmSp || amos_leek(src) == ID_AmIc)) {
        int num_sprites = amos_deek(&src[4]);
        uint32_t pos = 6, w, h, d;
        while (num_sprites--) {
            if (pos + 10 > len) return 0;
             w = amos_deek(&src[pos+0]) * 2;
             h = amos_deek(&src[pos+2]);
             d = amos_deek(&src[pos+4]);
            pos += 10 +  w * h * d;
        }
        pos += 64; /* include palette */
        return pos > len ? 0 : pos;
    }
    else if (len >= 20 && amos_leek(src) == ID_AmBk) {
        uint32_t bank_len = (amos_leek(&src[8]) & 0x0FFFFFFF) + 20 - 8;
        return bank_len > len ? 0 : bank_len;
    }
    return 0;
}

// Assembly:
xorl %eax, %eax
cmpq $0x6, %rsi
jb 0x15a5
movl (%rdi), %ecx
bswapl %ecx
cmpl $0x416d5370, %ecx       # imm = 0x416D5370
je 0x14f7
cmpl $0x416d4963, %ecx       # imm = 0x416D4963
jne 0x1569
movzwl 0x4(%rdi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
pushq $0x6
popq %rdx
subl $0x1, %ecx
jb 0x155d
leal 0xa(%rdx), %r8d
cmpq %rsi, %r8
ja 0x15a5
movl %edx, %r9d
movzbl (%rdi,%r9), %r10d
movzbl 0x1(%rdi,%r9), %r9d
shll $0x9, %r10d
leal (%r10,%r9,2), %r9d
leal 0x2(%rdx), %r10d
movzwl (%rdi,%r10), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
imull %r9d, %r10d
addl $0x4, %edx
movzwl (%rdi,%rdx), %edx
rolw $0x8, %dx
movzwl %dx, %edx
imull %r10d, %edx
addl %edx, %r8d
movl %r8d, %edx
jmp 0x1505
addl $0x40, %edx
xorl %eax, %eax
cmpq %rsi, %rdx
cmovbel %edx, %eax
retq
cmpq $0x14, %rsi
jb 0x15a5
cmpl $0x416d426b, %ecx       # imm = 0x416D426B
jne 0x15a5
movzbl 0x8(%rdi), %eax
movzbl 0x9(%rdi), %ecx
shll $0x10, %ecx
movzbl 0xa(%rdi), %edx
shll $0x8, %edx
movzbl 0xb(%rdi), %edi
andl $0xf, %eax
shll $0x18, %eax
orl %ecx, %eax
orl %edi, %eax
leal (%rdx,%rax), %ecx
addl $0xc, %ecx
xorl %eax, %eax
cmpq %rsi, %rcx
cmovbel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: bank_number
uint32_t bank_number(uint8_t *src, size_t len) {
    if (len >= 6 && amos_leek(src) == ID_AmSp) {
        return 1; /* Sprites always bank 1 */
    }
    if (len >= 6 && amos_leek(src) == ID_AmIc) {
        return 2; /* Icons always bank 2 */
    }
    if (len >= 20 && amos_leek(src) == ID_AmBk) {
        return amos_deek(&src[4]);
    }
    return 0;
}

// Assembly:
xorl %eax, %eax
cmpq $0x6, %rsi
jb 0x15c9
movl (%rdi), %ecx
bswapl %ecx
cmpl $0x416d4963, %ecx       # imm = 0x416D4963
je 0x15c6
cmpl $0x416d5370, %ecx       # imm = 0x416D5370
jne 0x15ca
pushq $0x1
popq %rax
retq
pushq $0x2
popq %rax
retq
cmpq $0x14, %rsi
jb 0x15c9
cmpl $0x416d426b, %ecx       # imm = 0x416D426B
jne 0x15c9
movzwl 0x4(%rdi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: bank_type
char *bank_type(uint8_t *src, size_t len) {
    if (len >= 6 && amos_leek(src) == ID_AmSp) {
        return "Sprites";
    }
    if (len >= 6 && amos_leek(src) == ID_AmIc) {
        return "Icons";
    }
    if (len >= 20 && amos_leek(src) == ID_AmBk) {
        /* copy bank type, remove space padding */
        static char type[9];
        char *tp = &type[8];
        memcpy(type, &src[12], 8);
        do { *tp-- = 0; } while (*tp == ' ' && tp > &type[0]);
        return type;
    }
    return NULL;
}

// Assembly:
cmpq $0x6, %rsi
jb 0x1606
movl (%rdi), %ecx
bswapl %ecx
cmpl $0x416d4963, %ecx       # imm = 0x416D4963
je 0x1609
cmpl $0x416d5370, %ecx       # imm = 0x416D5370
jne 0x1611
leaq 0x1a10(%rip), %rax      # 0x3015
retq
xorl %eax, %eax
retq
leaq 0x1a0d(%rip), %rax      # 0x301d
retq
xorl %eax, %eax
cmpq $0x14, %rsi
jb 0x1610
cmpl $0x416d426b, %ecx       # imm = 0x416D426B
jne 0x1610
movq 0xc(%rdi), %rax
movq %rax, 0x3a9c(%rip)      # 0x50c8
leaq 0x3a9c(%rip), %rcx      # 0x50cf
leaq 0x3a8e(%rip), %rax      # 0x50c8
movb $0x0, 0x1(%rcx)
cmpq %rax, %rcx
jbe 0x1610
cmpb $0x20, (%rcx)
leaq -0x1(%rcx), %rcx
je 0x163a
jmp 0x1610
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: decode_tracker
void decode_tracker(char *fname, uint8_t *src, size_t len) {
    uint32_t mod_len = len - 20;
    char *outname = output_fname(fname, "tracker%02X.mod", bank_number(src, len));
    if (outname) {
        printf("%s: extracting tracker mod %s (%d bytes)\n", fname, outname, mod_len);
        write_file(outname, &src[20], mod_len);
        free(outname);
    }
    else {
        perror(fname);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x15a6
leaq 0x1086(%rip), %rsi      # 0x3104
movq %r15, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x1378
testq %rax, %rax
je 0x20d0
movq %rax, %r12
addl $-0x14, %ebx
leaq 0x1078(%rip), %rdi      # 0x3114
movq %r15, %rsi
movq %rax, %rdx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10c0
addq $0x14, %r14
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1317
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1120
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: amos_bank
void amos_bank(char *fname, uint8_t *src, size_t len) {
    /* get the "real", validated bank length */
    if (!(len = bank_length(src, len))) return;

    if (amos_leek(src) == ID_AmSp) {
        decode_sprites(fname, src, len, "sprite");
    }
    else if (amos_leek(src) == ID_AmIc) {
        decode_sprites(fname, src, len, "icon");
    }
    else if (amos_leek(src) == ID_AmBk) {
        if (!memcmp(&src[12], "Pac.Pic.", 8)) {
            decode_pacpic(fname, src, len);
        }
        else if (!memcmp(&src[12], "Samples ", 8)) {
            decode_samples(fname, src, len);
        }
        else if (!memcmp(&src[12], "Tracker ", 8)) {
            decode_tracker(fname, src, len);
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x14d7
testl %eax, %eax
je 0x216b
movl %eax, %edx
movl (%rbx), %eax
bswapl %eax
cmpl $0x416d426b, %eax       # imm = 0x416D426B
je 0x2139
cmpl $0x416d4963, %eax       # imm = 0x416D4963
je 0x2120
cmpl $0x416d5370, %eax       # imm = 0x416D5370
jne 0x216b
leaq 0x1020(%rip), %rcx      # 0x313e
jmp 0x2127
leaq 0x101e(%rip), %rcx      # 0x3145
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x164e
movabsq $0x2e6369502e636150, %rax # imm = 0x2E6369502E636150
cmpq %rax, 0xc(%rbx)
je 0x2173
leaq 0xc(%rbx), %rax
movabsq $0x2073656c706d6153, %rcx # imm = 0x2073656C706D6153
cmpq %rcx, (%rax)
je 0x2185
movabsq $0x2072656b63617254, %rcx # imm = 0x2072656B63617254
cmpq %rcx, (%rax)
je 0x2197
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1912
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1e70
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x205b
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: amos_banks
void amos_banks(char *fname, uint8_t *src, size_t len) {
    if (len < 6) {
        fprintf(stderr, "%s: file too short to be AMOS banks\n", fname);
    }
    else {
        uint32_t num_banks = amos_deek(&src[4]), bank_pos = 6;
        while (num_banks--) {
            uint32_t bank_len = bank_length(&src[bank_pos], len - bank_pos);
            uint32_t bank_num = bank_number(&src[bank_pos], bank_len);
            char *type = bank_type(&src[bank_pos], bank_len), *outname;
            if (bank_num > 0) {
                if ((outname = output_fname(fname, "bank%02X.abk", bank_num))) {
                    printf("%s: extracting bank %d (%s) as %s (%d bytes)\n",
                           fname, bank_num, type, outname, bank_len);
                    write_file(outname, &src[bank_pos], bank_len);
                    amos_bank(outname, &src[bank_pos], bank_len);
                    free(outname);
                }
                else {
                    perror(fname);
                }
            }
            bank_pos += bank_len;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %rdx, 0x10(%rsp)
cmpq $0x5, %rdx
jbe 0x22b4
movzwl 0x4(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %ebx
pushq $0x6
popq %rax
movq %rsi, 0x8(%rsp)
subl $0x1, %ebx
jb 0x22a5
movl %eax, 0x4(%rsp)
movl %eax, %eax
leaq (%rsi,%rax), %r13
movq 0x10(%rsp), %rsi
subq %rax, %rsi
movq %r13, %rdi
callq 0x14d7
movl %eax, %ebp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x15a6
movl %eax, %r12d
movq %r13, %rdi
movq %rbp, %rsi
callq 0x15e4
testl %r12d, %r12d
je 0x2288
movq %rax, %r15
movq %r14, %rdi
leaq 0xf5e(%rip), %rsi       # 0x318a
movl %r12d, %edx
xorl %eax, %eax
callq 0x1378
movq %r14, %rdx
testq %rax, %rax
je 0x2298
movq %rax, %r14
leaq 0xf4f(%rip), %rdi       # 0x3197
movq %r15, %rcx
movq %rdx, %r15
movq %rdx, %rsi
movl %r12d, %edx
movq %rax, %r8
movl %ebp, %r9d
xorl %eax, %eax
callq 0x10c0
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x1317
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x20e3
movq %r14, %rdi
callq 0x1030
movq %r15, %r14
addl 0x4(%rsp), %ebp
movl %ebp, %eax
movq 0x8(%rsp), %rsi
jmp 0x21dc
movq %rdx, %rdi
movq %rdx, %r14
callq 0x1120
jmp 0x2288
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d35(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xea0(%rip), %rsi       # 0x3165
movq %r14, %rdx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: amos_source
void amos_source(char *fname, uint8_t *src, size_t len) {
    if (len < 30) {
        fprintf(stderr, "%s: file too short to be AMOS source code\n", fname);
    }
    else {
        uint32_t src_len = amos_leek(&src[16]) + 20;
        char hdr[17] = {0};
        memcpy(hdr, src, 16);
        printf("%s: AMOS source code with header '%s'\n", fname, hdr);

        /* parse banks after source code */
        if (src_len < len) {
            amos_banks(fname, &src[src_len], len - src_len);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpq $0x1d, %rdx
jbe 0x2342
movq %rdx, %r14
movq %rsi, %r15
movl 0x10(%rsi), %r12d
bswapl %r12d
addl $0x14, %r12d
movq %rsp, %rdx
movb $0x0, 0x10(%rdx)
movups (%rsi), %xmm0
movaps %xmm0, (%rdx)
leaq 0xeda(%rip), %rdi       # 0x31f0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
subq %r12, %r14
jbe 0x2336
addq %r12, %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x21a9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x2ca7(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xe72(%rip), %rsi       # 0x31c5
movq %rbx, %rdx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10d0
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: amos_file
void amos_file(char *fname, uint8_t *src, size_t len) {
    if (len < 4) {
        fprintf(stderr, "%s: file too short to be an AMOS file\n", fname);
    }
    else {
        switch (amos_leek(src)) {
        case ID_AMOS:
            amos_source(fname, src, len);
            break;

        case ID_AmBs:
            printf("%s: AMOS banks\n", fname);
            amos_banks(fname, src, len);
            break;

        case ID_AmBk:
        case ID_AmSp:
        case ID_AmIc:
            printf("%s: AMOS bank (%s)\n", fname, bank_type(src, len));
            amos_bank(fname, src, len);
            break;

        default:
            fprintf(stderr, "%s: not an AMOS source file or bank\n", fname);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x3, %rdx
jbe 0x2414
movq %rdx, %r14
movq %rsi, %r15
movl (%rsi), %eax
bswapl %eax
cmpl $0x416d5370, %eax       # imm = 0x416D5370
je 0x23be
cmpl $0x416d426b, %eax       # imm = 0x416D426B
je 0x23be
cmpl $0x416d4273, %eax       # imm = 0x416D4273
je 0x23f0
cmpl $0x416d4963, %eax       # imm = 0x416D4963
je 0x23be
cmpl $0x414d4f53, %eax       # imm = 0x414D4F53
jne 0x2434
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x22dd
movq %r15, %rdi
movq %r14, %rsi
callq 0x15e4
leaq 0xe7e(%rip), %rdi       # 0x324e
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10c0
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x20e3
leaq 0xe47(%rip), %rdi       # 0x323e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x21a9
movq 0x2bd5(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xdf2(%rip), %rsi       # 0x3217
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x10d0
movq 0x2bb5(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xe1d(%rip), %rsi       # 0x3262
jmp 0x2425
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/dumpamos.c
// Function: main
int main(int argc, char *argv[]) {
    if (argc <= 1) {
        printf("Extract the contents of AMOS source code and memory banks.\n");
        printf("Usage: %s [-p] <file.AMOS, file.abk, file.abs, ...>\n", argv[0]);
        printf("Options:\n"
               "  -p     Prefix removal\n");
        return 1;
    }

    for (int i = 1; i < argc; i++) {
        if (!strcmp(argv[i], "-p")) {
            use_prefix = 1;
        }
        else {
            char *fname = argv[i];
            uint8_t *buf;
            size_t len;
            if ((buf = read_file(fname, &len))) {
                amos_file(fname, buf, len);
                free(buf);
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x2, %edi
jge 0x2488
leaq 0xe5b(%rip), %rdi       # 0x32bc
callq 0x1070
movq (%rbx), %rsi
leaq 0xe17(%rip), %rdi       # 0x3287
xorl %eax, %eax
callq 0x10c0
leaq 0xe79(%rip), %rdi       # 0x32f7
callq 0x1070
pushq $0x1
popq %rax
jmp 0x24eb
movl %edi, %r13d
pushq $0x1
popq %rbp
movq %rsp, %r14
cmpq %rbp, %r13
je 0x24e9
movq (%rbx,%rbp,8), %r15
cmpb $0x2d, (%r15)
jne 0x24ae
cmpb $0x70, 0x1(%r15)
jne 0x24ae
cmpb $0x0, 0x2(%r15)
je 0x24dd
movq %r15, %rdi
movq %r14, %rsi
callq 0x124c
testq %rax, %rax
je 0x24d8
movq %rax, %r12
movq (%rsp), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x2368
movq %r12, %rdi
callq 0x1030
incq %rbp
jmp 0x2491
movl $0x1, 0x2bd9(%rip)      # 0x50c0
jmp 0x24d8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: wordTreeFindInList
struct wordTree *wordTreeFindInList(struct wordTree *list, struct monomer *monomer)
/* Return wordTree element in list that has given word, or NULL if none. */
{
struct wordTree *wt;
for (wt = list; wt != NULL; wt = wt->next)
    if (wt->monomer == monomer)
        break;
return wt;
}

// Assembly:
movq %rdi, %rax
testq %rax, %rax
je 0x3923
cmpq %rsi, 0x18(%rax)
je 0x3923
movq (%rax), %rax
jmp 0x3913
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: wordTreeAddFollowing
struct wordTree *wordTreeAddFollowing(struct wordTree *wt, struct monomer *monomer)
/* Make word follow wt in tree.  If word already exists among followers
 * return it and bump use count.  Otherwise create new one. */
{
struct wordTree *child = wordTreeFindInList(wt->children, monomer);
if (child == NULL)
    {
    child = wordTreeNew(monomer);
    child->parent = wt;
    slAddHead(&wt->children, child);
    }
child->useCount += 1;
return child;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x3910
testq %rax, %rax
jne 0x3953
movq %r14, %rdi
callq 0x38e3
movq %rbx, 0x10(%rax)
movq 0x8(%rbx), %rcx
movq %rcx, (%rax)
movq %rax, 0x8(%rbx)
incl 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: addChainToTree
void addChainToTree(struct wordTree *wt, struct dlList *chain)
/* Add chain of words to tree. */
{
struct dlNode *node;
wt->useCount += 1;
for (node = chain->head; !dlEnd(node); node = node->next)
    {
    struct monomer *monomer = node->val;
    verbose(4, "  adding %s\n", monomer->word);
    wt = wordTreeAddFollowing(wt, monomer);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r15
incl 0x20(%rdi)
movq %rsi, %rbx
leaq 0x12cfb(%rip), %r14     # 0x16691
pushq $0x4
popq %rbp
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
je 0x39c7
movq 0x10(%rbx), %r12
movq 0x8(%r12), %rdx
movl %ebp, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x110f9
movq %r15, %rdi
movq %r12, %rsi
callq 0x3924
movq %rax, %r15
jmp 0x3999
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: useCountInTree
int useCountInTree(struct wordTree *wt, struct dlNode *nodeList, int chainSize)
/* Return number of times chainSize successive nodes from nodeList are found
 * in wt,  0 if not found. */
{
int i;
struct wordTree *subTree = wt;
struct dlNode *node = nodeList;
for (i=0; i<chainSize; ++i)
    {
    struct monomer *monomer = node->val;
    subTree = wordTreeFindInList(subTree->children, monomer);
    if (subTree == NULL)
        return FALSE;
    node = node->next;
    }
return subTree->useCount;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rax
xorl %ebp, %ebp
testl %edx, %edx
cmovgl %edx, %ebp
subl $0x1, %ebp
jb 0x39fc
movq 0x10(%rbx), %rsi
movq 0x8(%rax), %rdi
callq 0x3910
testq %rax, %rax
je 0x3a01
movq (%rbx), %rbx
jmp 0x39e0
movl 0x20(%rax), %eax
jmp 0x3a03
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: findLongestSupportingMarkovChain
void findLongestSupportingMarkovChain(struct wordTree *wt, struct dlNode *node,
    int *retChainSize, int *retReadCount)
/* See if chain of words is in tree tree. */
{
struct dlNode *start = node;
int chainSize = 1;
int readCount = 0;
for (;;)
    {
    int useCount = useCountInTree(wt, start, chainSize);
    if (useCount == 0)
        break;
    readCount = useCount;
    chainSize += 1;
    start = start->prev;
    if (dlStart(start))
        break;
    }
*retChainSize = chainSize;
*retReadCount = readCount;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
pushq $0x1
popq %rbp
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x39d0
testl %eax, %eax
je 0x3a4a
incl %ebp
movq 0x8(%r15), %r15
cmpq $0x0, 0x8(%r15)
movl %eax, %r13d
jne 0x3a27
jmp 0x3a4d
movl %r13d, %eax
movl %ebp, (%r14)
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: wordTreeAddPseudoCount
int wordTreeAddPseudoCount(struct wordTree *wt, int pseudo)
/* Add pseudo to all leaves of tree and propagate counts up to parents. */
{
if (wt->children == NULL)
    {
    wt->useCount += pseudo;
    return wt->useCount;
    }
else
    {
    struct wordTree *child;
    int oldChildTotal = 0;
    for (child = wt->children; child != NULL; child = child->next)
	oldChildTotal += child->useCount;
    int oldDiff = wt->useCount - oldChildTotal;
    if (oldDiff < 0) oldDiff = 0;  // Necessary in rare cases, not sure why.

    int total = 0;
    for (child = wt->children; child != NULL; child = child->next)
	total += wordTreeAddPseudoCount(child, pseudo);
    wt->useCount = total + oldDiff + pseudo;
    return total;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %r15
testq %r15, %r15
je 0x3abb
xorl %eax, %eax
movq %r15, %rcx
testq %rcx, %rcx
je 0x3a89
addl 0x20(%rcx), %eax
movq (%rcx), %rcx
jmp 0x3a7c
movl 0x20(%r14), %r12d
subl %eax, %r12d
xorl %ebp, %ebp
testq %r15, %r15
je 0x3aa8
movq %r15, %rdi
movl %ebx, %esi
callq 0x3a61
addl %eax, %ebp
movq (%r15), %r15
jmp 0x3a92
xorl %eax, %eax
testl %r12d, %r12d
cmovgl %r12d, %eax
addl %ebp, %ebx
addl %eax, %ebx
movl %ebx, 0x20(%r14)
jmp 0x3ac5
addl 0x20(%r14), %ebx
movl %ebx, 0x20(%r14)
movl %ebx, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: wordTreeNormalize
void wordTreeNormalize(struct wordTree *wt, double outTarget, double normVal)
/* Recursively set wt->normVal  and wt->outTarget so each branch gets its share */
{
if (pseudoCount > 0)
    wordTreeAddPseudoCount(wt, pseudoCount);
wt->normVal = normVal;
wt->outTarget = outTarget;
wt->outCount = 0;
int childrenTotalUses = wordTreeSumUseCounts(wt->children);
struct wordTree *child;
for (child = wt->children; child != NULL; child = child->next)
    {
    double childRatio = (double)child->useCount / childrenTotalUses;
    wordTreeNormalize(child, childRatio*outTarget, childRatio*normVal);
    }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
movl 0x22906(%rip), %esi     # 0x263f0
testl %esi, %esi
jle 0x3af6
movq %rbx, %rdi
callq 0x3a61
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rbx)
cvttsd2si 0x8(%rsp), %eax
movl %eax, 0x24(%rbx)
andl $0x0, 0x28(%rbx)
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x395e
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%rsp)
testq %rbx, %rbx
je 0x3b51
cvtsi2sdl 0x20(%rbx), %xmm1
divsd 0x18(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm1
movq %rbx, %rdi
callq 0x3ad0
movq (%rbx), %rbx
jmp 0x3b24
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: wordTreeString
char *wordTreeString(struct wordTree *wt)
/* Return something like '(a b c)' where c would be the value at wt itself, and
 * a and b would be gotten by following parents. */
{
struct slName *list = NULL, *el;
for (;wt != NULL; wt = wt->parent)
    {
    char *word = wt->monomer->word;
    if (!isEmpty(word))   // Avoid blank great grandparent at root of tree.
	slNameAddHead(&list, word);
    }

struct dyString *dy = dyStringNew(0);
dyStringAppendC(dy, '(');
for (el = list; el != NULL; el = el->next)
   {
   dyStringPrintf(dy, "%s", el->name);
   if (el->next != NULL)
       dyStringAppendC(dy, ' ');
   }
dyStringAppendC(dy, ')');
slFreeList(&list);
return dyStringCannibalize(&dy);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x8(%rsp), %rbx
andq $0x0, (%rbx)
testq %r14, %r14
je 0x3b91
movq 0x18(%r14), %rax
movq 0x8(%rax), %rsi
testq %rsi, %rsi
je 0x3b8b
cmpb $0x0, (%rsi)
je 0x3b8b
movq %rbx, %rdi
callq 0x696a
movq 0x10(%r14), %r14
jmp 0x3b6c
xorl %edi, %edi
callq 0x9df0
movq %rax, %r14
movq %rax, (%rsp)
movb $0x28, %al
leaq 0x13a14(%rip), %r15     # 0x175bc
movsbl %al, %esi
movq %r14, %rdi
callq 0x9f5e
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x3bd6
leaq 0x8(%rbx), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xa0eb
cmpq $0x0, (%rbx)
je 0x3bb3
movb $0x20, %al
jmp 0x3ba8
pushq $0x29
popq %rsi
movq %r14, %rdi
callq 0x9f5e
leaq 0x8(%rsp), %rdi
callq 0x615b
movq %rsp, %rdi
callq 0x9e4a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: dlListFragWords
char *dlListFragWords(struct dlNode *head)
/* Return string containing all words in list pointed to by head. */
{
struct dyString *dy = dyStringNew(0);
dyStringAppendC(dy, '{');
struct dlNode *node;
for (node = head; !dlEnd(node); node = node->next)
    {
    if (node != head)
       dyStringAppendC(dy, ' ');
    struct monomer *monomer = node->val;
    dyStringAppend(dy, monomer->word);
    }
dyStringAppendC(dy, '}');
return dyStringCannibalize(&dy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x9df0
movq %rax, %r14
movq %rax, (%rsp)
pushq $0x7b
popq %rsi
movq %rax, %rdi
callq 0x9f5e
pushq $0x20
popq %rbp
movq %rbx, %r15
cmpq $0x0, (%r15)
je 0x3c50
cmpq %rbx, %r15
je 0x3c3b
movq %r14, %rdi
movl %ebp, %esi
callq 0x9f5e
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0x9ffe
movq (%r15), %r15
jmp 0x3c26
pushq $0x7d
popq %rsi
movq %r14, %rdi
callq 0x9f5e
movq %rsp, %rdi
callq 0x9e4a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: wordTreeDump
void wordTreeDump(int level, struct wordTree *wt, int maxChainSize, FILE *f)
/* Write out wordTree to file. */
{
static char *words[64];
int i;
assert(level < ArraySize(words));

words[level] = wt->monomer->word;
if (!fullOnly || level == maxChainSize)
    {
    fprintf(f, "%d\t%d\t%d\t%d\t%f\t", 
	    level, wt->useCount, wt->outTarget, wt->outCount, wt->normVal);
    
    for (i=1; i<=level; ++i)
	{
	spaceOut(f, level*2);
	fprintf(f, "%s ", words[i]);
	}
    fprintf(f, "\n");
    }
struct wordTree *child;
for (child = wt->children; child != NULL; child = child->next)
    wordTreeDump(level+1, child, maxChainSize, f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x40, %edi
jae 0x3d4e
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %r15d
movl %edi, %eax
movq 0x18(%rsi), %rcx
movq 0x8(%rcx), %rcx
leaq 0x229a2(%rip), %rdx     # 0x26640
movq %rcx, (%rdx,%rax,8)
cmpl %ebp, %edi
je 0x3cb4
cmpl $0x0, 0x22987(%rip)     # 0x26634
je 0x3cb4
incl %r15d
jmp 0x3d21
movl 0x20(%r14), %ecx
movl 0x24(%r14), %r8d
movl 0x28(%r14), %r9d
movsd 0x30(%r14), %xmm0
leaq 0x12a2d(%rip), %rsi     # 0x166fa
movq %rbx, %rdi
movl %r15d, %edx
movb $0x1, %al
callq 0x3470
leal (%r15,%r15), %r12d
incl %r15d
pushq $0x1
popq %r13
cmpq %r13, %r15
je 0x3d16
movq %rbx, %rdi
movl %r12d, %esi
callq 0x839f
leaq 0x22944(%rip), %rax     # 0x26640
movq (%rax,%r13,8), %rdx
movq %rbx, %rdi
leaq 0x158d2(%rip), %rsi     # 0x195dc
xorl %eax, %eax
callq 0x3470
incq %r13
jmp 0x3ce5
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x33a0
addq $0x8, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x3d3f
movl %r15d, %edi
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x3c6e
jmp 0x3d25
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12949(%rip), %rdi     # 0x1669e
leaq 0x1295b(%rip), %rsi     # 0x166b7
leaq 0x12960(%rip), %rcx     # 0x166c3
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x32e0
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: pickWeightedRandomFromList
struct wordTree *pickWeightedRandomFromList(struct wordTree *list)
/* Pick word from list randomly, but so that words with higher outTargets
 * are picked more often. */
{
struct wordTree *picked = NULL;

/* Debug output. */
    {
    verbose(4, "   pickWeightedRandomFromList(");
    struct wordTree *wt;
    for (wt = list; wt != NULL; wt = wt->next)
        {
	if (wt != list)
	    verbose(4, " ");
	verbose(4, "%s:%d", wt->monomer->word, wt->outTarget);
	}
    verbose(4, ") total %d\n", wordTreeSumOutTargets(list));
    }

/* Figure out total number of outputs left, and a random number between 0 and that total. */
int total = wordTreeSumOutTargets(list);
if (total > 0)
    {
    int threshold = rand() % total; 
    verbose(4, "      threshold %d\n", threshold);

    /* Loop through list returning selection corresponding to random threshold. */
    int binStart = 0;
    struct wordTree *wt;
    for (wt = list; wt != NULL; wt = wt->next)
	{
	int size = wt->outTarget;
	int binEnd = binStart + size;
	verbose(4, "      %s size %d, binEnd %d\n", wt->monomer->word, size, binEnd);
	if (threshold < binEnd)
	    {
	    picked = wt;
	    verbose(4, "      picked %s\n", wt->monomer->word);
	    break;
	    }
	binStart = binEnd;
	}
    }
return picked;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x1298b(%rip), %rsi     # 0x1670a
pushq $0x4
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x110f9
leaq 0x12997(%rip), %r14     # 0x16729
leaq 0x15b48(%rip), %r15     # 0x198e1
movq %rbx, %r12
testq %r12, %r12
je 0x3dd2
cmpq %rbx, %r12
je 0x3db2
movl %ebp, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x110f9
movq 0x18(%r12), %rax
movq 0x8(%rax), %rdx
movl 0x24(%r12), %ecx
movl %ebp, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x110f9
movq (%r12), %r12
jmp 0x3d9c
movq %rbx, %rdi
callq 0x396e
leaq 0x1294e(%rip), %rsi     # 0x1672f
pushq $0x4
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x110f9
movq %rbx, %rdi
callq 0x396e
testl %eax, %eax
jle 0x3e51
movl %eax, %ebp
callq 0x3780
cltd
idivl %ebp
movl %edx, %ebp
leaq 0x1292f(%rip), %rsi     # 0x1673b
pushq $0x4
popq %r14
movl %r14d, %edi
xorl %eax, %eax
callq 0x110f9
leaq 0x1292e(%rip), %r15     # 0x1674f
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x3e51
movl 0x24(%rbx), %ecx
addl %ecx, %r12d
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rdx
movl %r14d, %edi
movq %r15, %rsi
movl %r12d, %r8d
xorl %eax, %eax
callq 0x110f9
cmpl %r12d, %ebp
jl 0x3e55
movq (%rbx), %rbx
jmp 0x3e24
xorl %ebx, %ebx
jmp 0x3e6e
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x12908(%rip), %rsi     # 0x1676c
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x110f9
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: pickRandomFromType
struct monomer *pickRandomFromType(struct monomerType *type)
/* Pick a random word, weighted by outTarget, from all available of given type */
{
/* Figure out total on list */
int total = 0;
struct monomerRef *ref;
for (ref = type->list; ref != NULL; ref = ref->next)
    total += ref->val->outTarget;
verbose(3, "pickRandomFromType %s total of outTarget=%d\n", type->name, total);

/* Loop through list returning selection corresponding to random threshold. */
if (total > 0)
    {
    int threshold = rand() % total; 
    int binStart = 0;
    for (ref = type->list; ref != NULL; ref = ref->next)
	{
	struct monomer *monomer = ref->val;
	int size = monomer->outTarget;
	int binEnd = binStart + size;
	if (threshold < binEnd)
	    return monomer;
	binStart = binEnd;
	}
    }

verbose(3, "Backup plan for %s in pickRandomFromType\n", type->name);

/* Try again based on use counts. */
total = 0;
for (ref = type->list; ref != NULL; ref = ref->next)
    total += ref->val->useCount;
if (total > 0)
    {
    int threshold = rand() % total; 
    int binStart = 0;
    for (ref = type->list; ref != NULL; ref = ref->next)
	{
	struct monomer *monomer = ref->val;
	int size = monomer->useCount;
	int binEnd = binStart + size;
	if (threshold < binEnd)
	    return monomer;
	binStart = binEnd;
	}
    }

errAbort("Fell off end in pickRandomFromType on %s", type->name);
return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
xorl %ebp, %ebp
movq %r15, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x3e9f
movq 0x8(%rax), %rcx
addl 0x14(%rcx), %ebp
jmp 0x3e8e
movq 0x8(%rbx), %rdx
leaq 0x128d3(%rip), %rsi     # 0x1677d
xorl %r12d, %r12d
pushq $0x3
popq %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x110f9
testl %ebp, %ebp
jle 0x3ee0
callq 0x3780
cltd
idivl %ebp
xorl %eax, %eax
movq %r15, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x3ee0
movq 0x8(%rcx), %r14
addl 0x14(%r14), %eax
cmpl %eax, %edx
jge 0x3eca
jmp 0x3f45
movq 0x8(%rbx), %rdx
leaq 0x128bf(%rip), %rsi     # 0x167aa
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x110f9
movq %r15, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x3f0a
movq 0x8(%rax), %rcx
addl 0x10(%rcx), %r12d
jmp 0x3ef8
testl %r12d, %r12d
jle 0x3f30
callq 0x3780
cltd
idivl %r12d
xorl %eax, %eax
movq (%r15), %r15
testq %r15, %r15
je 0x3f30
movq 0x8(%r15), %r14
addl 0x10(%r14), %eax
cmpl %eax, %edx
jge 0x3f1a
jmp 0x3f45
movq 0x8(%rbx), %rsi
leaq 0x12899(%rip), %rdi     # 0x167d4
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xa61f
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: predictNextFromAllPredecessors
struct wordTree *predictNextFromAllPredecessors(struct wordTree *wt, struct dlNode *list)
/* Predict next word given tree and recently used word list.  If tree doesn't
 * have statistics for what comes next given the words in list, then it returns
 * NULL. */
{
if (verboseLevel() >= 4)
    verbose(4, "  predictNextFromAllPredecessors(%s, %s)\n", wordTreeString(wt), dlListFragWords(list));
struct dlNode *node;
for (node = list; !dlEnd(node); node = node->next)
    {
    struct monomer *monomer = node->val;
    wt = wordTreeFindInList(wt->children, monomer);
    if (verboseLevel() >= 4)
	verbose(4, "   wordTreeFindInList(%s) = %p %s\n", monomer->word, wt, wordTreeString(wt));
    if (wt == NULL || wt->children == NULL)
        break;
    }
struct wordTree *result = NULL;
if (wt != NULL && wt->children != NULL)
    result = pickWeightedRandomFromList(wt->children);
return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x1135c
cmpl $0x4, %eax
jl 0x3f95
movq %r14, %rdi
callq 0x3b57
movq %rax, %r15
movq %rbx, %rdi
callq 0x3bfd
leaq 0x12878(%rip), %rsi     # 0x167fd
pushq $0x4
popq %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x110f9
leaq 0x1288b(%rip), %r15     # 0x16827
pushq $0x4
popq %rbp
cmpq $0x0, (%rbx)
je 0x3ff7
movq 0x10(%rbx), %r12
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x3910
movq %rax, %r14
xorl %eax, %eax
callq 0x1135c
cmpl $0x4, %eax
jl 0x3fe6
movq 0x8(%r12), %r12
movq %r14, %rdi
callq 0x3b57
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x110f9
testq %r14, %r14
je 0x4012
cmpq $0x0, 0x8(%r14)
je 0x4012
movq (%rbx), %rbx
jmp 0x3f9f
testq %r14, %r14
je 0x4012
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x4012
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3d6d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: predictFromWordTree
struct wordTree *predictFromWordTree(struct wordTree *wt, struct dlNode *recent)
/* Predict next word given tree and recently used word list.  Will use all words in
 * recent list if can,  but if there is not data in tree, will back off, and use
 * progressively less previous words. */
{
struct dlNode *node;
if (verboseLevel() >= 4)
    verbose(4, " predictNextFromWordTree(%s)\n", wordTreeString(wt));

for (node = recent; !dlEnd(node); node = node->next)
    {
    struct wordTree *result = predictNextFromAllPredecessors(wt, node);
    if (result != NULL)
        return result;
    }
return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x1135c
cmpl $0x4, %eax
jl 0x4050
movq %r14, %rdi
callq 0x3b57
leaq 0x12807(%rip), %rsi     # 0x1684a
pushq $0x4
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x110f9
xorl %r15d, %r15d
cmpq $0x0, (%rbx)
je 0x4071
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3f51
testq %rax, %rax
jne 0x406e
movq (%rbx), %rbx
jmp 0x4053
movq %rax, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: typeBefore
struct monomerType *typeBefore(struct alphaStore *store, struct monomerType *oldType, int amount)
/* Pick type that comes amount before given type. */
{
int typeIx = ptArrayIx(oldType, store->typeArray, store->typeCount);
typeIx -= amount;
while (typeIx < 0)
    typeIx += store->typeCount;
return store->typeArray[typeIx];
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rax
movq %rdi, %rbx
movq 0x50(%rdi), %rsi
movl 0x48(%rdi), %edx
movq %rax, %rdi
callq 0x8628
subl %ebp, %eax
testl %eax, %eax
jns 0x40db
addl 0x48(%rbx), %eax
jmp 0x40d2
movq 0x50(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: predictFromPreviousTypes
struct wordTree *predictFromPreviousTypes(struct alphaStore *store, struct dlList *past)
/* Predict next based on general pattern of monomer order. */
{
/* This routine is now a bit more complex than necessary but it still works.  It
 * these days only needs to look back 1 because of the read-based type fill-in. */
int maxToLookBack = 3;
    { /* Debugging block */
    struct dlNode *node = nodesFromTail(past, maxToLookBack);
    verbose(4, "predictFromPreviousTypes(");
    for (; !dlEnd(node); node = node->next)
        {
	struct monomer *monomer = node->val;
	verbose(4, "%s, ", monomer->word);
	}
    verbose(4, ")\n");
    }
int pastDepth;
struct dlNode *node;
for (pastDepth = 1, node = past->tail; pastDepth <= maxToLookBack; ++pastDepth)
    {
    if (dlStart(node))
	{
	verbose(3, "predictFromPreviousTypes with empty past\n");
	return NULL;
	}
    struct monomer *monomer = node->val;
    struct monomerType *prevType = hashFindVal(store->typeHash, monomer->word);
    if (prevType != NULL)
        {
	struct monomerType *curType = typeAfter(store, prevType, pastDepth);
	struct monomer *curInfo = pickRandomFromType(curType);
	struct wordTree *curTree = wordTreeFindInList(store->markovChains->children, curInfo);
	verbose(4, "predictFromPreviousType pastDepth %d, curInfo %s, curTree %p %s\n", 
	    pastDepth, curInfo->word, curTree, curTree->monomer->word);
	return curTree;
	}
    node = node->prev;
    }
verbose(3, "predictFromPreviousTypes past all unknown types\n");
return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x407a
movq %rax, %r15
leaq 0x12759(%rip), %rsi     # 0x16868
pushq $0x4
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x110f9
leaq 0x12760(%rip), %r12     # 0x16882
cmpq $0x0, (%r15)
je 0x4141
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdx
movl %ebp, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x110f9
movq (%r15), %r15
jmp 0x4122
leaq 0x12f77(%rip), %rsi     # 0x170bf
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x110f9
addq $0x10, %r14
pushq $0x1
popq %rbp
cmpl $0x4, %ebp
je 0x4186
movq (%r14), %r14
cmpq $0x0, 0x8(%r14)
je 0x418f
movq 0x10(%r14), %rax
movq 0x40(%rbx), %rdi
movq 0x8(%rax), %rsi
callq 0xaf0d
testq %rax, %rax
jne 0x41a4
addq $0x8, %r14
incl %ebp
jmp 0x4159
leaq 0x12765(%rip), %rsi     # 0x168f2
jmp 0x4196
leaq 0x126f1(%rip), %rsi     # 0x16887
xorl %ebx, %ebx
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x110f9
jmp 0x41f1
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x4098
movq %rax, %rdi
callq 0x3e7a
movq %rax, %r14
movq 0x20(%rbx), %rax
movq 0x8(%rax), %rdi
movq %r14, %rsi
callq 0x3910
movq %rax, %rbx
movq 0x8(%r14), %rcx
movq 0x18(%rax), %rax
movq 0x8(%rax), %r9
leaq 0x126cf(%rip), %rsi     # 0x168b1
pushq $0x4
popq %rdi
movl %ebp, %edx
movq %rbx, %r8
xorl %eax, %eax
callq 0x110f9
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: predictNext
struct wordTree *predictNext(struct alphaStore *store, struct dlList *past)
/* Given input data store and what is known from the past, predict the next word. */
{
struct dlNode *recent = nodesFromTail(past, store->maxChainSize);
struct wordTree *pick =  predictFromWordTree(store->markovChains, recent);
if (pick == NULL)
    pick = predictFromPreviousTypes(store, past);
if (pick == NULL)
    {
    pick = pickWeightedRandomFromList(store->markovChains->children);
    verbose(3, "in predictNext() last resort pick of %s\n", pick->monomer->word);
    }
return pick;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0x30(%rdi), %esi
movq %r15, %rdi
callq 0x407a
movq 0x20(%r14), %rdi
movq %rax, %rsi
callq 0x401d
testq %rax, %rax
jne 0x4234
movq %r14, %rdi
movq %r15, %rsi
callq 0x40ec
testq %rax, %rax
je 0x4240
movq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x20(%r14), %rax
movq 0x8(%rax), %rdi
callq 0x3d6d
movq %rax, %rbx
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x126c4(%rip), %rsi     # 0x16923
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x110f9
jmp 0x4237
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: decrementOutputCountsInTree
void decrementOutputCountsInTree(struct wordTree *wt)
/* Decrement output count of self and parents. */
{
while (wt != NULL)
    {
    /* Decrement target count, but don't let it fall below sum of counts of all children. 
     * This can happen with incomplete data if we don't prevent it.  This
     * same code also prevents us from having negative outTarget. */
    int outTarget = wt->outTarget - 1;
    int kidSum = wordTreeSumOutTargets(wt->children);
    if (outTarget < kidSum)
        outTarget = kidSum;
    wt->outTarget = outTarget;

    /* Always bump outCount to help us debug (only real use of outCount). */
    wt->outCount += 1;
    wt = wt->parent;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rbx, %rbx
je 0x429a
movl 0x24(%rbx), %r14d
leal -0x1(%r14), %ebp
movq 0x8(%rbx), %rdi
callq 0x396e
cmpl %eax, %r14d
cmovlel %eax, %ebp
movl %ebp, 0x24(%rbx)
incl 0x28(%rbx)
movq 0x10(%rbx), %rbx
jmp 0x4272
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: listUnusedMonomers
struct slRef *listUnusedMonomers(struct alphaStore *store, struct dlList *ll)
/* Return list of references to monomers that are in store but not on ll. */
{
struct slRef *refList = NULL, *ref;
struct hash *usedHash = hashNew(0);
struct dlNode *node;
/* Make hash of used monomers. */
for (node = ll->head; !dlEnd(node); node = node->next)
    {
    struct monomer *monomer = node->val;
    hashAdd(usedHash, monomer->word, monomer);
    }

/* Stream through all monomers looking for ones not used and adding to list. */
struct monomer *monomer;
for (monomer = store->monomerList; monomer != NULL; monomer = monomer->next)
    {
    if (isEmpty(monomer->word))
        continue;
    if (!hashLookup(usedHash, monomer->word))
	{
	AllocVar(ref);
	ref->val = monomer;
	slAddHead(&refList, ref);
	}
    }
hashFree(&usedHash);
slReverse(&refList);
return refList;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
andq $0x0, 0x8(%rsp)
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0xb010
movq %rax, %r14
movq %rax, 0x10(%rsp)
movq (%r15), %r15
cmpq $0x0, (%r15)
je 0x42e3
movq 0x10(%r15), %rdx
movq 0x8(%rdx), %rsi
movq %r14, %rdi
callq 0xad17
jmp 0x42c8
xorl %r12d, %r12d
pushq $0x10
popq %r15
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x4326
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x42ea
cmpb $0x0, (%rsi)
je 0x42ea
movq %r14, %rdi
callq 0xaaa4
testq %rax, %rax
jne 0x42ea
movq %r15, %rdi
callq 0xd87c
movq %rbx, 0x8(%rax)
movq %r12, (%rax)
movq %rax, 0x8(%rsp)
movq %rax, %r12
jmp 0x42ea
leaq 0x10(%rsp), %rdi
callq 0xb306
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x613f
movq (%rbx), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: monomerRefIx
int monomerRefIx(struct monomerRef *list, struct monomer *monomer)
/* Return index of monomer in list. */
{
int i;
struct monomerRef *ref;
for (i=0, ref = list; ref != NULL; ref = ref->next, ++i)
    {
    if (ref->val == monomer)
        return i;
    }
errAbort("Monomer %s not on list\n", monomer->word);
return -1;
}

// Assembly:
pushq %rax
xorl %eax, %eax
testq %rdi, %rdi
je 0x4361
cmpq %rsi, 0x8(%rdi)
je 0x4376
movq (%rdi), %rdi
incl %eax
jmp 0x434f
movq 0x8(%rsi), %rsi
leaq 0x125e0(%rip), %rdi     # 0x1694c
xorl %eax, %eax
callq 0xa61f
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: findNeighborhoodFromReads
struct monomerRef *findNeighborhoodFromReads(struct monomer *center)
/* Find if possible one monomer to either side of center */
{
struct slRef *readRef;
struct monomerRef *before = NULL, *after = NULL;

/* Loop through reads hoping to find a case where center is flanked by two monomers in
 * same read.   As a fallback, keep track of a monomer before and a monomer after in
 * any read. */
for (readRef = center->readList; readRef != NULL; readRef = readRef->next)
    {
    struct alphaRead *read = readRef->val;
    int readSize = slCount(read->list);
    int centerIx = monomerRefIx(read->list, center);
    if (readSize >= 3 && centerIx > 0 && centerIx < readSize-1)
	 {
	 before = slElementFromIx(read->list, centerIx-1);
	 after = slElementFromIx(read->list, centerIx+1);
	 break;
	 }
    else if (readSize >= 2)
         {
	 if (centerIx == 0)
	     after = slElementFromIx(read->list, centerIx+1);
	 else
	     before = slElementFromIx(read->list, centerIx-1);
	 }
    }

/* Make up list from end to start. */
struct monomerRef *retList = NULL, *monoRef;
if (after)
    {
    AllocVar(monoRef);
    monoRef->val = after->val;
    slAddHead(&retList, monoRef);
    }
AllocVar(monoRef);
monoRef->val = center;
slAddHead(&retList, monoRef);
if (before)
    {
    AllocVar(monoRef);
    monoRef->val = before->val;
    slAddHead(&retList, monoRef);
    }
return retList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %rbp
xorl %r15d, %r15d
movq $0x0, (%rsp)
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x4409
movq 0x8(%rbp), %r14
movq 0x10(%r14), %rdi
callq 0x6082
movl %eax, %r13d
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x434c
movl %eax, %r12d
cmpl $0x3, %r13d
setge %al
testl %r12d, %r12d
setg %cl
andb %al, %cl
leal -0x1(%r13), %eax
cmpl %eax, %r12d
setl %al
andb %cl, %al
cmpb $0x1, %al
je 0x440f
cmpl $0x2, %r13d
jl 0x4395
movq 0x10(%r14), %rdi
testl %r12d, %r12d
je 0x43fc
decl %r12d
movl %r12d, %esi
callq 0x6091
movq %rax, (%rsp)
jmp 0x4395
pushq $0x1
popq %rsi
callq 0x6091
movq %rax, %r15
jmp 0x4395
movq (%rsp), %r13
jmp 0x4432
movq 0x10(%r14), %rdi
leal -0x1(%r12), %esi
callq 0x6091
movq %rax, %r13
movq 0x10(%r14), %rdi
incl %r12d
movl %r12d, %esi
callq 0x6091
movq %rax, %r15
testq %r15, %r15
je 0x4452
pushq $0x10
popq %rdi
callq 0xd87c
movq %rax, %r12
movq 0x8(%r15), %rax
movq %rax, 0x8(%r12)
andq $0x0, (%r12)
jmp 0x4455
xorl %r12d, %r12d
pushq $0x10
popq %rdi
callq 0xd87c
movq %rax, %r15
movq %rbx, 0x8(%rax)
movq %r12, (%rax)
testq %r13, %r13
je 0x4482
pushq $0x10
popq %rdi
callq 0xd87c
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%rax)
movq %r15, (%rax)
movq %rax, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: matchExceptCenter
struct dlNode *matchExceptCenter(struct dlNode *node, struct monomerRef *neighborhood, struct monomer *center)
/* Return center node if node matches neighborhood except for center. */
{
struct dlNode *centerNode = NULL;
struct monomerRef *neighbor;
struct dlNode *n;
for (n = node, neighbor=neighborhood; ; n = n->next, neighbor = neighbor->next)
    {
    if (neighbor == NULL)
        break;
    if (dlEnd(n))
        return NULL;
    if (neighbor->val == center)
        centerNode = n;
    else if (n->val != neighbor->val)
        return NULL;
    }
return centerNode;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
je 0x44c1
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x44bf
movq 0x8(%rsi), %r8
cmpq %rdx, %r8
je 0x44b4
cmpq %r8, 0x10(%rdi)
je 0x44b7
jmp 0x44bf
movq %rdi, %rax
movq (%rsi), %rsi
movq %rcx, %rdi
jmp 0x4496
xorl %eax, %eax
retq