// File: /workspace/github_c_makefile_star2_O3/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), %r14d
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %r13
movq 0x20(%rdi), %r15
movq 0x28(%rdi), %rcx
movl (%rcx), %ebp
movq 0x30(%rdi), %r12
movq 0x38(%rdi), %rcx
movq %rcx, 0x10(%rsp)
movq 0x40(%rdi), %rcx
movl (%rcx), %ecx
movl %ecx, 0x4(%rsp)
movq 0x48(%rdi), %rcx
movq %rcx, 0x8(%rsp)
xorl %ecx, %ecx
cmpl %ecx, (%rax)
movl %ecx, (%rsp)
movq %rcx, 0x18(%rsp)
movl %ecx, 0x24(%rsp)
movq %rcx, 0x38(%rsp)
jne 0x8bf4
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x147cb
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x324f7
testl %eax, %eax
je 0x8c79
testl %ebp, %ebp
je 0x8c18
leaq 0x8496b(%rip), %rdi     # 0x8d579
movq %rbx, %rsi
xorl %eax, %eax
callq 0x26e94
movl $0x1, %edi
movq %rbx, %rsi
callq 0x32118
movq %rax, %r14
leaq 0x40(%rsp), %r13
movq %rax, (%r13)
leaq 0x8(%rax), %rdi
callq 0x2e0b0
movq %rbx, %rdi
callq 0x1feba
movq %rax, 0x8(%r14)
movq %rsp, %rax
leaq 0x18(%rsp), %r9
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq 0x10(%rsp), %rcx
movq %r12, %r8
pushq 0x8(%rsp)
pushq %rax
callq 0x8a8d
addq $0x10, %rsp
movq %r13, %rdi
callq 0x24db1
jmp 0x8e33
movq %rbx, %rdi
callq 0x3f293
testl %eax, %eax
je 0x8d39
movq %r15, 0x30(%rsp)
movq %rbx, %rdi
callq 0x3edef
movq %rax, %r14
movq (%rax), %rdi
callq 0x3e405
movq %rax, %r13
movq %rax, 0x40(%rsp)
movl %ebp, 0x20(%rsp)
testl %ebp, %ebp
je 0x8cc2
leaq 0x848f7(%rip), %rdi     # 0x8d5af
movq %rbx, %rsi
xorl %eax, %eax
callq 0x26e94
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x8dc2
movq %r12, %rbp
movl 0x20(%rsp), %ebx
movq 0x10(%rsp), %r14
movq %r13, %r12
movq 0x8(%rsp), %r13
movq 0x8(%r15), %rsi
movl 0x10(%r15), %edx
movl 0x14(%r15), %ecx
movq %r12, %rdi
callq 0x3ebfd
movq %rax, 0x28(%rsp)
movq %rax, %rdi
movl %ebx, %esi
movq 0x30(%rsp), %rdx
movq %r14, %rcx
movq %rbp, %r8
leaq 0x18(%rsp), %r9
pushq %r13
leaq 0x8(%rsp), %rax
pushq %rax
callq 0x8a8d
addq $0x10, %rsp
leaq 0x28(%rsp), %rdi
callq 0x24db1
movq (%r15), %r15
testq %r15, %r15
jne 0x8ce3
jmp 0x8e29
movl $0x200, %edi            # imm = 0x200
callq 0x69d0
movq %rax, 0x48(%rsp)
testl %r14d, %r14d
je 0x8da9
leaq 0x18(%rsp), %rbx
movq %r13, %rdi
leaq 0x50(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x48(%rsp), %rcx
leaq 0x38(%rsp), %r8
leaq 0x24(%rsp), %r9
callq 0x27c4e
testl %eax, %eax
je 0x8da4
leaq 0x40(%rsp), %rdi
movl %ebp, %esi
movq %r15, %rdx
movq 0x10(%rsp), %rcx
movq %r12, %r8
movq %rbx, %r9
pushq 0x8(%rsp)
leaq 0x8(%rsp), %rax
pushq %rax
callq 0x8a8d
addq $0x10, %rsp
decl %r14d
jne 0x8d52
movq 0x48(%rsp), %rax
movq %rax, %rdi
callq 0x68a0
leaq 0x38(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x27927
jmp 0x8e33
movq 0x28(%r13), %r15
testq %r15, %r15
movq %r12, %rbx
movl 0x20(%rsp), %ebp
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r12
je 0x8e29
movq 0x8(%r15), %rsi
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3ebfd
movq %rax, 0x28(%rsp)
movq %rax, %rdi
movl %ebp, %esi
movq 0x30(%rsp), %rdx
movq %r14, %rcx
movq %rbx, %r8
leaq 0x18(%rsp), %r9
pushq %r12
leaq 0x8(%rsp), %rax
pushq %rax
callq 0x8a8d
addq $0x10, %rsp
leaq 0x28(%rsp), %rdi
callq 0x24db1
movq (%r15), %r15
testq %r15, %r15
jne 0x8ddc
leaq 0x40(%rsp), %rdi
callq 0x3e30e
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x8e51
movq 0x18(%rsp), %rsi
movl (%rsp), %edx
leaq 0x8479c(%rip), %rdi     # 0x8d5e6
xorl %eax, %eax
callq 0x6070
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq