#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 */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(int);
double *calloc(int, int);
double exp(double);
double fmax(int, double);
int /*<<< orphan*/ free(double *);
double pow(double, double);
double sqrt(double);
extern double TrinomialTree(int EuropeanOption, int fCall, double S, double X,
                            double T, double r, double b, double v, double n) {
  int i, j, z;
  double dt, u, vsdt2, d, pu, pd, pm, Df, result;
  double *pval;
  assert(((S) == (S)) && (S) >= 0.000001 && (S) <= 1000000000000.0);
  assert(((X) == (X)) && (X) >= 0.000001 && (X) <= 1000000000000.0);
  assert(((T) == (T)) && (T) >= (1.0 / (253.0 * 24.0)) && (T) <= (20.0));
  assert(((r) == (r)) && (r) >= 0.0 && (r) <= 1000.0);
  assert(((b) == (b)) && (b) >= -1000.0 && (b) <= 1000.0);
  assert(((v) == (v)) && (v) >= 0.0000001 && v <= 100.99999);
  if ((pval = calloc(2 * n + 1, sizeof *pval)) == NULL) {
    abort();
  }
  if (fCall)
    z = 1;
  else
    z = -1;
  dt = T / n;
  u = exp(v * sqrt(2.0 * dt));
  vsdt2 = v * sqrt(dt / 2.0);
  d = exp(-v * sqrt(2.0 * dt));
  pu = (((exp(b * dt / 2.0) - exp(-vsdt2)) / (exp(vsdt2) - exp(-vsdt2))) *
        ((exp(b * dt / 2.0) - exp(-vsdt2)) / (exp(vsdt2) - exp(-vsdt2))));
  pd = (((exp(vsdt2) - exp(b * dt / 2.0)) / (exp(vsdt2) - exp(-vsdt2))) *
        ((exp(vsdt2) - exp(b * dt / 2.0)) / (exp(vsdt2) - exp(-vsdt2))));
  pm = 1.0 - pu - pd;
  Df = exp(-r * dt);
  for (i = 0; i <= 2 * n; i++) {
    pval[i] = fmax(0.0, z * (S * pow(u, fmax(i - n, 0.0)) *
                                 pow(d, fmax(n * 2.0 - n - i, 0.0)) -
                             X));
  }
  for (j = (int)n - 1; j >= 0; j--) {
    for (i = 0; i <= j * 2; i++) {
      if (EuropeanOption) {
        pval[i] = (pu * pval[i + 2] + pm * pval[i + 1] + pd * pval[i]) * Df;
      } else {
        pval[i] =
            fmax((z * (S * pow(u, fmax((double)i - j, 0.0)) *
                           pow(d, fmax((double)j * 2.0 - j - i, 0.0)) -
                       X)),
                 (pu * pval[i + 2] + pm * pval[i + 1] + pd * pval[i]) * Df);
      }
    }
  }
  result = pval[0];
  free(pval);
  assert(((result) == (result)));
  return result;
}


x86 assembly (clang, -O0):
<TrinomialTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0xa1(%rbp)
jne    1207 <TrinomialTree+0x87>
jp     1207 <TrinomialTree+0x87>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe1f(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xa1(%rbp)
jb     1207 <TrinomialTree+0x87>
movsd  0xe0f(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0xa2(%rbp)
jne    126a <TrinomialTree+0xea>
jp     126a <TrinomialTree+0xea>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdbc(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xa2(%rbp)
jb     126a <TrinomialTree+0xea>
movsd  0xdac(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0xa2(%rbp)
mov    -0xa2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x20(%rbp),%xmm0
mov    %al,-0xa3(%rbp)
jne    12cd <TrinomialTree+0x14d>
jp     12cd <TrinomialTree+0x14d>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd69(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xa3(%rbp)
jb     12cd <TrinomialTree+0x14d>
movsd  0xd59(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0xa3(%rbp)
mov    -0xa3(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x28(%rbp),%xmm0
mov    %al,-0xa4(%rbp)
jne    132b <TrinomialTree+0x1ab>
jp     132b <TrinomialTree+0x1ab>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xa4(%rbp)
jb     132b <TrinomialTree+0x1ab>
movsd  0xd03(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %al
mov    %al,-0xa4(%rbp)
mov    -0xa4(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0xa5(%rbp)
jne    138e <TrinomialTree+0x20e>
jp     138e <TrinomialTree+0x20e>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
movsd  0xcc0(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xa5(%rbp)
jb     138e <TrinomialTree+0x20e>
movsd  0xca0(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
setae  %al
mov    %al,-0xa5(%rbp)
mov    -0xa5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x38(%rbp),%xmm0
mov    %al,-0xa6(%rbp)
jne    13f1 <TrinomialTree+0x271>
jp     13f1 <TrinomialTree+0x271>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
movsd  0xc65(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xa6(%rbp)
jb     13f1 <TrinomialTree+0x271>
movsd  0xc55(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
setae  %al
mov    %al,-0xa6(%rbp)
mov    -0xa6(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  -0x40(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xc2e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0xa0(%rbp)
cmp    $0x0,%rax
jne    143c <TrinomialTree+0x2bc>
mov    $0x0,%al
call   1040 <abort@plt>
cmpl   $0x0,-0x8(%rbp)
je     1452 <TrinomialTree+0x2d2>
movl   $0x1,-0x4c(%rbp)
jmp    1459 <TrinomialTree+0x2d9>
movl   $0xffffffff,-0x4c(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  0xbcb(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  0xb8e(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  0xb45(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xb10(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <exp@plt>
movsd  -0x110(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x108(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xa5f(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <exp@plt>
movsd  -0xf8(%rbp),%xmm2
ff
movsd  -0xf0(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0xe8(%rbp),%xmm0
ff
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0x993(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <exp@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0x8f9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <exp@plt>
movsd  -0xc0(%rbp),%xmm2
ff
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0xb0(%rbp),%xmm0
ff
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0x86a(%rip),%xmm0
subsd  -0x78(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x58(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x0,-0x44(%rbp)
cvtsi2sdl -0x44(%rbp),%xmm1
movsd  0x81e(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1958 <TrinomialTree+0x7d8>
cvtsi2sdl -0x4c(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
cvtsi2sdl -0x44(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%edi
xorps  %xmm0,%xmm0
call   1080 <fmax@plt>
movaps %xmm0,%xmm1
movsd  -0x158(%rbp),%xmm0
ff
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x150(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
xorps  %xmm0,%xmm0
call   1080 <fmax@plt>
movaps %xmm0,%xmm1
movsd  -0x148(%rbp),%xmm0
ff
call   1090 <pow@plt>
movsd  -0x140(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0x138(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
xor    %edi,%edi
call   1080 <fmax@plt>
mov    -0xa0(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    181d <TrinomialTree+0x69d>
cvttsd2si -0x40(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jl     1ba9 <TrinomialTree+0xa29>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jg     1b96 <TrinomialTree+0xa16>
cmpl   $0x0,-0x4(%rbp)
je     1a08 <TrinomialTree+0x888>
movsd  -0x78(%rbp),%xmm1
mov    -0xa0(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x88(%rbp),%xmm0
ff
mov    -0xa0(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mov    -0xa0(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0xa0(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1b83 <TrinomialTree+0xa03>
cvtsi2sdl -0x4c(%rbp),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
cvtsi2sdl -0x44(%rbp),%xmm0
cvtsi2sdl -0x48(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
xorps  %xmm0,%xmm0
call   1080 <fmax@plt>
movaps %xmm0,%xmm1
movsd  -0x180(%rbp),%xmm0
ff
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x178(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
cvtsi2sdl -0x48(%rbp),%xmm0
cvtsi2sdl -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
xorps  %xmm0,%xmm0
call   1080 <fmax@plt>
movaps %xmm0,%xmm1
movsd  -0x170(%rbp),%xmm0
ff
call   1090 <pow@plt>
movsd  -0x168(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0x160(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x78(%rbp),%xmm1
mov    -0xa0(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x88(%rbp),%xmm0
ff
mov    -0xa0(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mov    -0xa0(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
call   1080 <fmax@plt>
mov    -0xa0(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1b88 <TrinomialTree+0xa08>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1974 <TrinomialTree+0x7f4>
jmp    1b9b <TrinomialTree+0xa1b>
mov    -0x48(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x48(%rbp)
jmp    1963 <TrinomialTree+0x7e3>
mov    -0xa0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x98(%rbp),%xmm0
ff
ucomisd -0x98(%rbp),%xmm0
ff
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  -0x98(%rbp),%xmm0
ff
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrinomialTree>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe60(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe5b(%rip),%xmm7
movsd  %xmm0,0xb0(%rsp)
ucomisd %xmm0,%xmm7
mov    %esi,%r14d
movsd  %xmm6,0x38(%rsp)
movaps %xmm5,0x20(%rsp)
movsd  %xmm4,0x10(%rsp)
movapd %xmm3,0x70(%rsp)
movsd  %xmm2,0x8(%rsp)
movaps %xmm1,0x80(%rsp)
mov    %edi,%r12d
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1060 <assert@plt>
movapd 0x80(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xdf6(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xdf1(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xdd3(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xdce(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1060 <assert@plt>
xorpd  %xmm0,%xmm0
movapd 0x70(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movsd  0xdac(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1060 <assert@plt>
movsd  0x10(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xd8e(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xd79(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1060 <assert@plt>
movapd 0x20(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xd63(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xd5e(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  0x38(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xd43(%rip),%xmm0
movsd  %xmm1,0x68(%rsp)
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     1902 <TrinomialTree+0x782>
mov    %rax,%rbx
xor    %ebp,%ebp
test   %r14d,%r14d
sete   %r14b
movsd  0x38(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xd00(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
jb     135e <TrinomialTree+0x1de>
sqrtsd %xmm0,%xmm0
jmp    1363 <TrinomialTree+0x1e3>
call   10a0 <sqrt@plt>
movapd 0x20(%rsp),%xmm1
mov    %r14b,%bpl
mulsd  %xmm1,%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xa8(%rsp)
movsd  0xcc2(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jb     139c <TrinomialTree+0x21c>
sqrtsd %xmm0,%xmm0
jmp    13a5 <TrinomialTree+0x225>
call   10a0 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x18(%rsp),%xmm1
lea    0xcae(%rip),%r14
movapd 0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm0,0x40(%rsp)
xorpd  0xca6(%rip),%xmm2
ucomisd %xmm3,%xmm1
jb     13d9 <TrinomialTree+0x259>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    13ee <TrinomialTree+0x26e>
movapd %xmm1,%xmm0
movapd %xmm2,0x20(%rsp)
call   10a0 <sqrt@plt>
movapd 0x20(%rsp),%xmm2
movsd  (%r14,%rbp,8),%xmm1
movsd  %xmm1,0xa0(%rsp)
mulsd  %xmm2,%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x98(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xc25(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1070 <exp@plt>
movsd  %xmm0,0x120(%rsp)
movaps 0x40(%rsp),%xmm0
xorps  0xc2d(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
call   1070 <exp@plt>
movsd  %xmm0,0x118(%rsp)
movaps 0x40(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x110(%rsp)
movaps 0x50(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x108(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x20(%rsp)
movaps 0x50(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xf8(%rsp)
movaps 0x40(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xf0(%rsp)
movaps 0x50(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xe8(%rsp)
movaps 0x40(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x100(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xe0(%rsp)
movaps 0x40(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xd8(%rsp)
movaps 0x50(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xd0(%rsp)
movaps 0x40(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xc8(%rsp)
movaps 0x40(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xc0(%rsp)
movaps 0x50(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0xb8(%rsp)
movapd 0x70(%rsp),%xmm0
xorpd  0xb05(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x40(%rsp)
xorpd  %xmm2,%xmm2
movsd  0x68(%rsp),%xmm0
ucomisd %xmm2,%xmm0
movsd  0x38(%rsp),%xmm1
jb     1669 <TrinomialTree+0x4e9>
subsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rsp)
movapd 0xac8(%rip),%xmm0
xorpd  0x80(%rsp),%xmm0
movapd %xmm0,0x70(%rsp)
xor    %ebp,%ebp
nopl   0x0(%rax)
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
xorpd  %xmm0,%xmm0
call   1080 <fmax@plt>
movapd %xmm0,%xmm1
movsd  0xa8(%rsp),%xmm0
call   1090 <pow@plt>
mulsd  0xb0(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x50(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
xorpd  %xmm0,%xmm0
call   1080 <fmax@plt>
movapd %xmm0,%xmm1
movsd  0x98(%rsp),%xmm0
call   1090 <pow@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x70(%rsp),%xmm0
mulsd  0xa0(%rsp),%xmm0
xor    %edi,%edi
call   1080 <fmax@plt>
movsd  0x38(%rsp),%xmm1
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
movsd  0x68(%rsp),%xmm0
ucomisd %xmm2,%xmm0
jae    15c0 <TrinomialTree+0x440>
cvttsd2si %xmm1,%eax
test   %eax,%eax
jle    18c3 <TrinomialTree+0x743>
movsd  0x120(%rsp),%xmm1
subsd  0x118(%rsp),%xmm1
movsd  0x110(%rsp),%xmm0
subsd  0x108(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
subsd  0xf8(%rsp),%xmm0
movsd  0xf0(%rsp),%xmm2
subsd  0xe8(%rsp),%xmm2
divsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x100(%rsp),%xmm2
subsd  0xe0(%rsp),%xmm2
movsd  0xd8(%rsp),%xmm1
subsd  0xd0(%rsp),%xmm1
divsd  %xmm1,%xmm2
movsd  0x18(%rsp),%xmm1
subsd  0xc8(%rsp),%xmm1
movsd  0xc0(%rsp),%xmm3
subsd  0xb8(%rsp),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
movsd  0x921(%rip),%xmm2
movsd  %xmm0,0x20(%rsp)
subsd  %xmm0,%xmm2
movsd  %xmm1,0x18(%rsp)
subsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movapd 0x80(%rsp),%xmm0
xorpd  0x926(%rip),%xmm0
movapd %xmm0,0x80(%rsp)
mov    %eax,%r14d
jmp    176c <TrinomialTree+0x5ec>
nopl   0x0(%rax,%rax,1)
cmpq   $0x2,0x70(%rsp)
jl     18c3 <TrinomialTree+0x743>
mov    %r14,0x70(%rsp)
add    $0xffffffffffffffff,%r14
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
lea    (%r14,%r14,1),%eax
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm0,0x68(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rsp)
movslq %eax,%r13
xor    %ebp,%ebp
jmp    1883 <TrinomialTree+0x703>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x10(%rsp)
subsd  0x68(%rsp),%xmm0
cvttsd2si %xmm0,%edi
xorpd  %xmm0,%xmm0
call   1080 <fmax@plt>
movapd %xmm0,%xmm1
movsd  0xa8(%rsp),%xmm0
call   1090 <pow@plt>
mulsd  0xb0(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x50(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
xorpd  %xmm0,%xmm0
call   1080 <fmax@plt>
movapd %xmm0,%xmm1
movsd  0x98(%rsp),%xmm0
call   1090 <pow@plt>
mulsd  0x38(%rsp),%xmm0
addsd  0x80(%rsp),%xmm0
mulsd  0xa0(%rsp),%xmm0
cvttsd2si %xmm0,%edi
lea    0x1(%rbp),%r15
movsd  0x8(%rbx,%rbp,8),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rbx,%rbp,8),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  (%rbx,%rbp,8),%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x40(%rsp),%xmm0
call   1080 <fmax@plt>
movsd  %xmm0,(%rbx,%rbp,8)
cmp    %r13,%rbp
mov    %r15,%rbp
jge    1760 <TrinomialTree+0x5e0>
test   %r12d,%r12d
je     17b0 <TrinomialTree+0x630>
lea    0x1(%rbp),%r15
movsd  0x8(%rbx,%rbp,8),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rbx,%rbp,8),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  (%rbx,%rbp,8),%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x40(%rsp),%xmm0
jmp    1872 <TrinomialTree+0x6f2>
movsd  (%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
movsd  0x20(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %dil
call   1060 <assert@plt>
movsd  0x20(%rsp),%xmm0
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1040 <abort@plt>

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

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