extern double ThreeDimensionalBinomial(int type, int EuropeanOption, int fCall,
                                       double S1, double S2, double Q1,
                                       double Q2, double X1, double X2,
                                       double T, double r, double b1, double b2,
                                       double v1, double v2, double rho_,
                                       int n) {
  double result, dt, sdt, mu1, mu2, u, d;
  int i, j, m;
  double optval[n + 1][n + 1];
  assert(((S1) == (S1)) && (S1) >= 0.000001 && (S1) <= 1000000000000.0);
  assert(((S2) == (S2)) && (S2) >= 0.000001 && (S2) <= 1000000000000.0);
  assert(((X1) == (X1)) && (X1) >= 0.000001 && (X1) <= 1000000000000.0);
  assert(((X2) == (X2)) && (X2) >= 0.000001 && (X2) <= 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(((b1) == (b1)) && (b1) >= -1000.0 && (b1) <= 1000.0);
  assert(((b2) == (b2)) && (b2) >= -1000.0 && (b2) <= 1000.0);
  assert(((v1) == (v1)) && (v1) >= 0.0000001 && v1 <= 100.99999);
  assert(((v2) == (v2)) && (v2) >= 0.0000001 && v2 <= 100.99999);
  assert(n > 0);
  assert(type >= 1);
  assert(type <= 7);
  dt = T / n;
  sdt = sqrt(dt);
  mu1 = b1 - ((v1) * (v1)) / 2.0;
  mu2 = b2 - ((v2) * (v2)) / 2.0;
  u = exp(mu1 * dt + v1 * sdt);
  d = exp(mu1 * dt - v1 * sdt);
  for (j = 0; j <= n; j++) {
    const double Y1 = (2.0 * j - n) * sdt;
    const double NodeValueS1 = S1 * pow(u, (double)j) * pow(d, (double)(n - j));
    for (i = 0; i <= n; i++) {
      double NodeValueS2;
      const double y2 =
          rho_ * Y1 + sqrt(1.0 - ((rho_) * (rho_))) * (2.0 * i - n) * sdt;
      (void)y2;
      NodeValueS2 = S2 * exp(mu2 * n * dt) *
                    exp(v2 * (rho_ * Y1 + sqrt(1 - ((rho_) * (rho_))) *
                                              (2.0 * i - n) * sdt));
      optval[j][i] =
          PayoffFunction(type, fCall, NodeValueS1, NodeValueS2, Q1, Q2, X1, X2);
    }
  }
  for (m = n - 1; m >= 0; m--) {
    for (j = 0; j <= m; j++) {
      const double Y1 = (2.0 * j - m) * sdt;
      const double NodeValueS1 =
          S1 * pow(u, (double)j) * pow(d, (double)(m - j));
      for (i = 0; i <= m; i++) {
        const double y2 =
            rho_ * Y1 + sqrt(1.0 - ((rho_) * (rho_))) * (2.0 * i - m) * sdt;
        const double NodeValueS2 = S2 * exp(mu2 * m * dt) * exp(v2 * y2);
        optval[j][i] = 0.25 *
                       (optval[j][i] + optval[j + 1][i] + optval[j][i + 1] +
                        optval[j + 1][i + 1]) *
                       exp(-r * dt);
        if (!EuropeanOption) {
          optval[j][i] =
              fmax(optval[j][i], PayoffFunction(type, fCall, NodeValueS1,
                                                NodeValueS2, Q1, Q2, X1, X2));
        }
      }
    }
  }
  result = optval[0][0];
  assert(((result) == (result)));
  return result;
}


x86 assembly (clang, -O0):
<ThreeDimensionalBinomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movsd  0x30(%rbp),%xmm8
movsd  0x28(%rbp),%xmm8
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
movsd  %xmm5,-0x40(%rbp)
movsd  %xmm6,-0x48(%rbp)
movsd  %xmm7,-0x50(%rbp)
mov    %ecx,-0x54(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %rax,-0x110(%rbp)
mov    %rax,%rcx
mov    %rsp,%rdx
mov    %rdx,-0xa8(%rbp)
mov    %rax,%rdx
imul   %rdx,%rdx
lea    0xf(,%rdx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x108(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0xb0(%rbp)
mov    %rax,-0xb8(%rbp)
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0xf9(%rbp)
jne    124b <ThreeDimensionalBinomial+0xfb>
jp     124b <ThreeDimensionalBinomial+0xfb>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xddb(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xf9(%rbp)
jb     124b <ThreeDimensionalBinomial+0xfb>
movsd  0xdcb(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0xf9(%rbp)
mov    -0xf9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x20(%rbp),%xmm0
mov    %al,-0x111(%rbp)
jne    12b0 <ThreeDimensionalBinomial+0x160>
jp     12b0 <ThreeDimensionalBinomial+0x160>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd76(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x111(%rbp)
jb     12b0 <ThreeDimensionalBinomial+0x160>
movsd  0xd66(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0x111(%rbp)
mov    -0x111(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x38(%rbp),%xmm0
mov    %al,-0x112(%rbp)
jne    1315 <ThreeDimensionalBinomial+0x1c5>
jp     1315 <ThreeDimensionalBinomial+0x1c5>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd11(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x112(%rbp)
jb     1315 <ThreeDimensionalBinomial+0x1c5>
movsd  0xd01(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
setae  %al
mov    %al,-0x112(%rbp)
mov    -0x112(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x40(%rbp),%xmm0
mov    %al,-0x113(%rbp)
jne    137a <ThreeDimensionalBinomial+0x22a>
jp     137a <ThreeDimensionalBinomial+0x22a>
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
movsd  0xcac(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x113(%rbp)
jb     137a <ThreeDimensionalBinomial+0x22a>
movsd  0xc9c(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
mov    %al,-0x113(%rbp)
mov    -0x113(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x48(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x48(%rbp),%xmm0
mov    %al,-0x114(%rbp)
jne    13df <ThreeDimensionalBinomial+0x28f>
jp     13df <ThreeDimensionalBinomial+0x28f>
movsd  -0x48(%rbp),%xmm0
xor    %eax,%eax
movsd  0xc57(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x114(%rbp)
jb     13df <ThreeDimensionalBinomial+0x28f>
movsd  0xc47(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
setae  %al
mov    %al,-0x114(%rbp)
mov    -0x114(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x50(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x50(%rbp),%xmm0
mov    %al,-0x115(%rbp)
jne    143f <ThreeDimensionalBinomial+0x2ef>
jp     143f <ThreeDimensionalBinomial+0x2ef>
movsd  -0x50(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x115(%rbp)
jb     143f <ThreeDimensionalBinomial+0x2ef>
movsd  0xbef(%rip),%xmm0
ucomisd -0x50(%rbp),%xmm0
setae  %al
mov    %al,-0x115(%rbp)
mov    -0x115(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd 0x10(%rbp),%xmm0
mov    %al,-0x116(%rbp)
jne    14a4 <ThreeDimensionalBinomial+0x354>
jp     14a4 <ThreeDimensionalBinomial+0x354>
movsd  0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xbaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x116(%rbp)
jb     14a4 <ThreeDimensionalBinomial+0x354>
movsd  0xb8a(%rip),%xmm0
ucomisd 0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x116(%rbp)
mov    -0x116(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd 0x18(%rbp),%xmm0
mov    %al,-0x117(%rbp)
jne    1509 <ThreeDimensionalBinomial+0x3b9>
jp     1509 <ThreeDimensionalBinomial+0x3b9>
movsd  0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xb45(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x117(%rbp)
jb     1509 <ThreeDimensionalBinomial+0x3b9>
movsd  0xb25(%rip),%xmm0
ucomisd 0x18(%rbp),%xmm0
setae  %al
mov    %al,-0x117(%rbp)
mov    -0x117(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd 0x20(%rbp),%xmm0
mov    %al,-0x118(%rbp)
jne    156e <ThreeDimensionalBinomial+0x41e>
jp     156e <ThreeDimensionalBinomial+0x41e>
movsd  0x20(%rbp),%xmm0
xor    %eax,%eax
movsd  0xae8(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x118(%rbp)
jb     156e <ThreeDimensionalBinomial+0x41e>
movsd  0xad8(%rip),%xmm0
ucomisd 0x20(%rbp),%xmm0
setae  %al
mov    %al,-0x118(%rbp)
mov    -0x118(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd 0x28(%rbp),%xmm0
mov    %al,-0x119(%rbp)
jne    15d3 <ThreeDimensionalBinomial+0x483>
jp     15d3 <ThreeDimensionalBinomial+0x483>
movsd  0x28(%rbp),%xmm0
xor    %eax,%eax
movsd  0xa83(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x119(%rbp)
jb     15d3 <ThreeDimensionalBinomial+0x483>
movsd  0xa73(%rip),%xmm0
ucomisd 0x28(%rbp),%xmm0
setae  %al
mov    %al,-0x119(%rbp)
mov    -0x119(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x0,-0x54(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x1,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x7,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x48(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0x10(%rbp),%xmm0
movsd  0x20(%rbp),%xmm1
mulsd  0x20(%rbp),%xmm1
movsd  0x9e9(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0x18(%rbp),%xmm0
movsd  0x28(%rbp),%xmm1
mulsd  0x28(%rbp),%xmm1
movsd  0x9c5(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  0x20(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  0x20(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     1a15 <ThreeDimensionalBinomial+0x8c5>
cvtsi2sdl -0x98(%rbp),%xmm0
ff
cvtsi2sdl -0x54(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
cvtsi2sdl -0x98(%rbp),%xmm1
ff
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x54(%rbp),%eax
sub    -0x98(%rbp),%eax
cvtsi2sd %eax,%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     19fc <ThreeDimensionalBinomial+0x8ac>
movsd  0x30(%rbp),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x168(%rbp)
ff
movsd  0x30(%rbp),%xmm0
movsd  0x30(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x840(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  -0x168(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x160(%rbp),%xmm0
ff
cvtsi2sdl -0x94(%rbp),%xmm3
ff
cvtsi2sdl -0x54(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
addsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x158(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  0x28(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  0x30(%rbp),%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
movsd  0x30(%rbp),%xmm0
movsd  0x30(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x74c(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  -0x150(%rbp),%xmm1
ff
movsd  -0x148(%rbp),%xmm3
ff
movaps %xmm0,%xmm2
movsd  -0x140(%rbp),%xmm0
ff
cvtsi2sdl -0x94(%rbp),%xmm4
ff
cvtsi2sdl -0x54(%rbp),%xmm5
movq   %xmm5,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm5
addsd  %xmm4,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
mulsd  -0x70(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x138(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0xd0(%rbp),%xmm1
ff
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm5
mov    $0x6,%al
call   1040 <PayoffFunction@plt>
mov    -0x110(%rbp),%rdx
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
cvtsi2sd %ecx,%xmm0
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    17b7 <ThreeDimensionalBinomial+0x667>
jmp    1a01 <ThreeDimensionalBinomial+0x8b1>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    16fb <ThreeDimensionalBinomial+0x5ab>
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x9c(%rbp)
cmpl   $0x0,-0x9c(%rbp)
jl     1e4f <ThreeDimensionalBinomial+0xcff>
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x9c(%rbp),%eax
jg     1e36 <ThreeDimensionalBinomial+0xce6>
cvtsi2sdl -0x98(%rbp),%xmm0
ff
cvtsi2sdl -0x9c(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
cvtsi2sdl -0x98(%rbp),%xmm1
ff
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x178(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x9c(%rbp),%eax
sub    -0x98(%rbp),%eax
cvtsi2sd %eax,%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x170(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x9c(%rbp),%eax
jg     1e1d <ThreeDimensionalBinomial+0xccd>
movsd  0x30(%rbp),%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  0x30(%rbp),%xmm0
movsd  0x30(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x4f7(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  -0x1a0(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x198(%rbp),%xmm0
ff
cvtsi2sdl -0x94(%rbp),%xmm3
ff
cvtsi2sdl -0x9c(%rbp),%xmm4
ff
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
addsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
cvtsi2sdl -0x9c(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x190(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  0x28(%rbp),%xmm0
mulsd  -0xf0(%rbp),%xmm0
ff
call   1050 <exp@plt>
mov    -0x110(%rbp),%rdx
mov    -0x108(%rbp),%rax
movaps %xmm0,%xmm1
movsd  -0x188(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movslq -0x98(%rbp),%rsi
imul   %rdx,%rsi
shl    $0x3,%rsi
mov    %rax,%rcx
add    %rsi,%rcx
movslq -0x94(%rbp),%rsi
movsd  (%rcx,%rsi,8),%xmm1
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rsi
imul   %rdx,%rsi
shl    $0x3,%rsi
mov    %rax,%rcx
add    %rsi,%rcx
movslq -0x94(%rbp),%rsi
addsd  (%rcx,%rsi,8),%xmm1
movslq -0x98(%rbp),%rsi
imul   %rdx,%rsi
shl    $0x3,%rsi
mov    %rax,%rcx
add    %rsi,%rcx
mov    -0x94(%rbp),%esi
add    $0x1,%esi
movslq %esi,%rsi
addsd  (%rcx,%rsi,8),%xmm1
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0x378(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1050 <exp@plt>
mov    -0x110(%rbp),%rdx
mov    -0x108(%rbp),%rax
movaps %xmm0,%xmm1
movsd  -0x180(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
cmpl   $0x0,-0x8(%rbp)
jne    1e04 <ThreeDimensionalBinomial+0xcb4>
mov    -0x108(%rbp),%rax
mov    -0x110(%rbp),%rdx
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
movsd  -0xe8(%rbp),%xmm0
ff
movsd  -0xf8(%rbp),%xmm1
ff
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm5
mov    $0x6,%al
call   1040 <PayoffFunction@plt>
movsd  -0x1a8(%rbp),%xmm3
ff
mov    -0x110(%rbp),%rdx
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
cvtsi2sd %ecx,%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1e09 <ThreeDimensionalBinomial+0xcb9>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1afd <ThreeDimensionalBinomial+0x9ad>
jmp    1e22 <ThreeDimensionalBinomial+0xcd2>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1a38 <ThreeDimensionalBinomial+0x8e8>
jmp    1e3b <ThreeDimensionalBinomial+0xceb>
mov    -0x9c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x9c(%rbp)
jmp    1a21 <ThreeDimensionalBinomial+0x8d1>
mov    -0x108(%rbp),%rax
mov    -0x110(%rbp),%rcx
imul   $0x0,%rcx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x60(%rbp),%xmm0
mov    -0xa8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreeDimensionalBinomial>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %ecx,%r14d
movaps %xmm7,-0x100(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm5,-0x90(%rbp)
ff
movsd  %xmm4,-0x88(%rbp)
ff
movsd  %xmm3,-0xe8(%rbp)
ff
movsd  %xmm2,-0xe0(%rbp)
ff
movsd  %xmm1,-0x80(%rbp)
mov    %edx,-0x50(%rbp)
mov    %esi,-0xb4(%rbp)
mov    %edi,%ebx
lea    0x1(%r14),%r13d
mov    %r13,%rax
imul   %r13,%rax
mov    %rsp,%rcx
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe2a(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe25(%rip),%xmm1
movsd  %xmm0,-0xd8(%rbp)
ff
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  -0x80(%rbp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xdee(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xde9(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  -0x88(%rbp),%xmm0
ff
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xdb7(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xdb2(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  -0x90(%rbp),%xmm0
ff
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xd80(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xd7b(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  -0x40(%rbp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xd5c(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xd57(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xorpd  %xmm1,%xmm1
movapd -0x100(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
setae  %al
movsd  0xd31(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x10(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xd12(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xcfd(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x18(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xcde(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  %xmm0,-0x58(%rbp)
movsd  0xcc4(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x20(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xcad(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xca8(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x28(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xc79(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xc74(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14d,%r14d
setg   %dil
xor    %eax,%eax
call   1030 <assert@plt>
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
xor    %eax,%eax
call   1030 <assert@plt>
xor    %edi,%edi
mov    %ebx,-0x4c(%rbp)
cmp    $0x8,%ebx
mov    %r14,%rbx
setl   %dil
xor    %eax,%eax
call   1030 <assert@plt>
movsd  -0x40(%rbp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movapd %xmm0,-0x70(%rbp)
divsd  %xmm0,%xmm2
ucomisd 0xc2f(%rip),%xmm2
movsd  %xmm2,-0x40(%rbp)
jb     1439 <ThreeDimensionalBinomial+0x2e9>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1447 <ThreeDimensionalBinomial+0x2f7>
movapd %xmm2,%xmm0
call   1070 <sqrt@plt>
movsd  -0x40(%rbp),%xmm2
movsd  %xmm0,-0x60(%rbp)
movapd %xmm0,%xmm1
movsd  0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movapd %xmm1,%xmm4
movsd  %xmm1,-0x38(%rbp)
mulsd  %xmm3,%xmm3
movsd  0xbd2(%rip),%xmm0
mulsd  %xmm0,%xmm3
movsd  0x10(%rbp),%xmm5
subsd  %xmm3,%xmm5
movsd  0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mulsd  %xmm2,%xmm5
movsd  %xmm5,-0x30(%rbp)
movapd %xmm5,%xmm0
addsd  %xmm4,%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
test   %ebx,%ebx
js     16c3 <ThreeDimensionalBinomial+0x573>
movsd  -0x58(%rbp),%xmm1
movapd -0x70(%rbp),%xmm0
mulsd  %xmm0,%xmm1
xorpd  0xb77(%rip),%xmm0
movapd %xmm0,-0x70(%rbp)
movsd  0x30(%rbp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xb49(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  -0x40(%rbp),%xmm1
movsd  %xmm1,-0x110(%rbp)
ff
lea    0x0(,%r13,8),%rax
mov    %rax,-0x98(%rbp)
xor    %r15d,%r15d
movsd  %xmm2,-0x38(%rbp)
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x48(%rbp),%r12
jmp    1557 <ThreeDimensionalBinomial+0x407>
nopl   0x0(%rax)
add    $0x1,%r15
add    -0x98(%rbp),%r12
cmp    %r13,%r15
mov    %r14,%rbx
je     16c3 <ThreeDimensionalBinomial+0x573>
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x70(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
call   1060 <pow@plt>
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x30(%rbp)
mov    %rbx,%r14
mov    %ebx,%eax
sub    %r15d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
call   1060 <pow@plt>
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
xor    %ebx,%ebx
jmp    166b <ThreeDimensionalBinomial+0x51b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
addsd  %xmm1,%xmm1
addsd  -0x70(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mulsd  -0x60(%rbp),%xmm1
movsd  0x30(%rbp),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
mulsd  0x28(%rbp),%xmm0
call   1050 <exp@plt>
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm0,%xmm1
mov    -0x4c(%rbp),%edi
mov    -0x50(%rbp),%esi
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xe0(%rbp),%xmm2
ff
movsd  -0xe8(%rbp),%xmm3
ff
movsd  -0x88(%rbp),%xmm4
ff
movsd  -0x90(%rbp),%xmm5
ff
mov    $0x6,%al
call   1040 <PayoffFunction@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r13
je     1540 <ThreeDimensionalBinomial+0x3f0>
movsd  -0x38(%rbp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     16b6 <ThreeDimensionalBinomial+0x566>
movsd  -0x110(%rbp),%xmm0
ff
call   1050 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd 0x9bf(%rip),%xmm0
movsd  -0xa0(%rbp),%xmm0
ff
jae    15d0 <ThreeDimensionalBinomial+0x480>
movsd  -0x38(%rbp),%xmm0
call   1070 <sqrt@plt>
jmp    15d0 <ThreeDimensionalBinomial+0x480>
ucomisd %xmm1,%xmm0
jae    167a <ThreeDimensionalBinomial+0x52a>
call   1070 <sqrt@plt>
jmp    167a <ThreeDimensionalBinomial+0x52a>
mov    %r13,-0xc0(%rbp)
test   %ebx,%ebx
movsd  -0x40(%rbp),%xmm1
jle    19c6 <ThreeDimensionalBinomial+0x876>
movsd  0x30(%rbp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0x960(%rip),%xmm2
subsd  %xmm0,%xmm2
movapd -0x100(%rbp),%xmm0
ff
xorpd  0x964(%rip),%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,-0x100(%rbp)
ff
mov    %ebx,%eax
mov    %rax,-0x78(%rbp)
mov    -0xc0(%rbp),%rax
mov    -0x48(%rbp),%rcx
lea    0x8(%rcx,%rax,8),%rcx
mov    %rcx,-0x118(%rbp)
lea    0x0(,%rax,8),%rax
mov    %rax,-0x120(%rbp)
movsd  %xmm2,-0x70(%rbp)
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
jmp    175f <ThreeDimensionalBinomial+0x60f>
nopw   0x0(%rax,%rax,1)
cmp    $0x2,%r12
movsd  -0x40(%rbp),%xmm1
jl     19c6 <ThreeDimensionalBinomial+0x876>
mov    -0x78(%rbp),%r12
lea    -0x1(%r12),%rax
mov    %rax,-0x78(%rbp)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm0,%xmm2
xorpd  0x8dc(%rip),%xmm0
movapd %xmm0,-0x110(%rbp)
ff
mulsd  %xmm1,%xmm2
movsd  %xmm2,-0x98(%rbp)
ff
mov    -0x48(%rbp),%r13
mov    -0x118(%rbp),%r14
xor    %ebx,%ebx
jmp    17c9 <ThreeDimensionalBinomial+0x679>
nopw   0x0(%rax,%rax,1)
mov    -0x120(%rbp),%rax
add    %rax,%r14
add    %rax,%r13
mov    -0x128(%rbp),%rbx
cmp    %r12,%rbx
je     1750 <ThreeDimensionalBinomial+0x600>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x110(%rbp),%xmm0
ff
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
call   1060 <pow@plt>
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x30(%rbp)
mov    -0x78(%rbp),%rax
sub    %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
call   1060 <pow@plt>
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
mov    %rbx,%rax
imul   -0xc0(%rbp),%rax
ff
add    $0x1,%rbx
mov    %rbx,-0x128(%rbp)
mov    -0x48(%rbp),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
xor    %r15d,%r15d
jmp    1929 <ThreeDimensionalBinomial+0x7d9>
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
addsd  %xmm1,%xmm1
addsd  -0x110(%rbp),%xmm1
ff
mulsd  %xmm0,%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  0x30(%rbp),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
call   1050 <exp@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  0x28(%rbp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x38(%rbp),%xmm1
addsd  -0x8(%r14,%r15,8),%xmm1
lea    0x1(%r15),%rbx
movsd  0x8(%r13,%r15,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
addsd  %xmm0,%xmm1
addsd  (%r14,%r15,8),%xmm1
movsd  %xmm1,-0x30(%rbp)
movapd -0x100(%rbp),%xmm0
ff
call   1050 <exp@plt>
movsd  -0x30(%rbp),%xmm1
mulsd  0x74c(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm1,0x0(%r13,%r15,8)
cmpl   $0x0,-0xb4(%rbp)
je     1960 <ThreeDimensionalBinomial+0x810>
mov    %rbx,%r15
cmp    %rbx,%r12
je     17b0 <ThreeDimensionalBinomial+0x660>
movsd  -0x70(%rbp),%xmm0
ucomisd 0x722(%rip),%xmm0
movsd  -0x138(%rbp),%xmm0
ff
jae    1860 <ThreeDimensionalBinomial+0x710>
movsd  -0x70(%rbp),%xmm0
call   1070 <sqrt@plt>
jmp    1860 <ThreeDimensionalBinomial+0x710>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  -0xb0(%rbp),%xmm1
ff
mulsd  -0x80(%rbp),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
mov    -0x4c(%rbp),%edi
mov    -0x50(%rbp),%esi
movsd  -0x130(%rbp),%xmm0
ff
movsd  -0xe0(%rbp),%xmm2
ff
movsd  -0xe8(%rbp),%xmm3
ff
movsd  -0x88(%rbp),%xmm4
ff
movsd  -0x90(%rbp),%xmm5
ff
mov    $0x6,%al
call   1040 <PayoffFunction@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm1
maxsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%r13,%r15,8)
jmp    191d <ThreeDimensionalBinomial+0x7cd>
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
xor    %eax,%eax
call   1030 <assert@plt>
movsd  -0x30(%rbp),%xmm0
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @ThreeDimensionalBinomial(i32 %0, i32 %1, i32 %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12, double %13, double %14, double %15, i32 %16) {
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%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
%32 = alloca double
%33 = alloca double
%34 = alloca i32
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca i32
%43 = alloca i32
%44 = alloca i32
%45 = alloca i8*
%46 = alloca i64
%47 = alloca i64
%48 = alloca double
%49 = alloca double
%50 = alloca double
%51 = alloca double
%52 = alloca double
%53 = alloca double
%54 = alloca double
%55 = alloca double
store i32 %0, i32* %18
store i32 %1, i32* %19
store i32 %2, i32* %20
store double %3, double* %21
store double %4, double* %22
store double %5, double* %23
store double %6, double* %24
store double %7, double* %25
store double %8, double* %26
store double %9, double* %27
store double %10, double* %28
store double %11, double* %29
store double %12, double* %30
store double %13, double* %31
store double %14, double* %32
store double %15, double* %33
store i32 %16, i32* %34
%56 = load i32, i32* %34
%57 = add nsw i32 %56, 1
%58 = zext i32 %57 to i64
%59 = load i32, i32* %34
%60 = add nsw i32 %59, 1
%61 = zext i32 %60 to i64
%62 = call i8* @llvm.stacksave()
store i8* %62, i8** %45
%63 = mul nuw i64 %58, %61
%64 = alloca double, i64 %63
store i64 %58, i64* %46
store i64 %61, i64* %47
%65 = load double, double* %21
%66 = load double, double* %21
%67 = fcmp oeq double %65, %66
br i1 %67, label %68, label %74
68: ; preds = %17
%69 = load double, double* %21
%70 = fcmp oge double %69, 0x3EB0C6F7A0B5ED8D
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = load double, double* %21
%73 = fcmp ole double %72, 1.000000e+12
br label %74
74: ; preds = %71, %68, %17
%75 = phi i1 [ false, %68 ], [ false, %17 ], [ %73, %71 ]
%76 = zext i1 %75 to i32
%77 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %76)
%78 = load double, double* %22
%79 = load double, double* %22
%80 = fcmp oeq double %78, %79
br i1 %80, label %81, label %87
81: ; preds = %74
%82 = load double, double* %22
%83 = fcmp oge double %82, 0x3EB0C6F7A0B5ED8D
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = load double, double* %22
%86 = fcmp ole double %85, 1.000000e+12
br label %87
87: ; preds = %84, %81, %74
%88 = phi i1 [ false, %81 ], [ false, %74 ], [ %86, %84 ]
%89 = zext i1 %88 to i32
%90 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %89)
%91 = load double, double* %25
%92 = load double, double* %25
%93 = fcmp oeq double %91, %92
br i1 %93, label %94, label %100
94: ; preds = %87
%95 = load double, double* %25
%96 = fcmp oge double %95, 0x3EB0C6F7A0B5ED8D
br i1 %96, label %97, label %100
97: ; preds = %94
%98 = load double, double* %25
%99 = fcmp ole double %98, 1.000000e+12
br label %100
100: ; preds = %97, %94, %87
%101 = phi i1 [ false, %94 ], [ false, %87 ], [ %99, %97 ]
%102 = zext i1 %101 to i32
%103 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %102)
%104 = load double, double* %26
%105 = load double, double* %26
%106 = fcmp oeq double %104, %105
br i1 %106, label %107, label %113
107: ; preds = %100
%108 = load double, double* %26
%109 = fcmp oge double %108, 0x3EB0C6F7A0B5ED8D
br i1 %109, label %110, label %113
110: ; preds = %107
%111 = load double, double* %26
%112 = fcmp ole double %111, 1.000000e+12
br label %113
113: ; preds = %110, %107, %100
%114 = phi i1 [ false, %107 ], [ false, %100 ], [ %112, %110 ]
%115 = zext i1 %114 to i32
%116 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %115)
%117 = load double, double* %27
%118 = load double, double* %27
%119 = fcmp oeq double %117, %118
br i1 %119, label %120, label %126
120: ; preds = %113
%121 = load double, double* %27
%122 = fcmp oge double %121, 0x3F2596179C29D2CE
br i1 %122, label %123, label %126
123: ; preds = %120
%124 = load double, double* %27
%125 = fcmp ole double %124, 2.000000e+01
br label %126
126: ; preds = %123, %120, %113
%127 = phi i1 [ false, %120 ], [ false, %113 ], [ %125, %123 ]
%128 = zext i1 %127 to i32
%129 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %128)
%130 = load double, double* %28
%131 = load double, double* %28
%132 = fcmp oeq double %130, %131
br i1 %132, label %133, label %139
133: ; preds = %126
%134 = load double, double* %28
%135 = fcmp oge double %134, 0.000000e+00
br i1 %135, label %136, label %139
136: ; preds = %133
%137 = load double, double* %28
%138 = fcmp ole double %137, 1.000000e+03
br label %139
139: ; preds = %136, %133, %126
%140 = phi i1 [ false, %133 ], [ false, %126 ], [ %138, %136 ]
%141 = zext i1 %140 to i32
%142 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %141)
%143 = load double, double* %29
%144 = load double, double* %29
%145 = fcmp oeq double %143, %144
br i1 %145, label %146, label %152
146: ; preds = %139
%147 = load double, double* %29
%148 = fcmp oge double %147, -1.000000e+03
br i1 %148, label %149, label %152
149: ; preds = %146
%150 = load double, double* %29
%151 = fcmp ole double %150, 1.000000e+03
br label %152
152: ; preds = %149, %146, %139
%153 = phi i1 [ false, %146 ], [ false, %139 ], [ %151, %149 ]
%154 = zext i1 %153 to i32
%155 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %154)
%156 = load double, double* %30
%157 = load double, double* %30
%158 = fcmp oeq double %156, %157
br i1 %158, label %159, label %165
159: ; preds = %152
%160 = load double, double* %30
%161 = fcmp oge double %160, -1.000000e+03
br i1 %161, label %162, label %165
162: ; preds = %159
%163 = load double, double* %30
%164 = fcmp ole double %163, 1.000000e+03
br label %165
165: ; preds = %162, %159, %152
%166 = phi i1 [ false, %159 ], [ false, %152 ], [ %164, %162 ]
%167 = zext i1 %166 to i32
%168 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %167)
%169 = load double, double* %31
%170 = load double, double* %31
%171 = fcmp oeq double %169, %170
br i1 %171, label %172, label %178
172: ; preds = %165
%173 = load double, double* %31
%174 = fcmp oge double %173, 0x3E7AD7F29ABCAF48
br i1 %174, label %175, label %178
175: ; preds = %172
%176 = load double, double* %31
%177 = fcmp ole double %176, 0x40593FFFD60E94EE
br label %178
178: ; preds = %175, %172, %165
%179 = phi i1 [ false, %172 ], [ false, %165 ], [ %177, %175 ]
%180 = zext i1 %179 to i32
%181 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %180)
%182 = load double, double* %32
%183 = load double, double* %32
%184 = fcmp oeq double %182, %183
br i1 %184, label %185, label %191
185: ; preds = %178
%186 = load double, double* %32
%187 = fcmp oge double %186, 0x3E7AD7F29ABCAF48
br i1 %187, label %188, label %191
188: ; preds = %185
%189 = load double, double* %32
%190 = fcmp ole double %189, 0x40593FFFD60E94EE
br label %191
191: ; preds = %188, %185, %178
%192 = phi i1 [ false, %185 ], [ false, %178 ], [ %190, %188 ]
%193 = zext i1 %192 to i32
%194 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %193)
%195 = load i32, i32* %34
%196 = icmp sgt i32 %195, 0
%197 = zext i1 %196 to i32
%198 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %197)
%199 = load i32, i32* %18
%200 = icmp sge i32 %199, 1
%201 = zext i1 %200 to i32
%202 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %201)
%203 = load i32, i32* %18
%204 = icmp sle i32 %203, 7
%205 = zext i1 %204 to i32
%206 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %205)
%207 = load double, double* %27
%208 = load i32, i32* %34
%209 = sitofp i32 %208 to double
%210 = fdiv double %207, %209
store double %210, double* %36
%211 = load double, double* %36
%212 = call double @sqrt(double %211)
store double %212, double* %37
%213 = load double, double* %29
%214 = load double, double* %31
%215 = load double, double* %31
%216 = fmul double %214, %215
%217 = fdiv double %216, 2.000000e+00
%218 = fsub double %213, %217
store double %218, double* %38
%219 = load double, double* %30
%220 = load double, double* %32
%221 = load double, double* %32
%222 = fmul double %220, %221
%223 = fdiv double %222, 2.000000e+00
%224 = fsub double %219, %223
store double %224, double* %39
%225 = load double, double* %38
%226 = load double, double* %36
%227 = load double, double* %31
%228 = load double, double* %37
%229 = fmul double %227, %228
%230 = call double @llvm.fmuladd.f64(double %225, double %226, double %229)
%231 = call double @exp(double %230)
store double %231, double* %40
%232 = load double, double* %38
%233 = load double, double* %36
%234 = load double, double* %31
%235 = load double, double* %37
%236 = fmul double %234, %235
%237 = fneg double %236
%238 = call double @llvm.fmuladd.f64(double %232, double %233, double %237)
%239 = call double @exp(double %238)
store double %239, double* %41
store i32 0, i32* %43
br label %240
240: ; preds = %340, %191
%241 = load i32, i32* %43
%242 = load i32, i32* %34
%243 = icmp sle i32 %241, %242
br i1 %243, label %244, label %343
244: ; preds = %240
%245 = load i32, i32* %43
%246 = sitofp i32 %245 to double
%247 = load i32, i32* %34
%248 = sitofp i32 %247 to double
%249 = fneg double %248
%250 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %246, double %249)
%251 = load double, double* %37
%252 = fmul double %250, %251
store double %252, double* %48
%253 = load double, double* %21
%254 = load double, double* %40
%255 = load i32, i32* %43
%256 = sitofp i32 %255 to double
%257 = call double @pow(double %254, double %256)
%258 = fmul double %253, %257
%259 = load double, double* %41
%260 = load i32, i32* %34
%261 = load i32, i32* %43
%262 = sub nsw i32 %260, %261
%263 = sitofp i32 %262 to double
%264 = call double @pow(double %259, double %263)
%265 = fmul double %258, %264
store double %265, double* %49
store i32 0, i32* %42
br label %266
266: ; preds = %336, %244
%267 = load i32, i32* %42
%268 = load i32, i32* %34
%269 = icmp sle i32 %267, %268
br i1 %269, label %270, label %339
270: ; preds = %266
%271 = load double, double* %33
%272 = load double, double* %48
%273 = load double, double* %33
%274 = load double, double* %33
%275 = fneg double %273
%276 = call double @llvm.fmuladd.f64(double %275, double %274, double 1.000000e+00)
%277 = call double @sqrt(double %276)
%278 = load i32, i32* %42
%279 = sitofp i32 %278 to double
%280 = load i32, i32* %34
%281 = sitofp i32 %280 to double
%282 = fneg double %281
%283 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %279, double %282)
%284 = fmul double %277, %283
%285 = load double, double* %37
%286 = fmul double %284, %285
%287 = call double @llvm.fmuladd.f64(double %271, double %272, double %286)
store double %287, double* %51
%288 = load double, double* %51
%289 = load double, double* %22
%290 = load double, double* %39
%291 = load i32, i32* %34
%292 = sitofp i32 %291 to double
%293 = fmul double %290, %292
%294 = load double, double* %36
%295 = fmul double %293, %294
%296 = call double @exp(double %295)
%297 = fmul double %289, %296
%298 = load double, double* %32
%299 = load double, double* %33
%300 = load double, double* %48
%301 = load double, double* %33
%302 = load double, double* %33
%303 = fneg double %301
%304 = call double @llvm.fmuladd.f64(double %303, double %302, double 1.000000e+00)
%305 = call double @sqrt(double %304)
%306 = load i32, i32* %42
%307 = sitofp i32 %306 to double
%308 = load i32, i32* %34
%309 = sitofp i32 %308 to double
%310 = fneg double %309
%311 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %307, double %310)
%312 = fmul double %305, %311
%313 = load double, double* %37
%314 = fmul double %312, %313
%315 = call double @llvm.fmuladd.f64(double %299, double %300, double %314)
%316 = fmul double %298, %315
%317 = call double @exp(double %316)
%318 = fmul double %297, %317
store double %318, double* %50
%319 = load i32, i32* %18
%320 = load i32, i32* %20
%321 = load double, double* %49
%322 = load double, double* %50
%323 = load double, double* %23
%324 = load double, double* %24
%325 = load double, double* %25
%326 = load double, double* %26
%327 = call i32 (i32, i32, double, double, double, double, double, double, ...) bitcast (i32 (...)* @PayoffFunction to i32 (i32, i32, double, double, double, double, double, double, ...)*)(i32 %319, i32 %320, double %321, double %322, double %323, double %324, double %325, double %326)
%328 = sitofp i32 %327 to double
%329 = load i32, i32* %43
%330 = sext i32 %329 to i64
%331 = mul nsw i64 %330, %61
%332 = getelementptr inbounds double, double* %64, i64 %331
%333 = load i32, i32* %42
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds double, double* %332, i64 %334
store double %328, double* %335
br label %336
336: ; preds = %270
%337 = load i32, i32* %42
%338 = add nsw i32 %337, 1
store i32 %338, i32* %42
br label %266
339: ; preds = %266
br label %340
340: ; preds = %339
%341 = load i32, i32* %43
%342 = add nsw i32 %341, 1
store i32 %342, i32* %43
br label %240
343: ; preds = %240
%344 = load i32, i32* %34
%345 = sub nsw i32 %344, 1
store i32 %345, i32* %44
br label %346
346: ; preds = %503, %343
%347 = load i32, i32* %44
%348 = icmp sge i32 %347, 0
br i1 %348, label %349, label %506
349: ; preds = %346
store i32 0, i32* %43
br label %350
350: ; preds = %499, %349
%351 = load i32, i32* %43
%352 = load i32, i32* %44
%353 = icmp sle i32 %351, %352
br i1 %353, label %354, label %502
354: ; preds = %350
%355 = load i32, i32* %43
%356 = sitofp i32 %355 to double
%357 = load i32, i32* %44
%358 = sitofp i32 %357 to double
%359 = fneg double %358
%360 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %356, double %359)
%361 = load double, double* %37
%362 = fmul double %360, %361
store double %362, double* %52
%363 = load double, double* %21
%364 = load double, double* %40
%365 = load i32, i32* %43
%366 = sitofp i32 %365 to double
%367 = call double @pow(double %364, double %366)
%368 = fmul double %363, %367
%369 = load double, double* %41
%370 = load i32, i32* %44
%371 = load i32, i32* %43
%372 = sub nsw i32 %370, %371
%373 = sitofp i32 %372 to double
%374 = call double @pow(double %369, double %373)
%375 = fmul double %368, %374
store double %375, double* %53
store i32 0, i32* %42
br label %376
376: ; preds = %495, %354
%377 = load i32, i32* %42
%378 = load i32, i32* %44
%379 = icmp sle i32 %377, %378
br i1 %379, label %380, label %498
380: ; preds = %376
%381 = load double, double* %33
%382 = load double, double* %52
%383 = load double, double* %33
%384 = load double, double* %33
%385 = fneg double %383
%386 = call double @llvm.fmuladd.f64(double %385, double %384, double 1.000000e+00)
%387 = call double @sqrt(double %386)
%388 = load i32, i32* %42
%389 = sitofp i32 %388 to double
%390 = load i32, i32* %44
%391 = sitofp i32 %390 to double
%392 = fneg double %391
%393 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %389, double %392)
%394 = fmul double %387, %393
%395 = load double, double* %37
%396 = fmul double %394, %395
%397 = call double @llvm.fmuladd.f64(double %381, double %382, double %396)
store double %397, double* %54
%398 = load double, double* %22
%399 = load double, double* %39
%400 = load i32, i32* %44
%401 = sitofp i32 %400 to double
%402 = fmul double %399, %401
%403 = load double, double* %36
%404 = fmul double %402, %403
%405 = call double @exp(double %404)
%406 = fmul double %398, %405
%407 = load double, double* %32
%408 = load double, double* %54
%409 = fmul double %407, %408
%410 = call double @exp(double %409)
%411 = fmul double %406, %410
store double %411, double* %55
%412 = load i32, i32* %43
%413 = sext i32 %412 to i64
%414 = mul nsw i64 %413, %61
%415 = getelementptr inbounds double, double* %64, i64 %414
%416 = load i32, i32* %42
%417 = sext i32 %416 to i64
%418 = getelementptr inbounds double, double* %415, i64 %417
%419 = load double, double* %418
%420 = load i32, i32* %43
%421 = add nsw i32 %420, 1
%422 = sext i32 %421 to i64
%423 = mul nsw i64 %422, %61
%424 = getelementptr inbounds double, double* %64, i64 %423
%425 = load i32, i32* %42
%426 = sext i32 %425 to i64
%427 = getelementptr inbounds double, double* %424, i64 %426
%428 = load double, double* %427
%429 = fadd double %419, %428
%430 = load i32, i32* %43
%431 = sext i32 %430 to i64
%432 = mul nsw i64 %431, %61
%433 = getelementptr inbounds double, double* %64, i64 %432
%434 = load i32, i32* %42
%435 = add nsw i32 %434, 1
%436 = sext i32 %435 to i64
%437 = getelementptr inbounds double, double* %433, i64 %436
%438 = load double, double* %437
%439 = fadd double %429, %438
%440 = load i32, i32* %43
%441 = add nsw i32 %440, 1
%442 = sext i32 %441 to i64
%443 = mul nsw i64 %442, %61
%444 = getelementptr inbounds double, double* %64, i64 %443
%445 = load i32, i32* %42
%446 = add nsw i32 %445, 1
%447 = sext i32 %446 to i64
%448 = getelementptr inbounds double, double* %444, i64 %447
%449 = load double, double* %448
%450 = fadd double %439, %449
%451 = fmul double 2.500000e-01, %450
%452 = load double, double* %28
%453 = fneg double %452
%454 = load double, double* %36
%455 = fmul double %453, %454
%456 = call double @exp(double %455)
%457 = fmul double %451, %456
%458 = load i32, i32* %43
%459 = sext i32 %458 to i64
%460 = mul nsw i64 %459, %61
%461 = getelementptr inbounds double, double* %64, i64 %460
%462 = load i32, i32* %42
%463 = sext i32 %462 to i64
%464 = getelementptr inbounds double, double* %461, i64 %463
store double %457, double* %464
%465 = load i32, i32* %19
%466 = icmp ne i32 %465, 0
br i1 %466, label %494, label %467
467: ; preds = %380
%468 = load i32, i32* %43
%469 = sext i32 %468 to i64
%470 = mul nsw i64 %469, %61
%471 = getelementptr inbounds double, double* %64, i64 %470
%472 = load i32, i32* %42
%473 = sext i32 %472 to i64
%474 = getelementptr inbounds double, double* %471, i64 %473
%475 = load double, double* %474
%476 = load i32, i32* %18
%477 = load i32, i32* %20
%478 = load double, double* %53
%479 = load double, double* %55
%480 = load double, double* %23
%481 = load double, double* %24
%482 = load double, double* %25
%483 = load double, double* %26
%484 = call i32 (i32, i32, double, double, double, double, double, double, ...) bitcast (i32 (...)* @PayoffFunction to i32 (i32, i32, double, double, double, double, double, double, ...)*)(i32 %476, i32 %477, double %478, double %479, double %480, double %481, double %482, double %483)
%485 = sitofp i32 %484 to double
%486 = call double @llvm.maxnum.f64(double %475, double %485)
%487 = load i32, i32* %43
%488 = sext i32 %487 to i64
%489 = mul nsw i64 %488, %61
%490 = getelementptr inbounds double, double* %64, i64 %489
%491 = load i32, i32* %42
%492 = sext i32 %491 to i64
%493 = getelementptr inbounds double, double* %490, i64 %492
store double %486, double* %493
br label %494
494: ; preds = %467, %380
br label %495
495: ; preds = %494
%496 = load i32, i32* %42
%497 = add nsw i32 %496, 1
store i32 %497, i32* %42
br label %376
498: ; preds = %376
br label %499
499: ; preds = %498
%500 = load i32, i32* %43
%501 = add nsw i32 %500, 1
store i32 %501, i32* %43
br label %350
502: ; preds = %350
br label %503
503: ; preds = %502
%504 = load i32, i32* %44
%505 = add nsw i32 %504, -1
store i32 %505, i32* %44
br label %346
506: ; preds = %346
%507 = mul nsw i64 0, %61
%508 = getelementptr inbounds double, double* %64, i64 %507
%509 = getelementptr inbounds double, double* %508, i64 0
%510 = load double, double* %509
store double %510, double* %35
%511 = load double, double* %35
%512 = load double, double* %35
%513 = fcmp oeq double %511, %512
%514 = zext i1 %513 to i32
%515 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %514)
%516 = load double, double* %35
%517 = load i8*, i8** %45
ret double %516
}

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