// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/jkOwnLib/gfBlatLib.c
// Function: gfAlignStrand
void gfAlignStrand(int *pConn, char *tSeqDir, struct dnaSeq *seq,
    boolean isRc, int minMatch, struct hash *tFileCache, struct gfOutput *out)
/* Search genome on server with one strand of other sequence to find homology. 
 * Then load homologous bits of genome locally and do detailed alignment.
 * Call 'outFunction' with each alignment that is found. */
{
struct ssBundle *bun;
struct gfRange *rangeList = NULL, *range;
struct dnaSeq *targetSeq;
char targetName[PATH_LEN];

rangeList = gfQuerySeq(*pConn, seq);
close(*pConn);
*pConn = -1;
slSort(&rangeList, gfRangeCmpTarget);
rangeList = gfRangesBundle(rangeList, ffIntronMax);
for (range = rangeList; range != NULL; range = range->next)
    {
    getTargetName(range->tName, out->includeTargetFile, targetName);
    targetSeq = gfiExpandAndLoadCached(range, tFileCache, tSeqDir, 
    	seq->size, &range->tTotalSize, FALSE, FALSE, usualExpansion);
    AllocVar(bun);
    bun->qSeq = seq;
    bun->genoSeq = targetSeq;
    alignComponents(range, bun, ffCdna);
    ssStitch(bun, ffCdna, minMatch, ssAliCount);
    saveAlignments(targetName, range->tTotalSize, range->tStart, 
	bun, NULL, isRc, FALSE, ffCdna, minMatch, out);
    ssBundleFree(&bun);
    freeDnaSeq(&targetSeq);
    }
gfRangeFreeList(&rangeList);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movl %ecx, 0xc(%rsp)
movq %rdx, %r12
movq %rsi, %rbp
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movq %rdi, %r15
movl (%rdi), %r13d
movq %rax, (%rsp)
leaq 0x7df89(%rip), %rdx     # 0x8ddcd
movl %r13d, %edi
movq %r12, %rsi
callq 0x129f6
leaq 0x60(%rsp), %rbx
movl %r13d, %edi
movq %rbx, %rsi
callq 0x30e9d
cmpl $0x646e65, (%rbx)       # imm = 0x646E65
je 0xff60
leaq 0x60(%rsp), %rbx
leaq 0x7df5c(%rip), %rdi     # 0x8ddd3
movq %rbx, %rsi
callq 0x217c8
testl %eax, %eax
jne 0xff48
movq %rbp, %r14
movq %r12, %rbp
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
movl $0x6, %edx
callq 0x223ad
cmpl $0x5, %eax
jg 0xfeb4
leaq 0x7df2f(%rip), %rdi     # 0x8ddda
movl %eax, %esi
xorl %eax, %eax
callq 0x26b6f
movl $0x48, %edi
callq 0x2dc95
movq %rax, %r12
movq 0x30(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x8(%r12)
movq 0x38(%rsp), %rdi
callq 0x6bd0
movl %eax, 0xc(%r12)
movq 0x40(%rsp), %rdi
callq 0x1f9f6
movq %rax, 0x10(%r12)
movq 0x48(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x20(%r12)
movq 0x50(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x24(%r12)
movq 0x58(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x30(%r12)
movq (%rsp), %rax
movq %rax, (%r12)
movq %r12, (%rsp)
movl %r13d, %edi
movq %rbx, %rsi
callq 0x30e9d
cmpl $0x646e65, 0x60(%rsp)   # imm = 0x646E65
movq %rbp, %r12
movq %r14, %rbp
jne 0xfe70
jmp 0xff60
movq 0x8(%r12), %rsi
leaq 0x7def4(%rip), %rdi     # 0x8de48
leaq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0x268ca
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x1fcb3
movq (%rbx), %rax
leaq 0x18(%rsp), %rbx
movq %rax, (%rbx)
movl (%r15), %edi
callq 0x6e80
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
leaq -0x464(%rip), %rsi      # 0xfb28
movq %rbx, %rdi
callq 0x1fd04
movq (%rbx), %rdi
leaq 0xb0bd2(%rip), %rax     # 0xc0b70
movl (%rax), %esi
callq 0xfc3f
movq %rax, (%rbx)
testq %rax, %rax
movq 0x20(%rsp), %r15
je 0x10095
movq %rax, %r13
movq %r12, %r14
movq %rbp, %rbx
movq 0x10(%r13), %rdi
movq 0x2a0(%rsp), %rbp
movl 0x48(%rbp), %esi
movq %r15, %rbp
leaq 0x60(%rsp), %r15
movq %r15, %rdx
callq 0x100d0
movl 0x18(%r14), %ecx
leaq 0x40(%r13), %r8
movq %r13, %rdi
movq 0x28(%rsp), %rsi
movq %rbx, %rdx
xorl %r9d, %r9d
pushq $0x1f4                  # imm = 0x1F4
xorl %r12d, %r12d
pushq %r12
callq 0x13224
addq $0x10, %rsp
movq %rax, 0x10(%rsp)
movl $0x48, %edi
callq 0x2dc95
movq %rax, (%rsp)
movq %r14, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq %r13, %rdi
movq %rax, %rsi
callq 0x10138
movq (%rsp), %rdi
movl $0x1, %esi
movl %ebp, %edx
movl $0x10, %ecx
callq 0x14ecb
movl 0x20(%r13), %edx
movl 0x40(%r13), %esi
movq (%rsp), %rcx
movq %r15, %rdi
movq %rbp, %r15
xorl %r8d, %r8d
movl 0xc(%rsp), %r9d
pushq 0x2a0(%rsp)
pushq %rbp
pushq $0x1
pushq %r12
callq 0x1022f
addq $0x20, %rsp
movq %rsp, %rdi
callq 0x14940
leaq 0x10(%rsp), %rdi
callq 0x24ab1
movq (%r13), %r13
testq %r13, %r13
jne 0xffbf
movq 0x18(%rsp), %r14
movq %r14, 0x30(%rsp)
testq %r14, %r14
je 0x100be
leaq 0x30(%rsp), %rbx
movq (%r14), %r14
movq %rbx, %rdi
callq 0xfa88
movq %r14, 0x30(%rsp)
testq %r14, %r14
jne 0x100a9
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq