// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/fuzzyFind.c
// Function: rwFindTilesBetween
static struct ffAli *rwFindTilesBetween(DNA *ns, DNA *ne, DNA *hs, DNA *he,
                                        enum ffStringency stringency, double probMax, struct lm **ffMemPool,
                                        double rwFreq[4], boolean *rwIsCdna, boolean *rwCheckGoodEnough)
/* Search for more or less regularly spaced exact matches that are
 * in the right order. */
{
    int searchOffset;
    int endTileOffset;
    int haySize = he - hs;
    int needleSize = ne - ns;
    int numTiles = 0;
    int bestWeaveVal;
    struct ffAli *hitList = NULL;
    struct ffAli *bestAli;
    struct ffAli *ali;
    int possibleTiles;
    double tileProbOne;

    possibleTiles = (haySize - nextPowerOfFour(needleSize));
    if (possibleTiles < 1) possibleTiles = 1;
    tileProbOne = probMax/possibleTiles;

    searchOffset = 0;
    endTileOffset = 0;
    for (;;)
    {
        DNA *tile;
        int tileSize;
        double tileProb;
        DNA *h = hs;

        searchOffset = endTileOffset;
        if (!ffFindGoodOligo(ns+searchOffset, needleSize-searchOffset, tileProbOne,
                             rwFreq, &tile, &tileSize, &tileProb))
        {
            break;
        }
        /* Find all parts that match the tile. */
        for (;;)
        {
            if ((h = matchInMem(tile, tile+tileSize, h, he)) == NULL)
                break;
            ali = ffNeedMem(sizeof(*ali), ffMemPool);
            ali->hStart = h;
            ali->hEnd = ali->hStart + tileSize;
            ali->nStart = tile;
            ali->nEnd = tile + tileSize;
            ali->left = hitList;
            hitList = ali;
            h += tileSize;
        }
        endTileOffset = tile + tileSize - ns;
        ++numTiles;
    }
    if (hitList == NULL)
        return NULL;

    hitList = ffMakeRightLinks(hitList);
    for (ali = hitList; ali != NULL; ali = ali->right)
    {
        ffExpandExactLeft(ali, ns, hs);
        ffExpandExactRight(ali, ne, he);
    }
    bestAli = weaveAli(hitList, ns, ne, hs, he, rwFreq, &bestWeaveVal, stringency, ffMemPool);
    if (*rwCheckGoodEnough)
    {
        double prob;
        prob = evalExactAli(bestAli, ns, ne, hs, he, numTiles, rwFreq);
        if (prob > 0.1)
            return NULL;
        *rwCheckGoodEnough = FALSE;
    }

    return bestAli;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movsd %xmm0, -0x38(%rbp)
movq %r9, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq $0x0, -0x60(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0xac(%rbp)
movslq -0x50(%rbp), %rdi
callq 0x33760
movl %eax, %ecx
movl -0xac(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x74(%rbp)
cmpl $0x1, -0x74(%rbp)
jge 0xb7ab
movl $0x1, -0x74(%rbp)
movsd -0x38(%rbp), %xmm0
cvtsi2sdl -0x74(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x44(%rbp), %rax
addq %rax, %rdi
movl -0x50(%rbp), %esi
subl -0x44(%rbp), %esi
movsd -0x80(%rbp), %xmm0
movq 0x10(%rbp), %rdx
leaq -0x88(%rbp), %rcx
leaq -0x8c(%rbp), %r8
leaq -0x98(%rbp), %r9
callq 0xbaf0
cmpl $0x0, %eax
jne 0xb81b
jmp 0xb915
jmp 0xb81d
movq -0x88(%rbp), %rdi
movq -0x88(%rbp), %rsi
movslq -0x8c(%rbp), %rax
addq %rax, %rsi
movq -0xa0(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x99b0
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
jne 0xb857
jmp 0xb8ec
movq -0x40(%rbp), %rsi
movl $0x38, %edi
callq 0x9c00
movq %rax, -0x70(%rbp)
movq -0xa0(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x70(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x8c(%rbp), %rax
addq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x88(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x88(%rbp), %rcx
movslq -0x8c(%rbp), %rax
addq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x60(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, (%rax)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x8c(%rbp), %ecx
movq -0xa0(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
jmp 0xb81d
movq -0x88(%rbp), %rax
movslq -0x8c(%rbp), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x48(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xb7cc
cmpq $0x0, -0x60(%rbp)
jne 0xb929
movq $0x0, -0x8(%rbp)
jmp 0xba18
movq -0x60(%rbp), %rdi
callq 0x37bc0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0xb975
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1aae0
movq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1aa40
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0xb93e
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq 0x10(%rbp), %r9
movl -0x2c(%rbp), %r10d
movq -0x40(%rbp), %rax
leaq -0x58(%rbp), %r11
movq %r11, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0xbbd0
movq %rax, -0x68(%rbp)
movq 0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0xba10
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movl -0x54(%rbp), %r9d
movq 0x10(%rbp), %rax
movq %rax, (%rsp)
callq 0x9c30
movsd %xmm0, -0xa8(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd 0xcbea2(%rip), %xmm1    # 0xd7898
ucomisd %xmm1, %xmm0
jbe 0xba06
movq $0x0, -0x8(%rbp)
jmp 0xba18
movq 0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)