// File: /workspace/github_cpp_makefile_star2_O3/bobverity[P]MavericK/MCMCobject_noAdmixture.cpp
// Function: MCMCobject_noAdmixture::d_logLikeConditional(int, int)
void MCMCobject_noAdmixture::d_logLikeConditional(int i, int k) {
    
    // calculate conditional probability of data
    logProbVec[k] = 0;
    int d, a, a_t;  // for making temporary copies of data, alleleCounts, and alleleCountsTotals respectively
    for (int l=0; l<loci; l++) {
        a_t = alleleCountsTotals[k][l];
        for (int p=0; p<ploidy_vec[i]; p++) {
            d = data[i][l][p];
            a = alleleCounts[k][l][d-1];
            if (d!=0) {
                if ((a<int(1e4)) && (a_t<int(1e4))) {
                    logProbVec[k] += log_lookup_0[a]-log_lookup[a_t][J[l]-1];
                } else {
                    logProbVec[k] += log((a + lambda)/double(a_t + J[l]*lambda));
                }
                alleleCounts[k][l][d-1] ++;
                a_t ++;
            }
        }
        for (int p=0; p<ploidy_vec[i]; p++) {
            d = data[i][l][p];
            if (d!=0) {
                alleleCounts[k][l][d-1] --;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq %edx, %r11
movq 0x170(%rdi), %rax
movq $0x0, (%rax,%r11,8)
cmpl $0x0, 0x24(%rdi)
jle 0xe8d0
movslq %esi, %r12
movq 0x40(%rdi), %rcx
movl (%rcx,%r12,4), %esi
xorl %r14d, %r14d
leaq (%r11,%r11,2), %rbp
leaq (%r12,%r12,2), %r10
movq %r10, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
testl %esi, %esi
jle 0xe8c0
movq 0xa8(%rdi), %rdx
movq 0xc0(%rdi), %rsi
movq (%rsi,%rbp,8), %rsi
movl (%rsi,%r14,4), %ebx
leaq (,%r14,8), %rsi
leaq (%rsi,%rsi,2), %r8
xorl %r13d, %r13d
movq %r8, 0x20(%rsp)
movq (%rdi), %rsi
movq (%rsi,%r10,8), %rsi
movq (%rsi,%r8), %rsi
movslq (%rsi,%r13,4), %r15
testq %r15, %r15
je 0xe862
movq (%rdx,%rbp,8), %rsi
movq (%rsi,%r8), %rsi
movslq -0x4(%rsi,%r15,4), %rsi
cmpl $0x270f, %esi           # imm = 0x270F
jg 0xe7cd
cmpl $0x270f, %ebx           # imm = 0x270F
jg 0xe7cd
leaq 0x32bc6(%rip), %r8      # 0x41358
movq (%r8), %r8
movsd (%r8,%rsi,8), %xmm0
movslq %ebx, %rsi
leaq 0x32b9b(%rip), %r8      # 0x41340
movq (%r8), %r9
leaq (%rsi,%rsi,2), %rsi
movq 0x28(%rdi), %r8
movslq (%r8,%r14,4), %r8
movq (%r9,%rsi,8), %rsi
subsd -0x8(%rsi,%r8,8), %xmm0
addsd (%rax,%r11,8), %xmm0
movsd %xmm0, (%rax,%r11,8)
jmp 0xe84a
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
movsd 0x70(%rdi), %xmm2
movq 0x28(%rdi), %rax
xorps %xmm3, %xmm3
cvtsi2sdl (%rax,%r14,4), %xmm3
addsd %xmm2, %xmm0
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
divsd %xmm3, %xmm0
movq %rdi, %rbp
movl %ebx, 0xc(%rsp)
movq %r14, %rbx
movq %r12, %r14
movq %r11, %r12
callq 0x3290
movq 0x10(%rsp), %r10
movq %r12, %r11
movq %r14, %r12
movq %rbx, %r14
movl 0xc(%rsp), %ebx
movq %rbp, %rdi
movq 0x18(%rsp), %rbp
movq 0x170(%rdi), %rax
addsd (%rax,%r11,8), %xmm0
movsd %xmm0, (%rax,%r11,8)
movq 0x40(%rdi), %rcx
movq 0xa8(%rdi), %rdx
movq (%rdx,%rbp,8), %rsi
leaq (%r14,%r14,2), %r8
movq (%rsi,%r8,8), %rsi
incl -0x4(%rsi,%r15,4)
incl %ebx
movq 0x20(%rsp), %r8
incq %r13
movslq (%rcx,%r12,4), %rsi
cmpq %rsi, %r13
jl 0xe756
testl %esi, %esi
jle 0xe8c0
movq (%rdi), %rdx
movq (%rdx,%r10,8), %r8
leaq (%r14,%r14,2), %rdx
movq (%r8,%rdx,8), %rbx
leaq (,%rbp,8), %r8
addq 0xa8(%rdi), %r8
xorl %r9d, %r9d
movslq (%rbx,%r9,4), %r10
testq %r10, %r10
je 0xe8b0
movq (%r8), %rsi
movq (%rsi,%rdx,8), %rsi
decl -0x4(%rsi,%r10,4)
movl (%rcx,%r12,4), %esi
incq %r9
movslq %esi, %r10
cmpq %r10, %r9
jl 0xe897
movq 0x10(%rsp), %r10
incq %r14
movslq 0x24(%rdi), %rdx
cmpq %rdx, %r14
jl 0xe724
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop