#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*/ abort();
scalar_t__ abs(int);
int /*<<< orphan*/ assert(int);
double *calloc(int, int);
int exp(double const);
double fmax(double, double);
int /*<<< orphan*/ free(double *);
double pow(double, double);
double sqrt(double);
extern double ConvertibleBond(int EuropeanOption, double S, double X, double T2,
                              double t1, double r, double k, double q, double v,
                              double F, double Coupon, int n) {
  double result, CRatio, dt, u, d, p, StockPrice, Time, CouponTime;
  double CouponValue;
  int i, j, CouponPayment;
  double *OptionValue;
  double *convprob;
  assert(((S) == (S)) && (S) >= 0.000001 && (S) <= 1000000000000.0);
  assert(((X) == (X)) && (X) >= 0.000001 && (X) <= 1000000000000.0);
  assert(((r) == (r)) && (r) >= 0.0 && (r) <= 1000.0);
  assert(((v) == (v)) && (v) >= 0.0000001 && v <= 100.99999);
  assert(n > 0);
  if ((OptionValue = calloc(n + 1, sizeof *OptionValue)) == NULL ||
      (convprob = calloc(n + 1, sizeof *convprob)) == NULL) {
    abort();
  }
  CRatio = F / X;
  dt = T2 / n;
  u = exp(v * sqrt(dt));
  d = 1.0 / u;
  p = (exp((r - q) * dt) - d) / (u - d);
  for (i = 0; i <= n; i++) {
    StockPrice = S * pow(u, (double)i) * pow(d, (double)(n - i));
    OptionValue[i] = fmax(F + Coupon, CRatio * StockPrice);
    if (OptionValue[i] == F + Coupon)
      convprob[i] = 0;
    else
      convprob[i] = 1;
  }
  Time = 0.0;
  CouponTime = T2;
  for (j = n - 1; j >= 0; j--) {
    if (CouponTime != T2 - (int)((n - j) * dt)) {
      CouponPayment = 1;
      CouponTime = T2 - (int)((n - j) * dt);
      Time = CouponTime - dt * j;
    } else {
      CouponPayment = 0;
    }
    for (i = 0; i <= j; i++) {
      const double ru = convprob[i + 1] * r + (1 - convprob[i + 1]) * (r + k);
      const double rd = convprob[i] * r + (1 - convprob[i]) * (r + k);
      StockPrice = S * pow(u, (double)i) * pow(d, (double)abs(i - j));
      if (CouponPayment == 1) {
        CouponValue =
            Coupon * (p * exp(-ru * Time) + (1 - p) * exp(-rd * Time));
      } else
        CouponValue = 0;
      if (EuropeanOption || (!EuropeanOption && dt * j <= t1)) {
        OptionValue[i] = CouponValue + p * OptionValue[i + 1] * exp(-ru * dt) +
                         (1 - p) * OptionValue[i] * exp(-rd * dt);
        convprob[i] = p * convprob[i + 1] + (1 - p) * convprob[i];
      } else if (!EuropeanOption) {
        double d1 = CRatio * (StockPrice - X) + F;
        double d2 = CouponValue + p * OptionValue[i + 1] * exp(-ru * dt) +
                    (1 - p) * OptionValue[i] * exp(-rd * dt);
        OptionValue[i] = fmax(d1, d2);
        if (OptionValue[i] == CRatio * (StockPrice - X) + F)
          convprob[i] = 1;
        else
          convprob[i] = p * convprob[i + 1] + (1 - p) * convprob[i];
      }
    }
  }
  result = OptionValue[0];
  assert(((result) == (result)));
  free(OptionValue);
  free(convprob);
  return result;
}


