// File: /workspace/github_cpp_makefile_star2_O3/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 0x11941
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 0x11916
movq %r15, %rdi
callq 0x5030
movq %rax, 0x150(%r13)
testl %ebx, %ebx
jle 0x11982
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 0x11957
movq %r13, 0x48(%rsp)
movl $0x1, %r13d
leaq 0x88(%rsp), %rbx
leaq 0x20(%rsp), %r15
leaq 0x1f967(%rip), %r12     # 0x31308
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 0xe33a
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x283a0
decl %r13d
movl %r13d, (%rax)
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xce20
movq %r15, %rdi
movq %rbp, %rsi
callq 0x53e0
movq 0x78(%rsp), %rdi
cmpq %rbx, %rdi
je 0x11a24
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x283a0
movl %r13d, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11a50
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
addl $0x2, %r13d
cmpl $0x17, %r13d
jne 0x119a6
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f89d(%rip), %rsi     # 0x3130f
leaq 0x1f897(%rip), %rdx     # 0x31310
callq 0xc3da
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2841c
movl $0x16, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11aaf
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f849(%rip), %rsi     # 0x3130c
leaq 0x1f846(%rip), %rdx     # 0x31310
callq 0xc3da
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2841c
movl $0x16, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11b00
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f800(%rip), %rsi     # 0x31314
leaq 0x1f7fa(%rip), %rdx     # 0x31315
callq 0xc3da
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2841c
movl $0x17, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11b51
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1f7ac(%rip), %rsi     # 0x31311
leaq 0x1f7a9(%rip), %rdx     # 0x31315
callq 0xc3da
leaq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x2841c
movl $0x17, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11ba2
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
cmpb $0x0, 0x8(%rsp)
je 0x11bd4
movups 0x1f740(%rip), %xmm0    # 0x312f0
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 0x2b082
jmp 0x11bf2
leaq 0x24(%rsp), %rdx
movl $0x0, -0x4(%rdx)
leaq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x2b082
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11c06
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %r13
movq 0x10(%rsp), %rax
jmp 0x11c6b
jmp 0x11c3b
jmp 0x11c32
jmp 0x11c3b
jmp 0x11c32
jmp 0x11c3b
jmp 0x11c32
jmp 0x11c3b
jmp 0x11c32
jmp 0x11c2b
jmp 0x11c2b
movq %rax, 0x8(%rsp)
jmp 0x11c61
movq %rax, 0x8(%rsp)
jmp 0x11c5c
jmp 0x11c3b
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x11c5c
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 0x11c87
movq 0x280(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x250(%r13), %rdi
testq %rdi, %rdi
je 0x11ca7
movq 0x260(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x238(%r13), %rdi
testq %rdi, %rdi
je 0x11cc7
movq 0x248(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x220(%r13), %rdi
testq %rdi, %rdi
je 0x11ce7
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 0x11d0e
movq 0x218(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x11d2a
movq 0x200(%r13), %rsi
subq %rdi, %rsi
callq 0x5340
movq 0x10(%rsp), %rax
movq 0x58(%rsp), %rcx
movq (%rcx), %rdi
cmpq %rax, %rdi
je 0x11d42
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 0x11d8d
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq %r14, %rdi
callq 0x28498
movq %r15, %rdi
callq 0x29876
movq 0x50(%rsp), %rdi
callq 0x298ee
movq %r13, %rdi
callq 0x29876
movq %rbp, %rdi
callq 0x298ee
movq %r12, %rdi
callq 0xe71c
movq 0x18(%rsp), %rdi
callq 0xe71c
movq 0x28(%rbx), %rdi
movq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x11de2
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rbx), %rdi
movq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x11dfb
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
callq 0x55c0
nop