// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdi, %rbx
movslq %edx, %r10
movq 0x170(%rdi), %rax
andq $0x0, (%rax,%r10,8)
movslq %esi, %r11
xorl %r15d, %r15d
imulq $0x18, %r10, %r12
imulq $0x18, %r11, %rbp
movq %r12, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
movslq 0x24(%rbx), %rcx
cmpq %rcx, %r15
jge 0xc685
movq 0xc0(%rbx), %rcx
movq (%rcx,%r12), %rcx
movl (%rcx,%r15,4), %r8d
imulq $0x18, %r15, %rdi
xorl %r14d, %r14d
movq %rdi, 0x10(%rsp)
movq 0x40(%rbx), %rcx
movslq (%rcx,%r11,4), %rdx
cmpq %rdx, %r14
jge 0xc638
movq (%rbx), %rcx
movq (%rcx,%rbp), %rcx
movq (%rcx,%rdi), %rcx
movslq (%rcx,%r14,4), %r13
testq %r13, %r13
je 0xc630
movq 0xa8(%rbx), %rcx
movq (%rcx,%r12), %rcx
movq (%rcx,%rdi), %rcx
movslq -0x4(%rcx,%r13,4), %rcx
cmpl $0x270f, %ecx           # imm = 0x270F
jg 0xc5ae
cmpl $0x270f, %r8d           # imm = 0x270F
jg 0xc5ae
leaq 0x27dd7(%rip), %rdx     # 0x34358
movq (%rdx), %rdx
movsd (%rdx,%rcx,8), %xmm0
movslq %r8d, %rcx
leaq 0x27dad(%rip), %rdx     # 0x34340
movq (%rdx), %rdx
imulq $0x18, %rcx, %rcx
movq 0x28(%rbx), %rsi
movslq (%rsi,%r15,4), %rsi
movq (%rdx,%rcx), %rcx
subsd -0x8(%rcx,%rsi,8), %xmm0
jmp 0xc60d
cvtsi2sd %ecx, %xmm0
cvtsi2sd %r8d, %xmm1
movsd 0x70(%rbx), %xmm2
movq 0x28(%rbx), %rax
cvtsi2sdl (%rax,%r15,4), %xmm3
addsd %xmm2, %xmm0
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
divsd %xmm3, %xmm0
movq %r15, %r12
movq %r10, %r15
movq %r11, %rbp
movl %r8d, 0xc(%rsp)
callq 0x32d0
movl 0xc(%rsp), %r8d
movq 0x10(%rsp), %rdi
movq %rbp, %r11
movq 0x18(%rsp), %rbp
movq %r15, %r10
movq %r12, %r15
movq 0x20(%rsp), %r12
movq 0x170(%rbx), %rax
addsd (%rax,%r10,8), %xmm0
movsd %xmm0, (%rax,%r10,8)
movq 0xa8(%rbx), %rcx
movq (%rcx,%r12), %rcx
movq (%rcx,%rdi), %rcx
incl -0x4(%rcx,%r13,4)
incl %r8d
incq %r14
jmp 0xc52c
movq (%rbx), %rsi
addq %rbp, %rsi
movq 0xa8(%rbx), %rdi
addq %r12, %rdi
xorl %r8d, %r8d
movslq %edx, %r9
cmpq %r9, %r8
jge 0xc67d
movq (%rsi), %r9
movq 0x10(%rsp), %r14
movq (%r9,%r14), %r9
movslq (%r9,%r8,4), %r9
testq %r9, %r9
je 0xc678
movq (%rdi), %rdx
movq (%rdx,%r14), %rdx
decl -0x4(%rdx,%r9,4)
movl (%rcx,%r11,4), %edx
incq %r8
jmp 0xc64b
incq %r15
jmp 0xc504
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq