// File: /workspace/github_c_makefile_star2_O2/debbiemarkslab[P]plmc/src/inference.c
// Function: PostCondition
lbfgsfloatval_t PostCondition(const lbfgsfloatval_t *x, lbfgsfloatval_t *g, lbfgsfloatval_t fx, alignment_t *ali, options_t *options) {
    if (options->zeroAPC == 1)
        for (int i = 0; i < ali->nSites; i++)
            for (int ai = 0; ai < ali->nCodes; ai++)
                dHi(i, ai) = 0.0;

    /* Group (L1/L2) regularization  */
    if (options->lambdaGroup > 0)
        for (int i = 0; i < ali->nSites - 1; i++)
            for (int j = i + 1; j < ali->nSites; j++) {
                double l2 = REGULARIZATION_GROUP_EPS;
                for (int ai = 0; ai < ali->nCodes; ai++)
                    for (int aj = 0; aj < ali->nCodes; aj++)
                        l2 += xEij(i, j, ai, aj) * xEij(i, j, ai, aj);
                double l1 = sqrt(l2);
                fx += options->lambdaGroup * l1;
                for (int ai = 0; ai < ali->nCodes; ai++)
                    for (int aj = 0; aj < ali->nCodes; aj++)
                        dEij(i, j, ai, aj) += options->lambdaGroup * xEij(i, j, ai, aj) / l1;
            }

    return fx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movapd %xmm0, %xmm3
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x1, 0x58(%rcx)
jne 0x9ec0
movslq 0x4(%r14), %rax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
shlq $0x3, %rax
movq %r15, %rsi
xorl %edi, %edi
cmpq %rdx, %rdi
je 0x9ec0
movl 0x8(%r14), %r8d
testl %r8d, %r8d
cmovlel %ecx, %r8d
movq %rsi, %r9
subq $0x1, %r8
jb 0x9eb7
andq $0x0, (%r9)
addq %rax, %r9
jmp 0x9ea8
incq %rdi
addq $0x8, %rsi
jmp 0x9e95
movsd 0x50(%rbx), %xmm0
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm0
jbe 0xa064
movl 0x4(%r14), %ecx
xorl %ebp, %ebp
pushq $0x1
popq %rsi
movsd 0x257c(%rip), %xmm5     # 0xc460
leal -0x1(%rcx), %eax
cmpl %eax, %ebp
jge 0xa064
leal 0x1(%rbp), %r8d
leal -0x1(%rbp), %eax
imull %ebp, %eax
cltd
pushq $0x2
popq %rdi
idivl %edi
movl %esi, 0xc(%rsp)
addl %esi, %eax
movl %eax, (%rsp)
movl %r8d, 0x8(%rsp)
movl %r8d, %r13d
cmpl %ecx, %r13d
jge 0xa053
movl 0x8(%r14), %esi
imull %esi, %ecx
leal -0x1(%r13), %eax
imull %r13d, %eax
cltd
pushq $0x2
popq %rdi
idivl %edi
xorl %edx, %edx
testl %esi, %esi
movl $0x0, %r9d
cmovgl %esi, %r9d
movl %esi, %edi
imull %edi, %edi
addl %ebp, %eax
movl %edi, %r8d
movl %eax, 0x4(%rsp)
imull %eax, %r8d
movl %r9d, %eax
imull (%rsp), %edi
movapd %xmm5, %xmm0
cmpl %eax, %edx
je 0x9f98
xorl %r9d, %r9d
movl %r8d, %r10d
cmpl %r9d, %esi
je 0x9f8f
leal (%rdi,%r9), %r11d
cmpl %r13d, %ebp
cmovbl %r10d, %r11d
addl %ecx, %r11d
movslq %r11d, %r11
movsd (%r12,%r11,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incl %r9d
addl %esi, %r10d
jmp 0x9f63
incl %edx
incl %r8d
addl %esi, %edi
jmp 0x9f59
ucomisd %xmm4, %xmm0
jb 0x9fa4
sqrtsd %xmm0, %xmm0
jmp 0x9fc1
movsd %xmm3, 0x10(%rsp)
callq 0x1210
movsd 0x24a9(%rip), %xmm5     # 0xc460
xorpd %xmm4, %xmm4
movsd 0x10(%rsp), %xmm3
movl 0x4(%rsp), %r8d
movsd 0x50(%rbx), %xmm1
movl 0x8(%r14), %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
movl %eax, %esi
imull %esi, %esi
imull %esi, %r8d
imull (%rsp), %esi
cmpl %edx, %ecx
je 0xa03c
xorl %edi, %edi
movl %r8d, %r11d
cmpl %edi, %eax
je 0xa030
movl 0x4(%r14), %r9d
imull %eax, %r9d
leal (%rsi,%rdi), %r10d
cmpl %r13d, %ebp
movsd 0x50(%rbx), %xmm2
cmovbl %r8d, %r10d
addl %r9d, %r10d
movslq %r10d, %r9
mulsd (%r12,%r9,8), %xmm2
divsd %xmm0, %xmm2
addsd (%r15,%r9,8), %xmm2
movsd %xmm2, (%r15,%r9,8)
incl %edi
addl %eax, %r8d
jmp 0x9ff1
incl %ecx
movl %r11d, %r8d
incl %r8d
addl %eax, %esi
jmp 0x9fe8
mulsd %xmm0, %xmm1
addsd %xmm1, %xmm3
incl %r13d
movl 0x4(%r14), %ecx
incl (%rsp)
jmp 0x9f10
movl 0xc(%rsp), %esi
incl %esi
movl 0x8(%rsp), %eax
movl %eax, %ebp
jmp 0x9ee4
movapd %xmm3, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop