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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int exp(double);
double fabs(double);
double log(double);
double pow(double, double);
double rq_pricing_blackscholes_gen(int, double, double, double, double, double,
                                   double);
int rq_pricing_cumul_norm_dist(double);
double rq_pricing_norm_dist(double);
double sqrt(int);
double rq_pricing_barone_adesi_whaley_amer_call(double S, double X, double T,
                                                double r, double b, double v) {
  double ret;
  if (b >= r)
    ret = rq_pricing_blackscholes_gen(1, S, X, T, r, b, v);
  else {
    double v_sqr = v * v;
    double n = 2.0 * b / v_sqr;
    double m = 2.0 * r / v_sqr;
    double q2u = (-(n - 1) + sqrt(pow((n - 1), 2) + 4 * m)) / 2.0;
    double Su = X / (1 - 1 / q2u);
    double h2 = -(b * T + 2.0 * v * sqrt(T)) * X / (Su - X);
    double Si = X + (Su - X) * (1 - exp(h2));
    double K = 2 * r / (v_sqr * (1 - exp(-r * T)));
    double d1 = (log(Si / X) + (b + v_sqr / 2) * T) / (v * sqrt(T));
    double Q2 = (-(n - 1.0) + sqrt(pow((n - 1.0), 2.0) + 4.0 * K)) / 2.0;
    double LHS = Si - X;
    double RHS =
        rq_pricing_blackscholes_gen(1, Si, X, T, r, b, v) +
        (1 - exp((b - r) * T) * rq_pricing_cumul_norm_dist(d1)) * Si / Q2;
    double bi =
        exp((b - r) * T) * rq_pricing_cumul_norm_dist(d1) * (1.0 - 1.0 / Q2) +
        (1.0 -
         exp((b - r) * T) * rq_pricing_cumul_norm_dist(d1) / (v * sqrt(T))) /
            Q2;
    double E = 0.000001;
    while (fabs(LHS - RHS) / X > E) {
      Si = (X + RHS - bi * Si) / (1 - bi);
      d1 = (log(Si / X) + (b + (v * v) / 2) * T) / (v * sqrt(T));
      LHS = Si - X;
      RHS = rq_pricing_blackscholes_gen(1, Si, X, T, r, b, v) +
            (1 - exp((b - r) * T) * rq_pricing_cumul_norm_dist(d1)) * Si / Q2;
      bi =
          exp((b - r) * T) * rq_pricing_cumul_norm_dist(d1) * (1.0 - 1.0 / Q2) +
          (1.0 - exp((b - r) * T) * rq_pricing_norm_dist(d1) / (v * sqrt(T))) /
              Q2;
    }
    if (S < Si) {
      double a2;
      Q2 = (-(n - 1) + sqrt(pow((n - 1), 2) + 4 * K)) / 2;
      a2 = (Si / Q2) * (1 - exp((b - r) * T) * rq_pricing_cumul_norm_dist(d1));
      ret = rq_pricing_blackscholes_gen(1, S, X, T, r, b, v) +
            a2 * pow((S / Si), Q2);
    } else
      ret = S - X;
  }
  return ret;
}


x86 assembly (clang, -O0):
<rq_pricing_barone_adesi_whaley_amer_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     11db <rq_pricing_barone_adesi_whaley_amer_call+0x6b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
mov    $0x1,%edi
call   1060 <rq_pricing_blackscholes_gen@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    1b11 <rq_pricing_barone_adesi_whaley_amer_call+0x9a1>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe1e(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe07(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xde3(%rip),%xmm1
subsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  0xdb3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xdaf(%rip),%xmm1
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  0xda2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x140(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  0xd72(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xd54(%rip),%xmm2
divsd  -0x58(%rbp),%xmm2
movsd  0xd47(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  0xd20(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
cvttsd2si -0x18(%rbp),%edi
call   1090 <sqrt@plt>
movsd  -0x138(%rbp),%xmm1
ff
movsd  -0x130(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   1050 <exp@plt>
movsd  -0x120(%rbp),%xmm0
ff
movsd  -0x118(%rbp),%xmm1
ff
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xc58(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
movsd  -0x110(%rbp),%xmm1
ff
movsd  -0x108(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  0xbca(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
cvttsd2si -0x18(%rbp),%edi
call   1090 <sqrt@plt>
movsd  -0x100(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xb61(%rip),%xmm1
subsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  0xb31(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xb2d(%rip),%xmm1
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  0xb20(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  0xaf0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
mov    $0x1,%edi
call   1060 <rq_pricing_blackscholes_gen@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
mov    %eax,-0xe4(%rbp)
movsd  -0x80(%rbp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    -0xe4(%rbp),%ecx
movsd  -0xe0(%rbp),%xmm0
ff
imul   %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  -0x70(%rbp),%xmm1
divsd  -0x88(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
mov    %eax,-0xd8(%rbp)
movsd  -0x80(%rbp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    %eax,%ecx
mov    -0xd8(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0x9fe(%rip),%xmm1
divsd  -0x88(%rbp),%xmm1
ff
movsd  0x9ee(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
mov    %eax,-0xd4(%rbp)
movsd  -0x80(%rbp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    %eax,%ecx
mov    -0xd4(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
cvttsd2si -0x18(%rbp),%edi
call   1090 <sqrt@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  -0xc8(%rbp),%xmm3
ff
movsd  -0xc0(%rbp),%xmm2
ff
movaps %xmm0,%xmm4
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm4,%xmm1
divsd  %xmm1,%xmm3
movsd  0x95d(%rip),%xmm1
subsd  %xmm3,%xmm1
divsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0x931(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x98(%rbp),%xmm0
ff
movaps 0x932(%rip),%xmm1
pand   %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    197a <rq_pricing_barone_adesi_whaley_amer_call+0x80a>
movsd  -0x10(%rbp),%xmm1
addsd  -0x98(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x8c2(%rip),%xmm1
subsd  -0xa0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  -0x30(%rbp),%xmm2
movsd  0x890(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
cvttsd2si -0x18(%rbp),%edi
call   1090 <sqrt@plt>
movsd  -0x190(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x188(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
mov    $0x1,%edi
call   1060 <rq_pricing_blackscholes_gen@plt>
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
mov    %eax,-0x17c(%rbp)
movsd  -0x80(%rbp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    -0x17c(%rbp),%ecx
movsd  -0x178(%rbp),%xmm0
ff
imul   %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  -0x70(%rbp),%xmm1
divsd  -0x88(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
mov    %eax,-0x16c(%rbp)
movsd  -0x80(%rbp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    %eax,%ecx
mov    -0x16c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  0x756(%rip),%xmm1
divsd  -0x88(%rbp),%xmm1
ff
movsd  0x746(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1030 <rq_pricing_norm_dist@plt>
movaps %xmm0,%xmm1
movsd  -0x168(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
cvttsd2si -0x18(%rbp),%edi
call   1090 <sqrt@plt>
movsd  -0x160(%rbp),%xmm1
ff
movsd  -0x158(%rbp),%xmm3
ff
movsd  -0x150(%rbp),%xmm2
ff
movaps %xmm0,%xmm4
movsd  -0x148(%rbp),%xmm0
ff
mulsd  %xmm4,%xmm1
divsd  %xmm1,%xmm3
movsd  0x6af(%rip),%xmm1
subsd  %xmm3,%xmm1
divsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    16d7 <rq_pricing_barone_adesi_whaley_amer_call+0x567>
movsd  -0x8(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1afd <rq_pricing_barone_adesi_whaley_amer_call+0x98d>
movsd  -0x48(%rbp),%xmm0
movsd  0x66d(%rip),%xmm1
subsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x1b8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  0x63d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0x639(%rip),%xmm1
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  0x62c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x1b8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  0x5fc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x1a8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
mov    %eax,-0x1ac(%rbp)
movsd  -0x80(%rbp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    -0x1ac(%rbp),%ecx
movsd  -0x1a8(%rbp),%xmm0
ff
imul   %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
mov    $0x1,%edi
call   1060 <rq_pricing_blackscholes_gen@plt>
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
call   1080 <pow@plt>
movsd  -0x1a0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x198(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1b0c <rq_pricing_barone_adesi_whaley_amer_call+0x99c>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1b11 <rq_pricing_barone_adesi_whaley_amer_call+0x9a1>
movsd  -0x38(%rbp),%xmm0
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_barone_adesi_whaley_amer_call>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
ucomisd %xmm3,%xmm4
jae    1748 <rq_pricing_barone_adesi_whaley_amer_call+0x5d8>
movsd  %xmm0,0x58(%rsp)
movapd %xmm5,%xmm7
mulsd  %xmm5,%xmm7
movsd  %xmm7,0x50(%rsp)
movapd %xmm4,%xmm6
addsd  %xmm4,%xmm6
divsd  %xmm7,%xmm6
movapd %xmm3,%xmm0
addsd  %xmm3,%xmm0
movapd %xmm0,0x40(%rsp)
divsd  %xmm7,%xmm0
addsd  0xe3b(%rip),%xmm6
movsd  %xmm6,0x60(%rsp)
mulsd  %xmm6,%xmm6
movsd  %xmm6,0x30(%rsp)
mulsd  0xe2b(%rip),%xmm0
addsd  %xmm6,%xmm0
cvttsd2si %xmm0,%edi
movsd  %xmm5,0x18(%rsp)
movsd  %xmm4,0x38(%rsp)
movapd %xmm3,0x70(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1090 <sqrt@plt>
subsd  0x60(%rsp),%xmm0
mulsd  0xdfa(%rip),%xmm0
movsd  0xde2(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xdee(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
cvttsd2si 0x28(%rsp),%ebx
mov    %ebx,%edi
call   1090 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
addsd  %xmm1,%xmm0
xorpd  0xdbc(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
movsd  %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1050 <exp@plt>
mov    $0x1,%r15d
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0xd70(%rip),%xmm0
xorpd  0x70(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1050 <exp@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0x50(%rsp),%xmm0
movapd 0x40(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1070 <log@plt>
movsd  0x50(%rsp),%xmm1
mulsd  0xcfc(%rip),%xmm1
addsd  0x38(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
movsd  %xmm1,0x50(%rsp)
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1090 <sqrt@plt>
mulsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd 0x40(%rsp),%xmm0
mulsd  0xcb0(%rip),%xmm0
addsd  0x30(%rsp),%xmm0
cvttsd2si %xmm0,%r14d
mov    %r14d,%edi
call   1090 <sqrt@plt>
subsd  0x60(%rsp),%xmm0
mulsd  0xc97(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
mov    $0x1,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movaps 0x70(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
call   1060 <rq_pricing_blackscholes_gen@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x38(%rsp),%xmm0
subsd  0x70(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
call   1050 <exp@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
imul   %ebp,%eax
sub    %eax,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  0x30(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
mov    %eax,%r15d
movsd  (%rsp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    %eax,%r13d
movsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
mov    %eax,%r12d
movsd  (%rsp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1090 <sqrt@plt>
movsd  0x20(%rsp),%xmm7
movsd  0x8(%rsp),%xmm5
movsd  0x10(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
movapd %xmm5,%xmm1
subsd  %xmm3,%xmm1
subsd  %xmm7,%xmm1
andpd  0xbd7(%rip),%xmm1
divsd  %xmm3,%xmm1
ucomisd 0xbab(%rip),%xmm1
jbe    167b <rq_pricing_barone_adesi_whaley_amer_call+0x50b>
movsd  0xb7d(%rip),%xmm4
movsd  0x30(%rsp),%xmm8
divsd  %xmm8,%xmm4
imul   %r15d,%r13d
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
movsd  0xb74(%rip),%xmm9
addsd  %xmm9,%xmm4
imul   %r12d,%ebp
cvtsi2sd %ebp,%xmm6
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm6
movapd %xmm9,%xmm0
subsd  %xmm6,%xmm0
divsd  %xmm8,%xmm0
movsd  %xmm4,0x88(%rsp)
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
nopl   0x0(%rax,%rax,1)
addsd  %xmm3,%xmm7
mulsd  %xmm1,%xmm5
subsd  %xmm5,%xmm7
movsd  0xb24(%rip),%xmm0
subsd  %xmm1,%xmm0
divsd  %xmm0,%xmm7
movsd  %xmm7,0x8(%rsp)
movapd %xmm7,%xmm0
divsd  %xmm3,%xmm0
call   1070 <log@plt>
addsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1090 <sqrt@plt>
mulsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    $0x1,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movaps 0x70(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
call   1060 <rq_pricing_blackscholes_gen@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
imul   %ebp,%eax
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  0x30(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
imul   %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x90(%rsp)
movsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  (%rsp),%xmm0
call   1030 <rq_pricing_norm_dist@plt>
mulsd  0x68(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
mov    %ebx,%edi
call   1090 <sqrt@plt>
movsd  0x90(%rsp),%xmm1
movsd  0x20(%rsp),%xmm7
movsd  0x8(%rsp),%xmm5
movsd  0x10(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x68(%rsp),%xmm4
divsd  %xmm0,%xmm4
movsd  0x9da(%rip),%xmm0
subsd  %xmm4,%xmm0
divsd  0x30(%rsp),%xmm0
mulsd  0x88(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm5,%xmm0
subsd  %xmm3,%xmm0
subsd  %xmm7,%xmm0
andpd  0x9d7(%rip),%xmm0
divsd  %xmm3,%xmm0
ucomisd 0x9ab(%rip),%xmm0
ja     14e0 <rq_pricing_barone_adesi_whaley_amer_call+0x370>
movsd  0x58(%rsp),%xmm0
ucomisd %xmm0,%xmm5
jbe    1763 <rq_pricing_barone_adesi_whaley_amer_call+0x5f3>
mov    %r14d,%edi
movsd  %xmm5,0x8(%rsp)
call   1090 <sqrt@plt>
subsd  0x60(%rsp),%xmm0
mulsd  0x969(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x40(%rsp),%xmm0
call   1050 <exp@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1040 <rq_pricing_cumul_norm_dist@plt>
imul   %ebx,%eax
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
movsd  0x58(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movapd 0x70(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
call   1060 <rq_pricing_blackscholes_gen@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x58(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
call   1080 <pow@plt>
mulsd  (%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
jmp    1767 <rq_pricing_barone_adesi_whaley_amer_call+0x5f7>
mov    $0x1,%edi
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <rq_pricing_blackscholes_gen@plt>
subsd  %xmm3,%xmm0
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define double @rq_pricing_barone_adesi_whaley_amer_call(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fcmp ult double %4, %3
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call double @rq_pricing_blackscholes_gen(i32 1, double %0, double %1, double %2, double %3, double %4, double %5)
br label %156
10: ; preds = %6
%11 = fmul double %5, %5
%12 = fmul double %4, 2.000000e+00
%13 = fdiv double %12, %11
%14 = fmul double %3, 2.000000e+00
%15 = fdiv double %14, %11
%16 = fadd double %13, -1.000000e+00
%17 = fmul double %16, %16
%18 = tail call double @llvm.fmuladd.f64(double %15, double 4.000000e+00, double %17)
%19 = fptosi double %18 to i32
%20 = tail call double @sqrt(i32 %19)
%21 = fsub double %20, %16
%22 = fmul double %21, 5.000000e-01
%23 = fdiv double 1.000000e+00, %22
%24 = fsub double 1.000000e+00, %23
%25 = fdiv double %1, %24
%26 = fmul double %5, 2.000000e+00
%27 = fptosi double %2 to i32
%28 = tail call double @sqrt(i32 %27)
%29 = fmul double %26, %28
%30 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %29)
%31 = fneg double %30
%32 = fmul double %31, %1
%33 = fsub double %25, %1
%34 = fdiv double %32, %33
%35 = tail call i32 @exp(double %34)
%36 = sub nsw i32 1, %35
%37 = sitofp i32 %36 to double
%38 = tail call double @llvm.fmuladd.f64(double %33, double %37, double %1)
%39 = fneg double %3
%40 = fmul double %39, %2
%41 = tail call i32 @exp(double %40)
%42 = sub nsw i32 1, %41
%43 = sitofp i32 %42 to double
%44 = fmul double %11, %43
%45 = fdiv double %14, %44
%46 = fdiv double %38, %1
%47 = tail call double @log(double %46)
%48 = fmul double %11, 5.000000e-01
%49 = fadd double %48, %4
%50 = tail call double @llvm.fmuladd.f64(double %49, double %2, double %47)
%51 = tail call double @sqrt(i32 %27)
%52 = fmul double %51, %5
%53 = fdiv double %50, %52
%54 = tail call double @llvm.fmuladd.f64(double %45, double 4.000000e+00, double %17)
%55 = fptosi double %54 to i32
%56 = tail call double @sqrt(i32 %55)
%57 = fsub double %56, %16
%58 = fmul double %57, 5.000000e-01
%59 = tail call double @rq_pricing_blackscholes_gen(i32 1, double %38, double %1, double %2, double %3, double %4, double %5)
%60 = fsub double %4, %3
%61 = fmul double %60, %2
%62 = tail call i32 @exp(double %61)
%63 = tail call i32 @rq_pricing_cumul_norm_dist(double %53)
%64 = mul nsw i32 %63, %62
%65 = sub nsw i32 1, %64
%66 = sitofp i32 %65 to double
%67 = fmul double %38, %66
%68 = fdiv double %67, %58
%69 = fadd double %59, %68
%70 = tail call i32 @exp(double %61)
%71 = tail call i32 @rq_pricing_cumul_norm_dist(double %53)
%72 = fdiv double 1.000000e+00, %58
%73 = fsub double 1.000000e+00, %72
%74 = tail call i32 @exp(double %61)
%75 = tail call i32 @rq_pricing_cumul_norm_dist(double %53)
%76 = tail call double @sqrt(i32 %27)
%77 = fsub double %38, %1
%78 = fsub double %77, %69
%79 = tail call double @llvm.fabs.f64(double %78)
%80 = fdiv double %79, %1
%81 = fcmp ogt double %80, 0x3EB0C6F7A0B5ED8D
br i1 %81, label %82, label %135
82: ; preds = %10
%83 = mul nsw i32 %71, %70
%84 = sitofp i32 %83 to double
%85 = mul nsw i32 %75, %74
%86 = sitofp i32 %85 to double
%87 = fmul double %76, %5
%88 = fdiv double %86, %87
%89 = fsub double 1.000000e+00, %88
%90 = fdiv double %89, %58
%91 = tail call double @llvm.fmuladd.f64(double %84, double %73, double %90)
br label %92
92: ; preds = %82, %92
%93 = phi double [ %100, %92 ], [ %38, %82 ]
%94 = phi double [ %129, %92 ], [ %91, %82 ]
%95 = phi double [ %115, %92 ], [ %69, %82 ]
%96 = fadd double %95, %1
%97 = fneg double %94
%98 = tail call double @llvm.fmuladd.f64(double %97, double %93, double %96)
%99 = fsub double 1.000000e+00, %94
%100 = fdiv double %98, %99
%101 = fdiv double %100, %1
%102 = tail call double @log(double %101)
%103 = tail call double @llvm.fmuladd.f64(double %49, double %2, double %102)
%104 = tail call double @sqrt(i32 %27)
%105 = fmul double %104, %5
%106 = fdiv double %103, %105
%107 = tail call double @rq_pricing_blackscholes_gen(i32 1, double %100, double %1, double %2, double %3, double %4, double %5)
%108 = tail call i32 @exp(double %61)
%109 = tail call i32 @rq_pricing_cumul_norm_dist(double %106)
%110 = mul nsw i32 %109, %108
%111 = sub nsw i32 1, %110
%112 = sitofp i32 %111 to double
%113 = fmul double %100, %112
%114 = fdiv double %113, %58
%115 = fadd double %107, %114
%116 = tail call i32 @exp(double %61)
%117 = tail call i32 @rq_pricing_cumul_norm_dist(double %106)
%118 = mul nsw i32 %117, %116
%119 = sitofp i32 %118 to double
%120 = tail call i32 @exp(double %61)
%121 = sitofp i32 %120 to double
%122 = tail call double @rq_pricing_norm_dist(double %106)
%123 = fmul double %122, %121
%124 = tail call double @sqrt(i32 %27)
%125 = fmul double %124, %5
%126 = fdiv double %123, %125
%127 = fsub double 1.000000e+00, %126
%128 = fdiv double %127, %58
%129 = tail call double @llvm.fmuladd.f64(double %119, double %73, double %128)
%130 = fsub double %100, %1
%131 = fsub double %130, %115
%132 = tail call double @llvm.fabs.f64(double %131)
%133 = fdiv double %132, %1
%134 = fcmp ogt double %133, 0x3EB0C6F7A0B5ED8D
br i1 %134, label %92, label %135
135: ; preds = %92, %10
%136 = phi double [ %53, %10 ], [ %106, %92 ]
%137 = phi double [ %38, %10 ], [ %100, %92 ]
%138 = fcmp ogt double %137, %0
br i1 %138, label %139, label %154
139: ; preds = %135
%140 = tail call double @sqrt(i32 %55)
%141 = fsub double %140, %16
%142 = fmul double %141, 5.000000e-01
%143 = fdiv double %137, %142
%144 = tail call i32 @exp(double %61)
%145 = tail call i32 @rq_pricing_cumul_norm_dist(double %136)
%146 = mul nsw i32 %145, %144
%147 = sub nsw i32 1, %146
%148 = sitofp i32 %147 to double
%149 = fmul double %143, %148
%150 = tail call double @rq_pricing_blackscholes_gen(i32 1, double %0, double %1, double %2, double %3, double %4, double %5)
%151 = fdiv double %0, %137
%152 = tail call double @pow(double %151, double %142)
%153 = tail call double @llvm.fmuladd.f64(double %149, double %152, double %150)
br label %156
154: ; preds = %135
%155 = fsub double %0, %1
br label %156
156: ; preds = %139, %154, %8
%157 = phi double [ %9, %8 ], [ %153, %139 ], [ %155, %154 ]
ret double %157
}