// File: millanek[P]evo/process_vcf_utils.cpp
// Function: massokoMalawiSharing(FilterResult const&, MassokoMalawiResult&)
void massokoMalawiSharing(const FilterResult& result, MassokoMalawiResult& sharingResult) {
    if (result.counts.individualsWithVariant[0] == 2 || result.counts.individualsWithVariant[1] == 2 ) {
        for (std::vector<int>::size_type i = 0; i < sharingResult.hetsWithBlue.size(); i++) {
            //std::cerr << ": " << std::endl;
            if (result.counts.individualsWithVariant[i+12] == 0) {
                sharingResult.absentWithBlue[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 1) {
                sharingResult.hetsWithBlue[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 2) {
                sharingResult.homsWithBlue[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 2) {
                sharingResult.absentWithYellow[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 1) {
                sharingResult.hetsWithYellow[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 0) {
                sharingResult.homsWithYellow[i]++;
            }
        }
    } else if (result.counts.individualsWithVariant[6] == 2 || result.counts.individualsWithVariant[7] == 2) {
        for (std::vector<int>::size_type i = 0; i < sharingResult.hetsWithYellow.size(); i++) {
            if (result.counts.individualsWithVariant[i+12] == 0) {
                sharingResult.absentWithYellow[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 1) {
                sharingResult.hetsWithYellow[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 2) {
                sharingResult.homsWithYellow[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 2) {
                sharingResult.absentWithBlue[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 1) {
                sharingResult.hetsWithBlue[i]++;
            }
            if (result.counts.individualsWithVariant[i+12] == 0) {
                sharingResult.homsWithBlue[i]++;
            }
        }
    } else {
        std::cerr << "There is a variant that does not appear fixed in Massoko: " << std::endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x48250
cmpl $0x2, (%rax)
je 0x80729
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movl $0x1, %esi
callq 0x48250
cmpl $0x2, (%rax)
jne 0x808ae
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x467f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x808a9
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x0, (%rax)
jne 0x80788
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x1, (%rax)
jne 0x807be
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x2, (%rax)
jne 0x807f4
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x2, (%rax)
jne 0x8082a
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x1, (%rax)
jne 0x80860
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x0, (%rax)
jne 0x80896
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x80898
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x80731
jmp 0x80a8e
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movl $0x6, %esi
callq 0x48250
cmpl $0x2, (%rax)
je 0x808e8
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movl $0x7, %esi
callq 0x48250
cmpl $0x2, (%rax)
jne 0x80a6a
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
callq 0x467f0
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0x80a68
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x0, (%rax)
jne 0x8094b
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
movq -0x20(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x1, (%rax)
jne 0x80981
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x20(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x2, (%rax)
jne 0x809b7
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
movq -0x20(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x2, (%rax)
jne 0x809e9
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x1, (%rax)
jne 0x80a1f
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x20(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0x70, %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x48250
cmpl $0x0, (%rax)
jne 0x80a55
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x20(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x80a57
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x808f0
jmp 0x80a8c
movq 0x11857f(%rip), %rdi    # 0x198ff0
leaq 0xba8d1(%rip), %rsi     # 0x13b349
callq 0xa5c0
movq %rax, %rdi
movq 0x118501(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x80a8e
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)