#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 */
double exp(double);
int integerrng(int, int);
double log(double);
double uniformrng();
void CO_select_forward_2(double *prob, int *n1, int *n2, double *fx,
                         int N_population, double temp) {
  int i;
  double fx_min;
  double fx_min_22;
  double un;
  double fx_sum;
  double fx_sum_22;
  double ss;
  double prob1;
  double prob2;
  double prob11;
  double prob12;
  double prob21;
  double prob22;
  fx_min = fx[1];
  for (i = 1; i <= N_population; i++)
    if (fx[i] < fx_min)
      fx_min = fx[i];
  fx_sum = 0.0;
  for (i = 1; i <= N_population; i++)
    fx_sum += exp((-fx[i] + fx_min) / temp);
  fx_min_22 = fx_min;
  fx_sum_22 = fx_sum;
  if (fx_sum != 0.0) {
    un = uniformrng();
    ss = 0.0;
    *n1 = 0;
    do {
      (*n1)++;
      ss += exp((-fx[*n1] + fx_min) / temp - log(fx_sum));
    } while (ss < un && *n1 <= N_population);
    prob11 = (-fx[*n1] + fx_min) / temp - log(fx_sum);
  } else {
    *n1 = integerrng(1, N_population);
    prob11 = -log((double)N_population);
  }
  fx_min = ((*n1 == 1) ? fx[2] : fx[1]);
  for (i = 1; i <= N_population; i++)
    if (i != *n1 && fx[i] < fx_min)
      fx_min = fx[i];
  fx_sum = 0.0;
  for (i = 1; i <= N_population; i++)
    if (i != *n1)
      fx_sum += exp((-fx[i] + fx_min) / temp);
  if (fx_sum != 0.0) {
    un = uniformrng();
    ss = 0.0;
    *n2 = 0;
    do {
      (*n2)++;
      if (*n2 != *n1)
        ss += exp((-fx[*n2] + fx_min) / temp - log(fx_sum));
    } while (ss < un && *n2 <= N_population);
    prob12 = (-fx[*n2] + fx_min) / temp - log(fx_sum);
  } else {
    *n2 = (int)integerrng(1, N_population - 1);
    if (*n2 >= *n1)
      (*n2)++;
    prob12 = -log((double)(N_population - 1));
  }
  prob1 = prob11 + prob12;
  fx_min = fx_min_22;
  fx_sum = fx_sum_22;
  if (fx_sum != 0.0)
    prob22 = (-fx[*n2] + fx_min) / temp - log(fx_sum);
  else
    prob22 = -log((double)N_population);
  fx_min = ((*n2 == 1) ? fx[2] : fx[1]);
  for (i = 1; i <= N_population; i++)
    if (i != *n2 && fx[i] < fx_min)
      fx_min = fx[i];
  fx_sum = 0.0;
  for (i = 1; i <= N_population; i++)
    if (i != *n2)
      fx_sum += exp((-fx[i] + fx_min) / temp);
  if (fx_sum != 0.0)
    prob21 = (-fx[*n1] + fx_min) / temp - log(fx_sum);
  else
    prob21 = -log((double)(N_population - 1));
  prob2 = prob22 + prob21;
  if (prob1 > prob2)
    *prob = prob1 + log(1.0 + exp(prob2 - prob1));
  else
    *prob = prob2 + log(1.0 + exp(prob1 - prob2));
}


x86 assembly (clang, -O0):
<CO_select_forward_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     11c6 <CO_select_forward_2+0x86>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11b3 <CO_select_forward_2+0x73>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11b8 <CO_select_forward_2+0x78>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1179 <CO_select_forward_2+0x39>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     122c <CO_select_forward_2+0xec>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1050 <exp@plt>
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11d5 <CO_select_forward_2+0x95>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    125d <CO_select_forward_2+0x11d>
jp     125d <CO_select_forward_2+0x11d>
jmp    137f <CO_select_forward_2+0x23f>
mov    $0x0,%al
call   1030 <uniformrng@plt>
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1050 <exp@plt>
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xa1(%rbp)
jbe    1315 <CO_select_forward_2+0x1d5>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x24(%rbp),%eax
setle  %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
test   $0x1,%al
jne    127b <CO_select_forward_2+0x13b>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    13ba <CO_select_forward_2+0x27a>
mov    -0x24(%rbp),%esi
mov    $0x1,%edi
call   1040 <integerrng@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cvtsi2sdl -0x24(%rbp),%xmm0
call   1060 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    13dd <CO_select_forward_2+0x29d>
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    13ee <CO_select_forward_2+0x2ae>
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     145e <CO_select_forward_2+0x31e>
mov    -0x34(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
je     144b <CO_select_forward_2+0x30b>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    144b <CO_select_forward_2+0x30b>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1450 <CO_select_forward_2+0x310>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1402 <CO_select_forward_2+0x2c2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     14d8 <CO_select_forward_2+0x398>
mov    -0x34(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
je     14c5 <CO_select_forward_2+0x385>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1050 <exp@plt>
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    14ca <CO_select_forward_2+0x38a>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    146d <CO_select_forward_2+0x32d>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14f5 <CO_select_forward_2+0x3b5>
jp     14f5 <CO_select_forward_2+0x3b5>
jmp    1631 <CO_select_forward_2+0x4f1>
mov    $0x0,%al
call   1030 <uniformrng@plt>
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
je     1591 <CO_select_forward_2+0x451>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
call   1050 <exp@plt>
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1596 <CO_select_forward_2+0x456>
movsd  -0x68(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0xc1(%rbp)
jbe    15c4 <CO_select_forward_2+0x484>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x24(%rbp),%eax
setle  %al
mov    %al,-0xc1(%rbp)
mov    -0xc1(%rbp),%al
test   $0x1,%al
jne    1513 <CO_select_forward_2+0x3d3>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    1694 <CO_select_forward_2+0x554>
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
mov    $0x1,%edi
call   1040 <integerrng@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jl     1666 <CO_select_forward_2+0x526>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
call   1060 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    16d7 <CO_select_forward_2+0x597>
jp     16d7 <CO_select_forward_2+0x597>
jmp    1736 <CO_select_forward_2+0x5f6>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    175f <CO_select_forward_2+0x61f>
cvtsi2sdl -0x24(%rbp),%xmm0
call   1060 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1782 <CO_select_forward_2+0x642>
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    1793 <CO_select_forward_2+0x653>
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1803 <CO_select_forward_2+0x6c3>
mov    -0x34(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
je     17f0 <CO_select_forward_2+0x6b0>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    17f0 <CO_select_forward_2+0x6b0>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    17f5 <CO_select_forward_2+0x6b5>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    17a7 <CO_select_forward_2+0x667>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     187d <CO_select_forward_2+0x73d>
mov    -0x34(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
je     186a <CO_select_forward_2+0x72a>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
call   1050 <exp@plt>
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    186f <CO_select_forward_2+0x72f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1812 <CO_select_forward_2+0x6d2>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    189a <CO_select_forward_2+0x75a>
jp     189a <CO_select_forward_2+0x75a>
jmp    18f9 <CO_select_forward_2+0x7b9>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    1927 <CO_select_forward_2+0x7e7>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
call   1060 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1998 <CO_select_forward_2+0x858>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  0x68d(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    19df <CO_select_forward_2+0x89f>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  0x641(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CO_select_forward_2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
movapd %xmm0,%xmm2
mov    %r8d,%ebp
mov    %rcx,%r15
mov    %rdx,%r13
mov    %rsi,%r12
mov    %rdi,%r14
movsd  0x8(%rcx),%xmm3
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x50(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
movsd  %xmm0,0x90(%rsp)
test   %r8d,%r8d
movsd  %xmm2,0x18(%rsp)
mov    %rbp,0x28(%rsp)
jle    11c2 <CO_select_forward_2+0x82>
add    $0x1,%ebp
movapd %xmm3,%xmm1
cmp    $0x2,%ebp
je     1246 <CO_select_forward_2+0x106>
lea    -0x2(%rbp),%rdx
lea    -0x3(%rbp),%rcx
mov    %edx,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    11cc <CO_select_forward_2+0x8c>
mov    $0x2,%ecx
movapd %xmm3,%xmm0
jmp    121d <CO_select_forward_2+0xdd>
movsd  %xmm3,(%rsp)
jmp    13a1 <CO_select_forward_2+0x261>
and    $0xfffffffffffffffc,%rdx
neg    %rdx
mov    $0x2,%ecx
movapd %xmm3,%xmm0
nopl   0x0(%rax)
movsd  (%r15,%rcx,8),%xmm1
minsd  %xmm0,%xmm1
movsd  0x8(%r15,%rcx,8),%xmm0
minsd  %xmm1,%xmm0
movsd  0x10(%r15,%rcx,8),%xmm1
minsd  %xmm0,%xmm1
movsd  0x18(%r15,%rcx,8),%xmm0
minsd  %xmm1,%xmm0
lea    (%rdx,%rcx,1),%rsi
add    $0x4,%rsi
add    $0x4,%rcx
cmp    $0x2,%rsi
jne    11e0 <CO_select_forward_2+0xa0>
movapd %xmm0,%xmm1
test   %rax,%rax
je     1246 <CO_select_forward_2+0x106>
lea    (%r15,%rcx,8),%rcx
xor    %edx,%edx
nopl   0x0(%rax)
movsd  (%rcx,%rdx,8),%xmm1
minsd  %xmm0,%xmm1
add    $0x1,%rdx
movapd %xmm1,%xmm0
cmp    %rdx,%rax
jne    1230 <CO_select_forward_2+0xf0>
mov    0x28(%rsp),%rbx
test   %ebx,%ebx
jle    1387 <CO_select_forward_2+0x247>
movapd %xmm1,0x30(%rsp)
movapd %xmm1,%xmm0
subsd  %xmm3,%xmm0
divsd  %xmm2,%xmm0
call   1050 <exp@plt>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
addsd  %xmm0,%xmm1
cmp    $0x1,%ebx
je     12b0 <CO_select_forward_2+0x170>
mov    $0x2,%ebx
movsd  %xmm1,0x50(%rsp)
movapd 0x30(%rsp),%xmm0
subsd  (%r15,%rbx,8),%xmm0
divsd  0x18(%rsp),%xmm0
call   1050 <exp@plt>
movsd  0x50(%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1280 <CO_select_forward_2+0x140>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movsd  %xmm1,0x50(%rsp)
jne    12c6 <CO_select_forward_2+0x186>
jnp    1391 <CO_select_forward_2+0x251>
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
mov    %rax,0x78(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <uniformrng@plt>
movsd  %xmm0,0x48(%rsp)
xorpd  %xmm0,%xmm0
mov    0x28(%rsp),%rbp
movsd  %xmm0,(%rsp)
lea    0x1(%rbx),%eax
mov    %eax,(%r12)
movslq %ebx,%rax
movapd 0x30(%rsp),%xmm0
subsd  0x8(%r15,%rax,8),%xmm0
divsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x50(%rsp),%xmm0
call   1060 <log@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <exp@plt>
addsd  (%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
ucomisd %xmm0,%xmm1
mov    (%r12),%ebx
jbe    134f <CO_select_forward_2+0x20f>
cmp    %ebp,%ebx
jle    12f0 <CO_select_forward_2+0x1b0>
movslq %ebx,%rax
movapd 0x30(%rsp),%xmm0
subsd  (%r15,%rax,8),%xmm0
divsd  0x18(%rsp),%xmm0
movapd %xmm0,0x60(%rsp)
movsd  0x50(%rsp),%xmm0
call   1060 <log@plt>
movapd 0x60(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,0x60(%rsp)
jmp    13dd <CO_select_forward_2+0x29d>
movsd  %xmm1,(%rsp)
mov    %rbx,%rbp
jmp    13a1 <CO_select_forward_2+0x261>
movapd 0x30(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x28(%rsp),%rbp
mov    $0x1,%edi
mov    %ebp,%esi
call   1040 <integerrng@plt>
mov    %eax,(%r12)
movsd  0x90(%rsp),%xmm0
call   1060 <log@plt>
xorps  0xc3a(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
xor    %eax,%eax
mov    %rax,0x78(%rsp)
movsd  (%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
lea    0x8(%r15),%rax
mov    %rax,0x88(%rsp)
lea    0x10(%r15),%rax
mov    %rax,0x80(%rsp)
mov    %ebp,%ebx
test   %ebp,%ebp
movsd  0x18(%rsp),%xmm1
jle    1640 <CO_select_forward_2+0x500>
mov    (%r12),%eax
cmp    $0x1,%eax
mov    0x88(%rsp),%rcx
cmove  0x80(%rsp),%rcx
movsd  (%rcx),%xmm0
movapd %xmm0,(%rsp)
cmp    $0x1,%ebp
jne    143a <CO_select_forward_2+0x2fa>
mov    $0x1,%ecx
test   $0x1,%bl
jne    14a2 <CO_select_forward_2+0x362>
jmp    14bd <CO_select_forward_2+0x37d>
mov    %ebx,%edx
and    $0xfffffffe,%edx
mov    $0x1,%edi
jmp    1459 <CO_select_forward_2+0x319>
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rsi),%rdi
cmp    %rdx,%rsi
je     1499 <CO_select_forward_2+0x359>
mov    %rdi,%rcx
cmp    %rdi,%rax
je     1477 <CO_select_forward_2+0x337>
movsd  (%r15,%rcx,8),%xmm0
movapd (%rsp),%xmm2
ucomisd %xmm0,%xmm2
jbe    1477 <CO_select_forward_2+0x337>
movapd %xmm0,(%rsp)
lea    0x1(%rcx),%rsi
cmp    %rax,%rsi
je     1450 <CO_select_forward_2+0x310>
movsd  0x8(%r15,%rcx,8),%xmm0
movapd (%rsp),%xmm2
ucomisd %xmm0,%xmm2
jbe    1450 <CO_select_forward_2+0x310>
movapd %xmm0,(%rsp)
jmp    1450 <CO_select_forward_2+0x310>
add    $0x2,%rcx
test   $0x1,%bl
je     14bd <CO_select_forward_2+0x37d>
cmp    %rax,%rcx
je     14bd <CO_select_forward_2+0x37d>
movsd  (%r15,%rcx,8),%xmm0
movapd (%rsp),%xmm2
ucomisd %xmm0,%xmm2
jbe    14bd <CO_select_forward_2+0x37d>
movapd %xmm0,(%rsp)
test   %ebp,%ebp
jle    1640 <CO_select_forward_2+0x500>
mov    %rbx,0x70(%rsp)
mov    %r14,%rbx
lea    0x1(%rbp),%ecx
mov    $0x2,%ebp
sub    %rcx,%rbp
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%r14d
nopl   0x0(%rax,%rax,1)
mov    %eax,%eax
cmp    %rax,%r14
je     1521 <CO_select_forward_2+0x3e1>
movapd (%rsp),%xmm0
subsd  (%r15,%r14,8),%xmm0
divsd  %xmm1,%xmm0
call   1050 <exp@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x20(%rsp)
lea    (%r14,%rbp,1),%rax
cmp    $0x1,%rax
je     1535 <CO_select_forward_2+0x3f5>
mov    (%r12),%eax
add    $0x1,%r14
jmp    14f0 <CO_select_forward_2+0x3b0>
xorpd  %xmm1,%xmm1
movsd  0x20(%rsp),%xmm0
ucomisd %xmm1,%xmm0
mov    %rbx,%r14
mov    0x28(%rsp),%rbp
mov    0x70(%rsp),%rbx
jne    1558 <CO_select_forward_2+0x418>
jnp    1640 <CO_select_forward_2+0x500>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x48(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <uniformrng@plt>
movapd %xmm0,%xmm2
movsd  %xmm0,0x98(%rsp)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,0x0(%r13)
cmp    (%r12),%ebx
movsd  0x18(%rsp),%xmm0
jne    15a0 <CO_select_forward_2+0x460>
movsd  0x48(%rsp),%xmm1
jmp    15ef <CO_select_forward_2+0x4af>
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rax
movapd (%rsp),%xmm1
subsd  (%r15,%rax,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0xa0(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <log@plt>
movsd  0xa0(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <exp@plt>
movsd  0x98(%rsp),%xmm2
movsd  0x48(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x48(%rsp)
ucomisd %xmm1,%xmm2
mov    0x0(%r13),%ebx
jbe    1607 <CO_select_forward_2+0x4c7>
cmp    %ebp,%ebx
jle    1580 <CO_select_forward_2+0x440>
movslq %ebx,%rax
movapd (%rsp),%xmm0
subsd  (%r15,%rax,8),%xmm0
divsd  0x18(%rsp),%xmm0
movapd %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <log@plt>
movapd (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
mov    0x70(%rsp),%rbx
jmp    167e <CO_select_forward_2+0x53e>
add    $0xffffffff,%ebp
mov    $0x1,%edi
mov    %ebp,%esi
call   1040 <integerrng@plt>
mov    %eax,0x0(%r13)
cmp    (%r12),%eax
jl     1660 <CO_select_forward_2+0x520>
add    $0x1,%eax
mov    %eax,0x0(%r13)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
call   1060 <log@plt>
xorpd  0x98c(%rip),%xmm0
movapd %xmm0,(%rsp)
mov    0x28(%rsp),%rbp
cmpb   $0x0,0x78(%rsp)
movapd 0x30(%rsp),%xmm0
je     16be <CO_select_forward_2+0x57e>
movslq 0x0(%r13),%rax
subsd  (%r15,%rax,8),%xmm0
divsd  0x18(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0x50(%rsp),%xmm0
call   1060 <log@plt>
movapd 0x30(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
jmp    16da <CO_select_forward_2+0x59a>
movsd  0x90(%rsp),%xmm0
call   1060 <log@plt>
xorpd  0x92c(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
movapd 0x60(%rsp),%xmm0
addsd  (%rsp),%xmm0
movapd %xmm0,0x60(%rsp)
test   %ebp,%ebp
movsd  0x18(%rsp),%xmm1
jle    1842 <CO_select_forward_2+0x702>
mov    0x0(%r13),%eax
cmp    $0x1,%eax
mov    0x88(%rsp),%rcx
cmove  0x80(%rsp),%rcx
movsd  (%rcx),%xmm2
cmp    $0x1,%ebp
jne    1726 <CO_select_forward_2+0x5e6>
mov    $0x1,%ecx
test   $0x1,%bl
jne    1786 <CO_select_forward_2+0x646>
jmp    179b <CO_select_forward_2+0x65b>
mov    %ebx,%edx
and    $0xfffffffe,%edx
mov    $0x1,%edi
jmp    1749 <CO_select_forward_2+0x609>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rsi),%rdi
cmp    %rdx,%rsi
je     177d <CO_select_forward_2+0x63d>
mov    %rdi,%rcx
cmp    %rdi,%rax
je     1761 <CO_select_forward_2+0x621>
movsd  (%r15,%rcx,8),%xmm0
ucomisd %xmm0,%xmm2
jbe    1761 <CO_select_forward_2+0x621>
movapd %xmm0,%xmm2
lea    0x1(%rcx),%rsi
cmp    %rax,%rsi
je     1740 <CO_select_forward_2+0x600>
movsd  0x8(%r15,%rcx,8),%xmm0
ucomisd %xmm0,%xmm2
jbe    1740 <CO_select_forward_2+0x600>
movapd %xmm0,%xmm2
jmp    1740 <CO_select_forward_2+0x600>
add    $0x2,%rcx
test   $0x1,%bl
je     179b <CO_select_forward_2+0x65b>
cmp    %rax,%rcx
je     179b <CO_select_forward_2+0x65b>
movsd  (%r15,%rcx,8),%xmm0
ucomisd %xmm0,%xmm2
jbe    179b <CO_select_forward_2+0x65b>
movapd %xmm0,%xmm2
test   %ebp,%ebp
jle    1842 <CO_select_forward_2+0x702>
lea    0x1(%rbp),%ecx
mov    $0x2,%ebp
sub    %rcx,%rbp
xorpd  %xmm3,%xmm3
mov    $0x1,%ebx
movapd %xmm2,0x50(%rsp)
nopl   (%rax)
mov    %eax,%eax
cmp    %rax,%rbx
je     17f4 <CO_select_forward_2+0x6b4>
movapd %xmm2,%xmm0
subsd  (%r15,%rbx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm3,(%rsp)
call   1050 <exp@plt>
movsd  (%rsp),%xmm3
movapd 0x50(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm3
lea    (%rbx,%rbp,1),%rax
cmp    $0x1,%rax
je     1808 <CO_select_forward_2+0x6c8>
mov    0x0(%r13),%eax
add    $0x1,%rbx
jmp    17c0 <CO_select_forward_2+0x680>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
mov    0x28(%rsp),%rbp
jne    1819 <CO_select_forward_2+0x6d9>
jnp    1842 <CO_select_forward_2+0x702>
movslq (%r12),%rax
subsd  (%r15,%rax,8),%xmm2
divsd  %xmm1,%xmm2
movapd %xmm2,0x50(%rsp)
movapd %xmm3,%xmm0
call   1060 <log@plt>
movapd 0x50(%rsp),%xmm1
subsd  %xmm0,%xmm1
jmp    185d <CO_select_forward_2+0x71d>
add    $0xffffffff,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
call   1060 <log@plt>
movapd %xmm0,%xmm1
xorpd  0x7a3(%rip),%xmm1
movapd 0x30(%rsp),%xmm3
addsd  %xmm1,%xmm3
movapd 0x60(%rsp),%xmm4
movapd %xmm4,%xmm1
subsd  %xmm3,%xmm1
movapd %xmm3,%xmm2
subsd  %xmm4,%xmm2
movapd %xmm3,%xmm0
cmpltsd %xmm4,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
maxsd  %xmm3,%xmm4
movapd %xmm4,0x60(%rsp)
call   1050 <exp@plt>
addsd  0x767(%rip),%xmm0
call   1060 <log@plt>
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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