// File: millanek[P]evo/process_vcf_print_routines.cpp
// Function: print_het_counts(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&, std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&)
void print_het_counts(const string& fileRoot, const std::vector<std::string>& header, const std::vector<int>& hetCounts, const std::vector<int>& sharedHetCounts) {
    assert(hetCounts.size() == sharedHetCounts.size());
    std::ios_base::openmode mode_out = std::ios_base::out;
    string hetFileName = fileRoot + ".hets.txt";
    string sharedHetFileName = fileRoot + ".sharedHets.txt";
    std::ofstream* pHetsOutFile = new std::ofstream(hetFileName.c_str(), mode_out);
    std::ofstream* pSharedHetsOutFile = new std::ofstream(sharedHetFileName.c_str(), mode_out);
    *pHetsOutFile << "# Het counts" << std::endl;
    *pHetsOutFile << "# Input file:" << fileRoot << ".vcf" << std::endl;
    
    *pSharedHetsOutFile << "# Shared het counts (line1) and proportions (line 2)" << std::endl;
    *pSharedHetsOutFile << "# Input file:" << fileRoot << ".vcf" << std::endl;

    // Calculate shared het proportions
    std::vector<double> sharedHetProportions;
    for (int i = 0; i < (int)sharedHetCounts.size(); i++) {
        sharedHetProportions.push_back((double)sharedHetCounts[i]/hetCounts[i]);
    }
    
    // print het counts
    print_vector(header,*pHetsOutFile);
    print_vector(hetCounts, *pHetsOutFile);
    
    // print shared het counts and proportions
    print_vector(header,*pSharedHetsOutFile);
    print_vector(sharedHetCounts, *pSharedHetsOutFile);
    print_vector(sharedHetProportions, *pSharedHetsOutFile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x467f0
movq %rax, -0x130(%rbp)
movq -0x20(%rbp), %rdi
callq 0x467f0
movq %rax, %rcx
movq -0x130(%rbp), %rax
cmpq %rcx, %rax
jne 0x90c35
jmp 0x90c54
leaq 0xab55a(%rip), %rdi     # 0x13c196
leaq 0xab57e(%rip), %rsi     # 0x13c1c1
movl $0x1e, %edx
leaq 0xab591(%rip), %rcx     # 0x13c1e0
callq 0xa390
movl $0x10, -0x24(%rbp)
movq -0x8(%rbp), %rsi
leaq 0xab5f6(%rip), %rdx     # 0x13c25c
leaq -0x48(%rbp), %rdi
callq 0x3da80
movq -0x8(%rbp), %rsi
leaq 0xab5ec(%rip), %rdx     # 0x13c266
leaq -0x68(%rbp), %rdi
callq 0x3da80
jmp 0x90c85
movl $0x200, %edi            # imm = 0x200
callq 0xa5d0
movq %rax, -0x138(%rbp)
jmp 0x90c98
leaq -0x48(%rbp), %rdi
callq 0xa220
movq -0x138(%rbp), %rdi
movq %rax, %rsi
movl -0x24(%rbp), %edx
callq 0xa650
jmp 0x90cb5
movq -0x138(%rbp), %rax
movq %rax, -0x80(%rbp)
movl $0x200, %edi            # imm = 0x200
callq 0xa5d0
movq %rax, -0x140(%rbp)
jmp 0x90cd3
leaq -0x68(%rbp), %rdi
callq 0xa220
movq -0x140(%rbp), %rdi
movq %rax, %rsi
movl -0x24(%rbp), %edx
callq 0xa650
jmp 0x90cf0
movq -0x140(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
leaq 0xab56d(%rip), %rsi     # 0x13c276
callq 0xa5c0
movq %rax, -0x148(%rbp)
jmp 0x90d17
movq -0x148(%rbp), %rdi
movq 0x108263(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x90d2c
movq -0x80(%rbp), %rdi
leaq 0xab451(%rip), %rsi     # 0x13c188
callq 0xa5c0
movq %rax, -0x150(%rbp)
jmp 0x90d45
movq -0x150(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xa520
movq %rax, -0x158(%rbp)
jmp 0x90d5e
movq -0x158(%rbp), %rdi
leaq 0xb5a84(%rip), %rsi     # 0x1467f0
callq 0xa5c0
movq %rax, -0x160(%rbp)
jmp 0x90d7a
movq -0x160(%rbp), %rdi
movq 0x108200(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x90d8f
movq -0x88(%rbp), %rdi
leaq 0xab4e6(%rip), %rsi     # 0x13c283
callq 0xa5c0
movq %rax, -0x168(%rbp)
jmp 0x90dab
movq -0x168(%rbp), %rdi
movq 0x1081cf(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x90dc0
movq -0x88(%rbp), %rdi
leaq 0xab3ba(%rip), %rsi     # 0x13c188
callq 0xa5c0
movq %rax, -0x170(%rbp)
jmp 0x90ddc
movq -0x170(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xa520
movq %rax, -0x178(%rbp)
jmp 0x90df5
movq -0x178(%rbp), %rdi
leaq 0xb59ed(%rip), %rsi     # 0x1467f0
callq 0xa5c0
movq %rax, -0x180(%rbp)
jmp 0x90e11
movq -0x180(%rbp), %rdi
movq 0x108169(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x90e26
leaq -0xa0(%rbp), %rdi
callq 0x48410
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x184(%rbp)
movq -0x20(%rbp), %rdi
callq 0x467f0
movq %rax, %rcx
movl -0x184(%rbp), %eax
cmpl %ecx, %eax
jge 0x90f48
movq -0x20(%rbp), %rdi
movslq -0xa4(%rbp), %rsi
callq 0x48250
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x190(%rbp)
movq -0x18(%rbp), %rdi
movslq -0xa4(%rbp), %rsi
callq 0x48250
movsd -0x190(%rbp), %xmm0
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x48450
jmp 0x90ebb
jmp 0x90ebd
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x90e3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x91132
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x91129
movq -0x138(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
movl $0x200, %esi            # imm = 0x200
callq 0xa5e0
jmp 0x91129
movq -0x140(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
movl $0x200, %esi            # imm = 0x200
callq 0xa5e0
jmp 0x91129
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x9111d
movq -0x10(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x3fee0
jmp 0x90f5a
movq -0x80(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x50da0
jmp 0x90f76
leaq -0xc8(%rbp), %rdi
callq 0x3dfa0
movq -0x18(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x4cf20
jmp 0x90f94
movq -0x80(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x5f9b0
jmp 0x90fb0
leaq -0xe0(%rbp), %rdi
callq 0x48290
movq -0x10(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x3fee0
jmp 0x90fce
movq -0x88(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x50da0
jmp 0x90fed
leaq -0xf8(%rbp), %rdi
callq 0x3dfa0
movq -0x20(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x4cf20
jmp 0x9100b
movq -0x88(%rbp), %rsi
leaq -0x110(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x5f9b0
jmp 0x9102a
leaq -0x110(%rbp), %rdi
callq 0x48290
leaq -0x128(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x53120
jmp 0x9104b
movq -0x88(%rbp), %rsi
leaq -0x128(%rbp), %rdi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x92580
jmp 0x9106a
leaq -0x128(%rbp), %rdi
callq 0x3ecb0
leaq -0xa0(%rbp), %rdi
callq 0x3ecb0
leaq -0x68(%rbp), %rdi
callq 0xac88
leaq -0x48(%rbp), %rdi
callq 0xac88
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3dfa0
jmp 0x9111d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x48290
jmp 0x9111d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x3dfa0
jmp 0x9111d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x48290
jmp 0x9111d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x3ecb0
leaq -0xa0(%rbp), %rdi
callq 0x3ecb0
leaq -0x68(%rbp), %rdi
callq 0xac88
leaq -0x48(%rbp), %rdi
callq 0xac88
movq -0x70(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)