x86 assembly (clang, -O0):
<ConvertibleBond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
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)
mov    %esi,-0x4c(%rbp)
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0xe1(%rbp)
jne    1218 <ConvertibleBond+0x98>
jp     1218 <ConvertibleBond+0x98>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xe0e(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xe1(%rbp)
jb     1218 <ConvertibleBond+0x98>
movsd  0xdfe(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0xe1(%rbp)
mov    -0xe1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x18(%rbp),%xmm0
mov    %al,-0xe2(%rbp)
jne    127b <ConvertibleBond+0xfb>
jp     127b <ConvertibleBond+0xfb>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
movsd  0xdab(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xe2(%rbp)
jb     127b <ConvertibleBond+0xfb>
movsd  0xd9b(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0xe2(%rbp)
mov    -0xe2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x30(%rbp),%xmm0
mov    %al,-0xe3(%rbp)
jne    12d9 <ConvertibleBond+0x159>
jp     12d9 <ConvertibleBond+0x159>
movsd  -0x30(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xe3(%rbp)
jb     12d9 <ConvertibleBond+0x159>
movsd  0xd45(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
setae  %al
mov    %al,-0xe3(%rbp)
mov    -0xe3(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movsd  -0x48(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x48(%rbp),%xmm0
mov    %al,-0xe4(%rbp)
jne    133c <ConvertibleBond+0x1bc>
jp     133c <ConvertibleBond+0x1bc>
movsd  -0x48(%rbp),%xmm0
xor    %eax,%eax
movsd  0xd02(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0xe4(%rbp)
jb     133c <ConvertibleBond+0x1bc>
movsd  0xcf2(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
setae  %al
mov    %al,-0xe4(%rbp)
mov    -0xe4(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
cmpl   $0x0,-0x4c(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x4c(%rbp),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,-0xb8(%rbp)
cmp    $0x0,%rax
je     139f <ConvertibleBond+0x21f>
mov    -0x4c(%rbp),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,-0xc0(%rbp)
cmp    $0x0,%rax
jne    13a6 <ConvertibleBond+0x226>
mov    $0x0,%al
call   1040 <abort@plt>
movsd  0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x4c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1080 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xc24(%rip),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1080 <exp@plt>
cvtsi2sd %eax,%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
subsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jg     157f <ConvertibleBond+0x3ff>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
cvtsi2sdl -0xa4(%rbp),%xmm1
ff
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mov    -0x4c(%rbp),%eax
sub    -0xa4(%rbp),%eax
cvtsi2sd %eax,%xmm1
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0x10(%rbp),%xmm3
addsd  0x18(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm2
mulsd  -0x88(%rbp),%xmm2
ff
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0xb8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xb8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0x10(%rbp),%xmm1
addsd  0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    154b <ConvertibleBond+0x3cb>
jp     154b <ConvertibleBond+0x3cb>
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1566 <ConvertibleBond+0x3e6>
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  0xac7(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    156b <ConvertibleBond+0x3eb>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1448 <ConvertibleBond+0x2c8>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x4c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa8(%rbp)
cmpl   $0x0,-0xa8(%rbp)
jl     1c93 <ConvertibleBond+0xb13>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x20(%rbp),%xmm1
mov    -0x4c(%rbp),%eax
sub    -0xa8(%rbp),%eax
cvtsi2sd %eax,%xmm2
mulsd  -0x68(%rbp),%xmm2
cvttsd2si %xmm2,%eax
cvtsi2sd %eax,%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    15f0 <ConvertibleBond+0x470>
jp     15f0 <ConvertibleBond+0x470>
jmp    1666 <ConvertibleBond+0x4e6>
movl   $0x1,-0xac(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x4c(%rbp),%eax
sub    -0xa8(%rbp),%eax
cvtsi2sd %eax,%xmm1
mulsd  -0x68(%rbp),%xmm1
cvttsd2si %xmm1,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x68(%rbp),%xmm0
cvtsi2sdl -0xa8(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    1670 <ConvertibleBond+0x4f0>
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xa8(%rbp),%eax
jg     1c7a <ConvertibleBond+0xafa>
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x964(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
movsd  -0x30(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  0x913(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
movsd  -0x30(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
cvtsi2sdl -0xa4(%rbp),%xmm1
ff
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0xa4(%rbp),%edi
sub    -0xa8(%rbp),%edi
call   1050 <abs@plt>
movsd  -0x110(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm1
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
cmpl   $0x1,-0xac(%rbp)
jne    1896 <ConvertibleBond+0x716>
movsd  0x18(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
call   1080 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  0x80c(%rip),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
call   1080 <exp@plt>
movsd  -0x138(%rbp),%xmm2
ff
movsd  -0x130(%rbp),%xmm1
ff
movsd  -0x128(%rbp),%xmm3
ff
movsd  -0x120(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm4
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    18a1 <ConvertibleBond+0x721>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
cmpl   $0x0,-0x4(%rbp)
jne    18d5 <ConvertibleBond+0x755>
cmpl   $0x0,-0x4(%rbp)
jne    1a34 <ConvertibleBond+0x8b4>
movsd  -0x68(%rbp),%xmm1
cvtsi2sdl -0xa8(%rbp),%xmm0
ff
mulsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1a34 <ConvertibleBond+0x8b4>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1080 <exp@plt>
movsd  -0x158(%rbp),%xmm0
ff
movsd  -0x150(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  0x6c9(%rip),%xmm0
subsd  -0x80(%rbp),%xmm0
mov    -0xb8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1080 <exp@plt>
movsd  -0x148(%rbp),%xmm0
ff
movsd  -0x140(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xb8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  0x62c(%rip),%xmm1
subsd  -0x80(%rbp),%xmm1
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1c61 <ConvertibleBond+0xae1>
cmpl   $0x0,-0x4(%rbp)
jne    1c5c <ConvertibleBond+0xadc>
movsd  -0x60(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
subsd  -0x18(%rbp),%xmm2
movsd  0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1080 <exp@plt>
movsd  -0x178(%rbp),%xmm0
ff
movsd  -0x170(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  0x539(%rip),%xmm0
subsd  -0x80(%rbp),%xmm0
mov    -0xb8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1080 <exp@plt>
movsd  -0x168(%rbp),%xmm0
ff
movsd  -0x160(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xd8(%rbp),%xmm3
ff
movsd  -0xe0(%rbp),%xmm2
ff
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0xb8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xb8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm3
ff
subsd  -0x18(%rbp),%xmm3
movsd  0x10(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    1bff <ConvertibleBond+0xa7f>
jp     1bff <ConvertibleBond+0xa7f>
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  0x433(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1c57 <ConvertibleBond+0xad7>
movsd  -0x80(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  0x404(%rip),%xmm1
subsd  -0x80(%rbp),%xmm1
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xc0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1c5c <ConvertibleBond+0xadc>
jmp    1c61 <ConvertibleBond+0xae1>
jmp    1c66 <ConvertibleBond+0xae6>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    167a <ConvertibleBond+0x4fa>
jmp    1c7f <ConvertibleBond+0xaff>
mov    -0xa8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa8(%rbp)
jmp    15a3 <ConvertibleBond+0x423>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%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   1070 <assert@plt>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc0(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x58(%rbp),%xmm0
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertibleBond>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
ucomisd %xmm0,%xmm0
setnp  %al
ucomisd 0xe60(%rip),%xmm0
setae  %cl
and    %al,%cl
movsd  0xe5a(%rip),%xmm8
movsd  %xmm0,0x88(%rsp)
ucomisd %xmm0,%xmm8
mov    %esi,%ebx
movsd  %xmm7,0x10(%rsp)
movsd  %xmm6,0x20(%rsp)
movsd  %xmm5,0x78(%rsp)
movsd  %xmm4,0x40(%rsp)
movsd  %xmm3,0xe8(%rsp)
movsd  %xmm2,0x68(%rsp)
movsd  %xmm1,0x70(%rsp)
mov    %edi,0xac(%rsp)
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1070 <assert@plt>
movsd  0x70(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xdec(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xde7(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1070 <assert@plt>
xorpd  %xmm0,%xmm0
movsd  0x40(%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movsd  0xdc5(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1070 <assert@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm1,%xmm1
setnp  %al
ucomisd 0xda7(%rip),%xmm1
setae  %cl
and    %al,%cl
movsd  0xda2(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    %cl,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1070 <assert@plt>
mov    %rbx,0x28(%rsp)
lea    0x1(%rbx),%r12d
mov    %r12d,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
test   %rax,%rax
je     197c <ConvertibleBond+0x7fc>
mov    %rax,%rbp
mov    %r12d,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
test   %rax,%rax
je     197c <ConvertibleBond+0x7fc>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2sdl 0x28(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
movapd %xmm1,0x50(%rsp)
jb     1304 <ConvertibleBond+0x184>
sqrtsd %xmm0,%xmm0
jmp    1309 <ConvertibleBond+0x189>
call   10a0 <sqrt@plt>
movsd  0x160(%rsp),%xmm1
divsd  0x70(%rsp),%xmm1
movsd  %xmm1,0x80(%rsp)
mulsd  0x10(%rsp),%xmm0
call   1080 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xced(%rip),%xmm0
movsd  %xmm1,0x98(%rsp)
divsd  %xmm1,%xmm0
movsd  %xmm0,0x90(%rsp)
movsd  0x40(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1080 <exp@plt>
mov    %eax,%r13d
cmpl   $0x0,0x28(%rsp)
js     144c <ConvertibleBond+0x2cc>
movsd  0x160(%rsp),%xmm0
addsd  0x168(%rsp),%xmm0
mov    %r12d,%r14d
xor    %r15d,%r15d
movsd  %xmm0,0x20(%rsp)
cmpunordsd %xmm0,%xmm0
movapd %xmm0,0xb0(%rsp)
mov    0x28(%rsp),%rax
mov    %eax,%r12d
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
movsd  0x98(%rsp),%xmm0
call   1090 <pow@plt>
mulsd  0x88(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
movsd  0x90(%rsp),%xmm0
call   1090 <pow@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0x80(%rsp),%xmm0
movapd 0xb0(%rsp),%xmm2
movapd %xmm2,%xmm1
andpd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm3
maxsd  %xmm3,%xmm0
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movlpd %xmm2,0x0(%rbp,%r15,8)
cmpeqsd %xmm3,%xmm2
movsd  0xbf7(%rip),%xmm0
andnpd %xmm0,%xmm2
movlpd %xmm2,(%rbx,%r15,8)
add    $0x1,%r15
add    $0xffffffff,%r12d
cmp    %r15,%r14
jne    13b0 <ConvertibleBond+0x230>
cmpl   $0x0,0x28(%rsp)
movsd  0x98(%rsp),%xmm2
movsd  0x90(%rsp),%xmm1
jle    193a <ConvertibleBond+0x7ba>
xorps  %xmm3,%xmm3
cvtsi2sd %r13d,%xmm3
subsd  %xmm1,%xmm3
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
divsd  %xmm0,%xmm3
movaps 0xba8(%rip),%xmm0
xorps  0x50(%rsp),%xmm0
movaps %xmm0,0x110(%rsp)
movsd  0x78(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
movsd  0xb79(%rip),%xmm0
movsd  %xmm3,0x38(%rsp)
subsd  %xmm3,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    0x28(%rsp),%rax
mov    %eax,%r13d
mov    $0x1,%r15d
sub    %eax,%r15d
xorpd  %xmm0,%xmm0
movsd  0x68(%rsp),%xmm3
jmp    1505 <ConvertibleBond+0x385>
nopl   0x0(%rax)
add    $0x1,%r15
movsd  0x48(%rsp),%xmm0
movsd  0xf0(%rsp),%xmm3
cmp    $0x2,%r13
mov    0xf8(%rsp),%r13
jl     193a <ConvertibleBond+0x7ba>
cmpl   $0x0,0xac(%rsp)
sete   0xf(%rsp)
lea    -0x1(%r13),%rcx
mov    0x28(%rsp),%rax
sub    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x50(%rsp),%xmm1
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
movsd  0x68(%rsp),%xmm4
subsd  %xmm1,%xmm4
ucomisd %xmm4,%xmm3
movapd %xmm4,%xmm1
jne    1550 <ConvertibleBond+0x3d0>
movapd %xmm4,%xmm1
jp     1550 <ConvertibleBond+0x3d0>
movapd %xmm3,%xmm1
movsd  %xmm1,0xf0(%rsp)
movsd  %xmm3,0x108(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
movapd 0x110(%rsp),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x48(%rsp)
mov    %rcx,0xf8(%rsp)
movsd  %xmm4,0x100(%rsp)
jne    159b <ConvertibleBond+0x41b>
jp     159b <ConvertibleBond+0x41b>
movsd  %xmm0,0x48(%rsp)
mulsd  0x50(%rsp),%xmm1
movsd  0xe8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
setb   %al
and    %al,0xf(%rsp)
movsd  (%rbx),%xmm1
xor    %r12d,%r12d
jmp    16a0 <ConvertibleBond+0x520>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rbp,%r14,8),%xmm0
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movapd 0xa45(%rip),%xmm1
movapd 0xc0(%rsp),%xmm0
xorpd  %xmm1,%xmm0
mulsd  0x50(%rsp),%xmm0
call   1080 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%rbp,%r14,8),%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movapd 0xd0(%rsp),%xmm0
xorpd  0x9f0(%rip),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1080 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%r14,8)
movsd  0xb0(%rsp),%xmm2
mulsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx,%r14,8)
cmp    %r12,%r13
movsd  0x98(%rsp),%xmm2
je     14e0 <ConvertibleBond+0x360>
mov    %r12,%r14
movsd  %xmm1,0xb0(%rsp)
movsd  0x8(%rbx,%r12,8),%xmm0
movsd  %xmm0,0x20(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
movapd %xmm2,%xmm0
call   1090 <pow@plt>
movsd  %xmm0,0x18(%rsp)
lea    (%r15,%r12,1),%edi
call   1050 <abs@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  0x90(%rsp),%xmm0
call   1090 <pow@plt>
movapd %xmm0,%xmm5
movsd  0x108(%rsp),%xmm0
ucomisd 0x100(%rsp),%xmm0
movsd  0x91b(%rip),%xmm3
movapd %xmm3,%xmm0
movsd  0x20(%rsp),%xmm4
subsd  %xmm4,%xmm0
movsd  0x78(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x40(%rsp),%xmm2
mulsd  %xmm2,%xmm4
addsd  %xmm0,%xmm4
movapd %xmm3,%xmm0
movsd  0xb0(%rsp),%xmm3
subsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm3,0xd0(%rsp)
movapd %xmm4,0xc0(%rsp)
jne    176a <ConvertibleBond+0x5ea>
jnp    17f0 <ConvertibleBond+0x670>
movapd %xmm4,%xmm0
movapd 0x8ba(%rip),%xmm1
xorpd  %xmm1,%xmm0
mulsd  0x48(%rsp),%xmm0
movsd  %xmm5,0xa0(%rsp)
call   1080 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd 0xd0(%rsp),%xmm0
xorpd  0x884(%rip),%xmm0
mulsd  0x48(%rsp),%xmm0
call   1080 <exp@plt>
movsd  0xa0(%rsp),%xmm5
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  0x168(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
jmp    17fa <ConvertibleBond+0x67a>
xchg   %ax,%ax
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x88(%rsp),%xmm0
movsd  0x80(%rsp),%xmm1
lea    0x1(%r14),%r12
cmpb   $0x0,0xf(%rsp)
je     15d0 <ConvertibleBond+0x450>
movsd  0x18(%rsp),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm5,%xmm2
subsd  0x70(%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x160(%rsp),%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0x8(%rbp,%r14,8),%xmm0
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0xa0(%rsp)
movapd 0x7d0(%rip),%xmm1
movapd 0xc0(%rsp),%xmm0
xorpd  %xmm1,%xmm0
mulsd  0x50(%rsp),%xmm0
call   1080 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xa0(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%rbp,%r14,8),%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0xc0(%rsp)
movapd 0xd0(%rsp),%xmm0
xorpd  0x775(%rip),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1080 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xc0(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm3
movapd %xmm3,%xmm1
cmpunordsd %xmm3,%xmm1
movapd %xmm1,%xmm2
andpd  %xmm0,%xmm2
maxsd  %xmm3,%xmm0
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movlpd %xmm1,0x0(%rbp,%r14,8)
ucomisd %xmm3,%xmm1
movsd  0x716(%rip),%xmm0
movsd  0x20(%rsp),%xmm1
jne    1920 <ConvertibleBond+0x7a0>
jnp    1688 <ConvertibleBond+0x508>
movsd  0xb0(%rsp),%xmm2
mulsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm0
jmp    1680 <ConvertibleBond+0x500>
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
call   1070 <assert@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  0x10(%rsp),%xmm0
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define double @ConvertibleBond(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, i32 %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 i32
%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 i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca double*
%39 = alloca double*
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
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 i32 %11, i32* %24
%44 = load double, double* %14
%45 = load double, double* %14
%46 = fcmp oeq double %44, %45
br i1 %46, label %47, label %53
47: ; preds = %12
%48 = load double, double* %14
%49 = fcmp oge double %48, 0x3EB0C6F7A0B5ED8D
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load double, double* %14
%52 = fcmp ole double %51, 1.000000e+12
br label %53
53: ; preds = %50, %47, %12
%54 = phi i1 [ false, %47 ], [ false, %12 ], [ %52, %50 ]
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = load double, double* %15
%58 = load double, double* %15
%59 = fcmp oeq double %57, %58
br i1 %59, label %60, label %66
60: ; preds = %53
%61 = load double, double* %15
%62 = fcmp oge double %61, 0x3EB0C6F7A0B5ED8D
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load double, double* %15
%65 = fcmp ole double %64, 1.000000e+12
br label %66
66: ; preds = %63, %60, %53
%67 = phi i1 [ false, %60 ], [ false, %53 ], [ %65, %63 ]
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = load double, double* %18
%71 = load double, double* %18
%72 = fcmp oeq double %70, %71
br i1 %72, label %73, label %79
73: ; preds = %66
%74 = load double, double* %18
%75 = fcmp oge double %74, 0.000000e+00
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load double, double* %18
%78 = fcmp ole double %77, 1.000000e+03
br label %79
79: ; preds = %76, %73, %66
%80 = phi i1 [ false, %73 ], [ false, %66 ], [ %78, %76 ]
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = load double, double* %21
%84 = load double, double* %21
%85 = fcmp oeq double %83, %84
br i1 %85, label %86, label %92
86: ; preds = %79
%87 = load double, double* %21
%88 = fcmp oge double %87, 0x3E7AD7F29ABCAF48
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = load double, double* %21
%91 = fcmp ole double %90, 0x40593FFFD60E94EE
br label %92
92: ; preds = %89, %86, %79
%93 = phi i1 [ false, %86 ], [ false, %79 ], [ %91, %89 ]
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = load i32, i32* %24
%97 = icmp sgt i32 %96, 0
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
%100 = load i32, i32* %24
%101 = add nsw i32 %100, 1
%102 = call double* @calloc(i32 %101, i32 8)
store double* %102, double** %38
%103 = icmp eq double* %102, null
br i1 %103, label %109, label %104
104: ; preds = %92
%105 = load i32, i32* %24
%106 = add nsw i32 %105, 1
%107 = call double* @calloc(i32 %106, i32 8)
store double* %107, double** %39
%108 = icmp eq double* %107, null
br i1 %108, label %109, label %111
109: ; preds = %104, %92
%110 = call i32 (...) @abort()
unreachable
111: ; preds = %104
%112 = load double, double* %22
%113 = load double, double* %15
%114 = fdiv double %112, %113
store double %114, double* %26
%115 = load double, double* %16
%116 = load i32, i32* %24
%117 = sitofp i32 %116 to double
%118 = fdiv double %115, %117
store double %118, double* %27
%119 = load double, double* %21
%120 = load double, double* %27
%121 = call double @sqrt(double %120)
%122 = fmul double %119, %121
%123 = call i32 @exp(double %122)
%124 = sitofp i32 %123 to double
store double %124, double* %28
%125 = load double, double* %28
%126 = fdiv double 1.000000e+00, %125
store double %126, double* %29
%127 = load double, double* %18
%128 = load double, double* %20
%129 = fsub double %127, %128
%130 = load double, double* %27
%131 = fmul double %129, %130
%132 = call i32 @exp(double %131)
%133 = sitofp i32 %132 to double
%134 = load double, double* %29
%135 = fsub double %133, %134
%136 = load double, double* %28
%137 = load double, double* %29
%138 = fsub double %136, %137
%139 = fdiv double %135, %138
store double %139, double* %30
store i32 0, i32* %35
br label %140
140: ; preds = %189, %111
%141 = load i32, i32* %35
%142 = load i32, i32* %24
%143 = icmp sle i32 %141, %142
br i1 %143, label %144, label %192
144: ; preds = %140
%145 = load double, double* %14
%146 = load double, double* %28
%147 = load i32, i32* %35
%148 = sitofp i32 %147 to double
%149 = call double @pow(double %146, double %148)
%150 = fmul double %145, %149
%151 = load double, double* %29
%152 = load i32, i32* %24
%153 = load i32, i32* %35
%154 = sub nsw i32 %152, %153
%155 = sitofp i32 %154 to double
%156 = call double @pow(double %151, double %155)
%157 = fmul double %150, %156
store double %157, double* %31
%158 = load double, double* %22
%159 = load double, double* %23
%160 = fadd double %158, %159
%161 = load double, double* %26
%162 = load double, double* %31
%163 = fmul double %161, %162
%164 = call double @llvm.maxnum.f64(double %160, double %163)
%165 = load double*, double** %38
%166 = load i32, i32* %35
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
store double %164, double* %168
%169 = load double*, double** %38
%170 = load i32, i32* %35
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds double, double* %169, i64 %171
%173 = load double, double* %172
%174 = load double, double* %22
%175 = load double, double* %23
%176 = fadd double %174, %175
%177 = fcmp oeq double %173, %176
br i1 %177, label %178, label %183
178: ; preds = %144
%179 = load double*, double** %39
%180 = load i32, i32* %35
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds double, double* %179, i64 %181
store double 0.000000e+00, double* %182
br label %188
183: ; preds = %144
%184 = load double*, double** %39
%185 = load i32, i32* %35
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %184, i64 %186
store double 1.000000e+00, double* %187
br label %188
188: ; preds = %183, %178
br label %189
189: ; preds = %188
%190 = load i32, i32* %35
%191 = add nsw i32 %190, 1
store i32 %191, i32* %35
br label %140
192: ; preds = %140
store double 0.000000e+00, double* %32
%193 = load double, double* %16
store double %193, double* %33
%194 = load i32, i32* %24
%195 = sub nsw i32 %194, 1
store i32 %195, i32* %36
br label %196
196: ; preds = %471, %192
%197 = load i32, i32* %36
%198 = icmp sge i32 %197, 0
br i1 %198, label %199, label %474
199: ; preds = %196
%200 = load double, double* %33
%201 = load double, double* %16
%202 = load i32, i32* %24
%203 = load i32, i32* %36
%204 = sub nsw i32 %202, %203
%205 = sitofp i32 %204 to double
%206 = load double, double* %27
%207 = fmul double %205, %206
%208 = fptosi double %207 to i32
%209 = sitofp i32 %208 to double
%210 = fsub double %201, %209
%211 = fcmp une double %200, %210
br i1 %211, label %212, label %229
212: ; preds = %199
store i32 1, i32* %37
%213 = load double, double* %16
%214 = load i32, i32* %24
%215 = load i32, i32* %36
%216 = sub nsw i32 %214, %215
%217 = sitofp i32 %216 to double
%218 = load double, double* %27
%219 = fmul double %217, %218
%220 = fptosi double %219 to i32
%221 = sitofp i32 %220 to double
%222 = fsub double %213, %221
store double %222, double* %33
%223 = load double, double* %33
%224 = load double, double* %27
%225 = load i32, i32* %36
%226 = sitofp i32 %225 to double
%227 = fneg double %224
%228 = call double @llvm.fmuladd.f64(double %227, double %226, double %223)
store double %228, double* %32
br label %230
229: ; preds = %199
store i32 0, i32* %37
br label %230
230: ; preds = %229, %212
store i32 0, i32* %35
br label %231
231: ; preds = %467, %230
%232 = load i32, i32* %35
%233 = load i32, i32* %36
%234 = icmp sle i32 %232, %233
br i1 %234, label %235, label %470
235: ; preds = %231
%236 = load double*, double** %39
%237 = load i32, i32* %35
%238 = add nsw i32 %237, 1
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds double, double* %236, i64 %239
%241 = load double, double* %240
%242 = load double, double* %18
%243 = load double*, double** %39
%244 = load i32, i32* %35
%245 = add nsw i32 %244, 1
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds double, double* %243, i64 %246
%248 = load double, double* %247
%249 = fsub double 1.000000e+00, %248
%250 = load double, double* %18
%251 = load double, double* %19
%252 = fadd double %250, %251
%253 = fmul double %249, %252
%254 = call double @llvm.fmuladd.f64(double %241, double %242, double %253)
store double %254, double* %40
%255 = load double*, double** %39
%256 = load i32, i32* %35
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double, double* %255, i64 %257
%259 = load double, double* %258
%260 = load double, double* %18
%261 = load double*, double** %39
%262 = load i32, i32* %35
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds double, double* %261, i64 %263
%265 = load double, double* %264
%266 = fsub double 1.000000e+00, %265
%267 = load double, double* %18
%268 = load double, double* %19
%269 = fadd double %267, %268
%270 = fmul double %266, %269
%271 = call double @llvm.fmuladd.f64(double %259, double %260, double %270)
store double %271, double* %41
%272 = load double, double* %14
%273 = load double, double* %28
%274 = load i32, i32* %35
%275 = sitofp i32 %274 to double
%276 = call double @pow(double %273, double %275)
%277 = fmul double %272, %276
%278 = load double, double* %29
%279 = load i32, i32* %35
%280 = load i32, i32* %36
%281 = sub nsw i32 %279, %280
%282 = call i64 @abs(i32 %281)
%283 = sitofp i64 %282 to double
%284 = call double @pow(double %278, double %283)
%285 = fmul double %277, %284
store double %285, double* %31
%286 = load i32, i32* %37
%287 = icmp eq i32 %286, 1
br i1 %287, label %288, label %308
288: ; preds = %235
%289 = load double, double* %23
%290 = load double, double* %30
%291 = load double, double* %40
%292 = fneg double %291
%293 = load double, double* %32
%294 = fmul double %292, %293
%295 = call i32 @exp(double %294)
%296 = sitofp i32 %295 to double
%297 = load double, double* %30
%298 = fsub double 1.000000e+00, %297
%299 = load double, double* %41
%300 = fneg double %299
%301 = load double, double* %32
%302 = fmul double %300, %301
%303 = call i32 @exp(double %302)
%304 = sitofp i32 %303 to double
%305 = fmul double %298, %304
%306 = call double @llvm.fmuladd.f64(double %290, double %296, double %305)
%307 = fmul double %289, %306
store double %307, double* %34
br label %309
308: ; preds = %235
store double 0.000000e+00, double* %34
br label %309
309: ; preds = %308, %288
%310 = load i32, i32* %13
%311 = icmp ne i32 %310, 0
br i1 %311, label %322, label %312
312: ; preds = %309
%313 = load i32, i32* %13
%314 = icmp ne i32 %313, 0
br i1 %314, label %378, label %315
315: ; preds = %312
%316 = load double, double* %27
%317 = load i32, i32* %36
%318 = sitofp i32 %317 to double
%319 = fmul double %316, %318
%320 = load double, double* %17
%321 = fcmp ole double %319, %320
br i1 %321, label %322, label %378
322: ; preds = %315, %309
%323 = load double, double* %34
%324 = load double, double* %30
%325 = load double*, double** %38
%326 = load i32, i32* %35
%327 = add nsw i32 %326, 1
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds double, double* %325, i64 %328
%330 = load double, double* %329
%331 = fmul double %324, %330
%332 = load double, double* %40
%333 = fneg double %332
%334 = load double, double* %27
%335 = fmul double %333, %334
%336 = call i32 @exp(double %335)
%337 = sitofp i32 %336 to double
%338 = call double @llvm.fmuladd.f64(double %331, double %337, double %323)
%339 = load double, double* %30
%340 = fsub double 1.000000e+00, %339
%341 = load double*, double** %38
%342 = load i32, i32* %35
%343 = sext i32 %342 to i64
%344 = getelementptr inbounds double, double* %341, i64 %343
%345 = load double, double* %344
%346 = fmul double %340, %345
%347 = load double, double* %41
%348 = fneg double %347
%349 = load double, double* %27
%350 = fmul double %348, %349
%351 = call i32 @exp(double %350)
%352 = sitofp i32 %351 to double
%353 = call double @llvm.fmuladd.f64(double %346, double %352, double %338)
%354 = load double*, double** %38
%355 = load i32, i32* %35
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds double, double* %354, i64 %356
store double %353, double* %357
%358 = load double, double* %30
%359 = load double*, double** %39
%360 = load i32, i32* %35
%361 = add nsw i32 %360, 1
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds double, double* %359, i64 %362
%364 = load double, double* %363
%365 = load double, double* %30
%366 = fsub double 1.000000e+00, %365
%367 = load double*, double** %39
%368 = load i32, i32* %35
%369 = sext i32 %368 to i64
%370 = getelementptr inbounds double, double* %367, i64 %369
%371 = load double, double* %370
%372 = fmul double %366, %371
%373 = call double @llvm.fmuladd.f64(double %358, double %364, double %372)
%374 = load double*, double** %39
%375 = load i32, i32* %35
%376 = sext i32 %375 to i64
%377 = getelementptr inbounds double, double* %374, i64 %376
store double %373, double* %377
br label %466
378: ; preds = %315, %312
%379 = load i32, i32* %13
%380 = icmp ne i32 %379, 0
br i1 %380, label %465, label %381
381: ; preds = %378
%382 = load double, double* %26
%383 = load double, double* %31
%384 = load double, double* %15
%385 = fsub double %383, %384
%386 = load double, double* %22
%387 = call double @llvm.fmuladd.f64(double %382, double %385, double %386)
store double %387, double* %42
%388 = load double, double* %34
%389 = load double, double* %30
%390 = load double*, double** %38
%391 = load i32, i32* %35
%392 = add nsw i32 %391, 1
%393 = sext i32 %392 to i64
%394 = getelementptr inbounds double, double* %390, i64 %393
%395 = load double, double* %394
%396 = fmul double %389, %395
%397 = load double, double* %40
%398 = fneg double %397
%399 = load double, double* %27
%400 = fmul double %398, %399
%401 = call i32 @exp(double %400)
%402 = sitofp i32 %401 to double
%403 = call double @llvm.fmuladd.f64(double %396, double %402, double %388)
%404 = load double, double* %30
%405 = fsub double 1.000000e+00, %404
%406 = load double*, double** %38
%407 = load i32, i32* %35
%408 = sext i32 %407 to i64
%409 = getelementptr inbounds double, double* %406, i64 %408
%410 = load double, double* %409
%411 = fmul double %405, %410
%412 = load double, double* %41
%413 = fneg double %412
%414 = load double, double* %27
%415 = fmul double %413, %414
%416 = call i32 @exp(double %415)
%417 = sitofp i32 %416 to double
%418 = call double @llvm.fmuladd.f64(double %411, double %417, double %403)
store double %418, double* %43
%419 = load double, double* %42
%420 = load double, double* %43
%421 = call double @llvm.maxnum.f64(double %419, double %420)
%422 = load double*, double** %38
%423 = load i32, i32* %35
%424 = sext i32 %423 to i64
%425 = getelementptr inbounds double, double* %422, i64 %424
store double %421, double* %425
%426 = load double*, double** %38
%427 = load i32, i32* %35
%428 = sext i32 %427 to i64
%429 = getelementptr inbounds double, double* %426, i64 %428
%430 = load double, double* %429
%431 = load double, double* %26
%432 = load double, double* %31
%433 = load double, double* %15
%434 = fsub double %432, %433
%435 = load double, double* %22
%436 = call double @llvm.fmuladd.f64(double %431, double %434, double %435)
%437 = fcmp oeq double %430, %436
br i1 %437, label %438, label %443
438: ; preds = %381
%439 = load double*, double** %39
%440 = load i32, i32* %35
%441 = sext i32 %440 to i64
%442 = getelementptr inbounds double, double* %439, i64 %441
store double 1.000000e+00, double* %442
br label %464
443: ; preds = %381
%444 = load double, double* %30
%445 = load double*, double** %39
%446 = load i32, i32* %35
%447 = add nsw i32 %446, 1
%448 = sext i32 %447 to i64
%449 = getelementptr inbounds double, double* %445, i64 %448
%450 = load double, double* %449
%451 = load double, double* %30
%452 = fsub double 1.000000e+00, %451
%453 = load double*, double** %39
%454 = load i32, i32* %35
%455 = sext i32 %454 to i64
%456 = getelementptr inbounds double, double* %453, i64 %455
%457 = load double, double* %456
%458 = fmul double %452, %457
%459 = call double @llvm.fmuladd.f64(double %444, double %450, double %458)
%460 = load double*, double** %39
%461 = load i32, i32* %35
%462 = sext i32 %461 to i64
%463 = getelementptr inbounds double, double* %460, i64 %462
store double %459, double* %463
br label %464
464: ; preds = %443, %438
br label %465
465: ; preds = %464, %378
br label %466
466: ; preds = %465, %322
br label %467
467: ; preds = %466
%468 = load i32, i32* %35
%469 = add nsw i32 %468, 1
store i32 %469, i32* %35
br label %231
470: ; preds = %231
br label %471
471: ; preds = %470
%472 = load i32, i32* %36
%473 = add nsw i32 %472, -1
store i32 %473, i32* %36
br label %196
474: ; preds = %196
%475 = load double*, double** %38
%476 = getelementptr inbounds double, double* %475, i64 0
%477 = load double, double* %476
store double %477, double* %25
%478 = load double, double* %25
%479 = load double, double* %25
%480 = fcmp oeq double %478, %479
%481 = zext i1 %480 to i32
%482 = call i32 @assert(i32 %481)
%483 = load double*, double** %38
%484 = call i32 @free(double* %483)
%485 = load double*, double** %39
%486 = call i32 @free(double* %485)
%487 = load double, double* %25
ret double %487
}

LLVM IR (-O2):
define double @ConvertibleBond(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, i32 %11) {
%13 = fcmp ord double %1, 0.000000e+00
%14 = fcmp oge double %1, 0x3EB0C6F7A0B5ED8D
%15 = and i1 %13, %14
%16 = fcmp ole double %1, 1.000000e+12
%17 = and i1 %16, %15
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = fcmp ord double %2, 0.000000e+00
%21 = fcmp oge double %2, 0x3EB0C6F7A0B5ED8D
%22 = and i1 %20, %21
%23 = fcmp ole double %2, 1.000000e+12
%24 = and i1 %23, %22
%25 = zext i1 %24 to i32
%26 = tail call i32 @assert(i32 %25)
%27 = fcmp oge double %5, 0.000000e+00
%28 = fcmp ole double %5, 1.000000e+03
%29 = and i1 %27, %28
%30 = zext i1 %29 to i32
%31 = tail call i32 @assert(i32 %30)
%32 = fcmp ord double %8, 0.000000e+00
%33 = fcmp oge double %8, 0x3E7AD7F29ABCAF48
%34 = and i1 %32, %33
%35 = fcmp ole double %8, 0x40593FFFD60E94EE
%36 = and i1 %35, %34
%37 = zext i1 %36 to i32
%38 = tail call i32 @assert(i32 %37)
%39 = icmp sgt i32 %11, 0
%40 = zext i1 %39 to i32
%41 = tail call i32 @assert(i32 %40)
%42 = add i32 %11, 1
%43 = tail call double* @calloc(i32 %42, i32 8)
%44 = icmp eq double* %43, null
br i1 %44, label %48, label %45
45: ; preds = %12
%46 = tail call double* @calloc(i32 %42, i32 8)
%47 = icmp eq double* %46, null
br i1 %47, label %48, label %50
48: ; preds = %45, %12
%49 = tail call i32 (...) @abort()
unreachable
50: ; preds = %45
%51 = fdiv double %9, %2
%52 = sitofp i32 %11 to double
%53 = fdiv double %3, %52
%54 = tail call double @sqrt(double %53)
%55 = fmul double %54, %8
%56 = tail call i32 @exp(double %55)
%57 = sitofp i32 %56 to double
%58 = fdiv double 1.000000e+00, %57
%59 = fsub double %5, %7
%60 = fmul double %59, %53
%61 = tail call i32 @exp(double %60)
%62 = sitofp i32 %61 to double
%63 = fsub double %62, %58
%64 = fsub double %57, %58
%65 = fdiv double %63, %64
%66 = icmp slt i32 %11, 0
br i1 %66, label %70, label %67
67: ; preds = %50
%68 = fadd double %9, %10
%69 = zext i32 %42 to i64
br label %77
70: ; preds = %77, %50
br i1 %39, label %71, label %200
71: ; preds = %70
%72 = fneg double %53
%73 = fadd double %5, %6
%74 = fsub double 1.000000e+00, %65
%75 = icmp eq i32 %0, 0
%76 = zext i32 %11 to i64
br label %97
77: ; preds = %67, %77
%78 = phi i64 [ 0, %67 ], [ %93, %77 ]
%79 = trunc i64 %78 to i32
%80 = sitofp i32 %79 to double
%81 = tail call double @pow(double %57, double %80)
%82 = fmul double %81, %1
%83 = sub nsw i32 %11, %79
%84 = sitofp i32 %83 to double
%85 = tail call double @pow(double %58, double %84)
%86 = fmul double %82, %85
%87 = fmul double %51, %86
%88 = tail call double @llvm.maxnum.f64(double %68, double %87)
%89 = getelementptr inbounds double, double* %43, i64 %78
store double %88, double* %89
%90 = fcmp oeq double %88, %68
%91 = select i1 %90, double 0.000000e+00, double 1.000000e+00
%92 = getelementptr inbounds double, double* %46, i64 %78
store double %91, double* %92
%93 = add nuw nsw i64 %78, 1
%94 = icmp eq i64 %93, %69
br i1 %94, label %70, label %77
95: ; preds = %197
%96 = icmp sgt i64 %98, 1
br i1 %96, label %97, label %200
97: ; preds = %95, %71
%98 = phi i64 [ %76, %71 ], [ %101, %95 ]
%99 = phi double [ 0.000000e+00, %71 ], [ %113, %95 ]
%100 = phi double [ %3, %71 ], [ %112, %95 ]
%101 = add nsw i64 %98, -1
%102 = trunc i64 %101 to i32
%103 = sub nsw i32 %11, %102
%104 = sitofp i32 %103 to double
%105 = fmul double %53, %104
%106 = fptosi double %105 to i32
%107 = sitofp i32 %106 to double
%108 = fsub double %3, %107
%109 = fcmp une double %100, %108
%110 = sitofp i32 %102 to double
%111 = tail call double @llvm.fmuladd.f64(double %72, double %110, double %108)
%112 = select i1 %109, double %108, double %100
%113 = select i1 %109, double %111, double %99
%114 = fmul double %53, %110
%115 = fcmp ugt double %114, %4
%116 = select i1 %75, i1 %115, i1 false
%117 = load double, double* %46
br label %118
118: ; preds = %97, %197
%119 = phi double [ %117, %97 ], [ %124, %197 ]
%120 = phi i64 [ 0, %97 ], [ %122, %197 ]
%121 = trunc i64 %120 to i32
%122 = add nuw nsw i64 %120, 1
%123 = getelementptr inbounds double, double* %46, i64 %122
%124 = load double, double* %123
%125 = fsub double 1.000000e+00, %124
%126 = fmul double %73, %125
%127 = tail call double @llvm.fmuladd.f64(double %124, double %5, double %126)
%128 = getelementptr inbounds double, double* %46, i64 %120
%129 = fsub double 1.000000e+00, %119
%130 = fmul double %73, %129
%131 = tail call double @llvm.fmuladd.f64(double %119, double %5, double %130)
%132 = sitofp i32 %121 to double
%133 = tail call double @pow(double %57, double %132)
%134 = fmul double %133, %1
%135 = sub nsw i32 %121, %102
%136 = tail call i64 @abs(i32 %135)
%137 = sitofp i64 %136 to double
%138 = tail call double @pow(double %58, double %137)
%139 = fmul double %134, %138
br i1 %109, label %140, label %152
140: ; preds = %118
%141 = fneg double %127
%142 = fmul double %113, %141
%143 = tail call i32 @exp(double %142)
%144 = sitofp i32 %143 to double
%145 = fneg double %131
%146 = fmul double %113, %145
%147 = tail call i32 @exp(double %146)
%148 = sitofp i32 %147 to double
%149 = fmul double %74, %148
%150 = tail call double @llvm.fmuladd.f64(double %65, double %144, double %149)
%151 = fmul double %150, %10
br label %152
152: ; preds = %118, %140
%153 = phi double [ %151, %140 ], [ 0.000000e+00, %118 ]
br i1 %116, label %173, label %154
154: ; preds = %152
%155 = getelementptr inbounds double, double* %43, i64 %122
%156 = load double, double* %155
%157 = fmul double %65, %156
%158 = fneg double %127
%159 = fmul double %53, %158
%160 = tail call i32 @exp(double %159)
%161 = sitofp i32 %160 to double
%162 = tail call double @llvm.fmuladd.f64(double %157, double %161, double %153)
%163 = getelementptr inbounds double, double* %43, i64 %120
%164 = load double, double* %163
%165 = fmul double %74, %164
%166 = fneg double %131
%167 = fmul double %53, %166
%168 = tail call i32 @exp(double %167)
%169 = sitofp i32 %168 to double
%170 = tail call double @llvm.fmuladd.f64(double %165, double %169, double %162)
store double %170, double* %163
%171 = fmul double %74, %119
%172 = tail call double @llvm.fmuladd.f64(double %65, double %124, double %171)
br label %197
173: ; preds = %152
%174 = fsub double %139, %2
%175 = tail call double @llvm.fmuladd.f64(double %51, double %174, double %9)
%176 = getelementptr inbounds double, double* %43, i64 %122
%177 = load double, double* %176
%178 = fmul double %65, %177
%179 = fneg double %127
%180 = fmul double %53, %179
%181 = tail call i32 @exp(double %180)
%182 = sitofp i32 %181 to double
%183 = tail call double @llvm.fmuladd.f64(double %178, double %182, double %153)
%184 = getelementptr inbounds double, double* %43, i64 %120
%185 = load double, double* %184
%186 = fmul double %74, %185
%187 = fneg double %131
%188 = fmul double %53, %187
%189 = tail call i32 @exp(double %188)
%190 = sitofp i32 %189 to double
%191 = tail call double @llvm.fmuladd.f64(double %186, double %190, double %183)
%192 = tail call double @llvm.maxnum.f64(double %175, double %191)
store double %192, double* %184
%193 = fcmp oeq double %192, %175
br i1 %193, label %197, label %194
194: ; preds = %173
%195 = fmul double %74, %119
%196 = tail call double @llvm.fmuladd.f64(double %65, double %124, double %195)
br label %197
197: ; preds = %194, %173, %154
%198 = phi double [ %172, %154 ], [ %196, %194 ], [ 1.000000e+00, %173 ]
store double %198, double* %128
%199 = icmp eq i64 %122, %98
br i1 %199, label %95, label %118
200: ; preds = %95, %70
%201 = load double, double* %43
%202 = fcmp ord double %201, 0.000000e+00
%203 = zext i1 %202 to i32
%204 = tail call i32 @assert(i32 %203)
%205 = tail call i32 @free(double* %43)
%206 = tail call i32 @free(double* %46)
ret double %201
}