double ExchangeExchangeOption(int TypeFlag, double S1, double S2, double q,
                              double t1, double T2, double r, double b1,
                              double b2, double v1, double v2, double Rho) {
  double result, I, d1, d2, d3, d4, Y1, y2, y3, y4;
  double st1T2, v, I1;
  int id;
  st1T2 = sqrt(t1 / T2);
  v = sqrt(((v1) * (v1)) + ((v2) * (v2)) - 2.0 * Rho * v1 * v2);
  I1 = S1 * exp((b1 - r) * (T2 - t1)) / (S2 * exp((b2 - r) * (T2 - t1)));
  if (TypeFlag == 1 || TypeFlag == 2)
    id = 1;
  else
    id = 2;
  I = CriticalPrice(id, I1, t1, T2, v, q);
  d1 = (log(S1 / (I * S2)) + (b1 - b2 + ((v) * (v)) / 2.0) * t1) /
       (v * sqrt(t1));
  d2 = d1 - v * sqrt(t1);
  d3 = (log((I * S2) / S1) + (b2 - b1 + ((v) * (v)) / 2.0) * t1) /
       (v * sqrt(t1));
  d4 = d3 - v * sqrt(t1);
  Y1 = (log(S1 / S2) + (b1 - b2 + ((v) * (v)) / 2.0) * T2) / (v * sqrt(T2));
  y2 = Y1 - v * sqrt(T2);
  y3 = (log(S2 / S1) + (b2 - b1 + ((v) * (v)) / 2.0) * T2) / (v * sqrt(T2));
  y4 = y3 - v * sqrt(T2);
  if (TypeFlag == 1) {
    result = -S2 * exp((b2 - r) * T2) * cbnd(d2, y2, st1T2) +
             S1 * exp((b1 - r) * T2) * cbnd(d1, Y1, st1T2) -
             q * S2 * exp((b2 - r) * t1) * cnd(d2);
  } else if (TypeFlag == 2) {
    result = S2 * exp((b2 - r) * T2) * cbnd(d3, y2, -st1T2) -
             S1 * exp((b1 - r) * T2) * cbnd(d4, Y1, -st1T2) +
             q * S2 * exp((b2 - r) * t1) * cnd(d3);
  } else if (TypeFlag == 3) {
    result = S2 * exp((b2 - r) * T2) * cbnd(d3, y3, st1T2) -
             S1 * exp((b1 - r) * T2) * cbnd(d4, y4, st1T2) -
             q * S2 * exp((b2 - r) * t1) * cnd(d3);
  } else if (TypeFlag == 4) {
    result = -S2 * exp((b2 - r) * T2) * cbnd(d2, y3, -st1T2) +
             S1 * exp((b1 - r) * T2) * cbnd(d1, y4, -st1T2) +
             q * S2 * exp((b2 - r) * t1) * cnd(d2);
  } else
    abort();
  return result;
}


