double RollGeskeWhaley(double S, double X, double t1, double T2, double r,
                       double d, double v) {
  double Sx, result;
  const double xinfinity = 100000000.0;
  const double epsilon = 0.00001;
  double ci, HighS, LowS, I;
  double vst1, vst2, a1, a2, b1, b2;
  assert(((S) == (S)) && (S) >= 0.000001 && (S) <= 1000000000000.0);
  assert(((X) == (X)) && (X) >= 0.000001 && (X) <= 1000000000000.0);
  assert(((t1) == (t1)) && (t1) >= (1.0 / (253.0 * 24.0)) && (t1) <= (20.0));
  assert(((T2) == (T2)) && (T2) >= (1.0 / (253.0 * 24.0)) && (T2) <= (20.0));
  assert(((r) == (r)) && (r) >= 0.0 && (r) <= 1000.0);
  assert(((v) == (v)) && (v) >= 0.0000001 && v <= 100.99999);
  assert(T2 > t1);
  Sx = S - d * exp(-r * t1);
  if (d <= X * (1.0 - exp(-r * (T2 - t1)))) {
    result = blackscholes(1, Sx, X, T2, r, v);
    return result;
  }
  ci = blackscholes_call(S, X, T2 - t1, r, v);
  HighS = S;
  while ((ci - HighS - d + X) > 0 && HighS < xinfinity) {
    HighS = HighS * 2.0;
    ci = blackscholes(1, HighS, X, T2 - t1, r, v);
  }
  if (HighS > xinfinity) {
    result = blackscholes_call(Sx, X, T2, r, v);
    return result;
  }
  LowS = 0.0;
  I = HighS * 0.5;
  ci = blackscholes(1, I, X, T2 - t1, r, v);
  while (fabs(ci - I - d + X) > epsilon && (HighS - LowS) > epsilon) {
    if ((ci - I - d + X) < 0)
      HighS = I;
    else
      LowS = I;
    I = (HighS + LowS) / 2.0;
    ci = blackscholes(1, I, X, T2 - t1, r, v);
  }
  vst1 = v * sqrt(t1);
  vst2 = v * sqrt(T2);
  a1 = (log(Sx / X) + (r + ((v) * (v)) / 2.0) * T2) / vst2;
  a2 = a1 - vst2;
  b1 = (log(Sx / I) + (r + ((v) * (v)) / 2.0) * t1) / vst1;
  b2 = b1 - vst1;
  result = Sx * cnd(b1) + Sx * cbnd(a1, -b1, -sqrt(t1 / T2)) -
           X * exp(-r * T2) * cbnd(a2, -b2, -sqrt(t1 / T2)) -
           (X - d) * exp(-r * t1) * cnd(b2);
  assert(((result) == (result)));
  return result;
}


x86 assembly (clang, -O0):
<RollGeskeWhaley>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
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  0xe52(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe3d(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0xb1(%rbp)
jne    121b <RollGeskeWhaley+0x9b>
jp     121b <RollGeskeWhaley+0x9b>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe1b(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xb1(%rbp)
jb     121b <RollGeskeWhaley+0x9b>
movsd  0xe0b(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0xb1(%rbp)
mov    -0xb1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0xb2(%rbp)
jne    1280 <RollGeskeWhaley+0x100>
jp     1280 <RollGeskeWhaley+0x100>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdb6(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xb2(%rbp)
jb     1280 <RollGeskeWhaley+0x100>
movsd  0xda6(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0xb2(%rbp)
mov    -0xb2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x20(%rbp),%xmm0
mov    %al,-0xb3(%rbp)
jne    12e5 <RollGeskeWhaley+0x165>
jp     12e5 <RollGeskeWhaley+0x165>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd61(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xb3(%rbp)
jb     12e5 <RollGeskeWhaley+0x165>
movsd  0xd51(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0xb3(%rbp)
mov    -0xb3(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x28(%rbp),%xmm0
mov    %al,-0xb4(%rbp)
jne    134a <RollGeskeWhaley+0x1ca>
jp     134a <RollGeskeWhaley+0x1ca>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
movsd  0xcfc(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xb4(%rbp)
jb     134a <RollGeskeWhaley+0x1ca>
movsd  0xcec(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %al
mov    %al,-0xb4(%rbp)
mov    -0xb4(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0xb5(%rbp)
jne    13aa <RollGeskeWhaley+0x22a>
jp     13aa <RollGeskeWhaley+0x22a>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xb5(%rbp)
jb     13aa <RollGeskeWhaley+0x22a>
movsd  0xc94(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
setae  %al
mov    %al,-0xb5(%rbp)
mov    -0xb5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x40(%rbp),%xmm0
mov    %al,-0xb6(%rbp)
jne    140f <RollGeskeWhaley+0x28f>
jp     140f <RollGeskeWhaley+0x28f>
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
movsd  0xc4f(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xb6(%rbp)
jb     140f <RollGeskeWhaley+0x28f>
movsd  0xc3f(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
mov    %al,-0xb6(%rbp)
mov    -0xb6(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x28(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1070 <exp@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1070 <exp@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0xc0(%rbp),%xmm0
ff
movsd  0xb33(%rip),%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     1564 <RollGeskeWhaley+0x3e4>
movsd  -0x48(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mov    $0x1,%edi
mov    $0x5,%al
call   1030 <blackscholes@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1b8a <RollGeskeWhaley+0xa0a>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mov    $0x5,%al
call   1040 <blackscholes_call@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xd9(%rbp)
jbe    15db <RollGeskeWhaley+0x45b>
movsd  0xa3b(%rip),%xmm0
ucomisd -0x70(%rbp),%xmm0
seta   %al
mov    %al,-0xd9(%rbp)
mov    -0xd9(%rbp),%al
test   $0x1,%al
jne    15ee <RollGeskeWhaley+0x46e>
jmp    1638 <RollGeskeWhaley+0x4b8>
movsd  0xa62(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mov    $0x1,%edi
mov    $0x5,%al
call   1030 <blackscholes@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    159c <RollGeskeWhaley+0x41c>
movsd  -0x70(%rbp),%xmm0
movsd  0x9c3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1687 <RollGeskeWhaley+0x507>
movsd  -0x48(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mov    $0x5,%al
call   1040 <blackscholes_call@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1b8a <RollGeskeWhaley+0xa0a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0x9b9(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mov    $0x1,%edi
mov    $0x5,%al
call   1030 <blackscholes@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movaps 0x971(%rip),%xmm1
pand   %xmm1,%xmm0
xor    %eax,%eax
movsd  0x903(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xda(%rbp)
jbe    172c <RollGeskeWhaley+0x5ac>
movsd  -0x70(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  0x8e1(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0xda(%rbp)
mov    -0xda(%rbp),%al
test   $0x1,%al
jne    173f <RollGeskeWhaley+0x5bf>
jmp    17cc <RollGeskeWhaley+0x64c>
movsd  -0x68(%rbp),%xmm1
subsd  -0x80(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    176f <RollGeskeWhaley+0x5ef>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1779 <RollGeskeWhaley+0x5f9>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  0x8cd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mov    $0x1,%edi
mov    $0x5,%al
call   1030 <blackscholes@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    16d4 <RollGeskeWhaley+0x554>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x158(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x150(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1080 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
movsd  0x807(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
call   1080 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
movsd  0x7a1(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
mov    $0x1,%al
call   1090 <cnd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   10a0 <sqrt@plt>
movsd  -0x148(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x140(%rbp),%xmm0
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
movsd  -0x138(%rbp),%xmm1
ff
movsd  -0x130(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm2
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   10a0 <sqrt@plt>
movsd  -0x118(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x110(%rbp),%xmm0
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
movsd  -0x108(%rbp),%xmm0
ff
movsd  -0x100(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
mov    $0x1,%al
call   1090 <cnd@plt>
movsd  -0xf0(%rbp),%xmm0
ff
movsd  -0xe8(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RollGeskeWhaley>:
sub    $0xa8,%rsp
movsd  %xmm0,0x8(%rsp)
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe64(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe5f(%rip),%xmm7
ucomisd %xmm0,%xmm7
movapd %xmm6,0x20(%rsp)
movsd  %xmm5,0x50(%rsp)
movaps %xmm4,0x40(%rsp)
movsd  %xmm3,0x30(%rsp)
movsd  %xmm2,0x38(%rsp)
movsd  %xmm1,0x10(%rsp)
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1060 <assert@plt>
movsd  0x10(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe0c(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe07(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1060 <assert@plt>
movsd  0x38(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xde7(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xde2(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1060 <assert@plt>
movsd  0x30(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xdb2(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xdad(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1060 <assert@plt>
xorpd  %xmm0,%xmm0
movapd 0x40(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movsd  0xd89(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
xor    %eax,%eax
call   1060 <assert@plt>
movapd 0x20(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xd69(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xd64(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1060 <assert@plt>
xor    %edi,%edi
movsd  0x30(%rsp),%xmm0
ucomisd 0x38(%rsp),%xmm0
seta   %dil
xor    %eax,%eax
call   1060 <assert@plt>
movapd 0xd60(%rip),%xmm0
xorpd  0x40(%rsp),%xmm0
movapd %xmm0,0x80(%rsp)
mulsd  0x38(%rsp),%xmm0
movapd %xmm0,0x90(%rsp)
call   1070 <exp@plt>
mulsd  0x50(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x58(%rsp)
movsd  0x30(%rsp),%xmm0
subsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mulsd  0x80(%rsp),%xmm0
call   1070 <exp@plt>
movsd  0x10(%rsp),%xmm1
movsd  0xcd1(%rip),%xmm2
subsd  %xmm0,%xmm2
movsd  0x50(%rsp),%xmm0
mulsd  %xmm1,%xmm2
ucomisd %xmm0,%xmm2
jae    147c <RollGeskeWhaley+0x2fc>
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm2
movapd 0x40(%rsp),%xmm3
movaps 0x20(%rsp),%xmm4
mov    $0x5,%al
call   1040 <blackscholes_call@plt>
movsd  0xc9b(%rip),%xmm0
movsd  0x8(%rsp),%xmm4
ucomisd %xmm4,%xmm0
jbe    14ae <RollGeskeWhaley+0x32e>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  %xmm4,%xmm0
subsd  0x50(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
addsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm2,%xmm1
jbe    14b4 <RollGeskeWhaley+0x334>
movapd 0x40(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
xchg   %ax,%ax
addsd  %xmm4,%xmm4
movsd  %xmm4,0x8(%rsp)
mov    $0x1,%edi
movapd %xmm4,%xmm0
movaps 0x20(%rsp),%xmm4
mov    $0x5,%al
call   1030 <blackscholes@plt>
movsd  0x8(%rsp),%xmm4
movsd  0xc23(%rip),%xmm0
ucomisd %xmm4,%xmm0
jbe    14ae <RollGeskeWhaley+0x32e>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  %xmm4,%xmm0
subsd  0x50(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
ucomisd 0xc0e(%rip),%xmm0
movapd 0x40(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
ja     13f0 <RollGeskeWhaley+0x270>
ucomisd 0xbe0(%rip),%xmm4
jbe    14c9 <RollGeskeWhaley+0x349>
movsd  0x58(%rsp),%xmm0
movsd  0x30(%rsp),%xmm2
movaps 0x20(%rsp),%xmm4
mov    $0x5,%al
call   1040 <blackscholes_call@plt>
jmp    149f <RollGeskeWhaley+0x31f>
mov    $0x1,%edi
movsd  0x58(%rsp),%xmm0
movsd  0x30(%rsp),%xmm2
movapd 0x40(%rsp),%xmm3
movaps 0x20(%rsp),%xmm4
mov    $0x5,%al
call   1030 <blackscholes@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0xa8,%rsp
ret
movsd  0x10(%rsp),%xmm1
movaps 0x40(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
ucomisd 0xb79(%rip),%xmm4
ja     1462 <RollGeskeWhaley+0x2e2>
movsd  0xb77(%rip),%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm0,0x60(%rsp)
mov    $0x1,%edi
movsd  %xmm4,0x8(%rsp)
movaps 0x20(%rsp),%xmm4
mov    $0x5,%al
call   1030 <blackscholes@plt>
movapd 0x60(%rsp),%xmm4
movsd  0x10(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  %xmm4,%xmm0
subsd  0x50(%rsp),%xmm0
addsd  %xmm1,%xmm0
movapd 0xb55(%rip),%xmm2
andpd  %xmm0,%xmm2
ucomisd 0xb29(%rip),%xmm2
jbe    160f <RollGeskeWhaley+0x48f>
movsd  0x8(%rsp),%xmm2
ucomisd 0xb15(%rip),%xmm2
jbe    160f <RollGeskeWhaley+0x48f>
xorpd  %xmm5,%xmm5
xorpd  %xmm6,%xmm6
movapd 0x40(%rsp),%xmm3
nop
ucomisd %xmm0,%xmm5
movapd %xmm4,%xmm7
ja     155e <RollGeskeWhaley+0x3de>
movapd %xmm2,%xmm7
cmpltsd %xmm5,%xmm0
andpd  %xmm0,%xmm6
andnpd %xmm4,%xmm0
orpd   %xmm0,%xmm6
movapd %xmm6,0x70(%rsp)
movsd  %xmm7,0x8(%rsp)
movapd %xmm7,%xmm0
addsd  %xmm6,%xmm0
mulsd  0xabd(%rip),%xmm0
movapd %xmm0,0x60(%rsp)
mov    $0x1,%edi
movsd  0x18(%rsp),%xmm2
movaps 0x20(%rsp),%xmm4
mov    $0x5,%al
call   1030 <blackscholes@plt>
movapd 0x60(%rsp),%xmm4
movsd  0x10(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  %xmm4,%xmm0
subsd  0x50(%rsp),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
andpd  0xa9b(%rip),%xmm2
movsd  0xa73(%rip),%xmm3
ucomisd %xmm3,%xmm2
jbe    160f <RollGeskeWhaley+0x48f>
movsd  0x8(%rsp),%xmm5
movapd %xmm5,%xmm2
movapd 0x70(%rsp),%xmm6
subsd  %xmm6,%xmm2
ucomisd %xmm3,%xmm2
movapd %xmm5,%xmm2
movapd 0x40(%rsp),%xmm3
xorpd  %xmm5,%xmm5
ja     1550 <RollGeskeWhaley+0x3d0>
xorpd  %xmm3,%xmm3
movsd  0x38(%rsp),%xmm0
ucomisd %xmm3,%xmm0
movapd %xmm4,0x60(%rsp)
jb     162e <RollGeskeWhaley+0x4ae>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    163b <RollGeskeWhaley+0x4bb>
call   10a0 <sqrt@plt>
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm2
movsd  0x30(%rsp),%xmm0
movapd 0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm2
ucomisd %xmm3,%xmm0
movsd  %xmm2,0x8(%rsp)
jb     1660 <RollGeskeWhaley+0x4e0>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    1669 <RollGeskeWhaley+0x4e9>
call   10a0 <sqrt@plt>
movapd %xmm0,%xmm2
movsd  0x10(%rsp),%xmm1
movsd  0x58(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm2
movsd  %xmm2,0x18(%rsp)
divsd  %xmm1,%xmm0
call   1080 <log@plt>
movapd 0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  0x9ac(%rip),%xmm1
addsd  0x40(%rsp),%xmm1
movapd %xmm1,0x20(%rsp)
mulsd  0x30(%rsp),%xmm1
addsd  %xmm0,%xmm1
divsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x70(%rsp)
movsd  0x58(%rsp),%xmm0
divsd  0x60(%rsp),%xmm0
call   1080 <log@plt>
movapd 0x20(%rsp),%xmm2
mulsd  0x38(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,0x20(%rsp)
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,0x40(%rsp)
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1090 <cnd@plt>
movaps 0x20(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  0x93f(%rip),%xmm1
movsd  0x38(%rsp),%xmm3
divsd  0x30(%rsp),%xmm3
xorps  %xmm2,%xmm2
sqrtsd %xmm3,%xmm2
xorpd  %xmm0,%xmm0
movsd  %xmm3,0x38(%rsp)
ucomisd %xmm0,%xmm3
movapd %xmm2,0x60(%rsp)
jae    1763 <RollGeskeWhaley+0x5e3>
movsd  0x38(%rsp),%xmm0
movaps %xmm1,0x20(%rsp)
call   10a0 <sqrt@plt>
movaps 0x20(%rsp),%xmm1
movapd %xmm0,%xmm2
movsd  0x70(%rsp),%xmm0
movapd %xmm0,%xmm3
subsd  0x18(%rsp),%xmm3
movsd  %xmm3,0x20(%rsp)
xorpd  0x8df(%rip),%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x58(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd 0x80(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
call   1070 <exp@plt>
movaps 0x898(%rip),%xmm1
movsd  %xmm0,0x18(%rsp)
xorps  0x40(%rsp),%xmm1
movsd  0x38(%rsp),%xmm0
ucomisd 0x877(%rip),%xmm0
movapd 0x60(%rsp),%xmm2
jae    17fc <RollGeskeWhaley+0x67c>
movaps %xmm1,0x60(%rsp)
call   10a0 <sqrt@plt>
movaps 0x60(%rsp),%xmm1
movapd %xmm0,%xmm2
xorpd  0x85c(%rip),%xmm2
movsd  0x20(%rsp),%xmm0
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
subsd  0x50(%rsp),%xmm2
movsd  %xmm2,0x10(%rsp)
movaps 0x90(%rsp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,0x20(%rsp)
movaps 0x40(%rsp),%xmm0
mov    $0x1,%al
call   1090 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
xor    %eax,%eax
call   1060 <assert@plt>
movsd  0x8(%rsp),%xmm0
add    $0xa8,%rsp
ret

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

LLVM IR (-O2):
define double @RollGeskeWhaley(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fcmp ord double %0, 0.000000e+00
%9 = fcmp oge double %0, 0x3EB0C6F7A0B5ED8D
%10 = and i1 %8, %9
%11 = fcmp ole double %0, 1.000000e+12
%12 = and i1 %11, %10
%13 = zext i1 %12 to i32
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %13)
%15 = fcmp ord double %1, 0.000000e+00
%16 = fcmp oge double %1, 0x3EB0C6F7A0B5ED8D
%17 = and i1 %15, %16
%18 = fcmp ole double %1, 1.000000e+12
%19 = and i1 %18, %17
%20 = zext i1 %19 to i32
%21 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %20)
%22 = fcmp ord double %2, 0.000000e+00
%23 = fcmp oge double %2, 0x3F2596179C29D2CE
%24 = and i1 %22, %23
%25 = fcmp ole double %2, 2.000000e+01
%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 %3, 0.000000e+00
%30 = fcmp oge double %3, 0x3F2596179C29D2CE
%31 = and i1 %29, %30
%32 = fcmp ole double %3, 2.000000e+01
%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 oge double %4, 0.000000e+00
%37 = fcmp ole double %4, 1.000000e+03
%38 = and i1 %36, %37
%39 = zext i1 %38 to i32
%40 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %39)
%41 = fcmp ord double %6, 0.000000e+00
%42 = fcmp oge double %6, 0x3E7AD7F29ABCAF48
%43 = and i1 %41, %42
%44 = fcmp ole double %6, 0x40593FFFD60E94EE
%45 = and i1 %44, %43
%46 = zext i1 %45 to i32
%47 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %46)
%48 = fcmp ogt double %3, %2
%49 = zext i1 %48 to i32
%50 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %49)
%51 = fneg double %4
%52 = fmul double %51, %2
%53 = tail call double @exp(double %52)
%54 = fneg double %5
%55 = tail call double @llvm.fmuladd.f64(double %54, double %53, double %0)
%56 = fsub double %3, %2
%57 = fmul double %56, %51
%58 = tail call double @exp(double %57)
%59 = fsub double 1.000000e+00, %58
%60 = fmul double %59, %1
%61 = fcmp ult double %60, %5
br i1 %61, label %65, label %62
62: ; preds = %7
%63 = tail call i32 (i32, double, double, double, double, double, ...) bitcast (i32 (...)* @blackscholes to i32 (i32, double, double, double, double, double, ...)*)(i32 1, double %55, double %1, double %3, double %4, double %6)
%64 = sitofp i32 %63 to double
br label %171
65: ; preds = %7
%66 = tail call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @blackscholes_call to i32 (double, double, double, double, double, ...)*)(double %0, double %1, double %56, double %4, double %6)
%67 = sitofp i32 %66 to double
%68 = fsub double %67, %0
%69 = fsub double %68, %5
%70 = fadd double %69, %1
%71 = fcmp ogt double %70, 0.000000e+00
%72 = fcmp olt double %0, 1.000000e+08
%73 = and i1 %72, %71
br i1 %73, label %74, label %85
74: ; preds = %65, %74
%75 = phi double [ %76, %74 ], [ %0, %65 ]
%76 = fmul double %75, 2.000000e+00
%77 = tail call i32 (i32, double, double, double, double, double, ...) bitcast (i32 (...)* @blackscholes to i32 (i32, double, double, double, double, double, ...)*)(i32 1, double %76, double %1, double %56, double %4, double %6)
%78 = sitofp i32 %77 to double
%79 = fsub double %78, %76
%80 = fsub double %79, %5
%81 = fadd double %80, %1
%82 = fcmp ogt double %81, 0.000000e+00
%83 = fcmp olt double %76, 1.000000e+08
%84 = and i1 %83, %82
br i1 %84, label %74, label %85
85: ; preds = %74, %65
%86 = phi double [ %0, %65 ], [ %76, %74 ]
%87 = fcmp ogt double %86, 1.000000e+08
br i1 %87, label %88, label %91
88: ; preds = %85
%89 = tail call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @blackscholes_call to i32 (double, double, double, double, double, ...)*)(double %55, double %1, double %3, double %4, double %6)
%90 = sitofp i32 %89 to double
br label %171
91: ; preds = %85
%92 = fmul double %86, 5.000000e-01
%93 = tail call i32 (i32, double, double, double, double, double, ...) bitcast (i32 (...)* @blackscholes to i32 (i32, double, double, double, double, double, ...)*)(i32 1, double %92, double %1, double %56, double %4, double %6)
%94 = sitofp i32 %93 to double
%95 = fsub double %94, %92
%96 = fsub double %95, %5
%97 = fadd double %96, %1
%98 = tail call double @llvm.fabs.f64(double %97)
%99 = fcmp ogt double %98, 1.000000e-05
%100 = fcmp ogt double %86, 1.000000e-05
%101 = and i1 %99, %100
br i1 %101, label %102, label %122
102: ; preds = %91, %102
%103 = phi double [ %116, %102 ], [ %97, %91 ]
%104 = phi double [ %109, %102 ], [ %86, %91 ]
%105 = phi double [ %108, %102 ], [ 0.000000e+00, %91 ]
%106 = phi double [ %111, %102 ], [ %92, %91 ]
%107 = fcmp olt double %103, 0.000000e+00
%108 = select i1 %107, double %105, double %106
%109 = select i1 %107, double %106, double %104
%110 = fadd double %109, %108
%111 = fmul double %110, 5.000000e-01
%112 = tail call i32 (i32, double, double, double, double, double, ...) bitcast (i32 (...)* @blackscholes to i32 (i32, double, double, double, double, double, ...)*)(i32 1, double %111, double %1, double %56, double %4, double %6)
%113 = sitofp i32 %112 to double
%114 = fsub double %113, %111
%115 = fsub double %114, %5
%116 = fadd double %115, %1
%117 = tail call double @llvm.fabs.f64(double %116)
%118 = fcmp ogt double %117, 1.000000e-05
%119 = fsub double %109, %108
%120 = fcmp ogt double %119, 1.000000e-05
%121 = select i1 %118, i1 %120, i1 false
br i1 %121, label %102, label %122
122: ; preds = %102, %91
%123 = phi double [ %92, %91 ], [ %111, %102 ]
%124 = tail call double @sqrt(double %2)
%125 = fmul double %124, %6
%126 = tail call double @sqrt(double %3)
%127 = fmul double %126, %6
%128 = fdiv double %55, %1
%129 = tail call double @log(double %128)
%130 = fmul double %6, %6
%131 = fmul double %130, 5.000000e-01
%132 = fadd double %131, %4
%133 = tail call double @llvm.fmuladd.f64(double %132, double %3, double %129)
%134 = fdiv double %133, %127
%135 = fsub double %134, %127
%136 = fdiv double %55, %123
%137 = tail call double @log(double %136)
%138 = tail call double @llvm.fmuladd.f64(double %132, double %2, double %137)
%139 = fdiv double %138, %125
%140 = fsub double %139, %125
%141 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %139)
%142 = sitofp i32 %141 to double
%143 = fneg double %139
%144 = fdiv double %2, %3
%145 = tail call double @sqrt(double %144)
%146 = fneg double %145
%147 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %134, double %143, double %146)
%148 = sitofp i32 %147 to double
%149 = fmul double %55, %148
%150 = tail call double @llvm.fmuladd.f64(double %55, double %142, double %149)
%151 = fmul double %51, %3
%152 = tail call double @exp(double %151)
%153 = fneg double %140
%154 = tail call double @sqrt(double %144)
%155 = fneg double %154
%156 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %135, double %153, double %155)
%157 = sitofp i32 %156 to double
%158 = fneg double %152
%159 = fmul double %158, %1
%160 = tail call double @llvm.fmuladd.f64(double %159, double %157, double %150)
%161 = fsub double %1, %5
%162 = tail call double @exp(double %52)
%163 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %140)
%164 = sitofp i32 %163 to double
%165 = fneg double %161
%166 = fmul double %162, %165
%167 = tail call double @llvm.fmuladd.f64(double %166, double %164, double %160)
%168 = fcmp ord double %167, 0.000000e+00
%169 = zext i1 %168 to i32
%170 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %169)
br label %171
171: ; preds = %122, %88, %62
%172 = phi double [ %64, %62 ], [ %90, %88 ], [ %167, %122 ]
ret double %172
}