extern double gbs_put(double S, double X, double T, double r, double b,
                      double v) {
  double vst, d1;
  assert(((S) == (S)) && (S) >= 0.000001 && (S) <= 1000000000000.0);
  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(((b) == (b)) && (b) >= -1000.0 && (b) <= 1000.0);
  assert(((v) == (v)) && (v) >= 0.0000001 && v <= 100.99999);
  vst = v * sqrt(T);
  d1 = (log(S / X) + (b + ((v) * (v)) / 2) * T) / vst;
  return X * exp(-r * T) * cnd(-(d1 - vst)) - S * exp((b - r) * T) * cnd(-d1);
}


x86 assembly (clang, -O0):
<gbs_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x41(%rbp)
jne    11c3 <gbs_put+0x73>
jp     11c3 <gbs_put+0x73>
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe5d(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x41(%rbp)
jb     11c3 <gbs_put+0x73>
movsd  0xe50(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x42(%rbp)
jne    121c <gbs_put+0xcc>
jp     121c <gbs_put+0xcc>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe04(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x42(%rbp)
jb     121c <gbs_put+0xcc>
movsd  0xdf7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x42(%rbp)
mov    -0x42(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0x43(%rbp)
jne    1275 <gbs_put+0x125>
jp     1275 <gbs_put+0x125>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdbb(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x43(%rbp)
jb     1275 <gbs_put+0x125>
movsd  0xdae(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0x43(%rbp)
mov    -0x43(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x20(%rbp),%xmm0
mov    %al,-0x44(%rbp)
jne    12c9 <gbs_put+0x179>
jp     12c9 <gbs_put+0x179>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x44(%rbp)
jb     12c9 <gbs_put+0x179>
movsd  0xd62(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0x44(%rbp)
mov    -0x44(%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,-0x45(%rbp)
jne    1322 <gbs_put+0x1d2>
jp     1322 <gbs_put+0x1d2>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd26(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x45(%rbp)
jb     1322 <gbs_put+0x1d2>
movsd  0xd09(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %al
mov    %al,-0x45(%rbp)
mov    -0x45(%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,-0x46(%rbp)
jne    137b <gbs_put+0x22b>
jp     137b <gbs_put+0x22b>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
movsd  0xcd5(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x46(%rbp)
jb     137b <gbs_put+0x22b>
movsd  0xcc8(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
setae  %al
mov    %al,-0x46(%rbp)
mov    -0x46(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  -0x30(%rbp),%xmm2
movsd  0xc68(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbs_put>:
sub    $0x58,%rsp
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe9d(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe98(%rip),%xmm6
movsd  %xmm0,0x38(%rsp)
ucomisd %xmm0,%xmm6
movsd  %xmm5,0x20(%rsp)
movsd  %xmm4,0x18(%rsp)
movaps %xmm3,0x40(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xe45(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe40(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xe20(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe1b(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xorpd  %xmm1,%xmm1
movapd 0x40(%rsp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
movsd  0xdf7(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x18(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xdd7(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xdc2(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x20(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xdaa(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xda5(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xd94(%rip),%xmm0
jb     12c2 <gbs_put+0x172>
movsd  0x8(%rsp),%xmm0
sqrtsd %xmm0,%xmm0
jmp    12cd <gbs_put+0x17d>
movsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x38(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1050 <log@plt>
movsd  0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm2
mulsd  0xd44(%rip),%xmm2
addsd  0x18(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
divsd  0x30(%rsp),%xmm0
movapd %xmm0,0x20(%rsp)
movapd 0x40(%rsp),%xmm0
xorpd  0xd26(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0x20(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
xorpd  0xcfd(%rip),%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
subsd  0x40(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movaps 0x20(%rsp),%xmm0
xorps  0xcba(%rip),%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x58,%rsp
ret

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

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