#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*/ CO_select_forward_1(double *, int *, int *, double *, int,
                                       double);
double cost(double *, int);
double exp(double);
int /*<<< orphan*/ self_adj_index_search(int *, double, double *, int);
int uniformrng();
void Crossover_linear(double **x, double *fx, int N_dimension, int N_population,
                      double *theta, double *grid_points, int grid_size,
                      double temp, double scl, double *accpr_pop,
                      double *z_new) {
  double temp_co;
  int n1;
  int n2;
  int i;
  int k_old;
  int k_new;
  double pr_fw;
  double fz_old;
  double fz_new;
  double sumv;
  double un;
  double rat;
  temp_co = 0.1;
  CO_select_forward_1(&pr_fw, &n1, &n2, fx, N_population, temp_co);
  fz_old = fx[n1];
  self_adj_index_search(&k_old, fz_old, grid_points, grid_size);
  un = (2 * uniformrng() - 1.0) * scl;
  for (i = 1; i <= N_dimension; i++)
    z_new[i] = x[n1][i] + un * x[n2][i];
  fz_new = cost(z_new, N_dimension);
  self_adj_index_search(&k_new, fz_new, grid_points, grid_size);
  rat = -theta[k_new] - fz_new / temp + theta[k_old] + fz_old / temp;
  *accpr_pop = ((rat > 0.0) ? 1.0 : exp(rat));
  un = uniformrng();
  if (*accpr_pop > un) {
    fx[n1] = fz_new;
    for (i = 1; i <= N_dimension; i++)
      x[n1][i] = z_new[i];
  }
}


x86 assembly (clang, -O0):
<Crossover_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8d
movsd  -0x40(%rbp),%xmm0
lea    -0x60(%rbp),%rdi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1070 <CO_select_forward_1@plt>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%rsi
mov    0x10(%rbp),%edx
lea    -0x50(%rbp),%rdi
call   1050 <self_adj_index_search@plt>
mov    $0x0,%al
call   1030 <uniformrng@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe12(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1261 <Crossover_linear+0x111>
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x80(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1203 <Crossover_linear+0xb3>
mov    0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <cost@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rsi
mov    0x10(%rbp),%edx
lea    -0x54(%rbp),%rdi
call   1050 <self_adj_index_search@plt>
mov    -0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x70(%rbp),%xmm1
divsd  -0x30(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  -0x68(%rbp),%xmm1
divsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1306 <Crossover_linear+0x1b6>
movsd  0xd07(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
jmp    131b <Crossover_linear+0x1cb>
movsd  -0x88(%rbp),%xmm0
ff
call   1060 <exp@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1030 <uniformrng@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    13a8 <Crossover_linear+0x258>
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     13a3 <Crossover_linear+0x253>
mov    0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1367 <Crossover_linear+0x217>
jmp    13a8 <Crossover_linear+0x258>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Crossover_linear>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x38(%rsp)
mov    %r9,%r13
mov    %r8,0x30(%rsp)
mov    %ecx,%r8d
mov    %edx,%r12d
mov    %rsi,%rbp
mov    %rdi,%r15
mov    0x90(%rsp),%rbx
mov    0x80(%rsp),%r14d
lea    0x40(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
movsd  0xe5c(%rip),%xmm0
mov    %rbp,%rcx
call   1070 <CO_select_forward_1@plt>
movslq 0x8(%rsp),%rax
mov    %rbp,0x20(%rsp)
movsd  0x0(%rbp,%rax,8),%xmm0
lea    0x10(%rsp),%rdi
movsd  %xmm0,0x28(%rsp)
mov    %r13,%rsi
mov    %r14d,%edx
call   1050 <self_adj_index_search@plt>
xor    %eax,%eax
call   1030 <uniformrng@plt>
test   %r12d,%r12d
jle    13de <Crossover_linear+0x28e>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe15(%rip),%xmm0
mulsd  (%rsp),%xmm0
movslq 0x8(%rsp),%rax
mov    (%r15,%rax,8),%rax
movslq 0x14(%rsp),%rcx
mov    (%r15,%rcx,8),%rcx
mov    %r12d,%edi
lea    0x1(%rdi),%rdx
mov    $0x1,%esi
cmp    $0x4,%r12d
jae    1287 <Crossover_linear+0x137>
mov    %rsi,%rdi
not    %rdi
test   $0x1,%dl
jne    123e <Crossover_linear+0xee>
movsd  (%rcx,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rax,%rsi,8),%xmm1
movsd  %xmm1,(%rbx,%rsi,8)
add    $0x1,%rsi
add    %rdx,%rdi
je     13de <Crossover_linear+0x28e>
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rax,%rsi,8),%xmm1
movsd  %xmm1,(%rbx,%rsi,8)
movsd  0x8(%rcx,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rax,%rsi,8),%xmm1
movsd  %xmm1,0x8(%rbx,%rsi,8)
add    $0x2,%rsi
cmp    %rsi,%rdx
jne    1250 <Crossover_linear+0x100>
jmp    13de <Crossover_linear+0x28e>
mov    %rdi,0x18(%rsp)
mov    %r15,(%rsp)
lea    0x8(%rbx),%rdi
lea    (%rbx,%rdx,8),%rbp
lea    0x8(%rax),%r9
lea    (%rax,%rdx,8),%r10
lea    0x8(%rcx),%r11
lea    (%rcx,%rdx,8),%r14
cmp    %r10,%rdi
setb   %r10b
cmp    %rbp,%r9
setb   %r8b
cmp    %r14,%rdi
setb   %dil
cmp    %rbp,%r11
setb   %r9b
test   %r8b,%r10b
jne    1503 <Crossover_linear+0x3b3>
and    %r9b,%dil
mov    (%rsp),%r15
jne    121c <Crossover_linear+0xcc>
mov    0x18(%rsp),%r8
mov    %r8d,%esi
and    $0xfffffffc,%esi
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rsi),%rdi
mov    %rdi,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rdi,%rdi
je     1515 <Crossover_linear+0x3c5>
movabs $0x7ffffffffffffffc,%rbp
ff ff 7f
or     $0x2,%rbp
and    %r9,%rbp
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movupd 0x8(%rax,%rdi,8),%xmm2
movupd 0x18(%rax,%rdi,8),%xmm3
movupd 0x8(%rcx,%rdi,8),%xmm4
movupd 0x18(%rcx,%rdi,8),%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,0x8(%rbx,%rdi,8)
movupd %xmm5,0x18(%rbx,%rdi,8)
movupd 0x28(%rax,%rdi,8),%xmm2
movupd 0x38(%rax,%rdi,8),%xmm3
movupd 0x28(%rcx,%rdi,8),%xmm4
movupd 0x38(%rcx,%rdi,8),%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,0x28(%rbx,%rdi,8)
movupd %xmm5,0x38(%rbx,%rdi,8)
add    $0x8,%rdi
add    $0xfffffffffffffffe,%rbp
jne    1320 <Crossover_linear+0x1d0>
test   $0x1,%r9b
je     13d1 <Crossover_linear+0x281>
shl    $0x3,%rdi
or     $0x8,%rdi
movupd (%rax,%rdi,1),%xmm2
movupd 0x10(%rax,%rdi,1),%xmm3
movupd (%rcx,%rdi,1),%xmm4
movupd 0x10(%rcx,%rdi,1),%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,(%rbx,%rdi,1)
movupd %xmm5,0x10(%rbx,%rdi,1)
cmp    %rsi,%r8
mov    (%rsp),%r15
jne    150c <Crossover_linear+0x3bc>
mov    0x88(%rsp),%r14
mov    %rbx,%rdi
mov    %r12d,%esi
call   1040 <cost@plt>
movsd  %xmm0,(%rsp)
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
mov    0x80(%rsp),%edx
call   1050 <self_adj_index_search@plt>
movslq 0xc(%rsp),%rax
mov    0x30(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm3
xorpd  0xbff(%rip),%xmm3
movsd  (%rsp),%xmm1
movsd  0x38(%rsp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm3
movslq 0x10(%rsp),%rax
addsd  (%rcx,%rax,8),%xmm3
movsd  0x28(%rsp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1460 <Crossover_linear+0x310>
movsd  0xbb2(%rip),%xmm0
jmp    1465 <Crossover_linear+0x315>
call   1060 <exp@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
call   1030 <uniformrng@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%r14),%xmm1
ucomisd %xmm0,%xmm1
jbe    1647 <Crossover_linear+0x4f7>
movslq 0x8(%rsp),%rax
mov    0x20(%rsp),%rcx
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
test   %r12d,%r12d
jle    1647 <Crossover_linear+0x4f7>
mov    (%r15,%rax,8),%rax
mov    %r12d,%r8d
lea    0x1(%r8),%rcx
mov    $0x1,%edx
cmp    $0x4,%r12d
jb     15d5 <Crossover_linear+0x485>
lea    0x8(%rax),%rsi
lea    (%rbx,%rcx,8),%rdi
cmp    %rdi,%rsi
jae    14dc <Crossover_linear+0x38c>
lea    (%rax,%rcx,8),%rsi
lea    0x8(%rbx),%rdi
cmp    %rsi,%rdi
jb     15d5 <Crossover_linear+0x485>
mov    %r8d,%edx
and    $0xfffffffc,%edx
lea    -0x4(%rdx),%rbp
mov    %rbp,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%esi
and    $0x3,%esi
cmp    $0xc,%rbp
jae    1526 <Crossover_linear+0x3d6>
xor    %ebp,%ebp
jmp    158e <Crossover_linear+0x43e>
mov    (%rsp),%r15
jmp    121c <Crossover_linear+0xcc>
or     $0x1,%rsi
jmp    121c <Crossover_linear+0xcc>
xor    %edi,%edi
test   $0x1,%r9b
jne    1398 <Crossover_linear+0x248>
jmp    13d1 <Crossover_linear+0x281>
and    $0xfffffffffffffffc,%rdi
xor    %ebp,%ebp
nopl   0x0(%rax)
movups 0x8(%rbx,%rbp,8),%xmm0
movups 0x18(%rbx,%rbp,8),%xmm1
movups %xmm0,0x8(%rax,%rbp,8)
movups %xmm1,0x18(%rax,%rbp,8)
movups 0x28(%rbx,%rbp,8),%xmm0
movups 0x38(%rbx,%rbp,8),%xmm1
movups %xmm0,0x28(%rax,%rbp,8)
movups %xmm1,0x38(%rax,%rbp,8)
movups 0x48(%rbx,%rbp,8),%xmm0
movups 0x58(%rbx,%rbp,8),%xmm1
movups %xmm0,0x48(%rax,%rbp,8)
movups %xmm1,0x58(%rax,%rbp,8)
movupd 0x68(%rbx,%rbp,8),%xmm0
movupd 0x78(%rbx,%rbp,8),%xmm1
movupd %xmm0,0x68(%rax,%rbp,8)
movupd %xmm1,0x78(%rax,%rbp,8)
add    $0x10,%rbp
add    $0xfffffffffffffffc,%rdi
jne    1530 <Crossover_linear+0x3e0>
test   %rsi,%rsi
je     15cc <Crossover_linear+0x47c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x0(,%rbp,8),%rdi
or     $0x8,%rdi
movupd (%rbx,%rdi,1),%xmm0
movupd 0x10(%rbx,%rdi,1),%xmm1
movupd %xmm0,(%rax,%rdi,1)
movupd %xmm1,0x10(%rax,%rdi,1)
add    $0x4,%rbp
add    $0xffffffffffffffff,%rsi
jne    15a0 <Crossover_linear+0x450>
cmp    %rdx,%r8
je     1647 <Crossover_linear+0x4f7>
or     $0x1,%rdx
mov    %ecx,%edi
sub    %edx,%edi
mov    %rdx,%rsi
not    %rsi
add    %rcx,%rsi
and    $0x3,%rdi
je     1604 <Crossover_linear+0x4b4>
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rdx,8),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rdi
jne    15f0 <Crossover_linear+0x4a0>
cmp    $0x3,%rsi
jb     1647 <Crossover_linear+0x4f7>
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rdx,8),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
movsd  0x8(%rbx,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rax,%rdx,8)
movsd  0x10(%rbx,%rdx,8),%xmm0
movsd  %xmm0,0x10(%rax,%rdx,8)
movsd  0x18(%rbx,%rdx,8),%xmm0
movsd  %xmm0,0x18(%rax,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%rcx
jne    1610 <Crossover_linear+0x4c0>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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