// File: /workspace/github_cpp_makefile_star2_O2/BGI-Qingdao[P]metaSLR/classify.cpp
// Function: processFastq(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, BarcodeCache&)
void processFastq(const std::string & file,int t_num,BarcodeCache& data){
    std::string head;
    std::string seq;
    std::string tmp;
    MultiThread mt(t_num);
    std::istream *in ;
    bool gz_file = false;
    if( file.size() > 3 ) {
        int end=file.size() ;
        if( file[end-3] == '.' && file[end-2] == 'g' && file[end-1]=='z' ) {
            gz_file = true ;
        }
    }
    if ( gz_file )
        in = new igzstream(file.c_str());
    else 
        in = new std::ifstream(file);
    Buffer buffer ;
    buffer.Init();
    while(!std::getline(*in,head).eof()){
        std::getline(*in,seq);
        //mt.submit(head,seq);
        buffer.heads.at(buffer.size) = head ;
        buffer.seqs.at(buffer.size) = seq;
        buffer.size ++ ;
        if ( buffer.size >= max_buffer ){
            mt.submit(buffer);
            buffer.Init();
        }
        std::getline(*in,tmp);
        std::getline(*in,tmp);
    }
    if( buffer.size > 0 ){
        mt.submit(buffer);
        buffer.Init();
    }
    mt.end=true;
    mt.wait();
    mt.collectBarcodes();
    data.Add(mt.final_data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100d8, %rsp          # imm = 0x100D8
movq %rdx, -0x30(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
xorl %ecx, %ecx
leaq -0x60(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0xf8(%rbp), %rdi
callq 0x4e44
movq 0x8(%rbx), %rax
cmpq $0x4, %rax
jb 0x3d00
shlq $0x20, %rax
movabsq $-0x300000000, %rcx     # imm = 0xFFFFFFFD00000000
addq %rax, %rcx
sarq $0x20, %rcx
movq (%rbx), %r15
cmpb $0x2e, (%r15,%rcx)
jne 0x3d00
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
cmpb $0x67, (%r15,%rcx)
jne 0x3d00
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rcx, %rax
sarq $0x20, %rax
cmpb $0x7a, (%r15,%rax)
jne 0x3d00
movl $0x2a0, %edi            # imm = 0x2A0
callq 0x3250
movq %rax, %r14
pushq $0x8
popq %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5000
addq $0x188, %r14            # imm = 0x188
jmp 0x3d1b
movl $0x208, %edi            # imm = 0x208
callq 0x3250
movq %rax, %r14
pushq $0x8
popq %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x33b0
leaq -0x10100(%rbp), %r15
movq %r15, %rdi
callq 0x50c0
andl $0x0, 0x10000(%r15)
leaq -0x90(%rbp), %r13
leaq -0x70(%rbp), %rbx
leaq -0x50(%rbp), %r12
movq %r14, %rdi
movq %r13, %rsi
callq 0x3070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x2, 0x20(%rax,%rcx)
jne 0x3de8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3070
movslq -0x100(%rbp), %rsi
movq %r15, %rdi
callq 0x50e4
movq %rax, %rdi
movq %r13, %rsi
callq 0x3170
movslq -0x100(%rbp), %rsi
leaq -0x8100(%rbp), %rdi
callq 0x50e4
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3170
movl -0x100(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x100(%rbp)
cmpl $0x3ff, %eax            # imm = 0x3FF
jl 0x3dcd
leaq -0xf8(%rbp), %rdi
movq %r15, %rsi
callq 0x5110
andl $0x0, -0x100(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x3070
movq %r14, %rdi
movq %r12, %rsi
callq 0x3070
jmp 0x3d41
cmpl $0x0, -0x100(%rbp)
jle 0x3e0b
leaq -0xf8(%rbp), %rdi
leaq -0x10100(%rbp), %rsi
callq 0x5110
andl $0x0, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
movb $0x1, 0x4(%rdi)
callq 0x5196
leaq -0xf8(%rbp), %rdi
callq 0x51e8
leaq -0xc0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x522a
leaq -0x10100(%rbp), %rdi
callq 0x529a
leaq -0xf8(%rbp), %rdi
callq 0x52be
leaq -0x50(%rbp), %rdi
callq 0x3130
leaq -0x70(%rbp), %rdi
callq 0x3130
leaq -0x90(%rbp), %rdi
callq 0x3130
addq $0x100d8, %rsp          # imm = 0x100D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3e81
movq %rax, %rbx
movq %r14, %rdi
callq 0x3230
jmp 0x3ea9
movq %rax, %rbx
jmp 0x3ea9
movq %rax, %rbx
jmp 0x3eb5
jmp 0x3e9a
movq %rax, %rbx
leaq -0x10100(%rbp), %rdi
callq 0x529a
leaq -0xf8(%rbp), %rdi
callq 0x52be
leaq -0x50(%rbp), %rdi
callq 0x3130
leaq -0x70(%rbp), %rdi
callq 0x3130
leaq -0x90(%rbp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3440