// File: /workspace/github_cpp_makefile_star2_O2/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
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xb8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rsi, %rdx
movl %edi, %esi
movb %cl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
andq $0x0, 0x38(%rax)
leaq 0x28(%rsp), %rdi
callq 0x575c
leaq 0x88(%rsp), %rsi
movl 0x40(%rsi), %ebx
leaq 0x8(%rsp), %rdi
callq 0x53f0
movzbl 0xf8(%rsp), %ecx
leaq 0x200(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movl %ebx, %esi
callq 0xd24c
leaq 0x68(%rsp), %r14
leaq 0x8(%rsp), %rdi
callq 0x55e8
cmpl $0x3, 0x6c(%r14)
jne 0x6d07
leaq 0x1e0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x53f0
leaq 0x1c0(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x53f0
leaq 0x200(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x18d94
jmp 0x6d42
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x53f0
leaq 0x180(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x53f0
leaq 0x200(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x18d10
movq %r14, %rdi
callq 0x55e8
movq %rbx, %rdi
callq 0x55e8
xorl %r12d, %r12d
leaq 0x160(%rsp), %rbx
leaq 0x140(%rsp), %r14
leaq 0x100(%rsp), %r15
leaq 0x120(%rsp), %r13
xorl %ebp, %ebp
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rbp, %rax
jbe 0x6e2b
addq %r12, %rsi
movq %rbx, %rdi
callq 0x53f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x53f0
leal 0x1(%rbp), %esi
movq %r15, %rdi
callq 0x8011
movq %r13, %rdi
leaq 0x1a2fe(%rip), %rsi     # 0x210c0
movq %r15, %rdx
callq 0x7fed
movzbl 0xd8(%rsp), %ecx
movl 0xcc(%rsp), %r8d
movl 0xd0(%rsp), %r9d
movl 0xd4(%rsp), %eax
movl %eax, (%rsp)
leaq 0x200(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x18f44
movq %r13, %rdi
callq 0x55e8
movq %r15, %rdi
callq 0x55e8
movq %r14, %rdi
callq 0x55e8
movq %rbx, %rdi
callq 0x55e8
addq $0x20, %r12
incq %rbp
jmp 0x6d77
leaq 0x200(%rsp), %rdi
callq 0xd7ba
leaq 0x28(%rsp), %rdi
callq 0x8596
xorl %eax, %eax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x55e8
jmp 0x6e7d
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x55e8
jmp 0x6e8a
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
jmp 0x6eed
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
jmp 0x6eed
jmp 0x6ef4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x55e8
jmp 0x6f04
jmp 0x6ea7
movq %rax, %rbx
jmp 0x6f04
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x55e8
jmp 0x6ec1
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x55e8
jmp 0x6ed8
movq %rax, %rbx
jmp 0x6ee5
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x55e8
leaq 0x160(%rsp), %rdi
callq 0x55e8
jmp 0x6ef7
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0xd7ba
leaq 0x28(%rsp), %rdi
callq 0x8596
movq %rbx, %rdi
callq 0x5540