// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/blatSrc/blat.c
// Function: blat
void blat(char *dbFile, int queryCount, char **queryFiles, struct lineFile **lf, FILE *out[])
/* blat - Standalone BLAT fast sequence search command line tool. */
{
    char **dbFiles;
    int dbCount;
    struct dnaSeq *dbSeqList, *seq;
    struct genoFind *gf;
    boolean tIsProt = (tType == gftProt);
    boolean qIsProt = (qType == gftProt);
    boolean bothSimpleNuc = (tType == gftDna && (qType == gftDna || qType == gftRna));
    boolean bothSimpleProt = (tIsProt && qIsProt);
    boolean showStatus = (out[0] != stdout);
    /* Stuff to support various output formats. */
    struct gfOutput **gvo;		/* output controller */
    int i;

    databaseName = dbFile;
    gfClientFileArray(dbFile, &dbFiles, &dbCount);
    if (makeOoc != NULL)
    {
        gfMakeOoc(makeOoc, dbFiles, dbCount, tileSize, repMatch, tType);
        if (showStatus)
            printf("Done making %s\n", makeOoc);
        exit(0);
    }

    dbSeqList = gfClientSeqList(dbCount, dbFiles, tIsProt, tType == gftDnaX, repeats,
                                minRepDivergence, showStatus);
    databaseSeqCount = slCount(dbSeqList);
    for (seq = dbSeqList; seq != NULL; seq = seq->next)
        databaseLetters += seq->size;


    gvo = (struct gfOutput **)malloc(sizeof(struct gfOutput *) * threads);
    for (i=0; i<threads; i++)
    {
        gvo[i] = gfOutputAny(outputFormat, minIdentity*10, qIsProt, tIsProt, noHead,
                             databaseName, databaseSeqCount, databaseLetters, minIdentity, out[i]);
    }


    if (bothSimpleNuc || bothSimpleProt)
    {
        struct hash *maskHash = NULL;

        /* Save away masking info for output. */
        if (repeats != NULL)
        {
            maskHash = newHash(0);
            for (seq = dbSeqList; seq != NULL; seq = seq->next)
            {
                Bits *maskedBits = maskFromUpperCaseSeq(seq);
                hashAdd(maskHash, seq->name, maskedBits);
            }
        }

        /* Handle masking and indexing.  If masking is off, we want the indexer
         * to see unmasked sequence, otherwise we want it to see masked.  However
         * after indexing we always want it unmasked, because things are always
         * unmasked for the extension phase. */
        if (mask == NULL && !bothSimpleProt)
            gfClientUnmask(dbSeqList);
        gf = gfIndexSeq(dbSeqList, minMatch, maxGap, tileSize, repMatch, ooc,
                        tIsProt, oneOff, FALSE, stepSize);
        if (mask != NULL)
            gfClientUnmask(dbSeqList);

        searchOneIndex(queryCount, queryFiles, lf, gf, tIsProt, maskHash, out, gvo, showStatus);
        freeHash(&maskHash);
    }
    else if (tType == gftDnaX && qType == gftProt)
    {
        bigBlat(dbSeqList, queryCount, queryFiles, lf, FALSE, TRUE, out, gvo, showStatus);
    }
    else if (tType == gftDnaX && (qType == gftDnaX || qType == gftRnaX))
    {
        bigBlat(dbSeqList, queryCount, queryFiles, lf, TRUE, qType == gftDnaX, out, gvo, showStatus);
    }
    else
    {
        errAbort("Unrecognized combination of target and query types\n");
    }
    if (dotEvery > 0)
        printf("\n");
    freeDnaSeqList(&dbSeqList);
    free(gvo);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %rbx
movq %rcx, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movl %esi, 0x1c(%rsp)
movl 0xb7531(%rip), %eax     # 0xc0e9c
xorl %r14d, %r14d
cmpl $0x2, %eax
sete %r13b
testl %eax, %eax
sete 0xe(%rsp)
xorl %r15d, %r15d
cmpl $0x2, 0xb7512(%rip)     # 0xc0e98
sete 0xf(%rsp)
setb 0xd(%rsp)
movq (%r8), %rcx
movq 0xb5616(%rip), %rax     # 0xbefb0
movq (%rax), %rax
xorl %r12d, %r12d
movq %rcx, 0x20(%rsp)
movq %rax, 0x50(%rsp)
cmpq %rax, %rcx
setne %bpl
movq %rdi, 0xb7500(%rip)     # 0xc0eb8
leaq 0x48(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
callq 0x12b6c
movq 0xb74ba(%rip), %rdi     # 0xc0e88
testq %rdi, %rdi
jne 0x9ce2
movb %r13b, %r14b
movb %bpl, %r12b
movl 0x2c(%rsp), %edi
movq 0x48(%rsp), %rsi
xorl %ecx, %ecx
cmpl $0x3, 0xb74ad(%rip)     # 0xc0e9c
sete %cl
movq 0xb74af(%rip), %r8      # 0xc0ea8
cvtsd2ss 0xb5d77(%rip), %xmm0    # 0xbf778
movl %r14d, %edx
movl %r12d, %r9d
callq 0x12c76
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x1fbec
movl %eax, 0xb7439(%rip)     # 0xc0e58
movq 0x10(%rsp), %rax
testq %rax, %rax
movb 0xf(%rsp), %sil
je 0x9a4b
movq 0xb742b(%rip), %rcx     # 0xc0e60
movslq 0x18(%rax), %rdx
addq %rdx, %rcx
movq (%rax), %rax
testq %rax, %rax
jne 0x9a35
movq %rcx, 0xb7415(%rip)     # 0xc0e60
movq %r12, 0x20(%rsp)
movb 0xd(%rsp), %al
andb %al, 0xe(%rsp)
andb %sil, %r13b
movb %r13b, 0xd(%rsp)
movslq 0xb5cf9(%rip), %rbp     # 0xbf760
leaq (,%rbp,8), %rdi
movl %esi, %r12d
callq 0x69d0
movq %rax, %r13
testq %rbp, %rbp
jle 0x9b05
movb %r12b, %r15b
xorl %ebp, %ebp
movq 0xb5cf9(%rip), %rdi     # 0xbf788
movsd 0xb5ce9(%rip), %xmm1    # 0xbf780
movapd %xmm1, %xmm0
mulsd 0x82565(%rip), %xmm0    # 0x8c008
cvttsd2si %xmm0, %esi
movl 0xb73c6(%rip), %r8d     # 0xc0e74
movq 0xb7403(%rip), %r9      # 0xc0eb8
movl 0xb739d(%rip), %eax     # 0xc0e58
movsd 0xb739d(%rip), %xmm2    # 0xc0e60
unpcklps 0x82546(%rip), %xmm2    # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x8254e(%rip), %xmm2    # 0x8c020
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
movl %r15d, %edx
movl %r14d, %ecx
pushq (%rbx,%rbp,8)
pushq %rax
callq 0x144e0
addq $0x10, %rsp
movq %rax, (%r13,%rbp,8)
incq %rbp
movslq 0xb5c60(%rip), %rax     # 0xbf760
cmpq %rax, %rbp
jl 0x9a88
movb 0xe(%rsp), %al
orb 0xd(%rsp), %al
testb $0x1, %al
je 0x9b5d
movq $0x0, 0x40(%rsp)
cmpq $0x0, 0xb7386(%rip)     # 0xc0ea8
je 0x9ba0
xorl %edi, %edi
movl $0x1, %esi
callq 0x29160
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x9ba0
movq %r15, %rdi
callq 0x24d6a
movq 0x40(%rsp), %rdi
movq 0x8(%r15), %rsi
movq %rax, %rdx
callq 0x28dbe
movq (%r15), %r15
jmp 0x9b3a
movl 0xb7339(%rip), %ecx     # 0xc0e9c
movl %ecx, %edx
xorl $0x3, %edx
movl 0xb732a(%rip), %eax     # 0xc0e98
movl %eax, %esi
xorl $0x2, %esi
orl %edx, %esi
jne 0x9c51
movq 0x10(%rsp), %rdi
subq $0x8, %rsp
movl 0x24(%rsp), %esi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
jmp 0x9c8e
cmpq $0x0, 0xb72f8(%rip)     # 0xc0ea0
setne %al
orb 0xd(%rsp), %al
testb $0x1, %al
jne 0x9bbd
movq 0x10(%rsp), %rdi
callq 0x12c57
movq 0x10(%rsp), %rdi
movl 0xb5ba0(%rip), %esi     # 0xbf768
movl 0xb5ba2(%rip), %edx     # 0xbf770
movl 0xb5b90(%rip), %ecx     # 0xbf764
movl 0xb5b99(%rip), %r8d     # 0xbf774
movq 0xb72ae(%rip), %r9      # 0xc0e90
movl 0xb7288(%rip), %eax     # 0xc0e70
movl 0xb7279(%rip), %r10d    # 0xc0e68
pushq %r10
pushq $0x0
pushq %rax
pushq %r14
callq 0xd6a2
addq $0x20, %rsp
movq %rax, %r15
cmpq $0x0, 0xb7296(%rip)     # 0xc0ea0
je 0x9c16
movq 0x10(%rsp), %rdi
callq 0x12c57
leaq 0x40(%rsp), %rbp
movq (%rbp), %r9
subq $0x8, %rsp
movl 0x24(%rsp), %edi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r15, %rcx
movl %r14d, %r8d
pushq 0x28(%rsp)
pushq %r13
pushq %rbx
callq 0x8f49
addq $0x20, %rsp
movq %rbp, %rdi
callq 0x29565
jmp 0x9cae
cmpl $0x3, %ecx
sete %cl
leal -0x3(%rax), %edx
cmpl $0x2, %edx
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x9ca0
xorl %r9d, %r9d
cmpl $0x3, %eax
sete %r9b
movq 0x10(%rsp), %rdi
subq $0x8, %rsp
movl 0x24(%rsp), %esi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movl $0x1, %r8d
pushq 0x28(%rsp)
pushq %r13
pushq %rbx
callq 0x943f
addq $0x20, %rsp
jmp 0x9cae
leaq 0x839cd(%rip), %rdi     # 0x8d674
xorl %eax, %eax
callq 0x26b6f
cmpl $0x0, 0xb71b7(%rip)     # 0xc0e6c
jle 0x9cc1
movl $0xa, %edi
callq 0x6a40
leaq 0x10(%rsp), %rdi
callq 0x24af5
movq %r13, %rdi
callq 0x68a0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rsp), %rsi
movl 0x2c(%rsp), %edx
movl 0xb5a73(%rip), %ecx     # 0xbf764
movl 0xb5a7c(%rip), %r8d     # 0xbf774
movl 0xb719d(%rip), %r9d     # 0xc0e9c
callq 0xeec0
movq 0x50(%rsp), %rax
cmpq %rax, 0x20(%rsp)
je 0x9d25
movq 0xb7171(%rip), %rsi     # 0xc0e88
leaq 0x83946(%rip), %rdi     # 0x8d664
xorl %eax, %eax
callq 0x6070
xorl %edi, %edi
callq 0x68d0