#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 /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
double pow(double, int);
void invgamma(int M, double s, double ds, double *low, double *high) {
  int i, ilo, ihi, n = 10000;
  double psum = 0.0, cdf = 0.0;
  double xmin, xmax, dx, xlo, xhi, plo, phi, tmp;
  double *x, *posterior;
  x = (double *)malloc(n * sizeof(double));
  posterior = (double *)malloc(n * sizeof(double));
  xmax = s + 50.0 * ds;
  xmin = s - 4.0 * ds;
  if (xmin < 0.01 * s)
    xmin = 0.01 * s;
  dx = (xmax - xmin) / (n - 1.0);
  ilo = (int)((s - xmin) / dx);
  ihi = ilo + 1;
  xlo = xmin + ilo * dx;
  xhi = xmin + ihi * dx;
  plo = pow(xlo, -M) * exp(-M * s * s / (2 * xlo * xlo));
  phi = pow(xhi, -M) * exp(-M * s * s / (2 * xhi * xhi));
  for (i = 0; i < n; i++) {
    if (ilo < 0 || ihi >= n)
      break;
    if (plo > phi) {
      posterior[i] = plo;
      x[i] = xlo;
      xlo = xmin + (--ilo) * dx;
      plo = pow(xlo, -M) * exp(-M * s * s / (2 * xlo * xlo));
    } else {
      posterior[i] = phi;
      x[i] = xhi;
      xhi = xmin + (++ihi) * dx;
      phi = pow(xhi, -M) * exp(-M * s * s / (2 * xhi * xhi));
    }
    psum += posterior[i];
  }
  for (; i < n; i++) {
    if (ilo < 0)
      x[i] = xmin + (ihi++) * dx;
    else
      x[i] = xmin + (ilo--) * dx;
    posterior[i] = pow(x[i], -M) * exp(-M * s * s / (2 * x[i] * x[i]));
  }
  for (i = 0; i < n; i++) {
    posterior[i] = posterior[i] / psum;
  }
  i = 0;
  while (cdf < 0.683) {
    cdf += posterior[i++];
  }
  *low = x[i];
  *high = tmp = x[--i];
  if (*low > *high) {
    *high = *low;
    *low = tmp;
  }
  while (1) {
    tmp = x[--i];
    if (*low < tmp && tmp < *high)
      break;
    else if (tmp < *low)
      *low = tmp;
    else
      *high = tmp;
  }
  *low = (s - *low);
  *high = (*high - s);
  free(x);
  free(posterior);
}


x86 assembly (clang, -O0):
<invgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movl   $0x2710,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x90(%rbp)
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x98(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe5b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe34(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0xe12(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    120f <invgamma+0xcf>
movsd  0xdfb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
movsd  0xdfa(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0x30(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1060 <pow@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xd5c(%rip),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1060 <pow@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xcff(%rip),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1505 <invgamma+0x3c5>
cmpl   $0x0,-0x30(%rbp)
jl     136d <invgamma+0x22d>
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jl     1372 <invgamma+0x232>
jmp    1505 <invgamma+0x3c5>
movsd  -0x78(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    1432 <invgamma+0x2f2>
movsd  -0x78(%rbp),%xmm0
mov    -0x98(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm1
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
cvtsi2sd %eax,%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1060 <pow@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xc16(%rip),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    14dd <invgamma+0x39d>
movsd  -0x80(%rbp),%xmm0
mov    -0x98(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm1
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cvtsi2sd %eax,%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1060 <pow@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xb66(%rip),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x98(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    134b <invgamma+0x20b>
jmp    150a <invgamma+0x3ca>
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    161e <invgamma+0x4de>
cmpl   $0x0,-0x30(%rbp)
jge    1556 <invgamma+0x416>
movsd  -0x50(%rbp),%xmm1
mov    -0x34(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
cvtsi2sd %eax,%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1587 <invgamma+0x447>
movsd  -0x50(%rbp),%xmm1
mov    -0x30(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x30(%rbp)
cvtsi2sd %eax,%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1060 <pow@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  0xa49(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x98(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    150a <invgamma+0x3ca>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1664 <invgamma+0x524>
mov    -0x98(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x40(%rbp),%xmm0
mov    -0x98(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1625 <invgamma+0x4e5>
movl   $0x0,-0x2c(%rbp)
movsd  0x9b5(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    16a7 <invgamma+0x567>
mov    -0x98(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    166b <invgamma+0x52b>
mov    -0x90(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x90(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x2c(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    171d <invgamma+0x5dd>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1722 <invgamma+0x5e2>
mov    -0x90(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x2c(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x88(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    177b <invgamma+0x63b>
movsd  -0x88(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    177b <invgamma+0x63b>
jmp    17c4 <invgamma+0x684>
movsd  -0x88(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    17aa <invgamma+0x66a>
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17ba <invgamma+0x67a>
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17bf <invgamma+0x67f>
jmp    1722 <invgamma+0x5e2>
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invgamma>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%r14
mov    %rsi,0x70(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x40(%rsp)
mov    %edi,%ebx
mov    $0x13880,%edi
call   1040 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    $0x13880,%edi
call   1040 <malloc@plt>
mov    %rax,%r15
movsd  0xe78(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm1
mulsd  0xe6e(%rip),%xmm0
movsd  0x40(%rsp),%xmm3
addsd  %xmm3,%xmm1
addsd  %xmm3,%xmm0
movsd  0xe60(%rip),%xmm2
mulsd  %xmm3,%xmm2
maxsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
divsd  0xe54(%rip),%xmm1
movapd %xmm3,%xmm0
subsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ebp
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
lea    0x1(%rbp),%r13d
mulsd  %xmm1,%xmm0
xorps  %xmm3,%xmm3
cvtsi2sd %r13d,%xmm3
addsd  %xmm2,%xmm0
movapd %xmm0,0x60(%rsp)
movsd  %xmm1,0x48(%rsp)
mulsd  %xmm1,%xmm3
movsd  %xmm2,0x38(%rsp)
addsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rsp)
neg    %ebx
mov    %ebx,%edi
call   1060 <pow@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
movsd  %xmm0,0x20(%rsp)
movsd  0x40(%rsp),%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x30(%rsp)
movapd 0x60(%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <exp@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %ebx,0x14(%rsp)
mov    %ebx,%edi
call   1060 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <exp@plt>
cmp    $0x270e,%ebp
jbe    12b8 <invgamma+0x178>
xorpd  %xmm2,%xmm2
xor    %eax,%eax
movsd  0x38(%rsp),%xmm1
jmp    1442 <invgamma+0x302>
mov    %r14,%rbx
movsd  0x18(%rsp),%xmm4
mulsd  %xmm0,%xmm4
movsd  0x20(%rsp),%xmm3
mulsd  0x50(%rsp),%xmm3
xorpd  %xmm2,%xmm2
xor    %r14d,%r14d
mov    0x14(%rsp),%edi
movsd  0x48(%rsp),%xmm5
movsd  0x38(%rsp),%xmm1
nopl   0x0(%rax,%rax,1)
movapd %xmm2,0x50(%rsp)
ucomisd %xmm4,%xmm3
jbe    1380 <invgamma+0x240>
movsd  %xmm3,(%r15,%r14,8)
mov    0x28(%rsp),%rax
movaps 0x60(%rsp),%xmm2
movsd  %xmm2,(%rax,%r14,8)
add    $0xffffffff,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,0x60(%rsp)
movsd  %xmm4,0x18(%rsp)
call   1060 <pow@plt>
movsd  %xmm0,0x20(%rsp)
movapd 0x60(%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <exp@plt>
movsd  0x18(%rsp),%xmm4
movapd %xmm0,%xmm3
mulsd  0x20(%rsp),%xmm3
jmp    13f7 <invgamma+0x2b7>
nopl   0x0(%rax)
movsd  %xmm4,(%r15,%r14,8)
mov    0x28(%rsp),%rax
movsd  0x8(%rsp),%xmm2
movsd  %xmm2,(%rax,%r14,8)
add    $0x1,%r13d
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm3,0x20(%rsp)
call   1060 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <exp@plt>
movsd  0x20(%rsp),%xmm3
movapd %xmm0,%xmm4
mulsd  0x18(%rsp),%xmm4
movapd 0x50(%rsp),%xmm2
addsd  (%r15,%r14,8),%xmm2
lea    0x1(%r14),%rax
cmp    $0x270e,%r14
mov    0x14(%rsp),%edi
movsd  0x48(%rsp),%xmm5
movsd  0x38(%rsp),%xmm1
ja     1434 <invgamma+0x2f4>
test   %ebp,%ebp
js     1434 <invgamma+0x2f4>
mov    %rax,%r14
cmp    $0x270f,%r13d
jle    12f0 <invgamma+0x1b0>
cmp    $0x270f,%eax
mov    %rbx,%r14
ja     14dd <invgamma+0x39d>
movapd %xmm2,0x50(%rsp)
mov    %eax,%ebx
mov    0x28(%rsp),%r12
nop
test   %ebp,%ebp
mov    %ebp,%eax
cmovs  %r13d,%eax
mov    %ebp,%ecx
shr    $0x1f,%ecx
add    %ecx,%r13d
mov    %ebp,%ecx
not    %ecx
sar    $0x1f,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    %ecx,%ebp
mulsd  0x48(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r12,%rbx,8)
mov    0x14(%rsp),%edi
call   1060 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%r12,%rbx,8),%xmm0
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <exp@plt>
movsd  0x38(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    $0x2710,%rbx
jne    1450 <invgamma+0x310>
movapd 0x50(%rsp),%xmm2
unpcklpd %xmm2,%xmm2
mov    $0x2,%eax
mov    0x70(%rsp),%rdx
nopl   0x0(%rax,%rax,1)
movupd -0x10(%r15,%rax,8),%xmm0
movupd (%r15,%rax,8),%xmm1
divpd  %xmm2,%xmm0
movupd %xmm0,-0x10(%r15,%rax,8)
divpd  %xmm2,%xmm1
movupd %xmm1,(%r15,%rax,8)
add    $0x4,%rax
cmp    $0x2712,%rax
jne    14f0 <invgamma+0x3b0>
xorpd  %xmm0,%xmm0
mov    $0xffffffffffffffff,%rax
movsd  0xaef(%rip),%xmm1
mov    0x28(%rsp),%rdi
cs nopw 0x0(%rax,%rax,1)
addsd  0x8(%r15,%rax,8),%xmm0
add    $0x1,%rax
ucomisd %xmm0,%xmm1
ja     1540 <invgamma+0x400>
lea    0x1(%rax),%ecx
movsd  (%rdi,%rcx,8),%xmm0
movsd  %xmm0,(%rdx)
mov    %eax,%ecx
movsd  (%rdi,%rcx,8),%xmm0
movsd  %xmm0,(%r14)
movsd  (%rdx),%xmm1
ucomisd %xmm0,%xmm1
jbe    157e <invgamma+0x43e>
movsd  %xmm1,(%r14)
movsd  %xmm0,(%rdx)
jmp    1582 <invgamma+0x442>
movapd %xmm1,%xmm0
cltq
lea    (%rdi,%rax,8),%rax
add    $0xfffffffffffffff8,%rax
jmp    159d <invgamma+0x45d>
xchg   %ax,%ax
movsd  %xmm1,(%r14)
movsd  (%rdx),%xmm0
add    $0xfffffffffffffff8,%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
jbe    15b2 <invgamma+0x472>
movsd  (%r14),%xmm2
ucomisd %xmm1,%xmm2
ja     15c6 <invgamma+0x486>
ucomisd %xmm1,%xmm0
jbe    1590 <invgamma+0x450>
movsd  %xmm1,(%rdx)
add    $0xfffffffffffffff8,%rax
movapd %xmm1,%xmm0
jmp    159d <invgamma+0x45d>
movsd  0x40(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
movsd  (%r14),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,(%r14)
call   1030 <free@plt>
mov    %r15,%rdi
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @invgamma(i32 %0, double %1, double %2, double* nocapture %3, double* nocapture %4) {
%6 = tail call i64 @malloc(i32 80000)
%7 = inttoptr i64 %6 to double*
%8 = tail call i64 @malloc(i32 80000)
%9 = inttoptr i64 %8 to double*
%10 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e+01, double %1)
%11 = tail call double @llvm.fmuladd.f64(double %2, double -4.000000e+00, double %1)
%12 = fmul double %1, 1.000000e-02
%13 = fcmp olt double %11, %12
%14 = select i1 %13, double %12, double %11
%15 = fsub double %10, %14
%16 = fdiv double %15, 9.999000e+03
%17 = fsub double %1, %14
%18 = fdiv double %17, %16
%19 = fptosi double %18 to i32
%20 = add nsw i32 %19, 1
%21 = sitofp i32 %19 to double
%22 = tail call double @llvm.fmuladd.f64(double %21, double %16, double %14)
%23 = sitofp i32 %20 to double
%24 = tail call double @llvm.fmuladd.f64(double %23, double %16, double %14)
%25 = sub nsw i32 0, %0
%26 = tail call double @pow(double %22, i32 %25)
%27 = sitofp i32 %25 to double
%28 = fmul double %27, %1
%29 = fmul double %28, %1
%30 = fmul double %22, 2.000000e+00
%31 = fmul double %22, %30
%32 = fdiv double %29, %31
%33 = fptosi double %32 to i32
%34 = tail call double @exp(i32 %33)
%35 = tail call double @pow(double %24, i32 %25)
%36 = fmul double %24, 2.000000e+00
%37 = fmul double %24, %36
%38 = fdiv double %29, %37
%39 = fptosi double %38 to i32
%40 = tail call double @exp(i32 %39)
%41 = icmp ugt i32 %19, 9998
br i1 %41, label %48, label %42
42: ; preds = %5
%43 = fmul double %35, %40
%44 = fmul double %26, %34
br label %54
45: ; preds = %89
%46 = trunc i64 %99 to i32
%47 = icmp ult i32 %46, 10000
br i1 %47, label %48, label %105
48: ; preds = %5, %45
%49 = phi i64 [ %99, %45 ], [ 0, %5 ]
%50 = phi i32 [ %95, %45 ], [ %19, %5 ]
%51 = phi i32 [ %90, %45 ], [ %20, %5 ]
%52 = phi double [ %98, %45 ], [ 0.000000e+00, %5 ]
%53 = and i64 %49, 4294967295
br label %124
54: ; preds = %42, %89
%55 = phi i64 [ 0, %42 ], [ %99, %89 ]
%56 = phi i32 [ %19, %42 ], [ %95, %89 ]
%57 = phi double [ %43, %42 ], [ %94, %89 ]
%58 = phi double [ %44, %42 ], [ %93, %89 ]
%59 = phi double [ %24, %42 ], [ %92, %89 ]
%60 = phi double [ %22, %42 ], [ %91, %89 ]
%61 = phi i32 [ %20, %42 ], [ %90, %89 ]
%62 = phi double [ 0.000000e+00, %42 ], [ %98, %89 ]
%63 = fcmp ogt double %58, %57
%64 = getelementptr inbounds double, double* %9, i64 %55
br i1 %63, label %65, label %77
65: ; preds = %54
store double %58, double* %64
%66 = getelementptr inbounds double, double* %7, i64 %55
store double %60, double* %66
%67 = add nsw i32 %56, -1
%68 = sitofp i32 %67 to double
%69 = tail call double @llvm.fmuladd.f64(double %68, double %16, double %14)
%70 = tail call double @pow(double %69, i32 %25)
%71 = fmul double %69, 2.000000e+00
%72 = fmul double %69, %71
%73 = fdiv double %29, %72
%74 = fptosi double %73 to i32
%75 = tail call double @exp(i32 %74)
%76 = fmul double %70, %75
br label %89
77: ; preds = %54
store double %57, double* %64
%78 = getelementptr inbounds double, double* %7, i64 %55
store double %59, double* %78
%79 = add nsw i32 %61, 1
%80 = sitofp i32 %79 to double
%81 = tail call double @llvm.fmuladd.f64(double %80, double %16, double %14)
%82 = tail call double @pow(double %81, i32 %25)
%83 = fmul double %81, 2.000000e+00
%84 = fmul double %81, %83
%85 = fdiv double %29, %84
%86 = fptosi double %85 to i32
%87 = tail call double @exp(i32 %86)
%88 = fmul double %82, %87
br label %89
89: ; preds = %77, %65
%90 = phi i32 [ %61, %65 ], [ %79, %77 ]
%91 = phi double [ %69, %65 ], [ %60, %77 ]
%92 = phi double [ %59, %65 ], [ %81, %77 ]
%93 = phi double [ %76, %65 ], [ %58, %77 ]
%94 = phi double [ %57, %65 ], [ %88, %77 ]
%95 = phi i32 [ %67, %65 ], [ %56, %77 ]
%96 = getelementptr inbounds double, double* %9, i64 %55
%97 = load double, double* %96
%98 = fadd double %62, %97
%99 = add nuw nsw i64 %55, 1
%100 = icmp ugt i64 %55, 9998
%101 = icmp slt i32 %95, 0
%102 = select i1 %100, i1 true, i1 %101
%103 = icmp sgt i32 %90, 9999
%104 = select i1 %102, i1 true, i1 %103
br i1 %104, label %45, label %54
105: ; preds = %124, %45
%106 = phi double [ %98, %45 ], [ %52, %124 ]
%107 = insertelement <2 x double> poison, double %106, i64 0
%108 = shufflevector <2 x double> %107, <2 x double> poison, <2 x i32> zeroinitializer
br label %109
109: ; preds = %109, %105
%110 = phi i64 [ 0, %105 ], [ %122, %109 ]
%111 = getelementptr inbounds double, double* %9, i64 %110
%112 = bitcast double* %111 to <2 x double>*
%113 = load <2 x double>, <2 x double>* %112
%114 = fdiv <2 x double> %113, %108
%115 = bitcast double* %111 to <2 x double>*
store <2 x double> %114, <2 x double>* %115
%116 = or i64 %110, 2
%117 = getelementptr inbounds double, double* %9, i64 %116
%118 = bitcast double* %117 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = fdiv <2 x double> %119, %108
%121 = bitcast double* %117 to <2 x double>*
store <2 x double> %120, <2 x double>* %121
%122 = add nuw nsw i64 %110, 4
%123 = icmp eq i64 %122, 10000
br i1 %123, label %149, label %109
124: ; preds = %48, %124
%125 = phi i64 [ %53, %48 ], [ %147, %124 ]
%126 = phi i32 [ %50, %48 ], [ %134, %124 ]
%127 = phi i32 [ %51, %48 ], [ %131, %124 ]
%128 = icmp slt i32 %126, 0
%129 = select i1 %128, i32 %127, i32 %126
%130 = lshr i32 %126, 31
%131 = add nsw i32 %127, %130
%132 = xor i1 %128, true
%133 = sext i1 %132 to i32
%134 = add nsw i32 %126, %133
%135 = sitofp i32 %129 to double
%136 = tail call double @llvm.fmuladd.f64(double %135, double %16, double %14)
%137 = getelementptr inbounds double, double* %7, i64 %125
store double %136, double* %137
%138 = tail call double @pow(double %136, i32 %25)
%139 = load double, double* %137
%140 = fmul double %139, 2.000000e+00
%141 = fmul double %139, %140
%142 = fdiv double %29, %141
%143 = fptosi double %142 to i32
%144 = tail call double @exp(i32 %143)
%145 = fmul double %138, %144
%146 = getelementptr inbounds double, double* %9, i64 %125
store double %145, double* %146
%147 = add nuw nsw i64 %125, 1
%148 = icmp eq i64 %147, 10000
br i1 %148, label %105, label %124
149: ; preds = %109, %149
%150 = phi i64 [ %152, %149 ], [ 0, %109 ]
%151 = phi double [ %155, %149 ], [ 0.000000e+00, %109 ]
%152 = add nuw i64 %150, 1
%153 = getelementptr inbounds double, double* %9, i64 %150
%154 = load double, double* %153
%155 = fadd double %151, %154
%156 = fcmp olt double %155, 6.830000e-01
br i1 %156, label %149, label %157
157: ; preds = %149
%158 = and i64 %152, 4294967295
%159 = getelementptr inbounds double, double* %7, i64 %158
%160 = load double, double* %159
store double %160, double* %3
%161 = and i64 %150, 4294967295
%162 = getelementptr inbounds double, double* %7, i64 %161
%163 = load double, double* %162
store double %163, double* %4
%164 = load double, double* %3
%165 = fcmp ogt double %164, %163
br i1 %165, label %166, label %167
166: ; preds = %157
store double %164, double* %4
store double %163, double* %3
br label %167
167: ; preds = %166, %157
%168 = phi double [ %163, %166 ], [ %164, %157 ]
%169 = shl i64 %150, 32
%170 = ashr exact i64 %169, 32
br label %171
171: ; preds = %184, %167
%172 = phi double [ %168, %167 ], [ %185, %184 ]
%173 = phi i64 [ %170, %167 ], [ %174, %184 ]
%174 = add i64 %173, -1
%175 = getelementptr inbounds double, double* %7, i64 %174
%176 = load double, double* %175
%177 = fcmp olt double %172, %176
br i1 %177, label %178, label %181
178: ; preds = %171
%179 = load double, double* %4
%180 = fcmp olt double %176, %179
br i1 %180, label %188, label %181
181: ; preds = %178, %171
%182 = fcmp olt double %176, %172
br i1 %182, label %183, label %186
183: ; preds = %181
store double %176, double* %3
br label %184
184: ; preds = %183, %186
%185 = phi double [ %176, %183 ], [ %187, %186 ]
br label %171
186: ; preds = %181
store double %176, double* %4
%187 = load double, double* %3
br label %184
188: ; preds = %178
%189 = fsub double %1, %172
store double %189, double* %3
%190 = load double, double* %4
%191 = fsub double %190, %1
store double %191, double* %4
%192 = tail call i32 @free(double* %7)
%193 = tail call i32 @free(double* %9)
ret void
}