// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/bandExt.c
// Function: bandExtFf
struct ffAli *bandExtFf(
	struct lm *lm,	/* Local memory pool, NULL to use global allocation for ff */
	struct axtScoreScheme *ss, 	/* Scoring scheme to use. */
	int maxInsert,			/* Maximum number of inserts to allow. */
	struct ffAli *origFf,		/* Alignment block to extend. */
	char *nStart, char *nEnd,	/* Bounds of region to extend through */
	char *hStart, char *hEnd,	/* Bounds of region to extend through */
	int dir,			/* +1 to extend end, -1 to extend start */
	int maxExt)			/* Maximum length of extension. */
/* Extend a gapless alignment in one direction.  Returns extending
 * ffAlis, not linked into origFf, or NULL if no extension possible. */
{
int symAlloc = 2*maxExt;
char *symBuf = needMem(4*maxExt);
char *nBuf = symBuf;
char *hBuf = symBuf + symAlloc;
char *ns, *hs;
int symCount, nExt, hExt;
int nSize, hSize;
struct ffAli *ffList = NULL;
boolean gotExt;

if (dir > 0)
    {
    nSize = nEnd - origFf->nEnd;
    hSize = hEnd - origFf->hEnd;
    if (nSize > maxExt) nSize = maxExt;
    if (hSize > maxExt) hSize = maxExt;
    ns = origFf->nEnd;
    hs = origFf->hEnd;
    }
else
    {
    nSize = origFf->nStart - nStart;
    hSize = origFf->hStart - hStart;
    if (nSize > maxExt) nSize = maxExt;
    if (hSize > maxExt) hSize = maxExt;
    ns = origFf->nStart - nSize;
    hs = origFf->hStart - hSize;
    }

gotExt = bandExt(FALSE, ss, maxInsert, ns, nSize, hs, hSize, dir,
	symAlloc, &symCount, nBuf, hBuf, &nExt, &hExt);
if (gotExt)
    {
    char *nExtStart, *hExtStart;
    if (dir > 0)
	{
	nExtStart = ns;
	hExtStart = hs;
	}
    else
	{
	nExtStart = origFf->nStart - nExt - 1;
	hExtStart = origFf->hStart - hExt - 1;
	}
    ffList = ffAliFromSym(symCount, nBuf, hBuf, lm,  nExtStart, hExtStart);
    }
freeMem(symBuf);
return ffList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movl 0x28(%rbp), %eax
shll %eax
movl %eax, -0x5c(%rbp)
movl 0x28(%rbp), %eax
shll $0x2, %eax
movslq %eax, %rdi
callq 0x40c50
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0xa8(%rbp)
cmpl $0x0, 0x20(%rbp)
jle 0x206fd
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x98(%rbp)
movq 0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x9c(%rbp)
movl -0x98(%rbp), %eax
cmpl 0x28(%rbp), %eax
jle 0x206c9
movl 0x28(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x9c(%rbp), %eax
cmpl 0x28(%rbp), %eax
jle 0x206dd
movl 0x28(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x20788
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x98(%rbp)
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x9c(%rbp)
movl -0x98(%rbp), %eax
cmpl 0x28(%rbp), %eax
jle 0x2073b
movl 0x28(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x9c(%rbp), %eax
cmpl 0x28(%rbp), %eax
jle 0x2074f
movl 0x28(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x98(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x9c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rsi
movl -0x3c(%rbp), %edx
movq -0x80(%rbp), %rcx
movl -0x98(%rbp), %r8d
movq -0x88(%rbp), %r9
movl -0x9c(%rbp), %r13d
movl 0x20(%rbp), %r12d
movl -0x5c(%rbp), %r15d
movq -0x70(%rbp), %rbx
movq -0x78(%rbp), %r11
xorl %edi, %edi
leaq -0x8c(%rbp), %r14
leaq -0x90(%rbp), %r10
leaq -0x94(%rbp), %rax
movl %r13d, (%rsp)
movl %r12d, 0x8(%rsp)
movl %r15d, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x1fac0
movl %eax, -0xac(%rbp)
cmpl $0x0, -0xac(%rbp)
je 0x2089f
cmpl $0x0, 0x20(%rbp)
jle 0x2082f
movq -0x80(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xc0(%rbp)
jmp 0x20873
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x90(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x94(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0xc0(%rbp)
movl -0x8c(%rbp), %edi
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0xb8(%rbp), %r8
movq -0xc0(%rbp), %r9
callq 0x37dd0
movq %rax, -0xa8(%rbp)
movq -0x68(%rbp), %rdi
callq 0x40d40
movq -0xa8(%rbp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)