// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/jkOwnLib/fuzzyFind.c
// Function: expandAlis
static struct ffAli *expandAlis(struct ffAli *ali, DNA *nStart, DNA *nEnd, DNA *hStart, DNA *hEnd,
                                int gapPenalty, int maxSkip, struct lm **ffMemPool)
/* Expand alignment to cover in-between tiles as well. */
{
    struct ffAli *a, *left, *right;
    DNA *ns, *ne, *hs, *he;
    boolean expanded = TRUE;

    while (expanded)
    {
        expanded = FALSE;
        /* Loop through expanding three times. */
        /* First just expand through N's that don't require an insertion/deletion. */
        for (a = ali; a != NULL; a = a->right)
        {
            if ((left = a->left) != NULL)
            {
                ns = left->nEnd;
                hs = left->hEnd;
            }
            else
            {
                ns = nStart;
                hs = hStart;
            }
            if ((right = a->right) != NULL)
            {
                ne = right->nStart;
                he = right->hStart;
            }
            else
            {
                ne = nEnd;
                he = hEnd;
            }
            expanded |= expandThroughNLeft(a, ns, ne, hs, he);
            expanded |= expandThroughNRight(a, ns, ne, hs, he);
        }
        /* Second do other expansion that doesn't require an insertion/deletion. */
        for (a = ali; a != NULL; a = a->right)
        {
            if ((left = a->left) != NULL)
            {
                ns = left->nEnd;
                hs = left->hEnd;
            }
            else
            {
                ns = nStart;
                hs = hStart;
            }
            if ((right = a->right) != NULL)
            {
                ne = right->nStart;
                he = right->hStart;
            }
            else
            {
                ne = nEnd;
                he = hEnd;
            }
            expanded |= expandLeft(a, ns, ne, hs, he, 0, gapPenalty, maxSkip, ffMemPool);
            expanded |= expandRight(a, ns, ne, hs, he, 0, gapPenalty, maxSkip, ffMemPool);
        }
        /* Finally do insertion/deletion. */
        for (a = ali; a != NULL; a = a->right)
        {
            if ((left = a->left) != NULL)
            {
                ns = left->nEnd;
                hs = left->hEnd;
            }
            else
            {
                ns = nStart;
                hs = hStart;
            }
            if ((right = a->right) != NULL)
            {
                ne = right->nStart;
                he = right->hStart;
            }
            else
            {
                ne = nEnd;
                he = hEnd;
            }
            expanded |= expandLeft(a, ns, ne, hs, he, 1, gapPenalty, maxSkip, ffMemPool);
            expanded |= expandRight(a, ns, ne, hs, he, 1, gapPenalty, maxSkip, ffMemPool);
        }
        while (ali->left)
            ali = ali->left;
    }
    return ali;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x0, %r13d
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0xb49a
xorl %r13d, %r13d
movq 0x10(%rsp), %rbp
movq (%rbp), %rax
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rcx
testq %rax, %rax
je 0xb315
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rcx
movq 0x8(%rbp), %rax
movq 0x20(%rsp), %rbx
movq 0x30(%rsp), %r12
testq %rax, %rax
je 0xb330
movq 0x10(%rax), %rbx
movq 0x20(%rax), %r12
movq %rbp, %rdi
callq 0xa59f
movl %eax, %r15d
movq %rbp, %rdi
movq %rbx, %rdx
movq %r12, %r8
callq 0xa49b
orl %r15d, %r13d
orl %eax, %r13d
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0xb2fa
movq 0x10(%rsp), %rax
movq %rax, %rbp
testq %rax, %rax
je 0xb49a
movq (%rbp), %rax
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdx
testq %rax, %rax
je 0xb384
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x8(%rbp), %rax
movq 0x20(%rsp), %r14
movq 0x30(%rsp), %rbx
testq %rax, %rax
je 0xb39f
movq 0x10(%rax), %r14
movq 0x20(%rax), %rbx
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
xorl %ecx, %ecx
movl 0xc(%rsp), %r12d
movl %r12d, %r8d
movl 0x70(%rsp), %r9d
callq 0xbb7f
movl %eax, %r15d
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
movl %r12d, %r8d
movl 0x70(%rsp), %r9d
callq 0xc041
orl %r15d, %r13d
orl %eax, %r13d
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0xb369
movq 0x10(%rsp), %rax
movq %rax, %rbp
testq %rax, %rax
je 0xb49a
movq (%rbp), %rax
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdx
testq %rax, %rax
je 0xb422
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x8(%rbp), %rax
movq 0x20(%rsp), %r14
movq 0x30(%rsp), %rbx
testq %rax, %rax
je 0xb43d
movq 0x10(%rax), %r14
movq 0x20(%rax), %rbx
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movl $0x1, %ecx
movl 0xc(%rsp), %r12d
movl %r12d, %r8d
movl 0x70(%rsp), %r9d
callq 0xbb7f
movl %eax, %r15d
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
movl %r12d, %r8d
movl 0x70(%rsp), %r9d
callq 0xc041
orl %r15d, %r13d
orl %eax, %r13d
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0xb407
movq 0x10(%rsp), %rcx
movq %rcx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0xb49f
movq %rax, %rdi
testl %r13d, %r13d
jne 0xb2de
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq