// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/gfBlatLib.c
// Function: gfRangesBundle
struct gfRange *gfRangesBundle(struct gfRange *exonList, int maxIntron)
/* Bundle a bunch of 'exons' into plausable 'genes'.  It's
 * not necessary to be precise here.  The main thing is to
 * group together exons that are close to each other in the
 * same target sequence. */
{
struct gfRange *geneList = NULL, *gene = NULL, *lastExon = NULL, *exon, *nextExon;

for (exon = exonList; exon != NULL; exon = nextExon)
    {
    nextExon = exon->next;
    if (lastExon == NULL || !sameString(lastExon->tName, exon->tName) 
	|| exon->t3  != lastExon->t3
        || exon->tStart - lastExon->tEnd > maxIntron)
	{
	AllocVar(gene);
	gene->tStart = exon->tStart;
	gene->tEnd = exon->tEnd;
	gene->tName = cloneString(exon->tName);
	gene->tSeq = exon->tSeq;
	gene->qStart = exon->qStart;
	gene->qEnd = exon->qEnd;
	gene->hitCount = exon->hitCount;
	gene->t3 = exon->t3;
	slAddHead(&gene->components, exon);
	slAddHead(&geneList, gene);
	}
    else
        {
	if (exon->qStart < gene->qStart) gene->qStart = exon->qStart;
	if (exon->qEnd > gene->qEnd) gene->qEnd = exon->qEnd;
	if (exon->tStart < gene->tStart) gene->tStart = exon->tStart;
	if (exon->tEnd > gene->tEnd) gene->tEnd = exon->tEnd;
	gene->hitCount += exon->hitCount;
	slAddTail(&gene->components, exon);
	}
    lastExon = exon;
    }
slReverse(&geneList);
return geneList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x11bdd
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x11a7f
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x6a40
cmpl $0x0, %eax
jne 0x11a7f
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x11a7f
movq -0x30(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x28(%rbp), %rcx
subl 0x24(%rcx), %eax
cmpl -0xc(%rbp), %eax
jle 0x11b2e
movl $0x48, %edi
callq 0x40c50
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x30(%rbp), %rax
movl 0x24(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2a450
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
movq -0x30(%rbp), %rsi
callq 0x119b0
movq -0x20(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x119b0
jmp 0x11bc8
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x11b4c
movq -0x30(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jle 0x11b6a
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x11b88
movq -0x30(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x30(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jle 0x11ba6
movq -0x30(%rbp), %rax
movl 0x24(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x30(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x20(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
movq -0x30(%rbp), %rsi
callq 0x2a960
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x11a1f
leaq -0x18(%rbp), %rdi
callq 0x2aad0
movq -0x18(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq