// File: /workspace/github_c_makefile_star2_O1/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, %ebx
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0xb3e3
xorl %ebx, %ebx
movq 0x10(%rsp), %rbp
movq (%rbp), %rax
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rcx
testq %rax, %rax
je 0xb3a1
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rcx
movq 0x8(%rbp), %rax
movq 0x20(%rsp), %r15
movq 0x30(%rsp), %r12
testq %rax, %rax
je 0xb3bc
movq 0x10(%rax), %r15
movq 0x20(%rax), %r12
movq %rbp, %rdi
callq 0xa662
movl %eax, %r13d
movq %rbp, %rdi
movq %r15, %rdx
movq %r12, %r8
callq 0xa563
orl %r13d, %ebx
orl %eax, %ebx
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0xb386
movq 0x10(%rsp), %rax
movq %rax, %rbp
testq %rax, %rax
je 0xb480
movq (%rbp), %rax
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdx
testq %rax, %rax
je 0xb40f
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x8(%rbp), %rax
movq 0x20(%rsp), %r12
movq 0x30(%rsp), %r15
testq %rax, %rax
je 0xb42a
movq 0x10(%rax), %r12
movq 0x20(%rax), %r15
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
xorl %ecx, %ecx
movl 0xc(%rsp), %r14d
movl %r14d, %r8d
movl 0x70(%rsp), %r9d
callq 0xbcc9
movl %eax, %r13d
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movl %r14d, %r8d
movl 0x70(%rsp), %r9d
callq 0xc1d3
orl %r13d, %ebx
orl %eax, %ebx
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0xb3f4
movq 0x10(%rsp), %rax
movq %rax, %rbp
testq %rax, %rax
je 0xb523
movq (%rbp), %rax
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdx
testq %rax, %rax
je 0xb4ac
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x8(%rbp), %rax
movq 0x20(%rsp), %r12
movq 0x30(%rsp), %r15
testq %rax, %rax
je 0xb4c7
movq 0x10(%rax), %r12
movq 0x20(%rax), %r15
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movl $0x1, %ecx
movl 0xc(%rsp), %r14d
movl %r14d, %r8d
movl 0x70(%rsp), %r9d
callq 0xbcc9
movl %eax, %r13d
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x1, %ecx
movl %r14d, %r8d
movl 0x70(%rsp), %r9d
callq 0xc1d3
orl %r13d, %ebx
orl %eax, %ebx
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0xb491
movq 0x10(%rsp), %rax
movq %rax, %rdi
movq (%rax), %rax
testq %rax, %rax
jne 0xb528
testl %ebx, %ebx
jne 0xb370
movq %rdi, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq