#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 log(double);
double rq_pricing_cumul_norm_dist(double);
double rq_pricing_norm_density(double);
double sqrt(double);
double rq_greeks_garmankhol(int call, double S, double X, double df_dom,
                            double df_for, double sigma, double tau_e,
                            double tau_d, double *delta, double *gamma,
                            double *vega, double *rho_dom, double *rho_for,
                            double *theta) {
  double m = (call ? 1.0 : -1.0);
  double f = S * df_for / df_dom;
  double tau_sqrt = sqrt(tau_e);
  double sigma_tau_sqrt = sigma * tau_sqrt;
  double d1tmp = (log(f / X) + (0.5 * sigma * sigma * tau_e)) / sigma_tau_sqrt;
  double d2 = (d1tmp - sigma_tau_sqrt) * m;
  double d1 = d1tmp * m;
  double cnd1 = rq_pricing_cumul_norm_dist(d1);
  double cnd2 = rq_pricing_cumul_norm_dist(d2);
  double nd1 = rq_pricing_norm_density(d1);
  double nd1Neg = rq_pricing_norm_density(-d1);
  if (delta)
    (*delta) = df_for * cnd1 * m;
  if (gamma)
    (*gamma) = df_for * nd1 / (S * sigma_tau_sqrt);
  if (vega)
    (*vega) = S * tau_sqrt * df_for * nd1;
  if (rho_dom)
    (*rho_dom) = (call ? 1.0 : -1.0) * tau_e * X * df_dom * cnd2;
  if (rho_for)
    (*rho_for) = (call ? -1.0 : 1.0) * tau_e * S * df_for * cnd1;
  if (theta) {
    double rf_for = -log(df_for) / tau_e;
    double rf_dom = -log(df_dom) / tau_e;
    (*theta) = -sigma * S * df_for * nd1 / (2 * tau_sqrt) -
               (-m) * rf_for * S * cnd1 * df_for -
               m * rf_dom * X * df_dom * cnd2;
  }
  return (df_dom * ((f * cnd1 * m) + (X * cnd2 * -m)));
}


x86 assembly (clang, -O0):
<rq_greeks_garmankhol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-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)
mov    %rsi,-0x48(%rbp)
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x58(%rbp)
mov    %r8,-0x60(%rbp)
mov    %r9,-0x68(%rbp)
mov    -0x4(%rbp),%eax
movsd  0xe74(%rip),%xmm0
movsd  0xe74(%rip),%xmm1
movsd  %xmm1,-0xe0(%rbp)
ff
cmp    $0x0,%eax
movsd  %xmm0,-0xd8(%rbp)
ff
jne    11c5 <rq_greeks_garmankhol+0x85>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xddf(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
call   1060 <rq_pricing_norm_density@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <rq_pricing_norm_density@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
cmpq   $0x0,-0x48(%rbp)
je     130a <rq_greeks_garmankhol+0x1ca>
movsd  -0x28(%rbp),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0x70(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x50(%rbp)
je     133b <rq_greeks_garmankhol+0x1fb>
movsd  -0x28(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  -0x10(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x58(%rbp)
je     1365 <rq_greeks_garmankhol+0x225>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x60(%rbp)
je     13d3 <rq_greeks_garmankhol+0x293>
mov    -0x4(%rbp),%eax
movsd  0xc8d(%rip),%xmm0
movsd  0xc8d(%rip),%xmm1
movsd  %xmm1,-0xf0(%rbp)
ff
cmp    $0x0,%eax
movsd  %xmm0,-0xe8(%rbp)
ff
jne    13ac <rq_greeks_garmankhol+0x26c>
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x68(%rbp)
je     1441 <rq_greeks_garmankhol+0x301>
mov    -0x4(%rbp),%eax
movsd  0xc27(%rip),%xmm0
movsd  0xc17(%rip),%xmm1
movsd  %xmm1,-0x100(%rbp)
ff
cmp    $0x0,%eax
movsd  %xmm0,-0xf8(%rbp)
ff
jne    141a <rq_greeks_garmankhol+0x2da>
movsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,0x10(%rbp)
je     1582 <rq_greeks_garmankhol+0x442>
movsd  -0x28(%rbp),%xmm0
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  0xb3a(%rip),%xmm1
mulsd  -0x80(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  -0xc8(%rbp),%xmm1
ff
mulsd  -0x10(%rbp),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
movsd  -0x28(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  -0xd0(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x70(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_greeks_garmankhol>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r13
mov    %rdx,%rbp
mov    %rsi,%rbx
movsd  %xmm4,0x28(%rsp)
mov    %edi,%r12d
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0xe89(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm4
movapd %xmm0,%xmm6
mulsd  %xmm3,%xmm6
divsd  %xmm2,%xmm6
xorpd  %xmm7,%xmm7
ucomisd %xmm7,%xmm5
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm6,0x38(%rsp)
movaps %xmm4,0x80(%rsp)
movsd  %xmm3,0x58(%rsp)
movapd %xmm5,0x70(%rsp)
movsd  %xmm0,0x50(%rsp)
jb     11c7 <rq_greeks_garmankhol+0x87>
xorps  %xmm0,%xmm0
sqrtsd %xmm5,%xmm0
jmp    11dc <rq_greeks_garmankhol+0x9c>
movapd %xmm5,%xmm0
call   1050 <sqrt@plt>
movsd  0x38(%rsp),%xmm6
movsd  0x18(%rsp),%xmm1
movsd  %xmm0,0x30(%rsp)
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movapd %xmm6,%xmm0
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movapd %xmm0,%xmm2
movsd  0xe19(%rip),%xmm0
movsd  0x28(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x70(%rsp),%xmm0
addsd  %xmm0,%xmm2
movsd  0x40(%rsp),%xmm3
divsd  %xmm3,%xmm2
movapd 0x80(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm0,0x60(%rsp)
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <rq_pricing_cumul_norm_dist@plt>
movsd  %xmm0,0x10(%rsp)
movaps 0x60(%rsp),%xmm0
call   1060 <rq_pricing_norm_density@plt>
movsd  %xmm0,0x8(%rsp)
movaps 0x60(%rsp),%xmm0
xorps  0xd8a(%rip),%xmm0
call   1060 <rq_pricing_norm_density@plt>
movsd  0x48(%rsp),%xmm10
movapd 0x80(%rsp),%xmm4
test   %rbx,%rbx
movsd  0x58(%rsp),%xmm0
je     12b7 <rq_greeks_garmankhol+0x177>
movapd %xmm10,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm4,%xmm1
movsd  %xmm1,(%rbx)
test   %rbp,%rbp
movsd  0x20(%rsp),%xmm8
movsd  0x50(%rsp),%xmm6
je     12e6 <rq_greeks_garmankhol+0x1a6>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x40(%rsp),%xmm3
mulsd  %xmm6,%xmm3
divsd  %xmm3,%xmm1
movsd  %xmm1,0x0(%rbp)
test   %r13,%r13
movsd  0x18(%rsp),%xmm9
movapd 0x70(%rsp),%xmm5
je     1312 <rq_greeks_garmankhol+0x1d2>
movsd  0x30(%rsp),%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x0(%r13)
test   %r15,%r15
je     1334 <rq_greeks_garmankhol+0x1f4>
movapd %xmm4,%xmm1
mulsd  %xmm5,%xmm1
mulsd  %xmm9,%xmm1
mulsd  %xmm8,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,(%r15)
mov    0xd0(%rsp),%rbx
test   %r14,%r14
je     1368 <rq_greeks_garmankhol+0x228>
movapd %xmm5,%xmm1
test   %r12d,%r12d
je     1356 <rq_greeks_garmankhol+0x216>
movapd 0xcbe(%rip),%xmm1
xorpd  %xmm5,%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm10,%xmm1
movsd  %xmm1,(%r14)
test   %rbx,%rbx
je     142a <rq_greeks_garmankhol+0x2ea>
call   1040 <log@plt>
movsd  %xmm0,0x60(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <log@plt>
movsd  0x48(%rsp),%xmm10
movapd 0x80(%rsp),%xmm4
movsd  0x18(%rsp),%xmm9
movsd  0x20(%rsp),%xmm8
movapd 0x70(%rsp),%xmm7
divsd  %xmm7,%xmm0
movsd  0x28(%rsp),%xmm5
movsd  0x50(%rsp),%xmm3
mulsd  %xmm3,%xmm5
movsd  0x58(%rsp),%xmm2
mulsd  %xmm2,%xmm5
mulsd  0x8(%rsp),%xmm5
movsd  0x30(%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm5
movapd 0xc2b(%rip),%xmm1
xorpd  %xmm4,%xmm1
movsd  0x60(%rsp),%xmm6
divsd  %xmm7,%xmm6
mulsd  %xmm1,%xmm6
mulsd  %xmm3,%xmm6
mulsd  %xmm10,%xmm6
mulsd  %xmm2,%xmm6
subsd  %xmm5,%xmm6
mulsd  %xmm4,%xmm0
mulsd  %xmm9,%xmm0
mulsd  %xmm8,%xmm0
movsd  0x10(%rsp),%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm6,%xmm0
movsd  %xmm0,(%rbx)
jmp    143c <rq_greeks_garmankhol+0x2fc>
movapd 0xbde(%rip),%xmm1
xorpd  %xmm4,%xmm1
movsd  0x10(%rsp),%xmm5
movsd  0x38(%rsp),%xmm0
mulsd  %xmm10,%xmm0
mulsd  %xmm9,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
mulsd  %xmm8,%xmm0
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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