// File: /workspace/github_c_makefile_star2_O2/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)
movl %r8d, %r14d
movl %ecx, 0xc(%rsp)
movq %rdx, %r15
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movl (%rdi), %r13d
andq $0x0, (%rsp)
leaq 0x6f33b(%rip), %rdx     # 0x7cdad
movl %r13d, %edi
movq %r15, %rsi
callq 0x10111
leaq 0x60(%rsp), %rbx
xorl %ebp, %ebp
movl %r13d, %edi
movq %rbx, %rsi
callq 0x2bbc0
cmpl $0x646e65, 0x60(%rsp)   # imm = 0x646E65
je 0xdb5b
leaq 0x6f30f(%rip), %rdi     # 0x7cdb3
movq %rbx, %rsi
callq 0x1db41
testl %eax, %eax
jne 0xdb4e
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
pushq $0x6
popq %rdx
callq 0x1e59b
cmpl $0x5, %eax
jg 0xdad9
leaq 0x6f2ea(%rip), %rdi     # 0x7cdba
movl %eax, %esi
xorl %eax, %eax
callq 0x223fb
pushq $0x48
popq %rdi
callq 0x28bb0
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 0x1c306
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 %rbp, (%r12)
movq %r12, (%rsp)
movq %r12, %rbp
jmp 0xda84
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x101c5
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x1c567
movq (%rbx), %rax
movq %rax, (%rbx)
movq 0x18(%rsp), %rbx
movl (%rbx), %edi
callq 0x6e80
orl $-0x1, (%rbx)
leaq -0x3cb(%rip), %rsi      # 0xd7b7
movq %rsp, %r12
movq %r12, %rdi
callq 0x1c5ab
movq (%r12), %rdi
leaq 0xa6fd8(%rip), %rax     # 0xb4b70
movl (%rax), %esi
callq 0xd8b7
movq %rax, %rbx
movq %rax, (%r12)
leaq 0x60(%rsp), %r13
leaq 0x10(%rsp), %rbp
testq %rbx, %rbx
je 0xdc76
movq 0x10(%rbx), %rdi
movq 0x2a0(%rsp), %r12
movl 0x48(%r12), %esi
movq %r13, %rdx
callq 0xdc90
movl 0x18(%r15), %ecx
leaq 0x40(%rbx), %r8
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
xorl %r9d, %r9d
pushq $0x1f4                  # imm = 0x1F4
pushq $0x0
callq 0x10845
popq %rcx
popq %rdx
movq %rax, 0x10(%rsp)
pushq $0x48
popq %rdi
callq 0x28bb0
movq %rax, 0x30(%rsp)
movq %r15, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xdcf8
movq 0x30(%rsp), %rdi
pushq $0x1
popq %rsi
movl %r14d, %edx
pushq $0x10
popq %rcx
callq 0x121d7
movl 0x20(%rbx), %edx
movl 0x40(%rbx), %esi
movq 0x30(%rsp), %rcx
movq %r13, %rdi
xorl %r8d, %r8d
movl 0xc(%rsp), %r9d
pushq %r12
pushq %r14
pushq $0x1
pushq $0x0
callq 0xdde1
addq $0x20, %rsp
leaq 0x30(%rsp), %rdi
callq 0x11cb5
movq %rbp, %rdi
callq 0x20737
movq (%rbx), %rbx
jmp 0xdbb0
movq %rsp, %rdi
callq 0xd77e
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq