// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_massoko.cpp
// Function: getMassokoVariantCounts(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&)
MassokoCounts getMassokoVariantCounts(const std::vector<std::string>& fields) {
    MassokoCounts thisVariantCounts;
    thisVariantCounts.individualsWithVariant.assign((fields.size()-NUM_NON_GENOTYPE_COLUMNS),0);
    for (std::vector<std::string>::size_type i = NUM_NON_GENOTYPE_COLUMNS; i != fields.size(); i++) {
        if (fields[i][0] == '1') { 
            thisVariantCounts.overall++;
            if (i <= 14) { thisVariantCounts.blue++; }
            thisVariantCounts.individualsWithVariant[i- NUM_NON_GENOTYPE_COLUMNS]++;
        }
        if (fields[i][2] == '1') { 
            thisVariantCounts.overall++; 
            if (i <= 14) { thisVariantCounts.blue++; }
            thisVariantCounts.individualsWithVariant[i-NUM_NON_GENOTYPE_COLUMNS]++;
        }
        std::vector<std::string> genotypeData = split(fields[i], ':');
        
        if (atoi(genotypeData[2].c_str()) < thisVariantCounts.minimumDepthInAnIndividual) {
            thisVariantCounts.minimumDepthInAnIndividual = atoi(genotypeData[2].c_str());
        }
        
    }
    // Also get overall depth for this variant
    std::vector<std::string> info = split(fields[7], ';');
    if (info[0] == "INDEL") {
        info = split(info[1], '=');
    } else {
        info = split(info[0], '=');
    }
    thisVariantCounts.overallDepth = atoi((info.back()).c_str());
    return thisVariantCounts;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x50a92
leaq 0x70(%rbx), %r15
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
addq $-0x9, %rsi
leaq 0x8(%rsp), %rdx
andl $0x0, (%rdx)
movq %r15, %rdi
callq 0x44dfe
pushq $0x9
popq %r13
movl $0x120, %ebp            # imm = 0x120
leaq 0x8(%rsp), %r12
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %r13
je 0x4fdbc
movq (%rsi,%rbp), %rax
cmpb $0x31, (%rax)
jne 0x4fd68
incl (%rbx)
cmpq $0xe, %r13
ja 0x4fd60
incl 0xfc(%rbx)
movq (%r15), %rcx
incl -0x24(%rcx,%r13,4)
cmpb $0x31, 0x2(%rax)
jne 0x4fd84
incl (%rbx)
cmpq $0xe, %r13
ja 0x4fd7c
incl 0xfc(%rbx)
movq (%r15), %rax
incl -0x24(%rax,%r13,4)
addq %rbp, %rsi
movq %r12, %rdi
pushq $0x3a
popq %rdx
callq 0x40349
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x86f0
cmpl 0x4(%rbx), %eax
jge 0x4fda8
movl %eax, 0x4(%rbx)
movq %r12, %rdi
callq 0x28a08
incq %r13
addq $0x20, %rbp
jmp 0x4fd36
addq $0xe0, %rsi
leaq 0x8(%rsp), %rdi
pushq $0x3b
popq %rdx
callq 0x40349
movq 0x8(%rsp), %rdi
leaq 0x478de(%rip), %rsi     # 0x976ba
callq 0x2193f
testb %al, %al
je 0x4fdfd
movq 0x8(%rsp), %rsi
addq $0x20, %rsi
leaq 0x20(%rsp), %rdi
pushq $0x3d
popq %rdx
callq 0x40349
jmp 0x4fe0f
movq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x3d
popq %rdx
callq 0x40349
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %r14
movq %r14, %rsi
callq 0x2f6c0
movq %r14, %rdi
callq 0x28a08
leaq 0x8(%rsp), %r14
movq 0x8(%r14), %rax
movq -0x20(%rax), %rdi
callq 0x86f0
movl %eax, 0x8(%rbx)
movq %r14, %rdi
callq 0x28a08
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4fe5a
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x28a08
jmp 0x4fe70
jmp 0x4fe6d
jmp 0x4fe6d
movq %rax, %r14
movq %rbx, %rdi
callq 0x289b4
movq %r14, %rdi
callq 0x8870