#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);
double rq_pricing_blackscholes(short, double, double, double, double, double,
                               double, double);
double rq_pricing_cumul_norm_dist(double);
double sqrt(double);
double rq_pricing_partial_double_barrier_delayed_start(
    short in, short call, double S, double X, double L, double H, double r_dom,
    double r_for, double sigma, double tau_e, double tau_d, double tau_bar) {
  double fi = (call ? 1.0 : -1.0);
  double b = r_dom - r_for;
  double v_sq = sigma * sigma;
  double b_t = b * tau_d;
  double exp_b_t = exp(b_t);
  double half_v_sq_t = 0.5 * v_sq * tau_e;
  double v_sqrt_t = sigma * sqrt(tau_e);
  double log_S_X = log(S / X);
  double log_S_H = log(S / H);
  double log_L_sq_o_S_X = log((L * L) / (S * X));
  double log_L_sq_o_S_H = log((L * L) / (S * H));
  double log_S_L = log(S / L);
  double log_L_sq_o_S_L = log((L * L) / (S * L));
  double d1_fact = (call ? log_S_X : log_S_L);
  double d2_fact = (call ? log_S_H : log_S_X);
  double d3_fact = (call ? log_L_sq_o_S_X : log_L_sq_o_S_L);
  double d4_fact = (call ? log_L_sq_o_S_H : log_L_sq_o_S_X);
  double asset_prob_d1 = (d1_fact + b_t + half_v_sq_t) / v_sqrt_t;
  double cash_prob_d2 = (d2_fact + b_t + half_v_sq_t) / v_sqrt_t;
  double asset_bar_prob_d3 = (d3_fact + b_t + half_v_sq_t) / v_sqrt_t;
  double cash_bar_prob_d4 = (d4_fact + b_t + half_v_sq_t) / v_sqrt_t;
  double two_b_vsq_1 = 2.0 * b / v_sq + 1.0;
  double expected_value = fi * S * exp_b_t *
                          (rq_pricing_cumul_norm_dist(asset_prob_d1) -
                           rq_pricing_cumul_norm_dist(cash_prob_d2));
  double expected_bar_cost = fi * S * exp_b_t * pow(L / S, two_b_vsq_1) *
                             (rq_pricing_cumul_norm_dist(asset_bar_prob_d3) -
                              rq_pricing_cumul_norm_dist(cash_bar_prob_d4));
  double agreed_value = fi * X *
                        (rq_pricing_cumul_norm_dist(asset_prob_d1 - v_sqrt_t) -
                         rq_pricing_cumul_norm_dist(cash_prob_d2 - v_sqrt_t));
  double agreed_bar_cost =
      fi * X * pow(L / S, two_b_vsq_1 - 2.0) *
      (rq_pricing_cumul_norm_dist(asset_bar_prob_d3 - v_sqrt_t) -
       rq_pricing_cumul_norm_dist(cash_bar_prob_d4 - v_sqrt_t));
  double ko = exp(-r_dom * tau_d) * (expected_value - expected_bar_cost -
                                     agreed_value + agreed_bar_cost);
  if (in)
    return ko;
  else
    return rq_pricing_blackscholes(call, S, X, r_dom, r_for, sigma, tau_e,
                                   tau_d) -
           ko;
}


x86 assembly (clang, -O0):
<rq_pricing_partial_double_barrier_delayed_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %si,%ax
mov    %di,%cx
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
movsd  %xmm5,-0x40(%rbp)
movsd  %xmm6,-0x48(%rbp)
movsd  %xmm7,-0x50(%rbp)
movswl -0xc(%rbp),%eax
movsd  0xe4f(%rip),%xmm0
movsd  0xe4f(%rip),%xmm1
movsd  %xmm1,-0x138(%rbp)
ff
cmp    $0x0,%eax
movsd  %xmm0,-0x130(%rbp)
ff
jne    11ea <rq_pricing_partial_double_barrier_delayed_start+0x8a>
movsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x130(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  0xdc5(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1080 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x140(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movswl -0xc(%rbp),%eax
cmp    $0x0,%eax
je     134e <rq_pricing_partial_double_barrier_delayed_start+0x1ee>
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
jmp    135e <rq_pricing_partial_double_barrier_delayed_start+0x1fe>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movswl -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1390 <rq_pricing_partial_double_barrier_delayed_start+0x230>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
jmp    13a0 <rq_pricing_partial_double_barrier_delayed_start+0x240>
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x150(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movswl -0xc(%rbp),%eax
cmp    $0x0,%eax
je     13d2 <rq_pricing_partial_double_barrier_delayed_start+0x272>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x158(%rbp)
ff
jmp    13e2 <rq_pricing_partial_double_barrier_delayed_start+0x282>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x158(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movswl -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1414 <rq_pricing_partial_double_barrier_delayed_start+0x2b4>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x160(%rbp)
ff
jmp    1424 <rq_pricing_partial_double_barrier_delayed_start+0x2c4>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x160(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
addsd  -0x70(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  0xb54(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  0xb32(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x1b0(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x1b0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x1a8(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x100(%rbp),%xmm1
ff
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x1a0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x198(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x190(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x188(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x180(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x100(%rbp),%xmm1
ff
movsd  0x9bd(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x178(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x170(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x168(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  0x10(%rbp),%xmm0
call   1040 <exp@plt>
movsd  -0x108(%rbp),%xmm1
ff
subsd  -0x110(%rbp),%xmm1
ff
subsd  -0x118(%rbp),%xmm1
ff
addsd  -0x120(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
cmpw   $0x0,-0xa(%rbp)
je     173f <rq_pricing_partial_double_barrier_delayed_start+0x5df>
movsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    177b <rq_pricing_partial_double_barrier_delayed_start+0x61b>
mov    -0xc(%rbp),%ax
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm4
movsd  -0x50(%rbp),%xmm5
movsd  0x10(%rbp),%xmm6
movswl %ax,%edi
call   1050 <rq_pricing_blackscholes@plt>
subsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_partial_double_barrier_delayed_start>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xc8,%rsp
movsd  %xmm7,0x60(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x48(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %esi,%r15d
mov    %edi,%r14d
xor    %ebp,%ebp
test   %r15w,%r15w
sete   %bpl
lea    0xe5e(%rip),%rbx
movapd %xmm4,0xb0(%rsp)
movsd  %xmm5,0x98(%rsp)
subsd  %xmm5,%xmm4
movsd  %xmm6,0x78(%rsp)
mulsd  %xmm6,%xmm6
movsd  %xmm6,(%rsp)
movapd %xmm4,0x80(%rsp)
movapd %xmm4,%xmm0
mulsd  0xf0(%rsp),%xmm0
movapd %xmm0,0xa0(%rsp)
call   1040 <exp@plt>
movsd  0x60(%rsp),%xmm1
movsd  0xe27(%rip),%xmm3
mulsd  (%rsp),%xmm3
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
movsd  %xmm0,0x50(%rsp)
jb     1217 <rq_pricing_partial_double_barrier_delayed_start+0xb7>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1232 <rq_pricing_partial_double_barrier_delayed_start+0xd2>
movapd %xmm1,%xmm0
movsd  %xmm3,0x18(%rsp)
call   1080 <sqrt@plt>
movsd  0x18(%rsp),%xmm3
movsd  0x60(%rsp),%xmm1
movsd  %xmm0,0x30(%rsp)
movsd  0x48(%rsp),%xmm2
movsd  (%rbx,%rbp,8),%xmm0
movsd  %xmm0,0x28(%rsp)
mulsd  %xmm1,%xmm3
movsd  %xmm3,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  %xmm2,%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x70(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0x20(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x10(%rsp),%xmm1
mulsd  0x48(%rsp),%xmm1
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x68(%rsp)
movsd  0x20(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  0x38(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0x38(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1060 <log@plt>
movsd  0x30(%rsp),%xmm4
mulsd  0x78(%rsp),%xmm4
test   %r15w,%r15w
je     1345 <rq_pricing_partial_double_barrier_delayed_start+0x1e5>
movsd  0x70(%rsp),%xmm0
movsd  0x68(%rsp),%xmm5
movsd  0x10(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x58(%rsp),%xmm3
movsd  0x50(%rsp),%xmm8
movapd 0xa0(%rsp),%xmm6
movsd  0x18(%rsp),%xmm7
jmp    1377 <rq_pricing_partial_double_barrier_delayed_start+0x217>
movapd %xmm0,%xmm5
movsd  0x70(%rsp),%xmm3
movsd  0x68(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  0x50(%rsp),%xmm8
movapd 0xa0(%rsp),%xmm6
movsd  0x18(%rsp),%xmm7
movsd  0x40(%rsp),%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
divsd  %xmm4,%xmm0
movsd  %xmm0,0x40(%rsp)
addsd  %xmm6,%xmm3
addsd  %xmm7,%xmm3
divsd  %xmm4,%xmm3
movsd  %xmm3,0x58(%rsp)
addsd  %xmm6,%xmm5
addsd  %xmm7,%xmm5
divsd  %xmm4,%xmm5
movsd  %xmm5,0x38(%rsp)
addsd  %xmm6,%xmm2
addsd  %xmm7,%xmm2
divsd  %xmm4,%xmm2
movsd  %xmm2,0x20(%rsp)
movapd 0x80(%rsp),%xmm2
addsd  %xmm2,%xmm2
divsd  (%rsp),%xmm2
addsd  0xc4f(%rip),%xmm2
movapd %xmm2,0x80(%rsp)
movsd  0x28(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm8,%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  %xmm4,0x30(%rsp)
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,(%rsp)
movsd  0x58(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x18(%rsp),%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movaps 0x80(%rsp),%xmm1
call   1070 <pow@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x38(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x50(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x18(%rsp),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
mulsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x40(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x58(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x40(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x28(%rsp),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movapd 0x80(%rsp),%xmm1
addsd  0xb3c(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1070 <pow@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x38(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x28(%rsp),%xmm1
addsd  (%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movapd 0xaba(%rip),%xmm0
xorpd  0xb0(%rsp),%xmm0
movsd  0xf0(%rsp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0x8(%rsp),%xmm0
test   %r14w,%r14w
jne    15c3 <rq_pricing_partial_double_barrier_delayed_start+0x463>
movswl %r15w,%edi
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
movapd 0xb0(%rsp),%xmm2
movsd  0x98(%rsp),%xmm3
movsd  0x78(%rsp),%xmm4
movsd  0x60(%rsp),%xmm5
movsd  0xf0(%rsp),%xmm6
call   1050 <rq_pricing_blackscholes@plt>
subsd  (%rsp),%xmm0
add    $0xc8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @rq_pricing_partial_double_barrier_delayed_start(i16 signext %0, i16 signext %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
%13 = alloca double
%14 = alloca i16
%15 = alloca i16
%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
%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 double
%45 = alloca double
%46 = alloca double
%47 = alloca double
%48 = alloca double
%49 = alloca double
%50 = alloca double
%51 = alloca double
%52 = alloca double
store i16 %0, i16* %14
store i16 %1, i16* %15
store double %2, double* %16
store double %3, double* %17
store double %4, double* %18
store double %5, double* %19
store double %6, double* %20
store double %7, double* %21
store double %8, double* %22
store double %9, double* %23
store double %10, double* %24
store double %11, double* %25
%53 = load i16, i16* %15
%54 = sext i16 %53 to i32
%55 = icmp ne i32 %54, 0
%56 = zext i1 %55 to i64
%57 = select i1 %55, double 1.000000e+00, double -1.000000e+00
store double %57, double* %26
%58 = load double, double* %20
%59 = load double, double* %21
%60 = fsub double %58, %59
store double %60, double* %27
%61 = load double, double* %22
%62 = load double, double* %22
%63 = fmul double %61, %62
store double %63, double* %28
%64 = load double, double* %27
%65 = load double, double* %24
%66 = fmul double %64, %65
store double %66, double* %29
%67 = load double, double* %29
%68 = call double @exp(double %67)
store double %68, double* %30
%69 = load double, double* %28
%70 = fmul double 5.000000e-01, %69
%71 = load double, double* %23
%72 = fmul double %70, %71
store double %72, double* %31
%73 = load double, double* %22
%74 = load double, double* %23
%75 = call double @sqrt(double %74)
%76 = fmul double %73, %75
store double %76, double* %32
%77 = load double, double* %16
%78 = load double, double* %17
%79 = fdiv double %77, %78
%80 = call double @log(double %79)
store double %80, double* %33
%81 = load double, double* %16
%82 = load double, double* %19
%83 = fdiv double %81, %82
%84 = call double @log(double %83)
store double %84, double* %34
%85 = load double, double* %18
%86 = load double, double* %18
%87 = fmul double %85, %86
%88 = load double, double* %16
%89 = load double, double* %17
%90 = fmul double %88, %89
%91 = fdiv double %87, %90
%92 = call double @log(double %91)
store double %92, double* %35
%93 = load double, double* %18
%94 = load double, double* %18
%95 = fmul double %93, %94
%96 = load double, double* %16
%97 = load double, double* %19
%98 = fmul double %96, %97
%99 = fdiv double %95, %98
%100 = call double @log(double %99)
store double %100, double* %36
%101 = load double, double* %16
%102 = load double, double* %18
%103 = fdiv double %101, %102
%104 = call double @log(double %103)
store double %104, double* %37
%105 = load double, double* %18
%106 = load double, double* %18
%107 = fmul double %105, %106
%108 = load double, double* %16
%109 = load double, double* %18
%110 = fmul double %108, %109
%111 = fdiv double %107, %110
%112 = call double @log(double %111)
store double %112, double* %38
%113 = load i16, i16* %15
%114 = sext i16 %113 to i32
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %12
%117 = load double, double* %33
br label %120
118: ; preds = %12
%119 = load double, double* %37
br label %120
120: ; preds = %118, %116
%121 = phi double [ %117, %116 ], [ %119, %118 ]
store double %121, double* %39
%122 = load i16, i16* %15
%123 = sext i16 %122 to i32
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %127
125: ; preds = %120
%126 = load double, double* %34
br label %129
127: ; preds = %120
%128 = load double, double* %33
br label %129
129: ; preds = %127, %125
%130 = phi double [ %126, %125 ], [ %128, %127 ]
store double %130, double* %40
%131 = load i16, i16* %15
%132 = sext i16 %131 to i32
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %129
%135 = load double, double* %35
br label %138
136: ; preds = %129
%137 = load double, double* %38
br label %138
138: ; preds = %136, %134
%139 = phi double [ %135, %134 ], [ %137, %136 ]
store double %139, double* %41
%140 = load i16, i16* %15
%141 = sext i16 %140 to i32
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %145
143: ; preds = %138
%144 = load double, double* %36
br label %147
145: ; preds = %138
%146 = load double, double* %35
br label %147
147: ; preds = %145, %143
%148 = phi double [ %144, %143 ], [ %146, %145 ]
store double %148, double* %42
%149 = load double, double* %39
%150 = load double, double* %29
%151 = fadd double %149, %150
%152 = load double, double* %31
%153 = fadd double %151, %152
%154 = load double, double* %32
%155 = fdiv double %153, %154
store double %155, double* %43
%156 = load double, double* %40
%157 = load double, double* %29
%158 = fadd double %156, %157
%159 = load double, double* %31
%160 = fadd double %158, %159
%161 = load double, double* %32
%162 = fdiv double %160, %161
store double %162, double* %44
%163 = load double, double* %41
%164 = load double, double* %29
%165 = fadd double %163, %164
%166 = load double, double* %31
%167 = fadd double %165, %166
%168 = load double, double* %32
%169 = fdiv double %167, %168
store double %169, double* %45
%170 = load double, double* %42
%171 = load double, double* %29
%172 = fadd double %170, %171
%173 = load double, double* %31
%174 = fadd double %172, %173
%175 = load double, double* %32
%176 = fdiv double %174, %175
store double %176, double* %46
%177 = load double, double* %27
%178 = fmul double 2.000000e+00, %177
%179 = load double, double* %28
%180 = fdiv double %178, %179
%181 = fadd double %180, 1.000000e+00
store double %181, double* %47
%182 = load double, double* %26
%183 = load double, double* %16
%184 = fmul double %182, %183
%185 = load double, double* %30
%186 = fmul double %184, %185
%187 = load double, double* %43
%188 = call double @rq_pricing_cumul_norm_dist(double %187)
%189 = load double, double* %44
%190 = call double @rq_pricing_cumul_norm_dist(double %189)
%191 = fsub double %188, %190
%192 = fmul double %186, %191
store double %192, double* %48
%193 = load double, double* %26
%194 = load double, double* %16
%195 = fmul double %193, %194
%196 = load double, double* %30
%197 = fmul double %195, %196
%198 = load double, double* %18
%199 = load double, double* %16
%200 = fdiv double %198, %199
%201 = load double, double* %47
%202 = call double @pow(double %200, double %201)
%203 = fmul double %197, %202
%204 = load double, double* %45
%205 = call double @rq_pricing_cumul_norm_dist(double %204)
%206 = load double, double* %46
%207 = call double @rq_pricing_cumul_norm_dist(double %206)
%208 = fsub double %205, %207
%209 = fmul double %203, %208
store double %209, double* %49
%210 = load double, double* %26
%211 = load double, double* %17
%212 = fmul double %210, %211
%213 = load double, double* %43
%214 = load double, double* %32
%215 = fsub double %213, %214
%216 = call double @rq_pricing_cumul_norm_dist(double %215)
%217 = load double, double* %44
%218 = load double, double* %32
%219 = fsub double %217, %218
%220 = call double @rq_pricing_cumul_norm_dist(double %219)
%221 = fsub double %216, %220
%222 = fmul double %212, %221
store double %222, double* %50
%223 = load double, double* %26
%224 = load double, double* %17
%225 = fmul double %223, %224
%226 = load double, double* %18
%227 = load double, double* %16
%228 = fdiv double %226, %227
%229 = load double, double* %47
%230 = fsub double %229, 2.000000e+00
%231 = call double @pow(double %228, double %230)
%232 = fmul double %225, %231
%233 = load double, double* %45
%234 = load double, double* %32
%235 = fsub double %233, %234
%236 = call double @rq_pricing_cumul_norm_dist(double %235)
%237 = load double, double* %46
%238 = load double, double* %32
%239 = fsub double %237, %238
%240 = call double @rq_pricing_cumul_norm_dist(double %239)
%241 = fsub double %236, %240
%242 = fmul double %232, %241
store double %242, double* %51
%243 = load double, double* %20
%244 = fneg double %243
%245 = load double, double* %24
%246 = fmul double %244, %245
%247 = call double @exp(double %246)
%248 = load double, double* %48
%249 = load double, double* %49
%250 = fsub double %248, %249
%251 = load double, double* %50
%252 = fsub double %250, %251
%253 = load double, double* %51
%254 = fadd double %252, %253
%255 = fmul double %247, %254
store double %255, double* %52
%256 = load i16, i16* %14
%257 = icmp ne i16 %256, 0
br i1 %257, label %258, label %260
258: ; preds = %147
%259 = load double, double* %52
store double %259, double* %13
br label %272
260: ; preds = %147
%261 = load i16, i16* %15
%262 = load double, double* %16
%263 = load double, double* %17
%264 = load double, double* %20
%265 = load double, double* %21
%266 = load double, double* %22
%267 = load double, double* %23
%268 = load double, double* %24
%269 = call double @rq_pricing_blackscholes(i16 signext %261, double %262, double %263, double %264, double %265, double %266, double %267, double %268)
%270 = load double, double* %52
%271 = fsub double %269, %270
store double %271, double* %13
br label %272
272: ; preds = %260, %258
%273 = load double, double* %13
ret double %273
}

LLVM IR (-O2):
define double @rq_pricing_partial_double_barrier_delayed_start(i16 signext %0, i16 signext %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
%13 = icmp eq i16 %1, 0
%14 = select i1 %13, double -1.000000e+00, double 1.000000e+00
%15 = fsub double %6, %7
%16 = fmul double %8, %8
%17 = fmul double %15, %10
%18 = tail call double @exp(double %17)
%19 = fmul double %16, 5.000000e-01
%20 = fmul double %19, %9
%21 = tail call double @sqrt(double %9)
%22 = fmul double %21, %8
%23 = fdiv double %2, %3
%24 = tail call double @log(double %23)
%25 = fdiv double %2, %5
%26 = tail call double @log(double %25)
%27 = fmul double %4, %4
%28 = fmul double %2, %3
%29 = fdiv double %27, %28
%30 = tail call double @log(double %29)
%31 = fmul double %2, %5
%32 = fdiv double %27, %31
%33 = tail call double @log(double %32)
%34 = fdiv double %2, %4
%35 = tail call double @log(double %34)
%36 = fmul double %2, %4
%37 = fdiv double %27, %36
%38 = tail call double @log(double %37)
%39 = select i1 %13, double %35, double %24
%40 = select i1 %13, double %24, double %26
%41 = select i1 %13, double %38, double %30
%42 = select i1 %13, double %30, double %33
%43 = fadd double %17, %39
%44 = fadd double %20, %43
%45 = fdiv double %44, %22
%46 = fadd double %17, %40
%47 = fadd double %20, %46
%48 = fdiv double %47, %22
%49 = fadd double %17, %41
%50 = fadd double %20, %49
%51 = fdiv double %50, %22
%52 = fadd double %17, %42
%53 = fadd double %20, %52
%54 = fdiv double %53, %22
%55 = fmul double %15, 2.000000e+00
%56 = fdiv double %55, %16
%57 = fadd double %56, 1.000000e+00
%58 = fmul double %14, %2
%59 = fmul double %58, %18
%60 = tail call double @rq_pricing_cumul_norm_dist(double %45)
%61 = tail call double @rq_pricing_cumul_norm_dist(double %48)
%62 = fsub double %60, %61
%63 = fmul double %59, %62
%64 = fdiv double %4, %2
%65 = tail call double @pow(double %64, double %57)
%66 = fmul double %59, %65
%67 = tail call double @rq_pricing_cumul_norm_dist(double %51)
%68 = tail call double @rq_pricing_cumul_norm_dist(double %54)
%69 = fsub double %67, %68
%70 = fmul double %66, %69
%71 = fmul double %14, %3
%72 = fsub double %45, %22
%73 = tail call double @rq_pricing_cumul_norm_dist(double %72)
%74 = fsub double %48, %22
%75 = tail call double @rq_pricing_cumul_norm_dist(double %74)
%76 = fsub double %73, %75
%77 = fmul double %71, %76
%78 = fadd double %57, -2.000000e+00
%79 = tail call double @pow(double %64, double %78)
%80 = fmul double %71, %79
%81 = fsub double %51, %22
%82 = tail call double @rq_pricing_cumul_norm_dist(double %81)
%83 = fsub double %54, %22
%84 = tail call double @rq_pricing_cumul_norm_dist(double %83)
%85 = fsub double %82, %84
%86 = fmul double %80, %85
%87 = fneg double %6
%88 = fmul double %87, %10
%89 = tail call double @exp(double %88)
%90 = fsub double %63, %70
%91 = fsub double %90, %77
%92 = fadd double %91, %86
%93 = fmul double %89, %92
%94 = icmp eq i16 %0, 0
br i1 %94, label %95, label %98
95: ; preds = %12
%96 = tail call double @rq_pricing_blackscholes(i16 signext %1, double %2, double %3, double %6, double %7, double %8, double %9, double %10)
%97 = fsub double %96, %93
br label %98
98: ; preds = %12, %95
%99 = phi double [ %97, %95 ], [ %93, %12 ]
ret double %99
}