#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double exp(int);
int log(double);
double optimize_px(int n, int numt, double p[], double hat_hat[], double eigs[],
                   double *lambda0, double *lambda0_range, double chi0,
                   double tc, double *Trace) {
  int i, j, k, niter = 50;
  double px, lambda, dlambda, lambda_best, eigs1,
      px_max = 0., start = lambda0_range[0], stop = lambda0_range[1];
  double m[n][n], s1, s2, s3, sum, v[n], tcn = tc / numt, Tr,
                                         Tr0 = (1 - 3. / numt) / (1. + tcn);
  for (i = 0; i < n; i++) {
    for (j = i; j < n; j++)
      m[j][i] = 0.;
  }
  for (k = 0; k < n; k++) {
    s1 = 1. + (k % (n / 2));
    s1 *= s1;
    s1 *= s1;
    for (i = 0; i < n; i++) {
      for (j = i; j < n; j++)
        m[j][i] += hat_hat[i + k * n] * hat_hat[j + k * n] / s1;
    }
  }
  lambda = start;
  dlambda = exp(log(stop / start) / niter);
  for (k = 0; k < 3; k++) {
    for (j = 0; j <= niter; j++) {
      Tr = 1 - 2. * n / numt;
      px = chi0;
      s1 = 0;
      s2 = 0, s3 = 0;
      for (i = 0; i < n; i++) {
        eigs1 = eigs[i] + numt * (lambda - (*lambda0));
        Tr += 2. * lambda / eigs1;
        s1 += p[i] * (v[i] = p[i] / eigs1);
        s2 += p[i] * v[i] / eigs1;
        s3 += v[i] * m[i][i] * v[i];
        for (k = 0; k < i; k++)
          s3 += 2. * v[i] * m[i][k] * v[k];
      }
      px = chi0 -
           (chi0 - s1 - s2 * numt * lambda) * (1. + tcn * (s2 / s3)) * Tr0 / Tr;
      if (px > px_max && Tr > 0) {
        px_max = px;
        lambda_best = lambda;
        *Trace = Tr;
      }
      lambda *= dlambda;
    }
    if (lambda_best - 1.e-5 > start)
      start = lambda_best / dlambda;
    else
      break;
    if (lambda_best + 1.e-5 < stop)
      stop = lambda_best * dlambda;
    else
      break;
    dlambda = exp(log(stop / start) / niter);
  }
  *lambda0 = lambda_best;
  return px_max;
}


