// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/fuzzyFind.c
// Function: expandLeft
static boolean expandLeft(struct ffAli *ali, DNA *needleStart, DNA *needleEnd,
                          DNA *hayStart, DNA *hayEnd, int numSkips, int gapPenalty, int maxSkip,
                          struct lm **ffMemPool)
/* Given a matching segment, try to expand the aligned parts to the
 * right. */
{
    DNA *ns = ali->nStart;
    DNA *hs = ali->hStart;
    int score;
    DNA *oldNs = ns;

    for (;;)
    {
        while (ns > needleStart && hs > hayStart && ns[-1] == hs[-1])
        {
            --hs;
            --ns;
        }
        if (ns <= needleStart || hs <= hayStart)
        {
            ali->nStart = ns;
            ali->hStart = hs;
            return ns != oldNs;
        }
        /* Find fuzzy score to the left. */
        {
            int windowSize = 5;
            int nSize = ns-needleStart;
            int hSize = hs-hayStart;
            if (windowSize > nSize) windowSize = nSize;
            if (windowSize > hSize) windowSize = hSize;
            if (windowSize > 0)
                score = dnaScoreMatch(ns-windowSize, hs-windowSize, windowSize);
            else
                score = -1;

            if (score >= windowSize-2)
            {
                hs -= windowSize;
                ns -= windowSize;
            }
            else if (--numSkips >= 0)
            {
                struct ffAli *newAli = ffNeedMem(sizeof(*newAli), ffMemPool);
                ali->nStart = ns;
                ali->hStart = hs;
                if (ns - needleStart < 3 ||
                        !leftNextMatch(newAli, needleStart, ns, hayStart, hs, gapPenalty, maxSkip))
                {
                    return ns != oldNs; /* We did our best... */
                }
                newAli->right = ali;
                newAli->left = ali->left;
                if (ali->left)
                    ali->left->right = newAli;
                ali->left = newAli;
                ali = newAli;
                expandRight(ali, needleStart, ns, hayStart, hs, 0, gapPenalty, maxSkip, ffMemPool);
                ns = ali->nStart;
                hs = ali->hStart;
            }
            else
            {
                ali->nStart = ns;
                ali->hStart = hs;
                return ns != oldNs;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq 0x20(%rbp), %rax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0xc06f
movq -0x40(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x71(%rbp)
jbe 0xc0a5
movq -0x48(%rbp), %rcx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x71(%rbp)
jbe 0xc0a5
movq -0x40(%rbp), %rax
movsbl -0x1(%rax), %eax
movq -0x48(%rbp), %rcx
movsbl -0x1(%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0xc0ae
jmp 0xc0c8
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xc06f
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0xc0dc
movq -0x48(%rbp), %rax
cmpq -0x28(%rbp), %rax
ja 0xc10c
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rax
cmpq -0x58(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0xc31a
movl $0x5, -0x5c(%rbp)
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x64(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jle 0xc13d
movl -0x60(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jle 0xc14b
movl -0x64(%rbp), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jle 0xc17e
movq -0x40(%rbp), %rdi
movslq -0x5c(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rdi
movq -0x48(%rbp), %rsi
movslq -0x5c(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rsi
movl -0x5c(%rbp), %edx
callq 0x34030
movl %eax, -0x4c(%rbp)
jmp 0xc185
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movl -0x4c(%rbp), %eax
movl -0x5c(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jl 0xc1c3
movl -0x5c(%rbp), %ecx
movq -0x48(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x5c(%rbp), %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0xc315
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jl 0xc2e6
movq 0x20(%rbp), %rsi
movl $0x38, %edi
callq 0x9c00
movq %rax, -0x70(%rbp)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
cmpq $0x3, %rax
jl 0xc238
movq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x48(%rbp), %r8
movl 0x10(%rbp), %r9d
movl 0x18(%rbp), %eax
movl %eax, (%rsp)
callq 0xc620
cmpl $0x0, %eax
jne 0xc250
movq -0x40(%rbp), %rax
cmpq -0x58(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0xc31a
movq -0x10(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x70(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xc283
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x70(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x48(%rbp), %r8
movl 0x10(%rbp), %r11d
movl 0x18(%rbp), %r10d
movq 0x20(%rbp), %rax
xorl %r9d, %r9d
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0xc330
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0xc313
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rax
cmpq -0x58(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0xc31a
jmp 0xc315
jmp 0xc06d
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)