// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movq 0x38(%rbp), %rax
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq 0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x400, %edi            # imm = 0x400
callq 0x35020
movq %rax, -0x68(%rbp)
movl $0x400, %edi            # imm = 0x400
callq 0x35020
movq %rax, -0x70(%rbp)
movq $0x0, -0x80(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x16a69
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x39590
movq %rax, -0x80(%rbp)
movl $0x18, %edi
callq 0x40c50
movq %rax, -0x78(%rbp)
movl -0xc(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x10(%rax)
movq 0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x16e81
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x80(%rbp), %rcx
movl $0x8, %esi
callq 0x17ee0
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movq -0x70(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x16cb7
movq -0x68(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x351f0
movq -0x70(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x20(%rcx), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x351f0
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x16c9e
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x84(%rbp)
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rdx
xorl %ecx, %ecx
callq 0x1a7a0
addl -0x10(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rdx
movl $0x1, %ecx
callq 0x1a7a0
addl -0x10(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x88(%rbp), %eax
subl -0x8c(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x90(%rbp), %eax
jle 0x16bee
movl -0x84(%rbp), %eax
movl %eax, -0x98(%rbp)
jmp 0x16bfa
movl -0x90(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x94(%rbp)
cmpl $0x0, -0x84(%rbp)
jl 0x16c18
cmpl $0x0, -0x90(%rbp)
jge 0x16c36
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0xc15c8(%rip), %rdi     # 0xd81f7
movb $0x0, %al
callq 0x35d40
movl -0x84(%rbp), %eax
cmpl -0x94(%rbp), %eax
jne 0x16c71
movq -0x68(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x94(%rbp), %edx
callq 0x351f0
movq -0x70(%rbp), %rdi
movl -0x94(%rbp), %edx
movl $0x2d, %esi
callq 0x35320
jmp 0x16c9c
movq -0x70(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rsi
movl -0x94(%rbp), %edx
callq 0x351f0
movq -0x68(%rbp), %rdi
movl -0x94(%rbp), %edx
movl $0x2d, %esi
callq 0x35320
jmp 0x16c9e
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x16af0
movq -0x70(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x68(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jne 0x16cc9
jmp 0x16ce8
leaq 0xc1545(%rip), %rdi     # 0xd8215
leaq 0xc155d(%rip), %rsi     # 0xd8234
movl $0x128, %edx            # imm = 0x128
leaq 0xc1562(%rip), %rcx     # 0xd8245
callq 0x6450
movl $0x58, %edi
callq 0x40c50
movq %rax, -0x60(%rbp)
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2a450
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x14(%rax)
movl 0x18(%rbp), %edx
movl $0x2b, %eax
movl $0x2d, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x60(%rbp), %rax
movb %cl, 0x18(%rax)
movq -0x8(%rbp), %rdi
callq 0x2a450
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rdx
xorl %ecx, %ecx
callq 0x1a7a0
movl %eax, %ecx
addl -0x10(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rdx
movl $0x1, %ecx
callq 0x1a7a0
movl %eax, %ecx
addl -0x10(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl 0x20(%rbp), %edx
movl $0x2b, %eax
movl $0x2d, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x60(%rbp), %rax
movb %cl, 0x30(%rax)
movq -0x70(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2a450
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2a450
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x80(%rbp), %rsi
callq 0x1a820
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x50(%rax)
movq 0x38(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0x16e51
movq -0x60(%rbp), %rdi
callq 0x21590
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x16e63
movq -0x60(%rbp), %rdi
callq 0x21550
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x78(%rbp), %rdi
addq $0x8, %rdi
movq -0x60(%rbp), %rsi
callq 0x17fc0
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x16a97
movq -0x78(%rbp), %rdi
addq $0x8, %rdi
callq 0x2aad0
leaq -0x68(%rbp), %rdi
callq 0x35080
leaq -0x70(%rbp), %rdi
callq 0x35080
movq -0x30(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x17fc0
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)