extern double blackscholes_put(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 X * exp(-r * T) * cnd(-(d1 - vst)) - S * cnd(-d1);
}


x86 assembly (clang, -O0):
<blackscholes_put>:
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_put+0x6b>
jp     11bb <blackscholes_put+0x6b>
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe65(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x39(%rbp)
jb     11bb <blackscholes_put+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_put+0xc4>
jp     1214 <blackscholes_put+0xc4>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe0c(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3a(%rbp)
jb     1214 <blackscholes_put+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_put+0x11d>
jp     126d <blackscholes_put+0x11d>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdc3(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3b(%rbp)
jb     126d <blackscholes_put+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_put+0x171>
jp     12c1 <blackscholes_put+0x171>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3c(%rbp)
jb     12c1 <blackscholes_put+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_put+0x1ca>
jp     131a <blackscholes_put+0x1ca>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd2e(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x3d(%rbp)
jb     131a <blackscholes_put+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  -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,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%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,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%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_put>:
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,(%rsp)
movsd  %xmm1,0x8(%rsp)
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 0xe4c(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe47(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xe28(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe23(%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  0xdff(%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 0xddf(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xdda(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
ucomisd 0xdca(%rip),%xmm0
jb     1283 <blackscholes_put+0x133>
movsd  (%rsp),%xmm0
sqrtsd %xmm0,%xmm0
jmp    128d <blackscholes_put+0x13d>
movsd  (%rsp),%xmm0
call   1070 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x28(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
movsd  0x10(%rsp),%xmm3
mulsd  %xmm3,%xmm3
mulsd  0xd7c(%rip),%xmm3
movapd %xmm0,%xmm2
movapd 0x30(%rsp),%xmm0
addsd  %xmm0,%xmm3
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm3
addsd  %xmm3,%xmm2
divsd  0x20(%rsp),%xmm2
movapd %xmm2,0x10(%rsp)
xorpd  0xd65(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
xorpd  0xd3d(%rip),%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movaps 0x10(%rsp),%xmm0
xorps  0xd19(%rip),%xmm0
mov    $0x1,%al
call   1060 <cnd@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x28(%rsp),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @blackscholes_put(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* %7
%97 = load double, double* %9
%98 = fneg double %97
%99 = load double, double* %8
%100 = fmul double %98, %99
%101 = call double @exp(double %100)
%102 = fmul double %96, %101
%103 = load double, double* %12
%104 = load double, double* %11
%105 = fsub double %103, %104
%106 = fneg double %105
%107 = call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %106)
%108 = sitofp i32 %107 to double
%109 = load double, double* %6
%110 = load double, double* %12
%111 = fneg double %110
%112 = call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %111)
%113 = sitofp i32 %112 to double
%114 = fmul double %109, %113
%115 = fneg double %114
%116 = call double @llvm.fmuladd.f64(double %102, double %108, double %115)
ret double %116
}

LLVM IR (-O2):
define double @blackscholes_put(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 = fneg double %3
%49 = fmul double %48, %2
%50 = tail call double @exp(double %49)
%51 = fmul double %50, %1
%52 = fsub double %47, %40
%53 = fneg double %52
%54 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %53)
%55 = sitofp i32 %54 to double
%56 = fneg double %47
%57 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %56)
%58 = sitofp i32 %57 to double
%59 = fneg double %58
%60 = fmul double %59, %0
%61 = tail call double @llvm.fmuladd.f64(double %51, double %55, double %60)
ret double %61
}