// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/ffSeedExtend.c
// Function: scanIndexForSmallExons
static struct ffAli *scanIndexForSmallExons(struct genoFind *gf, struct gfSeqSource *target,
    struct dnaSeq *qSeq, Bits *qMaskBits, int qMaskOffset, struct dnaSeq *tSeq,
    struct lm *lm, struct ffAli *ffList)
/* Use index to look for missing small exons. */
{
int qGap, tGap, tStart, qStart;
struct ffAli *lastFf = NULL, *ff = ffList;
struct gfHit *hitList = NULL;
struct dnaSeq qSubSeq;
struct ffAli *extraList = NULL;
int tileSize = gf->tileSize;
int biggestToFind = 200;	/* Longer should be found at an earlier stage */

/* Handle problematic empty case immediately. */
if (ffList == NULL)
    return NULL;

ZeroVar(&qSubSeq);

/* Look for initial gap. */
qGap = ff->nStart - qSeq->dna;
tGap = ff->hStart - tSeq->dna;
if (qGap >= tileSize && qGap <= biggestToFind && tGap >= tileSize)
    {
    tStart = ff->hStart - tSeq->dna;
    if (tGap > ffIntronMax) 
	{
	tGap = ffIntronMax;
	}
    qSubSeq.dna = qSeq->dna;
    qSubSeq.size = qGap;
    hitList = gfFindHitsInRegion(gf, &qSubSeq, qMaskBits, qMaskOffset,
	lm, target, tStart - tGap, tStart);
    addExtraHits(hitList, tileSize, &qSubSeq, tSeq, &extraList);
    }

/* Look for middle gaps. */
for (;;)
    {
    lastFf = ff;
    ff = ff->right;
    if (ff == NULL)
	break;
    qGap = ff->nStart - lastFf->nEnd;
    tGap = ff->hStart - lastFf->hEnd;
    if (qGap >= tileSize && qGap <= biggestToFind && tGap >= tileSize)
	 {
	 qStart = lastFf->nEnd - qSeq->dna;
	 tStart = lastFf->hEnd - tSeq->dna;
	 qSubSeq.dna = lastFf->nEnd;
	 qSubSeq.size = qGap;
	 hitList = gfFindHitsInRegion(gf, &qSubSeq, qMaskBits, qMaskOffset + qStart, 
		lm, target, tStart, tStart + tGap);
	 addExtraHits(hitList, tileSize, &qSubSeq, tSeq, &extraList);
	 }
    }

/* Look for end gaps. */
qGap = qSeq->dna + qSeq->size - lastFf->nEnd;
tGap = tSeq->dna + tSeq->size - lastFf->hEnd;
if (qGap >= tileSize && qGap < biggestToFind && tGap >= tileSize)
    {
    if (tGap > ffIntronMax) tGap = ffIntronMax;
    qStart = lastFf->nEnd - qSeq->dna;
    tStart = lastFf->hEnd - tSeq->dna;
    qSubSeq.dna = lastFf->nEnd;
    qSubSeq.size = qGap;
    hitList = gfFindHitsInRegion(gf, &qSubSeq, qMaskBits, qMaskOffset + qStart, 
		lm, target, tStart, tStart + tGap);
    addExtraHits(hitList, tileSize, &qSubSeq, tSeq, &extraList);
    }
extraList = ffMakeRightLinks(extraList);
ffList = foldInExtras(qSeq, tSeq, ffList, extraList);
return ffList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x50(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x94(%rbp)
movl $0xc8, -0x98(%rbp)
cmpq $0x0, 0x18(%rbp)
jne 0x1ce59
movq $0x0, -0x8(%rbp)
jmp 0x1d1ca
leaq -0x88(%rbp), %rdi
movl $0x28, %esi
callq 0x1dc10
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x94(%rbp), %eax
jl 0x1cf5c
movl -0x3c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jg 0x1cf5c
movl -0x40(%rbp), %eax
cmpl -0x94(%rbp), %eax
jl 0x1cf5c
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x44(%rbp)
movl -0x40(%rbp), %eax
leaq 0xe9dbd(%rip), %rcx     # 0x106ca0
cmpl (%rcx), %eax
jle 0x1cef3
leaq 0xe9db2(%rip), %rax     # 0x106ca0
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movq 0x10(%rbp), %r8
movq -0x18(%rbp), %r9
movl -0x44(%rbp), %r10d
subl -0x40(%rbp), %r10d
movl -0x44(%rbp), %eax
leaq -0x88(%rbp), %rsi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0xefd0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movl -0x94(%rbp), %esi
movq -0x38(%rbp), %rcx
leaq -0x88(%rbp), %rdx
leaq -0x90(%rbp), %r8
callq 0x1dc40
jmp 0x1cf5e
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x1cf7e
jmp 0x1d073
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x18(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x50(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x94(%rbp), %eax
jl 0x1d06e
movl -0x3c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jg 0x1d06e
movl -0x40(%rbp), %eax
cmpl -0x94(%rbp), %eax
jl 0x1d06e
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
addl -0x48(%rbp), %ecx
movq 0x10(%rbp), %r8
movq -0x18(%rbp), %r9
movl -0x44(%rbp), %r10d
movl -0x44(%rbp), %eax
addl -0x40(%rbp), %eax
leaq -0x88(%rbp), %rsi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0xefd0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movl -0x94(%rbp), %esi
movq -0x38(%rbp), %rcx
leaq -0x88(%rbp), %rdx
leaq -0x90(%rbp), %r8
callq 0x1dc40
jmp 0x1cf5e
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x18(%rcx), %rcx
addq %rcx, %rax
movq -0x50(%rbp), %rcx
movq 0x18(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movslq 0x18(%rcx), %rcx
addq %rcx, %rax
movq -0x50(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x94(%rbp), %eax
jl 0x1d193
movl -0x3c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jge 0x1d193
movl -0x40(%rbp), %eax
cmpl -0x94(%rbp), %eax
jl 0x1d193
movl -0x40(%rbp), %eax
leaq 0xe9bb4(%rip), %rcx     # 0x106ca0
cmpl (%rcx), %eax
jle 0x1d0fc
leaq 0xe9ba9(%rip), %rax     # 0x106ca0
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
addl -0x48(%rbp), %ecx
movq 0x10(%rbp), %r8
movq -0x18(%rbp), %r9
movl -0x44(%rbp), %r10d
movl -0x44(%rbp), %eax
addl -0x40(%rbp), %eax
leaq -0x88(%rbp), %rsi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0xefd0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movl -0x94(%rbp), %esi
movq -0x38(%rbp), %rcx
leaq -0x88(%rbp), %rdx
leaq -0x90(%rbp), %r8
callq 0x1dc40
movq -0x90(%rbp), %rdi
callq 0x37bc0
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq 0x18(%rbp), %rdx
movq -0x90(%rbp), %rcx
callq 0x1dd80
movq %rax, 0x18(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)