// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/jkOwnLib/gfBlatLib.c
// Function: gfLongTransTransInMem
void gfLongTransTransInMem(struct dnaSeq *query, struct genoFind *gfs[3], 
   struct hash *t3Hash, boolean qIsRc, boolean tIsRc, boolean qIsRna,
   int minScore, struct gfOutput *out)
/* Chop up query into pieces, align each in translated space, and stitch back
 * together again as nucleotides. */
{
enum ffStringency stringency = (qIsRna ? ffCdna : ffLoose);
int maxSize = 1500;
int preferredSize = 1200;	/* PreferredSize - overlapSize might need to be multiple of 3. */
int overlapSize = 270;
struct dnaSeq subQuery = *query;
int subOffset, subSize, nextOffset;
DNA saveEnd, *endPos;
struct ssBundle *oneBunList = NULL, *bigBunList = NULL, *bun;
struct hash *bunHash = newHash(8);

for (subOffset = 0; subOffset<query->size; subOffset = nextOffset)
    {
    /* Figure out size of this piece.  If query is
     * maxSize or less do it all.   Otherwise just
     * do prefered size, and set it up to overlap
     * with surrounding pieces by overlapSize.  */
    if (subOffset == 0 && query->size <= maxSize)
	nextOffset = subSize = query->size;
    else
        {
	subSize = preferredSize;
	if (subSize + subOffset >= query->size)
	    {
	    subSize = query->size - subOffset;
	    nextOffset = query->size;
	    }
	else
	    {
	    nextOffset = subOffset + preferredSize - overlapSize;
	    }
	}
    subQuery.dna = query->dna + subOffset;
    subQuery.size = subSize;
    endPos = &subQuery.dna[subSize];
    saveEnd = *endPos;
    *endPos = 0;
    oneBunList = gfTransTransFindBundles(gfs, &subQuery, t3Hash, qIsRc, minScore, qIsRna);
    addToBigBundleList(&oneBunList, bunHash, &bigBunList, query);
    *endPos = saveEnd;
    }
for (bun = bigBunList; bun != NULL; bun = bun->next)
    {
    ssStitch(bun, ffCdna, minScore, ssAliCount);
    saveAlignments(bun->genoSeq->name, bun->genoSeq->size, 0, 
	bun, NULL, qIsRc, tIsRc, stringency, minScore, out);
    }
hashFree(&bunHash);
ssBundleFreeList(&bigBunList);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %r8, 0x58(%rsp)
movl %ecx, 0x18(%rsp)
movq %rdx, 0x70(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdi, %rbx
xorl %eax, %eax
testl %r9d, %r9d
sete %al
leal 0x1(,%rax,2), %eax
movq %rax, 0x20(%rsp)
movq 0x20(%rdi), %rax
leaq 0x90(%rsp), %rcx
movq %rax, 0x20(%rcx)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movaps %xmm1, 0x10(%rcx)
movaps %xmm0, (%rcx)
leaq 0x38(%rsp), %rax
andq $0x0, (%rax)
leaq 0x30(%rsp), %r15
andq $0x0, (%r15)
pushq $0x8
popq %rdi
pushq $0x1
popq %rsi
callq 0x245c9
movq %rax, 0x28(%rsp)
xorl %eax, %eax
movq %rbx, 0x48(%rsp)
movl 0x18(%rbx), %edi
movl %edi, %ecx
subl %eax, %ecx
jle 0x10092
testl %eax, %eax
sete %dl
cmpl $0x5dd, %edi            # imm = 0x5DD
setl %sil
testb %sil, %dl
je 0xfe26
movl %edi, 0x4(%rsp)
movl %edi, %ecx
jmp 0xfe45
leal 0x4b0(%rax), %edx
cmpl %edi, %edx
jge 0xfe41
leal 0x3a2(%rax), %ecx
movl %ecx, 0x4(%rsp)
movl $0x4b0, %ecx            # imm = 0x4B0
jmp 0xfe45
movl %edi, 0x4(%rsp)
cltq
addq 0x10(%rbx), %rax
movq %rax, 0xa0(%rsp)
movl %ecx, 0xa8(%rsp)
movslq %ecx, %rdx
movb (%rdx,%rax), %cl
movb %cl, 0x3(%rsp)
movq %rax, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movb $0x0, (%rdx,%rax)
leaq 0x90(%rsp), %rdi
callq 0x12f80
movq %rax, %r14
movq %rax, 0x80(%rsp)
andq $0x0, 0x8(%rsp)
movq 0x50(%rsp), %rbx
movq (%rbx), %rax
movl 0xc(%rax), %eax
movl %eax, 0x1c(%rsp)
andq $0x0, 0x10(%rsp)
xorl %edi, %edi
callq 0x26f00
movq %rax, 0x78(%rsp)
addq $0x18, %r14
movq %rbx, %rdi
movq %r14, %r12
movq %r14, %rsi
leaq 0xc0(%rsp), %rdx
movq %rax, %rcx
leaq 0x8c(%rsp), %r8
callq 0xcbdd
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq $0x3, %r15
je 0xff6f
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0xff67
imulq $0x18, %r15, %rax
addq %rsp, %rax
addq $0xc0, %rax
leaq (%rax,%r14,8), %r13
movq (%r13), %r13
testq %r13, %r13
je 0xff62
andq $0x0, 0x40(%rsp)
movq (%r12,%r15,8), %rsi
movq %r13, %rdi
movl 0x1c(%rsp), %edx
movl %r14d, %ecx
xorl %r8d, %r8d
leaq 0x40(%rsp), %r9
pushq $0x0
pushq $0x1
callq 0xe37d
popq %rax
popq %rcx
movq 0x40(%rsp), %rbp
movq %rbp, %rdi
movl %r15d, %esi
movl %r14d, %edx
movq 0x70(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xef0e
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1c549
movq %rax, %rbx
movq %rax, 0x8(%rsp)
jmp 0xfeff
incq %r14
jmp 0xfee8
incq %r15
jmp 0xfedb
leaq 0x8(%rsp), %rdi
leaq -0x27c4(%rip), %rsi     # 0xd7b7
callq 0x1c5ab
movq 0x8(%rsp), %rdi
movl $0x7d0, %esi            # imm = 0x7D0
callq 0xd8b7
movq %rax, %rbx
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
testq %rbx, %rbx
je 0xfff2
movq 0x18(%rbx), %r12
pushq $0x48
popq %rdi
callq 0x28bb0
movq %rax, %r14
leaq 0x90(%rsp), %rsi
movq %rsi, 0x10(%rax)
movq %r12, 0x18(%rax)
movq 0x28(%rbx), %rdi
callq 0xdfa8
movq %rax, 0x8(%r14)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movl 0x140(%rsp), %edx
pushq $0x10
popq %rcx
callq 0x121d7
movq %r15, (%r14)
movq %r14, 0x10(%rsp)
movq (%rbx), %rbx
movq %r14, %r15
jmp 0xff9a
leaq 0xc0(%rsp), %rbx
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0x10024
xorl %r15d, %r15d
cmpq $0x18, %r15
je 0x1001b
leaq (%rbx,%r15), %rdi
callq 0xba5e
addq $0x8, %r15
jmp 0x10006
incq %r14
addq $0x18, %rbx
jmp 0xfffd
leaq 0x8(%rsp), %rdi
callq 0xd77e
leaq 0x80(%rsp), %rdi
callq 0x12fe3
leaq 0x78(%rsp), %rdi
callq 0x26fa2
leaq 0x10(%rsp), %rdi
callq 0x1c567
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rsi
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rdx
movq 0x48(%rsp), %rbx
movq %rbx, %rcx
callq 0xfcd0
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rcx
movb 0x3(%rsp), %dl
movb %dl, (%rax,%rcx)
movl 0x4(%rsp), %eax
jmp 0xfdfd
pushq $0x1
popq %rbx
pushq $0x10
popq %rbp
movq (%r15), %r15
testq %r15, %r15
je 0x100eb
movq %r15, %rdi
movl %ebx, %esi
movl 0x140(%rsp), %r14d
movl %r14d, %edx
movl %ebp, %ecx
callq 0x121d7
movq 0x18(%r15), %rax
movq 0x8(%rax), %rdi
movl 0x18(%rax), %esi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
movl 0x18(%rsp), %r9d
pushq 0x148(%rsp)
pushq %r14
pushq 0x30(%rsp)
pushq 0x70(%rsp)
callq 0xdde1
addq $0x20, %rsp
jmp 0x10098
leaq 0x28(%rsp), %rdi
callq 0x2494c
leaq 0x30(%rsp), %rdi
callq 0x11cd5
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq