#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, int);
double rq_pricing_cumul_norm_dist(double);
int sqrt(double);
double rq_pricing_lookback_floating_strike(short call, double S, double SMin,
                                           double SMax, double T, double r,
                                           double b, double v) {
  double a1;
  double a2;
  double m;
  double ret = 0.0;
  if (call)
    m = SMin;
  else
    m = SMax;
  a1 = (log(S / m) + (b + (v * v) / 2) * T) / (v * sqrt(T));
  a2 = a1 - v * sqrt(T);
  if (call)
    ret = S * exp((b - r) * T) * rq_pricing_cumul_norm_dist(a1) -
          m * exp(-r * T) * rq_pricing_cumul_norm_dist(a2) +
          exp(-r * T) * (v * v) / (2 * b) * S *
              (pow((S / m), (-2 * b / (v * v))) *
                   rq_pricing_cumul_norm_dist(-a1 + 2 * b / v * sqrt(T)) -
               exp(b * T) * rq_pricing_cumul_norm_dist(-a1));
  else
    ret = m * exp(-r * T) * rq_pricing_cumul_norm_dist(-a2) -
          S * exp((b - r) * T) * rq_pricing_cumul_norm_dist(-a1) +
          exp(-r * T) * (v * v) / (2 * b) * S *
              (pow(-(S / m), (-2 * b / (v * v))) *
                   rq_pricing_cumul_norm_dist(a1 - 2 * b / v * sqrt(T)) +
               exp(b * T) * rq_pricing_cumul_norm_dist(a1));
  return ret;
}


x86 assembly (clang, -O0):
<rq_pricing_lookback_floating_strike>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %di,%ax
mov    %ax,-0x2(%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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     11a7 <rq_pricing_lookback_floating_strike+0x57>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    11b1 <rq_pricing_lookback_floating_strike+0x61>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
movsd  0xe26(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     14f3 <rq_pricing_lookback_floating_strike+0x3a3>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  -0xc8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movsd  -0x40(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc62(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  0xc42(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <pow@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xbea(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0xa8(%rbp),%xmm3
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm4
ff
movsd  -0x90(%rbp),%xmm1
ff
movaps %xmm0,%xmm5
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm5,%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    177a <rq_pricing_lookback_floating_strike+0x62a>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x140(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x138(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x130(%rbp),%xmm1
ff
movsd  -0x128(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movsd  -0x40(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x9bf(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0x988(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <pow@plt>
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  0x947(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  -0x118(%rbp),%xmm0
ff
movsd  -0x110(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  -0x108(%rbp),%xmm3
ff
movsd  -0x100(%rbp),%xmm2
ff
movsd  -0xf8(%rbp),%xmm4
ff
movsd  -0xf0(%rbp),%xmm1
ff
movaps %xmm0,%xmm5
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_lookback_floating_strike>:
push   %rbp
push   %rbx
sub    $0xb8,%rsp
movsd  %xmm6,0x30(%rsp)
movsd  %xmm5,0x28(%rsp)
movaps %xmm4,0x10(%rsp)
movsd  %xmm3,(%rsp)
mov    %edi,%ebx
test   %bx,%bx
je     117a <rq_pricing_lookback_floating_strike+0x2a>
movapd %xmm1,%xmm2
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,0x38(%rsp)
divsd  %xmm2,%xmm0
movapd %xmm0,0x80(%rsp)
call   1050 <log@plt>
movsd  %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm0
call   1070 <sqrt@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
call   1070 <sqrt@plt>
movsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe36(%rip),%xmm3
movsd  %xmm0,0x78(%rsp)
mulsd  %xmm0,%xmm3
movsd  0x28(%rsp),%xmm4
addsd  %xmm4,%xmm3
movsd  (%rsp),%xmm5
mulsd  %xmm5,%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  0x40(%rsp),%xmm3
mulsd  %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
movapd %xmm3,0x40(%rsp)
subsd  %xmm1,%xmm3
movapd %xmm3,0xa0(%rsp)
test   %bx,%bx
movapd %xmm5,%xmm1
je     13bd <rq_pricing_lookback_floating_strike+0x26d>
movapd %xmm4,%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x98(%rsp)
movaps 0x40(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x50(%rsp)
movapd 0xdaf(%rip),%xmm1
movapd %xmm1,0x60(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
call   1040 <exp@plt>
movsd  %xmm0,0x90(%rsp)
movapd 0xa0(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x90(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x50(%rsp),%xmm0
mulsd  0x98(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rsp)
movapd 0x10(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0x78(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x28(%rsp),%xmm2
movapd %xmm2,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x10(%rsp)
divsd  %xmm3,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xd03(%rip),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movaps 0x80(%rsp),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,0x80(%rsp)
movaps 0x60(%rsp),%xmm0
xorps  0x40(%rsp),%xmm0
movaps %xmm0,0x60(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1070 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
subsd  0x40(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,(%rsp)
movapd 0x60(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
mulsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x80(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  0x50(%rsp),%xmm1
movapd %xmm1,%xmm0
jmp    1533 <rq_pricing_lookback_floating_strike+0x3e3>
movapd 0x10(%rsp),%xmm0
xorpd  0xc45(%rip),%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x50(%rsp)
call   1040 <exp@plt>
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movaps 0xa0(%rsp),%xmm0
xorps  0xc1b(%rip),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x60(%rsp)
movsd  0x28(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x10(%rsp)
movapd 0x40(%rsp),%xmm0
xorpd  0xbe6(%rip),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x60(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x60(%rsp)
movapd 0x50(%rsp),%xmm0
call   1040 <exp@plt>
movsd  0x78(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x28(%rsp),%xmm3
movapd %xmm3,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,0x50(%rsp)
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movaps 0x80(%rsp),%xmm0
xorps  0xb73(%rip),%xmm0
movsd  0xb63(%rip),%xmm1
mulsd  %xmm3,%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1070 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x50(%rsp),%xmm1
divsd  0x30(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd 0x40(%rsp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x30(%rsp)
movsd  (%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,(%rsp)
movapd 0x40(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
mulsd  (%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
add    $0xb8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @rq_pricing_lookback_floating_strike(i16 signext %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca i16
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store i16 %0, i16* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
store double 0.000000e+00, double* %20
%21 = load i16, i16* %9
%22 = icmp ne i16 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %8
%24 = load double, double* %11
store double %24, double* %19
br label %27
25: ; preds = %8
%26 = load double, double* %12
store double %26, double* %19
br label %27
27: ; preds = %25, %23
%28 = load double, double* %10
%29 = load double, double* %19
%30 = fdiv double %28, %29
%31 = call double @log(double %30)
%32 = load double, double* %15
%33 = load double, double* %16
%34 = load double, double* %16
%35 = fmul double %33, %34
%36 = fdiv double %35, 2.000000e+00
%37 = fadd double %32, %36
%38 = load double, double* %13
%39 = call double @llvm.fmuladd.f64(double %37, double %38, double %31)
%40 = load double, double* %16
%41 = load double, double* %13
%42 = call i32 @sqrt(double %41)
%43 = sitofp i32 %42 to double
%44 = fmul double %40, %43
%45 = fdiv double %39, %44
store double %45, double* %17
%46 = load double, double* %17
%47 = load double, double* %16
%48 = load double, double* %13
%49 = call i32 @sqrt(double %48)
%50 = sitofp i32 %49 to double
%51 = fneg double %47
%52 = call double @llvm.fmuladd.f64(double %51, double %50, double %46)
store double %52, double* %18
%53 = load i16, i16* %9
%54 = icmp ne i16 %53, 0
br i1 %54, label %55, label %125
55: ; preds = %27
%56 = load double, double* %10
%57 = load double, double* %15
%58 = load double, double* %14
%59 = fsub double %57, %58
%60 = load double, double* %13
%61 = fmul double %59, %60
%62 = call double @exp(double %61)
%63 = fmul double %56, %62
%64 = load double, double* %17
%65 = call double @rq_pricing_cumul_norm_dist(double %64)
%66 = load double, double* %19
%67 = load double, double* %14
%68 = fneg double %67
%69 = load double, double* %13
%70 = fmul double %68, %69
%71 = call double @exp(double %70)
%72 = fmul double %66, %71
%73 = load double, double* %18
%74 = call double @rq_pricing_cumul_norm_dist(double %73)
%75 = fmul double %72, %74
%76 = fneg double %75
%77 = call double @llvm.fmuladd.f64(double %63, double %65, double %76)
%78 = load double, double* %14
%79 = fneg double %78
%80 = load double, double* %13
%81 = fmul double %79, %80
%82 = call double @exp(double %81)
%83 = load double, double* %16
%84 = load double, double* %16
%85 = fmul double %83, %84
%86 = fmul double %82, %85
%87 = load double, double* %15
%88 = fmul double 2.000000e+00, %87
%89 = fdiv double %86, %88
%90 = load double, double* %10
%91 = fmul double %89, %90
%92 = load double, double* %10
%93 = load double, double* %19
%94 = fdiv double %92, %93
%95 = load double, double* %15
%96 = fmul double -2.000000e+00, %95
%97 = load double, double* %16
%98 = load double, double* %16
%99 = fmul double %97, %98
%100 = fdiv double %96, %99
%101 = fptosi double %100 to i32
%102 = call double @pow(double %94, i32 %101)
%103 = load double, double* %17
%104 = fneg double %103
%105 = load double, double* %15
%106 = fmul double 2.000000e+00, %105
%107 = load double, double* %16
%108 = fdiv double %106, %107
%109 = load double, double* %13
%110 = call i32 @sqrt(double %109)
%111 = sitofp i32 %110 to double
%112 = call double @llvm.fmuladd.f64(double %108, double %111, double %104)
%113 = call double @rq_pricing_cumul_norm_dist(double %112)
%114 = load double, double* %15
%115 = load double, double* %13
%116 = fmul double %114, %115
%117 = call double @exp(double %116)
%118 = load double, double* %17
%119 = fneg double %118
%120 = call double @rq_pricing_cumul_norm_dist(double %119)
%121 = fmul double %117, %120
%122 = fneg double %121
%123 = call double @llvm.fmuladd.f64(double %102, double %113, double %122)
%124 = call double @llvm.fmuladd.f64(double %91, double %123, double %77)
store double %124, double* %20
br label %196
125: ; preds = %27
%126 = load double, double* %19
%127 = load double, double* %14
%128 = fneg double %127
%129 = load double, double* %13
%130 = fmul double %128, %129
%131 = call double @exp(double %130)
%132 = fmul double %126, %131
%133 = load double, double* %18
%134 = fneg double %133
%135 = call double @rq_pricing_cumul_norm_dist(double %134)
%136 = load double, double* %10
%137 = load double, double* %15
%138 = load double, double* %14
%139 = fsub double %137, %138
%140 = load double, double* %13
%141 = fmul double %139, %140
%142 = call double @exp(double %141)
%143 = fmul double %136, %142
%144 = load double, double* %17
%145 = fneg double %144
%146 = call double @rq_pricing_cumul_norm_dist(double %145)
%147 = fmul double %143, %146
%148 = fneg double %147
%149 = call double @llvm.fmuladd.f64(double %132, double %135, double %148)
%150 = load double, double* %14
%151 = fneg double %150
%152 = load double, double* %13
%153 = fmul double %151, %152
%154 = call double @exp(double %153)
%155 = load double, double* %16
%156 = load double, double* %16
%157 = fmul double %155, %156
%158 = fmul double %154, %157
%159 = load double, double* %15
%160 = fmul double 2.000000e+00, %159
%161 = fdiv double %158, %160
%162 = load double, double* %10
%163 = fmul double %161, %162
%164 = load double, double* %10
%165 = load double, double* %19
%166 = fdiv double %164, %165
%167 = fneg double %166
%168 = load double, double* %15
%169 = fmul double -2.000000e+00, %168
%170 = load double, double* %16
%171 = load double, double* %16
%172 = fmul double %170, %171
%173 = fdiv double %169, %172
%174 = fptosi double %173 to i32
%175 = call double @pow(double %167, i32 %174)
%176 = load double, double* %17
%177 = load double, double* %15
%178 = fmul double 2.000000e+00, %177
%179 = load double, double* %16
%180 = fdiv double %178, %179
%181 = load double, double* %13
%182 = call i32 @sqrt(double %181)
%183 = sitofp i32 %182 to double
%184 = fneg double %180
%185 = call double @llvm.fmuladd.f64(double %184, double %183, double %176)
%186 = call double @rq_pricing_cumul_norm_dist(double %185)
%187 = load double, double* %15
%188 = load double, double* %13
%189 = fmul double %187, %188
%190 = call double @exp(double %189)
%191 = load double, double* %17
%192 = call double @rq_pricing_cumul_norm_dist(double %191)
%193 = fmul double %190, %192
%194 = call double @llvm.fmuladd.f64(double %175, double %186, double %193)
%195 = call double @llvm.fmuladd.f64(double %163, double %194, double %149)
store double %195, double* %20
br label %196
196: ; preds = %125, %55
%197 = load double, double* %20
ret double %197
}

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