// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/ffSeedExtend.c
// Function: ffFindExtendNmers
static struct ffAli *ffFindExtendNmers(char *nStart, char *nEnd, char *hStart, char *hEnd,
	int seedSize)
/* Find perfectly matching n-mers and extend them. */
{
struct lm *lm = lmInit(32*1024);
struct seqHashEl **hashTable, *hashEl, **hashSlot;
struct ffAli *ffList = NULL, *ff;
char *n = nStart, *h = hStart, *ne = nEnd - seedSize, *he = hEnd - seedSize;

/* Hash the needle. */
lmAllocArray(lm, hashTable, 4*1024);
while (n <= ne)
    {
    if (!totalDegenerateN(n, seedSize))
	{
	hashSlot = ffHashFuncN(n, seedSize) + hashTable;
	lmAllocVar(lm, hashEl);
	hashEl->seq = n;
	slAddHead(hashSlot, hashEl);
	}
    ++n;
    }

/* Scan the haystack adding hits. */
while (h <= he)
    {
    for (hashEl = hashTable[ffHashFuncN(h, seedSize)]; 
    	hashEl != NULL; hashEl = hashEl->next)
	{
	if (memcmp(hashEl->seq, h, seedSize) == 0)
	    {
	    AllocVar(ff);
	    ff->hStart = h;
	    ff->hEnd = h + seedSize;
	    ff->nStart = hashEl->seq;
	    ff->nEnd = hashEl->seq + seedSize;
	    extendExactLeft(ff->nStart - nStart, ff->hStart - hStart, 
		&ff->nStart, &ff->hStart);
	    extendExactRight(nEnd - ff->nEnd, hEnd - ff->hEnd, &ff->nEnd, &ff->hEnd);
	    ff->left = ffList;
	    ffList = ff;
	    }
	}
    ++h;
    }
ffList = ffMakeRightLinks(ffList);
ffList = ffMergeClose(ffList, nStart, hStart);
lmCleanup(&lm);
return ffList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x8000, %edi           # imm = 0x8000
callq 0x3dc20
movq %rax, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rdi
movl $0x8000, %esi           # imm = 0x8000
callq 0x3de60
movq %rax, -0x38(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x70(%rbp), %rax
ja 0x1c663
movq -0x60(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x1c9d0
cmpl $0x0, %eax
jne 0x1c655
movq -0x60(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x1ca80
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
movl $0x10, %esi
callq 0x3de60
movq %rax, -0x40(%rbp)
movq -0x60(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1c310
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x1c5ef
jmp 0x1c665
movq -0x68(%rbp), %rax
cmpq -0x78(%rbp), %rax
ja 0x1c7b9
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x68(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x1ca80
movl %eax, %ecx
movq -0x80(%rbp), %rax
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1c7a8
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x68(%rbp), %rsi
movslq -0x24(%rbp), %rdx
callq 0x62d0
cmpl $0x0, %eax
jne 0x1c796
movl $0x38, %edi
callq 0x40c50
movq %rax, -0x58(%rbp)
movq -0x68(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x68(%rbp), %rcx
movslq -0x24(%rbp), %rax
addq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0x24(%rbp), %rax
addq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edi
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
movq -0x58(%rbp), %rdx
addq $0x10, %rdx
movq -0x58(%rbp), %rcx
addq $0x20, %rcx
callq 0x1cae0
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movq 0x18(%rcx), %rcx
subq %rcx, %rax
movl %eax, %edi
movq -0x20(%rbp), %rax
movq -0x58(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq %rcx, %rax
movl %eax, %esi
movq -0x58(%rbp), %rdx
addq $0x18, %rdx
movq -0x58(%rbp), %rcx
addq $0x28, %rcx
callq 0x1cba0
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x1c798
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x1c698
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x1c665
movq -0x50(%rbp), %rdi
callq 0x37bc0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1ab90
movq %rax, -0x50(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3dd90
movq -0x50(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)