// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movabsq $0x7fffffff00000000, %rax # imm = 0x7FFFFFFF00000000
movq %rax, (%rdi)
xorl %eax, %eax
movl %eax, 0x8(%rdi)
leaq 0x20(%rdi), %rcx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movb %al, 0x20(%rdi)
leaq 0x40(%rdi), %rcx
movq %rcx, 0x30(%rdi)
movq %rax, 0x38(%rdi)
movb %al, 0x40(%rdi)
movsd 0x66744(%rip), %xmm0    # 0xcbd20
movups %xmm0, 0x50(%rdi)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x70(%rdi), %r15
movq %rax, 0xe0(%rdi)
movl %eax, 0xe8(%rdi)
movq %rax, 0xf0(%rdi)
movw $0x0, 0xf8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rdi)
movups %xmm0, 0x80(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0xa0(%rdi)
movups %xmm0, 0xb0(%rdi)
movups %xmm0, 0xc0(%rdi)
movups %xmm0, 0xcc(%rdi)
movl %eax, 0xfc(%rdi)
movq 0x8(%rsi), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
addq $-0x9, %rsi
leaq 0x20(%rsp), %rdx
movl %eax, (%rdx)
movq %r15, %rdi
callq 0x56106
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
cmpq $0x120, %rax            # imm = 0x120
je 0x65714
movl $0x9, %r13d
movl $0x120, %ebp            # imm = 0x120
leaq 0x20(%rsp), %r12
movq (%rsi,%rbp), %rax
cmpb $0x31, (%rax)
jne 0x656ac
incl (%rbx)
cmpq $0xe, %r13
ja 0x656a4
incl 0xfc(%rbx)
movq (%r15), %rcx
incl -0x24(%rcx,%r13,4)
cmpb $0x31, 0x2(%rax)
jne 0x656c8
incl (%rbx)
cmpq $0xe, %r13
ja 0x656c0
incl 0xfc(%rbx)
movq (%r15), %rax
incl -0x24(%rax,%r13,4)
addq %rbp, %rsi
movq %r12, %rdi
movl $0x3a, %edx
callq 0x4d650
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x86e0
cmpl 0x4(%rbx), %eax
jge 0x656ee
movl %eax, 0x4(%rbx)
movq %r12, %rdi
callq 0x2e784
incq %r13
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %rbp
cmpq %rax, %r13
jne 0x6568d
addq $0xe0, %rsi
movq %rsp, %rdi
movl $0x3b, %edx
callq 0x4d650
movq (%rsp), %rdi
leaq 0x670a7(%rip), %rsi     # 0xcc7da
callq 0x8160
testl %eax, %eax
je 0x65751
movq (%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl $0x3d, %edx
callq 0x4d650
jmp 0x65768
movq (%rsp), %rsi
addq $0x20, %rsi
leaq 0x40(%rsp), %rdi
movl $0x3d, %edx
callq 0x4d650
movq 0x10(%rsp), %rax
leaq 0x40(%rsp), %r14
movaps (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rsp)
movaps (%rsp), %xmm1
movaps %xmm0, (%rsp)
leaq 0x20(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x2e784
movq %r14, %rdi
callq 0x2e784
movq %rsp, %r14
movq 0x8(%r14), %rax
movq -0x20(%rax), %rdi
callq 0x86e0
movl %eax, 0x8(%rbx)
movq %r14, %rdi
callq 0x2e784
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x657de
movq %rax, %r14
movq %rsp, %rdi
callq 0x2e784
jmp 0x657f2
jmp 0x657ef
jmp 0x657ef
movq %rax, %r14
movq %rbx, %rdi
callq 0x2e6d0
movq %r14, %rdi
callq 0x8840