// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movslq %edx, %r10
movq 0x170(%rdi), %rax
movq $0x0, (%rax,%r10,8)
cmpl $0x0, 0x24(%rdi)
jle 0xed23
movq %rdi, %rbx
movslq %esi, %r11
xorl %r15d, %r15d
leaq (%r10,%r10,2), %r12
leaq (%r11,%r11,2), %rbp
leaq (,%r12,8), %rax
movq %rax, 0x8(%rsp)
movq %r12, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
movq %r10, 0x10(%rsp)
movq 0x40(%rbx), %rax
cmpl $0x0, (%rax,%r11,4)
jle 0xecce
movq 0xc0(%rbx), %rax
movq (%rax,%r12,8), %rax
movl (%rax,%r15,4), %esi
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rdi
leaq (%r15,%r15,2), %r8
xorl %r14d, %r14d
movq %r15, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movq (%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%rdi), %rax
movslq (%rax,%r14,4), %r13
testq %r13, %r13
je 0xecba
movq 0xa8(%rbx), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%rdi), %rax
movslq -0x4(%rax,%r13,4), %rax
cmpl $0x270f, %eax           # imm = 0x270F
jg 0xec33
cmpl $0x270f, %esi           # imm = 0x270F
jg 0xec33
leaq 0x33752(%rip), %rcx     # 0x42358
movq (%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
movslq %esi, %rax
leaq 0x33728(%rip), %rcx     # 0x42340
movq (%rcx), %rcx
leaq (%rax,%rax,2), %rax
movq 0x28(%rbx), %rdx
movslq (%rdx,%r15,4), %rdx
movq (%rcx,%rax,8), %rax
subsd -0x8(%rax,%rdx,8), %xmm0
jmp 0xec91
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
movsd 0x70(%rbx), %xmm2
movq 0x28(%rbx), %rax
xorps %xmm3, %xmm3
cvtsi2sdl (%rax,%r15,4), %xmm3
addsd %xmm2, %xmm0
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
divsd %xmm3, %xmm0
movq %r11, %r12
movl %esi, %ebp
movq %r8, %r15
callq 0x3290
movq %r15, %r8
movq 0x28(%rsp), %rdi
movl %ebp, %esi
movq %r12, %r11
movq 0x20(%rsp), %r12
movq 0x10(%rsp), %r10
movq 0x30(%rsp), %r15
movq 0x18(%rsp), %rbp
movq 0x170(%rbx), %rax
addsd (%rax,%r10,8), %xmm0
movsd %xmm0, (%rax,%r10,8)
movq 0xa8(%rbx), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r8,8), %rax
incl -0x4(%rax,%r13,4)
incl %esi
incq %r14
movq 0x40(%rbx), %rax
movslq (%rax,%r11,4), %rcx
cmpq %rcx, %r14
jl 0xebc4
cmpl $0x0, (%rax,%r11,4)
jle 0xed13
movq (%rbx), %rcx
movq (%rcx,%rbp,8), %rdx
leaq (%r15,%r15,2), %rcx
movq (%rdx,%rcx,8), %rdx
movq 0xa8(%rbx), %rsi
addq 0x8(%rsp), %rsi
xorl %edi, %edi
movslq (%rdx,%rdi,4), %r8
testq %r8, %r8
je 0xed07
movq (%rsi), %r9
movq (%r9,%rcx,8), %r9
decl -0x4(%r9,%r8,4)
incq %rdi
movslq (%rax,%r11,4), %r8
cmpq %r8, %rdi
jl 0xecf2
incq %r15
movslq 0x24(%rbx), %rax
cmpq %rax, %r15
jl 0xeb89
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq