// File: 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
subq $0x10150, %rsp          # imm = 0x10150
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x43d0
leaq -0x58(%rbp), %rdi
callq 0x43d0
leaq -0x78(%rbp), %rdi
callq 0x43d0
movl -0xc(%rbp), %esi
leaq -0xe0(%rbp), %rdi
callq 0x75c0
jmp 0x5162
movb $0x0, -0xf9(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4210
cmpq $0x3, %rax
jbe 0x5204
movq -0x8(%rbp), %rdi
callq 0x4210
movl %eax, -0x100(%rbp)
movq -0x8(%rbp), %rdi
movl -0x100(%rbp), %eax
subl $0x3, %eax
movslq %eax, %rsi
callq 0x4330
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x5202
movq -0x8(%rbp), %rdi
movl -0x100(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
callq 0x4330
movsbl (%rax), %eax
cmpl $0x67, %eax
jne 0x5202
movq -0x8(%rbp), %rdi
movl -0x100(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x4330
movsbl (%rax), %eax
cmpl $0x7a, %eax
jne 0x5202
movb $0x1, -0xf9(%rbp)
jmp 0x5202
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
jmp 0x5527
jmp 0x5204
testb $0x1, -0xf9(%rbp)
je 0x52ba
movl $0x2a0, %edi            # imm = 0x2A0
callq 0x42d0
movq %rax, -0x10110(%rbp)
jmp 0x5224
movq -0x8(%rbp), %rdi
callq 0x4160
movq -0x10110(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x78d0
jmp 0x5243
movq -0x10110(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x10118(%rbp)
je 0x526d
movq -0x10110(%rbp), %rax
addq $0x188, %rax            # imm = 0x188
movq %rax, -0x10118(%rbp)
movq -0x10118(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x5317
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
jmp 0x551b
movq -0x10110(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
callq 0x42a0
jmp 0x551b
movl $0x208, %edi            # imm = 0x208
callq 0x42d0
movq %rax, -0x10120(%rbp)
jmp 0x52cd
movq -0x10120(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x8, %edx
callq 0x44b0
jmp 0x52e4
movq -0x10120(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x5317
movq -0x10120(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
callq 0x42a0
jmp 0x551b
leaq -0x10108(%rbp), %rdi
movq %rdi, -0x10128(%rbp)
callq 0x79e0
movq -0x10128(%rbp), %rdi
callq 0x7a10
jmp 0x5338
jmp 0x533a
movq -0xf8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4090
movq %rax, -0x10130(%rbp)
jmp 0x5353
movq -0x10130(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4580
movb %al, -0x10131(%rbp)
jmp 0x5371
movb -0x10131(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5382
jmp 0x547c
movq -0xf8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4090
jmp 0x5394
movslq -0x108(%rbp), %rsi
leaq -0x10108(%rbp), %rdi
callq 0x7a30
movq %rax, -0x10140(%rbp)
jmp 0x53b0
movq -0x10140(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4050
jmp 0x53c2
leaq -0x8108(%rbp), %rdi
movslq -0x108(%rbp), %rsi
callq 0x7a30
movq %rax, -0x10148(%rbp)
jmp 0x53de
movq -0x10148(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4050
jmp 0x53f0
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
cmpl $0x400, -0x108(%rbp)    # imm = 0x400
jl 0x5453
leaq -0xe0(%rbp), %rdi
leaq -0x10108(%rbp), %rsi
callq 0x7a80
jmp 0x5420
leaq -0x10108(%rbp), %rdi
callq 0x7a10
jmp 0x542e
jmp 0x5453
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0x10108(%rbp), %rdi
callq 0x7d00
jmp 0x551b
movq -0xf8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4090
jmp 0x5465
movq -0xf8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4090
jmp 0x5477
jmp 0x533a
cmpl $0x0, -0x108(%rbp)
jle 0x54aa
leaq -0xe0(%rbp), %rdi
leaq -0x10108(%rbp), %rsi
callq 0x7a80
jmp 0x549a
leaq -0x10108(%rbp), %rdi
callq 0x7a10
jmp 0x54a8
jmp 0x54aa
movb $0x1, -0xdc(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x7b40
jmp 0x54bf
leaq -0xe0(%rbp), %rdi
callq 0x7bc0
jmp 0x54cd
movq -0x18(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x7c20
jmp 0x54df
leaq -0x10108(%rbp), %rdi
callq 0x7d00
leaq -0xe0(%rbp), %rdi
callq 0x7d30
leaq -0x78(%rbp), %rdi
callq 0x41d0
leaq -0x58(%rbp), %rdi
callq 0x41d0
leaq -0x38(%rbp), %rdi
callq 0x41d0
addq $0x10150, %rsp          # imm = 0x10150
popq %rbp
retq
leaq -0xe0(%rbp), %rdi
callq 0x7d30
leaq -0x78(%rbp), %rdi
callq 0x41d0
leaq -0x58(%rbp), %rdi
callq 0x41d0
leaq -0x38(%rbp), %rdi
callq 0x41d0
movq -0xe8(%rbp), %rdi
callq 0x4550
nop