x86 assembly (clang, -O0):
<ExchangeExchangeOption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
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  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0x10(%rbp),%xmm1
movsd  0x10(%rbp),%xmm2
movsd  0x18(%rbp),%xmm0
mulsd  0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe0d(%rip),%xmm0
mulsd  0x20(%rbp),%xmm0
mulsd  0x10(%rbp),%xmm0
movsd  0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1060 <exp@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
cmpl   $0x1,-0x4(%rbp)
je     12d0 <ExchangeExchangeOption+0x160>
cmpl   $0x2,-0x4(%rbp)
jne    12df <ExchangeExchangeOption+0x16f>
movl   $0x1,-0xb4(%rbp)
jmp    12e9 <ExchangeExchangeOption+0x179>
movl   $0x2,-0xb4(%rbp)
mov    -0xb4(%rbp),%edi
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0xa8(%rbp),%xmm3
ff
movsd  -0x20(%rbp),%xmm4
mov    $0x5,%al
call   1040 <CriticalPrice@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  -0xa8(%rbp),%xmm2
ff
movsd  0xca5(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0x150(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x148(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0x140(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x138(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  -0xa8(%rbp),%xmm2
ff
movsd  0xbb7(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0x130(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0x120(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x118(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  -0xa8(%rbp),%xmm2
ff
movsd  0xace(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0x110(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0x100(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  -0xa8(%rbp),%xmm2
ff
movsd  0x9e2(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1090 <sqrt@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
cmpl   $0x1,-0x4(%rbp)
jne    1864 <ExchangeExchangeOption+0x6f4>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x190(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
mov    $0x3,%al
call   1050 <cbnd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x188(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0xa0(%rbp),%xmm2
ff
mov    $0x3,%al
call   1050 <cbnd@plt>
movsd  -0x180(%rbp),%xmm1
ff
movsd  -0x178(%rbp),%xmm0
ff
movsd  -0x170(%rbp),%xmm2
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x168(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
movsd  -0x160(%rbp),%xmm0
ff
movsd  -0x158(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1d44 <ExchangeExchangeOption+0xbd4>
cmpl   $0x2,-0x4(%rbp)
jne    1a03 <ExchangeExchangeOption+0x893>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x1d0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x1d0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b8(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x1b0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x1c8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x1c8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
movsd  -0x1c0(%rbp),%xmm1
ff
movsd  -0x1b8(%rbp),%xmm0
ff
movsd  -0x1b0(%rbp),%xmm2
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x1a8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
movsd  -0x1a0(%rbp),%xmm0
ff
movsd  -0x198(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1d3f <ExchangeExchangeOption+0xbcf>
cmpl   $0x3,-0x4(%rbp)
jne    1b8e <ExchangeExchangeOption+0xa1e>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x210(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x210(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
mov    $0x3,%al
call   1050 <cbnd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x1f0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x208(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x208(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
mov    $0x3,%al
call   1050 <cbnd@plt>
movsd  -0x200(%rbp),%xmm1
ff
movsd  -0x1f8(%rbp),%xmm0
ff
movsd  -0x1f0(%rbp),%xmm2
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1d8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x1e8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x1e8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1e0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
movsd  -0x1e0(%rbp),%xmm0
ff
movsd  -0x1d8(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1d3a <ExchangeExchangeOption+0xbca>
cmpl   $0x4,-0x4(%rbp)
jne    1d30 <ExchangeExchangeOption+0xbc0>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x250(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x250(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x238(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x230(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x248(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x248(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x240(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
movsd  -0x240(%rbp),%xmm1
ff
movsd  -0x238(%rbp),%xmm0
ff
movsd  -0x230(%rbp),%xmm2
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x218(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x228(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x228(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x220(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
movsd  -0x220(%rbp),%xmm0
ff
movsd  -0x218(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1d35 <ExchangeExchangeOption+0xbc5>
call   1030 <abort@plt>
jmp    1d3a <ExchangeExchangeOption+0xbca>
jmp    1d3f <ExchangeExchangeOption+0xbcf>
jmp    1d44 <ExchangeExchangeOption+0xbd4>
movsd  -0x50(%rbp),%xmm0
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExchangeExchangeOption>:
push   %rbx
sub    $0xd0,%rsp
movsd  %xmm6,0x30(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x40(%rsp)
movsd  %xmm1,0x38(%rsp)
movsd  %xmm0,0x48(%rsp)
mov    %edi,%ebx
movsd  0xf0(%rsp),%xmm2
movsd  0xe8(%rsp),%xmm5
movsd  0xe0(%rsp),%xmm6
movapd %xmm3,%xmm0
divsd  %xmm4,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movsd  %xmm7,0x28(%rsp)
jb     11dd <ExchangeExchangeOption+0x6d>
sqrtsd %xmm0,%xmm0
jmp    1201 <ExchangeExchangeOption+0x91>
call   1090 <sqrt@plt>
movsd  0xe0(%rsp),%xmm6
xorpd  %xmm3,%xmm3
movsd  0xe8(%rsp),%xmm5
movsd  0xf0(%rsp),%xmm2
movapd %xmm0,0x60(%rsp)
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
movapd %xmm6,%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xddd(%rip),%xmm2
mulsd  %xmm6,%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm3,%xmm2
jb     123e <ExchangeExchangeOption+0xce>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1247 <ExchangeExchangeOption+0xd7>
movapd %xmm2,%xmm0
call   1090 <sqrt@plt>
movapd %xmm0,0x80(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
subsd  0x20(%rsp),%xmm2
subsd  %xmm0,%xmm1
movsd  %xmm1,0x58(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm2,0x78(%rsp)
mulsd  %xmm2,%xmm0
call   1060 <exp@plt>
mulsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm1
subsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x50(%rsp)
movsd  0x58(%rsp),%xmm0
mulsd  %xmm1,%xmm0
call   1060 <exp@plt>
mulsd  0x38(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
mov    $0x2,%edi
sbb    $0x0,%edi
movapd %xmm1,%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movapd 0x80(%rsp),%xmm3
movsd  0x40(%rsp),%xmm4
mov    $0x5,%al
call   1040 <CriticalPrice@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x38(%rsp),%xmm1
movsd  0x48(%rsp),%xmm0
movsd  %xmm1,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1070 <log@plt>
movsd  0x18(%rsp),%xmm1
movsd  %xmm0,0xc0(%rsp)
xorps  %xmm2,%xmm2
sqrtsd %xmm1,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm1
movapd %xmm2,%xmm0
movsd  %xmm2,0x20(%rsp)
jae    135b <ExchangeExchangeOption+0x1eb>
movapd %xmm1,%xmm0
call   1090 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
movsd  %xmm0,0xb8(%rsp)
ucomisd %xmm3,%xmm1
movapd %xmm2,%xmm0
jae    1379 <ExchangeExchangeOption+0x209>
movsd  0x18(%rsp),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,0xc8(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0x48(%rsp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,0xb0(%rsp)
xorpd  %xmm3,%xmm3
movsd  0x18(%rsp),%xmm1
ucomisd %xmm3,%xmm1
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
jae    13cf <ExchangeExchangeOption+0x25f>
movapd %xmm1,%xmm0
call   1090 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
movsd  %xmm0,0xa8(%rsp)
ucomisd %xmm3,%xmm1
jae    13ed <ExchangeExchangeOption+0x27d>
movsd  0x18(%rsp),%xmm0
call   1090 <sqrt@plt>
movapd %xmm0,%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  0x48(%rsp),%xmm0
divsd  0x38(%rsp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,0xa0(%rsp)
movsd  0x8(%rsp),%xmm1
xorps  %xmm2,%xmm2
sqrtsd %xmm1,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm1
movapd %xmm2,%xmm0
movsd  %xmm2,0x10(%rsp)
jae    1447 <ExchangeExchangeOption+0x2d7>
movapd %xmm1,%xmm0
call   1090 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
movsd  %xmm0,0x98(%rsp)
ucomisd %xmm3,%xmm1
movapd %xmm2,%xmm0
jae    1465 <ExchangeExchangeOption+0x2f5>
movsd  0x8(%rsp),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0x38(%rsp),%xmm0
divsd  0x48(%rsp),%xmm0
call   1070 <log@plt>
movsd  %xmm0,0x90(%rsp)
xorpd  %xmm0,%xmm0
movsd  0x8(%rsp),%xmm8
ucomisd %xmm0,%xmm8
movsd  0x10(%rsp),%xmm9
movapd %xmm9,%xmm5
jb     16c3 <ExchangeExchangeOption+0x553>
ucomisd %xmm0,%xmm8
jb     16ee <ExchangeExchangeOption+0x57e>
cmp    $0x3,%ebx
ja     1719 <ExchangeExchangeOption+0x5a9>
movapd 0x80(%rsp),%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
movsd  0x30(%rsp),%xmm3
movapd %xmm3,%xmm7
movsd  0x28(%rsp),%xmm2
subsd  %xmm2,%xmm7
mulsd  0xb20(%rip),%xmm0
subsd  %xmm3,%xmm2
addsd  %xmm0,%xmm7
addsd  %xmm0,%xmm2
movapd %xmm7,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  0xc0(%rsp),%xmm1
movsd  0xb8(%rsp),%xmm3
mulsd  %xmm4,%xmm3
divsd  %xmm3,%xmm1
movapd %xmm2,%xmm6
mulsd  %xmm0,%xmm6
addsd  0xb0(%rsp),%xmm6
movsd  0xa8(%rsp),%xmm0
mulsd  %xmm4,%xmm0
divsd  %xmm0,%xmm6
mulsd  %xmm8,%xmm7
addsd  0xa0(%rsp),%xmm7
movsd  0x98(%rsp),%xmm0
mulsd  %xmm4,%xmm0
divsd  %xmm0,%xmm7
mulsd  %xmm8,%xmm2
addsd  0x90(%rsp),%xmm2
mulsd  %xmm4,%xmm5
divsd  %xmm5,%xmm2
movapd 0xa95(%rip),%xmm0
xorpd  %xmm4,%xmm0
movsd  0xc8(%rsp),%xmm3
mulsd  %xmm4,%xmm3
movapd %xmm1,%xmm5
subsd  %xmm3,%xmm5
movsd  0x20(%rsp),%xmm3
mulsd  %xmm0,%xmm3
movsd  0x58(%rsp),%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm0,%xmm9
addsd  %xmm6,%xmm3
addsd  %xmm7,%xmm4
addsd  %xmm2,%xmm9
lea    0xa5f(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movsd  0x50(%rsp),%xmm0
mulsd  %xmm8,%xmm0
movsd  %xmm4,0x58(%rsp)
movsd  %xmm7,0x28(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm1,0x30(%rsp)
call   1060 <exp@plt>
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x78(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1060 <exp@plt>
mulsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
jmp    1821 <ExchangeExchangeOption+0x6b1>
movapd %xmm8,%xmm0
call   1090 <sqrt@plt>
movsd  0x10(%rsp),%xmm9
movsd  0x8(%rsp),%xmm8
movapd %xmm0,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm8
jae    14b2 <ExchangeExchangeOption+0x342>
movapd %xmm8,%xmm0
movsd  %xmm5,0x10(%rsp)
call   1090 <sqrt@plt>
movsd  0x10(%rsp),%xmm5
movsd  0x8(%rsp),%xmm8
movapd %xmm0,%xmm9
cmp    $0x3,%ebx
jbe    14bb <ExchangeExchangeOption+0x34b>
call   1030 <abort@plt>
movsd  0x50(%rsp),%xmm0
mulsd  %xmm8,%xmm0
movsd  %xmm2,0x28(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm9,0x10(%rsp)
movsd  %xmm6,0x30(%rsp)
call   1060 <exp@plt>
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x80(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x78(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x48(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x28(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x28(%rsp),%xmm0
subsd  %xmm1,%xmm0
jmp    1a4e <ExchangeExchangeOption+0x8de>
movsd  0x50(%rsp),%xmm0
mulsd  %xmm8,%xmm0
movsd  %xmm3,0x20(%rsp)
movsd  %xmm6,0x30(%rsp)
movsd  %xmm4,0x58(%rsp)
movsd  %xmm7,0x28(%rsp)
call   1060 <exp@plt>
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movaps 0x60(%rsp),%xmm2
xorps  0x7a6(%rip),%xmm2
movaps %xmm2,0x60(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x78(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x48(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x40(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1060 <exp@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
jmp    1a4e <ExchangeExchangeOption+0x8de>
movsd  0x50(%rsp),%xmm0
mulsd  %xmm8,%xmm0
movsd  %xmm2,0x28(%rsp)
movsd  %xmm9,0x10(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm1,0x30(%rsp)
call   1060 <exp@plt>
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movaps 0x60(%rsp),%xmm2
xorps  0x68d(%rip),%xmm2
movaps %xmm2,0x60(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x80(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x78(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1060 <exp@plt>
mulsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
mov    $0x3,%al
call   1050 <cbnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x40(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1060 <exp@plt>
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
mov    $0x1,%al
call   1080 <cnd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ExchangeExchangeOption(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca i32
store i32 %0, i32* %13
store double %1, double* %14
store double %2, double* %15
store double %3, double* %16
store double %4, double* %17
store double %5, double* %18
store double %6, double* %19
store double %7, double* %20
store double %8, double* %21
store double %9, double* %22
store double %10, double* %23
store double %11, double* %24
%39 = load double, double* %17
%40 = load double, double* %18
%41 = fdiv double %39, %40
%42 = call double @sqrt(double %41)
store double %42, double* %35
%43 = load double, double* %22
%44 = load double, double* %22
%45 = load double, double* %23
%46 = load double, double* %23
%47 = fmul double %45, %46
%48 = call double @llvm.fmuladd.f64(double %43, double %44, double %47)
%49 = load double, double* %24
%50 = fmul double 2.000000e+00, %49
%51 = load double, double* %22
%52 = fmul double %50, %51
%53 = load double, double* %23
%54 = fneg double %52
%55 = call double @llvm.fmuladd.f64(double %54, double %53, double %48)
%56 = call double @sqrt(double %55)
store double %56, double* %36
%57 = load double, double* %14
%58 = load double, double* %20
%59 = load double, double* %19
%60 = fsub double %58, %59
%61 = load double, double* %18
%62 = load double, double* %17
%63 = fsub double %61, %62
%64 = fmul double %60, %63
%65 = call double @exp(double %64)
%66 = fmul double %57, %65
%67 = load double, double* %15
%68 = load double, double* %21
%69 = load double, double* %19
%70 = fsub double %68, %69
%71 = load double, double* %18
%72 = load double, double* %17
%73 = fsub double %71, %72
%74 = fmul double %70, %73
%75 = call double @exp(double %74)
%76 = fmul double %67, %75
%77 = fdiv double %66, %76
store double %77, double* %37
%78 = load i32, i32* %13
%79 = icmp eq i32 %78, 1
br i1 %79, label %83, label %80
80: ; preds = %12
%81 = load i32, i32* %13
%82 = icmp eq i32 %81, 2
br i1 %82, label %83, label %84
83: ; preds = %80, %12
store i32 1, i32* %38
br label %85
84: ; preds = %80
store i32 2, i32* %38
br label %85
85: ; preds = %84, %83
%86 = load i32, i32* %38
%87 = load double, double* %37
%88 = load double, double* %17
%89 = load double, double* %18
%90 = load double, double* %36
%91 = load double, double* %16
%92 = call i32 (i32, double, double, double, double, double, ...) bitcast (i32 (...)* @CriticalPrice to i32 (i32, double, double, double, double, double, ...)*)(i32 %86, double %87, double %88, double %89, double %90, double %91)
%93 = sitofp i32 %92 to double
store double %93, double* %26
%94 = load double, double* %14
%95 = load double, double* %26
%96 = load double, double* %15
%97 = fmul double %95, %96
%98 = fdiv double %94, %97
%99 = call double @log(double %98)
%100 = load double, double* %20
%101 = load double, double* %21
%102 = fsub double %100, %101
%103 = load double, double* %36
%104 = load double, double* %36
%105 = fmul double %103, %104
%106 = fdiv double %105, 2.000000e+00
%107 = fadd double %102, %106
%108 = load double, double* %17
%109 = call double @llvm.fmuladd.f64(double %107, double %108, double %99)
%110 = load double, double* %36
%111 = load double, double* %17
%112 = call double @sqrt(double %111)
%113 = fmul double %110, %112
%114 = fdiv double %109, %113
store double %114, double* %27
%115 = load double, double* %27
%116 = load double, double* %36
%117 = load double, double* %17
%118 = call double @sqrt(double %117)
%119 = fneg double %116
%120 = call double @llvm.fmuladd.f64(double %119, double %118, double %115)
store double %120, double* %28
%121 = load double, double* %26
%122 = load double, double* %15
%123 = fmul double %121, %122
%124 = load double, double* %14
%125 = fdiv double %123, %124
%126 = call double @log(double %125)
%127 = load double, double* %21
%128 = load double, double* %20
%129 = fsub double %127, %128
%130 = load double, double* %36
%131 = load double, double* %36
%132 = fmul double %130, %131
%133 = fdiv double %132, 2.000000e+00
%134 = fadd double %129, %133
%135 = load double, double* %17
%136 = call double @llvm.fmuladd.f64(double %134, double %135, double %126)
%137 = load double, double* %36
%138 = load double, double* %17
%139 = call double @sqrt(double %138)
%140 = fmul double %137, %139
%141 = fdiv double %136, %140
store double %141, double* %29
%142 = load double, double* %29
%143 = load double, double* %36
%144 = load double, double* %17
%145 = call double @sqrt(double %144)
%146 = fneg double %143
%147 = call double @llvm.fmuladd.f64(double %146, double %145, double %142)
store double %147, double* %30
%148 = load double, double* %14
%149 = load double, double* %15
%150 = fdiv double %148, %149
%151 = call double @log(double %150)
%152 = load double, double* %20
%153 = load double, double* %21
%154 = fsub double %152, %153
%155 = load double, double* %36
%156 = load double, double* %36
%157 = fmul double %155, %156
%158 = fdiv double %157, 2.000000e+00
%159 = fadd double %154, %158
%160 = load double, double* %18
%161 = call double @llvm.fmuladd.f64(double %159, double %160, double %151)
%162 = load double, double* %36
%163 = load double, double* %18
%164 = call double @sqrt(double %163)
%165 = fmul double %162, %164
%166 = fdiv double %161, %165
store double %166, double* %31
%167 = load double, double* %31
%168 = load double, double* %36
%169 = load double, double* %18
%170 = call double @sqrt(double %169)
%171 = fneg double %168
%172 = call double @llvm.fmuladd.f64(double %171, double %170, double %167)
store double %172, double* %32
%173 = load double, double* %15
%174 = load double, double* %14
%175 = fdiv double %173, %174
%176 = call double @log(double %175)
%177 = load double, double* %21
%178 = load double, double* %20
%179 = fsub double %177, %178
%180 = load double, double* %36
%181 = load double, double* %36
%182 = fmul double %180, %181
%183 = fdiv double %182, 2.000000e+00
%184 = fadd double %179, %183
%185 = load double, double* %18
%186 = call double @llvm.fmuladd.f64(double %184, double %185, double %176)
%187 = load double, double* %36
%188 = load double, double* %18
%189 = call double @sqrt(double %188)
%190 = fmul double %187, %189
%191 = fdiv double %186, %190
store double %191, double* %33
%192 = load double, double* %33
%193 = load double, double* %36
%194 = load double, double* %18
%195 = call double @sqrt(double %194)
%196 = fneg double %193
%197 = call double @llvm.fmuladd.f64(double %196, double %195, double %192)
store double %197, double* %34
%198 = load i32, i32* %13
%199 = icmp eq i32 %198, 1
br i1 %199, label %200, label %245
200: ; preds = %85
%201 = load double, double* %15
%202 = fneg double %201
%203 = load double, double* %21
%204 = load double, double* %19
%205 = fsub double %203, %204
%206 = load double, double* %18
%207 = fmul double %205, %206
%208 = call double @exp(double %207)
%209 = fmul double %202, %208
%210 = load double, double* %28
%211 = load double, double* %32
%212 = load double, double* %35
%213 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %210, double %211, double %212)
%214 = sitofp i32 %213 to double
%215 = load double, double* %14
%216 = load double, double* %20
%217 = load double, double* %19
%218 = fsub double %216, %217
%219 = load double, double* %18
%220 = fmul double %218, %219
%221 = call double @exp(double %220)
%222 = fmul double %215, %221
%223 = load double, double* %27
%224 = load double, double* %31
%225 = load double, double* %35
%226 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %223, double %224, double %225)
%227 = sitofp i32 %226 to double
%228 = fmul double %222, %227
%229 = call double @llvm.fmuladd.f64(double %209, double %214, double %228)
%230 = load double, double* %16
%231 = load double, double* %15
%232 = fmul double %230, %231
%233 = load double, double* %21
%234 = load double, double* %19
%235 = fsub double %233, %234
%236 = load double, double* %17
%237 = fmul double %235, %236
%238 = call double @exp(double %237)
%239 = fmul double %232, %238
%240 = load double, double* %28
%241 = call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %240)
%242 = sitofp i32 %241 to double
%243 = fneg double %239
%244 = call double @llvm.fmuladd.f64(double %243, double %242, double %229)
store double %244, double* %25
br label %395
245: ; preds = %85
%246 = load i32, i32* %13
%247 = icmp eq i32 %246, 2
br i1 %247, label %248, label %294
248: ; preds = %245
%249 = load double, double* %15
%250 = load double, double* %21
%251 = load double, double* %19
%252 = fsub double %250, %251
%253 = load double, double* %18
%254 = fmul double %252, %253
%255 = call double @exp(double %254)
%256 = fmul double %249, %255
%257 = load double, double* %29
%258 = load double, double* %32
%259 = load double, double* %35
%260 = fneg double %259
%261 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %257, double %258, double %260)
%262 = sitofp i32 %261 to double
%263 = load double, double* %14
%264 = load double, double* %20
%265 = load double, double* %19
%266 = fsub double %264, %265
%267 = load double, double* %18
%268 = fmul double %266, %267
%269 = call double @exp(double %268)
%270 = fmul double %263, %269
%271 = load double, double* %30
%272 = load double, double* %31
%273 = load double, double* %35
%274 = fneg double %273
%275 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %271, double %272, double %274)
%276 = sitofp i32 %275 to double
%277 = fmul double %270, %276
%278 = fneg double %277
%279 = call double @llvm.fmuladd.f64(double %256, double %262, double %278)
%280 = load double, double* %16
%281 = load double, double* %15
%282 = fmul double %280, %281
%283 = load double, double* %21
%284 = load double, double* %19
%285 = fsub double %283, %284
%286 = load double, double* %17
%287 = fmul double %285, %286
%288 = call double @exp(double %287)
%289 = fmul double %282, %288
%290 = load double, double* %29
%291 = call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %290)
%292 = sitofp i32 %291 to double
%293 = call double @llvm.fmuladd.f64(double %289, double %292, double %279)
store double %293, double* %25
br label %394
294: ; preds = %245
%295 = load i32, i32* %13
%296 = icmp eq i32 %295, 3
br i1 %296, label %297, label %342
297: ; preds = %294
%298 = load double, double* %15
%299 = load double, double* %21
%300 = load double, double* %19
%301 = fsub double %299, %300
%302 = load double, double* %18
%303 = fmul double %301, %302
%304 = call double @exp(double %303)
%305 = fmul double %298, %304
%306 = load double, double* %29
%307 = load double, double* %33
%308 = load double, double* %35
%309 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %306, double %307, double %308)
%310 = sitofp i32 %309 to double
%311 = load double, double* %14
%312 = load double, double* %20
%313 = load double, double* %19
%314 = fsub double %312, %313
%315 = load double, double* %18
%316 = fmul double %314, %315
%317 = call double @exp(double %316)
%318 = fmul double %311, %317
%319 = load double, double* %30
%320 = load double, double* %34
%321 = load double, double* %35
%322 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %319, double %320, double %321)
%323 = sitofp i32 %322 to double
%324 = fmul double %318, %323
%325 = fneg double %324
%326 = call double @llvm.fmuladd.f64(double %305, double %310, double %325)
%327 = load double, double* %16
%328 = load double, double* %15
%329 = fmul double %327, %328
%330 = load double, double* %21
%331 = load double, double* %19
%332 = fsub double %330, %331
%333 = load double, double* %17
%334 = fmul double %332, %333
%335 = call double @exp(double %334)
%336 = fmul double %329, %335
%337 = load double, double* %29
%338 = call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %337)
%339 = sitofp i32 %338 to double
%340 = fneg double %336
%341 = call double @llvm.fmuladd.f64(double %340, double %339, double %326)
store double %341, double* %25
br label %393
342: ; preds = %294
%343 = load i32, i32* %13
%344 = icmp eq i32 %343, 4
br i1 %344, label %345, label %391
345: ; preds = %342
%346 = load double, double* %15
%347 = fneg double %346
%348 = load double, double* %21
%349 = load double, double* %19
%350 = fsub double %348, %349
%351 = load double, double* %18
%352 = fmul double %350, %351
%353 = call double @exp(double %352)
%354 = fmul double %347, %353
%355 = load double, double* %28
%356 = load double, double* %33
%357 = load double, double* %35
%358 = fneg double %357
%359 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %355, double %356, double %358)
%360 = sitofp i32 %359 to double
%361 = load double, double* %14
%362 = load double, double* %20
%363 = load double, double* %19
%364 = fsub double %362, %363
%365 = load double, double* %18
%366 = fmul double %364, %365
%367 = call double @exp(double %366)
%368 = fmul double %361, %367
%369 = load double, double* %27
%370 = load double, double* %34
%371 = load double, double* %35
%372 = fneg double %371
%373 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %369, double %370, double %372)
%374 = sitofp i32 %373 to double
%375 = fmul double %368, %374
%376 = call double @llvm.fmuladd.f64(double %354, double %360, double %375)
%377 = load double, double* %16
%378 = load double, double* %15
%379 = fmul double %377, %378
%380 = load double, double* %21
%381 = load double, double* %19
%382 = fsub double %380, %381
%383 = load double, double* %17
%384 = fmul double %382, %383
%385 = call double @exp(double %384)
%386 = fmul double %379, %385
%387 = load double, double* %28
%388 = call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %387)
%389 = sitofp i32 %388 to double
%390 = call double @llvm.fmuladd.f64(double %386, double %389, double %376)
store double %390, double* %25
br label %392
391: ; preds = %342
unreachable
392: ; preds = %345
br label %393
393: ; preds = %392, %297
br label %394
394: ; preds = %393, %248
br label %395
395: ; preds = %394, %200
%396 = load double, double* %25
ret double %396
}

LLVM IR (-O2):
define double @ExchangeExchangeOption(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
%13 = fdiv double %4, %5
%14 = tail call double @sqrt(double %13)
%15 = fmul double %10, %10
%16 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %15)
%17 = fmul double %11, -2.000000e+00
%18 = fmul double %17, %9
%19 = tail call double @llvm.fmuladd.f64(double %18, double %10, double %16)
%20 = tail call double @sqrt(double %19)
%21 = fsub double %7, %6
%22 = fsub double %5, %4
%23 = fmul double %22, %21
%24 = tail call double @exp(double %23)
%25 = fmul double %24, %1
%26 = fsub double %8, %6
%27 = fmul double %22, %26
%28 = tail call double @exp(double %27)
%29 = fmul double %28, %2
%30 = fdiv double %25, %29
%31 = add i32 %0, -1
%32 = icmp ult i32 %31, 2
%33 = select i1 %32, i32 1, i32 2
%34 = tail call i32 (i32, double, double, double, double, double, ...) bitcast (i32 (...)* @CriticalPrice to i32 (i32, double, double, double, double, double, ...)*)(i32 %33, double %30, double %4, double %5, double %20, double %3)
%35 = sitofp i32 %34 to double
%36 = fmul double %35, %2
%37 = fdiv double %1, %36
%38 = tail call double @log(double %37)
%39 = fsub double %7, %8
%40 = fmul double %20, %20
%41 = fmul double %40, 5.000000e-01
%42 = fadd double %39, %41
%43 = tail call double @llvm.fmuladd.f64(double %42, double %4, double %38)
%44 = tail call double @sqrt(double %4)
%45 = fmul double %20, %44
%46 = fdiv double %43, %45
%47 = tail call double @sqrt(double %4)
%48 = fneg double %20
%49 = tail call double @llvm.fmuladd.f64(double %48, double %47, double %46)
%50 = fdiv double %36, %1
%51 = tail call double @log(double %50)
%52 = fsub double %8, %7
%53 = fadd double %52, %41
%54 = tail call double @llvm.fmuladd.f64(double %53, double %4, double %51)
%55 = tail call double @sqrt(double %4)
%56 = fmul double %20, %55
%57 = fdiv double %54, %56
%58 = tail call double @sqrt(double %4)
%59 = tail call double @llvm.fmuladd.f64(double %48, double %58, double %57)
%60 = fdiv double %1, %2
%61 = tail call double @log(double %60)
%62 = tail call double @llvm.fmuladd.f64(double %42, double %5, double %61)
%63 = tail call double @sqrt(double %5)
%64 = fmul double %20, %63
%65 = fdiv double %62, %64
%66 = tail call double @sqrt(double %5)
%67 = tail call double @llvm.fmuladd.f64(double %48, double %66, double %65)
%68 = fdiv double %2, %1
%69 = tail call double @log(double %68)
%70 = tail call double @llvm.fmuladd.f64(double %53, double %5, double %69)
%71 = tail call double @sqrt(double %5)
%72 = fmul double %20, %71
%73 = fdiv double %70, %72
%74 = tail call double @sqrt(double %5)
%75 = tail call double @llvm.fmuladd.f64(double %48, double %74, double %73)
switch i32 %0, label %164 [
i32 1, label %76
i32 2, label %98
i32 3, label %120
i32 4, label %142
]
76: ; preds = %12
%77 = fneg double %2
%78 = fmul double %26, %5
%79 = tail call double @exp(double %78)
%80 = fmul double %79, %77
%81 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %49, double %67, double %14)
%82 = sitofp i32 %81 to double
%83 = fmul double %21, %5
%84 = tail call double @exp(double %83)
%85 = fmul double %84, %1
%86 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %46, double %65, double %14)
%87 = sitofp i32 %86 to double
%88 = fmul double %85, %87
%89 = tail call double @llvm.fmuladd.f64(double %80, double %82, double %88)
%90 = fmul double %26, %4
%91 = tail call double @exp(double %90)
%92 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %49)
%93 = sitofp i32 %92 to double
%94 = fneg double %3
%95 = fmul double %94, %2
%96 = fmul double %95, %91
%97 = tail call double @llvm.fmuladd.f64(double %96, double %93, double %89)
br label %165
98: ; preds = %12
%99 = fmul double %26, %5
%100 = tail call double @exp(double %99)
%101 = fmul double %100, %2
%102 = fneg double %14
%103 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %57, double %67, double %102)
%104 = sitofp i32 %103 to double
%105 = fmul double %21, %5
%106 = tail call double @exp(double %105)
%107 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %59, double %65, double %102)
%108 = sitofp i32 %107 to double
%109 = fneg double %106
%110 = fmul double %109, %1
%111 = fmul double %110, %108
%112 = tail call double @llvm.fmuladd.f64(double %101, double %104, double %111)
%113 = fmul double %2, %3
%114 = fmul double %26, %4
%115 = tail call double @exp(double %114)
%116 = fmul double %113, %115
%117 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %57)
%118 = sitofp i32 %117 to double
%119 = tail call double @llvm.fmuladd.f64(double %116, double %118, double %112)
br label %165
120: ; preds = %12
%121 = fmul double %26, %5
%122 = tail call double @exp(double %121)
%123 = fmul double %122, %2
%124 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %57, double %73, double %14)
%125 = sitofp i32 %124 to double
%126 = fmul double %21, %5
%127 = tail call double @exp(double %126)
%128 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %59, double %75, double %14)
%129 = sitofp i32 %128 to double
%130 = fneg double %127
%131 = fmul double %130, %1
%132 = fmul double %131, %129
%133 = tail call double @llvm.fmuladd.f64(double %123, double %125, double %132)
%134 = fmul double %26, %4
%135 = tail call double @exp(double %134)
%136 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %57)
%137 = sitofp i32 %136 to double
%138 = fneg double %3
%139 = fmul double %138, %2
%140 = fmul double %139, %135
%141 = tail call double @llvm.fmuladd.f64(double %140, double %137, double %133)
br label %165
142: ; preds = %12
%143 = fneg double %2
%144 = fmul double %26, %5
%145 = tail call double @exp(double %144)
%146 = fmul double %145, %143
%147 = fneg double %14
%148 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %49, double %73, double %147)
%149 = sitofp i32 %148 to double
%150 = fmul double %21, %5
%151 = tail call double @exp(double %150)
%152 = fmul double %151, %1
%153 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cbnd to i32 (double, double, double, ...)*)(double %46, double %75, double %147)
%154 = sitofp i32 %153 to double
%155 = fmul double %152, %154
%156 = tail call double @llvm.fmuladd.f64(double %146, double %149, double %155)
%157 = fmul double %2, %3
%158 = fmul double %26, %4
%159 = tail call double @exp(double %158)
%160 = fmul double %157, %159
%161 = tail call i32 (double, ...) bitcast (i32 (...)* @cnd to i32 (double, ...)*)(double %49)
%162 = sitofp i32 %161 to double
%163 = tail call double @llvm.fmuladd.f64(double %160, double %162, double %156)
br label %165
164: ; preds = %12
tail call void @abort()
unreachable
165: ; preds = %98, %142, %120, %76
%166 = phi double [ %97, %76 ], [ %119, %98 ], [ %141, %120 ], [ %163, %142 ]
ret double %166
}