// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/blatSrc/blat.c
// Function: performSearch
void* performSearch(void* args)
{
    int             id=*((int*)(((void**)args)[0]));
    int             queryCount=*((int*)(((void**)args)[1]));
    char            **files=(char**)(((void**)args)[2]);
    struct lineFile *lf=(struct lineFile *)(((void**)args)[3]);
    struct genoFind *gf=(struct genoFind *)(((void**)args)[4]);
    boolean         isProt=*((boolean*)(((void**)args)[5]));
    struct hash     *maskHash=(struct hash *)(((void**)args)[6]);
    FILE            *outFile=(FILE *)(((void**)args)[7]);
    boolean         showStatus=*((boolean*)(((void**)args)[8]));
    struct gfOutput *gvo=(struct gfOutput *)(((void**)args)[9]);

    int             i;
    char            *fileName;
    int             count = 0;
    long long   totalSize = 0;

    unsigned faFastBufSize = 0;
    DNA *faFastBuf = NULL;


    if (id==0)
        gfOutputHead(gvo, outFile);
//for (i=0; i<queryCount; ++i)
    {
        fileName = files[0];
        if (nibIsFile(fileName))
        {
            struct dnaSeq *seq;

            if (isProt)
                errAbort("%s: Can't use .nib files with -prot or d=prot option\n", fileName);
            seq = nibLoadAllMasked(NIB_MASK_MIXED, fileName);
            freez(&seq->name);
            seq->name = cloneString(fileName);
            searchOneMaskTrim(seq, isProt, gf, outFile,
                              maskHash, &totalSize, &count, gvo);
            freeDnaSeq(&seq);
        }
        else if (twoBitIsSpec(fileName))
        {
            struct twoBitSpec *tbs = twoBitSpecNew(fileName);
            struct twoBitFile *tbf = twoBitOpen(tbs->fileName);
            if (isProt)
                errAbort("%s is a two bit file, which doesn't work for proteins.",
                         fileName);
            if (tbs->seqs != NULL)
            {
                struct twoBitSeqSpec *ss = NULL;
                for (ss = tbs->seqs;  ss != NULL;  ss = ss->next)
                {
                    struct dnaSeq *seq = twoBitReadSeqFrag(tbf, ss->name,
                                                           ss->start, ss->end);
                    searchOneMaskTrim(seq, isProt, gf, outFile,
                                      maskHash, &totalSize, &count, gvo);
                    dnaSeqFree(&seq);
                }
            }
            else
            {
                struct twoBitIndex *index = NULL;
                for (index = tbf->indexList; index != NULL; index = index->next)
                {
                    struct dnaSeq *seq = twoBitReadSeqFrag(tbf, index->name, 0, 0);
                    searchOneMaskTrim(seq, isProt, gf, outFile,
                                      maskHash, &totalSize, &count, gvo);
                    dnaSeqFree(&seq);
                }
            }
            twoBitClose(&tbf);
        }
        else
        {
            struct dnaSeq seq;
            seq.name=(char*)malloc(sizeof(char)*512);
            while (queryCount-- && faMixedSpeedReadNext(lf, &seq.dna, &seq.size, &seq.name, &faFastBuf, &faFastBufSize))
            {
                searchOneMaskTrim(&seq, isProt, gf, outFile,
                                  maskHash, &totalSize, &count, gvo);
            }
            free(seq.name);
            faFreeFastBuf(&faFastBuf, &faFastBufSize);
        }
    }
    if (showStatus)
        printf("Searched %lld bases in %d sequences\n", totalSize, count);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movl (%rcx), %r13d
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %rcx
movq %rcx, 0x38(%rsp)
movq 0x20(%rdi), %rcx
movq %rcx, 0x20(%rsp)
movq 0x28(%rdi), %rcx
movl (%rcx), %ebp
movq 0x30(%rdi), %rcx
movq %rcx, 0x18(%rsp)
movq 0x38(%rdi), %r15
movq 0x40(%rdi), %rcx
movl (%rcx), %r14d
movq 0x48(%rdi), %r12
movl (%rax), %eax
andl $0x0, 0x4(%rsp)
andq $0x0, 0x8(%rsp)
andl $0x0, 0x14(%rsp)
andq $0x0, 0x30(%rsp)
testl %eax, %eax
jne 0x740a
movq %r12, %rdi
movq %r15, %rsi
callq 0x11a93
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x2ce73
testl %eax, %eax
je 0x748e
testl %ebp, %ebp
je 0x742e
leaq 0x75155(%rip), %rdi     # 0x7c579
movq %rbx, %rsi
xorl %eax, %eax
callq 0x223fb
pushq $0x1
popq %rdi
movq %rbx, %rsi
callq 0x2ca98
movq %rax, %r13
leaq 0x40(%rsp), %rax
movq %r13, (%rax)
leaq 0x8(%r13), %rdi
callq 0x28c3d
movq %rbx, %rdi
callq 0x1c306
movq %rax, 0x8(%r13)
leaq 0x4(%rsp), %rax
leaq 0x8(%rsp), %r9
movq %r13, %rdi
movl %ebp, %esi
movq 0x20(%rsp), %rdx
movq %r15, %rcx
movq 0x18(%rsp), %r8
pushq %r12
pushq %rax
callq 0x72a7
popq %rax
popq %rcx
leaq 0x40(%rsp), %rdi
callq 0x20737
jmp 0x7627
movl %r14d, 0x10(%rsp)
movq %rbx, %rdi
callq 0x391eb
testl %eax, %eax
je 0x7536
movq %rbx, %rdi
callq 0x38d9f
movq %rax, %r13
movq (%rax), %rdi
callq 0x3842b
movq %rax, %r14
movq %rax, 0x40(%rsp)
testl %ebp, %ebp
je 0x74d3
leaq 0x750e6(%rip), %rdi     # 0x7c5af
movq %rbx, %rsi
xorl %eax, %eax
callq 0x223fb
movq 0x8(%r13), %rbx
testq %rbx, %rbx
je 0x75be
leaq 0x4(%rsp), %r13
testq %rbx, %rbx
je 0x7618
movq 0x8(%rbx), %rsi
movl 0x10(%rbx), %edx
movl 0x14(%rbx), %ecx
movq %r14, %rdi
callq 0x38bcf
movq %rax, 0x28(%rsp)
movq %rax, %rdi
movl %ebp, %esi
movq 0x20(%rsp), %rdx
movq %r15, %rcx
movq 0x18(%rsp), %r8
leaq 0x8(%rsp), %r9
pushq %r12
pushq %r13
callq 0x72a7
popq %rax
popq %rcx
leaq 0x28(%rsp), %rdi
callq 0x20737
movq (%rbx), %rbx
jmp 0x74e5
movl $0x200, %edi            # imm = 0x200
callq 0x69d0
leaq 0x48(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %rbx
subl $0x1, %r13d
jb 0x75a3
movq 0x38(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x48(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x14(%rsp), %r9
callq 0x2311f
testl %eax, %eax
je 0x75a3
leaq 0x40(%rsp), %rdi
movl %ebp, %esi
movq 0x20(%rsp), %rdx
movq %r15, %rcx
movq 0x18(%rsp), %r8
movq %rbx, %r9
pushq %r12
pushq %r14
callq 0x72a7
popq %rax
popq %rcx
jmp 0x7552
movq 0x48(%rsp), %rdi
callq 0x68a0
leaq 0x30(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0x22e09
jmp 0x7622
movq %r14, %r13
addq $0x28, %r13
leaq 0x28(%rsp), %rbx
movq (%r13), %r13
testq %r13, %r13
je 0x7618
movq 0x8(%r13), %rsi
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x38bcf
movq %rax, 0x28(%rsp)
movq %rax, %rdi
movl %ebp, %esi
movq 0x20(%rsp), %rdx
movq %r15, %rcx
movq 0x18(%rsp), %r8
leaq 0x8(%rsp), %r9
pushq %r12
leaq 0xc(%rsp), %rax
pushq %rax
callq 0x72a7
popq %rax
popq %rcx
movq %rbx, %rdi
callq 0x20737
jmp 0x75ca
leaq 0x40(%rsp), %rdi
callq 0x3833b
movl 0x10(%rsp), %r14d
testl %r14d, %r14d
je 0x7643
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %edx
leaq 0x74faa(%rip), %rdi     # 0x7c5e6
xorl %eax, %eax
callq 0x6070
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq