// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x12400
movq %rax, -0x20(%rbp)
xorl %edi, %edi
movl $0x1, %esi
callq 0x10f70
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x13510
cmpl $0x0, %eax
je 0x64bb
leaq -0x28(%rbp), %rdi
callq 0x9050
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x104b0
cmpq $0x0, %rax
je 0x63c9
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x1d9ad(%rip), %rdi     # 0x23d6f
movb $0x0, %al
callq 0xfd50
movl $0x18, %edi
callq 0x152f0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x7530
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
movq -0x48(%rbp), %rsi
callq 0x39e0
leaq -0x28(%rbp), %rdi
callq 0x9050
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x648e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x10d00
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x6449
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rcx
leaq 0x1d954(%rip), %rdi     # 0x23d96
movb $0x0, %al
callq 0xfd50
movl $0x10, %edi
callq 0x152f0
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rdi
addq $0x10, %rdi
movq -0x58(%rbp), %rsi
callq 0x39e0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x10ad0
jmp 0x63fc
movq -0x48(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x64b6
movq -0x20(%rbp), %rax
movl 0x28(%rax), %esi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x1d8fe(%rip), %rdi     # 0x23dad
movb $0x0, %al
callq 0xfd50
jmp 0x6372
movq -0x8(%rbp), %rdi
addq $0x38, %rdi
callq 0x7bb0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x64e9
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x1d912(%rip), %rdi     # 0x23df4
movb $0x0, %al
callq 0xfd50
leaq -0x20(%rbp), %rdi
callq 0x12ea0
leaq -0x38(%rbp), %rdi
callq 0x11620
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x78f0
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl 0x28(%rax), %ecx
movq -0x18(%rbp), %r8
movl $0x3, %edi
leaq 0x1d8db(%rip), %rsi     # 0x23e00
movb $0x0, %al
callq 0x1adf0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x78f0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x8(%rbp), %rax
movslq 0x48(%rax), %rdi
shlq $0x3, %rdi
callq 0x15070
movq -0x8(%rbp), %rcx
movq %rax, 0x50(%rcx)
movq %rax, -0x60(%rbp)
movl $0x0, -0x6c(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x68(%rbp)
movl -0x6c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jge 0x65a4
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movq -0x68(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x6572
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)