// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/fuzzyFind.c
// Function: lumpHits
struct protoGene *lumpHits(struct ffAli **pHitList, DNA *ns, DNA *hs, struct lm **ffMemPool)
/* Lump together as many hits as can. Criteria - they must be close
 * to same "diagonal." That is the distance between them must be
 * nearly the same in the needle and the haystack. */
{
    struct protoGene proto;
    struct protoGene *retProto;
    struct ffAli *ali, *nextAli;
    int dif, lastDif;
    int lumpCount = 1;

    if ((ali = *pHitList) == NULL)
        return NULL;

    /* Move first hit onto our crude exon. */
    nextAli = ali->right;
    proto.left = proto.right = NULL;
    unlinkAli(pHitList, ali);
    proto.hits = ali;
    proto.hStart = ali->hStart;
    proto.hEnd = ali->hEnd;
    proto.nStart = ali->nStart;
    proto.nEnd = ali->nEnd;
    lastDif = ali->hStart - ali->nStart;

    /* Go through rest of list and put others that are close to
     * on the same diagonal onto this exon. */
    while ((ali = nextAli) != NULL)
    {
        nextAli = ali->right;
        dif = ali->hStart - ali->nStart;
        if (lastDif - 2 <= dif && dif <= lastDif + 2)
        {
            lastDif = dif;
            unlinkAli(pHitList, ali);
            ali->left = proto.hits;
            proto.hits = ali;
            proto.hEnd = ali->hEnd;
            proto.nEnd = ali->nEnd;
            ++lumpCount;
        }
    }
    proto.hits = ffMakeRightLinks(proto.hits);
    retProto = ffNeedMem(sizeof(*retProto), ffMemPool);
    memcpy(retProto, &proto, sizeof(*retProto));
    return retProto;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x1, -0x8c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
jne 0xa3e3
movq $0x0, -0x8(%rbp)
jmp 0xa549
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x9e00
movq -0x78(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x78(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x78(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x88(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0xa510
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x78(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x84(%rbp)
movl -0x88(%rbp), %eax
subl $0x2, %eax
cmpl -0x84(%rbp), %eax
jg 0xa50b
movl -0x84(%rbp), %eax
movl -0x88(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jg 0xa50b
movl -0x84(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x9e00
movq -0x58(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movq -0x78(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x78(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0xa45d
movq -0x58(%rbp), %rdi
callq 0x37bc0
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rsi
movl $0x40, %edi
callq 0x9c00
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x40, %edx
callq 0x6570
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)