// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %rbx
subq $0xb8, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl -0x2c(%rbp), %edx
movl $0x3, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x30(%rbp)
movl $0x5dc, -0x34(%rbp)     # imm = 0x5DC
movl $0x4b0, -0x38(%rbp)     # imm = 0x4B0
movl $0x10e, -0x3c(%rbp)     # imm = 0x10E
movq -0x10(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movl $0x28, %edx
callq 0x6570
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movl $0x8, %edi
movl $0x1, %esi
callq 0x398a0
movq %rax, -0xa0(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x14d34
cmpl $0x0, -0x6c(%rbp)
jne 0x14c6b
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0x34(%rbp), %eax
jg 0x14c6b
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x14ca7
movl -0x38(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
addl -0x6c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jl 0x14c99
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
subl -0x6c(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x74(%rbp)
jmp 0x14ca5
movl -0x6c(%rbp), %eax
addl -0x38(%rbp), %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x74(%rbp)
jmp 0x14ca7
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x6c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movslq -0x70(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movb (%rax), %al
movb %al, -0x75(%rbp)
movq -0x80(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x2c(%rbp), %r9d
leaq -0x68(%rbp), %rsi
callq 0x14e00
movq %rax, -0x88(%rbp)
movq -0xa0(%rbp), %rsi
movq -0x10(%rbp), %rcx
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x14a30
movb -0x75(%rbp), %cl
movq -0x80(%rbp), %rax
movb %cl, (%rax)
movl -0x74(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x14c3a
movq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x14dd3
movq -0x98(%rbp), %rdi
movl 0x10(%rbp), %edx
movl 0xf1094(%rip), %ecx     # 0x105df4
movl $0x1, %esi
callq 0x18b80
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x18(%rax), %esi
movq -0x98(%rbp), %rcx
movl -0x24(%rbp), %r9d
movl -0x28(%rbp), %ebx
movl -0x30(%rbp), %r11d
movl 0x10(%rbp), %r10d
movq 0x18(%rbp), %rax
xorl %edx, %edx
xorl %r8d, %r8d
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x121d0
movq -0x98(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x14d42
leaq -0xa0(%rbp), %rdi
callq 0x3a080
leaq -0x90(%rbp), %rdi
callq 0x183e0
addq $0xb8, %rsp
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)