// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %r9, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %r13
movq %rdi, %r14
leaq 0x10(%rsp), %rbx
movq $0x0, (%rbx)
movq (%rdi), %rax
movl 0xc(%rax), %ebp
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2bea4
movq %rax, 0x40(%rsp)
leaq 0x50(%rsp), %rdx
leaq 0x4c(%rsp), %r8
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rcx
callq 0xedc0
movq 0x50(%rsp,%r15,8), %r14
testq %r14, %r14
je 0x10710
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
pushq $0x0
pushq $0x1
callq 0x1088d
addq $0x10, %rsp
movq (%r14), %r14
jmp 0x106e8
incq %r15
cmpq $0x3, %r15
jne 0x106e3
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x1fcb3
leaq -0xc05(%rip), %rsi      # 0xfb28
movq %rbx, %rdi
callq 0x1fd04
movq (%rbx), %rdi
leaq 0xb0431(%rip), %rax     # 0xc0b70
movslq (%rax), %rax
imulq $0x55555556, %rax, %rsi # imm = 0x55555556
movq %rsi, %rax
shrq $0x3f, %rax
shrq $0x20, %rsi
addl %eax, %esi
callq 0xfc3f
movq %rax, (%rbx)
testq %rax, %rax
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r15
movq 0x18(%rsp), %r14
je 0x10829
movq %rax, %rbp
movq %rbx, %r12
movq 0x18(%rbp), %rbx
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x28fdd
movq %rax, %r14
movl $0x48, %edi
callq 0x2dc95
movq %rax, 0x8(%rsp)
movq %r13, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq 0x28(%rbp), %rdi
movq %r13, %rsi
callq 0x10414
movq 0x8(%rsp), %rdi
movq %rax, 0x8(%rdi)
movl $0x1, %eax
movl %eax, 0x30(%rdi)
movq %r14, 0x38(%rdi)
movl $0x1, %esi
movl %r15d, %edx
movl $0x10, %ecx
callq 0x14ecb
movq 0x8(%rbx), %rdi
movq %r12, %rbx
movq 0x38(%rsp), %r12
movq 0x10(%r14), %rax
movq 0x18(%rsp), %r14
movl 0x18(%rax), %esi
movq 0x8(%rsp), %rcx
xorl %edx, %edx
movq %r14, %r8
xorl %r9d, %r9d
pushq %rbx
pushq %r15
movl $0x1, %eax
pushq %rax
pushq %r12
callq 0x1022f
addq $0x20, %rsp
leaq 0x8(%rsp), %rdi
callq 0x14940
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x10779
movq 0x10(%rsp), %r14
movq %r14, 0x20(%rsp)
testq %r14, %r14
je 0x10852
leaq 0x20(%rsp), %rbx
movq (%r14), %r14
movq %rbx, %rdi
callq 0xfa88
movq %r14, 0x20(%rsp)
testq %r14, %r14
jne 0x1083d
movq $0x0, 0x10(%rsp)
xorl %ebx, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x50, %rdi
callq 0xdb1f
addq $0x8, %rbx
cmpq $0x18, %rbx
jne 0x1085d
leaq 0x40(%rsp), %rdi
callq 0x2bf4b
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq