// File: /workspace/github_cpp_makefile_star2_O1/medvedevgroup[P]varmatch/src/vm.cpp
// Function: main
int main(int argc, char* argv[])
{
//	dout << "Debug Mode" << endl;
//    WholeGenome wg(1);
//    wg.test();
//    return 0;

    Args args;
    TclapParser(args, argc, argv);

    //return 0;
    WholeGenome wg(args.thread_num,
                   args.output_dir,
                   args.pr_curves);

    // if(args.direct_match){
    //     for(int i = 0; i < args.query_file_list.size(); i++){
    //         string query_filename = args.query_file_list[i];
    //         wg.DirectMatch(args.ref_vcf_filename, query_filename, args.match_mode);
    //     }
    //     return 0;
    // }
    if(args.score_scheme == 3){
        wg.ReadDirectRef(args.genome_seq_filename, 
            args.ref_vcf_filename);
    }else{
        wg.ReadRef(args.genome_seq_filename, 
            args.ref_vcf_filename);
    }

    // use a loop 
    for(int i = 0; i < args.query_file_list.size(); i++){
        string query_filename = args.query_file_list[i];

        wg.Compare(query_filename,
            "query"+to_string(i+1),
            args.detail_results,
            args.score_unit,
            args.match_mode,
            args.score_scheme);
    }

    return 0;

//
//    if(args.remove_duplicates){
//        RemoveDuplicate rd(args.thread_num);
//        rd.Deduplicate(args.single_vcf_filename,
//            args.genome_seq_filename,
//            args.direct_search,
//            args.output_filename);
//        return 0;
//	}
//
//	DiploidVCF dv(args.thread_num);
//    dv.Compare(args.ref_vcf_filename,
//		args.que_vcf_filename,
//		args.genome_seq_filename,
//		args.direct_search,
//		args.output_filename,
//		args.match_genotype,
//		args.normalization,
//		args.score_basepair,
//		args.overlap_match,
//		args.variant_check);
//	return 0;
//
//	VCF vcf(args.thread_num);
//	vcf.Compare(args.ref_vcf_filename,
//			args.que_vcf_filename,
//			args.genome_seq_filename,
//			args.direct_search,
//            args.output_filename,
//            args.match_genotype,
//			args.normalization);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rsi, %rdx
movl %edi, %esi
leaq 0x138(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x158(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x178(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x198(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x1b8(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movq %rcx, 0x38(%rax)
leaq 0x128(%rsp), %rdi
callq 0x59fc
movl 0x1c8(%rsp), %ebx
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x188(%rsp), %rsi
movq 0x190(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x112ce
movzbl 0x1f8(%rsp), %ecx
leaq 0x200(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movl %ebx, %esi
callq 0x117a8
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x7f93
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5340
cmpl $0x3, 0x1d4(%rsp)
jne 0x8040
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x168(%rsp), %rsi
movq 0x170(%rsp), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0x112ce
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x128(%rsp), %rsi
movq 0x130(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x112ce
leaq 0x200(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x26ea4
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x8033
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x108(%rsp), %rdi
jmp 0x80da
leaq 0xf8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x168(%rsp), %rsi
movq 0x170(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rdi
callq 0x112ce
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x128(%rsp), %rsi
movq 0x130(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x112ce
leaq 0x200(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x26dc0
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x80d2
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x80ea
movq (%r14), %rsi
incq %rsi
callq 0x5340
movq 0x1e0(%rsp), %rax
cmpq %rax, 0x1e8(%rsp)
je 0x82f9
leaq 0x78(%rsp), %r12
leaq 0x38(%rsp), %rbp
xorl %ebx, %ebx
movl $0xd1b71759, %r13d      # imm = 0xD1B71759
movq %rbx, %rcx
shlq $0x5, %rcx
movq %r12, 0x68(%rsp)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x112ce
movq %r12, %r15
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x112ce
leaq 0x1(%rbx), %r14
movl $0x1, %r12d
cmpq $0x9, %rbx
leaq 0x8(%rsp), %rbx
jb 0x81af
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x81a6
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x81ac
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x81af
movl %eax, %ecx
imulq %r13, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x8176
addl $-0x3, %r12d
jmp 0x81af
addl $-0x2, %r12d
jmp 0x81af
decl %r12d
movl %r12d, %esi
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl $0x2d, %edx
callq 0x53b0
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0xe3b6
movl $0x5, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x27ed3(%rip), %rcx     # 0x300c0
callq 0x5380
movq %rbp, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %r15, %r12
je 0x8218
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x821f
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movzbl 0x1d8(%rsp), %ecx
movl 0x1cc(%rsp), %r8d
movl 0x1d0(%rsp), %r9d
movl 0x1d4(%rsp), %eax
movl %eax, (%rsp)
leaq 0x200(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x2726c
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x8287
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x82a3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x82bf
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x82d6
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x1e0(%rsp), %rax
movq 0x1e8(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movq %r14, %rbx
cmpq %r14, %rcx
ja 0x8112
leaq 0x200(%rsp), %rdi
callq 0x11e92
leaq 0x128(%rsp), %rdi
callq 0xaab6
xorl %eax, %eax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x836e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x836e
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x838f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x838f
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x845f
movq 0xf8(%rsp), %rsi
jmp 0x8457
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x845f
movq 0x118(%rsp), %rsi
jmp 0x8457
jmp 0x83e2
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x846c
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x846c
jmp 0x83da
movq %rax, %rbx
jmp 0x846c
movq %rax, %rbx
jmp 0x845f
movq %rax, %rbx
jmp 0x8448
movq %rax, %rbx
jmp 0x842c
movq %rax, %rbx
jmp 0x8410
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x8410
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x842c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x8448
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x845f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x200(%rsp), %rdi
callq 0x11e92
leaq 0x128(%rsp), %rdi
callq 0xaab6
movq %rbx, %rdi
callq 0x55c0
nop