#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 cost(double *, int);
double exp(double);
int integerrng(int, int);
double normalrng();
double pow(int, double);
int /*<<< orphan*/ self_adj_index_search(int *, double, double *, int);
double uniformrng();
void Mutation_Kpoint(double *z, double *fz, int N_dimension, double *theta,
                     double *grid_points, int grid_size, double temp,
                     double scl, double *accpr_pop, double *z_new) {
  int k_old;
  int k_new;
  int i;
  int lab_1;
  int lab_2;
  double fz_new;
  double rat;
  double un;
  self_adj_index_search(&k_old, *fz, grid_points, grid_size);
  for (i = 1; i <= N_dimension; i++)
    z_new[i] = z[i];
  lab_1 = integerrng(1, N_dimension);
  un = normalrng() * scl * pow(k_old / (grid_size + 1.0), 0.5);
  z_new[lab_1] += un;
  if ((uniformrng() < 0.5) && (N_dimension >= 2)) {
    lab_2 = integerrng(1, N_dimension - 1);
    if (lab_2 >= lab_1)
      lab_2++;
    un = normalrng() * scl;
    z_new[lab_2] += un;
  }
  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 / temp;
  *accpr_pop = ((rat > 0.0) ? 1.0 : exp(rat));
  un = uniformrng();
  if (*accpr_pop > un) {
    *fz = fz_new;
    for (i = 1; i <= N_dimension; i++)
      z[i] = z_new[i];
  }
}


x86 assembly (clang, -O0):
<Mutation_Kpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    -0x44(%rbp),%rdi
call   1050 <self_adj_index_search@plt>
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11f7 <Mutation_Kpoint+0x87>
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11c3 <Mutation_Kpoint+0x53>
mov    -0x14(%rbp),%esi
mov    $0x1,%edi
call   1060 <integerrng@plt>
mov    %eax,-0x50(%rbp)
mov    $0x0,%al
call   1080 <normalrng@plt>
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
cvtsi2sdl -0x44(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xdde(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xdc2(%rip),%xmm0
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    $0x0,%al
call   1030 <uniformrng@plt>
movaps %xmm0,%xmm1
movsd  0xd83(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12e1 <Mutation_Kpoint+0x171>
cmpl   $0x2,-0x14(%rbp)
jl     12e1 <Mutation_Kpoint+0x171>
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    $0x1,%edi
call   1060 <integerrng@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x50(%rbp),%eax
jl     12b9 <Mutation_Kpoint+0x149>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1080 <normalrng@plt>
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <cost@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    -0x48(%rbp),%rdi
call   1050 <self_adj_index_search@plt>
mov    -0x20(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x60(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
divsd  -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1380 <Mutation_Kpoint+0x210>
movsd  0xc92(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    138f <Mutation_Kpoint+0x21f>
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1030 <uniformrng@plt>
movsd  %xmm0,-0x70(%rbp)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    1408 <Mutation_Kpoint+0x298>
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1403 <Mutation_Kpoint+0x293>
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    13cf <Mutation_Kpoint+0x25f>
jmp    1408 <Mutation_Kpoint+0x298>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mutation_Kpoint>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %r9d,%r12d
mov    %rcx,%rbp
mov    %edx,%r15d
mov    %rdi,%rbx
mov    0x78(%rsp),%r14
mov    %rsi,0x30(%rsp)
movsd  (%rsi),%xmm0
lea    0xc(%rsp),%rdi
mov    %r8,0x20(%rsp)
mov    %r8,%rsi
mov    %r9d,%edx
call   1050 <self_adj_index_search@plt>
test   %r15d,%r15d
jle    134b <Mutation_Kpoint+0x1db>
mov    %r15d,%edx
lea    0x1(%rdx),%rax
mov    $0x1,%ecx
cmp    $0x4,%r15d
jb     12d8 <Mutation_Kpoint+0x168>
lea    0x8(%r14),%rsi
lea    (%rbx,%rax,8),%rdi
cmp    %rdi,%rsi
jae    11f5 <Mutation_Kpoint+0x85>
lea    (%r14,%rax,8),%rsi
lea    0x8(%rbx),%rdi
cmp    %rsi,%rdi
jb     12d8 <Mutation_Kpoint+0x168>
mov    %rbp,%r8
mov    %edx,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%ebp
and    $0x3,%ebp
cmp    $0xc,%rdi
jae    121b <Mutation_Kpoint+0xab>
xor    %edi,%edi
jmp    1294 <Mutation_Kpoint+0x124>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups 0x8(%rbx,%rdi,8),%xmm0
movups 0x18(%rbx,%rdi,8),%xmm1
movups %xmm0,0x8(%r14,%rdi,8)
movups %xmm1,0x18(%r14,%rdi,8)
movups 0x28(%rbx,%rdi,8),%xmm0
movups 0x38(%rbx,%rdi,8),%xmm1
movups %xmm0,0x28(%r14,%rdi,8)
movups %xmm1,0x38(%r14,%rdi,8)
movups 0x48(%rbx,%rdi,8),%xmm0
movups 0x58(%rbx,%rdi,8),%xmm1
movups %xmm0,0x48(%r14,%rdi,8)
movups %xmm1,0x58(%r14,%rdi,8)
movupd 0x68(%rbx,%rdi,8),%xmm0
movups 0x78(%rbx,%rdi,8),%xmm1
movupd %xmm0,0x68(%r14,%rdi,8)
movups %xmm1,0x78(%r14,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    1230 <Mutation_Kpoint+0xc0>
test   %rbp,%rbp
je     12cc <Mutation_Kpoint+0x15c>
nopl   0x0(%rax)
lea    0x0(,%rdi,8),%rsi
or     $0x8,%rsi
movupd (%rbx,%rsi,1),%xmm0
movups 0x10(%rbx,%rsi,1),%xmm1
movupd %xmm0,(%r14,%rsi,1)
movups %xmm1,0x10(%r14,%rsi,1)
add    $0x4,%rdi
add    $0xffffffffffffffff,%rbp
jne    12a0 <Mutation_Kpoint+0x130>
cmp    %rcx,%rdx
mov    %r8,%rbp
je     134b <Mutation_Kpoint+0x1db>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     1305 <Mutation_Kpoint+0x195>
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    12f0 <Mutation_Kpoint+0x180>
cmp    $0x3,%rdx
jb     134b <Mutation_Kpoint+0x1db>
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r14,%rcx,8)
movsd  0x10(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x10(%r14,%rcx,8)
movsd  0x18(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x18(%r14,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1310 <Mutation_Kpoint+0x1a0>
mov    $0x1,%edi
mov    %r15d,%esi
call   1060 <integerrng@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1080 <normalrng@plt>
cvtsi2sdl 0xc(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
addsd  0xc88(%rip),%xmm1
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
movsd  0xc75(%rip),%xmm0
call   1090 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movslq %r13d,%rax
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
xor    %eax,%eax
call   1030 <uniformrng@plt>
cmp    $0x2,%r15d
jl     1412 <Mutation_Kpoint+0x2a2>
movsd  0xc46(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1412 <Mutation_Kpoint+0x2a2>
lea    -0x1(%r15),%esi
mov    $0x1,%edi
call   1060 <integerrng@plt>
mov    %r15,0x10(%rsp)
mov    %r12d,%r15d
mov    %rbp,%r12
xor    %ebp,%ebp
cmp    %r13d,%eax
setge  %bpl
add    %eax,%ebp
xor    %eax,%eax
call   1080 <normalrng@plt>
mulsd  (%rsp),%xmm0
movslq %ebp,%rax
mov    %r12,%rbp
mov    %r15d,%r12d
mov    0x10(%rsp),%r15
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
mov    0x70(%rsp),%r13
mov    %r14,%rdi
mov    %r15d,%esi
call   1040 <cost@plt>
movsd  %xmm0,(%rsp)
lea    0x1c(%rsp),%rdi
mov    0x20(%rsp),%rsi
mov    %r12d,%edx
call   1050 <self_adj_index_search@plt>
movslq 0x1c(%rsp),%rax
movsd  0x0(%rbp,%rax,8),%xmm1
xorpd  0xbc4(%rip),%xmm1
movsd  (%rsp),%xmm0
movsd  0x28(%rsp),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movslq 0xc(%rsp),%rax
addsd  0x0(%rbp,%rax,8),%xmm1
mov    0x30(%rsp),%rbp
movsd  0x0(%rbp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1490 <Mutation_Kpoint+0x320>
movsd  0xb72(%rip),%xmm0
jmp    1495 <Mutation_Kpoint+0x325>
call   1070 <exp@plt>
movsd  %xmm0,0x0(%r13)
xor    %eax,%eax
call   1030 <uniformrng@plt>
movsd  0x0(%r13),%xmm1
ucomisd %xmm0,%xmm1
jbe    164b <Mutation_Kpoint+0x4db>
movsd  (%rsp),%xmm0
movsd  %xmm0,0x0(%rbp)
test   %r15d,%r15d
jle    164b <Mutation_Kpoint+0x4db>
mov    %r15d,%edx
lea    0x1(%rdx),%rax
mov    $0x1,%ecx
cmp    $0x4,%r15d
jb     15d7 <Mutation_Kpoint+0x467>
lea    0x8(%rbx),%rsi
lea    (%r14,%rax,8),%rdi
cmp    %rdi,%rsi
jae    14f9 <Mutation_Kpoint+0x389>
lea    (%rbx,%rax,8),%rsi
lea    0x8(%r14),%rdi
cmp    %rsi,%rdi
jb     15d7 <Mutation_Kpoint+0x467>
mov    %edx,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%ebp
and    $0x3,%ebp
cmp    $0xc,%rdi
jae    151c <Mutation_Kpoint+0x3ac>
xor    %edi,%edi
jmp    1596 <Mutation_Kpoint+0x426>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups 0x8(%r14,%rdi,8),%xmm0
movups 0x18(%r14,%rdi,8),%xmm1
movups %xmm0,0x8(%rbx,%rdi,8)
movups %xmm1,0x18(%rbx,%rdi,8)
movups 0x28(%r14,%rdi,8),%xmm0
movups 0x38(%r14,%rdi,8),%xmm1
movups %xmm0,0x28(%rbx,%rdi,8)
movups %xmm1,0x38(%rbx,%rdi,8)
movups 0x48(%r14,%rdi,8),%xmm0
movups 0x58(%r14,%rdi,8),%xmm1
movups %xmm0,0x48(%rbx,%rdi,8)
movups %xmm1,0x58(%rbx,%rdi,8)
movupd 0x68(%r14,%rdi,8),%xmm0
movupd 0x78(%r14,%rdi,8),%xmm1
movupd %xmm0,0x68(%rbx,%rdi,8)
movupd %xmm1,0x78(%rbx,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    1530 <Mutation_Kpoint+0x3c0>
test   %rbp,%rbp
je     15ce <Mutation_Kpoint+0x45e>
nopl   0x0(%rax,%rax,1)
lea    0x0(,%rdi,8),%rsi
or     $0x8,%rsi
movupd (%r14,%rsi,1),%xmm0
movupd 0x10(%r14,%rsi,1),%xmm1
movupd %xmm0,(%rbx,%rsi,1)
movupd %xmm1,0x10(%rbx,%rsi,1)
add    $0x4,%rdi
add    $0xffffffffffffffff,%rbp
jne    15a0 <Mutation_Kpoint+0x430>
cmp    %rcx,%rdx
je     164b <Mutation_Kpoint+0x4db>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     1605 <Mutation_Kpoint+0x495>
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    15f0 <Mutation_Kpoint+0x480>
cmp    $0x3,%rdx
jb     164b <Mutation_Kpoint+0x4db>
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
movsd  0x8(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rcx,8)
movsd  0x10(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rcx,8)
movsd  0x18(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1610 <Mutation_Kpoint+0x4a0>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Mutation_Kpoint(double* nocapture %0, double* nocapture %1, i32 %2, double* nocapture %3, double* %4, i32 %5, double %6, double %7, double* nocapture %8, double* %9) {
%11 = alloca i32
%12 = alloca i32
%13 = bitcast i32* %11 to i8*
%14 = bitcast i32* %12 to i8*
%15 = load double, double* %1
%16 = call i32 @self_adj_index_search(i32* %11, double %15, double* %4, i32 %5)
%17 = icmp slt i32 %2, 1
br i1 %17, label %151, label %18
18: ; preds = %10
%19 = add nuw i32 %2, 1
%20 = zext i32 %19 to i64
%21 = add nsw i64 %20, -1
%22 = icmp ult i64 %21, 4
br i1 %22, label %113, label %23
23: ; preds = %18
%24 = getelementptr double, double* %9, i64 1
%25 = getelementptr double, double* %9, i64 %20
%26 = getelementptr double, double* %0, i64 1
%27 = getelementptr double, double* %0, i64 %20
%28 = icmp ult double* %24, %27
%29 = icmp ult double* %26, %25
%30 = and i1 %28, %29
br i1 %30, label %113, label %31
31: ; preds = %23
%32 = and i64 %21, -4
%33 = or i64 %32, 1
%34 = add nsw i64 %32, -4
%35 = lshr exact i64 %34, 2
%36 = add nuw nsw i64 %35, 1
%37 = and i64 %36, 3
%38 = icmp ult i64 %34, 12
br i1 %38, label %91, label %39
39: ; preds = %31
%40 = and i64 %36, 9223372036854775804
br label %41
41: ; preds = %41, %39
%42 = phi i64 [ 0, %39 ], [ %88, %41 ]
%43 = phi i64 [ 0, %39 ], [ %89, %41 ]
%44 = or i64 %42, 1
%45 = getelementptr inbounds double, double* %0, i64 %44
%46 = bitcast double* %45 to <2 x double>*
%47 = load <2 x double>, <2 x double>* %46
%48 = getelementptr inbounds double, double* %45, i64 2
%49 = bitcast double* %48 to <2 x double>*
%50 = load <2 x double>, <2 x double>* %49
%51 = getelementptr inbounds double, double* %9, i64 %44
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> %47, <2 x double>* %52
%53 = getelementptr inbounds double, double* %51, i64 2
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> %50, <2 x double>* %54
%55 = or i64 %42, 5
%56 = getelementptr inbounds double, double* %0, i64 %55
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = getelementptr inbounds double, double* %56, i64 2
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = getelementptr inbounds double, double* %9, i64 %55
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> %58, <2 x double>* %63
%64 = getelementptr inbounds double, double* %62, i64 2
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> %61, <2 x double>* %65
%66 = or i64 %42, 9
%67 = getelementptr inbounds double, double* %0, i64 %66
%68 = bitcast double* %67 to <2 x double>*
%69 = load <2 x double>, <2 x double>* %68
%70 = getelementptr inbounds double, double* %67, i64 2
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = getelementptr inbounds double, double* %9, i64 %66
%74 = bitcast double* %73 to <2 x double>*
store <2 x double> %69, <2 x double>* %74
%75 = getelementptr inbounds double, double* %73, i64 2
%76 = bitcast double* %75 to <2 x double>*
store <2 x double> %72, <2 x double>* %76
%77 = or i64 %42, 13
%78 = getelementptr inbounds double, double* %0, i64 %77
%79 = bitcast double* %78 to <2 x double>*
%80 = load <2 x double>, <2 x double>* %79
%81 = getelementptr inbounds double, double* %78, i64 2
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = getelementptr inbounds double, double* %9, i64 %77
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> %80, <2 x double>* %85
%86 = getelementptr inbounds double, double* %84, i64 2
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %83, <2 x double>* %87
%88 = add nuw i64 %42, 16
%89 = add nuw i64 %43, 4
%90 = icmp eq i64 %89, %40
br i1 %90, label %91, label %41
91: ; preds = %41, %31
%92 = phi i64 [ 0, %31 ], [ %88, %41 ]
%93 = icmp eq i64 %37, 0
br i1 %93, label %111, label %94
94: ; preds = %91, %94
%95 = phi i64 [ %108, %94 ], [ %92, %91 ]
%96 = phi i64 [ %109, %94 ], [ 0, %91 ]
%97 = or i64 %95, 1
%98 = getelementptr inbounds double, double* %0, 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* %9, i64 %97
%105 = bitcast double* %104 to <2 x double>*
store <2 x double> %100, <2 x double>* %105
%106 = getelementptr inbounds double, double* %104, i64 2
%107 = bitcast double* %106 to <2 x double>*
store <2 x double> %103, <2 x double>* %107
%108 = add nuw i64 %95, 4
%109 = add i64 %96, 1
%110 = icmp eq i64 %109, %37
br i1 %110, label %111, label %94
111: ; preds = %94, %91
%112 = icmp eq i64 %21, %32
br i1 %112, label %151, label %113
113: ; preds = %23, %18, %111
%114 = phi i64 [ 1, %23 ], [ 1, %18 ], [ %33, %111 ]
%115 = sub nsw i64 %20, %114
%116 = xor i64 %114, -1
%117 = add nsw i64 %116, %20
%118 = and i64 %115, 3
%119 = icmp eq i64 %118, 0
br i1 %119, label %129, label %120
120: ; preds = %113, %120
%121 = phi i64 [ %126, %120 ], [ %114, %113 ]
%122 = phi i64 [ %127, %120 ], [ 0, %113 ]
%123 = getelementptr inbounds double, double* %0, i64 %121
%124 = load double, double* %123
%125 = getelementptr inbounds double, double* %9, i64 %121
store double %124, double* %125
%126 = add nuw nsw i64 %121, 1
%127 = add i64 %122, 1
%128 = icmp eq i64 %127, %118
br i1 %128, label %129, label %120
129: ; preds = %120, %113
%130 = phi i64 [ %114, %113 ], [ %126, %120 ]
%131 = icmp ult i64 %117, 3
br i1 %131, label %151, label %132
132: ; preds = %129, %132
%133 = phi i64 [ %149, %132 ], [ %130, %129 ]
%134 = getelementptr inbounds double, double* %0, i64 %133
%135 = load double, double* %134
%136 = getelementptr inbounds double, double* %9, i64 %133
store double %135, double* %136
%137 = add nuw nsw i64 %133, 1
%138 = getelementptr inbounds double, double* %0, i64 %137
%139 = load double, double* %138
%140 = getelementptr inbounds double, double* %9, i64 %137
store double %139, double* %140
%141 = add nuw nsw i64 %133, 2
%142 = getelementptr inbounds double, double* %0, i64 %141
%143 = load double, double* %142
%144 = getelementptr inbounds double, double* %9, i64 %141
store double %143, double* %144
%145 = add nuw nsw i64 %133, 3
%146 = getelementptr inbounds double, double* %0, i64 %145
%147 = load double, double* %146
%148 = getelementptr inbounds double, double* %9, i64 %145
store double %147, double* %148
%149 = add nuw nsw i64 %133, 4
%150 = icmp eq i64 %149, %20
br i1 %150, label %151, label %132
151: ; preds = %129, %132, %111, %10
%152 = call i32 @integerrng(i32 1, i32 %2)
%153 = call double (...) @normalrng()
%154 = fmul double %153, %7
%155 = load i32, i32* %11
%156 = sitofp i32 %155 to double
%157 = sitofp i32 %5 to double
%158 = fadd double %157, 1.000000e+00
%159 = fdiv double %156, %158
%160 = fptosi double %159 to i32
%161 = call double @pow(i32 %160, double 5.000000e-01)
%162 = fmul double %154, %161
%163 = sext i32 %152 to i64
%164 = getelementptr inbounds double, double* %9, i64 %163
%165 = load double, double* %164
%166 = fadd double %165, %162
store double %166, double* %164
%167 = call double (...) @uniformrng()
%168 = fcmp olt double %167, 5.000000e-01
%169 = icmp sgt i32 %2, 1
%170 = and i1 %169, %168
br i1 %170, label %171, label %183
171: ; preds = %151
%172 = add nsw i32 %2, -1
%173 = call i32 @integerrng(i32 1, i32 %172)
%174 = icmp sge i32 %173, %152
%175 = zext i1 %174 to i32
%176 = add nsw i32 %173, %175
%177 = call double (...) @normalrng()
%178 = fmul double %177, %7
%179 = sext i32 %176 to i64
%180 = getelementptr inbounds double, double* %9, i64 %179
%181 = load double, double* %180
%182 = fadd double %181, %178
store double %182, double* %180
br label %183
183: ; preds = %171, %151
%184 = call double @cost(double* %9, i32 %2)
%185 = call i32 @self_adj_index_search(i32* %12, double %184, double* %4, i32 %5)
%186 = load i32, i32* %12
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds double, double* %3, i64 %187
%189 = load double, double* %188
%190 = fneg double %189
%191 = fdiv double %184, %6
%192 = fsub double %190, %191
%193 = load i32, i32* %11
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %3, i64 %194
%196 = load double, double* %195
%197 = fadd double %192, %196
%198 = load double, double* %1
%199 = fdiv double %198, %6
%200 = fadd double %197, %199
%201 = fcmp ogt double %200, 0.000000e+00
br i1 %201, label %204, label %202
202: ; preds = %183
%203 = call double @exp(double %200)
br label %204
204: ; preds = %183, %202
%205 = phi double [ %203, %202 ], [ 1.000000e+00, %183 ]
store double %205, double* %8
%206 = call double (...) @uniformrng()
%207 = load double, double* %8
%208 = fcmp ogt double %207, %206
br i1 %208, label %209, label %343
209: ; preds = %204
store double %184, double* %1
br i1 %17, label %343, label %210
210: ; preds = %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 = %210
%216 = getelementptr double, double* %0, i64 1
%217 = getelementptr double, double* %0, i64 %212
%218 = getelementptr double, double* %9, i64 1
%219 = getelementptr double, double* %9, 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* %9, 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* %0, 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* %9, 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* %0, 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* %9, 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* %0, 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* %9, 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* %0, 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* %9, 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* %0, 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, %210, %303
%306 = phi i64 [ 1, %215 ], [ 1, %210 ], [ %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* %9, i64 %313
%316 = load double, double* %315
%317 = getelementptr inbounds double, double* %0, 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* %9, i64 %325
%327 = load double, double* %326
%328 = getelementptr inbounds double, double* %0, i64 %325
store double %327, double* %328
%329 = add nuw nsw i64 %325, 1
%330 = getelementptr inbounds double, double* %9, i64 %329
%331 = load double, double* %330
%332 = getelementptr inbounds double, double* %0, i64 %329
store double %331, double* %332
%333 = add nuw nsw i64 %325, 2
%334 = getelementptr inbounds double, double* %9, i64 %333
%335 = load double, double* %334
%336 = getelementptr inbounds double, double* %0, i64 %333
store double %335, double* %336
%337 = add nuw nsw i64 %325, 3
%338 = getelementptr inbounds double, double* %9, i64 %337
%339 = load double, double* %338
%340 = getelementptr inbounds double, double* %0, 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, %209, %204
ret void
}