double SpreadApproximation(int fCall, double f1, double f2, double X, double T,
                           double r, double v1, double v2, double Rho) {
  double f2X, v, F;
  assert(((X) == (X)) && (X) >= 0.000001 && (X) <= 1000000000000.0);
  assert(((T) == (T)) && (T) >= (1.0 / (253.0 * 24.0)) && (T) <= (20.0));
  assert(((r) == (r)) && (r) >= 0.0 && (r) <= 1000.0);
  assert(((v1) == (v1)) && (v1) >= 0.0000001 && v1 <= 100.99999);
  assert(((v2) == (v2)) && (v2) >= 0.0000001 && v2 <= 100.99999);
  f2X = f2 + X;
  v = sqrt(((v1) * (v1)) + ((v2 * f2 / f2X) * (v2 * f2 / f2X)) -
           2.0 * Rho * v1 * v2 * f2 / f2X);
  F = f1 / f2X;
  return gbs(fCall, F, 1.0, T, r, 0.0, v) * f2X;
}


x86 assembly (clang, -O0):
<SpreadApproximation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
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)
movsd  %xmm7,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x20(%rbp),%xmm0
mov    %al,-0x61(%rbp)
jne    11ad <SpreadApproximation+0x7d>
jp     11ad <SpreadApproximation+0x7d>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe73(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x61(%rbp)
jb     11ad <SpreadApproximation+0x7d>
movsd  0xe66(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x28(%rbp),%xmm0
mov    %al,-0x62(%rbp)
jne    1206 <SpreadApproximation+0xd6>
jp     1206 <SpreadApproximation+0xd6>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe2a(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x62(%rbp)
jb     1206 <SpreadApproximation+0xd6>
movsd  0xe1d(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %al
mov    %al,-0x62(%rbp)
mov    -0x62(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0x63(%rbp)
jne    125a <SpreadApproximation+0x12a>
jp     125a <SpreadApproximation+0x12a>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x63(%rbp)
jb     125a <SpreadApproximation+0x12a>
movsd  0xdd1(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
setae  %al
mov    %al,-0x63(%rbp)
mov    -0x63(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x38(%rbp),%xmm0
mov    %al,-0x64(%rbp)
jne    12b3 <SpreadApproximation+0x183>
jp     12b3 <SpreadApproximation+0x183>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd95(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x64(%rbp)
jb     12b3 <SpreadApproximation+0x183>
movsd  0xd88(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
setae  %al
mov    %al,-0x64(%rbp)
mov    -0x64(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x40(%rbp),%xmm0
mov    %al,-0x65(%rbp)
jne    130c <SpreadApproximation+0x1dc>
jp     130c <SpreadApproximation+0x1dc>
movsd  -0x40(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd3c(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x65(%rbp)
jb     130c <SpreadApproximation+0x1dc>
movsd  0xd2f(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
setae  %al
mov    %al,-0x65(%rbp)
mov    -0x65(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
mulsd  -0x18(%rbp),%xmm3
divsd  -0x50(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xcda(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
subsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x60(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm5
movsd  0xc7d(%rip),%xmm1
xorps  %xmm4,%xmm4
mov    $0x6,%al
call   1050 <gbs@plt>
cvtsi2sd %eax,%xmm0
mulsd  -0x50(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SpreadApproximation>:
push   %rbx
sub    $0x40,%rsp
movsd  %xmm2,(%rsp)
ucomisd %xmm2,%xmm2
setnp  %al
ucomisd 0xeb7(%rip),%xmm2
setae  %cl
and    %al,%cl
movsd  0xeb1(%rip),%xmm8
ucomisd %xmm2,%xmm8
movsd  %xmm7,0x30(%rsp)
movsd  %xmm6,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movsd  %xmm4,0x20(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x38(%rsp)
mov    %edi,%ebx
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xe64(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe5f(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xorpd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movsd  0xe3b(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe1b(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe16(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x10(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xde6(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xde1(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
movsd  0x28(%rsp),%xmm2
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm1
movapd %xmm2,%xmm3
movsd  0x10(%rsp),%xmm5
mulsd  %xmm5,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm1
addsd  %xmm1,%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm1
movsd  %xmm2,(%rsp)
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xd74(%rip),%xmm0
jb     12d7 <SpreadApproximation+0x1a7>
xorps  %xmm5,%xmm5
sqrtsd %xmm0,%xmm5
jmp    12e0 <SpreadApproximation+0x1b0>
call   1040 <sqrt@plt>
movapd %xmm0,%xmm5
movsd  0x38(%rsp),%xmm0
divsd  (%rsp),%xmm0
movsd  0xd45(%rip),%xmm1
xorpd  %xmm4,%xmm4
mov    %ebx,%edi
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
mov    $0x6,%al
call   1050 <gbs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @SpreadApproximation(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = alloca i32
%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
%21 = alloca double
store i32 %0, i32* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double %8, double* %18
%22 = load double, double* %13
%23 = load double, double* %13
%24 = fcmp oeq double %22, %23
br i1 %24, label %25, label %31
25: ; preds = %9
%26 = load double, double* %13
%27 = fcmp oge double %26, 0x3EB0C6F7A0B5ED8D
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load double, double* %13
%30 = fcmp ole double %29, 1.000000e+12
br label %31
31: ; preds = %28, %25, %9
%32 = phi i1 [ false, %25 ], [ false, %9 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
%34 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %33)
%35 = load double, double* %14
%36 = load double, double* %14
%37 = fcmp oeq double %35, %36
br i1 %37, label %38, label %44
38: ; preds = %31
%39 = load double, double* %14
%40 = fcmp oge double %39, 0x3F2596179C29D2CE
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load double, double* %14
%43 = fcmp ole double %42, 2.000000e+01
br label %44
44: ; preds = %41, %38, %31
%45 = phi i1 [ false, %38 ], [ false, %31 ], [ %43, %41 ]
%46 = zext i1 %45 to i32
%47 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %46)
%48 = load double, double* %15
%49 = load double, double* %15
%50 = fcmp oeq double %48, %49
br i1 %50, label %51, label %57
51: ; preds = %44
%52 = load double, double* %15
%53 = fcmp oge double %52, 0.000000e+00
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = load double, double* %15
%56 = fcmp ole double %55, 1.000000e+03
br label %57
57: ; preds = %54, %51, %44
%58 = phi i1 [ false, %51 ], [ false, %44 ], [ %56, %54 ]
%59 = zext i1 %58 to i32
%60 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %59)
%61 = load double, double* %16
%62 = load double, double* %16
%63 = fcmp oeq double %61, %62
br i1 %63, label %64, label %70
64: ; preds = %57
%65 = load double, double* %16
%66 = fcmp oge double %65, 0x3E7AD7F29ABCAF48
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = load double, double* %16
%69 = fcmp ole double %68, 0x40593FFFD60E94EE
br label %70
70: ; preds = %67, %64, %57
%71 = phi i1 [ false, %64 ], [ false, %57 ], [ %69, %67 ]
%72 = zext i1 %71 to i32
%73 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %72)
%74 = load double, double* %17
%75 = load double, double* %17
%76 = fcmp oeq double %74, %75
br i1 %76, label %77, label %83
77: ; preds = %70
%78 = load double, double* %17
%79 = fcmp oge double %78, 0x3E7AD7F29ABCAF48
br i1 %79, label %80, label %83
80: ; preds = %77
%81 = load double, double* %17
%82 = fcmp ole double %81, 0x40593FFFD60E94EE
br label %83
83: ; preds = %80, %77, %70
%84 = phi i1 [ false, %77 ], [ false, %70 ], [ %82, %80 ]
%85 = zext i1 %84 to i32
%86 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %85)
%87 = load double, double* %12
%88 = load double, double* %13
%89 = fadd double %87, %88
store double %89, double* %19
%90 = load double, double* %16
%91 = load double, double* %16
%92 = load double, double* %17
%93 = load double, double* %12
%94 = fmul double %92, %93
%95 = load double, double* %19
%96 = fdiv double %94, %95
%97 = load double, double* %17
%98 = load double, double* %12
%99 = fmul double %97, %98
%100 = load double, double* %19
%101 = fdiv double %99, %100
%102 = fmul double %96, %101
%103 = call double @llvm.fmuladd.f64(double %90, double %91, double %102)
%104 = load double, double* %18
%105 = fmul double 2.000000e+00, %104
%106 = load double, double* %16
%107 = fmul double %105, %106
%108 = load double, double* %17
%109 = fmul double %107, %108
%110 = load double, double* %12
%111 = fmul double %109, %110
%112 = load double, double* %19
%113 = fdiv double %111, %112
%114 = fsub double %103, %113
%115 = call double @sqrt(double %114)
store double %115, double* %20
%116 = load double, double* %11
%117 = load double, double* %19
%118 = fdiv double %116, %117
store double %118, double* %21
%119 = load i32, i32* %10
%120 = load double, double* %21
%121 = load double, double* %14
%122 = load double, double* %15
%123 = load double, double* %20
%124 = call i32 (i32, double, double, double, double, double, double, ...) bitcast (i32 (...)* @gbs to i32 (i32, double, double, double, double, double, double, ...)*)(i32 %119, double %120, double 1.000000e+00, double %121, double %122, double 0.000000e+00, double %123)
%125 = sitofp i32 %124 to double
%126 = load double, double* %19
%127 = fmul double %125, %126
ret double %127
}

LLVM IR (-O2):
define double @SpreadApproximation(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = fcmp ord double %3, 0.000000e+00
%11 = fcmp oge double %3, 0x3EB0C6F7A0B5ED8D
%12 = and i1 %10, %11
%13 = fcmp ole double %3, 1.000000e+12
%14 = and i1 %13, %12
%15 = zext i1 %14 to i32
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %15)
%17 = fcmp ord double %4, 0.000000e+00
%18 = fcmp oge double %4, 0x3F2596179C29D2CE
%19 = and i1 %17, %18
%20 = fcmp ole double %4, 2.000000e+01
%21 = and i1 %20, %19
%22 = zext i1 %21 to i32
%23 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %22)
%24 = fcmp oge double %5, 0.000000e+00
%25 = fcmp ole double %5, 1.000000e+03
%26 = and i1 %24, %25
%27 = zext i1 %26 to i32
%28 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %27)
%29 = fcmp ord double %6, 0.000000e+00
%30 = fcmp oge double %6, 0x3E7AD7F29ABCAF48
%31 = and i1 %29, %30
%32 = fcmp ole double %6, 0x40593FFFD60E94EE
%33 = and i1 %32, %31
%34 = zext i1 %33 to i32
%35 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %34)
%36 = fcmp ord double %7, 0.000000e+00
%37 = fcmp oge double %7, 0x3E7AD7F29ABCAF48
%38 = and i1 %36, %37
%39 = fcmp ole double %7, 0x40593FFFD60E94EE
%40 = and i1 %39, %38
%41 = zext i1 %40 to i32
%42 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %41)
%43 = fadd double %2, %3
%44 = fmul double %2, %7
%45 = fdiv double %44, %43
%46 = fmul double %45, %45
%47 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %46)
%48 = fmul double %8, 2.000000e+00
%49 = fmul double %48, %6
%50 = fmul double %49, %7
%51 = fmul double %50, %2
%52 = fdiv double %51, %43
%53 = fsub double %47, %52
%54 = tail call double @sqrt(double %53)
%55 = fdiv double %1, %43
%56 = tail call i32 (i32, double, double, double, double, double, double, ...) bitcast (i32 (...)* @gbs to i32 (i32, double, double, double, double, double, double, ...)*)(i32 %0, double %55, double 1.000000e+00, double %4, double %5, double 0.000000e+00, double %54)
%57 = sitofp i32 %56 to double
%58 = fmul double %43, %57
ret double %58
}