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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double exp(double);
double log(double);
double pow(double, double);
int rq_pricing_blackscholes(short, double, double, double, double, double,
                            double, double);
double rq_pricing_cumul_norm_dist(double);
double sqrt(double);
double rq_pricing_single_barrier(short in, short call, double S, double X,
                                 double B, double r_dom, double r_for,
                                 double sigma, double tau_e, double tau_d) {
  int eta = (S > B ? 1 : -1);
  int fi = (call ? 1 : -1);
  int S_gt_B = (S > B);
  int X_gt_B = (X > B);
  int b_over = ((S_gt_B == X_gt_B) && (X_gt_B == 0));
  int a2 = (call ? !X_gt_B : X_gt_B);
  int a3 = (S_gt_B == X_gt_B);
  int a4 = a2;
  double f = S * exp(r_dom * tau_d) / exp(r_for * tau_d);
  double b = log(f / S) / tau_d;
  double z = 1 - X / B;
  double df_dom = exp(-r_dom * tau_d);
  double df_for = exp(-r_for * tau_d);
  double v1;
  double v2;
  double v3;
  double v4;
  double v_sq = sigma * sigma;
  double one_p_b_m_half_vsq_o_vsq = 1.0 + (b - 0.5 * v_sq) / v_sq;
  double v_sqrt_t = sigma * sqrt(tau_e);
  double d1_S_B =
      ((log(S / B) + (b * tau_d) + (v_sq / 2.0) * tau_e) / v_sqrt_t);
  double d1_B_S =
      ((log(B / S) + (b * tau_d) + (v_sq / 2.0) * tau_e) / v_sqrt_t);
  double d1_S_X =
      ((log(S / X) + (b * tau_d) + (v_sq / 2.0) * tau_e) / v_sqrt_t);
  int a1 = (in && ((S_gt_B && !X_gt_B) || (!S_gt_B && X_gt_B))) ||
           (!in && (S_gt_B == X_gt_B));
  if (a2)
    if ((in && call && S_gt_B) || (in && !call && !S_gt_B) ||
        (!in && call && !S_gt_B) || (!in && !call && S_gt_B))
      a2 = -1;
  if (a3)
    if ((in && call && b_over) || (in && !call && !b_over) ||
        (!in && call && !b_over) || (!in && !call && b_over))
      a3 = -1;
  if (!in && a4)
    a4 = -1;
  v1 = (a1 *
        rq_pricing_blackscholes(call, S, X, r_dom, r_for, sigma, tau_e, tau_d));
  v2 = ((double)a2) * ((double)fi) *
       ((df_for * S * rq_pricing_cumul_norm_dist(d1_S_B * fi)) -
        (df_dom * X * rq_pricing_cumul_norm_dist((d1_S_B - v_sqrt_t) * fi)));
  v3 = ((double)a3) * ((double)fi) *
       (df_for * S * pow(B / S, 2.0 * one_p_b_m_half_vsq_o_vsq) *
            rq_pricing_cumul_norm_dist((log((B * B) / (S * X)) / v_sqrt_t +
                                        one_p_b_m_half_vsq_o_vsq * v_sqrt_t) *
                                       eta) -
        (df_dom * X * pow(B / S, 2.0 * one_p_b_m_half_vsq_o_vsq - 2.0) *
         rq_pricing_cumul_norm_dist(((log((B * B) / (S * X)) / v_sqrt_t +
                                      one_p_b_m_half_vsq_o_vsq * v_sqrt_t) -
                                     v_sqrt_t) *
                                    eta)));
  v4 = ((double)a4) * ((double)fi) *
       ((df_for * S * pow(B / S, 2.0 * one_p_b_m_half_vsq_o_vsq) *
             rq_pricing_cumul_norm_dist(d1_B_S * eta) -
         (df_dom * X * pow(B / S, 2.0 * one_p_b_m_half_vsq_o_vsq - 2.0) *
          rq_pricing_cumul_norm_dist((d1_B_S - v_sqrt_t) * eta))));
  return v1 + v2 + v3 + v4;
}


x86 assembly (clang, -O0):
<rq_pricing_single_barrier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4c(%rbp)
movswl -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x54(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x58(%rbp)
mov    -0x54(%rbp),%ecx
xor    %eax,%eax
cmp    -0x58(%rbp),%ecx
mov    %al,-0xe5(%rbp)
jne    1221 <rq_pricing_single_barrier+0xc1>
cmpl   $0x0,-0x58(%rbp)
sete   %al
mov    %al,-0xe5(%rbp)
mov    -0xe5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x5c(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1255 <rq_pricing_single_barrier+0xf5>
cmpl   $0x0,-0x58(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xec(%rbp)
jmp    125e <rq_pricing_single_barrier+0xfe>
mov    -0x58(%rbp),%eax
mov    %eax,-0xec(%rbp)
mov    -0xec(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x58(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm1
divsd  -0x20(%rbp),%xmm1
movsd  0xd09(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
movsd  0xc85(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
divsd  -0xb8(%rbp),%xmm1
ff
movsd  0xc65(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
call   1080 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1060 <log@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xbf2(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xba0(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1060 <log@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xb4e(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1518 <rq_pricing_single_barrier+0x3b8>
cmpl   $0x0,-0x54(%rbp)
je     14fc <rq_pricing_single_barrier+0x39c>
mov    $0x1,%al
cmpl   $0x0,-0x58(%rbp)
mov    %al,-0x109(%rbp)
je     1546 <rq_pricing_single_barrier+0x3e6>
cmpl   $0x0,-0x54(%rbp)
jne    1518 <rq_pricing_single_barrier+0x3b8>
mov    $0x1,%al
cmpl   $0x0,-0x58(%rbp)
mov    %al,-0x109(%rbp)
jne    1546 <rq_pricing_single_barrier+0x3e6>
xor    %eax,%eax
cmpw   $0x0,-0x2(%rbp)
mov    %al,-0x10a(%rbp)
jne    153a <rq_pricing_single_barrier+0x3da>
mov    -0x54(%rbp),%eax
cmp    -0x58(%rbp),%eax
sete   %al
mov    %al,-0x10a(%rbp)
mov    -0x10a(%rbp),%al
mov    %al,-0x109(%rbp)
mov    -0x109(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0x60(%rbp)
je     15f5 <rq_pricing_single_barrier+0x495>
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1585 <rq_pricing_single_barrier+0x425>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1585 <rq_pricing_single_barrier+0x425>
cmpl   $0x0,-0x54(%rbp)
jne    15e9 <rq_pricing_single_barrier+0x489>
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     15a7 <rq_pricing_single_barrier+0x447>
cmpw   $0x0,-0x4(%rbp)
jne    15a7 <rq_pricing_single_barrier+0x447>
cmpl   $0x0,-0x54(%rbp)
je     15e9 <rq_pricing_single_barrier+0x489>
cmpw   $0x0,-0x2(%rbp)
jne    15c9 <rq_pricing_single_barrier+0x469>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     15c9 <rq_pricing_single_barrier+0x469>
cmpl   $0x0,-0x54(%rbp)
je     15e9 <rq_pricing_single_barrier+0x489>
cmpw   $0x0,-0x2(%rbp)
jne    15f0 <rq_pricing_single_barrier+0x490>
cmpw   $0x0,-0x4(%rbp)
jne    15f0 <rq_pricing_single_barrier+0x490>
cmpl   $0x0,-0x54(%rbp)
je     15f0 <rq_pricing_single_barrier+0x490>
movl   $0xffffffff,-0x60(%rbp)
jmp    15f5 <rq_pricing_single_barrier+0x495>
cmpl   $0x0,-0x64(%rbp)
je     1693 <rq_pricing_single_barrier+0x533>
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1623 <rq_pricing_single_barrier+0x4c3>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1623 <rq_pricing_single_barrier+0x4c3>
cmpl   $0x0,-0x5c(%rbp)
jne    1687 <rq_pricing_single_barrier+0x527>
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1645 <rq_pricing_single_barrier+0x4e5>
cmpw   $0x0,-0x4(%rbp)
jne    1645 <rq_pricing_single_barrier+0x4e5>
cmpl   $0x0,-0x5c(%rbp)
je     1687 <rq_pricing_single_barrier+0x527>
cmpw   $0x0,-0x2(%rbp)
jne    1667 <rq_pricing_single_barrier+0x507>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1667 <rq_pricing_single_barrier+0x507>
cmpl   $0x0,-0x5c(%rbp)
je     1687 <rq_pricing_single_barrier+0x527>
cmpw   $0x0,-0x2(%rbp)
jne    168e <rq_pricing_single_barrier+0x52e>
cmpw   $0x0,-0x4(%rbp)
jne    168e <rq_pricing_single_barrier+0x52e>
cmpl   $0x0,-0x5c(%rbp)
je     168e <rq_pricing_single_barrier+0x52e>
movl   $0xffffffff,-0x64(%rbp)
jmp    1693 <rq_pricing_single_barrier+0x533>
cmpw   $0x0,-0x2(%rbp)
jne    16af <rq_pricing_single_barrier+0x54f>
cmpl   $0x0,-0x68(%rbp)
je     16af <rq_pricing_single_barrier+0x54f>
movl   $0xffffffff,-0x68(%rbp)
mov    -0xe4(%rbp),%eax
mov    %eax,-0x194(%rbp)
mov    -0x4(%rbp),%ax
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm5
movsd  -0x48(%rbp),%xmm6
movswl %ax,%edi
call   1050 <rq_pricing_blackscholes@plt>
mov    %eax,%ecx
mov    -0x194(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x98(%rbp)
cvtsi2sdl -0x60(%rbp),%xmm0
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
subsd  -0xc8(%rbp),%xmm0
ff
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x190(%rbp),%xmm2
ff
movsd  -0x188(%rbp),%xmm1
ff
movsd  -0x180(%rbp),%xmm3
ff
movaps %xmm0,%xmm4
movsd  -0x178(%rbp),%xmm0
ff
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
cvtsi2sdl -0x64(%rbp),%xmm0
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0x7f4(%rip),%xmm1
mulsd  -0xc0(%rbp),%xmm1
ff
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x170(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
divsd  -0xc8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x4c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  -0xc0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0x75f(%rip),%xmm2
addsd  %xmm2,%xmm1
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x168(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
divsd  -0xc8(%rbp),%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0xc8(%rbp),%xmm0
ff
cvtsi2sdl -0x4c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x160(%rbp),%xmm2
ff
movsd  -0x158(%rbp),%xmm1
ff
movsd  -0x150(%rbp),%xmm3
ff
movaps %xmm0,%xmm4
movsd  -0x148(%rbp),%xmm0
ff
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
cvtsi2sdl -0x68(%rbp),%xmm0
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0x642(%rip),%xmm1
mulsd  -0xc0(%rbp),%xmm1
ff
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x140(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
cvtsi2sdl -0x4c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  -0xc0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0x5e5(%rip),%xmm2
addsd  %xmm2,%xmm1
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x138(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
subsd  -0xc8(%rbp),%xmm0
ff
cvtsi2sdl -0x4c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x130(%rbp),%xmm2
ff
movsd  -0x128(%rbp),%xmm1
ff
movsd  -0x120(%rbp),%xmm3
ff
movaps %xmm0,%xmm4
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0xa0(%rbp),%xmm0
ff
addsd  -0xa8(%rbp),%xmm0
ff
addsd  -0xb0(%rbp),%xmm0
ff
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_single_barrier>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
movsd  %xmm7,0x90(%rsp)
movsd  %xmm6,0xa0(%rsp)
movsd  %xmm5,0xd0(%rsp)
movaps %xmm4,0x60(%rsp)
movapd %xmm3,0xc0(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %esi,%r15d
mov    %edi,%r14d
ucomisd %xmm2,%xmm0
seta   %r12b
xor    %ebx,%ebx
xor    %ebp,%ebp
movapd %xmm2,0x30(%rsp)
movsd  %xmm1,0x20(%rsp)
ucomisd %xmm2,%xmm1
setbe  %bl
seta   %bpl
test   %r15w,%r15w
mov    %ebp,%r13d
cmovne %ebx,%r13d
movapd %xmm3,%xmm0
mulsd  %xmm7,%xmm0
call   1040 <exp@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0x60(%rsp),%xmm0
mulsd  0x90(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x50(%rsp)
movapd 0xc0(%rsp),%xmm0
xorpd  0xdcf(%rip),%xmm0
mulsd  0x90(%rsp),%xmm0
call   1040 <exp@plt>
movapd %xmm0,0xe0(%rsp)
movapd 0xdb0(%rip),%xmm0
xorpd  0x60(%rsp),%xmm0
mulsd  0x90(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0xa0(%rsp),%xmm1
movapd %xmm0,0xb0(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1289 <rq_pricing_single_barrier+0x129>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1292 <rq_pricing_single_barrier+0x132>
movapd %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
xor    %bpl,%r12b
movsd  0x10(%rsp),%xmm0
divsd  0x30(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x70(%rsp)
movapd 0x30(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x88(%rsp)
call   1060 <log@plt>
movapd %xmm0,%xmm8
movsd  0x10(%rsp),%xmm0
divsd  0x20(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    181b <rq_pricing_single_barrier+0x6bb>
mov    %r12d,%eax
xor    $0x1,%al
xorpd  %xmm1,%xmm1
test   %r13b,%r13b
movsd  0x90(%rsp),%xmm6
movsd  0xa0(%rsp),%xmm5
movsd  0xd0(%rsp),%xmm4
movsd  0x70(%rsp),%xmm10
movsd  0x50(%rsp),%xmm9
je     1397 <rq_pricing_single_barrier+0x237>
test   %r14w,%r14w
je     133c <rq_pricing_single_barrier+0x1dc>
test   %r15w,%r15w
je     133c <rq_pricing_single_barrier+0x1dc>
movsd  0x10(%rsp),%xmm0
ucomisd 0x30(%rsp),%xmm0
ja     138f <rq_pricing_single_barrier+0x22f>
test   %r14w,%r14w
je     1356 <rq_pricing_single_barrier+0x1f6>
test   %r15w,%r15w
jne    1356 <rq_pricing_single_barrier+0x1f6>
movsd  0x10(%rsp),%xmm0
ucomisd 0x30(%rsp),%xmm0
jbe    138f <rq_pricing_single_barrier+0x22f>
movsd  0x10(%rsp),%xmm0
ucomisd 0x30(%rsp),%xmm0
ja     1370 <rq_pricing_single_barrier+0x210>
test   %r14w,%r14w
jne    1370 <rq_pricing_single_barrier+0x210>
test   %r15w,%r15w
jne    138f <rq_pricing_single_barrier+0x22f>
mov    %r15d,%ecx
or     %r14w,%cx
movsd  0xc99(%rip),%xmm1
jne    1397 <rq_pricing_single_barrier+0x237>
movsd  0x10(%rsp),%xmm0
ucomisd 0x30(%rsp),%xmm0
jbe    1397 <rq_pricing_single_barrier+0x237>
movsd  0xc91(%rip),%xmm1
divsd  %xmm6,%xmm9
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
movzbl %al,%ebp
test   %r12b,%r12b
movsd  %xmm1,0x48(%rsp)
jne    140c <rq_pricing_single_barrier+0x2ac>
and    %al,%bl
test   %r14w,%r14w
setne  %al
test   %r15w,%r15w
setne  %cl
and    %al,%cl
test   %bl,%cl
jne    1407 <rq_pricing_single_barrier+0x2a7>
test   %r15w,%r15w
setne  %al
test   %r14w,%r14w
sete   %cl
or     %al,%cl
or     %bl,%cl
cmp    $0x1,%cl
jne    1407 <rq_pricing_single_barrier+0x2a7>
test   %r14w,%r14w
setne  %al
test   %r15w,%r15w
sete   %cl
or     %al,%cl
or     %bl,%cl
cmp    $0x1,%cl
jne    1407 <rq_pricing_single_barrier+0x2a7>
mov    %r15d,%eax
or     %r14w,%ax
setne  %al
xor    $0x1,%bl
or     %al,%bl
jne    140c <rq_pricing_single_barrier+0x2ac>
mov    $0xffffffff,%ebp
movsd  0xbfc(%rip),%xmm7
mulsd  %xmm0,%xmm7
movapd %xmm9,%xmm3
mulsd  %xmm6,%xmm3
movsd  0xbf7(%rip),%xmm1
mulsd  %xmm0,%xmm1
movzbl %r13b,%eax
cvtsi2sd %eax,%xmm11
movsd  0xbea(%rip),%xmm2
test   %r13b,%r13b
jne    1448 <rq_pricing_single_barrier+0x2e8>
movapd %xmm11,%xmm2
addsd  %xmm9,%xmm7
addsd  %xmm3,%xmm10
mulsd  %xmm5,%xmm1
addsd  %xmm3,%xmm8
xor    %eax,%eax
xor    %ebx,%ebx
test   %r14w,%r14w
setne  %al
sete   %bl
je     1470 <rq_pricing_single_barrier+0x310>
movapd %xmm11,%xmm2
movapd %xmm2,0xf0(%rsp)
divsd  %xmm0,%xmm7
movsd  %xmm7,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  %xmm1,%xmm10
movsd  %xmm10,0x70(%rsp)
addsd  %xmm1,%xmm8
movsd  %xmm8,0x28(%rsp)
test   %r12b,%r12b
cmovne %eax,%ebx
movswl %r15w,%edi
movsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movaps 0xc0(%rsp),%xmm2
movaps 0x60(%rsp),%xmm3
call   1050 <rq_pricing_blackscholes@plt>
test   %bl,%bl
jne    14dd <rq_pricing_single_barrier+0x37d>
xorpd  %xmm0,%xmm0
jmp    14e4 <rq_pricing_single_barrier+0x384>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x50(%rsp),%xmm0
addsd  0xb20(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x70(%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  0x28(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0xaf2(%rip),%xmm0
test   %r15w,%r15w
jne    1534 <rq_pricing_single_barrier+0x3d4>
movsd  0xaf4(%rip),%xmm0
movsd  0x48(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x48(%rsp)
movapd 0xb0(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
movapd %xmm1,0xb0(%rsp)
movapd %xmm0,%xmm1
movapd %xmm0,0x90(%rsp)
mulsd  %xmm2,%xmm0
subsd  0x8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x70(%rsp)
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0xa0(%rsp)
movsd  0x70(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movapd 0xe0(%rsp),%xmm2
xorpd  0xa59(%rip),%xmm2
movsd  0x20(%rsp),%xmm3
mulsd  %xmm3,%xmm2
movapd %xmm2,0xe0(%rsp)
mulsd  %xmm2,%xmm0
movsd  0xa0(%rsp),%xmm1
mulsd  0xb0(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  0x48(%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
unpcklpd 0xf0(%rsp),%xmm0
movapd %xmm0,0xc0(%rsp)
movsd  0x50(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x60(%rsp)
movapd 0x30(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0x10(%rsp),%xmm3
divsd  %xmm3,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x88(%rsp),%xmm0
call   1070 <pow@plt>
movaps %xmm0,0x70(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
movsd  0x50(%rsp),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x50(%rsp)
addsd  %xmm2,%xmm0
movapd 0x30(%rsp),%xmm2
cmpltsd 0x10(%rsp),%xmm2
movsd  0x99e(%rip),%xmm3
andpd  %xmm2,%xmm3
movsd  0x9a2(%rip),%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm2,0x30(%rsp)
mulsd  %xmm2,%xmm0
movsd  0x990(%rip),%xmm1
addsd  0x60(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <rq_pricing_cumul_norm_dist@plt>
movapd %xmm0,0xa0(%rsp)
movsd  0x88(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1070 <pow@plt>
movaps %xmm0,0xd0(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
addsd  0x50(%rsp),%xmm0
subsd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movapd %xmm0,0x50(%rsp)
movapd 0x90(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  0xc0(%rsp),%xmm0
movapd %xmm0,0x90(%rsp)
movsd  0x88(%rsp),%xmm0
movsd  0x60(%rsp),%xmm1
call   1070 <pow@plt>
movapd 0xb0(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd 0x70(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm2,0x70(%rsp)
movapd 0x30(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movapd %xmm0,0xb0(%rsp)
movsd  0x88(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1070 <pow@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movapd 0xe0(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd 0xd0(%rsp),%xmm2
unpcklpd 0x10(%rsp),%xmm2
mulpd  %xmm1,%xmm2
movapd 0x50(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm2,%xmm1
movapd 0xa0(%rsp),%xmm0
unpcklpd 0xb0(%rsp),%xmm0
mulpd  0x70(%rsp),%xmm0
addpd  %xmm1,%xmm0
mulpd  0x90(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
addsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movsd  %xmm8,0x28(%rsp)
call   1060 <log@plt>
movsd  0x28(%rsp),%xmm8
jmp    12eb <rq_pricing_single_barrier+0x18b>

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

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