// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, %rbx
movq 0x8(%rdx), %rax
subq (%rdx), %rax
movq 0x8(%rcx), %rcx
subq (%rbx), %rcx
cmpq %rcx, %rax
jne 0x47bf1
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
leaq 0x587c0(%rip), %rdx     # 0xa012f
leaq 0xd8(%rsp), %rdi
movq %rbp, %rsi
callq 0x28806
leaq 0x587b3(%rip), %rdx     # 0xa0139
leaq 0xb8(%rsp), %rdi
movq %rbp, %rsi
callq 0x28806
movl $0x200, %edi            # imm = 0x200
callq 0x8490
movq 0xd8(%rsp), %rsi
pushq $0x10
popq %rdx
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x84e0
movl $0x200, %edi            # imm = 0x200
callq 0x8490
movq %rax, %r14
movq 0xb8(%rsp), %rsi
pushq $0x10
popq %rdx
movq %rax, %rdi
callq 0x84e0
leaq 0x5876a(%rip), %rsi     # 0xa0149
movq 0x8(%rsp), %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
leaq 0x58663(%rip), %rsi     # 0xa005b
movq 0x8(%rsp), %rdi
callq 0x8480
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8430
leaq 0x6288c(%rip), %rsi     # 0xaa2a0
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
leaq 0x5872b(%rip), %rsi     # 0xa0156
movq %r14, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
leaq 0x58619(%rip), %rsi     # 0xa005b
movq %r14, %rdi
callq 0x8480
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8430
leaq 0x62844(%rip), %rsi     # 0xaa2a0
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
movq %r14, 0x10(%rsp)
leaq 0x20(%rsp), %rbp
andq $0x0, 0x10(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rbp)
xorl %r14d, %r14d
leaq 0x18(%rsp), %r15
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r14
jge 0x47acc
cvtsi2sdl (%rax,%r14,4), %xmm0
movq (%r12), %rax
cvtsi2sdl (%rax,%r14,4), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
callq 0x2af10
incq %r14
jmp 0x47a8c
leaq 0xa0(%rsp), %rdi
movq %r13, %rsi
callq 0x297dc
movq 0x10(%rsp), %r14
leaq 0xa0(%rsp), %rdi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
movq 0x8(%rsp), %rsi
callq 0x2ea24
leaq 0xa0(%rsp), %rdi
callq 0x28a08
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x2c6d4
leaq 0x88(%rsp), %rdi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
movq 0x8(%rsp), %rsi
callq 0x348a2
leaq 0x88(%rsp), %rdi
callq 0x2aef2
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x297dc
leaq 0x70(%rsp), %rdi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0x2ea24
leaq 0x70(%rsp), %rdi
callq 0x28a08
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x2c6d4
leaq 0x58(%rsp), %rdi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0x348a2
leaq 0x58(%rsp), %rdi
callq 0x2aef2
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2f816
leaq 0x40(%rsp), %rdi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0x488bf
leaq 0x40(%rsp), %rdi
callq 0x2b43c
leaq 0x20(%rsp), %rdi
callq 0x2b43c
leaq 0xb8(%rsp), %rdi
callq 0x8978
leaq 0xd8(%rsp), %rdi
callq 0x8978
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x58471(%rip), %rdi     # 0xa0069
leaq 0x58495(%rip), %rsi     # 0xa0094
leaq 0x584ad(%rip), %rcx     # 0xa00b3
pushq $0x1e
popq %rdx
callq 0x82f0
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2b43c
jmp 0x47c87
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x47c3c
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x47c4e
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x2aef2
jmp 0x47c87
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x28a08
jmp 0x47c87
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdi
jmp 0x47c6f
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq 0x8(%rsp), %rdi
callq 0x84a0
jmp 0x47c91
jmp 0x47c7f
movq %rax, %rbx
jmp 0x47c9e
jmp 0x47c84
movq %rax, %rbx
jmp 0x47c91
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2b43c
leaq 0xb8(%rsp), %rdi
callq 0x8978
leaq 0xd8(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870