// File: millanek[P]evo/process_vcf_print_routines.cpp
// Function: print_AllH_pairwise_diff_stats(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, int, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>> const&)
void print_AllH_pairwise_diff_stats(const string& fileRoot, const std::vector<std::string>& samples, const int totalVariantNumber, const std::vector<std::vector<double> >& diffMatrixAllH) {
    std::ios_base::openmode mode_out = std::ios_base::out;
    string diffFileNameAllH = fileRoot + ".diff_matrix_AllH.txt";
    std::ofstream* pDiffAllHOutFile = new std::ofstream(diffFileNameAllH.c_str(), mode_out);
    *pDiffAllHOutFile << "# Input file:" << fileRoot << ".vcf" << std::endl;
    *pDiffAllHOutFile << "# Total number of segragating variant sites in this sample:" << totalVariantNumber << std::endl;
    *pDiffAllHOutFile << "# Differences between all haplotypes:" << std::endl;
    
    std::vector<std::string> header;
    for (std::vector<std::string>::size_type i = 0; i < samples.size(); i++) {
        header.push_back(samples[i] + "_H1");
        header.push_back(samples[i] + "_H2");
    }
    
    // print statistics
    print_vector(header,*pDiffAllHOutFile);
    print_matrix<const std::vector<std::vector<double> >&>(diffMatrixAllH, *pDiffAllHOutFile);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x10, -0x24(%rbp)
movq -0x8(%rbp), %rsi
leaq 0xaa44f(%rip), %rdx     # 0x13c58b
leaq -0x48(%rbp), %rdi
callq 0x3da80
movl $0x200, %edi            # imm = 0x200
callq 0xa5d0
movq %rax, -0xe0(%rbp)
jmp 0x92158
leaq -0x48(%rbp), %rdi
callq 0xa220
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
movl -0x24(%rbp), %edx
callq 0xa650
jmp 0x92175
movq -0xe0(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
leaq 0xa9ffd(%rip), %rsi     # 0x13c188
callq 0xa5c0
movq %rax, -0xe8(%rbp)
jmp 0x92199
movq -0xe8(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xa520
movq %rax, -0xf0(%rbp)
jmp 0x921b2
movq -0xf0(%rbp), %rdi
leaq 0xb4630(%rip), %rsi     # 0x1467f0
callq 0xa5c0
movq %rax, -0xf8(%rbp)
jmp 0x921ce
movq -0xf8(%rbp), %rdi
movq 0x106dac(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x921e3
movq -0x50(%rbp), %rdi
leaq 0xaa171(%rip), %rsi     # 0x13c35f
callq 0xa5c0
movq %rax, -0x100(%rbp)
jmp 0x921fc
movq -0x100(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xab20
movq %rax, -0x108(%rbp)
jmp 0x92214
movq -0x108(%rbp), %rdi
movq 0x106d66(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x92229
movq -0x50(%rbp), %rdi
leaq 0xaa36d(%rip), %rsi     # 0x13c5a1
callq 0xa5c0
movq %rax, -0x110(%rbp)
jmp 0x92242
movq -0x110(%rbp), %rdi
movq 0x106d38(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x92257
leaq -0x78(%rbp), %rdi
callq 0x48da0
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x118(%rbp), %rax
cmpq %rcx, %rax
jae 0x923a1
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x52960
movq %rax, %rsi
leaq 0xaa2e1(%rip), %rdx     # 0x13c587
leaq -0xa0(%rbp), %rdi
callq 0x3da80
jmp 0x922b4
leaq -0x78(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5f980
jmp 0x922c6
leaq -0xa0(%rbp), %rdi
callq 0xac88
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x52960
movq %rax, %rsi
leaq 0xaa2de(%rip), %rdx     # 0x13c5c7
leaq -0xc0(%rbp), %rdi
callq 0x3da80
jmp 0x922f7
leaq -0x78(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5f980
jmp 0x92309
leaq -0xc0(%rbp), %rdi
callq 0xac88
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x92268
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x92426
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x200, %esi            # imm = 0x200
callq 0xa5e0
jmp 0x92426
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x9241d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xac88
jmp 0x9241d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xac88
jmp 0x9241d
leaq -0xd8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3fee0
jmp 0x923b3
movq -0x50(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x50da0
jmp 0x923cf
leaq -0xd8(%rbp), %rdi
callq 0x3dfa0
movq -0x20(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x926b0
jmp 0x923ea
leaq -0x78(%rbp), %rdi
callq 0x3dfa0
leaq -0x48(%rbp), %rdi
callq 0xac88
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3dfa0
leaq -0x78(%rbp), %rdi
callq 0x3dfa0
leaq -0x48(%rbp), %rdi
callq 0xac88
movq -0x58(%rbp), %rdi
callq 0xab50
nopl (%rax,%rax)