// File: /workspace/github_cpp_makefile_star2_O3/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 0x5a6c
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 0x1123c
movzbl 0x1f8(%rsp), %ecx
leaq 0x200(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movl %ebx, %esi
callq 0x1171c
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x8003
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5340
cmpl $0x3, 0x1d4(%rsp)
jne 0x80b0
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x168(%rsp), %rsi
movq 0x170(%rsp), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0x1123c
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x128(%rsp), %rsi
movq 0x130(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x1123c
leaq 0x200(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x269c6
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x80a3
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x108(%rsp), %rdi
jmp 0x814a
leaq 0xf8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x168(%rsp), %rsi
movq 0x170(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rdi
callq 0x1123c
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x128(%rsp), %rsi
movq 0x130(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x1123c
leaq 0x200(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x268e2
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x8142
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x815a
movq (%r14), %rsi
incq %rsi
callq 0x5340
movq 0x1e0(%rsp), %rax
cmpq %rax, 0x1e8(%rsp)
je 0x8369
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 0x1123c
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 0x1123c
leaq 0x1(%rbx), %r14
movl $0x1, %r12d
cmpq $0x9, %rbx
leaq 0x8(%rsp), %rbx
jb 0x821f
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x8216
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x821c
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x821f
movl %eax, %ecx
imulq %r13, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x81e6
addl $-0x3, %r12d
jmp 0x821f
addl $-0x2, %r12d
jmp 0x821f
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 0xe33a
movl $0x5, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x27e63(%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 0x8288
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x828f
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 0x26d8e
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x82f7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8313
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x832f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x8346
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 0x8182
leaq 0x200(%rsp), %rdi
callq 0x11e06
leaq 0x128(%rsp), %rdi
callq 0xaa32
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 0x83de
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x83de
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x83ff
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x83ff
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x84cf
movq 0xf8(%rsp), %rsi
jmp 0x84c7
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x84cf
movq 0x118(%rsp), %rsi
jmp 0x84c7
jmp 0x8452
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x84dc
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x84dc
jmp 0x844a
movq %rax, %rbx
jmp 0x84dc
movq %rax, %rbx
jmp 0x84cf
movq %rax, %rbx
jmp 0x84b8
movq %rax, %rbx
jmp 0x849c
movq %rax, %rbx
jmp 0x8480
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x8480
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x849c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x84b8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x84cf
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x200(%rsp), %rdi
callq 0x11e06
leaq 0x128(%rsp), %rdi
callq 0xaa32
movq %rbx, %rdi
callq 0x55c0
nop