// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/jkOwnLib/gfBlatLib.c
// Function: gfFindAlignAaTrans
void gfFindAlignAaTrans(struct genoFind *gfs[3], aaSeq *qSeq, struct hash *t3Hash, 
	boolean tIsRc, int minMatch, struct gfOutput *out)
/* Look for qSeq alignment in three translated reading frames. Save alignment
 * via outFunction/outData. */
{
struct gfClump *clumps[3];
int frame;
struct gfClump *clump;
struct gfRange *rangeList = NULL, *range;
aaSeq *targetSeq;
struct ssBundle *bun;
int tileSize = gfs[0]->tileSize;
struct trans3 *t3;
int hitCount;
struct lm *lm = lmInit(0);

gfTransFindClumps(gfs, qSeq, clumps, lm, &hitCount);
for (frame=0; frame<3; ++frame)
    {
    for (clump = clumps[frame]; clump != NULL; clump = clump->next)
	{
	clumpToHspRange(clump, qSeq, tileSize, frame, NULL, &rangeList, TRUE, FALSE);
	}
    }
slReverse(&rangeList);
slSort(&rangeList, gfRangeCmpTarget);
rangeList = gfRangesBundle(rangeList, ffIntronMax/3);
for (range = rangeList; range != NULL; range = range->next)
    {
    targetSeq = range->tSeq;
    t3 = hashMustFindVal(t3Hash, targetSeq->name);
    AllocVar(bun);
    bun->qSeq = qSeq;
    bun->genoSeq = targetSeq;
    bun->ffList = gfRangesToFfItem(range->components, qSeq);
    bun->isProt = TRUE;
    bun->t3List = t3;
    ssStitch(bun, ffCdna, minMatch, ssAliCount);
    saveAlignments(targetSeq->name, t3->seq->size, 0, 
	bun, t3Hash, FALSE, tIsRc, ffCdna, minMatch, out);
    ssBundleFree(&bun);
    }
gfRangeFreeList(&rangeList);
for (frame=0; frame<3; ++frame)
    gfClumpFreeList(&clumps[frame]);
lmCleanup(&lm);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
leaq 0x8(%rsp), %rbx
andq $0x0, (%rbx)
movq %rsi, %r13
movq %rdi, %r14
movq (%rdi), %rax
movl 0xc(%rax), %ebp
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x26f00
movq %rax, 0x30(%rsp)
leaq 0x40(%rsp), %rdx
leaq 0x3c(%rsp), %r8
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rcx
callq 0xcb7c
cmpq $0x3, %r15
je 0xe25f
leaq (%rsp,%r15,8), %r14
addq $0x40, %r14
movq (%r14), %r14
testq %r14, %r14
je 0xe25a
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
pushq $0x0
pushq $0x1
callq 0xe37d
addq $0x10, %rsp
jmp 0xe232
incq %r15
jmp 0xe224
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1c567
leaq -0xabc(%rip), %rsi      # 0xd7b7
movq %rbx, %rdi
callq 0x1c5ab
movq (%rbx), %rdi
leaq 0xa68eb(%rip), %rax     # 0xb4b70
movl (%rax), %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
movl %eax, %esi
callq 0xd8b7
movq %rax, %rbp
movq %rax, (%rbx)
movq 0x10(%rsp), %rbx
movq 0x20(%rsp), %r12
testq %rbp, %rbp
je 0xe33f
movq 0x18(%rbp), %r15
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x2447a
movq %rax, %r14
pushq $0x48
popq %rdi
callq 0x28bb0
movq %rax, (%rsp)
movq %r13, 0x10(%rax)
movq %r15, 0x18(%rax)
movq 0x28(%rbp), %rdi
movq %r13, %rsi
callq 0xdfa8
movq (%rsp), %rdi
movq %rax, 0x8(%rdi)
pushq $0x1
popq %rax
movq %rax, %rsi
movl %esi, 0x30(%rdi)
movq %r14, 0x38(%rdi)
movl %r12d, %edx
pushq $0x10
popq %rcx
callq 0x121d7
movq 0x8(%r15), %rdi
movq 0x10(%r14), %rax
movl 0x18(%rax), %esi
movq (%rsp), %rcx
xorl %edx, %edx
movq %rbx, %r8
xorl %r9d, %r9d
pushq 0x28(%rsp)
pushq %r12
pushq $0x1
popq %rax
pushq %rax
pushq 0x30(%rsp)
callq 0xdde1
addq $0x20, %rsp
movq %rsp, %rdi
callq 0x11cb5
movq (%rbp), %rbp
jmp 0xe2a4
leaq 0x8(%rsp), %rdi
callq 0xd77e
xorl %ebx, %ebx
cmpq $0x18, %rbx
je 0xe364
leaq (%rsp,%rbx), %rdi
addq $0x40, %rdi
callq 0xba5e
addq $0x8, %rbx
jmp 0xe34b
leaq 0x30(%rsp), %rdi
callq 0x26fa2
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq