// File: /workspace/github_c_makefile_star2_O3/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 $0x278, %rsp            # imm = 0x278
movq %r9, %r12
movl %r8d, %r14d
movl %ecx, %r15d
movq %rdx, %r13
movq %rsi, 0x30(%rsp)
movq %rdi, 0x10(%rsp)
movl (%rdi), %ebp
movq $0x0, 0x8(%rsp)
leaq 0x7dec3(%rip), %rdx     # 0x8de0d
movl %ebp, %edi
movq %r13, %rsi
callq 0x12b22
leaq 0x70(%rsp), %rbx
movl %ebp, 0x18(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
callq 0x311c3
cmpl $0x646e65, (%rbx)       # imm = 0x646E65
movq %r13, 0x20(%rsp)
je 0x1007a
leaq 0x70(%rsp), %rbx
xorl %ebp, %ebp
leaq 0x7de8d(%rip), %rdi     # 0x8de13
movq %rbx, %rsi
callq 0x21b23
testl %eax, %eax
jne 0x10063
movl %r15d, %r13d
movq %r14, %r15
movq %r12, %r14
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
movl $0x6, %edx
callq 0x226f5
cmpl $0x5, %eax
jg 0xffc6
leaq 0x7de5d(%rip), %rdi     # 0x8de1a
movl %eax, %esi
xorl %eax, %eax
callq 0x26e94
movl $0x48, %edi
callq 0x2dff4
movq %rax, %r12
movq 0x40(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x8(%r12)
movq 0x48(%rsp), %rdi
callq 0x6bd0
movl %eax, 0xc(%r12)
movq 0x50(%rsp), %rdi
callq 0x1feba
movq %rax, 0x10(%r12)
movq 0x58(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x20(%r12)
movq 0x60(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x24(%r12)
movq 0x68(%rsp), %rdi
callq 0x6bd0
movl %eax, 0x30(%r12)
movq %rbp, (%r12)
movq %r12, 0x8(%rsp)
movl 0x18(%rsp), %edi
movq %rbx, %rsi
callq 0x311c3
cmpl $0x646e65, 0x70(%rsp)   # imm = 0x646E65
movq %r12, %rbp
movq %r14, %r12
movq %r15, %r14
movl %r13d, %r15d
movq 0x20(%rsp), %r13
jne 0xff7f
jmp 0x1007a
movq 0x8(%r13), %rsi
leaq 0x7de1a(%rip), %rdi     # 0x8de88
leaq 0x70(%rsp), %rdx
xorl %eax, %eax
callq 0x26bea
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x20173
movq (%rbx), %rax
leaq 0x38(%rsp), %rbx
movq %rax, (%rbx)
movq 0x10(%rsp), %r13
movl (%r13), %edi
callq 0x6e80
movl $0xffffffff, (%r13)     # imm = 0xFFFFFFFF
leaq -0x463(%rip), %rsi      # 0xfc4c
movq %rbx, %rdi
callq 0x201c4
movq (%rbx), %rdi
leaq 0xb0aaf(%rip), %rax     # 0xc0b70
movl (%rax), %esi
callq 0xfd63
movq %rax, (%rbx)
testq %rax, %rax
je 0x101e1
movq %rax, %r13
movq %r12, 0x18(%rsp)
movl %r15d, 0x10(%rsp)
movq 0x20(%rsp), %rbp
movq 0x10(%r13), %rdi
movq 0x2b0(%rsp), %r12
movl 0x48(%r12), %esi
leaq 0x70(%rsp), %r15
movq %r15, %rdx
callq 0x101f3
movl 0x18(%rbp), %ecx
leaq 0x40(%r13), %r8
movq %r13, %rdi
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdx
xorl %r9d, %r9d
pushq $0x1f4                  # imm = 0x1F4
xorl %ebx, %ebx
pushq %rbx
callq 0x13334
addq $0x10, %rsp
movq %rax, 0x28(%rsp)
movl $0x48, %edi
callq 0x2dff4
movq %rax, 0x8(%rsp)
movq %rbp, 0x10(%rax)
movq 0x28(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq %r13, %rdi
movq %rax, %rsi
callq 0x1025b
movq 0x8(%rsp), %rdi
movl $0x1, %esi
movl %r14d, %edx
movl $0x10, %ecx
callq 0x14f5d
movl 0x20(%r13), %edx
movl 0x40(%r13), %esi
movq 0x8(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movl 0x10(%rsp), %r9d
pushq %r12
pushq %r14
pushq $0x1
pushq %rbx
callq 0x10352
addq $0x20, %rsp
leaq 0x8(%rsp), %rdi
callq 0x149ec
leaq 0x28(%rsp), %rdi
callq 0x24db1
movq (%r13), %r13
testq %r13, %r13
jne 0x100e6
movq 0x38(%rsp), %r14
movq %r14, 0x40(%rsp)
testq %r14, %r14
je 0x101e1
leaq 0x40(%rsp), %rbx
movq (%r14), %r14
movq %rbx, %rdi
callq 0xfbac
movq %r14, 0x40(%rsp)
testq %r14, %r14
jne 0x101cc
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq