#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 */
int /*<<< orphan*/ assert(int);
double cnd(double);
double exp(double);
double log(double);
double pow(double, double);
double sqrt(double);
double delta(int fCall, double S, double X, double T, double r, double b,
             double v) {
  double d1, result;
  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);
  d1 = (log(S / X) + (b + pow(v, 2.0) / 2.0) * T) / (v * sqrt(T));
  result = exp((b - r) * T);
  if (fCall)
    result *= cnd(d1);
  else
    result *= (cnd(d1) - 1.0);
  return result;
}


x86 assembly (clang, -O0):
<delta>:
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  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x49(%rbp)
jne    11d3 <delta+0x73>
jp     11d3 <delta+0x73>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe4d(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x49(%rbp)
jb     11d3 <delta+0x73>
movsd  0xe40(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0x4a(%rbp)
jne    122a <delta+0xca>
jp     122a <delta+0xca>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdf6(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x4a(%rbp)
jb     122a <delta+0xca>
movsd  0xde9(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0x4a(%rbp)
mov    -0x4a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x20(%rbp),%xmm0
mov    %al,-0x4b(%rbp)
jne    1281 <delta+0x121>
jp     1281 <delta+0x121>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdaf(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x4b(%rbp)
jb     1281 <delta+0x121>
movsd  0xda2(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0x4b(%rbp)
mov    -0x4b(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x28(%rbp),%xmm0
mov    %al,-0x4c(%rbp)
jne    12d3 <delta+0x173>
jp     12d3 <delta+0x173>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x4c(%rbp)
jb     12d3 <delta+0x173>
movsd  0xd58(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %al
mov    %al,-0x4c(%rbp)
mov    -0x4c(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0x4d(%rbp)
jne    132a <delta+0x1ca>
jp     132a <delta+0x1ca>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd1e(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x4d(%rbp)
jb     132a <delta+0x1ca>
movsd  0xd01(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
setae  %al
mov    %al,-0x4d(%rbp)
mov    -0x4d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x38(%rbp),%xmm0
mov    %al,-0x4e(%rbp)
jne    1381 <delta+0x221>
jp     1381 <delta+0x221>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
movsd  0xccf(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x4e(%rbp)
jb     1381 <delta+0x221>
movsd  0xcc2(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
setae  %al
mov    %al,-0x4e(%rbp)
mov    -0x4e(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xc87(%rip),%xmm1
call   1070 <pow@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
movsd  0xc6d(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1080 <sqrt@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x48(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1457 <delta+0x2f7>
movsd  -0x40(%rbp),%xmm0
call   1060 <cnd@plt>
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1477 <delta+0x317>
movsd  -0x40(%rbp),%xmm0
call   1060 <cnd@plt>
movsd  0xbdf(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm0,0x28(%rsp)
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe96(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe91(%rip),%xmm6
ucomisd %xmm0,%xmm6
movsd  %xmm5,0x18(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
mov    %edi,%ebx
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe45(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe40(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xe22(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe1d(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
xorpd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movsd  0xdfb(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xddd(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xdc8(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xdb2(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xdad(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0x28(%rsp),%xmm0
divsd  (%rsp),%xmm0
call   1050 <log@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm2
mulsd  0xd7c(%rip),%xmm2
addsd  0x8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
ucomisd 0xd71(%rip),%xmm1
jb     12ea <delta+0x19a>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    12f9 <delta+0x1a9>
movapd %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movsd  0x8(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1060 <cnd@plt>
test   %ebx,%ebx
jne    133e <delta+0x1ee>
addsd  0xd0a(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

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

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