// File: /workspace/github_cpp_makefile_star2_O1/medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::WholeGenome(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
WholeGenome::WholeGenome(int thread_num_,
    string output_dir_,
    bool pr_curves){

    thread_num = thread_num_;
    chrom_num = 24;

    output_dir = output_dir_;

    //thread_num = thread_num_;
    //dout << "WholeGenome() Thread Number: " << thread_num << endl;

    ref_variant_by_chrid = new vector<DiploidVariant>*[chrom_num];

	for (int j = 0; j < chrom_num; j++) {
		ref_variant_by_chrid[j] = new vector<DiploidVariant>;
	}

    que_variant_by_chrid = new vector<DiploidVariant>*[chrom_num];
    for (int j = 0; j < chrom_num; j++) {
        que_variant_by_chrid[j] = new vector<DiploidVariant>;
    }

    // chr_id starts from 0
	for(int j = 1; j <= 22; j++){
        string chr_name = to_string(j);
        chrname_dict[chr_name] = j-1;
        chr_name = "chr"+chr_name;
        chrname_dict[chr_name] = j-1;
	}
	chrname_dict["X"] = 22;
	chrname_dict["chrX"] = 22;
	chrname_dict["Y"] = 23;
	chrname_dict["chrY"] = 23;

    if(pr_curves){
        per_list = {0.0, 0.1, 0.2, 0.3, 0.9};
    }else{
        per_list = {0.0};
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, 0x8(%rsp)
movq %rdi, %r13
leaq 0x18(%rdi), %r12
movq %r12, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movb %al, 0x18(%rdi)
leaq 0x38(%rdi), %rbp
movq %rbp, 0x28(%rdi)
movq %rax, 0x30(%rdi)
movb %al, 0x38(%rdi)
leaq 0x90(%rdi), %rcx
movl %eax, 0x90(%rdi)
movq %rax, 0x98(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x70(%rdi)
movq %rcx, 0xa0(%rdi)
movq %rcx, 0xa8(%rdi)
movq %rax, 0xb0(%rdi)
leaq 0xc0(%rdi), %rcx
movl %eax, 0xc0(%rdi)
movq %rax, 0xc8(%rdi)
movq %rcx, 0xd0(%rdi)
movq %rcx, 0xd8(%rdi)
movq %rax, 0xe0(%rdi)
leaq 0xe8(%rdi), %rcx
movq %rcx, 0x50(%rsp)
leaq 0xf0(%rdi), %rcx
movl %eax, 0xf0(%rdi)
movq %rax, 0xf8(%rdi)
movq %rcx, 0x100(%rdi)
movq %rcx, 0x108(%rdi)
movq %rax, 0x110(%rdi)
leaq 0x120(%rdi), %rcx
movl %eax, 0x120(%rdi)
movq %rax, 0x128(%rdi)
movq %rcx, 0x130(%rdi)
movq %rcx, 0x138(%rdi)
movq %rax, 0x140(%rdi)
movq %rax, 0x170(%rdi)
movups %xmm0, 0x160(%rdi)
leaq 0x1b0(%rdi), %rcx
movq %rcx, 0x60(%rsp)
movq %rcx, 0x1a0(%rdi)
movq %rax, 0x1a8(%rdi)
movb %al, 0x1b0(%rdi)
leaq 0x1c0(%rdi), %rdi
leaq 0x1d0(%r13), %rcx
movq %rcx, 0x10(%rsp)
movq %rcx, 0x1c0(%r13)
movq %rax, 0x1c8(%r13)
movb %al, 0x1d0(%r13)
leaq 0x270(%r13), %rcx
movq %rcx, 0x18(%rsp)
movups %xmm0, 0x270(%r13)
movq %rax, 0x280(%r13)
movq %rax, 0x260(%r13)
movups %xmm0, 0x250(%r13)
movups %xmm0, 0x240(%r13)
movups %xmm0, 0x230(%r13)
movups %xmm0, 0x220(%r13)
movups %xmm0, 0x210(%r13)
movups %xmm0, 0x200(%r13)
movups %xmm0, 0x1f0(%r13)
movl %esi, 0x4(%r13)
movl $0x18, (%r13)
movq %rdi, 0x58(%rsp)
movq %rdx, %rsi
movq %r12, 0x70(%rsp)
movq %rbp, 0x68(%rsp)
callq 0x51c0
movslq (%r13), %rbx
leaq (,%rbx,8), %rax
testq %rbx, %rbx
movq $-0x1, %r15
cmovnsq %rax, %r15
movq %r15, %rdi
callq 0x5030
movq %rax, 0x148(%r13)
testl %ebx, %ebx
jle 0x119cd
xorl %r14d, %r14d
movl $0x18, %edi
callq 0x5330
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x148(%r13), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0x119a2
movq %r15, %rdi
callq 0x5030
movq %rax, 0x150(%r13)
testl %ebx, %ebx
jle 0x11a0e
xorl %r14d, %r14d
movl $0x18, %edi
callq 0x5330
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x150(%r13), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0x119e3
movq %r13, 0x48(%rsp)
movl $0x1, %r13d
leaq 0x88(%rsp), %rbx
leaq 0x20(%rsp), %r15
leaq 0x1f8ab(%rip), %r12     # 0x312d8
leaq 0x78(%rsp), %rbp
cmpl $0xa, %r13d
movl $0x2, %r14d
sbbl $0x0, %r14d
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movl $0x2d, %edx
callq 0x53b0
movq 0x20(%rsp), %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0xe3b6
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x28812
decl %r13d
movl %r13d, (%rax)
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xce96
movq %r15, %rdi
movq %rbp, %rsi
callq 0x53e0
movq 0x78(%rsp), %rdi
cmpq %rbx, %rdi
je 0x11ab0
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x28812
movl %r13d, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11adc
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
addl $0x2, %r13d
cmpl $0x17, %r13d
jne 0x11a32
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f7e1(%rip), %rsi     # 0x312df
leaq 0x1f7db(%rip), %rdx     # 0x312e0
callq 0xc45c
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2888e
movl $0x16, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11b3b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f78d(%rip), %rsi     # 0x312dc
leaq 0x1f78a(%rip), %rdx     # 0x312e0
callq 0xc45c
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2888e
movl $0x16, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11b8c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f744(%rip), %rsi     # 0x312e4
leaq 0x1f73e(%rip), %rdx     # 0x312e5
callq 0xc45c
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2888e
movl $0x17, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11bdd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f6f0(%rip), %rsi     # 0x312e1
leaq 0x1f6ed(%rip), %rdx     # 0x312e5
callq 0xc45c
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2888e
movl $0x17, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11c2e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
cmpb $0x0, 0x8(%rsp)
je 0x11c60
movups 0x1f684(%rip), %xmm0    # 0x312c0
leaq 0x34(%rsp), %rdx
movaps %xmm0, -0x14(%rdx)
movl $0x3f666666, -0x4(%rdx) # imm = 0x3F666666
leaq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x2b572
jmp 0x11c7e
leaq 0x24(%rsp), %rdx
movl $0x0, -0x4(%rdx)
leaq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x2b572
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11c92
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %r13
movq 0x10(%rsp), %rax
jmp 0x11cf7
jmp 0x11cc7
jmp 0x11cbe
jmp 0x11cc7
jmp 0x11cbe
jmp 0x11cc7
jmp 0x11cbe
jmp 0x11cc7
jmp 0x11cbe
jmp 0x11cb7
jmp 0x11cb7
movq %rax, 0x8(%rsp)
jmp 0x11ced
movq %rax, 0x8(%rsp)
jmp 0x11ce8
jmp 0x11cc7
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11ce8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x48(%rsp), %r13
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x11d13
movq 0x280(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x250(%r13), %rdi
testq %rdi, %rdi
je 0x11d33
movq 0x260(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x238(%r13), %rdi
testq %rdi, %rdi
je 0x11d53
movq 0x248(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x220(%r13), %rdi
testq %rdi, %rdi
je 0x11d73
movq 0x230(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
leaq 0x1f0(%r13), %rbx
movq 0x208(%r13), %rdi
testq %rdi, %rdi
je 0x11d9a
movq 0x218(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x11db6
movq 0x200(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x58(%rsp), %rcx
movq (%rcx), %rdi
cmpq %rax, %rdi
je 0x11dce
movq (%rax), %rsi
incq %rsi
callq 0x5340
leaq 0x50(%r13), %rax
movq %rax, 0x18(%rsp)
leaq 0x68(%r13), %r12
leaq 0x88(%r13), %rbp
movq %r13, %rax
addq $0xb8, %r13
leaq 0x118(%rax), %r15
leaq 0x160(%rax), %r14
movq %rax, %rbx
movq 0x1a0(%rax), %rdi
movq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x11e19
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq %r14, %rdi
callq 0x2890a
movq %r15, %rdi
callq 0x29d0e
movq 0x50(%rsp), %rdi
callq 0x29d86
movq %r13, %rdi
callq 0x29d0e
movq %rbp, %rdi
callq 0x29d86
movq %r12, %rdi
callq 0xe7ca
movq 0x18(%rsp), %rdi
callq 0xe7ca
movq 0x28(%rbx), %rdi
movq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x11e6e
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rbx), %rdi
movq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x11e87
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
callq 0x55c0
nop