// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]Dsuite/Dsuite_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++) {
        bool speciesDefined = true;
        std::string species; try { species = posToSpeciesMap.at(i); } catch (const std::out_of_range& oor) {
            speciesDefined = false;
        }
        // The first allele in this individual
        if (genotypes[i][0] == '1') { overall++; individualsWithVariant[i]++; }
        if (genotypes[i][2] == '1') { overall++; individualsWithVariant[i]++; }
        if (speciesDefined) {
            if (genotypes[i][0] == '1') {
                setAltCounts[species]++; setAlleleCounts[species]++;
            } else if (genotypes[i][0] == '0') {
                setAlleleCounts[species]++;
            }
            // The second allele in this individual
            if (genotypes[i][2] == '1') {
                setAltCounts[species]++; setAlleleCounts[species]++;
            } else if (genotypes[i][2] == '0') {
                setAlleleCounts[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 0xc8(%rdi), %r12
leaq 0x98(%rdi), %rax
movq %rax, 0x10(%rsp)
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 0x8767
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0xb894
movb $0x1, %bpl
movq %r13, %rdi
movq %rax, %rsi
callq 0x7240
movq 0x8(%rsp), %rcx
movq (%r14), %rax
movq %rcx, %rdx
shlq $0x5, %rdx
movq (%rax,%rdx), %rax
cmpb $0x31, (%rax)
jne 0x86bb
incl (%r15)
movq 0x2c8(%r15), %rdx
incl (%rdx,%rcx,4)
cmpb $0x31, 0x2(%rax)
jne 0x86ce
incl (%r15)
movq 0x2c8(%r15), %rdx
incl (%rdx,%rcx,4)
testb %bpl, %bpl
je 0x8736
movzbl (%rax), %eax
cmpl $0x30, %eax
je 0x86ef
cmpl $0x31, %eax
jne 0x86fc
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0xbb88
incl (%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0xbb88
incl (%rax)
movq 0x8(%rsp), %rax
movq (%r14), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rax
movzbl 0x2(%rax), %eax
cmpl $0x30, %eax
je 0x8729
cmpl $0x31, %eax
jne 0x8736
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0xbb88
incl (%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0xbb88
incl (%rax)
movq %r13, %rdi
callq 0x7898
movq 0x8(%rsp), %rax
incq %rax
jmp 0x864d
movq %rax, %rbp
cmpl $0x1, %edx
jne 0x877b
movq %rbp, %rdi
callq 0x7190
callq 0x76a0
xorl %ebp, %ebp
jmp 0x8696
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8778
movq %rax, %rbp
leaq 0x18(%rsp), %rdi
callq 0x7898
movq %rbp, %rdi
callq 0x7750
nop