// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/jkOwnLib/gfOut.c
// Function: saveAxtBundle
static void saveAxtBundle(char *chromName, int chromSize, int chromOffset,
	struct ffAli *ali, 
	struct dnaSeq *tSeq, struct hash *t3Hash, struct dnaSeq *qSeq, 
	boolean qIsRc, boolean tIsRc, 
	enum ffStringency stringency, int minMatch, struct gfOutput *out)
/* Save alignment to axtBundle. */
{
struct axtData *ad = out->data;
struct ffAli *sAli, *eAli, *ff, *rt, *eFf = NULL;
struct axt *axt;
struct dyString *q = newDyString(1024), *t = newDyString(1024);
struct axtBundle *gab;
struct trans3 *t3List = NULL;

if (t3Hash != NULL)
    t3List = hashMustFindVal(t3Hash, tSeq->name);
AllocVar(gab);
gab->tSize = chromSize;
gab->qSize = qSeq->size;
for (sAli = ali; sAli != NULL; sAli = eAli)
    {
    eAli = ffNextBreak(sAli, 8, tSeq, t3List);
    dyStringClear(q);
    dyStringClear(t);
    for (ff = sAli; ff != eAli; ff = ff->right)
        {
	dyStringAppendN(q, ff->nStart, ff->nEnd - ff->nStart);
	dyStringAppendN(t, ff->hStart, ff->hEnd - ff->hStart);
	rt = ff->right;
	if (rt != eAli)
	    {
	    int nGap = rt->nStart - ff->nEnd;
	    int nhStart = trans3GenoPos(rt->hStart, tSeq, t3List, FALSE) 
	    	+ chromOffset;
	    int ohEnd = trans3GenoPos(ff->hEnd, tSeq, t3List, TRUE) 
	    	+ chromOffset;
	    int hGap = nhStart - ohEnd;
	    int gap = max(nGap, hGap);
	    if (nGap < 0 || hGap < 0)
		{
	        errAbort("Negative gap size in %s vs %s", tSeq->name, qSeq->name);
		}
	    if (nGap == gap)
	        {
		dyStringAppendN(q, ff->nEnd, gap);
		dyStringAppendMultiC(t, '-', gap);
		}
	    else
	        {
		dyStringAppendN(t, ff->hEnd, gap);
		dyStringAppendMultiC(q, '-', gap);
		}
	    }
	eFf = ff;	/* Keep track of last block in bunch */
	}
    assert(t->stringSize == q->stringSize);
    AllocVar(axt);
    axt->qName = cloneString(qSeq->name);
    axt->qStart = sAli->nStart - qSeq->dna;
    axt->qEnd = eFf->nEnd - qSeq->dna;
    axt->qStrand = (qIsRc ? '-' : '+');
    axt->tName = cloneString(chromName);
    axt->tStart = trans3GenoPos(sAli->hStart, tSeq, t3List, FALSE) + chromOffset;
    axt->tEnd = trans3GenoPos(eFf->hEnd, tSeq, t3List, TRUE) + chromOffset;
    axt->tStrand = (tIsRc ? '-' : '+');
    axt->symCount = t->stringSize;
    axt->qSym = cloneString(q->string);
    axt->tSym = cloneString(t->string);
    axt->frame = trans3Frame(sAli->hStart, t3List);
    if (out->qIsProt)
	axt->score = axtScoreProteinDefault(axt);
    else 
	axt->score = axtScoreDnaDefault(axt);
    slAddHead(&gab->axtList, axt);
    }
slReverse(&gab->axtList);
dyStringFree(&q);
dyStringFree(&t);
slAddHead(&ad->bundleList, gab);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, %r12
movq %r8, %r15
movq %rcx, %rbp
movl %edx, 0x2c(%rsp)
movl %esi, %r14d
movq %rdi, 0x48(%rsp)
movq 0xd8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movl $0x400, %edi            # imm = 0x400
callq 0x264e0
movq %rax, 0x20(%rsp)
movq %rax, 0x70(%rsp)
movl $0x400, %edi            # imm = 0x400
callq 0x264e0
movq %rax, 0x18(%rsp)
movq %rax, 0x68(%rsp)
testq %r12, %r12
je 0x13d17
movq 0x8(%r15), %rsi
movq %r12, %rdi
callq 0x29361
movq %rax, 0x10(%rsp)
jmp 0x13d20
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x2dff4
movq %rax, %rcx
movl %r14d, 0x10(%rax)
movq 0xb0(%rsp), %rax
movl 0x18(%rax), %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x14(%rcx)
testq %rbp, %rbp
je 0x1403d
cmpl $0x0, 0xb8(%rsp)
setne %al
addb %al, %al
addb $0x2b, %al
movb %al, 0x7(%rsp)
cmpl $0x0, 0xc0(%rsp)
setne %al
addb %al, %al
addb $0x2b, %al
movb %al, 0x6(%rsp)
xorl %r13d, %r13d
movq %r15, 0x38(%rsp)
movq %rbp, 0x8(%rsp)
movq %rbp, %rbx
movq 0x8(%rbx), %rbp
testq %rbp, %rbp
je 0x13dd6
movq 0x20(%rbp), %rdi
movq %r15, %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x15f64
movl %eax, %r14d
movq 0x28(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x15f64
movl 0x10(%rbp), %ecx
subl 0x18(%rbx), %ecx
subl %eax, %r14d
je 0x13dc8
testl %ecx, %ecx
jne 0x13dd6
cmpl $0x8, %r14d
ja 0x13dd6
movq %rbp, %rbx
cmpl $0x9, %ecx
jb 0x13d83
movq 0x20(%rsp), %rbx
xorl %ecx, %ecx
movl %ecx, 0x14(%rbx)
movq 0x8(%rbx), %rax
movb %cl, (%rax)
movq 0x18(%rsp), %r14
movl %ecx, 0x14(%r14)
movq 0x8(%r14), %rax
movb %cl, (%rax)
cmpq %rbp, 0x8(%rsp)
je 0x13f1a
movq 0x8(%rsp), %rax
movq %rbp, 0x50(%rsp)
movq %rax, %r13
movq 0x10(%rax), %rsi
movl 0x18(%rax), %edx
subl %esi, %edx
movq %rbx, %rdi
callq 0x265ea
movq 0x20(%r13), %rsi
movl 0x28(%r13), %edx
subl %esi, %edx
movq %r14, %rdi
callq 0x265ea
movq 0x8(%r13), %rax
cmpq %rbp, %rax
je 0x13f0d
leaq 0x18(%r13), %rbp
movq %r13, 0x58(%rsp)
addq $0x28, %r13
movl 0x10(%rax), %r14d
subl (%rbp), %r14d
movq 0x20(%rax), %rdi
movq %r15, %rsi
movq %r15, %rbx
movq 0x10(%rsp), %r15
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x15f64
movl %eax, %r12d
movq %r13, 0x60(%rsp)
movq (%r13), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0x15f64
subl %eax, %r12d
cmpl %r14d, %r12d
movl %r14d, %r15d
cmovgl %r12d, %r15d
testl %r14d, %r14d
js 0x13e9e
testl %r12d, %r12d
jns 0x13ec1
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0xb0(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x7a445(%rip), %rdi     # 0x8e2ff
xorl %eax, %eax
callq 0x26e94
cmpl %r14d, %r12d
cmovgq 0x60(%rsp), %rbp
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq 0x18(%rsp), %r14
cmovgq %r14, %rdi
movq %r14, %r12
cmovgq %rbx, %r12
movq (%rbp), %rsi
movl %r15d, %edx
callq 0x265ea
movq %r12, %rdi
movl $0x2d, %esi
movl %r15d, %edx
callq 0x266d2
movq 0x38(%rsp), %r15
movq 0x50(%rsp), %rbp
movq 0x58(%rsp), %r13
movq 0x8(%r13), %rax
cmpq %rbp, %rax
jne 0x13e0a
movl 0x14(%r14), %eax
cmpl 0x14(%rbx), %eax
jne 0x1407f
movl $0x58, %edi
callq 0x2dff4
movq %rax, %r14
movq 0xb0(%rsp), %rbx
movq 0x8(%rbx), %rdi
callq 0x1feba
movq %rax, 0x8(%r14)
movq 0x8(%rsp), %rcx
movl 0x10(%rcx), %eax
movq %rcx, %r12
movl 0x10(%rbx), %ecx
subl %ecx, %eax
movl %eax, 0x10(%r14)
movl 0x18(%r13), %eax
subl %ecx, %eax
movl %eax, 0x14(%r14)
movb 0x7(%rsp), %al
movb %al, 0x18(%r14)
movq 0x48(%rsp), %rdi
callq 0x1feba
movq %rax, 0x20(%r14)
movq 0x20(%r12), %rdi
movq %r15, %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x15f64
movl 0x2c(%rsp), %ebx
addl %ebx, %eax
movl %eax, 0x28(%r14)
movq 0x28(%r13), %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x15f64
addl %ebx, %eax
movl %eax, 0x2c(%r14)
movb 0x6(%rsp), %al
movb %al, 0x30(%r14)
movq 0x18(%rsp), %rbx
movl 0x14(%rbx), %eax
movl %eax, 0x38(%r14)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1feba
movq %rax, 0x40(%r14)
movq 0x8(%rbx), %rdi
callq 0x1feba
movq %rax, 0x48(%r14)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
movq %r12, %rsi
callq 0x15fb4
movl %eax, 0x50(%r14)
movq 0xd8(%rsp), %rax
cmpl $0x0, 0x3c(%rax)
je 0x14018
movq %r14, %rdi
callq 0x1a22d
jmp 0x14020
movq %r14, %rdi
callq 0x1a1fd
movl %eax, 0x34(%r14)
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, (%r14)
movq %r14, 0x8(%rcx)
testq %rbp, %rbp
jne 0x13d7b
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x20173
leaq 0x70(%rsp), %rdi
callq 0x2651d
leaq 0x68(%rsp), %rdi
callq 0x2651d
movq 0x40(%rsp), %rcx
movq (%rcx), %rax
movq %rax, (%rbx)
movq %rbx, (%rcx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7a297(%rip), %rdi     # 0x8e31d
leaq 0x7a2af(%rip), %rsi     # 0x8e33c
leaq 0x7a2b9(%rip), %rcx     # 0x8e34d
movl $0x128, %edx            # imm = 0x128
callq 0x6460