LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movq %rdi, %r14
movq %rdx, 0x18(%rsp)
cmpq $0x5, %rdx
jbe 0x237c
movzwl 0x4(%rsi), %eax
rolw $0x8, %ax
testw %ax, %ax
je 0x236d
movzwl %ax, %ebx
movl $0x6, %r15d
movq %rsi, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movl %r15d, %eax
leaq (%rsi,%rax), %r13
movq 0x18(%rsp), %rsi
subq %rax, %rsi
movq %r13, %rdi
callq 0x14e2
movl %eax, %ebp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x15c5
movl %eax, %r12d
movq %r13, %rdi
movq %rbp, %rsi
callq 0x160c
testl %r12d, %r12d
je 0x2349
movq %rax, 0x20(%rsp)
movq %r14, %rdi
leaq 0xe9e(%rip), %rsi       # 0x318a
movl %r12d, %edx
xorl %eax, %eax
callq 0x1383
movq %r14, %rcx
testq %rax, %rax
je 0x2360
movq %rax, %r14
leaq 0xe8f(%rip), %rdi       # 0x3197
movq %rcx, %rsi
movl %r12d, %edx
movq 0x20(%rsp), %rcx
movq %rax, %r8
movl %ebp, %r9d
xorl %eax, %eax
callq 0x10c0
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x131e
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x219e
movq %r14, %rdi
callq 0x1030
movq 0x8(%rsp), %r14
decl %ebx
addl %r15d, %ebp
movl %ebp, %r15d
testl %ebx, %ebx
movq 0x10(%rsp), %rsi
jne 0x22a6
jmp 0x236d
movq %rcx, %rdi
movq %rcx, %r14
callq 0x1120
jmp 0x2349
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2c6d(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xdd8(%rip), %rsi       # 0x3165
movq %r14, %rdx
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
// File: /workspace/github_c_makefile_star2_O3/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 0x240a
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 0xe12(%rip), %rdi       # 0x31f0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
subq %r12, %r14
jbe 0x23fe
addq %r12, %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2262
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x2bdf(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xdaa(%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_O3/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 0x24f5
movq %rdx, %r14
movq %rsi, %r15
movl (%rsi), %eax
bswapl %eax
cmpl $0x416d4272, %eax       # imm = 0x416D4272
jle 0x247e
cmpl $0x416d4273, %eax       # imm = 0x416D4273
je 0x24be
cmpl $0x416d4963, %eax       # imm = 0x416D4963
je 0x248c
cmpl $0x416d5370, %eax       # imm = 0x416D5370
je 0x248c
movq 0x2b81(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xde9(%rip), %rsi       # 0x3262
jmp 0x2506
cmpl $0x414d4f53, %eax       # imm = 0x414D4F53
je 0x24e2
cmpl $0x416d426b, %eax       # imm = 0x416D426B
jne 0x2468
movq %r15, %rdi
movq %r14, %rsi
callq 0x160c
leaq 0xdb0(%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 0x219e
leaq 0xd79(%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 0x2262
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x23a5
movq 0x2af4(%rip), %rax      # 0x4ff0
movq (%rax), %rdi
leaq 0xd11(%rip), %rsi       # 0x3217
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x10d0
// File: /workspace/github_c_makefile_star2_O3/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 0x2558
leaq 0xd8d(%rip), %rdi       # 0x32bc
callq 0x1070
movq (%rbx), %rsi
leaq 0xd49(%rip), %rdi       # 0x3287
xorl %eax, %eax
callq 0x10c0
leaq 0xdab(%rip), %rdi       # 0x32f7
callq 0x1070
movl $0x1, %eax
jmp 0x25bd
movl %edi, %r13d
movl $0x1, %ebp
movq %rsp, %r14
movq (%rbx,%rbp,8), %r15
cmpb $0x2d, (%r15)
jne 0x257b
cmpb $0x70, 0x1(%r15)
jne 0x257b
cmpb $0x0, 0x2(%r15)
je 0x25af
movq %r15, %rdi
movq %r14, %rsi
callq 0x124c
testq %rax, %rax
je 0x25a5
movq %rax, %r12
movq (%rsp), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x2430
movq %r12, %rdi
callq 0x1030
incq %rbp
cmpq %rbp, %r13
jne 0x2563
jmp 0x25bb
movl $0x1, 0x2b07(%rip)      # 0x50c0
jmp 0x25a5
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_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: catchSignal
static void catchSignal(int sigNum)
/* handler for various terminal signals for logging purposes */
{
char *sig = NULL;
switch (sigNum)
    {
    case SIGTERM:  // after timing out for not producing any stdout or stderr output for too long,
		   //  apache gives you 3 seconds to clean up and exit or it then sends SIGKILL.
      sig = "SIGTERM";
      break;
    case SIGHUP:   // apache sends this when it is doing a graceful restart or a log rotate.
      sig = "SIGHUP";
      break;
    case SIGABRT:
      sig = "SIGABRT";
      break;
    case SIGSEGV:
      sig = "SIGSEGV";
      break;
    case SIGFPE:
      sig = "SIGFPE";
      break;
    case SIGBUS:
      sig = "SIGBUS";
      break;
    }
    logCgiToStderr();

    // apache closes STDERR on the CGI before it sends the SIGTERM and SIGKILL signals
    //  which means that stderr output after that point will not be visible in error_log.
    fprintf(stderr, "Received signal %s\n", sig);
    if (dumpStackOnSignal)
        dumpStack("Stack for signal %s\n", sig);

if (sigNum == SIGTERM || sigNum == SIGHUP) 
    exit(1);   // so that atexit cleanup get called

raise(SIGKILL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leal -0x1(%rbx), %eax
cmpl $0xe, %eax
ja 0x384e
movl %eax, %eax
leaq 0x23508(%rip), %rcx     # 0x26d50
movq (%rcx,%rax,8), %r14
jmp 0x3851
xorl %r14d, %r14d
callq 0x38ac
movq 0x2379b(%rip), %rax     # 0x26ff8
movq (%rax), %rdi
leaq 0x18891(%rip), %rsi     # 0x1c0f8
movq %r14, %rdx
xorl %eax, %eax
callq 0x3470
cmpl $0x0, 0x24a50(%rip)     # 0x282c8
je 0x388b
leaq 0x1888b(%rip), %rdi     # 0x1c10c
movq %r14, %rsi
xorl %eax, %eax
callq 0x119cf
cmpl $0xf, %ebx
je 0x38a4
cmpl $0x1, %ebx
je 0x38a4
pushq $0x9
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3060
pushq $0x1
popq %rdi
callq 0x36e0
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/lib/cheapcgi.c
// Function: logCgiToStderr
void logCgiToStderr()
/* Log useful CGI info to stderr */
{
char *ip = getenv("REMOTE_ADDR");
char *cgiBinary = getenv("SCRIPT_FILENAME");
char *requestUri = getenv("REQUEST_URI");
char *hgsid = cgiOptionalString("hgsid");
char *cgiFileName = NULL;
time_t nowTime = time(NULL);
struct tm *tm;
tm = localtime(&nowTime);
char *ascTime = asctime(tm);
size_t len = strlen(ascTime);
if (cgiBinary)
    cgiFileName = basename(cgiBinary);
else
    cgiFileName = "cgi-bin";
if (len > 3) ascTime[len-2] = '\0';
if (!ip)
    ip = "unknown";
if (!hgsid)
    hgsid = "unknown";
if (!requestUri)
    requestUri = "unknown";
fprintf(stderr, "[%s] [%s] [client %s] [hgsid=%.24s] [%.1024s] ", ascTime, cgiFileName, ip,
	hgsid, requestUri);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x17e59(%rip), %rdi     # 0x1b71a
callq 0x3040
movq %rax, %rbx
leaq 0x1872a(%rip), %rdi     # 0x1bffa
callq 0x3040
movq %rax, %r13
leaq 0x17def(%rip), %rdi     # 0x1b6ce
callq 0x3040
movq %rax, %r15
leaq 0x1871c(%rip), %rdi     # 0x1c00a
callq 0x139f0
movq %rax, %r14
xorl %edi, %edi
callq 0x34d0
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
callq 0x30a0
movq %rax, %rdi
callq 0x3220
movq %rax, %r12
movq %rax, %rdi
callq 0x3200
movq %rax, %rbp
testq %r13, %r13
jne 0x392e
leaq 0x186e4(%rip), %rcx     # 0x1c010
jmp 0x3939
movq %r13, %rdi
callq 0x34c0
movq %rax, %rcx
cmpq $0x4, %rbp
jb 0x3945
movb $0x0, -0x2(%r12,%rbp)
testq %rbx, %rbx
leaq 0x17521(%rip), %rax     # 0x1ae70
cmoveq %rax, %rbx
testq %r14, %r14
cmoveq %rax, %r14
testq %r15, %r15
cmoveq %rax, %r15
movq 0x23690(%rip), %rax     # 0x26ff8
movq (%rax), %rdi
movq %r15, (%rsp)
leaq 0x186a2(%rip), %rsi     # 0x1c018
movq %r12, %rdx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x3470
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
je 0x3af8
movq %rdi, %rax
cmpq %rsi, 0x18(%rax)
je 0x3afa
movq (%rax), %rax
testq %rax, %rax
jne 0x3aea
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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), %rax
testq %rax, %rax
je 0x3b19
cmpq %r14, 0x18(%rax)
je 0x3b36
movq (%rax), %rax
jmp 0x3b09
movl $0x38, %edi
callq 0xee10
movq %r14, 0x18(%rax)
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_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
incl 0x20(%rdi)
movq (%rsi), %r12
cmpq $0x0, (%r12)
je 0x3bb1
movq %rdi, %rbx
leaq 0x14b11(%rip), %r14     # 0x18691
movq 0x10(%r12), %r15
movq 0x8(%r15), %rdx
movl $0x4, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x12a31
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3afb
movq %rax, %rbx
movq (%r12), %r12
cmpq $0x0, (%r12)
jne 0x3b80
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %edx, %edx
jle 0x3beb
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3bee
movq 0x10(%rsi), %r8
cmpq %r8, 0x18(%rdi)
je 0x3be2
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x3bd2
jmp 0x3bee
movq (%rsi), %rsi
incl %ecx
cmpl %edx, %ecx
jne 0x3bc5
movl 0x20(%rdi), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
xorl %r8d, %r8d
movl $0x1, %eax
movq %rsi, %r10
movq %rdi, %r9
xorl %r11d, %r11d
movq 0x8(%r9), %r9
testq %r9, %r9
je 0x3c44
movq 0x10(%r10), %rbx
cmpq %rbx, 0x18(%r9)
je 0x3c1e
movq (%r9), %r9
testq %r9, %r9
jne 0x3c0e
jmp 0x3c44
movq (%r10), %r10
incl %r11d
cmpl %eax, %r11d
jne 0x3c01
movl 0x20(%r9), %r9d
testl %r9d, %r9d
je 0x3c44
incl %eax
movq 0x8(%rsi), %rsi
cmpq $0x0, 0x8(%rsi)
movl %r9d, %r8d
jne 0x3bf8
jmp 0x3c47
movl %r8d, %r9d
movl %eax, (%rdx)
movl %r9d, (%rcx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x3ca6
xorl %eax, %eax
movq %r14, %rcx
addl 0x20(%rcx), %eax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x3c69
movl 0x20(%rbx), %r12d
subl %eax, %r12d
xorl %r15d, %r15d
testl %r12d, %r12d
cmovlel %r15d, %r12d
movq %r14, %rdi
movl %ebp, %esi
callq 0x3c4e
addl %eax, %r15d
movq (%r14), %r14
testq %r14, %r14
jne 0x3c85
addl %ebp, %r12d
addl %r15d, %r12d
movl %r12d, 0x20(%rbx)
jmp 0x3caf
addl 0x20(%rbx), %ebp
movl %ebp, 0x20(%rbx)
movl %ebp, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movapd %xmm1, %xmm2
movapd %xmm0, %xmm3
movq %rdi, %rbx
movl 0x2371f(%rip), %esi     # 0x273f0
testl %esi, %esi
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
jle 0x3cf5
movq %rbx, %rdi
callq 0x3c4e
movsd 0x8(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
movsd %xmm2, 0x30(%rbx)
cvttsd2si %xmm3, %eax
movl %eax, 0x24(%rbx)
movl $0x0, 0x28(%rbx)
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x3d69
xorl %eax, %eax
movq %rbx, %rcx
addl 0x20(%rcx), %eax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x3d16
testq %rbx, %rbx
je 0x3d69
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm1, %xmm1
cvtsi2sdl 0x20(%rbx), %xmm1
divsd 0x18(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
movq %rbx, %rdi
callq 0x3cbb
movsd 0x8(%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x3d33
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x18, %rsp
movq $0x0, 0x10(%rsp)
testq %rdi, %rdi
je 0x3daf
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rsi
testq %rsi, %rsi
je 0x3da6
cmpb $0x0, (%rsi)
je 0x3da6
movq %r14, %rdi
callq 0x6fa6
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x3d8c
xorl %edi, %edi
callq 0xad14
movq %rax, %rbx
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl $0x28, %esi
callq 0xaeab
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x3e11
leaq 0x157e0(%rip), %rbx     # 0x195bc
movq 0x8(%rsp), %rdi
leaq 0x8(%r14), %rdx
movq %rbx, %rsi
xorl %eax, %eax
callq 0xb0b7
cmpq $0x0, (%r14)
je 0x3e0c
movq 0x8(%rsp), %rdi
movl $0x20, %esi
callq 0xaeab
movq (%r14), %r14
testq %r14, %r14
jne 0x3ddc
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x29, %esi
callq 0xaeab
leaq 0x10(%rsp), %rdi
callq 0x66de
leaq 0x8(%rsp), %rdi
callq 0xad70
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %edi, %edi
callq 0xad14
movq %rax, %r14
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl $0x7b, %esi
callq 0xaeab
cmpq $0x0, (%rbx)
je 0x3e96
movq %rbx, %r15
cmpq %rbx, %r15
je 0x3e7d
movq %r14, %rdi
movl $0x20, %esi
callq 0xaeab
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0xaf83
movq (%r15), %r15
cmpq $0x0, (%r15)
jne 0x3e6b
movq %r14, %rdi
movl $0x7d, %esi
callq 0xaeab
leaq 0x8(%rsp), %rdi
callq 0xad70
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3fa3
movq %rcx, %rbx
movl %edx, %ebp
movl %edi, %r14d
movl %edi, %eax
movq 0x18(%rsi), %rcx
movq 0x8(%rcx), %rcx
leaq 0x2373c(%rip), %rdx     # 0x27620
movq %rcx, (%rdx,%rax,8)
cmpl %ebp, %edi
je 0x3ef5
cmpl $0x0, 0x23721(%rip)     # 0x27614
jne 0x3f70
movl 0x20(%rsi), %ecx
movl 0x24(%rsi), %r8d
movl 0x28(%rsi), %r9d
movq %rsi, (%rsp)
movsd 0x30(%rsi), %xmm0
leaq 0x147ea(%rip), %rsi     # 0x186fa
movq %rbx, %rdi
movl %r14d, %edx
movb $0x1, %al
callq 0x3470
testl %r14d, %r14d
je 0x3f5f
leal (%r14,%r14), %r12d
leal 0x1(%r14), %r15d
movl $0x1, %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x8f30
leaq 0x236de(%rip), %rax     # 0x27620
movq (%rax,%r13,8), %rdx
movq %rbx, %rdi
leaq 0x1768c(%rip), %rsi     # 0x1b5dc
xorl %eax, %eax
callq 0x3470
incq %r13
cmpq %r13, %r15
jne 0x3f30
movl $0xa, %edi
movq %rbx, %rsi
callq 0x33a0
movq (%rsp), %rsi
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x3f94
incl %r14d
movl %r14d, %edi
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x3eb7
movq (%r15), %r15
testq %r15, %r15
jne 0x3f7c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x146f4(%rip), %rdi     # 0x1869e
leaq 0x14706(%rip), %rsi     # 0x186b7
leaq 0x1470b(%rip), %rcx     # 0x186c3
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x32e0
// File: /workspace/github_c_makefile_star2_O3/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 0x14736(%rip), %rsi     # 0x1870a
movl $0x4, %edi
xorl %eax, %eax
callq 0x12a31
testq %rbx, %rbx
je 0x40c3
leaq 0x14739(%rip), %r14     # 0x18729
leaq 0x178ea(%rip), %r15     # 0x1b8e1
movq %rbx, %r12
cmpq %rbx, %r12
je 0x400e
movl $0x4, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x12a31
movq 0x18(%r12), %rax
movq 0x8(%rax), %rdx
movl 0x24(%r12), %ecx
movl $0x4, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x12a31
movq (%r12), %r12
testq %r12, %r12
jne 0x3ffa
xorl %edx, %edx
movq %rbx, %rax
addl 0x24(%rax), %edx
movq (%rax), %rax
testq %rax, %rax
jne 0x4039
leaq 0x146e4(%rip), %rsi     # 0x1872f
xorl %ebp, %ebp
movl $0x4, %edi
xorl %eax, %eax
callq 0x12a31
movq %rbx, %rax
addl 0x24(%rax), %ebp
movq (%rax), %rax
testq %rax, %rax
jne 0x405c
testl %ebp, %ebp
jle 0x40bf
callq 0x3780
cltd
idivl %ebp
movl %edx, %ebp
leaq 0x146bf(%rip), %rsi     # 0x1873b
movl $0x4, %edi
xorl %eax, %eax
callq 0x12a31
leaq 0x146c0(%rip), %r14     # 0x1874f
xorl %r15d, %r15d
movl 0x24(%rbx), %ecx
addl %ecx, %r15d
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rdx
movl $0x4, %edi
movq %r14, %rsi
movl %r15d, %r8d
xorl %eax, %eax
callq 0x12a31
cmpl %r15d, %ebp
jl 0x40dc
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x4092
xorl %ebx, %ebx
jmp 0x40f7
leaq 0x14665(%rip), %rsi     # 0x1872f
xorl %ebx, %ebx
movl $0x4, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x12a31
jmp 0x40f7
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rdx
leaq 0x14681(%rip), %rsi     # 0x1876c
movl $0x4, %edi
xorl %eax, %eax
callq 0x12a31
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x4178
xorl %ebp, %ebp
movq 0x8(%rax), %rcx
movq (%rax), %rdx
addl 0x14(%rcx), %ebp
movq %rdx, %rax
testq %rdx, %rdx
jne 0x411d
movq 0x8(%rbx), %rdx
addq $0x8, %rbx
leaq 0x1463f(%rip), %rsi     # 0x1877d
xorl %r12d, %r12d
movl $0x3, %edi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x12a31
testl %ebp, %ebp
jle 0x4195
callq 0x3780
cltd
idivl %ebp
movq %r15, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x4195
movq 0x8(%rax), %r14
addl 0x14(%r14), %r12d
cmpl %r12d, %edx
jge 0x415e
jmp 0x41ff
movq 0x8(%rbx), %rdx
addq $0x8, %rbx
leaq 0x145f6(%rip), %rsi     # 0x1877d
movl $0x3, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x12a31
movq (%rbx), %rdx
leaq 0x1460b(%rip), %rsi     # 0x187aa
xorl %ebp, %ebp
movl $0x3, %edi
xorl %eax, %eax
callq 0x12a31
movq (%r15), %rax
testq %rax, %rax
je 0x41eb
movq 0x8(%rax), %rcx
movq (%rax), %rdx
addl 0x10(%rcx), %ebp
movq %rdx, %rax
testq %rdx, %rdx
jne 0x41b5
testl %ebp, %ebp
jle 0x41eb
callq 0x3780
cltd
idivl %ebp
xorl %eax, %eax
movq (%r15), %r15
testq %r15, %r15
je 0x41eb
movq 0x8(%r15), %r14
addl 0x10(%r14), %eax
cmpl %eax, %edx
jge 0x41d5
jmp 0x41ff
movq (%rbx), %rsi
leaq 0x145df(%rip), %rdi     # 0x187d4
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xb6c8
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x12caa
cmpl $0x4, %eax
jl 0x4251
movq %r14, %rdi
callq 0x3d6f
movq %rax, %r15
movq %rbx, %rdi
callq 0x3e3a
leaq 0x145be(%rip), %rsi     # 0x187fd
movl $0x4, %edi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x12a31
cmpq $0x0, (%rbx)
je 0x42c8
movq 0x8(%r14), %rax
leaq 0x145c5(%rip), %r15     # 0x18827
movq 0x10(%rbx), %r12
testq %rax, %rax
je 0x4276
cmpq %r12, 0x18(%rax)
je 0x427b
movq (%rax), %rax
jmp 0x4266
xorl %r14d, %r14d
jmp 0x427e
movq %rax, %r14
xorl %eax, %eax
callq 0x12caa
cmpl $0x4, %eax
jl 0x42af
movq 0x8(%r12), %r12
movq %r14, %rdi
callq 0x3d6f
movl $0x4, %edi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x12a31
testq %r14, %r14
je 0x42e6
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x42e6
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
jne 0x4262
jmp 0x42cd
testq %r14, %r14
je 0x42e6
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x42e6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3fc2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x12caa
cmpl $0x4, %eax
jl 0x433d
movq %r14, %rdi
callq 0x3d6f
leaq 0x14531(%rip), %rsi     # 0x1884a
movl $0x4, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x12a31
jmp 0x433d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x420b
testq %rax, %rax
jne 0x4345
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
jne 0x432a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x930c
subl %ebp, %eax
jns 0x43a4
movl 0x48(%rbx), %ecx
addl %ecx, %eax
js 0x43a0
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_O3/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 %rdi, %rbx
leaq 0x10(%rsi), %r15
movq 0x10(%rsi), %r12
movl $0x3, %eax
movq 0x8(%r12), %r12
testq %r12, %r12
je 0x43dd
decl %eax
jne 0x43cd
jmp 0x43e0
movq (%rsi), %r12
leaq 0x14481(%rip), %rsi     # 0x18868
movl $0x4, %edi
xorl %eax, %eax
callq 0x12a31
cmpq $0x0, (%r12)
je 0x4424
leaq 0x14481(%rip), %r14     # 0x18882
movq 0x10(%r12), %rax
movq 0x8(%rax), %rdx
movl $0x4, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x12a31
movq (%r12), %r12
cmpq $0x0, (%r12)
jne 0x4401
leaq 0x14c94(%rip), %rsi     # 0x190bf
movl $0x4, %edi
xorl %eax, %eax
callq 0x12a31
movl $0x1, %ebp
movq (%r15), %r15
cmpq $0x0, 0x8(%r15)
je 0x4470
movq 0x10(%r15), %rax
movq 0x40(%rbx), %rdi
movq 0x8(%rax), %rsi
callq 0xc0b1
testq %rax, %rax
jne 0x4487
addq $0x8, %r15
incl %ebp
cmpl $0x4, %ebp
jne 0x443c
leaq 0x14484(%rip), %rsi     # 0x188f2
jmp 0x4477
leaq 0x14410(%rip), %rsi     # 0x18887
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0x12a31
jmp 0x44df
movl %ebp, %ecx
movq (%rax), %rax
testq %rax, %rax
jne 0x4495
movq 0x38(%rbx), %rax
decl %ecx
jne 0x4489
movq %rax, %rdi
callq 0x4103
movq 0x20(%rbx), %rcx
movq 0x8(%rcx), %rbx
testq %rbx, %rbx
je 0x44b9
cmpq %rax, 0x18(%rbx)
je 0x44bb
movq (%rbx), %rbx
jmp 0x44a9
xorl %ebx, %ebx
movq 0x8(%rax), %rcx
movq 0x18(%rbx), %rax
movq 0x8(%rax), %r9
leaq 0x143e3(%rip), %rsi     # 0x188b1
movl $0x4, %edi
movl %ebp, %edx
movq %rbx, %r8
xorl %eax, %eax
callq 0x12a31
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdi, %rbx
movl 0x30(%rdi), %eax
movq 0x10(%rsi), %rsi
testl %eax, %eax
jle 0x4513
movq 0x8(%rsi), %rsi
testq %rsi, %rsi
je 0x4510
decl %eax
jne 0x4501
jmp 0x4513
movq (%r14), %rsi
movq 0x20(%rbx), %rdi
callq 0x42f4
testq %rax, %rax
jne 0x4531
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43b5
testq %rax, %rax
je 0x453d
movq %rax, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x20(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x3fc2
movq %rax, %r15
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x143c7(%rip), %rsi     # 0x18923
movl $0x3, %edi
xorl %eax, %eax
callq 0x12a31
jmp 0x4534
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
je 0x4599
movq 0x8(%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x4582
addl 0x24(%rcx), %eax
movq (%rcx), %rcx
jmp 0x4575
movl 0x24(%rdi), %ecx
leal -0x1(%rcx), %edx
cmpl %eax, %ecx
cmovlel %eax, %edx
movl %edx, 0x24(%rdi)
incl 0x28(%rdi)
movq 0x10(%rdi), %rdi
jmp 0x456a
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq $0x0, (%rsp)
xorl %edi, %edi
movl $0x1, %esi
callq 0xc1ee
movq %rax, %rbx
movq %rax, 0x8(%rsp)
movq (%r15), %r15
cmpq $0x0, (%r15)
je 0x45e0
movq 0x10(%r15), %rdx
movq 0x8(%rdx), %rsi
movq %rbx, %rdi
callq 0xbe46
jmp 0x45c5
movq (%r14), %r14
testq %r14, %r14
je 0x4626
xorl %r15d, %r15d
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x461e
cmpb $0x0, (%rsi)
je 0x461e
movq %rbx, %rdi
callq 0xbb8c
testq %rax, %rax
jne 0x461e
movl $0x10, %edi
callq 0xee10
movq %r14, 0x8(%rax)
movq %r15, (%rax)
movq %rax, (%rsp)
movq %rax, %r15
movq (%r14), %r14
testq %r14, %r14
jne 0x45eb
leaq 0x8(%rsp), %rdi
callq 0xc51f
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x66bb
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
testq %rdi, %rdi
je 0x4660
xorl %eax, %eax
cmpq %rsi, 0x8(%rdi)
je 0x4677
movq (%rdi), %rdi
incl %eax
testq %rdi, %rdi
jne 0x4650
movq 0x8(%rsi), %rsi
leaq 0x142e1(%rip), %rdi     # 0x1894c
xorl %eax, %eax
callq 0xb6c8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq 0x28(%rdi), %rbp
xorl %r14d, %r14d
testq %rbp, %rbp
je 0x4762
movq $0x0, (%rsp)
movq 0x8(%rbp), %r15
movq 0x10(%r15), %rdi
callq 0x65f4
movl %eax, %r13d
movq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x4648
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 0x4715
cmpl $0x2, %r13d
jl 0x470a
movq 0x10(%r15), %rdi
testl %r12d, %r12d
je 0x46fc
decl %r12d
movl %r12d, %esi
callq 0x6603
movq %rax, %r14
jmp 0x470a
movl $0x1, %esi
callq 0x6603
movq %rax, (%rsp)
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x469f
jmp 0x4739
movq 0x10(%r15), %rdi
leal -0x1(%r12), %esi
callq 0x6603
movq %rax, %r14
movq 0x10(%r15), %rdi
incl %r12d
movl %r12d, %esi
callq 0x6603
movq %rax, (%rsp)
movq (%rsp), %r15
testq %r15, %r15
je 0x4762
movl $0x10, %edi
callq 0xee10
movq %rax, %r12
movq 0x8(%r15), %rax
movq %rax, 0x8(%r12)
movq $0x0, (%r12)
jmp 0x4765
xorl %r12d, %r12d
movl $0x10, %edi
callq 0xee10
movq %rax, %r15
movq %rbx, 0x8(%rax)
movq %r12, (%rax)
testq %r14, %r14
je 0x4796
movl $0x10, %edi
callq 0xee10
movq 0x8(%r14), %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_O3/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 0x47d5
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x47d3
movq 0x8(%rsi), %r8
cmpq %rdx, %r8
je 0x47c8
cmpq %r8, 0x10(%rdi)
je 0x47cb
jmp 0x47d3
movq %rdi, %rax
movq (%rsi), %rsi
movq %rcx, %rdi
jmp 0x47aa
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/linearSat/linearSat.c
// Function: printMonomerRefList
void printMonomerRefList(struct monomerRef *refList, FILE *f)
/* Print out a line to file with the list of monomers. */
{
struct monomerRef *ref;
for (ref = refList; ref != NULL; ref = ref->next)
    fprintf(f, "%s ", ref->val->word);
fprintf(f, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x480a
movq %rdi, %r14
leaq 0x16def(%rip), %r15     # 0x1b5dc
movq 0x8(%r14), %rax
movq 0x8(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3470
movq (%r14), %r14
testq %r14, %r14
jne 0x47ed
movl $0xa, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x33a0
// File: /workspace/github_c_makefile_star2_O3/JimKent[P]linearSat/linearSat/linearSat.c
// Function: refsToPossibleCenters
struct slRef *refsToPossibleCenters(struct monomer *center, struct monomerRef *neighborhood, struct dlList *ll)
/* Return a list of dlNodes where neighborhood, but not center matches. */
{
struct slRef *list = NULL;
struct dlNode *node;
for (node = ll->head; !dlEnd(node); node = node->next)
    {
    struct dlNode *centerNode = matchExceptCenter(node, neighborhood, center);
    if (centerNode != NULL)
	refAdd(&list, centerNode);
    }
return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq $0x0, (%rsp)
movq (%rdx), %r12
movq (%r12), %rax
testq %rax, %rax
je 0x489f
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
testq %rbx, %rbx
je 0x488e
xorl %esi, %esi
movq %rbx, %rcx
movq %r12, %rdi
movq %rax, %rdx
movq 0x8(%rcx), %r8
cmpq %r14, %r8
je 0x4862
cmpq %r8, 0x10(%rdi)
je 0x4865
jmp 0x488e
movq %rdi, %rsi
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x487d
movq %rdx, %rdi
movq (%rdx), %r8
movq %r8, %rdx
testq %r8, %r8
jne 0x4851
jmp 0x488e
testq %rsi, %rsi
je 0x488e
movq %r15, %rdi
callq 0x754a
movq (%r12), %rax
movq %rax, %r12
movq (%rax), %rax
testq %rax, %rax
jne 0x4841
movq (%rsp), %rax
jmp 0x48a1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq