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


x86 assembly (clang, -O0):
<blackscholes_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x39(%rbp)
jne    11bb <blackscholes_call+0x6b>
jp     11bb <blackscholes_call+0x6b>
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe65(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x39(%rbp)
jb     11bb <blackscholes_call+0x6b>
movsd  0xe58(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%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,-0x3a(%rbp)
jne    1214 <blackscholes_call+0xc4>
jp     1214 <blackscholes_call+0xc4>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe0c(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3a(%rbp)
jb     1214 <blackscholes_call+0xc4>
movsd  0xdff(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x3a(%rbp)
mov    -0x3a(%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,-0x3b(%rbp)
jne    126d <blackscholes_call+0x11d>
jp     126d <blackscholes_call+0x11d>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdc3(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3b(%rbp)
jb     126d <blackscholes_call+0x11d>
movsd  0xdb6(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0x3b(%rbp)
mov    -0x3b(%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,-0x3c(%rbp)
jne    12c1 <blackscholes_call+0x171>
jp     12c1 <blackscholes_call+0x171>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3c(%rbp)
jb     12c1 <blackscholes_call+0x171>
movsd  0xd6a(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0x3c(%rbp)
mov    -0x3c(%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,-0x3d(%rbp)
jne    131a <blackscholes_call+0x1ca>
jp     131a <blackscholes_call+0x1ca>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd2e(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3d(%rbp)
jb     131a <blackscholes_call+0x1ca>
movsd  0xd21(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  -0x28(%rbp),%xmm2
movsd  0xcc1(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%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  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%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    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blackscholes_call>:
sub    $0x48,%rsp
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe9d(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe98(%rip),%xmm5
movsd  %xmm0,0x28(%rsp)
ucomisd %xmm0,%xmm5
movsd  %xmm4,0x10(%rsp)
movaps %xmm3,0x30(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
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 0xe4b(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe46(%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 0xe26(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe21(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xorpd  %xmm0,%xmm0
movapd 0x30(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movsd  0xdfd(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xddd(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xdd8(%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 0xdc7(%rip),%xmm0
jb     1287 <blackscholes_call+0x137>
movsd  0x8(%rsp),%xmm0
sqrtsd %xmm0,%xmm0
jmp    1292 <blackscholes_call+0x142>
movsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x28(%rsp),%xmm0
divsd  0x18(%rsp),%xmm0
call   1050 <log@plt>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  0xd77(%rip),%xmm1
addsd  0x30(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
divsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
mov    $0x1,%al
call   1060 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0x30(%rsp),%xmm0
xorpd  0xd51(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x40(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x48,%rsp
ret

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

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