// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/genoFind.c
// Function: gfSegmentedFindHits
static struct gfHit *gfSegmentedFindHits(struct genoFind *gf, aaSeq *seq, 
	Bits *qMaskBits, int qMaskOffset, struct lm *lm, int *retHitCount,
	struct gfSeqSource *target, int tMin, int tMax)
/* Find hits associated with one sequence in general case in a segmented
 * index. */
{
struct gfHit *hitList = NULL, *hit;
int size = seq->size;
int tileSize = gf->tileSize;
int tileTailSize = gf->segSize;
int tileHeadSize = gf->tileSize - tileTailSize;
int lastStart = size - tileSize;
char *poly = seq->dna;
int i, j;
int tileHead, tileTail;
int listSize;
bits32 qStart;
bits16 *endList;
int hitCount = 0;
int (*makeTile)(char *poly, int n) = (gf->isPep ? gfPepTile : gfDnaTile);


initNtLookup();
for (i=0; i<=lastStart; ++i)
    {
    if (qMaskBits == NULL || bitCountRange(qMaskBits, i+qMaskOffset, tileSize) == 0)
	{
	tileHead = makeTile(poly+i, tileHeadSize);
	if (tileHead < 0)
	    continue;
	tileTail = makeTile(poly+i+tileHeadSize, tileTailSize);
	if (tileTail < 0)
	    continue;
	listSize = gf->listSizes[tileHead];
	qStart = i;
	endList = gf->endLists[tileHead];
	for (j=0; j<listSize; ++j)
	    {
	    if (endList[0] == tileTail)
		{
		int tStart = (endList[1]<<16) + endList[2];
		if (target == NULL || 
			(target == findSource(gf, tStart) 
			&& tStart >= tMin && tStart < tMax) ) 
		    {
		    lmAllocVar(lm,hit);
		    hit->qStart = qStart;
		    hit->tStart = tStart;
		    hit->diagonal = tStart + size - qStart;
		    slAddHead(&hitList, hit);
		    ++hitCount;
		    }
		}
	    endList += 3;
	    }
	}
    }
*retHitCount = hitCount;
return hitList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
subl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x44(%rbp), %eax
subl -0x48(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x84(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x28(%rax), %edx
leaq -0x40dd(%rip), %rax     # 0xcc50
leaq -0x4064(%rip), %rcx     # 0xccd0
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x90(%rbp)
callq 0xfde0
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x54(%rbp), %eax
jg 0x10f03
cmpq $0x0, -0x18(%rbp)
je 0x10d7c
movq -0x18(%rbp), %rdi
movl -0x64(%rbp), %esi
addl -0x1c(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x23e00
cmpl $0x0, %eax
jne 0x10ef3
movq -0x90(%rbp), %rax
movq -0x60(%rbp), %rdi
movslq -0x64(%rbp), %rcx
addq %rcx, %rdi
movl -0x50(%rbp), %esi
callq *%rax
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jge 0x10da1
jmp 0x10ef5
movq -0x90(%rbp), %rax
movq -0x60(%rbp), %rdi
movslq -0x64(%rbp), %rcx
addq %rcx, %rdi
movslq -0x50(%rbp), %rcx
addq %rcx, %rdi
movl -0x4c(%rbp), %esi
callq *%rax
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x70(%rbp)
jge 0x10dcd
jmp 0x10ef5
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x6c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x74(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0x10ef1
movq -0x80(%rbp), %rax
movzwl (%rax), %eax
cmpl -0x70(%rbp), %eax
jne 0x10ed7
movq -0x80(%rbp), %rax
movzwl 0x2(%rax), %eax
shll $0x10, %eax
movq -0x80(%rbp), %rcx
movzwl 0x4(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x94(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x10e7d
movq 0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
movl -0x94(%rbp), %esi
callq 0x10f20
movq %rax, %rcx
movq -0xa0(%rbp), %rax
cmpq %rcx, %rax
jne 0x10ed5
movl -0x94(%rbp), %eax
cmpl 0x18(%rbp), %eax
jl 0x10ed5
movl -0x94(%rbp), %eax
cmpl 0x20(%rbp), %eax
jge 0x10ed5
movq -0x28(%rbp), %rdi
movl $0x18, %esi
callq 0x3de60
movq %rax, -0x40(%rbp)
movl -0x78(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x94(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x94(%rbp), %ecx
addl -0x44(%rbp), %ecx
subl -0x78(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x10f80
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x10ed7
movq -0x80(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x80(%rbp)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x10e00
jmp 0x10ef3
jmp 0x10ef5
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x10d4e
movl -0x84(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)