// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq %rdi, %rbx
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xf8(%rbp), %rdi
callq 0x57f2
movq 0x8(%rbx), %rax
cmpq $0x4, %rax
jb 0x4069
shlq $0x20, %rax
movabsq $-0x300000000, %rcx     # imm = 0xFFFFFFFD00000000
addq %rax, %rcx
sarq $0x20, %rcx
movq (%rbx), %r15
cmpb $0x2e, (%r15,%rcx)
jne 0x4069
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
cmpb $0x67, (%r15,%rcx)
jne 0x4069
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rcx, %rax
sarq $0x20, %rax
cmpb $0x7a, (%r15,%rax)
jne 0x4069
movl $0x2a0, %edi            # imm = 0x2A0
callq 0x3250
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x59e2
addq $0x188, %r14            # imm = 0x188
jmp 0x4086
movl $0x208, %edi            # imm = 0x208
callq 0x3250
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x3380
movl $0x10, %eax
leaq (%rax,%rbp), %rcx
addq $-0x10100, %rcx         # imm = 0xFFFEFF00
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x8010, %rax           # imm = 0x8010
jne 0x408b
movq %r12, -0x30(%rbp)
movl $0x8010, %eax           # imm = 0x8010
leaq -0x8100(%rbp), %r15
leaq (%rax,%rbp), %rcx
addq $-0x10100, %rcx         # imm = 0xFFFEFF00
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x10010, %rax          # imm = 0x10010
jne 0x40c1
leaq -0x10100(%rbp), %rax
movl $0x0, 0x10000(%rax)
leaq -0x90(%rbp), %r12
leaq -0x70(%rbp), %r13
leaq -0x50(%rbp), %rbx
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x2, 0x20(%rax,%rcx)
jne 0x422a
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x3420
movslq -0x100(%rbp), %rsi
cmpq $0x400, %rsi            # imm = 0x400
jae 0x4330
shlq $0x5, %rsi
leaq (%rsi,%rbp), %rdi
addq $-0x10100, %rdi         # imm = 0xFFFEFF00
movq %r12, %rsi
callq 0x3160
movslq -0x100(%rbp), %rsi
cmpq $0x3ff, %rsi            # imm = 0x3FF
ja 0x4330
shlq $0x5, %rsi
addq %r15, %rsi
movq %rsi, %rdi
movq %r13, %rsi
callq 0x3160
movl -0x100(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x100(%rbp)
cmpl $0x3ff, %eax            # imm = 0x3FF
jl 0x41e1
leaq -0xf8(%rbp), %rdi
leaq -0x10100(%rbp), %rsi
callq 0x5ae0
movl $0x0, -0x100(%rbp)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3420
jmp 0x4107
cmpl $0x0, -0x100(%rbp)
movq -0x30(%rbp), %rbx
jle 0x4254
leaq -0xf8(%rbp), %rdi
leaq -0x10100(%rbp), %rsi
callq 0x5ae0
movl $0x0, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
movb $0x1, 0x4(%rdi)
callq 0x5b98
leaq -0xf8(%rbp), %rdi
callq 0x5be4
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x5c28
leaq -0x110(%rbp), %rbx
xorl %r14d, %r14d
movq -0x120(%rbp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0x429f
callq 0x3230
addq $-0x20, %r14
cmpq $-0x8000, %r14          # imm = 0x8000
jne 0x4289
leaq -0x8110(%rbp), %rbx
xorl %r14d, %r14d
movq -0x8120(%rbp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0x42cc
callq 0x3230
addq $-0x20, %r14
cmpq $-0x8000, %r14          # imm = 0x8000
jne 0x42b6
leaq -0xf8(%rbp), %rdi
callq 0x5d04
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x42f7
callq 0x3230
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4309
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x431e
callq 0x3230
addq $0x100d8, %rsp          # imm = 0x100D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6359(%rip), %rdi      # 0xa690
movl $0x400, %edx            # imm = 0x400
xorl %eax, %eax
callq 0x3350
jmp 0x4345
movq %rax, %rbx
movq %r14, %rdi
callq 0x3230
jmp 0x436d
movq %rax, %rbx
jmp 0x436d
movq %rax, %rbx
jmp 0x4379
jmp 0x435e
movq %rax, %rbx
leaq -0x10100(%rbp), %rdi
callq 0x5ca0
leaq -0xf8(%rbp), %rdi
callq 0x5d04
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x438b
callq 0x3230
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x439d
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x43b2
callq 0x3230
movq %rbx, %rdi
callq 0x3400