// File: /workspace/github_cpp_makefile_star2_O2/BGI-Qingdao[P]metaSLR/classify.cpp
// Function: main
int main(int argc ,char ** argv ){
    TestAll();
    static struct option long_options[] = {
        {"hap",  required_argument,  NULL, 'k'},
        {"read", required_argument,  NULL, 'r'},
        {"thread",required_argument, NULL, 't'},
        {"help",  no_argument,       NULL, 'h'},
        {0, 0, 0, 0}
    };
    static char optstring[] = "k:l:r:t:h";
    std::string hap0 , hap1 ;
    std::vector<std::string> haps;
    std::vector<std::string> read;
    int t_num=1;
    while(1){
        int c = getopt_long(argc, argv, optstring, long_options, NULL);
        if (c<0) break;
        switch (c){
            case 'k':
                haps.push_back(std::string(optarg));
                break;
            case 'r':
                read.push_back(std::string(optarg));
                break;
            case 't':
                t_num = atoi(optarg);
                break;
            case 'h':
            default :
                printUsage();
                return -1;
        }
    }
    if( haps.size() < 2 || read.empty() || t_num< 1) {
        printUsage();
        return -1;
    }
    std::cerr<<"__START__"<<std::endl;
    logtime();
    for( int i = 0 ; i < (int)haps.size() ; i++ ) {
        std::cerr<<"__load hap "<<i<<" kmers from file "<<haps[i]<<std::endl;
        load_kmers(haps[i],i);
    }
    InitAdaptor();
    logtime();
    BarcodeCache data;
    for(const auto r : read ){
        std::cerr<<"__process read: "<<r<<std::endl;
        processFastq(r,t_num,data);
        logtime();
        std::cerr<<"__process read done__"<<std::endl;
    }
    std::cerr<<"__print result__"<<std::endl;
    printBarcodeInfos(data,haps);
    logtime();
    std::cerr<<"__END__"<<std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movl %edi, %r15d
callq 0x42c7
leaq -0xf0(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0xd0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rax
andq $0x0, 0x10(%rax)
leaq -0x70(%rbp), %rcx
andq $0x0, 0x10(%rcx)
movaps %xmm0, (%rax)
movaps %xmm0, (%rcx)
pushq $0x1
popq %rax
movl %eax, -0x2c(%rbp)
leaq 0x99e9(%rip), %rbx      # 0xe2f0
leaq 0x9942(%rip), %r12      # 0xe250
leaq -0xa0(%rbp), %r13
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x33e0
testl %eax, %eax
js 0x49a9
cmpl $0x6b, %eax
je 0x495e
cmpl $0x72, %eax
jne 0x498d
movq 0x9682(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movq %r13, %rdi
leaq -0xc0(%rbp), %rdx
callq 0x3110
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x873c
jmp 0x4983
movq 0x965b(%rip), %rax      # 0xdfc0
movq (%rax), %rsi
movq %r13, %rdi
leaq -0xc0(%rbp), %rdx
callq 0x3110
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x873c
movq %r13, %rdi
callq 0x3130
jmp 0x4915
cmpl $0x74, %eax
jne 0x49d7
movq 0x9627(%rip), %rax      # 0xdfc0
movq (%rax), %rdi
callq 0x33a0
movl %eax, -0x2c(%rbp)
jmp 0x4915
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
cmpq $0x21, %rax
jb 0x49d0
movq -0x70(%rbp), %rax
cmpq -0x68(%rbp), %rax
sete %al
cmpl $0x0, -0x2c(%rbp)
setle %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x4a1d
callq 0x426f
jmp 0x49dc
callq 0x426f
pushq $-0x1
popq %rbx
leaq -0x70(%rbp), %rdi
callq 0x5650
leaq -0x50(%rbp), %rdi
callq 0x5650
leaq -0xe0(%rbp), %rdi
callq 0x3130
leaq -0x100(%rbp), %rdi
callq 0x3130
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x95cc(%rip), %rdi      # 0xdff0
leaq 0x4a22(%rip), %rsi      # 0x944d
callq 0x3240
movq %rax, %rdi
callq 0x3150
callq 0x35fc
xorl %r13d, %r13d
movq 0x95a9(%rip), %rbx      # 0xdff0
leaq 0x4a09(%rip), %r14      # 0x9457
leaq 0x4a0e(%rip), %r15      # 0x9463
xorl %r12d, %r12d
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
shrq $0x5, %rax
cltq
cmpq %rax, %r12
jge 0x4abb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3240
movq %rax, %rdi
movl %r12d, %esi
callq 0x3420
movq %rax, %rdi
movq %r15, %rsi
callq 0x3240
movq -0x50(%rbp), %rsi
addq %r13, %rsi
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3150
movq -0x50(%rbp), %rdi
addq %r13, %rdi
movl %r12d, %esi
callq 0x3634
incq %r12
addq $0x20, %r13
jmp 0x4a58
callq 0x3edb
callq 0x35fc
leaq -0x98(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq -0x70(%rbp), %r14
movq -0x68(%rbp), %r13
leaq -0xc0(%rbp), %rbx
movq 0x94f9(%rip), %r15      # 0xdff0
leaq 0x4988(%rip), %r12      # 0x9486
cmpq %r13, %r14
je 0x4b68
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3310
movq %r15, %rdi
leaq 0x495d(%rip), %rsi      # 0x9475
callq 0x3240
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3150
movq %rbx, %rdi
movl -0x2c(%rbp), %esi
leaq -0xa0(%rbp), %rdx
callq 0x3c2d
callq 0x35fc
movq %r15, %rdi
movq %r12, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3130
addq $0x20, %r14
jmp 0x4afe
movq 0x9481(%rip), %rdi      # 0xdff0
leaq 0x4926(%rip), %rsi      # 0x949c
callq 0x3240
movq %rax, %rdi
callq 0x3150
leaq -0xa0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3a59
callq 0x35fc
movq 0x9451(%rip), %rdi      # 0xdff0
leaq 0x4907(%rip), %rsi      # 0x94ad
callq 0x3240
movq %rax, %rdi
callq 0x3150
leaq -0xa0(%rbp), %rdi
callq 0x7dd6
xorl %ebx, %ebx
jmp 0x49df
jmp 0x4be8
jmp 0x4bcc
jmp 0x4be8
movq %rax, %rbx
jmp 0x4bfc
jmp 0x4be8
jmp 0x4be8
jmp 0x4bd7
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x3130
jmp 0x4c08
movq %rax, %rbx
jmp 0x4c08
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3130
leaq -0xa0(%rbp), %rdi
callq 0x7dd6
leaq -0x70(%rbp), %rdi
callq 0x5650
leaq -0x50(%rbp), %rdi
callq 0x5650
leaq -0xe0(%rbp), %rdi
callq 0x3130
leaq -0x100(%rbp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3440