// File: /workspace/github_c_makefile_star2_O3/debbiemarkslab[P]plmc/src/inference.c
// Function: PLMNegLogPosteriorBlock
static lbfgsfloatval_t PLMNegLogPosteriorBlock(void *instance,
    const lbfgsfloatval_t *x, lbfgsfloatval_t *g, const int n,
    const lbfgsfloatval_t step) {
    /* Compute the the negative log posterior, which is the negative 
       penalized log-(pseudo)likelihood and the objective for MAP inference
    */
    void **d = (void **)instance;
    alignment_t *ali = (alignment_t *) d[0];
    options_t *options = (options_t *) d[1];
    numeric_t *lambdas = (numeric_t *) d[2];

    /* Initialize log-likelihood and gradient */
    lbfgsfloatval_t fx = 0.0;
    for (int i = 0; i < ali->nParams; i++) g[i] = 0;

    /* Block fields hi */
    numeric_t *hi = (numeric_t *)
        malloc(ali->nSites * ali->nCodes * sizeof(numeric_t));
    numeric_t *gHi = (numeric_t *)
        malloc(ali->nSites * ali->nCodes * sizeof(numeric_t));
    for (int i = 0; i < ali->nSites; i++)
        for (int ai = 0; ai < ali->nCodes; ai++) Hi(i, ai) = xHi(i, ai);
    for (int i = 0; i < ali->nSites * ali->nCodes; i++) gHi[i] = 0;

    /* Block couplings eij */
    numeric_t *eij = (numeric_t *) malloc(ali->nSites * ali->nSites
        * ali->nCodes * ali->nCodes * sizeof(numeric_t));
    numeric_t *gEij = (numeric_t *) malloc(ali->nSites * ali->nSites
        * ali->nCodes * ali->nCodes * sizeof(numeric_t));
    for (int i = 0; i < ali->nSites * ali->nSites * ali->nCodes * ali->nCodes;
        i++) eij[i] = 0.0;
    for (int i = 0; i < ali->nSites * ali->nSites * ali->nCodes * ali->nCodes;
        i++) gEij[i] = 0.0;
    for (int i = 0; i < ali->nSites - 1; i++)
        for (int j = i + 1; j < ali->nSites; j++)
            for (int ai = 0; ai < ali->nCodes; ai++)
                for (int aj = 0; aj < ali->nCodes; aj++)
                    Eij(j, aj, i, ai) = Eij(i, ai, j, aj) = xEij(i, j, ai, aj);


    /* Negative log-pseudolikelihood */
    for (int s = 0; s < ali->nSeqs; s++) {
        /* Form potential for conditional log likelihoods at every site */
        numeric_t *H = (numeric_t *)
            malloc(ali->nCodes * ali->nSites * sizeof(numeric_t));
        numeric_t *Z = (numeric_t *) malloc(ali->nSites * sizeof(numeric_t));

        /* Initialize potentials with fields */
        // memcpy(H, hi, ali->nSites * ali->nCodes * sizeof(numeric_t));
        for(int jx = 0; jx < ali->nSites * ali->nCodes; jx++) H[jx] = hi[jx];

        /* Contribute coupling block due to i, ai */
        for (int i = 0; i < ali->nSites; i++) {
            const letter_t ai = seq(s, i);
            const numeric_t *jB = &(Eij(i, ai, 0, 0));
            for(int jx = 0; jx < ali->nSites * ali->nCodes; jx++)
                H[jx] += jB[jx];
        }

        /* Conditional log likelihoods */
        for (int i = 0; i < ali->nSites * ali->nCodes; i++) H[i] = exp(H[i]);
        for (int i = 0; i < ali->nSites; i++) Z[i] = 0;
        for (int i = 0; i < ali->nSites; i++)
            for (int ai = 0; ai < ali->nSites; ai++) Z[i] += Hp(i, ai);
        for (int i = 0; i < ali->nSites; i++)
            for (int ai = 0; ai < ali->nSites; ai++) Hp(i, ai) /= Z[i];

        numeric_t seqFx = 0;
        for (int i = 0; i < ali->nSites; i++)
            seqFx -= ali->weights[s] * log(Hp(i, seq(s, i)));

        for(int jx = 0; jx < ali->nSites * ali->nCodes; jx++)
            H[jx] *= -ali->weights[s];

        for (int i = 0; i < ali->nSites; i++)
            gHi(i, seq(s, i)) -= ali->weights[s];
        for(int jx = 0; jx < ali->nSites * ali->nCodes; jx++) gHi[jx] -= H[jx];

        for (int i = 0; i < ali->nSites - 1; i++)
            for (int j = i; j < ali->nSites; j++)
                gEij(i, seq(s, i), j, seq(s, j)) -= ali->weights[s];

        for (int i = 0; i < ali->nSites; i++) {
            const letter_t ai = seq(s, i);
            numeric_t *jgBlock = &(gEij(i, ai, 0, 0));
            for (int jx = 0; jx < ali->nSites * ali->nCodes; jx++)
                jgBlock[jx] -= H[jx];
        }

        free(H);
        free(Z);
        fx += seqFx;
    }

    for (int i = 0; i < ali->nSites; i++)
        for (int ai = 0; ai < ali->nCodes; ai++)
            dHi(i, ai) += gHi(i, ai);

    for (int i = 0; i < ali->nSites - 1; i++)
        for (int j = i + 1; j < ali->nSites; j++)
            for (int ai = 0; ai < ali->nCodes; ai++)
                for (int aj = 0; aj < ali->nCodes; aj++)
                    dEij(i, j, ai, aj) += gEij(j, aj, i, ai) + gEij(i, ai, j, aj);
    free(hi);
    free(gHi);
    free(eij);
    free(gEij);

    ali->negLogLk = fx;

    /* Gaussian priors */
    for (int i = 0; i < ali->nSites; i++)
        for (int ai = 0; ai < ali->nCodes; ai++) {
            dHi(i, ai) += lambdaHi(i) * 2.0 * xHi(i, ai);
            fx += lambdaHi(i) * xHi(i, ai) * xHi(i, ai);
        }

    for (int i = 0; i < ali->nSites-1; i++)
        for (int j = i + 1; j < ali->nSites; j++)
            for (int ai = 0; ai < ali->nCodes; ai++)
                for (int aj = 0; aj < ali->nCodes; aj++) {
                    dEij(i, j, ai, aj) += lambdaEij(i, j)
                        * 2.0 * xEij(i, j, ai, aj);
                    fx += lambdaEij(i, j)
                        * xEij(i, j, ai, aj) * xEij(i, j, ai, aj);
                }

    fx = PostCondition(x, g, fx, ali, options);
    return fx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, 0x58(%rsp)
movq %rsi, %r13
movq (%rdi), %rbx
movq 0x8(%rdi), %rax
movq %rax, 0xc0(%rsp)
movq 0x10(%rdi), %rax
movq %rax, 0xb0(%rsp)
movslq 0x68(%rbx), %rdx
testq %rdx, %rdx
jle 0x93e3
shlq $0x3, %rdx
movq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x1110
movslq 0x4(%rbx), %r14
movl 0x8(%rbx), %ecx
movq %rcx, 0x8(%rsp)
movl %ecx, %r15d
imull %r14d, %r15d
movslq %r15d, %r12
shlq $0x3, %r12
movq %r12, %rdi
callq 0x11b0
movq %rax, 0xb8(%rsp)
movq %r12, %rdi
callq 0x11b0
movq %r14, %r10
movq %rax, %r14
testq %r10, %r10
jle 0x9477
movq 0x8(%rsp), %rax
leaq (,%rax,8), %rax
leaq (,%r10,8), %rcx
xorl %edx, %edx
movq %r13, %rsi
movq 0xb8(%rsp), %rdi
movq 0x8(%rsp), %r11
testl %r11d, %r11d
jle 0x9468
movq %rsi, %r8
xorl %r9d, %r9d
movsd (%r8), %xmm0
movsd %xmm0, (%rdi,%r9,8)
incq %r9
addq %rcx, %r8
cmpq %r9, %r11
jne 0x9452
incq %rdx
addq %rax, %rdi
addq $0x8, %rsi
cmpq %r10, %rdx
jne 0x9447
movq %r10, 0x18(%rsp)
movq %rbx, 0x70(%rsp)
testl %r15d, %r15d
jle 0x9497
movl %r15d, %edx
shlq $0x3, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1110
movq %r14, 0x68(%rsp)
movl %r15d, %ebx
imull %r15d, %ebx
movslq %ebx, %r14
leaq (,%r14,8), %rbp
movq %rbp, %rdi
callq 0x11b0
movq %rax, %r12
movq %rbp, %rdi
callq 0x11b0
movq %rax, %rbp
testl %r14d, %r14d
jle 0x94e9
movl %ebx, %ebx
shlq $0x3, %rbx
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1110
movq %rbp, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1110
movq %rbp, 0x48(%rsp)
movq %r12, 0x88(%rsp)
movq 0x18(%rsp), %r10
cmpl $0x2, %r10d
jl 0x96b9
movq 0x8(%rsp), %rcx
movslq %ecx, %rax
leal -0x1(%r10), %edx
movq %rdx, 0x80(%rsp)
leaq (,%rax,8), %rdx
movq %rdx, 0x38(%rsp)
movq 0x88(%rsp), %rdx
leaq (%rdx,%rax,8), %rsi
movq %rax, %rdi
imulq %r10, %rdi
leaq 0x1(%rdi), %r8
imulq %rax, %r8
shlq $0x3, %r8
movq %r8, 0x78(%rsp)
leaq (,%rdi,8), %r8
imull %ecx, %ecx
movq %rcx, 0x30(%rsp)
imulq %rax, %rdi
leaq (%rdx,%rdi,8), %rdx
shlq $0x3, %rdi
movq %rdi, 0x50(%rsp)
movl $0x1, %r11d
xorl %eax, %eax
movq 0x8(%rsp), %r12
leaq 0x1(%rax), %rcx
movq %rcx, 0x40(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addl %eax, %ecx
imull %eax, %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %ecx, %edi
sarl %edi
addl %r11d, %edi
imull 0x30(%rsp), %edi
movq %rdi, 0x28(%rsp)
movq %rdx, 0x90(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x98(%rsp)
movq %rsi, 0x10(%rsp)
movq %r11, 0xa8(%rsp)
cmpl $0x0, 0x8(%rsp)
jle 0x9642
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leal (%r11,%rcx), %edx
imull %r11d, %edx
movl %edx, %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
sarl %ecx
addl %eax, %ecx
imull 0x30(%rsp), %ecx
movq 0x20(%rsp), %r10
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rdx
xorl %r9d, %r9d
movl %ecx, %ebp
movq %r10, %r14
xorl %esi, %esi
leal (%rdi,%rsi), %ebx
cmpq %r11, %rax
cmovbl %ebp, %ebx
addl %r15d, %ebx
movslq %ebx, %rbx
movsd (%r13,%rbx,8), %xmm0
movsd %xmm0, (%rdx,%rsi,8)
movsd %xmm0, (%r14)
incq %rsi
addq %r8, %r14
addl %r12d, %ebp
cmpq %rsi, %r12
jne 0x9600
incq %r9
addq %r8, %rdx
addq %r12, %rdi
addq $0x8, %r10
incl %ecx
cmpq %r12, %r9
jne 0x95f9
incq %r11
movq 0x10(%rsp), %rcx
addq 0x38(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rcx
addq 0x30(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq 0x20(%rsp), %rcx
addq 0x50(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movq 0x18(%rsp), %r10
cmpq %r10, %r11
jne 0x95c3
movq 0xa8(%rsp), %r11
incq %r11
movq 0x98(%rsp), %rsi
movq 0x78(%rsp), %rax
addq %rax, %rsi
movq 0x90(%rsp), %rdx
addq %rax, %rdx
movq 0x40(%rsp), %rax
cmpq 0x80(%rsp), %rax
jne 0x9578
movq 0x70(%rsp), %rbx
cmpl $0x0, (%rbx)
jle 0x9b4b
xorpd %xmm1, %xmm1
movq $0x0, 0x38(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movsd %xmm1, 0x40(%rsp)
movl %r10d, %r14d
movq %rax, 0x8(%rsp)
imull %eax, %r14d
movslq %r14d, %rbx
leaq (,%rbx,8), %rdi
movq %r10, %rbp
callq 0x11b0
movq %rax, %r15
movq %rbp, 0x18(%rsp)
movslq %ebp, %rdi
shlq $0x3, %rdi
callq 0x11b0
movq %rax, 0x30(%rsp)
movl %r14d, %ebp
testl %ebx, %ebx
jle 0x973f
leaq (,%rbp,8), %rdx
movq %r15, %rdi
movq 0xb8(%rsp), %rsi
callq 0x11a0
movq 0x18(%rsp), %r9
testl %r9d, %r9d
movq 0x70(%rsp), %rbx
movq 0x88(%rsp), %r10
jle 0x97ac
movl %r9d, %eax
movq 0x10(%rsp), %rcx
imulq %rax, %rcx
shlq $0x2, %rcx
addq 0x20(%rbx), %rcx
xorl %edx, %edx
xorl %esi, %esi
testl %r14d, %r14d
jle 0x97a0
movl (%rcx,%rsi,4), %edi
addl %edx, %edi
imull %r14d, %edi
movslq %edi, %rdi
leaq (%r10,%rdi,8), %rdi
xorl %r8d, %r8d
movsd (%rdi,%r8,8), %xmm0
addsd (%r15,%r8,8), %xmm0
movsd %xmm0, (%r15,%r8,8)
incq %r8
cmpq %r8, %rbp
jne 0x9786
incq %rsi
addl 0x8(%rsp), %edx
cmpq %rax, %rsi
jne 0x976e
testl %r14d, %r14d
movq 0x8(%rsp), %rcx
jle 0x97e1
xorl %r14d, %r14d
movsd (%r15,%r14,8), %xmm0
callq 0x1240
movsd %xmm0, (%r15,%r14,8)
incq %r14
movl 0x4(%rbx), %r9d
movl 0x8(%rbx), %ecx
movl %ecx, %eax
imull %r9d, %eax
cltq
cmpq %rax, %r14
jl 0x97b9
xorpd %xmm2, %xmm2
testl %r9d, %r9d
jle 0x98fb
movq %r9, 0x18(%rsp)
movl %r9d, %r14d
leaq (,%r14,8), %rdx
movq 0x30(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
movq %rcx, %r12
callq 0x1110
movq %rbp, %r8
movq %r12, %rdi
movslq %r12d, %rax
shlq $0x3, %rax
movq %r15, %rcx
xorl %edx, %edx
movsd (%r8,%rdx,8), %xmm0
xorl %esi, %esi
addsd (%rcx,%rsi,8), %xmm0
incq %rsi
cmpq %rsi, %r14
jne 0x982a
movsd %xmm0, (%r8,%rdx,8)
incq %rdx
addq %rax, %rcx
cmpq %r14, %rdx
jne 0x9822
movq 0x18(%rsp), %r9
testl %r9d, %r9d
movq 0x68(%rsp), %r12
jle 0x9907
movq %r15, %rcx
xorl %edx, %edx
movq 0x10(%rsp), %rbp
movsd (%r8,%rdx,8), %xmm0
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %r14
jne 0x986d
incq %rdx
addq %rax, %rcx
cmpq %r14, %rdx
jne 0x9865
testl %r9d, %r9d
xorpd %xmm2, %xmm2
jle 0x9915
xorl %r14d, %r14d
movsd %xmm2, 0x28(%rsp)
movq 0x20(%rbx), %rax
movq 0x50(%rbx), %rcx
movsd (%rcx,%rbp,8), %xmm0
movsd %xmm0, 0x20(%rsp)
imull %ebp, %r9d
movslq %r9d, %rcx
addq %r14, %rcx
movslq (%rax,%rcx,4), %rax
movslq 0x8(%rbx), %rcx
movslq %r14d, %rdx
imulq %rcx, %rdx
addq %rax, %rdx
movsd (%r15,%rdx,8), %xmm0
callq 0x1130
movsd 0x28(%rsp), %xmm2
mulsd 0x20(%rsp), %xmm0
subsd %xmm0, %xmm2
movl 0x4(%rbx), %r9d
incq %r14
cmpl %r9d, %r14d
jl 0x989a
movl 0x8(%rbx), %ecx
jmp 0x9918
movq 0x68(%rsp), %r12
movq 0x10(%rsp), %rbp
jmp 0x9918
movq %rdi, %rcx
movq 0x10(%rsp), %rbp
xorpd %xmm2, %xmm2
jmp 0x9918
movq %rdi, %rcx
movq %rcx, 0x8(%rsp)
movl %ecx, %eax
imull %r9d, %eax
movl %eax, %ecx
testl %eax, %eax
jle 0x9954
movq 0x50(%rbx), %rdx
movsd (%rdx,%rbp,8), %xmm0
xorpd 0x3776(%rip), %xmm0     # 0xd0b0
xorl %edx, %edx
movsd (%r15,%rdx,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%r15,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x993c
movl %r9d, %edx
movslq 0x8(%rsp), %rsi
movq %r9, 0x18(%rsp)
testl %r9d, %r9d
jle 0x99aa
movq 0x50(%rbx), %r8
movq 0x38(%rsp), %rdi
imulq %rdx, %rdi
addq 0x20(%rbx), %rdi
movsd (%r8,%rbp,8), %xmm0
leaq (,%rsi,8), %r8
movq %r12, %r9
xorl %r10d, %r10d
movslq (%rdi,%r10,4), %r11
movsd (%r9,%r11,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r9,%r11,8)
incq %r10
addq %r8, %r9
cmpq %r10, %rdx
jne 0x998b
movl %eax, 0x20(%rsp)
testl %eax, %eax
jle 0x99ce
xorl %edi, %edi
movsd (%r12,%rdi,8), %xmm0
subsd (%r15,%rdi,8), %xmm0
movsd %xmm0, (%r12,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0x99b4
cmpl $0x2, 0x18(%rsp)
jl 0x9a8b
movq 0x18(%rsp), %rax
leal -0x1(%rax), %edi
movq 0x10(%rsp), %rax
imulq %rdx, %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %r9
imulq %rdx, %r9
shlq $0x3, %rsi
xorl %r10d, %r10d
movq %rdx, %r11
xorl %r14d, %r14d
cmpq %rdx, %r14
jae 0x9a73
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rbp
movq 0x50(%rax), %r8
movq 0x10(%rsp), %rax
movsd (%r8,%rax,8), %xmm0
leaq (,%r14,4), %r8
addq %rbp, %r8
addq %r9, %rbp
movq 0x28(%rsp), %rax
movl (%r8,%rax,4), %r8d
addl %r10d, %r8d
imull 0x18(%rsp), %r8d
movslq %r8d, %r8
addq %r14, %r8
imulq %rsi, %r8
addq 0x48(%rsp), %r8
xorl %ebx, %ebx
movslq (%rbp,%rbx,4), %rax
movsd (%r8,%rax,8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r8,%rax,8)
incq %rbx
addq %rsi, %r8
cmpq %rbx, %r11
jne 0x9a53
incq %r14
addq $0x4, %r9
addl 0x8(%rsp), %r10d
decq %r11
cmpq %rdi, %r14
jne 0x9a05
movsd %xmm2, 0x28(%rsp)
cmpl $0x0, 0x18(%rsp)
movq 0x70(%rsp), %rbx
movq 0x48(%rsp), %rbp
movl 0x20(%rsp), %r11d
jle 0x9b02
movq 0x10(%rsp), %rsi
imulq %rdx, %rsi
shlq $0x2, %rsi
addq 0x20(%rbx), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
testl %r11d, %r11d
jle 0x9af6
movl (%rsi,%r8,4), %eax
addl %edi, %eax
imull %r11d, %eax
cltq
leaq (,%rax,8), %r9
addq %rbp, %r9
xorl %r10d, %r10d
movsd (%r9,%r10,8), %xmm0
subsd (%r15,%r10,8), %xmm0
movsd %xmm0, (%r9,%r10,8)
incq %r10
cmpq %r10, %rcx
jne 0x9adc
incq %r8
addl 0x8(%rsp), %edi
cmpq %rdx, %r8
jne 0x9abd
movq %r15, %rdi
callq 0x1050
movq 0x30(%rsp), %rdi
callq 0x1050
movsd 0x40(%rsp), %xmm1
addsd 0x28(%rsp), %xmm1
movq 0x10(%rsp), %rdx
incq %rdx
movslq (%rbx), %rax
addq $0x4, 0x38(%rsp)
movq %rdx, 0x10(%rsp)
cmpq %rax, %rdx
movq 0x18(%rsp), %r10
movq 0x8(%rsp), %rax
jl 0x96e2
jmp 0x9b5e
xorpd %xmm1, %xmm1
movq 0x8(%rsp), %rax
movq 0x68(%rsp), %r12
movq 0x48(%rsp), %rbp
movl %r10d, %r15d
movq %rax, 0x8(%rsp)
movl %eax, %eax
testl %r10d, %r10d
movq %r10, 0x18(%rsp)
movq %r15, 0xa8(%rsp)
movq %rax, 0x20(%rsp)
movsd %xmm1, 0x40(%rsp)
jle 0x9e04
leaq (,%rax,8), %rax
leaq (,%r15,8), %rcx
xorl %edx, %edx
movq 0x58(%rsp), %rsi
movq %r12, %rdi
movq 0x20(%rsp), %r11
cmpl $0x0, 0x8(%rsp)
jle 0x9bd0
movq %rsi, %r8
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
addsd (%r8), %xmm0
movsd %xmm0, (%r8)
incq %r9
addq %rcx, %r8
cmpq %r9, %r11
jne 0x9bb5
incq %rdx
addq %rax, %rdi
addq $0x8, %rsi
cmpq %r15, %rdx
jne 0x9ba8
leal -0x1(%r10), %eax
cmpl $0x1, %r10d
setne %cl
movl %eax, 0xa4(%rsp)
je 0x9e0f
movl %ecx, 0x64(%rsp)
movl %eax, %eax
movq %rax, 0xd0(%rsp)
movq 0x8(%rsp), %rdx
movslq %edx, %rax
movl %edx, %ecx
imull %r10d, %ecx
leaq (,%rax,8), %rsi
movq %rsi, 0x98(%rsp)
leaq (,%rax,8), %rsi
addq %rbp, %rsi
movq %rax, %rdi
imulq %r15, %rdi
leaq 0x1(%rdi), %r8
imulq %rax, %r8
shlq $0x3, %r8
movq %r8, 0xc8(%rsp)
leaq (,%rdi,8), %r9
imull %edx, %edx
movq %rdx, 0x50(%rsp)
imulq %rax, %rdi
leaq (,%rdi,8), %rdx
addq %rbp, %rdx
shlq $0x3, %rdi
movq %rdi, 0x90(%rsp)
movl $0x1, %edi
xorl %r8d, %r8d
movq 0x8(%rsp), %r12
leaq 0x1(%r8), %rax
movq %rax, 0xd8(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %r8d, %eax
imull %r8d, %eax
movl %eax, %r10d
shrl $0x1f, %r10d
addl %eax, %r10d
sarl %r10d
addl %edi, %r10d
imull 0x50(%rsp), %r10d
movq %r10, 0x10(%rsp)
movq %rdx, 0x78(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, 0x80(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdi, 0xe0(%rsp)
movq %rdi, %rax
cmpl $0x0, 0x8(%rsp)
jle 0x9d6b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leal (%rax,%rdx), %esi
imull %eax, %esi
movl %esi, %ebp
shrl $0x1f, %ebp
addl %esi, %ebp
sarl %ebp
addl %r8d, %ebp
imull 0x50(%rsp), %ebp
movq 0x30(%rsp), %r14
movq 0x10(%rsp), %rsi
movq 0x38(%rsp), %r11
xorl %r10d, %r10d
movl %ebp, 0x28(%rsp)
movq %r14, %r15
xorl %edi, %edi
leal (%rsi,%rdi), %ebx
movsd (%r15), %xmm0
addsd (%r11,%rdi,8), %xmm0
cmpq %rax, %r8
cmovbl %ebp, %ebx
addl %ecx, %ebx
movslq %ebx, %rbx
movq 0x58(%rsp), %rdx
addsd (%rdx,%rbx,8), %xmm0
movsd %xmm0, (%rdx,%rbx,8)
movq 0x20(%rsp), %rdx
incq %rdi
addq %r9, %r15
addl %r12d, %ebp
cmpq %rdi, %rdx
jne 0x9d18
incq %r10
addq %r9, %r11
addq %rdx, %rsi
addq $0x8, %r14
movl 0x28(%rsp), %ebp
incl %ebp
cmpq %rdx, %r10
jne 0x9d0f
incq %rax
movq 0x38(%rsp), %rdx
addq 0x98(%rsp), %rdx
movq %rdx, 0x38(%rsp)
movq 0x10(%rsp), %rdx
addq 0x50(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq 0x30(%rsp), %rdx
addq 0x90(%rsp), %rdx
movq %rdx, 0x30(%rsp)
movq 0xa8(%rsp), %r15
cmpq %r15, %rax
jne 0x9cd6
movq 0xe0(%rsp), %rdi
incq %rdi
movq 0x80(%rsp), %rsi
movq 0xc8(%rsp), %rax
addq %rax, %rsi
movq 0x78(%rsp), %rdx
addq %rax, %rdx
movq 0xd8(%rsp), %r8
cmpq 0xd0(%rsp), %r8
jne 0x9c81
movq 0x70(%rsp), %rbx
movq 0x18(%rsp), %r14
movq 0x68(%rsp), %r12
movq 0x48(%rsp), %rbp
jmp 0x9e1a
leal -0x1(%r10), %eax
movl %eax, 0xa4(%rsp)
movl $0x0, 0x64(%rsp)
movq %r10, %r14
movq 0xb8(%rsp), %rdi
callq 0x1050
movq %r12, %rdi
callq 0x1050
movq 0x88(%rsp), %rdi
callq 0x1050
movq %rbp, %rdi
callq 0x1050
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x70(%rbx)
testl %r14d, %r14d
jle 0x9ed2
leaq (,%r15,8), %rax
xorl %ecx, %ecx
movq %r13, %rdx
movq 0x58(%rsp), %rsi
movq 0xb0(%rsp), %r10
movq 0x20(%rsp), %rbx
cmpl $0x0, 0x8(%rsp)
jle 0x9ec0
movsd (%r10,%rcx,8), %xmm3
movq %rbx, %rdi
xorl %r8d, %r8d
addsd %xmm3, %xmm3
mulsd (%rdx,%r8), %xmm3
addsd (%rsi,%r8), %xmm3
movsd %xmm3, (%rsi,%r8)
movsd (%r10,%rcx,8), %xmm3
movsd (%rdx,%r8), %xmm1
movapd %xmm3, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm0
addq %rax, %r8
decq %rdi
jne 0x9e86
incq %rcx
addq $0x8, %rsi
addq $0x8, %rdx
cmpq %r15, %rcx
jne 0x9e73
jmp 0x9edf
movq 0xb0(%rsp), %r10
movq 0x20(%rsp), %rbx
cmpb $0x0, 0x64(%rsp)
je 0xa108
movl 0xa4(%rsp), %eax
movq %rax, 0x78(%rsp)
movq 0x8(%rsp), %rcx
movl %ecx, %eax
imull 0x18(%rsp), %eax
movl %eax, 0x28(%rsp)
movl %ecx, %eax
imull %ecx, %eax
movl %eax, 0x48(%rsp)
movl $0x1, %esi
xorl %r8d, %r8d
leaq 0x1(%r8), %rax
movq %rax, 0x80(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %r8d, %eax
imull %r8d, %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movq 0x18(%rsp), %rax
leal (%rdx,%rax), %edi
movq %rdi, 0x40(%rsp)
leal (%rax,%r8), %edi
movq %rdi, 0x88(%rsp)
addl %esi, %edx
movl 0x48(%rsp), %r9d
imull %edx, %r9d
imull %ecx, %edx
addl %eax, %edx
imull %ecx, %edx
movq %rsi, 0x68(%rsp)
testl %ecx, %ecx
movq %rdx, 0x98(%rsp)
movl %r9d, 0x90(%rsp)
jle 0xa0c3
movq 0x40(%rsp), %rax
addl %esi, %eax
movslq %eax, %rdi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %esi, %eax
imull %esi, %eax
movl %eax, %r14d
shrl $0x1f, %r14d
addl %eax, %r14d
sarl %r14d
movq 0x88(%rsp), %rax
addl %r14d, %eax
movslq %eax, %r11
addl %r8d, %r14d
imull %ecx, %r14d
movq 0x18(%rsp), %rax
movq %r14, 0x10(%rsp)
addl %eax, %r14d
imull %ecx, %r14d
movl %edx, %eax
movl %r9d, %edx
xorl %r9d, %r9d
movq %rbx, %r15
movl %r14d, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movl %edx, 0x50(%rsp)
movl %edx, %ebx
xorl %ebp, %ebp
cmpq %rsi, %r8
jae 0xa045
movsd (%r10,%r11,8), %xmm1
addsd %xmm1, %xmm1
movq 0x10(%rsp), %rdx
addl %ebp, %edx
movq %r13, %r10
movq 0x58(%rsp), %r13
movslq %r14d, %r12
mulsd (%r10,%r12,8), %xmm1
imull %ecx, %edx
addsd (%r13,%r12,8), %xmm1
movsd %xmm1, (%r13,%r12,8)
movq 0xb0(%rsp), %rcx
movsd (%rcx,%r11,8), %xmm1
movq 0x8(%rsp), %rcx
mulsd (%r10,%r12,8), %xmm1
movq %r10, %r13
movq 0xb0(%rsp), %r10
addl %r9d, %edx
jmp 0xa079
movsd (%r10,%rdi,8), %xmm1
addsd %xmm1, %xmm1
movslq %eax, %rdx
mulsd (%r13,%rdx,8), %xmm1
movq 0x58(%rsp), %r12
addsd (%r12,%rdx,8), %xmm1
movsd %xmm1, (%r12,%rdx,8)
movsd (%r10,%rdi,8), %xmm1
mulsd (%r13,%rdx,8), %xmm1
movl %ebx, %edx
addl 0x28(%rsp), %edx
movslq %edx, %rdx
mulsd (%r13,%rdx,8), %xmm1
addsd %xmm1, %xmm0
incq %rbp
incl %ebx
incl %eax
addl %ecx, %r14d
decq %r15
jne 0x9fe4
incq %r9
movl 0x50(%rsp), %edx
addl %ecx, %edx
movl 0x38(%rsp), %eax
addl %ecx, %eax
movl 0x30(%rsp), %r14d
incl %r14d
movq 0x20(%rsp), %rbx
cmpq %rbx, %r9
jne 0x9fd0
incq %rsi
movl 0x48(%rsp), %eax
movl 0x90(%rsp), %r9d
addl %eax, %r9d
movq 0x98(%rsp), %rdx
addl %eax, %edx
cmpq 0xa8(%rsp), %rsi
jne 0x9f69
movq 0x68(%rsp), %rsi
incq %rsi
movq 0x80(%rsp), %r8
cmpq 0x78(%rsp), %r8
jne 0x9f17
movq %r13, %rdi
movq 0x58(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0xc0(%rsp), %rcx
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb1ab