// File: /workspace/github_c_makefile_star2_O3/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, 0xc(%rsp)
movl 0xb7613(%rip), %eax     # 0xc0e9c
xorl %r14d, %r14d
cmpl $0x2, %eax
sete %r13b
testl %eax, %eax
sete 0x9(%rsp)
xorl %ebp, %ebp
cmpl $0x2, 0xb75f5(%rip)     # 0xc0e98
sete 0xb(%rsp)
setb 0xa(%rsp)
movq (%r8), %rcx
movq 0xb56f9(%rip), %rax     # 0xbefb0
movq (%rax), %rax
xorl %r15d, %r15d
movq %rcx, 0x10(%rsp)
movq %rax, 0x20(%rsp)
cmpq %rax, %rcx
setne %r12b
movq %rdi, 0xb75e3(%rip)     # 0xc0eb8
leaq 0x48(%rsp), %rsi
leaq 0x1c(%rsp), %rdx
callq 0x12c98
movq 0xb759d(%rip), %rdi     # 0xc0e88
testq %rdi, %rdi
jne 0x9c17
movb %r13b, 0x10(%rsp)
movb %r13b, %r14b
movb %r12b, %r15b
movl 0x1c(%rsp), %edi
movq 0x48(%rsp), %rsi
xorl %ecx, %ecx
cmpl $0x3, 0xb758b(%rip)     # 0xc0e9c
sete %cl
movq 0xb758d(%rip), %r8      # 0xc0ea8
cvtsd2ss 0xb5e55(%rip), %xmm0    # 0xbf778
movl %r14d, %edx
movl %r15d, %r9d
callq 0x12da2
movq %rax, %r12
movq %rax, 0x50(%rsp)
movq %rax, %rdi
callq 0x200ac
movl %eax, 0xb7514(%rip)     # 0xc0e58
testq %r12, %r12
movb 0xb(%rsp), %sil
je 0x996e
movq 0xb750b(%rip), %rax     # 0xc0e60
movq %r12, %rcx
movslq 0x18(%rcx), %rdx
addq %rdx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x9958
movq %rax, 0xb74f2(%rip)     # 0xc0e60
movq %r12, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movb 0xa(%rsp), %al
andb %al, 0x9(%rsp)
andb %sil, 0x10(%rsp)
movslq 0xb5dd4(%rip), %r12     # 0xbf760
leaq (,%r12,8), %rdi
movl %esi, %r15d
callq 0x69d0
movq %rax, %r13
testq %r12, %r12
jle 0x9a2b
movb %r15b, %bpl
xorl %r12d, %r12d
movq 0xb5dd3(%rip), %rdi     # 0xbf788
movsd 0xb5dc3(%rip), %xmm1    # 0xbf780
movapd %xmm1, %xmm0
mulsd 0x8263f(%rip), %xmm0    # 0x8c008
cvttsd2si %xmm0, %esi
movl 0xb74a0(%rip), %r8d     # 0xc0e74
movq 0xb74dd(%rip), %r9      # 0xc0eb8
movl 0xb7477(%rip), %eax     # 0xc0e58
movsd 0xb7477(%rip), %xmm2    # 0xc0e60
unpcklps 0x82620(%rip), %xmm2    # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x82628(%rip), %xmm2    # 0x8c020
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
movl %ebp, %edx
movl %r14d, %ecx
pushq (%rbx,%r12,8)
pushq %rax
callq 0x1458a
addq $0x10, %rsp
movq %rax, (%r13,%r12,8)
incq %r12
movslq 0xb5d3a(%rip), %rax     # 0xbf760
cmpq %rax, %r12
jl 0x99ae
movb 0x9(%rsp), %al
movb 0x10(%rsp), %r15b
orb %r15b, %al
testb $0x1, %al
je 0x9aa0
movq $0x0, 0x40(%rsp)
cmpq $0x0, 0xb745c(%rip)     # 0xc0ea8
movq 0x20(%rsp), %r12
je 0x9b2d
xorl %edi, %edi
movl $0x1, %esi
callq 0x294ea
movq %rax, %rbp
movq %rax, 0x40(%rsp)
testq %r12, %r12
je 0x9b2f
movq %r12, %r15
movq %r15, %rdi
callq 0x25071
movq 0x8(%r15), %rsi
movq %rbp, %rdi
movq %rax, %rdx
callq 0x29142
movq (%r15), %r15
testq %r15, %r15
jne 0x9a77
movb 0x10(%rsp), %r15b
jmp 0x9b2f
movl 0xb73f6(%rip), %ecx     # 0xc0e9c
movl %ecx, %edx
xorl $0x3, %edx
movl 0xb73e7(%rip), %eax     # 0xc0e98
movl %eax, %esi
xorl $0x2, %esi
orl %edx, %esi
movq 0x20(%rsp), %rdi
jne 0x9adc
subq $0x8, %rsp
movl 0x14(%rsp), %esi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
jmp 0x9b18
cmpl $0x3, %ecx
sete %cl
leal -0x3(%rax), %edx
cmpl $0x2, %edx
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x9c07
xorl %r9d, %r9d
cmpl $0x3, %eax
sete %r9b
subq $0x8, %rsp
movl 0x14(%rsp), %esi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movl $0x1, %r8d
pushq 0x30(%rsp)
pushq %r13
pushq %rbx
callq 0x935a
addq $0x20, %rsp
jmp 0x9bd3
xorl %ebp, %ebp
cmpq $0x0, 0xb7369(%rip)     # 0xc0ea0
setne %al
orb %r15b, %al
testb $0x1, %al
jne 0x9b49
movq %r12, %rdi
callq 0x12d83
movl 0xb5c19(%rip), %esi     # 0xbf768
movl 0xb5c1b(%rip), %edx     # 0xbf770
movl 0xb5c09(%rip), %ecx     # 0xbf764
movl 0xb5c12(%rip), %r8d     # 0xbf774
movq 0xb7327(%rip), %r9      # 0xc0e90
movl 0xb7301(%rip), %eax     # 0xc0e70
movl 0xb72f2(%rip), %r10d    # 0xc0e68
movq %r12, %rdi
pushq %r10
pushq $0x0
pushq %rax
pushq %r14
callq 0xd753
addq $0x20, %rsp
movq %rax, %r15
cmpq $0x0, 0xb730c(%rip)     # 0xc0ea0
je 0x9b9e
movq %r12, %rdi
callq 0x12d83
subq $0x8, %rsp
movl 0x14(%rsp), %edi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r15, %rcx
movl %r14d, %r8d
movq %rbp, %r9
pushq 0x30(%rsp)
pushq %r13
pushq %rbx
callq 0x8e60
addq $0x20, %rsp
leaq 0x40(%rsp), %rdi
callq 0x298bd
cmpl $0x0, 0xb7292(%rip)     # 0xc0e6c
jle 0x9be6
movl $0xa, %edi
callq 0x6a40
leaq 0x50(%rsp), %rdi
callq 0x24df5
movq %r13, %rdi
callq 0x68a0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x83a66(%rip), %rdi     # 0x8d674
xorl %eax, %eax
callq 0x26e94
jmp 0x9bd3
movq 0x48(%rsp), %rsi
movl 0x1c(%rsp), %edx
movl 0xb5b3e(%rip), %ecx     # 0xbf764
movl 0xb5b47(%rip), %r8d     # 0xbf774
movl 0xb7268(%rip), %r9d     # 0xc0e9c
callq 0xefc7
movq 0x20(%rsp), %rax
cmpq %rax, 0x10(%rsp)
je 0x9c5a
movq 0xb723c(%rip), %rsi     # 0xc0e88
leaq 0x83a11(%rip), %rdi     # 0x8d664
xorl %eax, %eax
callq 0x6070
xorl %edi, %edi
callq 0x68d0