LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslSwap
void pslSwap(struct psl *psl, boolean noRc)
/* swap query and target in psl.  If noRc is TRUE, don't reverse-complement
 * PSL if needed, instead make target strand explict. */
{
int itmp;
unsigned utmp;
char ctmp, *stmp; 
swapVars(psl->qBaseInsert, psl->tBaseInsert, utmp);
swapVars(psl->tNumInsert, psl->qNumInsert, utmp);
swapVars(psl->qName, psl->tName, stmp);
swapVars(psl->qSize, psl->tSize, utmp);
swapVars(psl->qStart, psl->tStart, itmp);
swapVars(psl->qEnd, psl->tEnd, itmp);

/* handle strand and block copy */
if (psl->strand[1] != '\0')
    {
    /* translated */
    swapVars(psl->strand[0], psl->strand[1], ctmp);
    swapBlocks(psl);
    }
else if (noRc)
    {
    /* untranslated with no reverse complement */
    psl->strand[1] = psl->strand[0];
    psl->strand[0] = '+';
    swapBlocks(psl);
    }
else
    {
    /* untranslated */
    if (psl->strand[0] == '+')
        swapBlocks(psl);
    else
        swapRCBlocks(psl);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
movq %rax, 0x20(%rdi)
movq %rcx, 0x18(%rdi)
movups 0x30(%rdi), %xmm0
movups 0x48(%rdi), %xmm1
movups %xmm1, 0x30(%rdi)
movups %xmm0, 0x48(%rdi)
movl 0x40(%rdi), %eax
movl 0x58(%rdi), %ecx
movl %ecx, 0x40(%rdi)
movl %eax, 0x58(%rdi)
movb 0x29(%rdi), %al
testb %al, %al
je 0x385f1
movb 0x28(%rbx), %cl
movb %al, 0x28(%rbx)
movb %cl, 0x29(%rbx)
jmp 0x38605
movb 0x28(%rbx), %al
testl %esi, %esi
je 0x38601
movb %al, 0x29(%rbx)
movb $0x2b, 0x28(%rbx)
jmp 0x38605
cmpb $0x2b, %al
jne 0x3860e
movq %rbx, %rdi
popq %rbx
jmp 0x386b9
movq 0x70(%rbx), %rdi
movl 0x5c(%rbx), %esi
callq 0x1fb3a
movq 0x68(%rbx), %rdi
movl 0x5c(%rbx), %esi
callq 0x1fb3a
movq 0x60(%rbx), %rdi
movl 0x5c(%rbx), %esi
callq 0x1fb3a
movq 0x70(%rbx), %rax
movq 0x68(%rbx), %rcx
movq %rcx, 0x70(%rbx)
movq %rax, 0x68(%rbx)
movl 0x5c(%rbx), %esi
testl %esi, %esi
je 0x3867c
movq 0x60(%rbx), %rdx
xorl %edi, %edi
movl (%rax,%rdi,4), %esi
addl (%rdx,%rdi,4), %esi
movl 0x38(%rbx), %r8d
subl %esi, %r8d
movl %r8d, (%rax,%rdi,4)
movl 0x50(%rbx), %esi
movl (%rcx,%rdi,4), %r8d
addl (%rdx,%rdi,4), %r8d
subl %r8d, %esi
movl %esi, (%rcx,%rdi,4)
incq %rdi
movl 0x5c(%rbx), %esi
cmpq %rsi, %rdi
jb 0x3864f
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x386b7
movq 0x60(%rbx), %rdx
callq 0x384e5
movq 0x80(%rbx), %rdi
movl 0x5c(%rbx), %esi
movq 0x60(%rbx), %rdx
callq 0x384e5
movq 0x78(%rbx), %rax
movq 0x80(%rbx), %rcx
movq %rcx, 0x78(%rbx)
movq %rax, 0x80(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: swapBlocks
static void swapBlocks(struct psl *psl)
/* Swap the blocks in a psl without reverse complementing them. */
{
int i;
unsigned utmp;
char *stmp; 
for (i = 0; i < psl->blockCount; i++)
    {
    swapVars(psl->qStarts[i], psl->tStarts[i], utmp);
    if (psl->qSequence != NULL)
        swapVars(psl->qSequence[i], psl->tSequence[i], stmp);
    }
}

// Assembly:
cmpl $0x0, 0x5c(%rdi)
je 0x38709
xorl %eax, %eax
movq 0x68(%rdi), %rcx
movq 0x70(%rdi), %rdx
movl (%rcx,%rax,4), %esi
movl (%rdx,%rax,4), %r8d
movl %r8d, (%rcx,%rax,4)
movl %esi, (%rdx,%rax,4)
movq 0x78(%rdi), %rcx
testq %rcx, %rcx
je 0x386fe
movq (%rcx,%rax,8), %rdx
movq 0x80(%rdi), %rsi
movq (%rsi,%rax,8), %rsi
movq %rsi, (%rcx,%rax,8)
movq 0x80(%rdi), %rcx
movq %rdx, (%rcx,%rax,8)
incq %rax
movl 0x5c(%rdi), %ecx
cmpq %rcx, %rax
jb 0x386c1
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslTargetOffset
void pslTargetOffset(struct psl *psl, int offset)
/* Add offset to target positions in psl. */
{
int i, blockCount = psl->blockCount;
unsigned *tStarts = psl->tStarts;
psl->tStart += offset;
psl->tEnd += offset;
for (i=0; i<blockCount; ++i)
   tStarts[i] += offset;
}

// Assembly:
movslq 0x5c(%rdi), %rax
addl %esi, 0x54(%rdi)
addl %esi, 0x58(%rdi)
testq %rax, %rax
jle 0x3872a
movq 0x70(%rdi), %rcx
xorl %edx, %edx
addl %esi, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x3871f
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslDump
void pslDump(struct psl *psl, FILE *f)
/* Dump most of PSL to file - for debugging. */
{
int i;
fprintf(f, "<PRE>\n");
fprintf(f, "psl %s:%d-%d %s %s:%d-%d %d\n", 
	psl->qName, psl->qStart, psl->qEnd, psl->strand,
	psl->tName, psl->tStart, psl->tEnd, psl->blockCount);
for (i=0; i<psl->blockCount; ++i)
    fprintf(f, "  size %d, qStart %d, tStart %d\n", 
    	psl->blockSizes[i], psl->qStarts[i], psl->tStarts[i]);
fprintf(f, "</PRE>");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x5b84a(%rip), %rdi     # 0x93f8a
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x6e70
movq 0x30(%r14), %rdx
movl 0x3c(%r14), %ecx
movl 0x40(%r14), %r8d
leaq 0x28(%r14), %r9
movl 0x54(%r14), %r10d
movl 0x58(%r14), %r11d
movl 0x5c(%r14), %r15d
leaq 0x5b81c(%rip), %rsi     # 0x93f91
movq %rbx, %rdi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r10
pushq 0x48(%r14)
callq 0x6a90
addq $0x20, %rsp
cmpl $0x0, 0x5c(%r14)
je 0x387cf
leaq 0x5b813(%rip), %r15     # 0x93fae
xorl %r12d, %r12d
movq 0x60(%r14), %rax
movq 0x68(%r14), %rcx
movl (%rax,%r12,4), %edx
movl (%rcx,%r12,4), %ecx
movq 0x70(%r14), %rax
movl (%rax,%r12,4), %r8d
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x6a90
incq %r12
movl 0x5c(%r14), %eax
cmpq %rax, %r12
jb 0x3879e
leaq 0x5b7f9(%rip), %rdi     # 0x93fcf
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6e70
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslRecalcBounds
void pslRecalcBounds(struct psl *psl)
/* Calculate qStart/qEnd tStart/tEnd at top level to be consistent
 * with blocks. */
{
int qStart, qEnd, tStart, tEnd, size;
int last = psl->blockCount - 1;
qStart = psl->qStarts[0];
tStart = psl->tStarts[0];
size = psl->blockSizes[last];
qEnd = psl->qStarts[last] + size;
tEnd = psl->tStarts[last] + size;
if (psl->strand[0] == '-')
    reverseIntRange(&qStart, &qEnd, psl->qSize);
if (psl->strand[1] == '-')
    reverseIntRange(&tStart, &tEnd, psl->tSize);
psl->qStart = qStart;
psl->qEnd = qEnd;
psl->tStart = tStart;
psl->tEnd = tEnd;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x5c(%rdi), %eax
decl %eax
movq 0x68(%rdi), %rcx
movl (%rcx), %edx
movl %edx, 0xc(%rsp)
movq 0x70(%rdi), %rdx
movl (%rdx), %esi
movl %esi, 0x4(%rsp)
movq 0x60(%rdi), %rsi
cltq
movl (%rsi,%rax,4), %esi
movl (%rcx,%rax,4), %ecx
addl %esi, %ecx
movl %ecx, 0x8(%rsp)
addl (%rdx,%rax,4), %esi
movl %esi, (%rsp)
cmpb $0x2d, 0x28(%rdi)
jne 0x38844
movl 0x38(%rbx), %edx
leaq 0xc(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x25145
cmpb $0x2d, 0x29(%rbx)
jne 0x3885a
movl 0x50(%rbx), %edx
leaq 0x4(%rsp), %rdi
movq %rsp, %rsi
callq 0x25145
movl 0xc(%rsp), %eax
movl %eax, 0x3c(%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x40(%rbx)
movl 0x4(%rsp), %eax
movl %eax, 0x54(%rbx)
movl (%rsp), %eax
movl %eax, 0x58(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: chkError
static void chkError(char* pslDesc, FILE* out, struct psl* psl, int* errCount, char* format, ...)
/* error handling on an pslCheck error, counting error and issuing description
 * of PSL on the first error. */
{
if (*errCount == 0)
    printPslDesc(pslDesc, out, psl);
va_list args;
va_start(args, format);
vfprintf(out, format, args);
va_end(args);
(*errCount)++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %r8, %r14
movq %rcx, %rbx
movq %rsi, %r15
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x38e4a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl $0x0, (%rcx)
jne 0x38e8e
movq %rdx, %r10
movq %rdi, %r11
movq 0x30(%rdx), %rdx
movl 0x3c(%r10), %ecx
movl 0x40(%r10), %r8d
movq 0x48(%r10), %r9
movl 0x54(%r10), %r12d
movl 0x58(%r10), %r13d
addq $0x28, %r10
leaq 0x5b560(%rip), %rsi     # 0x943d8
movq %r15, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq %r13
pushq %r12
callq 0x6a90
addq $0x20, %rsp
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000028, %rax     # imm = 0x3000000028
movq %rax, (%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x69e0
incl (%rbx)
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: chkInsertCounts
static void chkInsertCounts(char* pslDesc, FILE* out, struct psl* psl,
                            char* pName, char pCLabel, unsigned* pBlockStarts,
                            unsigned pNumInsert, unsigned pBaseInsert,
                            int* errCount)
/* check the insert counts, incrementing errorCnt */
{
unsigned numInsert = 0, baseInsert = 0;
int iBlk;

for (iBlk = 1; iBlk < psl->blockCount; iBlk++)
    {
    unsigned gapSize = pBlockStarts[iBlk] - (pBlockStarts[iBlk-1]+psl->blockSizes[iBlk-1]);
    if (gapSize > 0)
        {
        numInsert++;
        baseInsert += gapSize;
        }
    }
if (numInsert != pNumInsert)
    chkError(pslDesc, out, psl, errCount,
             "\t%s %cNumInsert %u != expected %u\n",
             pName, pCLabel, pNumInsert, numInsert);
if (baseInsert != pBaseInsert)
    chkError(pslDesc, out, psl, errCount,
             "\t%s %cBaseInsert %u != expected %u\n",
             pName, pCLabel, pBaseInsert, baseInsert);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x40(%rsp), %r10d
movl 0x5c(%rdx), %eax
xorl %ebp, %ebp
movl $0x0, %r11d
cmpq $0x2, %rax
jb 0x392ac
movq 0x60(%r14), %rcx
decq %rax
xorl %edx, %edx
xorl %r11d, %r11d
xorl %ebp, %ebp
movl 0x4(%r9,%rdx,4), %esi
movl (%rcx,%rdx,4), %edi
addl (%r9,%rdx,4), %edi
xorl %ebx, %ebx
cmpl %edi, %esi
setne %bl
addl %esi, %ebp
subl %edi, %ebp
addl %ebx, %r11d
incq %rdx
cmpq %rdx, %rax
jne 0x3928a
movq 0x50(%rsp), %rcx
movl 0x48(%rsp), %ebx
movzbl %r8b, %r13d
cmpl %r10d, %r11d
je 0x392f2
subq $0x8, %rsp
leaq 0x5b2a7(%rip), %r8      # 0x94570
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rcx, %rbx
movq 0x8(%rsp), %r9
xorl %eax, %eax
pushq %r11
pushq %r10
pushq %r13
callq 0x38df1
movq %rbx, %rcx
movl 0x68(%rsp), %ebx
addq $0x20, %rsp
cmpl %ebx, %ebp
jne 0x392fc
addq $0x8, %rsp
jmp 0x39324
subq $0x8, %rsp
leaq 0x5b28c(%rip), %r8      # 0x94593
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %r9
xorl %eax, %eax
pushq %rbp
pushq %rbx
pushq %r13
callq 0x38df1
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: readPslToBinKeeper
struct hash *readPslToBinKeeper(char *sizeFileName, char *pslFileName)
/* read a list of psls and return results in hash of binKeeper structure for fast query*/
{
struct binKeeper *bk; 
struct psl *psl;
struct lineFile *sf = lineFileOpen(sizeFileName, TRUE);
struct lineFile *pf = lineFileOpen(pslFileName , TRUE);
struct hash *hash = newHash(0);
char *chromRow[2];
char *row[21] ;

while (lineFileRow(sf, chromRow))
    {
    char *name = chromRow[0];
    int size = lineFileNeedNum(sf, chromRow, 1);

    if (hashLookup(hash, name) != NULL)
        warn("Duplicate %s, ignoring all but first\n", name);
    else
        {
        bk = binKeeperNew(0, size);
        assert(size > 1);
	hashAdd(hash, name, bk);
        }
    }
while (lineFileNextRow(pf, row, ArraySize(row)))
    {
    psl = pslLoad(row);
    bk = hashMustFindVal(hash, psl->tName);
    binKeeperAdd(bk, psl->tStart, psl->tEnd, psl);
    }
lineFileClose(&pf);
lineFileClose(&sf);
return hash;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movl $0x1, %esi
callq 0x2a1fc
movq %rax, (%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2a1fc
movq %rax, 0x8(%rsp)
xorl %edi, %edi
movl $0x1, %esi
callq 0x29160
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x2, %edx
callq 0x2b1eb
testl %eax, %eax
je 0x3940f
leaq 0x10(%rsp), %r14
leaq 0x5ac5e(%rip), %r15     # 0x94001
movq 0x10(%rsp), %r12
movq (%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x2b2eb
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x28b2c
testq %rax, %rax
je 0x393da
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x268ca
jmp 0x393fa
xorl %edi, %edi
movl %ebp, %esi
callq 0x1bff7
cmpl $0x1, %ebp
jle 0x39491
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x28dbe
movq (%rsp), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x2b1eb
testl %eax, %eax
jne 0x393a3
movq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x15, %edx
callq 0x2b1eb
testl %eax, %eax
je 0x3946c
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x3633b
movq %rax, %r15
movq 0x48(%rax), %rsi
movq %rbx, %rdi
callq 0x28fdd
movl 0x54(%r15), %esi
movl 0x58(%r15), %edx
movq %rax, %rdi
movq %r15, %rcx
callq 0x1c116
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x15, %edx
callq 0x2b1eb
testl %eax, %eax
jne 0x3942c
leaq 0x8(%rsp), %rdi
callq 0x2ab48
movq %rsp, %rdi
callq 0x2ab48
movq %rbx, %rax
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ab8f(%rip), %rdi     # 0x94027
leaq 0x5a8c2(%rip), %rsi     # 0x93d61
leaq 0x5ab8a(%rip), %rcx     # 0x94030
movl $0x64b, %edx            # imm = 0x64B
callq 0x6460
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslNew
struct psl* pslNew(char *qName, unsigned qSize, int qStart, int qEnd,
                   char *tName, unsigned tSize, int tStart, int tEnd,
                   char *strand, unsigned blockSpace, unsigned opts)
/* create a new psl with space for the specified number of blocks allocated.
 * pslGrow maybe used to expand this space if needed.  Valid options are
 * PSL_XA_FORMAT. */
{
struct psl *psl;
AllocVar(psl);
assert(blockSpace > 0);
psl->qName = cloneString(qName);
psl->qSize = qSize;
psl->qStart = qStart;
psl->qEnd = qEnd;
psl->tName = cloneString(tName);
psl->tSize = tSize;
psl->tStart = tStart;
psl->tEnd = tEnd;
strncpy(psl->strand, strand, 2);
AllocArray(psl->blockSizes, blockSpace);
AllocArray(psl->qStarts, blockSpace);
AllocArray(psl->tStarts, blockSpace);
if (opts & PSL_XA_FORMAT)
    {
    AllocArray(psl->qSequence, blockSpace);
    AllocArray(psl->tSequence, blockSpace);
    }
return psl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movq %r8, %r14
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbp
movl $0x88, %edi
callq 0x2dc95
cmpl $0x0, 0x58(%rsp)
je 0x39adf
movq %rax, %rbx
movq %rbp, %rdi
callq 0x1f9f6
movq %rax, 0x30(%rbx)
movl %r13d, 0x38(%rbx)
movl %r12d, 0x3c(%rbx)
movl %r15d, 0x40(%rbx)
movq %r14, %rdi
callq 0x1f9f6
movq %rax, 0x48(%rbx)
movl 0x4(%rsp), %eax
movl %eax, 0x50(%rbx)
movl 0x40(%rsp), %eax
movl %eax, 0x54(%rbx)
movl 0x48(%rsp), %eax
movl %eax, 0x58(%rbx)
movq %rbx, %rdi
addq $0x28, %rdi
movl $0x2, %edx
movq 0x50(%rsp), %rsi
callq 0x6380
movl 0x58(%rsp), %r14d
leaq (,%r14,4), %r15
movq %r15, %rdi
callq 0x2db04
movq %rax, 0x60(%rbx)
movq %r15, %rdi
callq 0x2db04
movq %rax, 0x68(%rbx)
movq %r15, %rdi
callq 0x2db04
movq %rax, 0x70(%rbx)
movl 0x60(%rsp), %eax
testb $0x4, %al
je 0x39acd
shlq $0x3, %r14
movq %r14, %rdi
callq 0x2db04
movq %rax, 0x78(%rbx)
movq %r14, %rdi
callq 0x2db04
movq %rax, 0x80(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a5b3(%rip), %rdi     # 0x94099
leaq 0x5a274(%rip), %rsi     # 0x93d61
leaq 0x5a5b4(%rip), %rcx     # 0x940a8
movl $0x719, %edx            # imm = 0x719
callq 0x6460
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: addBlock
static void addBlock(struct psl* psl, int qs, int qe, int ts, int te,
                     int *blockSpace)
/* add a block to the psl, growing if necessary */
{
assert((qe-qs) == (te-ts));  /* same lengths? */
if (psl->blockCount == *blockSpace)
    pslGrow(psl, blockSpace);
psl->blockSizes[psl->blockCount] = qe - qs;
psl->qStarts[psl->blockCount] = qs;
psl->tStarts[psl->blockCount] = ts;
psl->blockCount++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
subl %esi, %r15d
subl %ecx, %r8d
cmpl %r8d, %r15d
jne 0x39b5e
movl %ecx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl 0x5c(%rdi), %eax
cmpl (%r9), %eax
jne 0x39b2d
movq %r14, %rdi
movq %r9, %rsi
callq 0x39b7d
movq 0x60(%r14), %rax
movl 0x5c(%r14), %ecx
movl %r15d, (%rax,%rcx,4)
movq 0x68(%r14), %rax
movl 0x5c(%r14), %ecx
movl %ebp, (%rax,%rcx,4)
movq 0x70(%r14), %rax
movl 0x5c(%r14), %ecx
movl %ebx, (%rax,%rcx,4)
incl 0x5c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5aa52(%rip), %rdi     # 0x945b7
leaq 0x5a1f5(%rip), %rsi     # 0x93d61
leaq 0x5aa57(%rip), %rcx     # 0x945ca
movl $0x686, %edx            # imm = 0x686
callq 0x6460
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslGrow
void pslGrow(struct psl *psl, int *blockSpacePtr)
/* Increase memory allocated to a psl to hold more blocks.  blockSpacePtr
 * should point the the current maximum number of blocks and will be
 * updated to with the new amount of space. */
{
int blockSpace = *blockSpacePtr;
int newSpace = 2 * blockSpace;
ExpandArray(psl->blockSizes, blockSpace, newSpace);
ExpandArray(psl->qStarts, blockSpace, newSpace);
ExpandArray(psl->tStarts, blockSpace, newSpace);
if (psl->qSequence != NULL)
    {
    ExpandArray(psl->qSequence, blockSpace, newSpace);
    ExpandArray(psl->tSequence, blockSpace, newSpace);
    }
*blockSpacePtr = newSpace;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rsi), %r15
leaq (%r15,%r15), %r13
movq 0x60(%rdi), %rdi
leaq (,%r15,4), %r12
shlq $0x3, %r15
movq %r12, %rsi
movq %r15, %rdx
callq 0x2dd03
movq %rax, 0x60(%r14)
movq 0x68(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2dd03
movq %rax, 0x68(%r14)
movq 0x70(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2dd03
movq %rax, 0x70(%r14)
movq 0x78(%r14), %rdi
testq %rdi, %rdi
je 0x39c10
movq %r13, %r12
shlq $0x3, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x2dd03
movq %rax, 0x78(%r14)
movq 0x80(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2dd03
movq %rax, 0x80(%r14)
movl %r13d, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslComputeInsertCounts
void pslComputeInsertCounts(struct psl *psl)
/* compute numInsert and baseInsert fields from the blocks */
{
psl->qNumInsert = psl->qBaseInsert = 0;
psl->tNumInsert = psl->tBaseInsert = 0;
int iBlk;

for (iBlk = 1; iBlk < psl->blockCount; iBlk++)
    {
    unsigned qGapSize = psl->qStarts[iBlk] - (psl->qStarts[iBlk-1]+psl->blockSizes[iBlk-1]);
    if (qGapSize != 0)
        {
        psl->qNumInsert++;
        psl->qBaseInsert += qGapSize;
        }
    unsigned tGapSize = psl->tStarts[iBlk] - (psl->tStarts[iBlk-1]+psl->blockSizes[iBlk-1]);
    if (tGapSize != 0)
        {
        psl->tNumInsert++;
        psl->tBaseInsert += tGapSize;
        }
    }
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movl 0x5c(%rdi), %eax
cmpq $0x2, %rax
jb 0x39c79
movq 0x60(%rdi), %rcx
movq 0x68(%rdi), %rdx
movq 0x70(%rdi), %rsi
decq %rax
xorl %r8d, %r8d
movl 0x4(%rdx,%r8,4), %r9d
movl (%rcx,%r8,4), %r10d
addl (%rdx,%r8,4), %r10d
subl %r10d, %r9d
je 0x39c58
incl 0x18(%rdi)
addl %r9d, 0x1c(%rdi)
movl 0x4(%rsi,%r8,4), %r9d
movl (%rcx,%r8,4), %r10d
addl (%rsi,%r8,4), %r10d
subl %r10d, %r9d
je 0x39c71
incl 0x20(%rdi)
addl %r9d, 0x24(%rdi)
incq %r8
cmpq %r8, %rax
jne 0x39c3f
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslRangeTreeOverlap
int pslRangeTreeOverlap(struct psl *psl, struct rbTree *rangeTree)
/* Return amount that psl overlaps (on target side) with rangeTree. */
{
int i;
int overlap = 0;
boolean isRc = (psl->strand[1] == '-');
for (i=0; i<psl->blockCount; ++i)
    {
    int start = psl->tStarts[i];
    int end = start + psl->blockSizes[i];
    if (isRc)
        reverseIntRange(&start, &end, psl->tSize);
    overlap += rangeTreeOverlapSize(rangeTree, start, end);
    }
return overlap;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x5c(%rdi)
je 0x3a01a
movq %rsi, %rbx
movq %rdi, %r14
movb 0x29(%rdi), %r13b
xorl %r15d, %r15d
movq %rsp, %r12
xorl %ebp, %ebp
movq 0x70(%r14), %rax
movl (%rax,%r15,4), %eax
movl %eax, 0x4(%rsp)
movq 0x60(%r14), %rcx
addl (%rcx,%r15,4), %eax
movl %eax, (%rsp)
cmpb $0x2d, %r13b
jne 0x39ffb
movl 0x50(%r14), %edx
leaq 0x4(%rsp), %rdi
movq %r12, %rsi
callq 0x25145
movl 0x4(%rsp), %esi
movl (%rsp), %edx
movq %rbx, %rdi
callq 0x3a6c6
addl %eax, %ebp
incq %r15
movl 0x5c(%r14), %eax
cmpq %rax, %r15
jb 0x39fcd
jmp 0x3a01c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslClone
struct psl* pslClone(struct psl *psl)
/* clone a psl */
{
struct psl* pslCp = pslNew(psl->qName, psl->qSize, psl->qStart, psl->qEnd,
                           psl->tName, psl->tSize, psl->tStart, psl->tEnd,
                           psl->strand, psl->blockCount,
                           ((psl->tSequence != NULL) ? PSL_XA_FORMAT : 0));
pslCp->match = psl->match;
pslCp->misMatch = psl->misMatch;
pslCp->repMatch = psl->repMatch;
pslCp->nCount = psl->nCount;
pslCp->qNumInsert = psl->qNumInsert;
pslCp->qBaseInsert = psl->qBaseInsert;
pslCp->tNumInsert = psl->tNumInsert;
pslCp->tBaseInsert = psl->tBaseInsert;
int iBlk;
for (iBlk = 0; iBlk < psl->blockCount; iBlk++)
    {
    pslCp->blockSizes[iBlk] = psl->blockSizes[iBlk];
    pslCp->qStarts[iBlk] = psl->qStarts[iBlk];
    pslCp->tStarts[iBlk] = psl->tStarts[iBlk];
    if (psl->qSequence != NULL)
        pslCp->qSequence[iBlk] = cloneString(psl->qSequence[iBlk]);
    if (psl->tSequence != NULL)
        pslCp->tSequence[iBlk] = cloneString(psl->tSequence[iBlk]);
    pslCp->blockCount++;
    }
return pslCp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
movl 0x38(%rbx), %esi
movl 0x3c(%rbx), %edx
movl 0x40(%rbx), %ecx
movq 0x48(%rbx), %r8
movl 0x50(%rbx), %r9d
movl 0x54(%rbx), %eax
movl 0x58(%rbx), %r10d
leaq 0x28(%rbx), %r11
movl 0x5c(%rbx), %r14d
xorl %r15d, %r15d
cmpq $0x0, 0x80(%rbx)
setne %r15b
shll $0x2, %r15d
subq $0x8, %rsp
pushq %r15
pushq %r14
pushq %r11
pushq %r10
pushq %rax
callq 0x399ef
addq $0x30, %rsp
movq %rax, %r14
movl 0x8(%rbx), %eax
movl %eax, 0x8(%r14)
movl 0xc(%rbx), %eax
movl %eax, 0xc(%r14)
movl 0x10(%rbx), %eax
movl %eax, 0x10(%r14)
movl 0x14(%rbx), %eax
movl %eax, 0x14(%r14)
movl 0x18(%rbx), %eax
movl %eax, 0x18(%r14)
movl 0x1c(%rbx), %eax
movl %eax, 0x1c(%r14)
movl 0x20(%rbx), %eax
movl %eax, 0x20(%r14)
movl 0x24(%rbx), %eax
movl %eax, 0x24(%r14)
cmpl $0x0, 0x5c(%rbx)
je 0x3a17c
xorl %r15d, %r15d
movq 0x60(%rbx), %rax
movl (%rax,%r15,4), %eax
movq 0x60(%r14), %rcx
movl %eax, (%rcx,%r15,4)
movq 0x68(%rbx), %rax
movl (%rax,%r15,4), %eax
movq 0x68(%r14), %rcx
movl %eax, (%rcx,%r15,4)
movq 0x70(%rbx), %rax
movl (%rax,%r15,4), %eax
movq 0x70(%r14), %rcx
movl %eax, (%rcx,%r15,4)
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x3a14d
movq (%rax,%r15,8), %rdi
callq 0x1f9f6
movq 0x78(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x3a16d
movq (%rax,%r15,8), %rdi
callq 0x1f9f6
movq 0x80(%r14), %rcx
movq %rax, (%rcx,%r15,8)
incl 0x5c(%r14)
incq %r15
movl 0x5c(%rbx), %eax
cmpq %rax, %r15
jb 0x3a103
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslCmpTargetStart
int pslCmpTargetStart(const void *va, const void *vb)
/* Compare to sort based on target start. */
{
const struct psl *a = *((struct psl **)va);
const struct psl *b = *((struct psl **)vb);
int diff = cmpChrom(a->tName, b->tName);
if (diff == 0)
    diff = a->tStart - b->tStart;
return diff;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq (%rsi), %rbx
movq 0x48(%r14), %rdi
movq 0x48(%rbx), %rsi
callq 0x20430
testl %eax, %eax
jne 0x3a233
movl 0x54(%r14), %eax
subl 0x54(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/psl.c
// Function: pslSortListByVar
void pslSortListByVar(struct psl **pslList, char *sort)
/* Sort a list of psls using the method definied in the sort string. */
{
if (sameString(sort, "query,start"))
    {
    slSort(pslList, pslCmpQuery);
    }
else if (sameString(sort, "query,score"))
    {
    slSort(pslList, pslCmpQueryScore);
    }
else if (sameString(sort, "score"))
    {
    slSort(pslList, pslCmpScore);
    }
else if (sameString(sort, "chrom,start"))
    {
    slSort(pslList, pslCmpTargetStart);
    }
else if (sameString(sort, "chrom,score"))
    {
    slSort(pslList, pslCmpTargetScore);
    }
else
    {
    slSort(pslList, pslCmpQueryScore);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x59fcf(%rip), %rsi     # 0x9421b
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x3a2b6
leaq 0x59fb0(%rip), %rsi     # 0x9420f
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x3a2bf
leaq 0x558d6(%rip), %rsi     # 0x8fb48
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x3a2c8
leaq 0x59fae(%rip), %rsi     # 0x94233
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
je 0x3a2d1
leaq 0x59f8f(%rip), %rsi     # 0x94227
movq %r14, %rdi
callq 0x6a50
testl %eax, %eax
leaq -0x11f(%rip), %rax      # 0x3a18a
leaq -0x2d5f(%rip), %rsi     # 0x37551
cmoveq %rax, %rsi
jmp 0x3a2d8
leaq -0x2e9e(%rip), %rsi     # 0x3741f
jmp 0x3a2d8
leaq -0x2d75(%rip), %rsi     # 0x37551
jmp 0x3a2d8
leaq -0x2e21(%rip), %rsi     # 0x374ae
jmp 0x3a2d8
leaq -0xc7(%rip), %rsi       # 0x3a211
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1fd04
nop
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rangeTree.c
// Function: rangeTreeAddVal
struct range *rangeTreeAddVal(struct rbTree *tree, int start, int end, void *val, void *(*mergeVals)(void *existingVal, void *newVal) )
/* Add range to tree, merging with existing ranges if need be. 
 * If this is a new range, set the value to this val.
 * If there are existing items for this range, and if mergeVals function is not null, 
 * apply mergeVals to the existing values and this new val, storing the result as the val
 * for this range (see rangeTreeAddValCount() and rangeTreeAddValList() below for examples). */
{
struct range *r, *existing;
r = lmAlloc(tree->lm, sizeof(*r)); /* alloc new zeroed range */
r->start = start;
r->end = end;
r->val = val;
while ((existing = rbTreeRemove(tree, r)) != NULL)
    {
    r->start = min(r->start, existing->start);
    r->end = max(r->end, existing->end);
    if (mergeVals)
	r->val = mergeVals(existing->val, r->val);
    }
rbTreeAdd(tree, r);
return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r12
movl %edx, %ebp
movl %esi, %r13d
movq %rdi, %r14
movq 0x28(%rdi), %rdi
movl $0x18, %esi
callq 0x2bfa9
movq %rax, %r15
movl %r13d, 0x8(%rax)
movl %ebp, 0xc(%rax)
movq %r12, 0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x3aaf0
testq %rax, %rax
je 0x3a381
movl 0x8(%rax), %ecx
movl 0x8(%r15), %edx
cmpl %ecx, %edx
cmovll %edx, %ecx
movl 0xc(%r15), %edx
movl %ecx, 0x8(%r15)
movl 0xc(%rax), %ecx
cmpl %ecx, %edx
cmovgl %edx, %ecx
movl %ecx, 0xc(%r15)
testq %rbx, %rbx
je 0x3a379
movq 0x10(%rax), %rdi
movq 0x10(%r15), %rsi
callq *%rbx
movq %rax, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
jmp 0x3a33c
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a8a1
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_O1/icebert[P]pblat/lib/rangeTree.c
// Function: rangeTreeAllOverlapping
struct range *rangeTreeAllOverlapping(struct rbTree *tree, int start, int end)
/* Return list of all items in range tree that overlap interval start-end.
 * Do not free this list, it is owned by tree.  However it is only good until
 * next call to rangeTreeFindInRange or rangeTreeList. Not thread safe. */
{
struct range tempR;
tempR.start = start;
tempR.end = end;
struct range *rangeList = NULL;
rbTreeTraverseRangeWithContext(tree, &tempR, &tempR, rangeListAdd, &rangeList);
slReverse(&rangeList);
return rangeList;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x8(%rsp), %rax
movl %esi, 0x8(%rax)
movl %edx, 0xc(%rax)
movq %rsp, %rbx
movq $0x0, (%rbx)
leaq 0x7c(%rip), %rcx        # 0x3a623
movq %rax, %rsi
movq %rax, %rdx
movq %rbx, %r8
callq 0x3ae95
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rangeTree.c
// Function: rangeTreeOverlaps
boolean rangeTreeOverlaps(struct rbTree *tree, int start, int end)
/* Return TRUE if start-end overlaps anything in tree */
{
struct range tempR;
tempR.start = start;
tempR.end = end;
tempR.val = NULL;
return rbTreeFind(tree, &tempR) != NULL;
}

// Assembly:
subq $0x18, %rsp
movq %rsp, %rax
movl %esi, 0x8(%rax)
movl %edx, 0xc(%rax)
movq $0x0, 0x10(%rax)
movq %rax, %rsi
callq 0x3aaa1
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, %eax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rangeTree.c
// Function: rangeTreeList
struct range *rangeTreeList(struct rbTree *tree)
/* Return list of all ranges in tree in order.  Not thread safe. 
 * No need to free this when done, memory is local to tree. */
{
struct range *rangeList = NULL;
rbTreeTraverseWithContext(tree, rangeListAdd, &rangeList);
slReverse(&rangeList);
return rangeList;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
leaq 0x19(%rip), %rsi        # 0x3a623
movq %rbx, %rdx
callq 0x3affb
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rangeTree.c
// Function: rangeTreeFindEnclosing
struct range *rangeTreeFindEnclosing(struct rbTree *tree, int start, int end)
/* Find item in range tree that encloses range between start and end 
 * if there is any such item. */
{
struct range tempR, *r;
tempR.start = start;
tempR.end = end;
r = rbTreeFind(tree, &tempR);
if (r != NULL && r->start <= start && r->end >= end)
    {
    r->next = NULL; /* this can be set by previous calls to the List functions */
    return r;
    }
return NULL;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rsp, %rsi
movl %ebp, 0x8(%rsi)
movl %edx, 0xc(%rsi)
callq 0x3aaa1
testq %rax, %rax
je 0x3a654
cmpl %ebp, 0x8(%rax)
jg 0x3a654
cmpl %ebx, 0xc(%rax)
jge 0x3a65d
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq $0x0, (%rax)
jmp 0x3a656
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rangeTree.c
// Function: rangeTreeMaxOverlapping
struct range *rangeTreeMaxOverlapping(struct rbTree *tree, int start, int end)
/* Return item that overlaps most with start-end. Not thread safe.  Trashes list used
 * by rangeTreeAllOverlapping. */
{
struct range *range, *best = NULL;
int bestOverlap = 0; 
for (range  = rangeTreeAllOverlapping(tree, start, end); range != NULL; range = range->next)
    {
    int overlap = rangeIntersection(range->start, range->end, start, end);
    if (overlap > bestOverlap)
        {
	bestOverlap = overlap;
	best = range;
	}
    }
if (best)
    best->next = NULL; /* could be set by calls to List functions */
return best;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
callq 0x3a586
xorl %r12d, %r12d
testq %rax, %rax
je 0x3a6ab
movq %rax, %r15
xorl %r14d, %r14d
movl 0x8(%r15), %edi
movl 0xc(%r15), %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x23630
cmpl %r12d, %eax
cmovgq %r15, %r14
cmovgl %eax, %r12d
movq (%r15), %r15
testq %r15, %r15
jne 0x3a685
jmp 0x3a6ae
xorl %r14d, %r14d
testq %r14, %r14
je 0x3a6ba
movq $0x0, (%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rangeTree.c
// Function: rangeTreeOverlapSize
int rangeTreeOverlapSize(struct rbTree *tree, int start, int end)
/* Return the total size of intersection between interval
 * from start to end, and items in range tree. Sadly not
 * thread-safe. 
 * On 32 bit machines be careful not to overflow
 * range of start, end or total size return value. */
{
struct range tempR;
tempR.start = overlapStart = start;
tempR.end = overlapEnd = end;
totalOverlap = 0;
rbTreeTraverseRange(tree, &tempR, &tempR, addOverlap);
return totalOverlap;
}

// Assembly:
subq $0x18, %rsp
movl %esi, 0x89a28(%rip)     # 0xc40f8
movq %rsp, %rax
movl %esi, 0x8(%rax)
movl %edx, 0x89a20(%rip)     # 0xc40fc
movl %edx, 0xc(%rax)
movl $0x0, 0x89a17(%rip)     # 0xc4100
leaq 0x16(%rip), %rcx        # 0x3a706
movq %rax, %rsi
movq %rax, %rdx
callq 0x3af3a
movl 0x899ff(%rip), %eax     # 0xc4100
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeNewDetailed
struct rbTree *rbTreeNewDetailed(int (*compare)(void *, void *), struct lm *lm, 
	struct rbTreeNode *stack[128])
/* Allocate rbTree on an existing local memory & stack.  This is for cases
 * where you want a lot of trees, and don't want the overhead for each one. 
 * Note, to clean these up, just do freez(&rbTree) rather than rbFreeTree(&rbTree). */
{
struct rbTree *t;
AllocVar(t);
t->root = NULL;
t->compare = compare;
t->lm = lm;
t->stack = stack;	
t->n = 0;
return t;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x38, %edi
callq 0x2dc95
movq $0x0, 0x8(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x28(%rax)
movq %rbx, 0x20(%rax)
movl $0x0, 0x10(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeNew
struct rbTree *rbTreeNew(int (*compare)(void *, void *))
/* rbTreeNew() - Allocates space for a red-black tree and returns a pointer
 * to it.  The function compare compares they keys of two items, and returns a
 * negative, zero, or positive integer depending on whether the first item is
 * less than, equal to, or greater than the second.  */
{
/* The stack keeps us from having to keep explicit
 * parent, grandparent, greatgrandparent variables.
 * It needs to be big enough for the maximum depth
 * of tree.  Since the whole point of rb trees is
 * that they are self-balancing, this is not all
 * that deep, just 2*log2(N).  Therefore a stack of
 * 128 is good for up to 2^64 items in stack, which
 * should keep us for the next couple of decades... */
struct lm *lm = lmInit(0);
struct rbTreeNode **stack = lmAlloc(lm, 128 * sizeof(stack[0]));	
return rbTreeNewDetailed(compare, lm, stack);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2bea4
movq %rax, %r14
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdi
callq 0x2bfa9
movq %rax, %r15
movl $0x38, %edi
callq 0x2dc95
movq $0x0, 0x8(%rax)
movq %rbx, 0x18(%rax)
movq %r14, 0x28(%rax)
movq %r15, 0x20(%rax)
movl $0x0, 0x10(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeFree
void rbTreeFree(struct rbTree **pTree)
/* rbTreeFree() - Frees space used by the red-black tree pointed to by t. */
{
struct rbTree *tree = *pTree;
if (tree != NULL)
    {
    lmCleanup(&tree->lm);
    freez(pTree);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3a870
addq $0x28, %rdi
callq 0x2bf4b
movq %rbx, %rdi
popq %rbx
jmp 0x2dd51
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeFreeList
void rbTreeFreeList(struct rbTree **pList)
/* Free up a list of rbTrees. */
{
struct rbTree *tree, *next;
for (tree = *pList; tree != NULL; tree = next)
    {
    next = tree->next;
    rbTreeFree(&tree);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq %r14, (%rsp)
testq %r14, %r14
je 0x3a899
movq %rsp, %rbx
movq (%r14), %r14
movq %rbx, %rdi
callq 0x3a852
movq %r14, (%rsp)
testq %r14, %r14
jne 0x3a885
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeFind
void *rbTreeFind(struct rbTree *t, void *item)
/* rbTreeFind() - Find an item in the red-black tree with the same key as the
 * item pointed to by `item'.  Returns a pointer to the item found, or NULL
 * if no item was found.
 */
{
struct rbTreeNode *p, *nextP;
int (*compare)(void *, void *) = t->compare;
int cmpResult;
    
/* Repeatedly explore either the left or right branch, depending on the
 * value of the key, until the correct item is found.  */
for (p = t->root; p != NULL; p = nextP)
    {
    cmpResult = compare(item, p->item);
    if(cmpResult < 0) 
	nextP = p->left;
    else if(cmpResult > 0) 
	nextP = p->right;
    else 
	return p->item;
    }
return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r15
testq %r15, %r15
je 0x3aad9
movq %rsi, %r14
movq 0x18(%rdi), %r12
xorl %ebx, %ebx
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq *%r12
testl %eax, %eax
js 0x3aacf
je 0x3aadd
addq $0x8, %r15
movq (%r15), %r15
testq %r15, %r15
jne 0x3aabb
jmp 0x3aae1
xorl %ebx, %ebx
jmp 0x3aae1
movq 0x18(%r15), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeDump
void rbTreeDump(struct rbTree *tree, FILE *f, 
	void (*dumpItem)(void *item, FILE *f))
/* Dump out rb tree to file, mostly for debugging. */
{
dumpFile = f;
dumpLevel = 0;
dumpIt = dumpItem;
fprintf(f, "rbTreeDump\n");
rTreeDump(tree->root);
}

// Assembly:
pushq %rbx
movq %rsi, %rcx
movq %rdi, %rbx
movq %rsi, 0x89326(%rip)     # 0xc4108
movl $0x0, 0x89324(%rip)     # 0xc4110
movq %rdx, 0x89325(%rip)     # 0xc4118
leaq 0x59807(%rip), %rdi     # 0x94601
movl $0xb, %esi
movl $0x1, %edx
callq 0x6e70
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0x3ae10
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rTreeDump
static void rTreeDump(struct rbTreeNode *n)
/* Recursively dump. */
{
if (n == NULL)
    return;
spaceOut(dumpFile, ++dumpLevel * 3);
fprintf(dumpFile, "%c ", (n->color ==  rbTreeRed ? 'r' : 'b'));
dumpIt(n->item, dumpFile);
fprintf(dumpFile, "\n");
rTreeDump(n->left);
rTreeDump(n->right);
--dumpLevel;
}

// Assembly:
testq %rdi, %rdi
je 0x3ae94
pushq %rbx
movq %rdi, %rbx
movq 0x892e8(%rip), %rdi     # 0xc4108
movl 0x892ea(%rip), %eax     # 0xc4110
incl %eax
movl %eax, 0x892e2(%rip)     # 0xc4110
leal (%rax,%rax,2), %esi
callq 0x2278f
xorl %edx, %edx
cmpl $0x0, 0x10(%rbx)
movq 0x892c5(%rip), %rdi     # 0xc4108
sete %dl
shll $0x4, %edx
orl $0x62, %edx
leaq 0x597ba(%rip), %rsi     # 0x9460d
xorl %eax, %eax
callq 0x6a90
movq 0x18(%rbx), %rdi
movq 0x892a3(%rip), %rsi     # 0xc4108
callq *0x892ad(%rip)          # 0xc4118
movq 0x89296(%rip), %rsi     # 0xc4108
movl $0xa, %edi
callq 0x6930
movq (%rbx), %rdi
callq 0x3ae10
movq 0x8(%rbx), %rdi
callq 0x3ae10
decl 0x8927d(%rip)           # 0xc4110
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeTraverseRangeWithContext
void rbTreeTraverseRangeWithContext(struct rbTree *tree, void *minItem, void *maxItem,
	void (*doItem)(void *item, void *context), void *context)
/* Apply doItem function to all items in tree such that
 * minItem <= item <= maxItem.  THREAD SAFE */
{
struct rangeParams ourParams;
ourParams.doIt = doItem;
ourParams.minIt = minItem;
ourParams.maxIt = maxItem;
ourParams.compareIt = tree->compare;
rTreeTraverseRangeWithContext(tree->root, &ourParams, context);
}

// Assembly:
subq $0x28, %rsp
leaq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq %rsi, 0x8(%rax)
movq %rdx, 0x10(%rax)
movq 0x18(%rdi), %rcx
movq %rcx, 0x18(%rax)
movq 0x8(%rdi), %rdi
movq %rax, %rsi
movq %r8, %rdx
callq 0x3aec5
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rTreeTraverseRangeWithContext
static void rTreeTraverseRangeWithContext(struct rbTreeNode *n, struct rangeParams *rp, void *context)
/* Recursively traverse tree in range applying doIt with context. */
{
if (n != NULL)
   {
   int minCmp = rp->compareIt(n->item, rp->minIt);
   int maxCmp = rp->compareIt(n->item, rp->maxIt);
   if (minCmp >= 0)
       rTreeTraverseRangeWithContext(n->left, rp, context);
   if (minCmp >= 0 && maxCmp <= 0)
       rp->doIt(n->item, context);
   if (maxCmp <= 0)
       rTreeTraverseRangeWithContext(n->right, rp, context);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %r15, %r15
je 0x3af31
movq 0x18(%r15), %rdi
movq 0x8(%r14), %rsi
callq *0x18(%r14)
movl %eax, %r12d
movq 0x18(%r15), %rdi
movq 0x10(%r14), %rsi
callq *0x18(%r14)
movl %eax, %ebp
testl %r12d, %r12d
js 0x3af0b
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3aec5
testl %r12d, %r12d
setns %al
testl %ebp, %ebp
setle %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3af27
movq 0x18(%r15), %rdi
movq %rbx, %rsi
callq *(%r14)
testl %ebp, %ebp
jg 0x3af31
movq 0x8(%r15), %r15
jmp 0x3aed6
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rTreeTraverseRange
static void rTreeTraverseRange(struct rbTreeNode *n)
/* Recursively traverse tree in range applying doIt. */
{
if (n != NULL)
   {
   int minCmp = compareIt(n->item, minIt);
   int maxCmp = compareIt(n->item, maxIt);
   if (minCmp >= 0)
       rTreeTraverseRange(n->left);
   if (minCmp >= 0 && maxCmp <= 0)
       doIt(n->item);
   if (maxCmp <= 0)
       rTreeTraverseRange(n->right);
   }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rbx, %rbx
je 0x3afc6
movq 0x18(%rbx), %rdi
movq 0x891b1(%rip), %rsi     # 0xc4128
callq *0x891bb(%rip)          # 0xc4138
movl %eax, %r14d
movq 0x18(%rbx), %rdi
movq 0x891a5(%rip), %rsi     # 0xc4130
callq *0x891a7(%rip)          # 0xc4138
movl %eax, %ebp
testl %r14d, %r14d
js 0x3afa0
movq (%rbx), %rdi
callq 0x3af60
testl %r14d, %r14d
setns %al
testl %ebp, %ebp
setle %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3afbc
movq 0x18(%rbx), %rdi
callq *0x89164(%rip)          # 0xc4120
testl %ebp, %ebp
jg 0x3afc6
movq 0x8(%rbx), %rbx
jmp 0x3af67
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rTreeTraverse
static void rTreeTraverse(struct rbTreeNode *n)
/* Recursively traverse full tree applying doIt. */
{
if (n != NULL)
    {
    rTreeTraverse(n->left);
    doIt(n->item);
    rTreeTraverse(n->right);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rbx, %rbx
je 0x3aff9
movq (%rbx), %rdi
callq 0x3afd8
movq 0x18(%rbx), %rdi
callq *0x8912d(%rip)          # 0xc4120
movq 0x8(%rbx), %rbx
jmp 0x3afdc
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rTreeTraverseWithContext
static void rTreeTraverseWithContext(struct rbTreeNode *n, struct rTreeContext *context)
/* Traverse tree with a little context so don't need little static variables that
 * prevent reentrancy of callback functions. */
{
if (n != NULL)
    {
    rTreeTraverseWithContext(n->left, context);
    context->doItem(n->item, context->context);
    rTreeTraverseWithContext(n->right, context);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %r14, %r14
je 0x3b046
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3b01c
movq 0x18(%r14), %rdi
movq (%rbx), %rsi
callq *0x8(%rbx)
movq 0x8(%r14), %r14
jmp 0x3b026
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeItemsInRange
struct slRef *rbTreeItemsInRange(struct rbTree *tree, void *minItem, void *maxItem)
/* Return a sorted list of references to items in tree between range.
 * slFreeList this list when done. */
{
itList = NULL;
rbTreeTraverseRange(tree, minItem, maxItem, addRef);
slReverse(&itList);
return itList;
}

// Assembly:
pushq %rbx
movq $0x0, 0x890e6(%rip) # 0xc4140
leaq 0x890df(%rip), %rbx     # 0xc4140
leaq 0x3a(%rip), %rax        # 0x3b0a2
movq %rax, 0x890b1(%rip)     # 0xc4120
movq %rsi, 0x890b2(%rip)     # 0xc4128
movq %rdx, 0x890b3(%rip)     # 0xc4130
movq 0x18(%rdi), %rax
movq %rax, 0x890b0(%rip)     # 0xc4138
movq 0x8(%rdi), %rdi
callq 0x3af60
movq %rbx, %rdi
callq 0x1fcb3
movq 0x890a0(%rip), %rax     # 0xc4140
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/rbTree.c
// Function: rbTreeItems
struct slRef *rbTreeItems(struct rbTree *tree)
/* Return sorted list of items.  slFreeList this when done.*/
{
struct slRef *list = NULL;
rbTreeTraverseWithContext(tree, addRefWithContext, &list);
slReverse(&list);
return list;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
leaq 0x10(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x1e(%rip), %rax        # 0x3b0ef
movq %rax, 0x8(%rsi)
movq 0x8(%rdi), %rdi
callq 0x3b01c
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/repMask.c
// Function: repeatMaskOutStaticLoad
void repeatMaskOutStaticLoad(char **row, struct repeatMaskOut *ret)
/* Load a row from repeatMaskOut table into ret.  The contents of ret will
 * be replaced at the next call to this function. */
{
int i;

ret->score = sqlUnsigned(row[0]);
ret->percDiv = atof(row[1]);
ret->percDel = atof(row[2]);
ret->percInc = atof(row[3]);
ret->qName = row[4];
ret->qStart = sqlSigned(row[5]);
ret->qEnd = sqlSigned(row[6]);
ret->qLeft = row[7];
strcpy(ret->strand, row[8]);
ret->rName = row[9];
ret->rFamily = row[10];
ret->rStart = row[11];	/* sometimes this number is enclosed in (parens) */
/* This row[12] is interpreted as an Unsigned - but I can find no good reason
 * for it to be an error exit when there is a negative number here.
 * The only programs that use this routine are blat, psLayout and
 * maskOutFa and none of them even use this number for anything.
 * For data base loading of the rmsk tracks, these .out files are parsed
 * by hgLoadOut and none of this business is referenced.
 */
i = sqlSigned(row[12]);
if( i < 0 ) {
    warn("WARNING: negative rEnd: %d %s:%d-%d %s", i, ret->qName, ret->qStart, ret->qEnd, ret->rName);
    ret->rEnd = 0;
} else {
ret->rEnd = sqlUnsigned(row[12]);
}
ret->rLeft = row[13];
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x3b838
movl %eax, 0x8(%rbx)
movq 0x8(%r14), %rdi
callq 0x6920
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rbx)
movq 0x10(%r14), %rdi
callq 0x6920
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rbx)
movq 0x18(%r14), %rdi
callq 0x6920
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rbx)
movq 0x20(%r14), %rax
movq %rax, 0x18(%rbx)
movq 0x28(%r14), %rdi
callq 0x3b9a8
movl %eax, 0x20(%rbx)
movq 0x30(%r14), %rdi
callq 0x3b9a8
movl %eax, 0x24(%rbx)
movq 0x38(%r14), %rax
movq %rax, 0x28(%rbx)
leaq 0x30(%rbx), %rdi
movq 0x40(%r14), %rsi
callq 0x6680
movq 0x48(%r14), %rax
movq %rax, 0x38(%rbx)
movq 0x50(%r14), %rax
movq %rax, 0x40(%rbx)
movq 0x58(%r14), %rax
movq %rax, 0x48(%rbx)
movq 0x60(%r14), %rdi
callq 0x3b9a8
testl %eax, %eax
js 0x3b1ba
movq 0x60(%r14), %rdi
callq 0x3b838
movl %eax, %ebp
jmp 0x3b1db
movq 0x18(%rbx), %rdx
movl 0x20(%rbx), %ecx
movl 0x24(%rbx), %r8d
movq 0x38(%rbx), %r9
leaq 0x59441(%rip), %rdi     # 0x94611
xorl %ebp, %ebp
movl %eax, %esi
xorl %eax, %eax
callq 0x268ca
movl %ebp, 0x50(%rbx)
movq 0x68(%r14), %rax
movq %rax, 0x58(%rbx)
popq %rbx
popq %r14
popq %rbp
retq