// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/fuzzyFind.c
// Function: recursiveWeave
static struct ffAli *recursiveWeave(DNA *ns, DNA *ne, DNA *hs, DNA *he,
                                    enum ffStringency stringency, double probMax, int level, int orientation,
                                    struct lm **ffMemPool, double rwFreq[4], boolean *rwIsCdna, boolean *rwCheckGoodEnough)
/* Find a set of tiles, then recurse to find set of tiles between the tiles
 * at somewhat lower stringency. */
{
    struct ffAli *left = NULL, *right = NULL, *aliList;

    if ((left = exactAli(ns, ne, hs, he, ffMemPool)) != NULL)
        return left;
    if (stringency == ffExact)
        return NULL;

    aliList = rwFindTilesBetween(ns, ne, hs, he, stringency, probMax, ffMemPool, rwFreq, rwIsCdna, rwCheckGoodEnough);
    if (aliList != NULL)
    {
        DNA *lne, *rns, *lhe, *rhs;
        int ndif, hdif;
        right = aliList;
        if (orientation == 0)
            orientation = ffIntronOrientation(aliList);
        for (;;)
        {
            /* Figure out the end points to recurse to. */
            if (left != NULL)
            {
                lne = left->nEnd;
                lhe = left->hEnd;
            }
            else
            {
                lne = ns;
                lhe = hs;
            }
            if (right != NULL)
            {
                rns = right->nStart;
                rhs = right->hStart;
            }
            else
            {
                rns = ne;
                rhs = he;
            }
            ndif = rns-lne;
            hdif = rhs-lhe;
            /* If a big enough gap left recurse. */
            if (ndif >= 5 && hdif >= 5)
            {
                struct ffAli *newLeft = NULL, *newRight;

                newLeft = recursiveWeave(lne, rns, lhe, rhs, stringency, probMax*2, level+1,
                                         orientation, ffMemPool, rwFreq, rwIsCdna, rwCheckGoodEnough);
                if (newLeft != NULL)
                {
                    /* Insert new tiles between left and right. */

                    /* Find right end of tile set. */
                    newRight = newLeft;
                    while (newRight->right != NULL)
                        newRight = newRight->right;


                    if (left != NULL)
                    {
                        left->right = newLeft;
                        newLeft->left = left;
                    }
                    else
                    {
                        aliList = newLeft;
                    }
                    if (right != NULL)
                    {
                        right->left = newRight;
                        newRight->right = right;
                    }
                }
            }
            if ((left = right) == NULL)
                break;
            right = right->right;
        }
    }
    return aliList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xc0, %rsp
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movl %r8d, -0x3c(%rbp)
movsd %xmm0, -0x48(%rbp)
movl %r9d, -0x4c(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq 0x18(%rbp), %r8
callq 0xb640
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0xb3de
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xb630
cmpl $0x0, -0x3c(%rbp)
jne 0xb3f1
movq $0x0, -0x18(%rbp)
jmp 0xb630
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl -0x3c(%rbp), %r8d
movsd -0x48(%rbp), %xmm0
movq 0x18(%rbp), %r9
movq 0x20(%rbp), %r11
movq 0x28(%rbp), %r10
movq 0x30(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0xb720
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0xb628
movq -0x68(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpl $0x0, 0x10(%rbp)
jne 0xb456
movq -0x68(%rbp), %rdi
callq 0x37b20
movl %eax, 0x10(%rbp)
jmp 0xb458
cmpq $0x0, -0x58(%rbp)
je 0xb479
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0xb489
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xb4ad
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0xb4c0
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x8c(%rbp)
movq -0x88(%rbp), %rax
movq -0x80(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x90(%rbp)
cmpl $0x5, -0x8c(%rbp)
jl 0xb605
cmpl $0x5, -0x90(%rbp)
jl 0xb605
movq $0x0, -0x98(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
movl -0x3c(%rbp), %r8d
movsd 0xcc367(%rip), %xmm0    # 0xd7890
mulsd -0x48(%rbp), %xmm0
movl -0x4c(%rbp), %r9d
addl $0x1, %r9d
movl 0x10(%rbp), %r14d
movq 0x18(%rbp), %rbx
movq 0x20(%rbp), %r11
movq 0x28(%rbp), %r10
movq 0x30(%rbp), %rax
movl %r14d, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0xb360
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0xb603
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xb5ac
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0xb58a
cmpq $0x0, -0x58(%rbp)
je 0xb5d2
movq -0x98(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, (%rax)
jmp 0xb5dd
movq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xb601
movq -0xa0(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, (%rax)
movq -0x60(%rbp), %rcx
movq -0xa0(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xb603
jmp 0xb605
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
jne 0xb615
jmp 0xb626
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0xb458
jmp 0xb628
movq -0x68(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
retq