// File: /workspace/github_cpp_makefile_star2_O2/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 $0xa8, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
xorl %eax, %eax
movb %al, 0x18(%rdi)
addq $0x38, %rdi
movq %rdi, 0x28(%rbx)
andq $0x0, 0x30(%rbx)
movb %al, 0x38(%rbx)
leaq 0x90(%rbx), %rdi
andl $0x0, 0x90(%rbx)
andq $0x0, 0x98(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
movq %rdi, 0xa0(%rbx)
movq %rdi, 0xa8(%rbx)
andq $0x0, 0xb0(%rbx)
leaq 0xc0(%rbx), %rdi
andl $0x0, 0xc0(%rbx)
andq $0x0, 0xc8(%rbx)
movq %rdi, 0xd0(%rbx)
movq %rdi, 0xd8(%rbx)
andq $0x0, 0xe0(%rbx)
leaq 0xf0(%rbx), %rdi
andl $0x0, 0xf0(%rbx)
andq $0x0, 0xf8(%rbx)
movq %rdi, 0x100(%rbx)
movq %rdi, 0x108(%rbx)
andq $0x0, 0x110(%rbx)
andl $0x0, 0x120(%rbx)
andq $0x0, 0x128(%rbx)
movl %ecx, 0x30(%rsp)
leaq 0x120(%rbx), %rcx
movq %rcx, 0x130(%rbx)
movq %rcx, 0x138(%rbx)
andq $0x0, 0x140(%rbx)
movups %xmm0, 0x160(%rbx)
andq $0x0, 0x170(%rbx)
leaq 0x1b0(%rbx), %rcx
movq %rcx, 0x1a0(%rbx)
andq $0x0, 0x1a8(%rbx)
movb %al, 0x1b0(%rbx)
leaq 0x1d0(%rbx), %rcx
movq %rcx, 0x1c0(%rbx)
andq $0x0, 0x1c8(%rbx)
leaq 0xe8(%rbx), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x1c0(%rbx), %rbp
movb %al, 0x1d0(%rbx)
leaq 0x270(%rbx), %rax
movq %rax, 0x38(%rsp)
movups %xmm0, 0x270(%rbx)
andq $0x0, 0x280(%rbx)
movups %xmm0, 0x250(%rbx)
movups %xmm0, 0x240(%rbx)
movups %xmm0, 0x230(%rbx)
movups %xmm0, 0x220(%rbx)
movups %xmm0, 0x210(%rbx)
andq $0x0, 0x260(%rbx)
movups %xmm0, 0x200(%rbx)
movups %xmm0, 0x1f0(%rbx)
movl %esi, 0x4(%rbx)
movl $0x18, (%rbx)
movq %rbp, %rdi
movq %rdx, %rsi
movq %rbp, 0x80(%rsp)
callq 0x51d0
movslq (%rbx), %r13
leaq (,%r13,8), %rax
testq %r13, %r13
pushq $-0x1
popq %r15
cmovnsq %rax, %r15
movq %r15, %rdi
callq 0x5030
movq %rax, 0x148(%rbx)
xorl %r14d, %r14d
testl %r13d, %r13d
cmovlel %r14d, %r13d
pushq $0x18
popq %r12
cmpq %r14, %r13
je 0xd46a
movq %r12, %rdi
callq 0x5300
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0x148(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
jmp 0xd442
movq %r15, %rdi
callq 0x5030
movq %rax, 0x150(%rbx)
xorl %r14d, %r14d
pushq $0x18
popq %r15
cmpq %r14, %r13
je 0xd4a8
movq %r15, %rdi
callq 0x5300
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0x150(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
jmp 0xd480
pushq $0x1
popq %r13
pushq $0x16
popq %r14
leaq 0x10(%rsp), %r15
leaq 0x88(%rsp), %rbp
subl $0x1, %r14d
jb 0xd524
movq %r15, %rdi
movl %r13d, %esi
callq 0x8011
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x19942
leal -0x1(%r13), %r12d
movl %r12d, (%rax)
movq %rbp, %rdi
leaq 0x14dd4(%rip), %rsi     # 0x222c0
movq %r15, %rdx
callq 0x9dae
movq %r15, %rdi
movq %rbp, %rsi
callq 0x5390
movq %rbp, %rdi
callq 0x55e8
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x19942
movl %r12d, (%rax)
movq %r15, %rdi
callq 0x55e8
incl %r13d
jmp 0xd4bd
leaq 0x14d9c(%rip), %rsi     # 0x222c7
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x72ee
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x199a8
movl $0x16, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x55e8
leaq 0x14d61(%rip), %rsi     # 0x222c4
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x72ee
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x199a8
movl $0x16, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x55e8
leaq 0x14d31(%rip), %rsi     # 0x222cc
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x72ee
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x199a8
movl $0x17, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x55e8
leaq 0x14cf6(%rip), %rsi     # 0x222c9
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x72ee
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x199a8
movl $0x17, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x55e8
cmpb $0x0, 0x30(%rsp)
je 0xd633
movups 0x14c96(%rip), %xmm0    # 0x222a8
leaq 0x24(%rsp), %rdx
movaps %xmm0, -0x14(%rdx)
movl $0x3f666666, -0x4(%rdx) # imm = 0x3F666666
leaq 0x10(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x1c8e8
jmp 0xd64b
leaq 0x14(%rsp), %rdx
andl $0x0, -0x4(%rdx)
leaq 0x10(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x1c8e8
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd679
jmp 0xd679
jmp 0xd67e
jmp 0xd679
jmp 0xd67e
jmp 0xd679
jmp 0xd67e
jmp 0xd679
jmp 0xd67e
jmp 0xd679
jmp 0xd679
jmp 0xd679
jmp 0xd67e
jmp 0xd679
movq %rax, %r14
jmp 0xd68b
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x55e8
leaq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x28(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq 0x50(%rbx), %rax
movq %rax, 0x70(%rsp)
leaq 0x160(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x1a0(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x1f0(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x250(%rbx), %r15
leaq 0x238(%rbx), %r12
leaq 0x220(%rbx), %r13
leaq 0x208(%rbx), %rbp
leaq 0x68(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x118(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0xb8(%rbx), %rax
movq %rax, 0x60(%rsp)
addq $0x88, %rbx
movq 0x38(%rsp), %rdi
callq 0x1c3c2
movq %r15, %rdi
callq 0x1c38e
movq %r12, %rdi
callq 0xce14
movq %r13, %rdi
callq 0xce14
movq %rbp, %rdi
callq 0xce14
movq 0x40(%rsp), %rdi
callq 0xce14
movq 0x80(%rsp), %rdi
callq 0x55e8
movq 0x48(%rsp), %rdi
callq 0x55e8
movq 0x58(%rsp), %rdi
callq 0x19a0e
movq 0x50(%rsp), %rdi
callq 0x1ad04
movq 0x8(%rsp), %rdi
callq 0x1ad68
movq 0x60(%rsp), %rdi
callq 0x1ad04
movq %rbx, %rdi
callq 0x1ad68
movq 0x68(%rsp), %rdi
callq 0xadcc
movq 0x70(%rsp), %rdi
callq 0xadcc
movq 0x78(%rsp), %rdi
callq 0x55e8
movq 0x30(%rsp), %rdi
callq 0x55e8
movq %r14, %rdi
callq 0x5540
nop