// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/linearSat/linearSat.c
// Function: alphaStoreLoadMonomerOrder
void alphaStoreLoadMonomerOrder(struct alphaStore *store, char *readsFile, char *fileName)
/* Read in a file with one line for each monomer type, where first word is type name,
 * and rest of words are all the actually variants of that type.
 * Requires all variants already be in store.  The readsFile is passed
 * just for nicer error reporting. */
{
/* Stuff for processing file a line at a time. */
struct lineFile *lf = lineFileOpen(fileName, TRUE);
char *line, *word;
struct hash *uniq = hashNew(0);

/* Set up variables we'll put results in in store. */
store->typeList = NULL;

while (lineFileNextReal(lf, &line))
    {
    char *name = nextWord(&line);
    if (hashLookup(uniq, name) != NULL)
        errAbort("Type name '%s' repeated line %d of %s\n", name, lf->lineIx, lf->fileName);
    struct monomerType *type;
    AllocVar(type);
    type->name = cloneString(name);
    slAddHead(&store->typeList, type);
    while ((word = nextWord(&line)) != NULL)
        {
	struct monomer *monomer = hashFindVal(store->monomerHash, word);
	if (monomer == NULL)
	    errAbort("%s is in %s but not %s", word, lf->fileName, readsFile);
	struct monomerRef *ref;
	AllocVar(ref);
	ref->val = monomer;
	slAddHead(&type->list, ref);
	hashAddUnique(store->typeHash, word, type);
	}
    if (type->list == NULL)
        errAbort("Short line %d of %s.  Format should be:\ntype list-of-monomers-of-type\n",
	    lf->lineIx, lf->fileName);
    }
slReverse(&store->typeList);
if (store->typeList == NULL)
    errAbort("%s is empty", lf->fileName);
lineFileClose(&lf);
hashFree(&uniq);
verbose(3, "Added %d types containing %d words from %s\n", 
    slCount(store->typeList), store->typeHash->elCount, fileName);

/* Create type array */
store->typeCount = slCount(store->typeList);
struct monomerType **types = AllocArray(store->typeArray, store->typeCount);
struct monomerType *type;
int i;
for (i=0, type = store->typeList; i<store->typeCount; ++i, type = type->next)
    types[i] = type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, %rbx
pushq $0x1
popq %rbp
movq %rdx, 0x18(%rsp)
movq %rdx, %rdi
movl %ebp, %esi
callq 0xbbad
movq %rax, (%rsp)
movq %rax, 0x28(%rsp)
xorl %edi, %edi
movl %ebp, %esi
callq 0xb010
movq %rax, 0x10(%rsp)
andq $0x0, 0x38(%rbx)
leaq 0x38(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rbp
pushq $0x10
popq %r14
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0xc52c
testl %eax, %eax
je 0x5431
movq %rbp, %rdi
callq 0x6b8e
movq %rax, %r13
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xaaa4
testq %rax, %rax
je 0x5379
movq (%rsp), %rax
movl 0x28(%rax), %edx
movq 0x8(%rax), %rcx
leaq 0x11a10(%rip), %rdi     # 0x16d7f
movq %r13, %rsi
xorl %eax, %eax
callq 0xa61f
pushq $0x18
popq %rdi
callq 0xd87c
movq %rax, %r15
movq %r13, %rdi
callq 0x5ede
movq %rax, 0x8(%r15)
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq %rax, (%r15)
movq %r15, (%rcx)
movq %rbp, %rdi
callq 0x6b8e
testq %rax, %rax
je 0x5408
movq %rax, %r13
movq 0x8(%rbx), %rdi
movq %rax, %rsi
callq 0xaf0d
movq %rax, %r12
testq %rax, %rax
jne 0x53e0
movq (%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x119d5(%rip), %rdi     # 0x16da6
movq %r13, %rsi
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0xa61f
movq %r14, %rdi
callq 0xd87c
movq %r12, 0x8(%rax)
movq 0x10(%r15), %rcx
movq %rcx, (%rax)
movq %rax, 0x10(%r15)
movq 0x40(%rbx), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xadff
jmp 0x539e
cmpq $0x0, 0x10(%r15)
jne 0x532c
movq (%rsp), %rax
movl 0x28(%rax), %esi
movq 0x8(%rax), %rdx
leaq 0x11998(%rip), %rdi     # 0x16dbd
xorl %eax, %eax
callq 0xa61f
jmp 0x532c
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x613f
cmpq $0x0, (%r15)
jne 0x545a
movq (%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x119b1(%rip), %rdi     # 0x16e04
xorl %eax, %eax
callq 0xa61f
leaq 0x28(%rsp), %rdi
callq 0xc178
leaq 0x10(%rsp), %rdi
callq 0xb306
movq 0x38(%rbx), %rdi
callq 0x6082
movq 0x40(%rbx), %rcx
movl 0x28(%rcx), %ecx
leaq 0x1198b(%rip), %rsi     # 0x16e10
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %eax, %edx
movq 0x18(%rsp), %r8
xorl %eax, %eax
callq 0x110f9
movq 0x38(%rbx), %rdi
callq 0x6082
movl %eax, 0x48(%rbx)
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0xd6eb
movq %rax, 0x50(%rbx)
movslq 0x48(%rbx), %rcx
cmpq %rcx, %r14
jge 0x54ca
movq (%r15), %r15
movq %r15, (%rax,%r14,8)
incq %r14
jmp 0x54b9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq