// File: millanek[P]evo/process_vcf_utils.cpp
// Function: GeneralSetCounts::probabilitiesFromLikelihoods(std::vector<double, std::allocator<double>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::vector<double> GeneralSetCounts::probabilitiesFromLikelihoods(const std::vector<double>& thisLikelihoods, const string& species) {
    std::vector<double> thisProbabilities; thisProbabilities.assign(3, 0.0);
    double multiple0 = thisLikelihoods[0]*setHWEpriorsFromAAFfromGT[species][0];
    double multiple1 = thisLikelihoods[1]*setHWEpriorsFromAAFfromGT[species][1];
    double multiple2 = thisLikelihoods[2]*setHWEpriorsFromAAFfromGT[species][2];
    double sum = multiple0 + multiple1 + multiple2;
    
    thisProbabilities[0] = multiple0/sum;
    thisProbabilities[1] = multiple1/sum;
    thisProbabilities[2] = multiple2/sum;
    
    return thisProbabilities;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movb $0x0, -0x21(%rbp)
callq 0x48410
movq -0x68(%rbp), %rdi
movq $0x0, -0x30(%rbp)
movl $0x3, %esi
leaq -0x30(%rbp), %rdx
callq 0x84350
jmp 0x82153
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x84300
movq -0x70(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x88(%rbp)
addq $0x1e0, %rdi            # imm = 0x1E0
movq -0x20(%rbp), %rsi
callq 0x84380
movq %rax, -0x80(%rbp)
jmp 0x82186
movq -0x80(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3ec30
movsd -0x88(%rbp), %xmm0
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x84300
movq -0x70(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
addq $0x1e0, %rdi            # imm = 0x1E0
movq -0x20(%rbp), %rsi
callq 0x84380
movq %rax, -0x90(%rbp)
jmp 0x821df
movq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0x3ec30
movsd -0x98(%rbp), %xmm0
movsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x84300
movq -0x70(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
addq $0x1e0, %rdi            # imm = 0x1E0
movq -0x20(%rbp), %rsi
callq 0x84380
movq %rax, -0xa0(%rbp)
jmp 0x8223c
movq -0xa0(%rbp), %rdi
movl $0x2, %esi
callq 0x3ec30
movsd -0xa8(%rbp), %xmm0
movq -0x68(%rbp), %rdi
mulsd (%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x48(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x48(%rbp), %xmm0
divsd -0x60(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3ec30
movsd -0xc0(%rbp), %xmm0
movq -0x68(%rbp), %rdi
movsd %xmm0, (%rax)
movsd -0x50(%rbp), %xmm0
divsd -0x60(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movl $0x1, %esi
callq 0x3ec30
movsd -0xb8(%rbp), %xmm0
movq -0x68(%rbp), %rdi
movsd %xmm0, (%rax)
movsd -0x58(%rbp), %xmm0
divsd -0x60(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movl $0x2, %esi
callq 0x3ec30
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, (%rax)
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x82321
jmp 0x82318
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x3ecb0
jmp 0x8232e
movq -0x68(%rbp), %rdi
callq 0x3ecb0
movq -0x78(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xab50
nopw (%rax,%rax)