#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 exp(double);
double fmax(double, double);
double gbs_call(double, double, double, double, double, double);
double phi(double, double, double, double, double, double, double, double);
double const pow(double, double);
double sqrt(double);
double BSAmericanCallApprox(double S, double X, double T, double r, double b,
                            double v) {
  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);
  if (b >= r) {
    return gbs_call(S, X, T, r, b, v);
  } else {
    double vv, Beta, BInfinity, B0, ht, I;
    vv = v * v;
    assert(((vv) == (vv)));
    Beta =
        (0.5 - b / vv) + sqrt(((b / vv - 0.5) * (b / vv - 0.5)) + 2.0 * r / vv);
    assert(((Beta) == (Beta)));
    BInfinity = Beta / (Beta - 1.0) * X;
    assert(((BInfinity) == (BInfinity)));
    B0 = fmax(X, r / (r - b) * X);
    assert(((B0) == (B0)));
    ht = -(b * T + 2.0 * v * sqrt(T)) * B0 / (BInfinity - B0);
    assert(((ht) == (ht)));
    I = B0 + (BInfinity - B0) * (1.0 - exp(ht));
    assert(((I) == (I)));
    if (S >= I)
      return S - X;
    else {
      const double alpha = (I - X) * pow(I, -Beta);
      return alpha * pow(S, Beta) - alpha * phi(S, T, Beta, I, I, r, b, v) +
             phi(S, T, 1.0, I, I, r, b, v) - phi(S, T, 1.0, X, I, r, b, v) -
             X * phi(S, T, 0.0, I, I, r, b, v) +
             X * phi(S, T, 0.0, X, I, r, b, v);
    }
  }
}


