// File: 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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movl %esi, 0x6c(%rsp)
movl %edx, 0x68(%rsp)
movq 0x70(%rsp), %rdi
movq %rdi, 0x48(%rsp)
addq $0x170, %rdi            # imm = 0x170
movslq 0x68(%rsp), %rsi
callq 0x8c20
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl $0x0, 0x58(%rsp)
movq 0x48(%rsp), %rcx
movl 0x58(%rsp), %eax
cmpl 0x24(%rcx), %eax
jge 0x21071
movq 0x48(%rsp), %rdi
addq $0xc0, %rdi
movslq 0x68(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8ba0
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
movl $0x0, 0x54(%rsp)
movq 0x48(%rsp), %rdi
movl 0x54(%rsp), %eax
movl %eax, 0x44(%rsp)
addq $0x40, %rdi
movslq 0x6c(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x44(%rsp), %eax
cmpl (%rcx), %eax
jge 0x20fa9
movq 0x48(%rsp), %rdi
movslq 0x6c(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x54(%rsp), %rsi
callq 0x8ba0
movq 0x48(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x64(%rsp)
addq $0xa8, %rdi
movslq 0x68(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movl 0x64(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8ba0
movl (%rax), %eax
movl %eax, 0x60(%rsp)
cmpl $0x0, 0x64(%rsp)
je 0x20f97
cmpl $0x2710, 0x60(%rsp)     # imm = 0x2710
jge 0x20ec8
cmpl $0x2710, 0x5c(%rsp)     # imm = 0x2710
jge 0x20ec8
movslq 0x60(%rsp), %rsi
leaq 0x4c5f3(%rip), %rdi     # 0x6d438
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movslq 0x5c(%rsp), %rsi
leaq 0x4c5c0(%rip), %rdi     # 0x6d420
callq 0x8bc0
movq 0x48(%rsp), %rdi
movq %rax, 0x28(%rsp)
addq $0x28, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8ba0
movq 0x28(%rsp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8c20
movsd 0x30(%rsp), %xmm0
movq 0x48(%rsp), %rdi
subsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
addq $0x170, %rdi            # imm = 0x170
movslq 0x68(%rsp), %rsi
callq 0x8c20
movsd 0x38(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x20f50
movq 0x48(%rsp), %rdi
cvtsi2sdl 0x60(%rsp), %xmm0
addsd 0x70(%rdi), %xmm0
movsd %xmm0, 0x18(%rsp)
cvtsi2sdl 0x5c(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0x28, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8ba0
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cvtsi2sdl (%rcx), %xmm1
movsd 0x70(%rax), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x4390
movq 0x48(%rsp), %rdi
movsd %xmm0, 0x20(%rsp)
addq $0x170, %rdi            # imm = 0x170
movslq 0x68(%rsp), %rsi
callq 0x8c20
movsd 0x20(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq 0x48(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x68(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movl 0x64(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8ba0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x20f99
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x20d7e
movl $0x0, 0x50(%rsp)
movq 0x48(%rsp), %rdi
movl 0x50(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0x40, %rdi
movslq 0x6c(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl (%rcx), %eax
jge 0x2105f
movq 0x48(%rsp), %rdi
movslq 0x6c(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x50(%rsp), %rsi
callq 0x8ba0
movl (%rax), %eax
movl %eax, 0x64(%rsp)
cmpl $0x0, 0x64(%rsp)
je 0x2104d
movq 0x48(%rsp), %rdi
addq $0xa8, %rdi
movslq 0x68(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x58(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movl 0x64(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8ba0
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
jmp 0x2104f
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x20fb1
jmp 0x21061
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x20d3b
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)