// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: GeneralSetCounts::getBasicCounts(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::map<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
void GeneralSetCounts::getBasicCounts(const std::vector<std::string>& genotypes, const std::map<size_t, string>& posToSpeciesMap) {
    // Go through the genotypes - only biallelic markers are allowed
    for (std::vector<std::string>::size_type i = 0; i != genotypes.size(); i++) {
        std::string species = posToSpeciesMap.at(i);
        // The first allele in this individual
        if (genotypes[i][0] == '1') {
            overall++; individualsWithVariant[i] = 1;
            setAltCounts[species]++; setAlleleCounts[species]++;
        } else if (genotypes[i][0] == '0') {
            setAlleleCounts[species]++; setRefCounts[species]++;
            individualsWithVariant[i] = 0;
        }
        // The second allele in this individual
        if (genotypes[i][2] == '1') {
            overall++;
            setAltCounts[species]++; setAlleleCounts[species]++;
            individualsWithVariant[i]++;
        } else if (genotypes[i][2] == '0') {
            setAlleleCounts[species]++; setRefCounts[species]++;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x68(%rdi), %r12
leaq 0x8(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x38(%rdi), %rbp
xorl %eax, %eax
leaq 0x18(%rsp), %r13
movq %rax, 0x8(%rsp)
movq 0x8(%r14), %rcx
subq (%r14), %rcx
sarq $0x5, %rcx
cmpq %rcx, %rax
je 0x3ff3f
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x437e4
movq %r13, %rdi
movq %rax, %rsi
callq 0x8600
movq 0x8(%rsp), %rax
movq (%r14), %rcx
movq %rax, %rdx
shlq $0x5, %rdx
movq (%rcx,%rdx), %rcx
movzbl (%rcx), %ecx
cmpl $0x30, %ecx
je 0x3fe9a
cmpl $0x31, %ecx
jne 0x3fec6
incl (%r15)
movq 0x1c0(%r15), %rcx
movl $0x1, (%rcx,%rax,4)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq 0x8(%rsp), %rax
jmp 0x3fec6
movq %r12, %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq 0x8(%rsp), %rax
movq 0x1c0(%r15), %rcx
andl $0x0, (%rcx,%rax,4)
movq (%r14), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rax
movzbl 0x2(%rax), %eax
cmpl $0x30, %eax
je 0x3ff0e
cmpl $0x31, %eax
jne 0x3ff2a
incl (%r15)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq 0x8(%rsp), %rax
shlq $0x2, %rax
addq 0x1c0(%r15), %rax
jmp 0x3ff28
movq %r12, %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x32a8a
incl (%rax)
movq %r13, %rdi
callq 0x8978
movq 0x8(%rsp), %rax
incq %rax
jmp 0x3fe17
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870
nop