x86 assembly (clang, -O0):
<optimize_px>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movl   $0x32,-0x48(%rbp)
movq   $0x0,-0x78(%rbp)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x4(%rbp),%eax
mov    %rax,-0xf8(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rax,%rcx
imul   %rcx,%rcx
lea    0xf(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xf0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x98(%rbp)
mov    %rax,-0xa0(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xe8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xc8(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xdfa(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xde6(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xdda(%rip),%xmm1
addsd  -0xd0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12a9 <optimize_px+0x189>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1296 <optimize_px+0x176>
mov    -0xf0(%rbp),%rax
mov    -0xf8(%rbp),%rdx
movslq -0x40(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1253 <optimize_px+0x133>
jmp    129b <optimize_px+0x17b>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1241 <optimize_px+0x121>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13df <optimize_px+0x2bf>
mov    -0x44(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xfc(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm1
movsd  0xd19(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13cc <optimize_px+0x2ac>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13b9 <optimize_px+0x299>
mov    -0xf0(%rbp),%rax
mov    -0xf8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x3c(%rbp),%esi
mov    -0x44(%rbp),%edi
imul   -0x4(%rbp),%edi
add    %edi,%esi
movslq %esi,%rsi
movsd  (%rcx,%rsi,8),%xmm0
mov    -0x18(%rbp),%rcx
mov    -0x40(%rbp),%esi
mov    -0x44(%rbp),%edi
imul   -0x4(%rbp),%edi
add    %edi,%esi
movslq %esi,%rsi
mulsd  (%rcx,%rsi,8),%xmm0
divsd  -0xa8(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    133c <optimize_px+0x21c>
jmp    13be <optimize_px+0x29e>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    132a <optimize_px+0x20a>
jmp    13d1 <optimize_px+0x2b1>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12b0 <optimize_px+0x190>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
divsd  -0x80(%rbp),%xmm0
call   1040 <log@plt>
cltd
idivl  -0x48(%rbp)
mov    %eax,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    17d0 <optimize_px+0x6b0>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     1730 <optimize_px+0x610>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xbdc(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xbaf(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    163e <optimize_px+0x51e>
mov    -0xe8(%rbp),%rax
mov    -0xf0(%rbp),%rcx
mov    -0xf8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movslq -0x3c(%rbp),%rdi
movsd  (%rdx,%rdi,8),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mov    -0x28(%rbp),%rdx
subsd  (%rdx),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xb34(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
addsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x10(%rbp),%rdx
movslq -0x3c(%rbp),%rdi
movsd  (%rdx,%rdi,8),%xmm0
mov    -0x10(%rbp),%rdx
movslq -0x3c(%rbp),%rdi
movsd  (%rdx,%rdi,8),%xmm2
divsd  -0x70(%rbp),%xmm2
movslq -0x3c(%rbp),%rdx
movsd  %xmm2,(%rax,%rdx,8)
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x10(%rbp),%rdx
movslq -0x3c(%rbp),%rdi
movsd  (%rdx,%rdi,8),%xmm0
movslq -0x3c(%rbp),%rdx
mulsd  (%rax,%rdx,8),%xmm0
divsd  -0x70(%rbp),%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movslq -0x3c(%rbp),%rdx
movsd  (%rax,%rdx,8),%xmm0
movslq -0x3c(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0x3c(%rbp),%rdx
mulsd  (%rcx,%rdx,8),%xmm0
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    162b <optimize_px+0x50b>
mov    -0xe8(%rbp),%rax
mov    -0xf0(%rbp),%rcx
mov    -0xf8(%rbp),%rsi
movslq -0x3c(%rbp),%rdx
movsd  0xa39(%rip),%xmm0
mulsd  (%rax,%rdx,8),%xmm0
movslq -0x3c(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0x44(%rbp),%rdx
mulsd  (%rcx,%rdx,8),%xmm0
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    15b2 <optimize_px+0x492>
jmp    1630 <optimize_px+0x510>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    148f <optimize_px+0x36f>
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  -0xa8(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm1
ff
cvtsi2sdl -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movsd  -0x58(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0xd0(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm3
ff
divsd  -0xb8(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm2
movsd  0x957(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0xe0(%rbp),%xmm1
ff
divsd  -0xd8(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1713 <optimize_px+0x5f3>
movsd  -0xd8(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1713 <optimize_px+0x5f3>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0xd8(%rbp),%xmm0
ff
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1423 <optimize_px+0x303>
movsd  -0x68(%rbp),%xmm0
movsd  0x8d3(%rip),%xmm1
subsd  %xmm1,%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    1760 <optimize_px+0x640>
movsd  -0x68(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    1765 <optimize_px+0x645>
jmp    17d0 <optimize_px+0x6b0>
movsd  0x8a3(%rip),%xmm1
addsd  -0x68(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    179b <optimize_px+0x67b>
movsd  -0x68(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    17a0 <optimize_px+0x680>
jmp    17d0 <optimize_px+0x6b0>
movsd  -0x88(%rbp),%xmm0
ff
divsd  -0x80(%rbp),%xmm0
call   1040 <log@plt>
cltd
idivl  -0x48(%rbp)
mov    %eax,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1412 <optimize_px+0x2f2>
movsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x90(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimize_px>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movapd %xmm0,%xmm5
mov    %r9,-0x80(%rbp)
mov    %r8,-0x68(%rbp)
mov    %rdx,-0x60(%rbp)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm6
movsd  0x8(%rax),%xmm7
mov    %edi,%r14d
mov    %r14,%rax
imul   %r14,%rax
mov    %rsp,%rdx
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,-0x38(%rbp)
mov    %rdx,%rsp
mov    %rsp,%r12
lea    0xf(,%r14,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe64(%rip),%xmm2
movsd  %xmm0,-0x70(%rbp)
divsd  %xmm0,%xmm2
movsd  0xe5b(%rip),%xmm3
addsd  %xmm3,%xmm2
movsd  %xmm2,-0x58(%rbp)
movapd %xmm1,%xmm0
addsd  %xmm3,%xmm0
mov    %edi,-0x2c(%rbp)
test   %edi,%edi
jle    1366 <optimize_px+0x246>
cmpl   $0x1,-0x2c(%rbp)
jne    11d7 <optimize_px+0xb7>
xor    %r10d,%r10d
jmp    1266 <optimize_px+0x146>
mov    %r14d,%r8d
and    $0xfffffffe,%r8d
mov    %r14,%r9
shl    $0x4,%r9
add    $0x10,%r9
lea    0x0(,%r14,8),%rdi
mov    -0x38(%rbp),%rax
lea    (%rax,%r14,8),%r11
add    $0x8,%r11
xor    %r10d,%r10d
mov    %r14,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdx,%rsi
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
movq   $0x0,(%rbx)
add    %rdi,%rbx
add    $0xffffffffffffffff,%rsi
jne    1220 <optimize_px+0x100>
mov    $0x1,%ebx
mov    %r11,%rsi
nopl   0x0(%rax,%rax,1)
movq   $0x0,(%rsi)
add    $0x1,%rbx
add    %rdi,%rsi
cmp    %rbx,%rdx
jne    1240 <optimize_px+0x120>
add    $0x2,%r10
add    %r9,%rax
add    $0xfffffffffffffffe,%rdx
add    %r9,%r11
cmp    %r8,%r10
jne    1210 <optimize_px+0xf0>
test   $0x1,%r14b
je     12a0 <optimize_px+0x180>
mov    %r14,%rax
sub    %r10,%rax
lea    0x0(,%r14,8),%rdx
lea    0x8(,%r14,8),%rsi
imul   %r10,%rsi
add    -0x38(%rbp),%rsi
nopw   0x0(%rax,%rax,1)
movq   $0x0,(%rsi)
add    %rdx,%rsi
add    $0xffffffffffffffff,%rax
jne    1290 <optimize_px+0x170>
cmpl   $0x0,-0x2c(%rbp)
jle    1366 <optimize_px+0x246>
mov    -0x2c(%rbp),%eax
shr    %eax
mov    %eax,-0x40(%rbp)
lea    0x0(,%r14,8),%rdi
lea    0x8(,%r14,8),%r11
xor    %r9d,%r9d
mov    %rcx,%r10
nopl   0x0(%rax,%rax,1)
mov    %r9d,%eax
cltd
idivl  -0x40(%rbp)
xorps  %xmm4,%xmm4
cvtsi2sd %edx,%xmm4
addsd  0xd22(%rip),%xmm4
mulsd  %xmm4,%xmm4
mulsd  %xmm4,%xmm4
mov    %r9,%r15
imul   %r14,%r15
mov    %r14,%rdx
mov    -0x38(%rbp),%r13
mov    %r10,%rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%r15,1),%rsi
movsd  (%rcx,%rsi,8),%xmm2
mov    %r13,%rsi
xor    %r8d,%r8d
nop
movsd  (%rax,%r8,8),%xmm3
mulsd  %xmm2,%xmm3
divsd  %xmm4,%xmm3
addsd  (%rsi),%xmm3
movsd  %xmm3,(%rsi)
add    $0x1,%r8
add    %rdi,%rsi
cmp    %r8,%rdx
jne    1320 <optimize_px+0x200>
add    $0x1,%rbx
add    $0x8,%rax
add    %r11,%r13
add    $0xffffffffffffffff,%rdx
cmp    %r14,%rbx
jne    1310 <optimize_px+0x1f0>
add    $0x1,%r9
add    %rdi,%r10
cmp    %r14,%r9
jne    12d0 <optimize_px+0x1b0>
movsd  -0x58(%rbp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,-0x58(%rbp)
movsd  %xmm7,-0x90(%rbp)
ff
movapd %xmm7,%xmm0
divsd  %xmm6,%xmm0
movsd  %xmm1,-0x88(%rbp)
ff
movsd  %xmm5,-0x78(%rbp)
movsd  %xmm6,-0x48(%rbp)
call   1040 <log@plt>
cltq
imul   $0x51eb851f,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x24,%rdi
add    %eax,%edi
call   1030 <exp@plt>
movsd  -0x48(%rbp),%xmm15
movsd  -0x78(%rbp),%xmm14
movsd  -0x88(%rbp),%xmm13
ff ff
xorps  %xmm1,%xmm1
cvtsi2sdl -0x2c(%rbp),%xmm1
addsd  %xmm1,%xmm1
divsd  -0x70(%rbp),%xmm1
movsd  0xc24(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,-0xa0(%rbp)
ff
mov    -0x38(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0xa8(%rbp)
lea    0x0(,%r14,8),%r15
xor    %r13d,%r13d
movsd  %xmm15,-0x98(%rbp)
ff ff
xorpd  %xmm1,%xmm1
movsd  %xmm1,-0x40(%rbp)
mov    -0x80(%rbp),%r11
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rdx
nopl   0x0(%rax,%rax,1)
movsd  %xmm3,-0x50(%rbp)
xor    %r8d,%r8d
jmp    1453 <optimize_px+0x333>
nopw   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm15
add    $0x1,%r8d
cmp    $0x33,%r8d
je     16a0 <optimize_px+0x580>
cmpl   $0x0,-0x2c(%rbp)
jle    1600 <optimize_px+0x4e0>
movapd %xmm15,%xmm8
subsd  (%r11),%xmm8
movapd %xmm15,%xmm9
addsd  %xmm15,%xmm9
xorpd  %xmm6,%xmm6
mov    $0xffffffff,%r9d
mov    -0x38(%rbp),%r10
mov    -0xa8(%rbp),%rsi
xor    %ebx,%ebx
movsd  -0xa0(%rbp),%xmm10
ff ff
xorpd  %xmm12,%xmm12
xorpd  %xmm11,%xmm11
jmp    14d6 <optimize_px+0x3b6>
nopl   (%rax)
xor    %r13d,%r13d
movapd %xmm9,%xmm2
divsd  %xmm7,%xmm2
addsd  %xmm2,%xmm10
mulsd  %xmm1,%xmm3
addsd  %xmm3,%xmm11
divsd  %xmm7,%xmm3
addsd  %xmm3,%xmm12
add    $0x1,%rbx
add    %r15,%rsi
add    %r15,%r10
cmp    %r14,%rbx
je     1617 <optimize_px+0x4f7>
movapd %xmm6,%xmm5
add    $0x1,%r9d
movsd  -0x70(%rbp),%xmm7
mulsd  %xmm8,%xmm7
addsd  (%rcx,%rbx,8),%xmm7
movsd  (%rdx,%rbx,8),%xmm3
movapd %xmm3,%xmm1
divsd  %xmm7,%xmm1
movsd  %xmm1,(%r12,%rbx,8)
mov    %rbx,%rax
imul   %r14,%rax
mov    -0x38(%rbp),%rdi
lea    (%rdi,%rax,8),%rax
movsd  (%rax,%rbx,8),%xmm6
mulsd  %xmm1,%xmm6
mulsd  %xmm1,%xmm6
addsd  %xmm5,%xmm6
test   %rbx,%rbx
je     14a0 <optimize_px+0x380>
lea    -0x1(%rbx),%rax
movapd %xmm1,%xmm5
addsd  %xmm1,%xmm5
cmp    $0x3,%rax
jae    1540 <optimize_px+0x420>
xor    %eax,%eax
jmp    15ab <optimize_px+0x48b>
nop
mov    %rbx,%rdi
and    $0xfffffffffffffffc,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsd  -0x18(%rsi,%rax,8),%xmm4
mulsd  %xmm5,%xmm4
mulsd  (%r12,%rax,8),%xmm4
addsd  %xmm6,%xmm4
movsd  -0x10(%rsi,%rax,8),%xmm2
mulsd  %xmm5,%xmm2
mulsd  0x8(%r12,%rax,8),%xmm2
addsd  %xmm4,%xmm2
movsd  -0x8(%rsi,%rax,8),%xmm4
mulsd  %xmm5,%xmm4
mulsd  0x10(%r12,%rax,8),%xmm4
movsd  (%rsi,%rax,8),%xmm6
mulsd  %xmm5,%xmm6
mulsd  0x18(%r12,%rax,8),%xmm6
addsd  %xmm2,%xmm4
addsd  %xmm4,%xmm6
add    $0x4,%rax
cmp    %rax,%rdi
jne    1550 <optimize_px+0x430>
mov    %r9d,%r13d
test   $0x3,%bl
je     14a3 <optimize_px+0x383>
mov    %ebx,%edi
and    $0x3,%edi
lea    (%r12,%rax,8),%rcx
lea    (%r10,%rax,8),%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movsd  (%rax,%rdx,8),%xmm2
mulsd  %xmm5,%xmm2
mulsd  (%rcx,%rdx,8),%xmm2
addsd  %xmm2,%xmm6
add    $0x1,%rdx
cmp    %rdx,%rdi
jne    15d0 <optimize_px+0x4b0>
mov    %r9d,%r13d
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rdx
jmp    14a3 <optimize_px+0x383>
nopl   0x0(%rax,%rax,1)
xorpd  %xmm11,%xmm11
xorpd  %xmm12,%xmm12
xorpd  %xmm6,%xmm6
movsd  -0xa0(%rbp),%xmm10
ff ff
movapd %xmm14,%xmm1
subsd  %xmm11,%xmm1
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm12,%xmm2
mulsd  %xmm15,%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm6,%xmm12
mulsd  %xmm13,%xmm12
addsd  0x9c1(%rip),%xmm12
mulsd  %xmm1,%xmm12
mulsd  -0x58(%rbp),%xmm12
divsd  %xmm10,%xmm12
movapd %xmm14,%xmm1
subsd  %xmm12,%xmm1
ucomisd -0x40(%rbp),%xmm1
jbe    1440 <optimize_px+0x320>
ucomisd 0x9ab(%rip),%xmm10
jbe    1440 <optimize_px+0x320>
mov    0x18(%rbp),%rax
movsd  %xmm10,(%rax)
movsd  %xmm1,-0x40(%rbp)
movsd  %xmm15,-0x50(%rbp)
jmp    1440 <optimize_px+0x320>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x50(%rbp),%xmm3
movapd %xmm3,%xmm1
addsd  0x95f(%rip),%xmm1
ucomisd -0x98(%rbp),%xmm1
ff
jbe    1756 <optimize_px+0x636>
movapd %xmm3,%xmm1
addsd  0x94d(%rip),%xmm1
movsd  -0x90(%rbp),%xmm2
ff
ucomisd %xmm1,%xmm2
jbe    1756 <optimize_px+0x636>
movapd %xmm3,%xmm1
divsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  %xmm1,-0x98(%rbp)
ff
divsd  %xmm1,%xmm0
movsd  %xmm15,-0x48(%rbp)
call   1040 <log@plt>
cltq
imul   $0x51eb851f,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x24,%rdi
add    %eax,%edi
call   1030 <exp@plt>
movsd  -0x50(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm15
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
movsd  -0x78(%rbp),%xmm14
mov    -0x80(%rbp),%r11
movsd  -0x88(%rbp),%xmm13
ff ff
lea    0x1(%r13),%eax
cmp    $0x2,%r13d
mov    %eax,%r13d
jl     1430 <optimize_px+0x310>
movsd  %xmm3,(%r11)
movsd  -0x40(%rbp),%xmm0
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @optimize_px(i32 %0, i32 %1, double* %2, double* %3, double* %4, double* %5, double* %6, double %7, double %8, double* %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double
%19 = alloca double
%20 = alloca double*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca i8*
%34 = alloca i64
%35 = alloca i64
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca i64
%41 = alloca double
%42 = alloca double
%43 = alloca double
store i32 %0, i32* %11
store i32 %1, i32* %12
store double* %2, double** %13
store double* %3, double** %14
store double* %4, double** %15
store double* %5, double** %16
store double* %6, double** %17
store double %7, double* %18
store double %8, double* %19
store double* %9, double** %20
store i32 50, i32* %24
store double 0.000000e+00, double* %30
%44 = load double*, double** %17
%45 = getelementptr inbounds double, double* %44, i64 0
%46 = load double, double* %45
store double %46, double* %31
%47 = load double*, double** %17
%48 = getelementptr inbounds double, double* %47, i64 1
%49 = load double, double* %48
store double %49, double* %32
%50 = load i32, i32* %11
%51 = zext i32 %50 to i64
%52 = load i32, i32* %11
%53 = zext i32 %52 to i64
%54 = call i8* @llvm.stacksave()
store i8* %54, i8** %33
%55 = mul nuw i64 %51, %53
%56 = alloca double, i64 %55
store i64 %51, i64* %34
store i64 %53, i64* %35
%57 = load i32, i32* %11
%58 = zext i32 %57 to i64
%59 = alloca double, i64 %58
store i64 %58, i64* %40
%60 = load double, double* %19
%61 = load i32, i32* %12
%62 = sitofp i32 %61 to double
%63 = fdiv double %60, %62
store double %63, double* %41
%64 = load i32, i32* %12
%65 = sitofp i32 %64 to double
%66 = fdiv double 3.000000e+00, %65
%67 = fsub double 1.000000e+00, %66
%68 = load double, double* %41
%69 = fadd double 1.000000e+00, %68
%70 = fdiv double %67, %69
store double %70, double* %43
store i32 0, i32* %21
br label %71
71: ; preds = %93, %10
%72 = load i32, i32* %21
%73 = load i32, i32* %11
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %96
75: ; preds = %71
%76 = load i32, i32* %21
store i32 %76, i32* %22
br label %77
77: ; preds = %89, %75
%78 = load i32, i32* %22
%79 = load i32, i32* %11
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %92
81: ; preds = %77
%82 = load i32, i32* %22
%83 = sext i32 %82 to i64
%84 = mul nsw i64 %83, %53
%85 = getelementptr inbounds double, double* %56, i64 %84
%86 = load i32, i32* %21
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %85, i64 %87
store double 0.000000e+00, double* %88
br label %89
89: ; preds = %81
%90 = load i32, i32* %22
%91 = add nsw i32 %90, 1
store i32 %91, i32* %22
br label %77
92: ; preds = %77
br label %93
93: ; preds = %92
%94 = load i32, i32* %21
%95 = add nsw i32 %94, 1
store i32 %95, i32* %21
br label %71
96: ; preds = %71
store i32 0, i32* %23
br label %97
97: ; preds = %163, %96
%98 = load i32, i32* %23
%99 = load i32, i32* %11
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %166
101: ; preds = %97
%102 = load i32, i32* %23
%103 = load i32, i32* %11
%104 = sdiv i32 %103, 2
%105 = srem i32 %102, %104
%106 = sitofp i32 %105 to double
%107 = fadd double 1.000000e+00, %106
store double %107, double* %36
%108 = load double, double* %36
%109 = load double, double* %36
%110 = fmul double %109, %108
store double %110, double* %36
%111 = load double, double* %36
%112 = load double, double* %36
%113 = fmul double %112, %111
store double %113, double* %36
store i32 0, i32* %21
br label %114
114: ; preds = %159, %101
%115 = load i32, i32* %21
%116 = load i32, i32* %11
%117 = icmp slt i32 %115, %116
br i1 %117, label %118, label %162
118: ; preds = %114
%119 = load i32, i32* %21
store i32 %119, i32* %22
br label %120
120: ; preds = %155, %118
%121 = load i32, i32* %22
%122 = load i32, i32* %11
%123 = icmp slt i32 %121, %122
br i1 %123, label %124, label %158
124: ; preds = %120
%125 = load double*, double** %14
%126 = load i32, i32* %21
%127 = load i32, i32* %23
%128 = load i32, i32* %11
%129 = mul nsw i32 %127, %128
%130 = add nsw i32 %126, %129
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %125, i64 %131
%133 = load double, double* %132
%134 = load double*, double** %14
%135 = load i32, i32* %22
%136 = load i32, i32* %23
%137 = load i32, i32* %11
%138 = mul nsw i32 %136, %137
%139 = add nsw i32 %135, %138
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %134, i64 %140
%142 = load double, double* %141
%143 = fmul double %133, %142
%144 = load double, double* %36
%145 = fdiv double %143, %144
%146 = load i32, i32* %22
%147 = sext i32 %146 to i64
%148 = mul nsw i64 %147, %53
%149 = getelementptr inbounds double, double* %56, i64 %148
%150 = load i32, i32* %21
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %149, i64 %151
%153 = load double, double* %152
%154 = fadd double %153, %145
store double %154, double* %152
br label %155
155: ; preds = %124
%156 = load i32, i32* %22
%157 = add nsw i32 %156, 1
store i32 %157, i32* %22
br label %120
158: ; preds = %120
br label %159
159: ; preds = %158
%160 = load i32, i32* %21
%161 = add nsw i32 %160, 1
store i32 %161, i32* %21
br label %114
162: ; preds = %114
br label %163
163: ; preds = %162
%164 = load i32, i32* %23
%165 = add nsw i32 %164, 1
store i32 %165, i32* %23
br label %97
166: ; preds = %97
%167 = load double, double* %31
store double %167, double* %26
%168 = load double, double* %32
%169 = load double, double* %31
%170 = fdiv double %168, %169
%171 = call i32 @log(double %170)
%172 = load i32, i32* %24
%173 = sdiv i32 %171, %172
%174 = call double @exp(i32 %173)
store double %174, double* %27
store i32 0, i32* %23
br label %175
175: ; preds = %366, %166
%176 = load i32, i32* %23
%177 = icmp slt i32 %176, 3
br i1 %177, label %178, label %369
178: ; preds = %175
store i32 0, i32* %22
br label %179
179: ; preds = %335, %178
%180 = load i32, i32* %22
%181 = load i32, i32* %24
%182 = icmp sle i32 %180, %181
br i1 %182, label %183, label %338
183: ; preds = %179
%184 = load i32, i32* %11
%185 = sitofp i32 %184 to double
%186 = fmul double 2.000000e+00, %185
%187 = load i32, i32* %12
%188 = sitofp i32 %187 to double
%189 = fdiv double %186, %188
%190 = fsub double 1.000000e+00, %189
store double %190, double* %42
%191 = load double, double* %18
store double %191, double* %25
store double 0.000000e+00, double* %36
store double 0.000000e+00, double* %37
store double 0.000000e+00, double* %38
store i32 0, i32* %21
br label %192
192: ; preds = %294, %183
%193 = load i32, i32* %21
%194 = load i32, i32* %11
%195 = icmp slt i32 %193, %194
br i1 %195, label %196, label %297
196: ; preds = %192
%197 = load double*, double** %15
%198 = load i32, i32* %21
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds double, double* %197, i64 %199
%201 = load double, double* %200
%202 = load i32, i32* %12
%203 = sitofp i32 %202 to double
%204 = load double, double* %26
%205 = load double*, double** %16
%206 = load double, double* %205
%207 = fsub double %204, %206
%208 = call double @llvm.fmuladd.f64(double %203, double %207, double %201)
store double %208, double* %29
%209 = load double, double* %26
%210 = fmul double 2.000000e+00, %209
%211 = load double, double* %29
%212 = fdiv double %210, %211
%213 = load double, double* %42
%214 = fadd double %213, %212
store double %214, double* %42
%215 = load double*, double** %13
%216 = load i32, i32* %21
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %215, i64 %217
%219 = load double, double* %218
%220 = load double*, double** %13
%221 = load i32, i32* %21
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %220, i64 %222
%224 = load double, double* %223
%225 = load double, double* %29
%226 = fdiv double %224, %225
%227 = load i32, i32* %21
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %59, i64 %228
store double %226, double* %229
%230 = load double, double* %36
%231 = call double @llvm.fmuladd.f64(double %219, double %226, double %230)
store double %231, double* %36
%232 = load double*, double** %13
%233 = load i32, i32* %21
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds double, double* %232, i64 %234
%236 = load double, double* %235
%237 = load i32, i32* %21
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds double, double* %59, i64 %238
%240 = load double, double* %239
%241 = fmul double %236, %240
%242 = load double, double* %29
%243 = fdiv double %241, %242
%244 = load double, double* %37
%245 = fadd double %244, %243
store double %245, double* %37
%246 = load i32, i32* %21
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds double, double* %59, i64 %247
%249 = load double, double* %248
%250 = load i32, i32* %21
%251 = sext i32 %250 to i64
%252 = mul nsw i64 %251, %53
%253 = getelementptr inbounds double, double* %56, i64 %252
%254 = load i32, i32* %21
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds double, double* %253, i64 %255
%257 = load double, double* %256
%258 = fmul double %249, %257
%259 = load i32, i32* %21
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds double, double* %59, i64 %260
%262 = load double, double* %261
%263 = load double, double* %38
%264 = call double @llvm.fmuladd.f64(double %258, double %262, double %263)
store double %264, double* %38
store i32 0, i32* %23
br label %265
265: ; preds = %290, %196
%266 = load i32, i32* %23
%267 = load i32, i32* %21
%268 = icmp slt i32 %266, %267
br i1 %268, label %269, label %293
269: ; preds = %265
%270 = load i32, i32* %21
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %59, i64 %271
%273 = load double, double* %272
%274 = fmul double 2.000000e+00, %273
%275 = load i32, i32* %21
%276 = sext i32 %275 to i64
%277 = mul nsw i64 %276, %53
%278 = getelementptr inbounds double, double* %56, i64 %277
%279 = load i32, i32* %23
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds double, double* %278, i64 %280
%282 = load double, double* %281
%283 = fmul double %274, %282
%284 = load i32, i32* %23
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds double, double* %59, i64 %285
%287 = load double, double* %286
%288 = load double, double* %38
%289 = call double @llvm.fmuladd.f64(double %283, double %287, double %288)
store double %289, double* %38
br label %290
290: ; preds = %269
%291 = load i32, i32* %23
%292 = add nsw i32 %291, 1
store i32 %292, i32* %23
br label %265
293: ; preds = %265
br label %294
294: ; preds = %293
%295 = load i32, i32* %21
%296 = add nsw i32 %295, 1
store i32 %296, i32* %21
br label %192
297: ; preds = %192
%298 = load double, double* %18
%299 = load double, double* %18
%300 = load double, double* %36
%301 = fsub double %299, %300
%302 = load double, double* %37
%303 = load i32, i32* %12
%304 = sitofp i32 %303 to double
%305 = fmul double %302, %304
%306 = load double, double* %26
%307 = fneg double %305
%308 = call double @llvm.fmuladd.f64(double %307, double %306, double %301)
%309 = load double, double* %41
%310 = load double, double* %37
%311 = load double, double* %38
%312 = fdiv double %310, %311
%313 = call double @llvm.fmuladd.f64(double %309, double %312, double 1.000000e+00)
%314 = fmul double %308, %313
%315 = load double, double* %43
%316 = fmul double %314, %315
%317 = load double, double* %42
%318 = fdiv double %316, %317
%319 = fsub double %298, %318
store double %319, double* %25
%320 = load double, double* %25
%321 = load double, double* %30
%322 = fcmp ogt double %320, %321
br i1 %322, label %323, label %331
323: ; preds = %297
%324 = load double, double* %42
%325 = fcmp ogt double %324, 0.000000e+00
br i1 %325, label %326, label %331
326: ; preds = %323
%327 = load double, double* %25
store double %327, double* %30
%328 = load double, double* %26
store double %328, double* %28
%329 = load double, double* %42
%330 = load double*, double** %20
store double %329, double* %330
br label %331
331: ; preds = %326, %323, %297
%332 = load double, double* %27
%333 = load double, double* %26
%334 = fmul double %333, %332
store double %334, double* %26
br label %335
335: ; preds = %331
%336 = load i32, i32* %22
%337 = add nsw i32 %336, 1
store i32 %337, i32* %22
br label %179
338: ; preds = %179
%339 = load double, double* %28
%340 = fsub double %339, 1.000000e-05
%341 = load double, double* %31
%342 = fcmp ogt double %340, %341
br i1 %342, label %343, label %347
343: ; preds = %338
%344 = load double, double* %28
%345 = load double, double* %27
%346 = fdiv double %344, %345
store double %346, double* %31
br label %348
347: ; preds = %338
br label %369
348: ; preds = %343
%349 = load double, double* %28
%350 = fadd double %349, 1.000000e-05
%351 = load double, double* %32
%352 = fcmp olt double %350, %351
br i1 %352, label %353, label %357
353: ; preds = %348
%354 = load double, double* %28
%355 = load double, double* %27
%356 = fmul double %354, %355
store double %356, double* %32
br label %358
357: ; preds = %348
br label %369
358: ; preds = %353
%359 = load double, double* %32
%360 = load double, double* %31
%361 = fdiv double %359, %360
%362 = call i32 @log(double %361)
%363 = load i32, i32* %24
%364 = sdiv i32 %362, %363
%365 = call double @exp(i32 %364)
store double %365, double* %27
br label %366
366: ; preds = %358
%367 = load i32, i32* %23
%368 = add nsw i32 %367, 1
store i32 %368, i32* %23
br label %175
369: ; preds = %357, %347, %175
%370 = load double, double* %28
%371 = load double*, double** %16
store double %370, double* %371
%372 = load double, double* %30
%373 = load i8*, i8** %33
ret double %372
}

LLVM IR (-O2):
define double @optimize_px(i32 %0, i32 %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double %7, double %8, double* nocapture writeonly %9) {
%11 = load double, double* %6
%12 = getelementptr inbounds double, double* %6, i64 1
%13 = load double, double* %12
%14 = zext i32 %0 to i64
%15 = mul nuw i64 %14, %14
%16 = alloca double, i64 %15
%17 = alloca double, i64 %14
%18 = sitofp i32 %1 to double
%19 = fdiv double %8, %18
%20 = fdiv double 3.000000e+00, %18
%21 = fsub double 1.000000e+00, %20
%22 = fadd double %19, 1.000000e+00
%23 = fdiv double %21, %22
%24 = icmp sgt i32 %0, 0
br i1 %24, label %25, label %102
25: ; preds = %10
%26 = and i64 %14, 1
%27 = icmp eq i32 %0, 1
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = and i64 %14, 4294967294
br label %30
30: ; preds = %64, %28
%31 = phi i64 [ 0, %28 ], [ %65, %64 ]
%32 = phi i64 [ 0, %28 ], [ %66, %64 ]
%33 = getelementptr inbounds double, double* %16, i64 %31
br label %49
34: ; preds = %64, %25
%35 = phi i64 [ 0, %25 ], [ %65, %64 ]
%36 = icmp eq i64 %26, 0
br i1 %36, label %45, label %37
37: ; preds = %34
%38 = getelementptr inbounds double, double* %16, i64 %35
br label %39
39: ; preds = %39, %37
%40 = phi i64 [ %35, %37 ], [ %43, %39 ]
%41 = mul nuw nsw i64 %40, %14
%42 = getelementptr inbounds double, double* %38, i64 %41
store double 0.000000e+00, double* %42
%43 = add nuw nsw i64 %40, 1
%44 = icmp eq i64 %43, %14
br i1 %44, label %45, label %39
45: ; preds = %39, %34
br i1 %24, label %46, label %102
46: ; preds = %45
%47 = lshr i32 %0, 1
%48 = zext i32 %0 to i64
br label %68
49: ; preds = %30, %49
%50 = phi i64 [ %31, %30 ], [ %53, %49 ]
%51 = mul nuw nsw i64 %50, %14
%52 = getelementptr inbounds double, double* %33, i64 %51
store double 0.000000e+00, double* %52
%53 = add nuw nsw i64 %50, 1
%54 = icmp eq i64 %53, %14
br i1 %54, label %55, label %49
55: ; preds = %49
%56 = or i64 %31, 1
%57 = getelementptr inbounds double, double* %16, i64 %56
br label %58
58: ; preds = %58, %55
%59 = phi i64 [ %56, %55 ], [ %62, %58 ]
%60 = mul nuw nsw i64 %59, %14
%61 = getelementptr inbounds double, double* %57, i64 %60
store double 0.000000e+00, double* %61
%62 = add nuw nsw i64 %59, 1
%63 = icmp eq i64 %62, %14
br i1 %63, label %64, label %58
64: ; preds = %58
%65 = add nuw nsw i64 %31, 2
%66 = add i64 %32, 2
%67 = icmp eq i64 %66, %29
br i1 %67, label %34, label %30
68: ; preds = %99, %46
%69 = phi i64 [ 0, %46 ], [ %100, %99 ]
%70 = trunc i64 %69 to i32
%71 = srem i32 %70, %47
%72 = sitofp i32 %71 to double
%73 = fadd double %72, 1.000000e+00
%74 = fmul double %73, %73
%75 = fmul double %74, %74
%76 = mul nsw i64 %69, %48
br label %77
77: ; preds = %96, %68
%78 = phi i64 [ 0, %68 ], [ %97, %96 ]
%79 = add nuw nsw i64 %78, %76
%80 = getelementptr inbounds double, double* %3, i64 %79
%81 = load double, double* %80
%82 = getelementptr inbounds double, double* %16, i64 %78
br label %83
83: ; preds = %77, %83
%84 = phi i64 [ %78, %77 ], [ %94, %83 ]
%85 = add nuw nsw i64 %84, %76
%86 = getelementptr inbounds double, double* %3, i64 %85
%87 = load double, double* %86
%88 = fmul double %81, %87
%89 = fdiv double %88, %75
%90 = mul nuw nsw i64 %84, %14
%91 = getelementptr inbounds double, double* %82, i64 %90
%92 = load double, double* %91
%93 = fadd double %92, %89
store double %93, double* %91
%94 = add nuw nsw i64 %84, 1
%95 = icmp eq i64 %94, %14
br i1 %95, label %96, label %83
96: ; preds = %83
%97 = add nuw nsw i64 %78, 1
%98 = icmp eq i64 %97, %14
br i1 %98, label %99, label %77
99: ; preds = %96
%100 = add nuw nsw i64 %69, 1
%101 = icmp eq i64 %100, %14
br i1 %101, label %102, label %68
102: ; preds = %99, %10, %45
%103 = fdiv double %13, %11
%104 = tail call i32 @log(double %103)
%105 = sdiv i32 %104, 50
%106 = tail call double @exp(i32 %105)
%107 = sitofp i32 %0 to double
%108 = fmul double %107, 2.000000e+00
%109 = fdiv double %108, %18
%110 = fsub double 1.000000e+00, %109
br label %111
111: ; preds = %102, %255
%112 = phi i32 [ 0, %102 ], [ %261, %255 ]
%113 = phi double [ %11, %102 ], [ %245, %255 ]
%114 = phi double [ %106, %102 ], [ %260, %255 ]
%115 = phi double [ undef, %102 ], [ %244, %255 ]
%116 = phi double [ %13, %102 ], [ %256, %255 ]
%117 = phi double [ %11, %102 ], [ %252, %255 ]
%118 = phi double [ 0.000000e+00, %102 ], [ %243, %255 ]
br label %119
119: ; preds = %111, %242
%120 = phi i32 [ 0, %111 ], [ %246, %242 ]
%121 = phi i32 [ %112, %111 ], [ %226, %242 ]
%122 = phi double [ %113, %111 ], [ %245, %242 ]
%123 = phi double [ %115, %111 ], [ %244, %242 ]
%124 = phi double [ %118, %111 ], [ %243, %242 ]
br i1 %24, label %125, label %222
125: ; preds = %119
%126 = load double, double* %5
%127 = fsub double %122, %126
%128 = fmul double %122, 2.000000e+00
br label %129
129: ; preds = %125, %216
%130 = phi i64 [ 0, %125 ], [ %219, %216 ]
%131 = phi i32 [ -1, %125 ], [ %220, %216 ]
%132 = phi double [ %110, %125 ], [ %141, %216 ]
%133 = phi double [ 0.000000e+00, %125 ], [ %217, %216 ]
%134 = phi double [ 0.000000e+00, %125 ], [ %149, %216 ]
%135 = phi double [ 0.000000e+00, %125 ], [ %146, %216 ]
%136 = add i32 %131, 1
%137 = getelementptr inbounds double, double* %4, i64 %130
%138 = load double, double* %137
%139 = tail call double @llvm.fmuladd.f64(double %18, double %127, double %138)
%140 = fdiv double %128, %139
%141 = fadd double %132, %140
%142 = getelementptr inbounds double, double* %2, i64 %130
%143 = load double, double* %142
%144 = fdiv double %143, %139
%145 = getelementptr inbounds double, double* %17, i64 %130
store double %144, double* %145
%146 = tail call double @llvm.fmuladd.f64(double %143, double %144, double %135)
%147 = fmul double %143, %144
%148 = fdiv double %147, %139
%149 = fadd double %134, %148
%150 = mul nuw nsw i64 %130, %14
%151 = getelementptr inbounds double, double* %16, i64 %150
%152 = getelementptr inbounds double, double* %151, i64 %130
%153 = load double, double* %152
%154 = fmul double %144, %153
%155 = tail call double @llvm.fmuladd.f64(double %154, double %144, double %133)
%156 = icmp eq i64 %130, 0
br i1 %156, label %216, label %157
157: ; preds = %129
%158 = add nsw i64 %130, -1
%159 = fmul double %144, 2.000000e+00
%160 = and i64 %130, 3
%161 = icmp ult i64 %158, 3
br i1 %161, label %198, label %162
162: ; preds = %157
%163 = and i64 %130, 9223372036854775804
br label %164
164: ; preds = %164, %162
%165 = phi i64 [ 0, %162 ], [ %195, %164 ]
%166 = phi double [ %155, %162 ], [ %194, %164 ]
%167 = phi i64 [ 0, %162 ], [ %196, %164 ]
%168 = getelementptr inbounds double, double* %151, i64 %165
%169 = load double, double* %168
%170 = fmul double %159, %169
%171 = getelementptr inbounds double, double* %17, i64 %165
%172 = load double, double* %171
%173 = tail call double @llvm.fmuladd.f64(double %170, double %172, double %166)
%174 = or i64 %165, 1
%175 = getelementptr inbounds double, double* %151, i64 %174
%176 = load double, double* %175
%177 = fmul double %159, %176
%178 = getelementptr inbounds double, double* %17, i64 %174
%179 = load double, double* %178
%180 = tail call double @llvm.fmuladd.f64(double %177, double %179, double %173)
%181 = or i64 %165, 2
%182 = getelementptr inbounds double, double* %151, i64 %181
%183 = load double, double* %182
%184 = fmul double %159, %183
%185 = getelementptr inbounds double, double* %17, i64 %181
%186 = load double, double* %185
%187 = tail call double @llvm.fmuladd.f64(double %184, double %186, double %180)
%188 = or i64 %165, 3
%189 = getelementptr inbounds double, double* %151, i64 %188
%190 = load double, double* %189
%191 = fmul double %159, %190
%192 = getelementptr inbounds double, double* %17, i64 %188
%193 = load double, double* %192
%194 = tail call double @llvm.fmuladd.f64(double %191, double %193, double %187)
%195 = add nuw nsw i64 %165, 4
%196 = add i64 %167, 4
%197 = icmp eq i64 %196, %163
br i1 %197, label %198, label %164
198: ; preds = %164, %157
%199 = phi double [ undef, %157 ], [ %194, %164 ]
%200 = phi i64 [ 0, %157 ], [ %195, %164 ]
%201 = phi double [ %155, %157 ], [ %194, %164 ]
%202 = icmp eq i64 %160, 0
br i1 %202, label %216, label %203
203: ; preds = %198, %203
%204 = phi i64 [ %213, %203 ], [ %200, %198 ]
%205 = phi double [ %212, %203 ], [ %201, %198 ]
%206 = phi i64 [ %214, %203 ], [ 0, %198 ]
%207 = getelementptr inbounds double, double* %151, i64 %204
%208 = load double, double* %207
%209 = fmul double %159, %208
%210 = getelementptr inbounds double, double* %17, i64 %204
%211 = load double, double* %210
%212 = tail call double @llvm.fmuladd.f64(double %209, double %211, double %205)
%213 = add nuw nsw i64 %204, 1
%214 = add i64 %206, 1
%215 = icmp eq i64 %214, %160
br i1 %215, label %216, label %203
216: ; preds = %198, %203, %129
%217 = phi double [ %155, %129 ], [ %199, %198 ], [ %212, %203 ]
%218 = phi i32 [ 0, %129 ], [ %136, %203 ], [ %136, %198 ]
%219 = add nuw nsw i64 %130, 1
%220 = add nsw i32 %131, 1
%221 = icmp eq i64 %219, %14
br i1 %221, label %222, label %129
222: ; preds = %216, %119
%223 = phi double [ 0.000000e+00, %119 ], [ %146, %216 ]
%224 = phi double [ 0.000000e+00, %119 ], [ %149, %216 ]
%225 = phi double [ 0.000000e+00, %119 ], [ %217, %216 ]
%226 = phi i32 [ %121, %119 ], [ %218, %216 ]
%227 = phi double [ %110, %119 ], [ %141, %216 ]
%228 = fsub double %7, %223
%229 = fneg double %224
%230 = fmul double %18, %229
%231 = tail call double @llvm.fmuladd.f64(double %230, double %122, double %228)
%232 = fdiv double %224, %225
%233 = tail call double @llvm.fmuladd.f64(double %19, double %232, double 1.000000e+00)
%234 = fmul double %231, %233
%235 = fmul double %23, %234
%236 = fdiv double %235, %227
%237 = fsub double %7, %236
%238 = fcmp ogt double %237, %124
%239 = fcmp ogt double %227, 0.000000e+00
%240 = select i1 %238, i1 %239, i1 false
br i1 %240, label %241, label %242
241: ; preds = %222
store double %227, double* %9
br label %242
242: ; preds = %241, %222
%243 = phi double [ %237, %241 ], [ %124, %222 ]
%244 = phi double [ %122, %241 ], [ %123, %222 ]
%245 = fmul double %114, %122
%246 = add nuw nsw i32 %120, 1
%247 = icmp eq i32 %246, 51
br i1 %247, label %248, label %119
248: ; preds = %242
%249 = fadd double %244, -1.000000e-05
%250 = fcmp ogt double %249, %117
br i1 %250, label %251, label %263
251: ; preds = %248
%252 = fdiv double %244, %114
%253 = fadd double %244, 1.000000e-05
%254 = fcmp olt double %253, %116
br i1 %254, label %255, label %263
255: ; preds = %251
%256 = fmul double %114, %244
%257 = fdiv double %256, %252
%258 = tail call i32 @log(double %257)
%259 = sdiv i32 %258, 50
%260 = tail call double @exp(i32 %259)
%261 = add nsw i32 %226, 1
%262 = icmp slt i32 %226, 2
br i1 %262, label %111, label %263
263: ; preds = %251, %248, %255
store double %244, double* %5
ret double %243
}