#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_cumul_norm_dist(double);
double sqrt(double);
double rq_pricing_double_digital_knockout(short cash, 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 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_asset_value =
      (cash ? 0.0
            : (fi * S * exp_b_t *
               (rq_pricing_cumul_norm_dist(asset_prob_d1) -
                rq_pricing_cumul_norm_dist(cash_prob_d2))));
  double expected_asset_bar_cost =
      (cash ? 0.0
            : (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 expected_cash_value =
      (cash ? (-fi * X *
               (rq_pricing_cumul_norm_dist(asset_prob_d1 - v_sqrt_t) -
                rq_pricing_cumul_norm_dist(cash_prob_d2 - v_sqrt_t)))
            : 0.0);
  double expected_cash_bar_cost =
      (cash ? (-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)))
            : 0.0);
  return exp(-r_dom * tau_d) * (expected_asset_value - expected_asset_bar_cost -
                                expected_cash_value + expected_cash_bar_cost);
}


x86 assembly (clang, -O0):
<rq_pricing_double_digital_knockout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    %si,%ax
mov    %di,%cx
movsd  0x10(%rbp),%xmm8
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)
movswl -0x4(%rbp),%eax
movsd  0xe65(%rip),%xmm0
movsd  0xe65(%rip),%xmm1
movsd  %xmm1,-0x128(%rbp)
ff
cmp    $0x0,%eax
movsd  %xmm0,-0x120(%rbp)
ff
jne    11d4 <rq_pricing_double_digital_knockout+0x84>
movsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  0x10(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xddb(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1335 <rq_pricing_double_digital_knockout+0x1e5>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
jmp    1345 <rq_pricing_double_digital_knockout+0x1f5>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1377 <rq_pricing_double_digital_knockout+0x227>
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
jmp    1387 <rq_pricing_double_digital_knockout+0x237>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     13b9 <rq_pricing_double_digital_knockout+0x269>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
jmp    13c9 <rq_pricing_double_digital_knockout+0x279>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
je     13fb <rq_pricing_double_digital_knockout+0x2ab>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
jmp    140b <rq_pricing_double_digital_knockout+0x2bb>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x150(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0x68(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  0xb79(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  0xb57(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     14da <rq_pricing_double_digital_knockout+0x38a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
jmp    1536 <rq_pricing_double_digital_knockout+0x3e6>
movsd  -0x50(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x168(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x160(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x158(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1563 <rq_pricing_double_digital_knockout+0x413>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
jmp    15ed <rq_pricing_double_digital_knockout+0x49d>
movsd  -0x50(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  -0xf8(%rbp),%xmm1
ff
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x188(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x180(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x178(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x170(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1687 <rq_pricing_double_digital_knockout+0x537>
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x1a0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x198(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
jmp    1697 <rq_pricing_double_digital_knockout+0x547>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
jmp    1697 <rq_pricing_double_digital_knockout+0x547>
movsd  -0x190(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     176b <rq_pricing_double_digital_knockout+0x61b>
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  -0xf8(%rbp),%xmm1
ff
movsd  0x921(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x1c0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b0(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x1b8(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x1b8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x1b0(%rbp),%xmm0
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
jmp    177b <rq_pricing_double_digital_knockout+0x62b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
jmp    177b <rq_pricing_double_digital_knockout+0x62b>
movsd  -0x1a8(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  0x10(%rbp),%xmm0
call   1040 <exp@plt>
movsd  -0x100(%rbp),%xmm1
ff
subsd  -0x108(%rbp),%xmm1
ff
subsd  -0x110(%rbp),%xmm1
ff
addsd  -0x118(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_double_digital_knockout>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xc8,%rsp
movsd  %xmm7,0x20(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x40(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebp
mov    %edi,%r14d
xor    %ebx,%ebx
test   %bp,%bp
sete   %bl
movapd %xmm4,0xb0(%rsp)
subsd  %xmm5,%xmm4
movsd  %xmm6,0x98(%rsp)
mulsd  %xmm6,%xmm6
movsd  %xmm6,0x30(%rsp)
movapd %xmm4,0x60(%rsp)
movapd %xmm4,%xmm0
mulsd  0xf0(%rsp),%xmm0
movapd %xmm0,0xa0(%rsp)
call   1040 <exp@plt>
movsd  0x20(%rsp),%xmm3
movsd  0xe49(%rip),%xmm2
mulsd  0x30(%rsp),%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm3
movsd  %xmm0,0x88(%rsp)
jb     11f9 <rq_pricing_double_digital_knockout+0xa9>
xorps  %xmm0,%xmm0
sqrtsd %xmm3,%xmm0
jmp    1214 <rq_pricing_double_digital_knockout+0xc4>
movapd %xmm3,%xmm0
movsd  %xmm2,0x58(%rsp)
call   1070 <sqrt@plt>
movsd  0x20(%rsp),%xmm3
movsd  0x58(%rsp),%xmm2
movsd  %xmm0,0x10(%rsp)
lea    0xddf(%rip),%r15
mulsd  %xmm3,%xmm2
movsd  %xmm2,0x58(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0x40(%rsp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,0x80(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0x28(%rsp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x8(%rsp),%xmm1
mulsd  0x40(%rsp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <log@plt>
movsd  %xmm0,0x78(%rsp)
movsd  0x28(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0x38(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1050 <log@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0x18(%rsp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,0x90(%rsp)
movsd  0x8(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
movsd  0x38(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1050 <log@plt>
movsd  0x10(%rsp),%xmm8
mulsd  0x98(%rsp),%xmm8
test   %bp,%bp
je     1325 <rq_pricing_double_digital_knockout+0x1d5>
movsd  0x80(%rsp),%xmm1
movsd  0x78(%rsp),%xmm0
movapd 0x60(%rsp),%xmm4
movsd  0x28(%rsp),%xmm2
movapd 0xa0(%rsp),%xmm3
movsd  0x58(%rsp),%xmm5
movsd  0x20(%rsp),%xmm6
jmp    1352 <rq_pricing_double_digital_knockout+0x202>
movsd  0x80(%rsp),%xmm6
movsd  0x78(%rsp),%xmm2
movapd 0x60(%rsp),%xmm4
movapd 0xa0(%rsp),%xmm3
movsd  0x58(%rsp),%xmm5
movsd  0x90(%rsp),%xmm1
movsd  (%r15,%rbx,8),%xmm7
addsd  %xmm3,%xmm1
addsd  %xmm5,%xmm1
divsd  %xmm8,%xmm1
addsd  %xmm3,%xmm6
addsd  %xmm5,%xmm6
divsd  %xmm8,%xmm6
movsd  %xmm6,0x20(%rsp)
addsd  %xmm3,%xmm0
addsd  %xmm5,%xmm0
divsd  %xmm8,%xmm0
movsd  %xmm0,0x38(%rsp)
addsd  %xmm3,%xmm2
addsd  %xmm5,%xmm2
divsd  %xmm8,%xmm2
movsd  %xmm2,0x28(%rsp)
addsd  %xmm4,%xmm4
divsd  0x30(%rsp),%xmm4
addsd  0xc78(%rip),%xmm4
movapd %xmm4,0x60(%rsp)
test   %r14w,%r14w
je     1488 <rq_pricing_double_digital_knockout+0x338>
xorpd  0xc48(%rip),%xmm7
mulsd  0x40(%rsp),%xmm7
movapd %xmm7,0x40(%rsp)
subsd  %xmm8,%xmm1
movapd %xmm1,%xmm0
movsd  %xmm8,0x10(%rsp)
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x30(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x40(%rsp),%xmm1
movsd  %xmm1,0x30(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
movapd 0x60(%rsp),%xmm1
addsd  0xc00(%rip),%xmm1
call   1060 <pow@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x38(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x28(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x18(%rsp),%xmm2
movsd  0x30(%rsp),%xmm1
subsd  %xmm0,%xmm2
mulsd  0x8(%rsp),%xmm2
xorpd  %xmm0,%xmm0
jmp    152d <rq_pricing_double_digital_knockout+0x3dd>
mulsd  0x8(%rsp),%xmm7
mulsd  0x88(%rsp),%xmm7
movapd %xmm7,0x40(%rsp)
movapd %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x40(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
movaps 0x60(%rsp),%xmm1
call   1060 <pow@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x38(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
subsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0xb0(%rsp),%xmm0
xorpd  0xac4(%rip),%xmm0
mulsd  0xf0(%rsp),%xmm0
call   1040 <exp@plt>
mulsd  0x10(%rsp),%xmm0
add    $0xc8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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