// File: /workspace/github_cpp_makefile_star2_O1/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)
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
movq %rcx, 0x50(%rdi)
movq %rax, 0x58(%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 0x561e6
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
cmpq $0x120, %rax            # imm = 0x120
je 0x6599e
movl $0x9, %r13d
movl $0x120, %ebp            # imm = 0x120
leaq 0x20(%rsp), %r12
movq (%rsi,%rbp), %rax
cmpb $0x31, (%rax)
jne 0x65936
incl (%rbx)
cmpq $0xe, %r13
ja 0x6592e
incl 0xfc(%rbx)
movq (%r15), %rcx
incl -0x24(%rcx,%r13,4)
cmpb $0x31, 0x2(%rax)
jne 0x65952
incl (%rbx)
cmpq $0xe, %r13
ja 0x6594a
incl 0xfc(%rbx)
movq (%r15), %rax
incl -0x24(%rax,%r13,4)
addq %rbp, %rsi
movq %r12, %rdi
movl $0x3a, %edx
callq 0x50624
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x86e0
cmpl 0x4(%rbx), %eax
jge 0x65978
movl %eax, 0x4(%rbx)
movq %r12, %rdi
callq 0x3123c
incq %r13
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x20, %rbp
cmpq %rax, %r13
jne 0x65917
addq $0xe0, %rsi
leaq 0x8(%rsp), %rdi
movl $0x3b, %edx
callq 0x50624
movq 0x8(%rsp), %rdi
leaq 0x69b62(%rip), %rsi     # 0xcf522
callq 0x8160
testl %eax, %eax
je 0x659df
movq 0x8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl $0x3d, %edx
callq 0x50624
jmp 0x659f7
movq 0x8(%rsp), %rsi
addq $0x20, %rsi
leaq 0x40(%rsp), %rdi
movl $0x3d, %edx
callq 0x50624
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
movups 0x8(%rsp), %xmm0
movq 0x18(%rsp), %rax
leaq 0x40(%rsp), %r14
movups (%r14), %xmm1
movups %xmm1, 0x8(%rsp)
movq 0x10(%r14), %rcx
movq %rcx, 0x18(%rsp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r14)
movq $0x0, 0x10(%r14)
callq 0x3123c
movq %r14, %rdi
callq 0x3123c
leaq 0x8(%rsp), %r14
movq 0x8(%r14), %rax
movq -0x20(%rax), %rdi
callq 0x86e0
movl %eax, 0x8(%rbx)
movq %r14, %rdi
callq 0x3123c
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x65a77
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3123c
jmp 0x65a8d
jmp 0x65a8a
jmp 0x65a8a
movq %rax, %r14
movq %rbx, %rdi
callq 0x31188
movq %r14, %rdi
callq 0x8840