x86 assembly (clang, -O0):
<BSAmericanCallApprox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
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,-0x71(%rbp)
jne    11d3 <BSAmericanCallApprox+0x73>
jp     11d3 <BSAmericanCallApprox+0x73>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe4d(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x71(%rbp)
jb     11d3 <BSAmericanCallApprox+0x73>
movsd  0xe40(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0x72(%rbp)
jne    122a <BSAmericanCallApprox+0xca>
jp     122a <BSAmericanCallApprox+0xca>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdf6(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x72(%rbp)
jb     122a <BSAmericanCallApprox+0xca>
movsd  0xde9(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0x72(%rbp)
mov    -0x72(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x20(%rbp),%xmm0
mov    %al,-0x73(%rbp)
jne    1281 <BSAmericanCallApprox+0x121>
jp     1281 <BSAmericanCallApprox+0x121>
movsd  -0x20(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdaf(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x73(%rbp)
jb     1281 <BSAmericanCallApprox+0x121>
movsd  0xda2(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
setae  %al
mov    %al,-0x73(%rbp)
mov    -0x73(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x28(%rbp),%xmm0
mov    %al,-0x74(%rbp)
jne    12d3 <BSAmericanCallApprox+0x173>
jp     12d3 <BSAmericanCallApprox+0x173>
movsd  -0x28(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x74(%rbp)
jb     12d3 <BSAmericanCallApprox+0x173>
movsd  0xd58(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %al
mov    %al,-0x74(%rbp)
mov    -0x74(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x38(%rbp),%xmm0
mov    %al,-0x75(%rbp)
jne    132a <BSAmericanCallApprox+0x1ca>
jp     132a <BSAmericanCallApprox+0x1ca>
movsd  -0x38(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd1e(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x75(%rbp)
jb     132a <BSAmericanCallApprox+0x1ca>
movsd  0xd11(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
setae  %al
mov    %al,-0x75(%rbp)
mov    -0x75(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1374 <BSAmericanCallApprox+0x214>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
call   1030 <gbs_call@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1856 <BSAmericanCallApprox+0x6f6>
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x30(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
movsd  0xc97(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xc79(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm2
divsd  -0x40(%rbp),%xmm2
movsd  0xc63(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  0xc4f(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xbee(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x18(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
divsd  %xmm0,%xmm2
mulsd  -0x18(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
ucomisd -0x58(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xb4a(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1080 <sqrt@plt>
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
subsd  -0x58(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1060 <exp@plt>
movsd  -0x88(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0x80(%rbp),%xmm0
movsd  0xa7b(%rip),%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
jb     160e <BSAmericanCallApprox+0x4ae>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1856 <BSAmericanCallApprox+0x6f6>
movsd  -0x68(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
call   1070 <pow@plt>
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  -0x38(%rbp),%xmm7
call   1050 <phi@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movsd  -0xe8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  -0x38(%rbp),%xmm7
movsd  0x90f(%rip),%xmm2
call   1050 <phi@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  -0x38(%rbp),%xmm7
movsd  0x8c8(%rip),%xmm2
call   1050 <phi@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  -0x38(%rbp),%xmm7
xorps  %xmm2,%xmm2
call   1050 <phi@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xc0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  -0x38(%rbp),%xmm7
xorps  %xmm2,%xmm2
call   1050 <phi@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSAmericanCallApprox>:
sub    $0x78,%rsp
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe8d(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe88(%rip),%xmm6
movsd  %xmm0,0x20(%rsp)
ucomisd %xmm0,%xmm6
movsd  %xmm5,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x28(%rsp)
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  0x28(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xe37(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe32(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xe15(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xe10(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1040 <assert@plt>
xorpd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movsd  0xdee(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xdd0(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xdcb(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1040 <assert@plt>
movsd  0x18(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
ucomisd %xmm3,%xmm4
jae    12f7 <BSAmericanCallApprox+0x197>
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
call   1040 <assert@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x30(%rsp),%xmm2
divsd  %xmm2,%xmm0
movsd  0xd79(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
addsd  0xd6f(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xd69(%rip),%xmm0
jb     1317 <BSAmericanCallApprox+0x1b7>
sqrtsd %xmm0,%xmm0
jmp    131c <BSAmericanCallApprox+0x1bc>
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  (%rsp),%xmm2
movsd  0x10(%rsp),%xmm5
add    $0x78,%rsp
jmp    1030 <gbs_call@plt>
call   1080 <sqrt@plt>
movapd 0x40(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
xor    %edi,%edi
ucomisd %xmm1,%xmm1
setnp  %dil
call   1040 <assert@plt>
movsd  0xd05(%rip),%xmm0
movapd 0x40(%rsp),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
mulsd  0x28(%rsp),%xmm1
xor    %edi,%edi
movapd %xmm1,0x30(%rsp)
ucomisd %xmm1,%xmm1
setnp  %dil
call   1040 <assert@plt>
movsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
subsd  0x8(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  0x28(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
cmpunordsd %xmm0,%xmm2
movapd %xmm2,%xmm0
andpd  %xmm1,%xmm0
maxsd  %xmm3,%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
xor    %edi,%edi
movapd %xmm2,0x50(%rsp)
ucomisd %xmm2,%xmm2
setnp  %dil
call   1040 <assert@plt>
movsd  0x10(%rsp),%xmm2
addsd  %xmm2,%xmm2
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     13e2 <BSAmericanCallApprox+0x282>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    13fc <BSAmericanCallApprox+0x29c>
movapd %xmm1,%xmm0
movsd  %xmm2,0x60(%rsp)
call   1080 <sqrt@plt>
movsd  0x60(%rsp),%xmm2
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
xorpd  0xc4a(%rip),%xmm3
movapd 0x50(%rsp),%xmm0
mulsd  %xmm0,%xmm3
movapd 0x30(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
divsd  %xmm1,%xmm3
movapd %xmm3,0x60(%rsp)
xor    %edi,%edi
ucomisd %xmm3,%xmm3
setnp  %dil
call   1040 <assert@plt>
movapd 0x60(%rsp),%xmm0
call   1060 <exp@plt>
movsd  0xbf4(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x30(%rsp),%xmm1
addsd  0x50(%rsp),%xmm1
movsd  %xmm1,0x30(%rsp)
xor    %edi,%edi
ucomisd %xmm1,%xmm1
setnp  %dil
call   1040 <assert@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movapd %xmm1,%xmm2
ucomisd %xmm1,%xmm0
movsd  0x28(%rsp),%xmm1
jae    163d <BSAmericanCallApprox+0x4dd>
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
movsd  %xmm3,0x50(%rsp)
movaps 0xbaa(%rip),%xmm1
xorps  0x40(%rsp),%xmm1
movapd %xmm2,%xmm0
call   1070 <pow@plt>
mulsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x20(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
call   1070 <pow@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
movaps 0x40(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movaps %xmm3,%xmm4
movsd  0x18(%rsp),%xmm5
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm7
call   1050 <phi@plt>
movsd  0x60(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x50(%rsp),%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rsp)
movsd  0xb14(%rip),%xmm2
movsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x30(%rsp),%xmm3
movaps %xmm3,%xmm4
movsd  0x18(%rsp),%xmm5
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm7
call   1050 <phi@plt>
addsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0xaca(%rip),%xmm2
movsd  0x28(%rsp),%xmm3
movsd  0x30(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm7
call   1050 <phi@plt>
movsd  0x40(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%rsp)
xorps  %xmm2,%xmm2
movsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x30(%rsp),%xmm3
movaps %xmm3,%xmm4
movsd  0x18(%rsp),%xmm5
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm7
call   1050 <phi@plt>
movsd  0x28(%rsp),%xmm3
mulsd  %xmm3,%xmm0
movsd  0x40(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%rsp)
xorps  %xmm2,%xmm2
movsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x30(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
movsd  0x8(%rsp),%xmm6
movsd  0x10(%rsp),%xmm7
call   1050 <phi@plt>
mulsd  0x28(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
add    $0x78,%rsp
ret
subsd  %xmm1,%xmm0
add    $0x78,%rsp
ret

LLVM IR (-O0):
define double @BSAmericanCallApprox(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
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %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
%21 = load double, double* %8
%22 = load double, double* %8
%23 = fcmp oeq double %21, %22
br i1 %23, label %24, label %30
24: ; preds = %6
%25 = load double, double* %8
%26 = fcmp oge double %25, 0x3EB0C6F7A0B5ED8D
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load double, double* %8
%29 = fcmp ole double %28, 1.000000e+12
br label %30
30: ; preds = %27, %24, %6
%31 = phi i1 [ false, %24 ], [ false, %6 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load double, double* %9
%35 = load double, double* %9
%36 = fcmp oeq double %34, %35
br i1 %36, label %37, label %43
37: ; preds = %30
%38 = load double, double* %9
%39 = fcmp oge double %38, 0x3EB0C6F7A0B5ED8D
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load double, double* %9
%42 = fcmp ole double %41, 1.000000e+12
br label %43
43: ; preds = %40, %37, %30
%44 = phi i1 [ false, %37 ], [ false, %30 ], [ %42, %40 ]
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = load double, double* %10
%48 = load double, double* %10
%49 = fcmp oeq double %47, %48
br i1 %49, label %50, label %56
50: ; preds = %43
%51 = load double, double* %10
%52 = fcmp oge double %51, 0x3F2596179C29D2CE
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = load double, double* %10
%55 = fcmp ole double %54, 2.000000e+01
br label %56
56: ; preds = %53, %50, %43
%57 = phi i1 [ false, %50 ], [ false, %43 ], [ %55, %53 ]
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = load double, double* %11
%61 = load double, double* %11
%62 = fcmp oeq double %60, %61
br i1 %62, label %63, label %69
63: ; preds = %56
%64 = load double, double* %11
%65 = fcmp oge double %64, 0.000000e+00
br i1 %65, label %66, label %69
66: ; preds = %63
%67 = load double, double* %11
%68 = fcmp ole double %67, 1.000000e+03
br label %69
69: ; preds = %66, %63, %56
%70 = phi i1 [ false, %63 ], [ false, %56 ], [ %68, %66 ]
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = load double, double* %13
%74 = load double, double* %13
%75 = fcmp oeq double %73, %74
br i1 %75, label %76, label %82
76: ; preds = %69
%77 = load double, double* %13
%78 = fcmp oge double %77, 0x3E7AD7F29ABCAF48
br i1 %78, label %79, label %82
79: ; preds = %76
%80 = load double, double* %13
%81 = fcmp ole double %80, 0x40593FFFD60E94EE
br label %82
82: ; preds = %79, %76, %69
%83 = phi i1 [ false, %76 ], [ false, %69 ], [ %81, %79 ]
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
%86 = load double, double* %12
%87 = load double, double* %11
%88 = fcmp oge double %86, %87
br i1 %88, label %89, label %97
89: ; preds = %82
%90 = load double, double* %8
%91 = load double, double* %9
%92 = load double, double* %10
%93 = load double, double* %11
%94 = load double, double* %12
%95 = load double, double* %13
%96 = call double @gbs_call(double %90, double %91, double %92, double %93, double %94, double %95)
store double %96, double* %7
br label %260
97: ; preds = %82
%98 = load double, double* %13
%99 = load double, double* %13
%100 = fmul double %98, %99
store double %100, double* %14
%101 = load double, double* %14
%102 = load double, double* %14
%103 = fcmp oeq double %101, %102
%104 = zext i1 %103 to i32
%105 = call i32 @assert(i32 %104)
%106 = load double, double* %12
%107 = load double, double* %14
%108 = fdiv double %106, %107
%109 = fsub double 5.000000e-01, %108
%110 = load double, double* %12
%111 = load double, double* %14
%112 = fdiv double %110, %111
%113 = fsub double %112, 5.000000e-01
%114 = load double, double* %12
%115 = load double, double* %14
%116 = fdiv double %114, %115
%117 = fsub double %116, 5.000000e-01
%118 = load double, double* %11
%119 = fmul double 2.000000e+00, %118
%120 = load double, double* %14
%121 = fdiv double %119, %120
%122 = call double @llvm.fmuladd.f64(double %113, double %117, double %121)
%123 = call double @sqrt(double %122)
%124 = fadd double %109, %123
store double %124, double* %15
%125 = load double, double* %15
%126 = load double, double* %15
%127 = fcmp oeq double %125, %126
%128 = zext i1 %127 to i32
%129 = call i32 @assert(i32 %128)
%130 = load double, double* %15
%131 = load double, double* %15
%132 = fsub double %131, 1.000000e+00
%133 = fdiv double %130, %132
%134 = load double, double* %9
%135 = fmul double %133, %134
store double %135, double* %16
%136 = load double, double* %16
%137 = load double, double* %16
%138 = fcmp oeq double %136, %137
%139 = zext i1 %138 to i32
%140 = call i32 @assert(i32 %139)
%141 = load double, double* %9
%142 = load double, double* %11
%143 = load double, double* %11
%144 = load double, double* %12
%145 = fsub double %143, %144
%146 = fdiv double %142, %145
%147 = load double, double* %9
%148 = fmul double %146, %147
%149 = call double @llvm.maxnum.f64(double %141, double %148)
store double %149, double* %17
%150 = load double, double* %17
%151 = load double, double* %17
%152 = fcmp oeq double %150, %151
%153 = zext i1 %152 to i32
%154 = call i32 @assert(i32 %153)
%155 = load double, double* %12
%156 = load double, double* %10
%157 = load double, double* %13
%158 = fmul double 2.000000e+00, %157
%159 = load double, double* %10
%160 = call double @sqrt(double %159)
%161 = fmul double %158, %160
%162 = call double @llvm.fmuladd.f64(double %155, double %156, double %161)
%163 = fneg double %162
%164 = load double, double* %17
%165 = fmul double %163, %164
%166 = load double, double* %16
%167 = load double, double* %17
%168 = fsub double %166, %167
%169 = fdiv double %165, %168
store double %169, double* %18
%170 = load double, double* %18
%171 = load double, double* %18
%172 = fcmp oeq double %170, %171
%173 = zext i1 %172 to i32
%174 = call i32 @assert(i32 %173)
%175 = load double, double* %17
%176 = load double, double* %16
%177 = load double, double* %17
%178 = fsub double %176, %177
%179 = load double, double* %18
%180 = call double @exp(double %179)
%181 = fsub double 1.000000e+00, %180
%182 = call double @llvm.fmuladd.f64(double %178, double %181, double %175)
store double %182, double* %19
%183 = load double, double* %19
%184 = load double, double* %19
%185 = fcmp oeq double %183, %184
%186 = zext i1 %185 to i32
%187 = call i32 @assert(i32 %186)
%188 = load double, double* %8
%189 = load double, double* %19
%190 = fcmp oge double %188, %189
br i1 %190, label %191, label %195
191: ; preds = %97
%192 = load double, double* %8
%193 = load double, double* %9
%194 = fsub double %192, %193
store double %194, double* %7
br label %260
195: ; preds = %97
%196 = load double, double* %19
%197 = load double, double* %9
%198 = fsub double %196, %197
%199 = load double, double* %19
%200 = load double, double* %15
%201 = fneg double %200
%202 = call double @pow(double %199, double %201)
%203 = fmul double %198, %202
store double %203, double* %20
%204 = load double, double* %20
%205 = load double, double* %8
%206 = load double, double* %15
%207 = call double @pow(double %205, double %206)
%208 = load double, double* %20
%209 = load double, double* %8
%210 = load double, double* %10
%211 = load double, double* %15
%212 = load double, double* %19
%213 = load double, double* %19
%214 = load double, double* %11
%215 = load double, double* %12
%216 = load double, double* %13
%217 = call double @phi(double %209, double %210, double %211, double %212, double %213, double %214, double %215, double %216)
%218 = fmul double %208, %217
%219 = fneg double %218
%220 = call double @llvm.fmuladd.f64(double %204, double %207, double %219)
%221 = load double, double* %8
%222 = load double, double* %10
%223 = load double, double* %19
%224 = load double, double* %19
%225 = load double, double* %11
%226 = load double, double* %12
%227 = load double, double* %13
%228 = call double @phi(double %221, double %222, double 1.000000e+00, double %223, double %224, double %225, double %226, double %227)
%229 = fadd double %220, %228
%230 = load double, double* %8
%231 = load double, double* %10
%232 = load double, double* %9
%233 = load double, double* %19
%234 = load double, double* %11
%235 = load double, double* %12
%236 = load double, double* %13
%237 = call double @phi(double %230, double %231, double 1.000000e+00, double %232, double %233, double %234, double %235, double %236)
%238 = fsub double %229, %237
%239 = load double, double* %9
%240 = load double, double* %8
%241 = load double, double* %10
%242 = load double, double* %19
%243 = load double, double* %19
%244 = load double, double* %11
%245 = load double, double* %12
%246 = load double, double* %13
%247 = call double @phi(double %240, double %241, double 0.000000e+00, double %242, double %243, double %244, double %245, double %246)
%248 = fneg double %239
%249 = call double @llvm.fmuladd.f64(double %248, double %247, double %238)
%250 = load double, double* %9
%251 = load double, double* %8
%252 = load double, double* %10
%253 = load double, double* %9
%254 = load double, double* %19
%255 = load double, double* %11
%256 = load double, double* %12
%257 = load double, double* %13
%258 = call double @phi(double %251, double %252, double 0.000000e+00, double %253, double %254, double %255, double %256, double %257)
%259 = call double @llvm.fmuladd.f64(double %250, double %258, double %249)
store double %259, double* %7
br label %260
260: ; preds = %195, %191, %89
%261 = load double, double* %7
ret double %261
}

LLVM IR (-O2):
define double @BSAmericanCallApprox(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 @assert(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 @assert(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 @assert(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 @assert(i32 %31)
%33 = fcmp ord double %5, 0.000000e+00
%34 = fcmp oge double %5, 0x3E7AD7F29ABCAF48
%35 = and i1 %33, %34
%36 = fcmp ole double %5, 0x40593FFFD60E94EE
%37 = and i1 %36, %35
%38 = zext i1 %37 to i32
%39 = tail call i32 @assert(i32 %38)
%40 = fcmp ult double %4, %3
br i1 %40, label %43, label %41
41: ; preds = %6
%42 = tail call double @gbs_call(double %0, double %1, double %2, double %3, double %4, double %5)
br label %111
43: ; preds = %6
%44 = fmul double %5, %5
%45 = fcmp ord double %44, 0.000000e+00
%46 = zext i1 %45 to i32
%47 = tail call i32 @assert(i32 %46)
%48 = fdiv double %4, %44
%49 = fsub double 5.000000e-01, %48
%50 = fadd double %48, -5.000000e-01
%51 = fmul double %3, 2.000000e+00
%52 = fdiv double %51, %44
%53 = tail call double @llvm.fmuladd.f64(double %50, double %50, double %52)
%54 = tail call double @sqrt(double %53)
%55 = fadd double %49, %54
%56 = fcmp ord double %55, 0.000000e+00
%57 = zext i1 %56 to i32
%58 = tail call i32 @assert(i32 %57)
%59 = fadd double %55, -1.000000e+00
%60 = fdiv double %55, %59
%61 = fmul double %60, %1
%62 = fcmp ord double %61, 0.000000e+00
%63 = zext i1 %62 to i32
%64 = tail call i32 @assert(i32 %63)
%65 = fsub double %3, %4
%66 = fdiv double %3, %65
%67 = fmul double %66, %1
%68 = tail call double @llvm.maxnum.f64(double %1, double %67)
%69 = fcmp ord double %68, 0.000000e+00
%70 = zext i1 %69 to i32
%71 = tail call i32 @assert(i32 %70)
%72 = fmul double %5, 2.000000e+00
%73 = tail call double @sqrt(double %2)
%74 = fmul double %72, %73
%75 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %74)
%76 = fneg double %75
%77 = fmul double %68, %76
%78 = fsub double %61, %68
%79 = fdiv double %77, %78
%80 = fcmp ord double %79, 0.000000e+00
%81 = zext i1 %80 to i32
%82 = tail call i32 @assert(i32 %81)
%83 = tail call double @exp(double %79)
%84 = fsub double 1.000000e+00, %83
%85 = tail call double @llvm.fmuladd.f64(double %78, double %84, double %68)
%86 = fcmp ord double %85, 0.000000e+00
%87 = zext i1 %86 to i32
%88 = tail call i32 @assert(i32 %87)
%89 = fcmp ugt double %85, %0
br i1 %89, label %92, label %90
90: ; preds = %43
%91 = fsub double %0, %1
br label %111
92: ; preds = %43
%93 = fsub double %85, %1
%94 = fneg double %55
%95 = tail call double @pow(double %85, double %94)
%96 = fmul double %93, %95
%97 = tail call double @pow(double %0, double %55)
%98 = tail call double @phi(double %0, double %2, double %55, double %85, double %85, double %3, double %4, double %5)
%99 = fneg double %96
%100 = fmul double %98, %99
%101 = tail call double @llvm.fmuladd.f64(double %96, double %97, double %100)
%102 = tail call double @phi(double %0, double %2, double 1.000000e+00, double %85, double %85, double %3, double %4, double %5)
%103 = fadd double %102, %101
%104 = tail call double @phi(double %0, double %2, double 1.000000e+00, double %1, double %85, double %3, double %4, double %5)
%105 = fsub double %103, %104
%106 = tail call double @phi(double %0, double %2, double 0.000000e+00, double %85, double %85, double %3, double %4, double %5)
%107 = fneg double %1
%108 = tail call double @llvm.fmuladd.f64(double %107, double %106, double %105)
%109 = tail call double @phi(double %0, double %2, double 0.000000e+00, double %1, double %85, double %3, double %4, double %5)
%110 = tail call double @llvm.fmuladd.f64(double %1, double %109, double %108)
br label %111
111: ; preds = %90, %92, %41
%112 = phi double [ %42, %41 ], [ %91, %90 ], [ %110, %92 ]
ret double %112
}