LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %r14
leaq 0x15108(%rip), %r15     # 0x195dc
testq %r14, %r14
je 0x44f3
movq 0x8(%r14), %rax
movq 0x8(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3470
movq (%r14), %r14
jmp 0x44d4
pushq $0xa
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x33a0
// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsp, %r12
andq $0x0, (%r12)
movq (%rbx), %rbx
cmpq $0x0, (%rbx)
je 0x4545
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4494
testq %rax, %rax
je 0x451c
movq %r12, %rdi
movq %rax, %rsi
callq 0x6dd9
jmp 0x451c
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: mostCommonMonomerWord
void mostCommonMonomerWord(struct slRef *refList, char **retWord, int *retCount)
/* Given refs to dlNodes containing monomers, find word associated with most common monomer. */
{
/* Make up a hash that contains counts of all monomers. */
struct hash *countHash = hashNew(0);
struct slRef *ref;
for (ref = refList; ref != NULL; ref = ref->next)
    {
    struct dlNode *node = ref->val;
    struct monomer *monomer = node->val;
    hashIncInt(countHash, monomer->word);
    }

/* Iterate through hash finding max value. */
char *maxWord = NULL;
int maxCount = 0;
struct hashEl *hel;
struct hashCookie cookie = hashFirst(countHash);
while ((hel = hashNext(&cookie)) != NULL)
    {
    int count = ptToInt(hel->val);
    if (count > maxCount)
        {
	maxCount = count;
	maxWord = hel->name;
	}
    }
*retWord = maxWord;
*retCount = maxCount;
hashFree(&countHash);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0xb010
movq %rax, %r12
movq %rax, 0x8(%rsp)
testq %r15, %r15
je 0x459c
movq 0x8(%r15), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq %r12, %rdi
callq 0xaf87
movq (%r15), %r15
jmp 0x457e
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xb23b
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %r15, %rdi
callq 0xb275
testq %rax, %rax
je 0x45d9
movq %rax, %r12
movq 0x10(%rax), %rdi
callq 0xe32e
cmpl %r13d, %eax
jle 0x45b1
movq 0x8(%r12), %rbp
movl %eax, %r13d
jmp 0x45b1
movq %rbp, (%r14)
movl %r13d, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0xb306
addq $0x28, %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: subCenterInNeighborhood
boolean subCenterInNeighborhood(struct alphaStore *store, 
    struct monomer *center, struct monomerRef *neighborhood, struct dlList *ll)
/* Scan ll for cases where neighborhood around center matches.  Replace one of these 
 * cases with center. */
{
int size = slCount(neighborhood);
assert(size == 3 || size == 2);
if (subCommonCenter(store, center, neighborhood, ll))
   return TRUE;
if (size == 3)
    {
    if (subCommonCenter(store, center, neighborhood->next, ll))
       return TRUE;
    struct monomerRef *third = neighborhood->next->next;
    neighborhood->next->next = NULL;
    boolean ok = subCommonCenter(store, center, neighborhood, ll);
    neighborhood->next->next = third;
    return ok;
    }
else
    return FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0x6082
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0x4861
cmpl $0x3, %eax
setne %bpl
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x45f8
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %cl
orb %cl, %bpl
je 0x4817
movb %cl, %al
jmp 0x4852
movq (%rbx), %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x45f8
testl %eax, %eax
je 0x4831
pushq $0x1
popq %rax
jmp 0x4852
movq (%rbx), %rax
movq (%rax), %r13
andq $0x0, (%rax)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x45f8
movq (%rbx), %rcx
movq %r13, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12220(%rip), %rdi     # 0x16a88
leaq 0x11e48(%rip), %rsi     # 0x166b7
leaq 0x12229(%rip), %rcx     # 0x16a9f
movl $0x3d8, %edx            # imm = 0x3D8
callq 0x32e0
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: subIntoFirstMostCommonOfType
boolean subIntoFirstMostCommonOfType(struct alphaStore *store, struct monomer *unused, 
    struct dlList *ll)
/* Substitute unused for first occurence of most common monomer of same type. */
{
struct monomer *common = mostCommonInType(unused->type);
if (common == NULL)
    {
    verbose(3, "No monomers of type %s used at all!\n", unused->type->name);
    return FALSE;
    }
if (common->subbedOutCount < 2)
    {
    verbose(3, "Trying to sub in %s, but there's no monomers of type %s that are used more than once.\n", 
	unused->word, unused->type->name);
    return FALSE;
    }
struct dlNode *node;
for (node = ll->head; !dlEnd(node); node = node->next)
    {
    struct monomer *monomer = node->val;
    if (monomer == common)
        {
	verbose(3, "Subbing %s for %s of type %s\n", unused->word, monomer->word, unused->type->name);
	node->val = unused;
	unused->subbedOutCount += 1;
	monomer->subbedOutCount -= 1;
	break;
	}
    }
return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq 0x20(%rsi), %r15
movq %r15, %rdi
callq 0x4880
testq %rax, %rax
je 0x48e6
cmpl $0x2, 0x30(%rax)
jge 0x48ff
movq 0x8(%r14), %rdx
movq 0x8(%r15), %rcx
leaq 0x12255(%rip), %rsi     # 0x16b2d
xorl %ebx, %ebx
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x110f9
jmp 0x4944
movq 0x8(%r15), %rdx
leaq 0x12217(%rip), %rsi     # 0x16b08
xorl %ebx, %ebx
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x110f9
jmp 0x4944
movq (%rbx), %rcx
pushq $0x1
popq %rbx
movq %rcx, %r12
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x4944
movq 0x10(%r12), %r13
cmpq %rax, %r13
jne 0x4905
movq 0x8(%r14), %rdx
movq 0x8(%r13), %rcx
movq 0x8(%r15), %r8
leaq 0x12257(%rip), %rsi     # 0x16b84
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x110f9
movq %r14, 0x10(%r12)
incl 0x30(%r14)
decl 0x30(%r13)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: subInMissing
void subInMissing(struct alphaStore *store, struct dlList *ll)
/* Go figure out missing monomers in ll, and attempt to substitute them in somewhere they would fit. */
{
setInitialSubbedOutCount(store, ll);
struct slRef *unusedList = listUnusedMonomers(store, ll);
verbose(3, "%d monomers, %d unused\n", slCount(store->monomerList), slCount(unusedList));
struct slRef *unusedRef;
for (unusedRef = unusedList; unusedRef != NULL; unusedRef = unusedRef->next)
    {
    struct monomer *unused = unusedRef->val;
    struct monomerRef *neighborhood = findNeighborhoodFromReads(unused);
    if (!subCenterInNeighborhood(store, unused, neighborhood, ll))
	{
	verbose(3, "Couldn't substitute in %s with context, falling back to type logic\n", 
	    unused->word);
        subIntoFirstMostCommonOfType(store, unused, ll);
	}
    slFreeList(&neighborhood);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4950
movq %r14, %rdi
movq %rbx, %rsi
callq 0x429f
movq %rax, %r15
movq (%r14), %rdi
callq 0x6082
movl %eax, %ebp
movq %r15, %rdi
callq 0x6082
leaq 0x121fd(%rip), %rsi     # 0x16ba2
pushq $0x3
popq %rdi
movl %ebp, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x110f9
leaq 0x12200(%rip), %r12     # 0x16bba
movq %rsp, %r13
testq %r15, %r15
je 0x4a10
movq 0x8(%r15), %rbp
movq %rbp, %rdi
callq 0x4378
movq %rax, (%rsp)
movq %r14, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x47c4
testl %eax, %eax
jne 0x4a03
movq 0x8(%rbp), %rdx
pushq $0x3
popq %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x110f9
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x48a3
movq %r13, %rdi
callq 0x615b
movq (%r15), %r15
jmp 0x49bd
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: alphaStoreNew
struct alphaStore *alphaStoreNew(int maxChainSize)
/* Allocate and initialize a new word store. */
{
struct alphaStore *store;
AllocVar(store);
store->maxChainSize = maxChainSize;
store->monomerHash = hashNew(0);
store->typeHash = hashNew(0);
store->readHash = hashNew(0);
return store;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x58
popq %rdi
callq 0xd87c
movq %rax, %r14
movl %ebx, 0x30(%rax)
pushq $0x1
popq %rbx
xorl %edi, %edi
movl %ebx, %esi
callq 0xb010
movq %rax, 0x8(%r14)
xorl %edi, %edi
movl %ebx, %esi
callq 0xb010
movq %rax, 0x40(%r14)
xorl %edi, %edi
movl %ebx, %esi
callq 0xb010
movq %rax, 0x18(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: alphaStoreAddMonomer
struct monomer *alphaStoreAddMonomer(struct alphaStore *store, char *word)
/* Add word to store,  incrementing it's useCount if it's already there, otherwise
 * making up a new record for it. */
{
struct monomer *monomer = hashFindVal(store->monomerHash, word);
if (monomer == NULL)
    {
    AllocVar(monomer);
    hashAddSaveName(store->monomerHash, word, monomer, &monomer->word);
    slAddHead(&store->monomerList, monomer);
    }
monomer->useCount += 1;
monomer->outTarget = monomer->useCount;	    /* Set default value, may be renormalized. */
return monomer;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0xaf0d
movq %rax, %r14
testq %rax, %rax
jne 0x4aab
pushq $0x38
popq %rdi
callq 0xd87c
movq %rax, %r14
movq 0x8(%rbx), %rdi
leaq 0x8(%rax), %rcx
movq %r15, %rsi
movq %rax, %rdx
callq 0xae3b
movq (%rbx), %rax
movq %rax, (%r14)
movq %r14, (%rbx)
movl 0x10(%r14), %eax
incl %eax
movl %eax, 0x10(%r14)
movl %eax, 0x14(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: connectReadsToMonomers
void connectReadsToMonomers(struct alphaStore *store)
/* Add each read monomer appears in to monomer's readList. */
{
struct alphaRead *read;
for (read = store->readList; read != NULL; read = read->next)
    {
    struct monomerRef *ref;
    for (ref = read->list; ref != NULL; ref = ref->next)
        {
	struct monomer *monomer = ref->val;
	refAdd(&monomer->readList, read);
	}
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x10, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x4af3
leaq 0x10(%rbx), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x4acd
movq 0x8(%r14), %rdi
addq $0x28, %rdi
movq %rbx, %rsi
callq 0x6dd9
jmp 0x4ad9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: alphaReadListFromFile
void alphaReadListFromFile(char *fileName, struct alphaStore *store)
/* Read in file and turn it into a list of alphaReads. */
{
/* Stuff for processing file a line at a time. */
struct lineFile *lf = lineFileOpen(fileName, TRUE);
char *line, *word;

/* Loop through each line of file making up a read for it. */
struct alphaRead *readList = NULL;
while (lineFileNextReal(lf, &line))
    {
    /* Parse out first word of line into name, and rest into list. */
    char *name = nextWord(&line);
    struct monomerRef *list = NULL;
    while ((word = nextWord(&line)) != NULL)
        {
	struct monomer *monomer = alphaStoreAddMonomer(store, word);
	struct monomerRef *ref;
	AllocVar(ref);
	ref->val = monomer;
	slAddHead(&list, ref);
	}
    slReverse(&list);
    if (list == NULL)
	errAbort("Line %d of %s has no alpha monomers.", lf->lineIx, lf->fileName);

    /* Create data structure and add read to list and hash */
    if (hashLookup(store->readHash, name))
        errAbort("Read ID %s is repeated line %d of %s", name, lf->lineIx, lf->fileName);
    struct alphaRead *read;
    AllocVar(read);
    read->list = list;
    hashAddSaveName(store->readHash, name, read, &read->name);
    slAddHead(&readList, read);
    }
slReverse(&readList);
store->readList = readList;
if (store->readList == NULL)
    errAbort("%s contains no reads", lf->fileName);
lineFileClose(&lf);
connectReadsToMonomers(store);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
pushq $0x1
popq %rsi
callq 0xbbad
andq $0x0, 0x10(%rsp)
movq %rax, %r14
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %r15
pushq $0x10
popq %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0xc52c
testl %eax, %eax
je 0x4c0d
movq %r15, %rdi
callq 0x6b8e
movq %rax, %r12
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x6b8e
testq %rax, %rax
je 0x4b81
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4a68
movq %rax, %rbp
movq %r13, %rdi
callq 0xd87c
movq %rbp, 0x8(%rax)
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
jmp 0x4b4b
leaq 0x8(%rsp), %rdi
callq 0x613f
cmpq $0x0, 0x8(%rsp)
jne 0x4ba9
movl 0x28(%r14), %esi
movq 0x8(%r14), %rdx
leaq 0x1205c(%rip), %rdi     # 0x16bfe
xorl %eax, %eax
callq 0xa61f
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xaaa4
testq %rax, %rax
je 0x4bd3
movl 0x28(%r14), %edx
movq 0x8(%r14), %rcx
leaq 0x1205a(%rip), %rdi     # 0x16c23
movq %r12, %rsi
xorl %eax, %eax
callq 0xa61f
pushq $0x18
popq %rdi
callq 0xd87c
movq %rax, %rbp
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rbp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rbp), %rcx
movq %r12, %rsi
movq %rbp, %rdx
callq 0xae3b
movq 0x10(%rsp), %rax
movq %rax, (%rbp)
movq %rbp, 0x10(%rsp)
jmp 0x4b2b
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x613f
movq (%r15), %rax
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x4c38
movq 0x8(%r14), %rsi
leaq 0x12017(%rip), %rdi     # 0x16c48
xorl %eax, %eax
callq 0xa61f
leaq 0x18(%rsp), %rdi
callq 0xc178
movq %rbx, %rdi
callq 0x4ac2
addq $0x28, %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: findOrphanStarts
struct alphaOrphan *findOrphanStarts(struct alphaRead *readList, struct alphaStore *store)
/* Return list of monomers that are found only at start of reads. */
{
struct alphaOrphan *orphanList = NULL;

/* Build up hash of things seen later in reads. */
struct alphaRead *read;
struct hash *later = hashNew(0);    /* Hash of monomers found later. */
for (read = readList; read != NULL; read = read->next)
    {
    struct monomerRef *ref;
    for (ref = read->list->next; ref != NULL; ref = ref->next)
        {
	hashAdd(later, ref->val->word, NULL);
	}
    }

/* Pass through again collecting orphans. */
struct hash *orphanHash = hashNew(0);
for (read = readList; read != NULL; read = read->next)
    {
    struct monomer *monomer = read->list->val;
    char *word = monomer->word;
    if (!hashLookup(later, word))
        {
	struct alphaOrphan *orphan = hashFindVal(orphanHash, word);
	if (orphan == NULL)
	    {
	    AllocVar(orphan);
	    orphan->monomer = monomer;
	    slAddHead(&orphanList, orphan);
	    hashAdd(orphanHash, word, orphan);
	    verbose(3, "Adding orphan start %s\n", word);
	    }
	}
    }
hashFree(&later);
hashFree(&orphanHash);
slReverse(&orphanList);
return orphanList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
andq $0x0, (%rsp)
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0xb010
movq %rax, %r14
movq %rax, 0x10(%rsp)
movq %rbx, %r15
testq %r15, %r15
je 0x4cb0
movq 0x10(%r15), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x4cab
movq 0x8(%r12), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xad17
jmp 0x4c8d
movq (%r15), %r15
jmp 0x4c84
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0xb010
movq %rax, %r15
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
testq %rbx, %rbx
je 0x4d36
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rbp
movq 0x8(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0xaaa4
testq %rax, %rax
jne 0x4d31
movq %r15, %rdi
movq %r12, %rsi
callq 0xaf0d
testq %rax, %rax
jne 0x4d31
pushq $0x18
popq %rdi
callq 0xd87c
movq %r13, %rcx
movq %rax, %r13
movq %rbp, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xad17
pushq $0x3
popq %rdi
leaq 0x11f36(%rip), %rsi     # 0x16c5d
movq %r12, %rdx
xorl %eax, %eax
callq 0x110f9
movq (%rbx), %rbx
jmp 0x4cc5
leaq 0x10(%rsp), %rdi
callq 0xb306
leaq 0x8(%rsp), %rdi
callq 0xb306
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x613f
movq (%rbx), %rax
addq $0x18, %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: findOrphanEnds
struct alphaOrphan *findOrphanEnds(struct alphaRead *readList, struct alphaStore *store)
/* Return list of monomers that are found only at end of reads. */
{
struct alphaOrphan *orphanList = NULL;

/* Build up hash of things seen sooner in reads. */
struct alphaRead *read;
struct hash *sooner = hashNew(0);    /* Hash of monomers found sooner. */
for (read = readList; read != NULL; read = read->next)
    {
    struct monomerRef *ref;
    /* Loop over all but last. */
    for (ref = read->list; ref->next != NULL; ref = ref->next)
        {
	hashAdd(sooner, ref->val->word, NULL);
	}
    }

/* Pass through again collecting orphans. */
struct hash *orphanHash = hashNew(0);
for (read = readList; read != NULL; read = read->next)
    {
    struct monomerRef *lastRef = slLastEl(read->list);
    struct monomer *monomer = lastRef->val;
    if (!hashLookup(sooner, monomer->word))
        {
	struct alphaOrphan *orphan = hashFindVal(orphanHash, monomer->word);
	if (orphan == NULL)
	    {
	    AllocVar(orphan);
	    orphan->monomer = monomer;
	    slAddHead(&orphanList, orphan);
	    hashAdd(orphanHash, monomer->word, orphan);
	    verbose(3, "Adding orphan end %s\n", monomer->word);
	    }
	}
    }
hashFree(&sooner);
slReverse(&orphanList);
hashFree(&orphanHash);
return orphanList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
andq $0x0, (%rsp)
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0xb010
movq %rax, %r14
movq %rax, 0x10(%rsp)
movq %rbx, %r15
testq %r15, %r15
je 0x4dc0
leaq 0x10(%r15), %r12
movq (%r12), %r12
cmpq $0x0, (%r12)
je 0x4dbb
movq 0x8(%r12), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xad17
jmp 0x4d9b
movq (%r15), %r15
jmp 0x4d92
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0xb010
movq %rax, %r15
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
testq %rbx, %rbx
je 0x4e4b
movq 0x10(%rbx), %rdi
callq 0x60c6
movq 0x8(%rax), %rbp
movq 0x8(%rbp), %rsi
movq %r14, %rdi
callq 0xaaa4
testq %rax, %rax
jne 0x4e46
movq 0x8(%rbp), %rsi
movq %r15, %rdi
callq 0xaf0d
testq %rax, %rax
jne 0x4e46
pushq $0x18
popq %rdi
callq 0xd87c
movq %rax, %r12
movq %rbp, 0x8(%rax)
movq %r13, (%rax)
movq %rax, (%rsp)
movq 0x8(%rbp), %rsi
movq %r15, %rdi
movq %rax, %rdx
callq 0xad17
movq 0x8(%rbp), %rdx
pushq $0x3
popq %rdi
leaq 0x11e39(%rip), %rsi     # 0x16c75
xorl %eax, %eax
callq 0x110f9
movq %r12, %r13
movq (%rbx), %rbx
jmp 0x4dd5
leaq 0x10(%rsp), %rdi
callq 0xb306
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x613f
leaq 0x8(%rsp), %rdi
callq 0xb306
movq (%rbx), %rax
addq $0x18, %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: addReadOfTwo
struct alphaRead *addReadOfTwo(struct alphaStore *store, struct monomer *a, struct monomer *b)
/* Make up a fake read that goes from a to b and add it to store. */
{
/* Create fake name and start fake read with it. */
static int fakeId = 0;
char name[32];
safef(name, sizeof(name), "fake%d", ++fakeId);

/* Allocate fake read. */
struct alphaRead *read;
AllocVar(read);

/* Add a and b to the read. */
struct monomerRef *aRef, *bRef;
AllocVar(aRef);
aRef->val = a;
AllocVar(bRef);
bRef->val = b;
aRef->next = bRef;
read->list = aRef;

/* Add read to the store. */
slAddHead(&store->readList, read);
hashAddSaveName(store->readHash, name, read, &read->name);

/* Add read to the monomers. */
refAdd(&a->readList, read);
refAdd(&b->readList, read);

a->useCount += 1;
b->useCount += 1;
return read;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x219ab(%rip), %ecx     # 0x26844
incl %ecx
movl %ecx, 0x219a3(%rip)     # 0x26844
leaq 0x11de3(%rip), %rdx     # 0x16c8b
movq %rsp, %rdi
pushq $0x20
popq %rsi
xorl %eax, %eax
callq 0x939d
pushq $0x18
popq %rdi
callq 0xd87c
movq %rax, %r12
pushq $0x10
popq %rbp
movq %rbp, %rdi
callq 0xd87c
movq %rax, %r13
movq %r14, 0x8(%rax)
movq %rbp, %rdi
callq 0xd87c
movq %rbx, 0x8(%rax)
movq %rax, (%r13)
movq %r13, 0x10(%r12)
movq 0x10(%r15), %rax
movq %rax, (%r12)
movq %r12, 0x10(%r15)
movq 0x18(%r15), %rdi
leaq 0x8(%r12), %rcx
movq %rsp, %rsi
movq %r12, %rdx
callq 0xae3b
leaq 0x28(%r14), %rdi
movq %r12, %rsi
callq 0x6dd9
leaq 0x28(%rbx), %rdi
movq %r12, %rsi
callq 0x6dd9
incl 0x10(%r14)
incl 0x10(%rbx)
movq %r12, %rax
addq $0x28, %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: wordTreeSort
static void wordTreeSort(struct wordTree *wt)
/* Sort all children lists in tree. */
{
slSort(&wt->children, wordTreeCmpWord);
struct wordTree *child;
for (child = wt->children; child != NULL; child = child->next)
    wordTreeSort(child);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rbx
leaq -0x1967(%rip), %rsi     # 0x38f5
movq %rbx, %rdi
callq 0x6183
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x5276
movq %rbx, %rdi
callq 0x524d
jmp 0x5264
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: wordTreeWrite
void wordTreeWrite(struct wordTree *wt, int maxChainSize, char *fileName)
/* Write out tree to file */
{
FILE *f = mustOpen(fileName, "w");
fprintf(f, "#level\tuseCount\toutTarget\toutCount\tnormVal\tmonomers\n");
wordTreeDump(0, wt, maxChainSize, f);
carefulClose(&f);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x127a7(%rip), %rsi     # 0x17a33
movq %rdx, %rdi
callq 0x8645
movq %rax, %r15
movq %rsp, %r12
movq %rax, (%r12)
leaq 0x11aa5(%rip), %rdi     # 0x16d4a
pushq $0x34
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x36f0
xorl %edi, %edi
movq %r14, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x3c6e
movq %r12, %rdi
callq 0x8c9c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: crossCheckMonomerOrderAndReads
void crossCheckMonomerOrderAndReads(struct alphaStore *store, char *orderedPrefix, char *readFile, char *typeFile)
/* Make sure all monomer that begin with ordered prefix are present in monomer order file. */
{
/* Make hash of all monomers that have type info. */
struct hash *orderHash = hashNew(0);
struct monomerType *type;
for (type = store->typeList; type != NULL; type = type->next)
     {
     struct monomerRef *ref;
     for (ref = type->list; ref != NULL; ref = ref->next)
         hashAdd(orderHash, ref->val->word, ref->val);
     }

/* Go through all monomers and make sure ones with correct prefix are in list. */
struct monomer *mon;
for (mon = store->monomerList; mon != NULL; mon = mon->next)
    {
    char *word = mon->word;
    if (startsWith(orderedPrefix, word) && !hashLookup(orderHash, word))
        {
	errAbort("%s is in %s but not %s", word, readFile, typeFile);
	}
    }
hashFree(&orderHash);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0xb010
movq %rax, %r13
movq %rax, 0x10(%rsp)
leaq 0x38(%r12), %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x5533
leaq 0x10(%rbp), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x550c
movq 0x8(%rbx), %rdx
movq 0x8(%rdx), %rsi
movq %r13, %rdi
callq 0xad17
jmp 0x5519
leaq 0x1186c(%rip), %rbx     # 0x16da6
movq (%r12), %r12
testq %r12, %r12
je 0x557e
movq 0x8(%r12), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x76a5
testl %eax, %eax
je 0x553a
movq %r13, %rdi
movq %rbp, %rsi
callq 0xaaa4
testq %rax, %rax
jne 0x553a
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0xa61f
jmp 0x553a
leaq 0x10(%rsp), %rdi
callq 0xb306
addq $0x18, %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: monomerListNormalise
void monomerListNormalise(struct monomer *list, int totalCount, int outputSize)
/* Set outTarget field in all of list to be normalized to outputSize */
{
struct monomer *monomer;
double scale = (double)outputSize/totalCount;
for (monomer = list; monomer != NULL; monomer = monomer->next)
    {
    monomer->outCount = 0;
    monomer->outTarget = round(scale * monomer->useCount);
    }
}

// Assembly:
cvtsi2sd %edx, %xmm0
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
movsd 0x10a5d(%rip), %xmm1    # 0x16008
testq %rdi, %rdi
je 0x55cd
andl $0x0, 0x18(%rdi)
cvtsi2sdl 0x10(%rdi), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %eax
movl %eax, 0x14(%rdi)
movq (%rdi), %rdi
jmp 0x55ab
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: fillInTypes
void fillInTypes(struct alphaStore *store)
/* We have types for most but not all monomers. Try and fill out types for most of
 * the rest by looking for position in reads they are in that do contain known types */
{
/* Do first pass on ones defined - just have to look them up in hash. */
struct monomer *monomer;
for (monomer = store->monomerList; monomer != NULL; monomer = monomer->next)
    monomer->type = hashFindVal(store->typeHash, monomer->word);

/* Do second pass on ones that are not yet defined */
for (monomer = store->monomerList; monomer != NULL; monomer = monomer->next)
    {
    if (monomer->type == NULL)
	{
	monomer->type = fillInTypeFromReads(monomer, store);
	}
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x5849
movq 0x40(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0xaf0d
movq %rax, 0x20(%r14)
jmp 0x582e
movq %rbx, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x586c
cmpq $0x0, 0x20(%r14)
jne 0x584c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5603
movq %rax, 0x20(%r14)
jmp 0x584c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: countMissingMonomers
int countMissingMonomers(struct dlList *ll, struct monomer *monomerList)
/* Set the outCounts in monomer list to match how often they occur in ll.
 * Return number of monomers that do not occur at all in ll. */
{
/* Zero out output counts. */
struct monomer *monomer;
for (monomer = monomerList; monomer != NULL; monomer = monomer->next)
    monomer->outCount = 0;

/* Increase output count each time a monomer is used. */
struct dlNode *node;
for (node = ll->head; !dlEnd(node); node = node->next)
    {
    monomer = node->val;
    monomer->outCount += 1;
    }

/* Count up unused. */
int missing = 0;
for (monomer = monomerList; monomer != NULL; monomer = monomer->next)
    if (monomer->outCount == 0 && !sameString(monomer->word, ""))
        missing += 1;

return missing;
}

// Assembly:
movq %rsi, %rax
testq %rax, %rax
je 0x5a76
andl $0x0, 0x18(%rax)
movq (%rax), %rax
jmp 0x5a68
movq (%rdi), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x5a8d
movq 0x10(%rax), %rax
incl 0x18(%rax)
movq %rcx, %rax
jmp 0x5a79
xorl %eax, %eax
testq %rsi, %rsi
je 0x5aa9
cmpl $0x0, 0x18(%rsi)
jne 0x5aa4
movq 0x8(%rsi), %rcx
cmpb $0x1, (%rcx)
sbbl $-0x1, %eax
movq (%rsi), %rsi
jmp 0x5a8f
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: main
int main(int argc, char *argv[])
/* Process command line. */
{
optionInit(&argc, argv, options);
if (argc != 4)
    usage();
maxChainSize = optionInt("size", maxChainSize);
initialOutSize = optionInt("initialOutSize", initialOutSize);
maxOutSize = optionInt("maxOutSize", initialOutSize);  // Defaults to same as initialOutSize
if (maxOutSize < initialOutSize)
    errAbort("maxOutSize (%d) needs to be bigger than initialOutSize (%d)\n", 
	maxOutSize, initialOutSize);
maxToMiss = optionInt("maxToMiss", maxToMiss);
fullOnly = optionExists("fullOnly");
pseudoCount = optionInt("pseudoCount", pseudoCount);
betweens = optionExists("betweens");
int seed = optionInt("seed", 0);
srand(seed);
linearSat(argv[1], argv[2], argv[3]);
return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %r14
movl %edi, (%r14)
leaq 0x206a1(%rip), %rdx     # 0x26400
movq %r14, %rdi
callq 0xf1d7
cmpl $0x4, (%r14)
je 0x5d72
callq 0x38bc
movl 0x2067c(%rip), %esi     # 0x263f4
leaq 0x11359(%rip), %rdi     # 0x170d8
callq 0xf2ae
movl %eax, 0x2066a(%rip)     # 0x263f4
movl 0x20668(%rip), %esi     # 0x263f8
leaq 0x11346(%rip), %rdi     # 0x170dd
callq 0xf2ae
movl %eax, 0x20656(%rip)     # 0x263f8
leaq 0x11343(%rip), %rdi     # 0x170ec
movl %eax, %esi
callq 0xf2ae
movl %eax, 0x20a92(%rip)     # 0x26848
movl 0x2063c(%rip), %edx     # 0x263f8
cmpl %edx, %eax
jge 0x5dd0
leaq 0x11330(%rip), %rdi     # 0x170f7
movl %eax, %esi
xorl %eax, %eax
callq 0xa61f
movl 0x2085a(%rip), %esi     # 0x26630
leaq 0x11357(%rip), %rdi     # 0x17134
callq 0xf2ae
movl %eax, 0x20848(%rip)     # 0x26630
leaq 0x1134f(%rip), %rdi     # 0x1713e
callq 0xf4e4
movl %eax, 0x2083a(%rip)     # 0x26634
movl 0x205f0(%rip), %esi     # 0x263f0
leaq 0x11340(%rip), %rdi     # 0x17147
callq 0xf2ae
movl %eax, 0x205de(%rip)     # 0x263f0
leaq 0x1133a(%rip), %rdi     # 0x17153
callq 0xf4e4
movl %eax, 0x20814(%rip)     # 0x26638
leaq 0x11331(%rip), %rdi     # 0x1715c
xorl %esi, %esi
callq 0xf2ae
movl %eax, %edi
callq 0x33e0
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
callq 0x5aaa
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: cloneStringZExt
static char *cloneStringZExt(const char *s, int size, int copySize)
/* Make a zero terminated copy of string in memory */
{
char *d = needMem(copySize+1);
copySize = min(size,copySize);
memcpy(d, s, copySize);
d[copySize] = 0;
return d;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
leal 0x1(%rbx), %eax
movslq %eax, %rdi
callq 0xd87c
movq %rax, %r15
cmpl %ebx, %ebp
cmovll %ebp, %ebx
movslq %ebx, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x34a0
movb $0x0, (%r15,%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: reverseBytes
void reverseBytes(char *bytes, long length)
{
long halfLen = (length>>1);
char *end = bytes+length;
char c;
while (--halfLen >= 0)
    {
    c = *bytes;
    *bytes++ = *--end;
    *end = c;
    }
}

// Assembly:
leaq (%rsi,%rdi), %rax
decq %rax
sarq %rsi
testq %rsi, %rsi
jle 0x5fbd
decq %rsi
movb (%rdi), %cl
movb (%rax), %dl
movb %dl, (%rdi)
incq %rdi
movb %cl, (%rax)
decq %rax
jmp 0x5fa5
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: reverseInts
void reverseInts(int *a, int length)
/* Reverse the order of the integer array. */
{
int halfLen = (length>>1);
int *end = a+length;
int c;
while (--halfLen >= 0)
    {
    c = *a;
    *a++ = *--end;
    *end = c;
    }
}

// Assembly:
movslq %esi, %rax
sarl %esi
leaq (%rdi,%rax,4), %rax
addq $-0x4, %rax
testl %esi, %esi
jle 0x5fe3
decl %esi
movl (%rdi), %ecx
movl (%rax), %edx
movl %edx, (%rdi)
addq $0x4, %rdi
movl %ecx, (%rax)
addq $-0x4, %rax
jmp 0x5fcb
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: reverseUnsigned
void reverseUnsigned(unsigned *a, int length)
/* Reverse the order of the unsigned array. */
{
int halfLen = (length>>1);
unsigned *end = a+length;
unsigned c;
while (--halfLen >= 0)
    {
    c = *a;
    *a++ = *--end;
    *end = c;
    }
}

// Assembly:
movslq %esi, %rax
sarl %esi
leaq (%rdi,%rax,4), %rax
addq $-0x4, %rax
testl %esi, %esi
jle 0x6009
decl %esi
movl (%rdi), %ecx
movl (%rax), %edx
movl %edx, (%rdi)
addq $0x4, %rdi
movl %ecx, (%rax)
addq $-0x4, %rax
jmp 0x5ff1
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: reverseDoubles
void reverseDoubles(double *a, int length)
/* Reverse the order of the double array. */
{
int halfLen = (length>>1);
double *end = a+length;
double c;
while (--halfLen >= 0)
    {
    c = *a;
    *a++ = *--end;
    *end = c;
    }
}

// Assembly:
movslq %esi, %rax
sarl %esi
leaq (%rdi,%rax,8), %rax
addq $-0x8, %rax
testl %esi, %esi
jle 0x6037
decl %esi
movsd (%rdi), %xmm0
movsd (%rax), %xmm1
movsd %xmm1, (%rdi)
addq $0x8, %rdi
movsd %xmm0, (%rax)
addq $-0x8, %rax
jmp 0x6017
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: reverseStrings
void reverseStrings(char **a, int length)
/* Reverse the order of the char* array. */
{
int halfLen = (length>>1);
char **end = a+length;
char *c;
while (--halfLen >= 0)
    {
    c = *a;
    *a++ = *--end;
    *end = c;
    }
}

// Assembly:
movslq %esi, %rax
sarl %esi
leaq (%rdi,%rax,8), %rax
addq $-0x8, %rax
testl %esi, %esi
jle 0x6061
decl %esi
movq (%rdi), %rcx
movq (%rax), %rdx
movq %rdx, (%rdi)
addq $0x8, %rdi
movq %rcx, (%rax)
addq $-0x8, %rax
jmp 0x6045
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: swapBytes
void swapBytes(char *a, char *b, int length)
{
char c;
int i;

for (i=0; i<length; ++i)
    {
    c = a[i];
    a[i] = b[i];
    b[i] = c;
    }
}

// Assembly:
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
cmpq %rax, %rdx
je 0x6081
movb (%rdi,%rax), %cl
movb (%rsi,%rax), %r8b
movb %r8b, (%rdi,%rax)
movb %cl, (%rsi,%rax)
incq %rax
jmp 0x6069
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: slElementFromIx
void *slElementFromIx(void *list, int ix)
/* Return the ix'th element in list.  Returns NULL
 * if no such element. */
{
struct slList *pt = (struct slList *)list;
int i;
for (i=0;i<ix;i++)
    {
    if (pt == NULL) return NULL;
    pt = pt->next;
    }
return pt;
}

// Assembly:
movq %rdi, %rax
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
subl $0x1, %esi
jb 0x60ac
testq %rax, %rax
je 0x60aa
movq (%rax), %rax
jmp 0x609b
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: slFreeList
void slFreeList(void *listPt)
/* Free list */
{
struct slList **ppt = (struct slList**)listPt;
struct slList *next = *ppt;
struct slList *el;

while (next != NULL)
    {
    el = next;
    next = el->next;
    freeMem((char*)el);
    }
*ppt = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x6177
movq (%rdi), %r14
callq 0xd8f9
movq %r14, %rdi
jmp 0x6165
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: slSort
void slSort(void *pList, int (*compare )(const void *elem1,  const void *elem2))
/* Sort a singly linked list with Qsort and a temporary array. */
{
struct slList **pL = (struct slList **)pList;
struct slList *list = *pL;
int count;
count = slCount(list);
if (count > 1)
    {
    struct slList *el;
    struct slList **array;
    int i;
    array = needLargeMem(count * sizeof(*array));
    for (el = list, i=0; el != NULL; el = el->next, i++)
        array[i] = el;
    qsort(array, count, sizeof(array[0]), compare);
    list = NULL;
    for (i=0; i<count; ++i)
        {
        array[i]->next = list;
        list = array[i];
        }
    freeMem(array);
    slReverse(&list);
    *pL = list;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %r13
movq %r13, %rdi
callq 0x6082
cmpl $0x2, %eax
jl 0x6213
movl %eax, %r14d
leaq (,%r14,8), %rdi
callq 0xd684
movq %rax, %r15
testq %r13, %r13
je 0x61cb
movq %r13, (%rax)
movq (%r13), %r13
addq $0x8, %rax
jmp 0x61b9
pushq $0x8
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x3120
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %rax, %r14
je 0x61f5
movq (%r15,%rax,8), %rdx
movq %rcx, (%rdx)
movq (%r15,%rax,8), %rcx
incq %rax
jmp 0x61e0
leaq 0x8(%rsp), %r14
movq %rcx, (%r14)
movq %r15, %rdi
callq 0xd8f9
movq %r14, %rdi
callq 0x613f
movq (%r14), %rax
movq %rax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: slUniqify
void slUniqify(void *pList, int (*compare )(const void *elem1,  const void *elem2), void (*free)())
/* Return sorted list with duplicates removed.
 * Compare should be same type of function as slSort's compare (taking
 * pointers to pointers to elements.  Free should take a simple
 * pointer to dispose of duplicate element, and can be NULL. */
{
struct slList **pSlList = (struct slList **)pList;
struct slList *oldList = *pSlList;
struct slList *newList = NULL, *el;

slSort(&oldList, compare);
while ((el = slPopHead(&oldList)) != NULL)
    {
    if ((newList == NULL) || (compare(&newList, &el) != 0))
        slAddHead(&newList, el);
    else if (free != NULL)
        free(el);
    }
slReverse(&newList);
*pSlList = newList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rax
leaq 0x10(%rsp), %r13
movq %rax, (%r13)
leaq 0x8(%rsp), %r12
andq $0x0, (%r12)
movq %r13, %rdi
callq 0x6183
movq (%r13), %rax
movq %rsp, %r13
testq %rax, %rax
je 0x62b2
movq (%rax), %rbp
andq $0x0, (%rax)
movq %rax, (%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x628d
movq %r12, %rdi
movq %r13, %rsi
callq *%r15
testl %eax, %eax
je 0x629c
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
jmp 0x628f
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rax, 0x8(%rsp)
movq %rbp, %rax
jmp 0x625d
movq %rbp, %rax
testq %r14, %r14
je 0x625d
movq (%rsp), %rdi
xorl %eax, %eax
callq *%r14
movq %rbp, %rax
jmp 0x625d
andq $0x0, (%rsp)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x613f
movq (%r14), %rax
movq %rax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: slRemoveEl
boolean slRemoveEl(void *vpList, void *vToRemove)
/* Remove element from doubly linked list.  Usage:
 *    slRemove(&list, el);
 * Returns TRUE if element in list.  */
{
struct slList **pList = vpList;
struct slList *toRemove = vToRemove;
struct slList *el, *next, *newList = NULL;
boolean didRemove = FALSE;

for (el = *pList; el != NULL; el = next)
    {
    next = el->next;
    if (el != toRemove)
	{
	slAddHead(&newList, el);
	}
    else
        didRemove = TRUE;
    }
slReverse(&newList);
*pList = newList;
return didRemove;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rdx
xorl %eax, %eax
pushq $0x1
popq %rcx
xorl %ebp, %ebp
movl %ebp, %r8d
movl %r8d, %ebp
testq %rdx, %rdx
je 0x635c
movq %rdx, %rdi
movq (%rdx), %rdx
movl %ecx, %r8d
cmpq %rsi, %rdi
je 0x633e
movq %rax, (%rdi)
movq %rdi, %rax
jmp 0x633b
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
callq 0x613f
movq (%r14), %rax
movq %rax, (%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: doubleMedian
double doubleMedian(int count, double *array)
/* Return median value in array.  This will sort
 * the array as a side effect. */
{
double median;
doubleSort(count, array);
if ((count&1) == 1)
    median = array[count>>1];
else
    {
    count >>= 1;
    median = (array[count] + array[count-1]) * 0.5;
    }
return median;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x63ba
movl %ebp, %eax
sarl %eax
cltq
movsd (%rbx,%rax,8), %xmm0
testb $0x1, %bpl
jne 0x6423
addsd -0x8(%rbx,%rax,8), %xmm0
mulsd 0xfbe5(%rip), %xmm0     # 0x16008
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: doubleBoxWhiskerCalc
void doubleBoxWhiskerCalc(int count, double *array, double *retMin,
                          double *retQ1, double *retMedian, double *retQ3, double *retMax)
/* Calculate what you need to draw a box and whiskers plot from an array of doubles. */
{
doubleSort(count, array);
*retMin = array[0];
*retQ1 = array[(count+2)/4];
int halfCount = count>>1;
if ((count&1) == 1)
    *retMedian = array[halfCount];
else
    {
    *retMedian = (array[halfCount] + array[halfCount-1]) * 0.5;
    }
*retQ3 = array[(3*count+2)/4];
*retMax = array[count-1];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r14
movl %edi, %r15d
callq 0x63ba
movsd (%r14), %xmm0
movsd %xmm0, (%rbp)
leal 0x2(%r15), %eax
pushq $0x4
popq %rcx
cltd
idivl %ecx
cltq
movsd (%r14,%rax,8), %xmm0
movsd %xmm0, (%r13)
movl %r15d, %eax
sarl %eax
cltq
movsd (%r14,%rax,8), %xmm0
testb $0x1, %r15b
jne 0x6490
addsd -0x8(%r14,%rax,8), %xmm0
mulsd 0xfb78(%rip), %xmm0     # 0x16008
movsd %xmm0, (%r12)
leal (%r15,%r15,2), %eax
addl $0x2, %eax
cltd
idivl %ecx
cltq
movsd (%r14,%rax,8), %xmm0
movsd %xmm0, (%rbx)
movslq %r15d, %rax
movsd -0x8(%r14,%rax,8), %xmm0
movq 0x40(%rsp), %rax
movsd %xmm0, (%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/lib/common.c
// Function: slDoubleCmp
int slDoubleCmp(const void *va, const void *vb)
/* Compare two slDoubles. */
{
const struct slDouble *a = *((struct slDouble **)va);
const struct slDouble *b = *((struct slDouble **)vb);
double diff = a->val - b->val;
if (diff < 0)
    return -1;
else if (diff > 0)
    return 1;
else
    return 0;
}

// Assembly:
movq (%rdi), %rax
movq (%rsi), %rcx
movsd 0x8(%rax), %xmm0
subsd 0x8(%rcx), %xmm0
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
ucomisd %xmm1, %xmm0
seta %cl
ucomisd %xmm0, %xmm1
pushq $-0x1
popq %rax
cmovbel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: slDoubleMedian
double slDoubleMedian(struct slDouble *list)
/* Return median value on list. */
{
int i,count = slCount(list);
struct slDouble *el;
double *array, median;
if (count == 0)
    errAbort("Can't take median of empty list");
AllocArray(array,count);
for (i=0, el=list; i<count; ++i, el=el->next)
    array[i] = el->val;
median = doubleMedian(count, array);
freeMem(array);
return median;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x6082
movl %eax, %ebp
testl %eax, %eax
jne 0x6534
leaq 0x10caa(%rip), %rdi     # 0x171d7
xorl %eax, %eax
callq 0xa61f
movslq %ebp, %rdi
shlq $0x3, %rdi
callq 0xd6eb
movq %rax, %r14
xorl %eax, %eax
testl %ebp, %ebp
movl %ebp, %ecx
cmovlel %eax, %ecx
cmpq %rax, %rcx
je 0x6564
movsd 0x8(%rbx), %xmm0
movsd %xmm0, (%r14,%rax,8)
incq %rax
movq (%rbx), %rbx
jmp 0x654c
movl %ebp, %edi
movq %r14, %rsi
callq 0x63f7
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
callq 0xd8f9
movsd 0x8(%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: slDoubleBoxWhiskerCalc
void slDoubleBoxWhiskerCalc(struct slDouble *list, double *retMin,
                            double *retQ1, double *retMedian, double *retQ3, double *retMax)
/* Calculate what you need to draw a box and whiskers plot from a list of slDoubles. */
{
int i,count = slCount(list);
struct slDouble *el;
double *array;
if (count == 0)
    errAbort("Can't take do slDoubleBoxWhiskerCalc of empty list");
AllocArray(array,count);
for (i=0, el=list; i<count; ++i, el=el->next)
    array[i] = el->val;
doubleBoxWhiskerCalc(count, array, retMin, retQ1, retMedian, retQ3, retMax);
freeMem(array);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r12
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbp
callq 0x6082
movl %eax, %ebx
testl %eax, %eax
jne 0x65c8
leaq 0x10c36(%rip), %rdi     # 0x171f7
xorl %eax, %eax
callq 0xa61f
movslq %ebx, %rdi
shlq $0x3, %rdi
callq 0xd6eb
movq %rax, %r14
xorl %eax, %eax
testl %ebx, %ebx
movl %ebx, %ecx
cmovlel %eax, %ecx
cmpq %rax, %rcx
je 0x65f9
movsd 0x8(%rbp), %xmm0
movsd %xmm0, (%r14,%rax,8)
incq %rax
movq (%rbp), %rbp
jmp 0x65e0
movq %r12, (%rsp)
movl %ebx, %edi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
callq 0x642a
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd8f9
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: intMedian
int intMedian(int count, int *array)
/* Return median value in array.  This will sort
 * the array as a side effect. */
{
int median;
intSort(count, array);
if ((count&1) == 1)
    median = array[count>>1];
else
    {
    count >>= 1;
    median = (array[count] + array[count-1]) * 0.5;
    }
return median;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x662d
movl %ebp, %eax
sarl %eax
movslq %eax, %rcx
movl (%rbx,%rcx,4), %eax
testb $0x1, %bpl
jne 0x668b
addl -0x4(%rbx,%rcx,4), %eax
cvtsi2sd %eax, %xmm0
mulsd 0xf981(%rip), %xmm0     # 0x16008
cvttsd2si %xmm0, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/common.c
// Function: newSlName
struct slName *newSlName(char *name)
/* Return a new name. */
{
struct slName *sn;
if (name != NULL)
    {
    int len = strlen(name);
    sn = needMem(sizeof(*sn)+len);
    strcpy(sn->name, name);
    return sn;
    }
else
    {
    AllocVar(sn);
    }
return sn;
}

// Assembly:
testq %rdi, %rdi
je 0x66c9
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3200
movslq %eax, %rdi
addq $0x10, %rdi
callq 0xd87c
movq %rax, %r14
leaq 0x8(%rax), %rdi
movq %rbx, %rsi
callq 0x30e0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
jmp 0xd87c