// File: /workspace/github_c_makefile_star2_O2/OpenGene[P]pecheck/src/main.cpp
// Function: main
int main(int argc, char* argv[]){
    // display version info if no argument is given
    if(argc == 1) {
        cout << "A tool to check paired-end FASTQ data integrity" << endl << "version " << VERSION_NUM << endl;
    }
    if (argc == 2 && strcmp(argv[1], "test")==0){
        UnitTest tester;
        tester.run();
        return 0;
    }
    cmdline::parser cmd;
    // input/output
    cmd.add<string>("in1", 'i', "read1 file name", true, "");
    cmd.add<string>("in2", 'I', "read2 file name", true, "");
    cmd.add<string>("json", 'j', "json report file name", true, "pecheck.json");

    cmd.parse_check(argc, argv);
    
    stringstream ss;
    for(int i=0;i<argc;i++){
        ss << argv[i] << " ";
    }
    command = ss.str();

    time_t t1 = time(NULL);

    Options opt;

    opt.in1 = cmd.get<string>("in1");
    opt.in2 = cmd.get<string>("in2");
    opt.jsonFile = cmd.get<string>("json");

    opt.validate();

    PECheck pecheck(&opt);
    pecheck.run();

    time_t t2 = time(NULL);

    cerr << endl << "JSON report: " << opt.jsonFile << endl;
    cerr << endl << command << endl;
    cerr << "pecheck v" << VERSION_NUM << ", time used: " << (t2)-t1 << " seconds" << endl;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x360, %rsp            # imm = 0x360
movq %rsi, %rbx
movl %edi, %r14d
cmpl $0x2, %edi
je 0x47f0
cmpl $0x1, %r14d
jne 0x4808
movq 0xb81c(%rip), %rdi      # 0xffd0
leaq 0x5907(%rip), %rsi      # 0xa0c2
callq 0x3260
movq %rax, %rdi
callq 0x3140
leaq 0x5923(%rip), %rsi      # 0xa0f2
movq %rax, %rdi
callq 0x3260
leaq 0x591d(%rip), %rsi      # 0xa0fb
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3140
jmp 0x4808
movq 0x8(%rbx), %rdi
leaq 0x5906(%rip), %rsi      # 0xa101
callq 0x33a0
testl %eax, %eax
je 0x4c95
leaq 0x128(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
leaq 0x178(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, -0x30(%rax)
movups %xmm0, -0x20(%rax)
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x198(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
leaq 0x5bf6(%rip), %rsi      # 0xa45c
leaq 0x1d8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x44ec
leaq 0x5887(%rip), %rsi      # 0xa106
leaq 0x60(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x44ec
leaq 0x62b6(%rip), %rsi      # 0xab4b
leaq 0x100(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x44ec
leaq 0x120(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
pushq $0x69
popq %rdx
leaq 0x60(%rsp), %rcx
pushq $0x1
popq %r8
leaq 0x100(%rsp), %r9
callq 0x4d7c
leaq 0x100(%rsp), %rdi
callq 0x3568
leaq 0x60(%rsp), %rdi
callq 0x3568
leaq 0x1d8(%rsp), %rdi
callq 0x3568
leaq 0x5b8a(%rip), %rsi      # 0xa485
leaq 0x1d8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x44ec
leaq 0x5802(%rip), %rsi      # 0xa116
leaq 0x60(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x44ec
leaq 0x6221(%rip), %rsi      # 0xab4b
leaq 0xe0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x44ec
leaq 0x120(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
pushq $0x49
popq %rdx
leaq 0x60(%rsp), %rcx
pushq $0x1
popq %r8
leaq 0xe0(%rsp), %r9
callq 0x4d7c
leaq 0xe0(%rsp), %rdi
callq 0x3568
leaq 0x60(%rsp), %rdi
callq 0x3568
leaq 0x1d8(%rsp), %rdi
callq 0x3568
leaq 0x57b4(%rip), %rsi      # 0xa144
leaq 0x1d8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x44ec
leaq 0x577d(%rip), %rsi      # 0xa126
leaq 0x60(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x44ec
leaq 0x577d(%rip), %rsi      # 0xa13c
leaq 0xc0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x44ec
leaq 0x120(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
pushq $0x6a
popq %rdx
leaq 0x60(%rsp), %rcx
pushq $0x1
popq %r8
leaq 0xc0(%rsp), %r9
callq 0x4d7c
leaq 0xc0(%rsp), %rdi
callq 0x3568
leaq 0x60(%rsp), %rdi
callq 0x3568
leaq 0x1d8(%rsp), %rdi
callq 0x3568
leaq 0x120(%rsp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x4dec
leaq 0x1d8(%rsp), %rdi
callq 0x31b0
leaq 0x1e8(%rsp), %r15
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
leaq 0x57aa(%rip), %r12      # 0xa201
cmpq %r13, %r14
je 0x4a78
movq (%rbx,%r13,8), %rsi
movq %r15, %rdi
callq 0x3260
movq %rax, %rdi
movq %r12, %rsi
callq 0x3260
incq %r13
jmp 0x4a57
leaq 0x1f0(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x3450
leaq 0xb84f(%rip), %rdi      # 0x102e0
leaq 0x60(%rsp), %rbx
movq %rbx, %rsi
callq 0x3330
movq %rbx, %rdi
callq 0x3568
xorl %edi, %edi
callq 0x3240
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x746c
leaq 0x599b(%rip), %rsi      # 0xa45c
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x44ec
leaq 0x120(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4edc
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x3170
leaq 0x10(%rsp), %rdi
callq 0x3568
leaq 0x5985(%rip), %rsi      # 0xa485
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x44ec
leaq 0x120(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4edc
leaq 0x80(%rsp), %rdi
movq %rax, %rsi
callq 0x3170
leaq 0x10(%rsp), %rdi
callq 0x3568
leaq 0x5602(%rip), %rsi      # 0xa144
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x44ec
leaq 0x120(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4edc
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x3170
leaq 0x10(%rsp), %rdi
callq 0x3568
leaq 0x60(%rsp), %rdi
callq 0x763e
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x77b8
leaq 0x10(%rsp), %rdi
callq 0x77dc
xorl %edi, %edi
callq 0x3240
movq %rax, %r14
movq 0xb43c(%rip), %rdi      # 0xfff0
callq 0x3140
leaq 0x5589(%rip), %rsi      # 0xa149
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq %r15, %rsi
callq 0x3220
movq %rax, %rdi
callq 0x3140
movq 0xb40e(%rip), %rdi      # 0xfff0
callq 0x3140
leaq 0xb6f2(%rip), %rsi      # 0x102e0
movq %rax, %rdi
callq 0x3220
movq %rax, %rdi
callq 0x3140
movq 0xb3eb(%rip), %rdi      # 0xfff0
leaq 0x554b(%rip), %rsi      # 0xa157
callq 0x3260
leaq 0x54e3(%rip), %rsi      # 0xa0fb
movq %rax, %rdi
callq 0x3260
leaq 0x553a(%rip), %rsi      # 0xa161
movq %rax, %rdi
callq 0x3260
subq %rbx, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x3250
leaq 0x552b(%rip), %rsi      # 0xa16f
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3140
leaq 0x40(%rsp), %rdi
callq 0x3568
leaq 0x60(%rsp), %rdi
callq 0x5012
leaq 0x1d8(%rsp), %rdi
callq 0x31e0
leaq 0x120(%rsp), %rdi
callq 0x5032
xorl %eax, %eax
addq $0x360, %rsp            # imm = 0x360
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
callq 0x991c
movq %rbx, %rdi
callq 0x991e
jmp 0x4c82
jmp 0x4d3e
jmp 0x4cbc
jmp 0x4cbc
jmp 0x4cbc
jmp 0x4cbc
movq %rax, %rbx
jmp 0x4d4b
jmp 0x4d57
jmp 0x4d57
jmp 0x4d2b
jmp 0x4d2b
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
jmp 0x4d03
jmp 0x4d0a
jmp 0x4d19
jmp 0x4d2b
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
jmp 0x4d03
jmp 0x4d0a
jmp 0x4d19
jmp 0x4d2b
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x3568
jmp 0x4d0d
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3568
jmp 0x4d1c
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
callq 0x3568
jmp 0x4d67
movq %rax, %rbx
jmp 0x4d67
jmp 0x4d34
jmp 0x4d34
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x4d46
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3568
leaq 0x60(%rsp), %rdi
callq 0x5012
jmp 0x4d5a
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
callq 0x31e0
leaq 0x120(%rsp), %rdi
callq 0x5032
movq %rbx, %rdi
callq 0x34e0