// File: /workspace/github_c_makefile_star2_O3/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 $0x118, %rsp            # imm = 0x118
movl %r8d, %r14d
movl %ecx, %r15d
movq %rdx, %r12
movq %rsi, 0x60(%rsp)
movq %rdi, %r13
xorl %ebx, %ebx
testl %r9d, %r9d
sete %bpl
movq 0x20(%rdi), %rax
movq %rax, 0xc0(%rsp)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movaps %xmm1, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movq %rax, 0x28(%rsp)
movl $0x8, %edi
movl $0x1, %esi
callq 0x294ea
movq %rax, 0x48(%rsp)
movq %r13, 0x38(%rsp)
movl 0x18(%r13), %eax
testl %eax, %eax
jle 0x12afc
movq %r12, 0x80(%rsp)
movb %bpl, %bl
leal 0x1(,%rbx,2), %ecx
movq %rcx, 0x40(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0xd0(%rsp), %r12
xorl %ecx, %ecx
movq %r14, 0x58(%rsp)
movl %r15d, 0x30(%rsp)
testl %ecx, %ecx
sete %dl
cmpl $0x5dd, %eax            # imm = 0x5DD
setl %sil
testb %sil, %dl
je 0x127d6
movl %eax, 0xc(%rsp)
jmp 0x127f7
leal 0x4b0(%rcx), %edx
cmpl %eax, %edx
jge 0x127f1
leal 0x3a2(%rcx), %eax
movl %eax, 0xc(%rsp)
movl $0x4b0, %eax            # imm = 0x4B0
jmp 0x127f7
movl %eax, 0xc(%rsp)
subl %ecx, %eax
movslq %ecx, %rdx
movq 0x38(%rsp), %rcx
addq 0x10(%rcx), %rdx
movq %rdx, 0xb0(%rsp)
movl %eax, 0xb8(%rsp)
movslq %eax, %rcx
movb (%rcx,%rdx), %al
movb %al, 0xb(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movb $0x0, (%rcx,%rdx)
callq 0x15dc0
movq %rax, %r14
movq %rax, 0x90(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x10(%rsp)
movq 0x60(%rsp), %rbx
movq (%rbx), %rax
movl 0xc(%rax), %eax
movl %eax, 0x34(%rsp)
movq %rcx, 0x20(%rsp)
xorl %edi, %edi
callq 0x2c220
movq %rax, 0x88(%rsp)
addq $0x18, %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
leaq 0x9c(%rsp), %r8
callq 0xef2a
xorl %ebp, %ebp
xorl %r15d, %r15d
leaq (%r15,%r15,2), %rax
leaq (%rsp,%rax,8), %rax
addq $0xd0, %rax
movq %rax, 0x78(%rsp)
xorl %r13d, %r13d
movq 0x78(%rsp), %rax
movq (%rax,%r13,8), %r12
testq %r12, %r12
je 0x12910
movq $0x0, 0x18(%rsp)
movq (%r14,%r15,8), %rsi
movq %r12, %rdi
movl 0x34(%rsp), %edx
movl %r13d, %ecx
xorl %r8d, %r8d
leaq 0x18(%rsp), %r9
pushq $0x0
pushq $0x1
callq 0x1098c
addq $0x10, %rsp
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl %r15d, %esi
movl %r13d, %edx
movq 0x80(%rsp), %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x116ba
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x20155
movq %rax, %rbp
movq %rax, 0x10(%rsp)
movq (%r12), %r12
jmp 0x128a5
incq %r13
cmpq $0x3, %r13
jne 0x1289c
incq %r15
cmpq $0x3, %r15
jne 0x12886
leaq 0x10(%rsp), %rdi
leaq -0x2ce6(%rip), %rsi     # 0xfc4c
callq 0x201c4
movq 0x10(%rsp), %rdi
movl $0x7d0, %esi            # imm = 0x7D0
callq 0xfd63
movq %rax, 0x10(%rsp)
testq %rax, %rax
movl 0x150(%rsp), %r12d
leaq 0xa0(%rsp), %r13
je 0x129c1
movq %rax, %rbx
movq 0x20(%rsp), %r15
movq %r12, %rbp
movq 0x18(%rbx), %r12
movl $0x48, %edi
callq 0x2dff4
movq %rax, %r14
movq %r13, 0x10(%rax)
movq %r12, 0x18(%rax)
movq %rbp, %r12
movq 0x40(%rsp), %rbp
movq 0x28(%rbx), %rdi
movq %r13, %rsi
callq 0x10529
movq %rax, 0x8(%r14)
movq %r14, %rdi
movl %ebp, %esi
movl %r12d, %edx
movl $0x10, %ecx
callq 0x14f5d
movq %r15, (%r14)
movq %r14, 0x20(%rsp)
movq (%rbx), %rbx
movq %r14, %r15
testq %rbx, %rbx
jne 0x12968
leaq 0xd0(%rsp), %r12
movq %r12, %rbx
xorl %r14d, %r14d
leaq 0x18(%rsp), %r13
xorl %r15d, %r15d
leaq (%rbx,%r15), %rdi
callq 0xdbe4
addq $0x8, %r15
cmpq $0x18, %r15
jne 0x129d7
incq %r14
addq $0x18, %rbx
cmpq $0x3, %r14
jne 0x129d4
movq 0x10(%rsp), %rbx
movq %rbx, 0x18(%rsp)
testq %rbx, %rbx
je 0x12a13
movq (%rbx), %rbx
movq %r13, %rdi
callq 0xfbac
jmp 0x129fc
movq $0x0, 0x10(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x15e23
leaq 0x88(%rsp), %rdi
callq 0x2c2c7
leaq 0x20(%rsp), %rdi
callq 0x20173
movq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq 0x38(%rsp), %rbx
movq %rbx, %rcx
callq 0x12653
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
movb 0xb(%rsp), %dl
movb %dl, (%rax,%rcx)
movl 0x18(%rbx), %eax
movl 0xc(%rsp), %edx
movl %edx, %ecx
cmpl %eax, %edx
movq 0x58(%rsp), %r14
movl 0x30(%rsp), %ebp
leaq 0xa0(%rsp), %rdi
jl 0x127bd
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
movq 0x158(%rsp), %r15
movq 0x40(%rsp), %r12
movl 0x150(%rsp), %r13d
je 0x12afc
movq %rbx, %rdi
movl $0x1, %esi
movl %r13d, %edx
movl $0x10, %ecx
callq 0x14f5d
movq 0x18(%rbx), %rax
movq 0x8(%rax), %rdi
movl 0x18(%rax), %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %r15
pushq %r13
pushq %r12
pushq %r14
callq 0x10352
addq $0x20, %rsp
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x12ab8
leaq 0x48(%rsp), %rdi
callq 0x298bd
leaq 0x28(%rsp), %rdi
callq 0x14a0c
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq