#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();
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;
  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     11e7 <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    11b3 <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,-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  0xdcf(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1295 <Mutation_Kpoint+0x135>
cmpl   $0x2,-0x14(%rbp)
jl     1295 <Mutation_Kpoint+0x135>
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     126d <Mutation_Kpoint+0x10d>
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    1334 <Mutation_Kpoint+0x1d4>
movsd  0xcde(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1343 <Mutation_Kpoint+0x1e3>
movsd  -0x68(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%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    13bc <Mutation_Kpoint+0x25c>
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     13b7 <Mutation_Kpoint+0x257>
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    1383 <Mutation_Kpoint+0x223>
jmp    13bc <Mutation_Kpoint+0x25c>
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,0x8(%rsp)
movsd  %xmm0,0x30(%rsp)
mov    %rcx,%r13
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbx
mov    0x78(%rsp),%r14
movsd  (%rsi),%xmm0
lea    0x1c(%rsp),%rdi
mov    %r8,0x28(%rsp)
mov    %r8,%rsi
mov    %r9d,0x14(%rsp)
mov    %r9d,%edx
call   1050 <self_adj_index_search@plt>
test   %r15d,%r15d
jle    132b <Mutation_Kpoint+0x1cb>
mov    %r15d,%edx
lea    0x1(%rdx),%rax
mov    $0x1,%ecx
cmp    $0x4,%r15d
jb     12b7 <Mutation_Kpoint+0x157>
lea    0x8(%r14),%rsi
lea    (%rbx,%rax,8),%rdi
cmp    %rdi,%rsi
jae    11e6 <Mutation_Kpoint+0x86>
lea    (%r14,%rax,8),%rsi
lea    0x8(%rbx),%rdi
cmp    %rsi,%rdi
jb     12b7 <Mutation_Kpoint+0x157>
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    1209 <Mutation_Kpoint+0xa9>
xor    %edi,%edi
jmp    1276 <Mutation_Kpoint+0x116>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nop
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
movupd 0x78(%rbx,%rdi,8),%xmm1
movupd %xmm0,0x68(%r14,%rdi,8)
movupd %xmm1,0x78(%r14,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    1210 <Mutation_Kpoint+0xb0>
test   %rbp,%rbp
je     12ae <Mutation_Kpoint+0x14e>
nopl   0x0(%rax,%rax,1)
lea    0x0(,%rdi,8),%rsi
or     $0x8,%rsi
movupd (%rbx,%rsi,1),%xmm0
movupd 0x10(%rbx,%rsi,1),%xmm1
movupd %xmm0,(%r14,%rsi,1)
movupd %xmm1,0x10(%r14,%rsi,1)
add    $0x4,%rdi
add    $0xffffffffffffffff,%rbp
jne    1280 <Mutation_Kpoint+0x120>
cmp    %rcx,%rdx
je     132b <Mutation_Kpoint+0x1cb>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     12e5 <Mutation_Kpoint+0x185>
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    12d0 <Mutation_Kpoint+0x170>
cmp    $0x3,%rdx
jb     132b <Mutation_Kpoint+0x1cb>
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    12f0 <Mutation_Kpoint+0x190>
mov    $0x1,%edi
mov    %r15d,%esi
call   1060 <integerrng@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1080 <normalrng@plt>
mulsd  0x8(%rsp),%xmm0
movslq %ebp,%rax
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
xor    %eax,%eax
call   1030 <uniformrng@plt>
cmp    $0x2,%r15d
jl     13bd <Mutation_Kpoint+0x25d>
movsd  0xc95(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    13bd <Mutation_Kpoint+0x25d>
lea    -0x1(%r15),%esi
mov    $0x1,%edi
call   1060 <integerrng@plt>
mov    %r15,0x20(%rsp)
mov    %r13,%r15
mov    %r12,%r13
xor    %r12d,%r12d
cmp    %ebp,%eax
setge  %r12b
add    %eax,%r12d
xor    %eax,%eax
call   1080 <normalrng@plt>
mulsd  0x8(%rsp),%xmm0
movslq %r12d,%rax
mov    %r13,%r12
mov    %r15,%r13
mov    0x20(%rsp),%r15
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
mov    0x70(%rsp),%rbp
mov    %r14,%rdi
mov    %r15d,%esi
call   1040 <cost@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x18(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x14(%rsp),%edx
call   1050 <self_adj_index_search@plt>
movslq 0x18(%rsp),%rax
movsd  0x0(%r13,%rax,8),%xmm1
xorpd  0xc16(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
movsd  0x30(%rsp),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movslq 0x1c(%rsp),%rax
addsd  0x0(%r13,%rax,8),%xmm1
movsd  (%r12),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    143c <Mutation_Kpoint+0x2dc>
movsd  0xbce(%rip),%xmm0
jmp    1441 <Mutation_Kpoint+0x2e1>
call   1070 <exp@plt>
movsd  %xmm0,0x0(%rbp)
xor    %eax,%eax
call   1030 <uniformrng@plt>
movsd  0x0(%rbp),%xmm1
ucomisd %xmm0,%xmm1
jbe    15eb <Mutation_Kpoint+0x48b>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r12)
test   %r15d,%r15d
jle    15eb <Mutation_Kpoint+0x48b>
mov    %r15d,%edx
lea    0x1(%rdx),%rax
mov    $0x1,%ecx
cmp    $0x4,%r15d
jb     1577 <Mutation_Kpoint+0x417>
lea    0x8(%rbx),%rsi
lea    (%r14,%rax,8),%rdi
cmp    %rdi,%rsi
jae    14a5 <Mutation_Kpoint+0x345>
lea    (%rbx,%rax,8),%rsi
lea    0x8(%r14),%rdi
cmp    %rsi,%rdi
jb     1577 <Mutation_Kpoint+0x417>
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    14c8 <Mutation_Kpoint+0x368>
xor    %edi,%edi
jmp    1536 <Mutation_Kpoint+0x3d6>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
xchg   %ax,%ax
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    14d0 <Mutation_Kpoint+0x370>
test   %rbp,%rbp
je     156e <Mutation_Kpoint+0x40e>
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    1540 <Mutation_Kpoint+0x3e0>
cmp    %rcx,%rdx
je     15eb <Mutation_Kpoint+0x48b>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     15a5 <Mutation_Kpoint+0x445>
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1590 <Mutation_Kpoint+0x430>
cmp    $0x3,%rdx
jb     15eb <Mutation_Kpoint+0x48b>
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    15b0 <Mutation_Kpoint+0x450>
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
store double %56, double* %28
%57 = load double, double* %28
%58 = load double*, double** %20
%59 = load i32, i32* %24
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
%62 = load double, double* %61
%63 = fadd double %62, %57
store double %63, double* %61
%64 = call double (...) @uniformrng()
%65 = fcmp olt double %64, 5.000000e-01
br i1 %65, label %66, label %90
66: ; preds = %51
%67 = load i32, i32* %13
%68 = icmp sge i32 %67, 2
br i1 %68, label %69, label %90
69: ; preds = %66
%70 = load i32, i32* %13
%71 = sub nsw i32 %70, 1
%72 = call i32 @integerrng(i32 1, i32 %71)
store i32 %72, i32* %25
%73 = load i32, i32* %25
%74 = load i32, i32* %24
%75 = icmp sge i32 %73, %74
br i1 %75, label %76, label %79
76: ; preds = %69
%77 = load i32, i32* %25
%78 = add nsw i32 %77, 1
store i32 %78, i32* %25
br label %79
79: ; preds = %76, %69
%80 = call double (...) @normalrng()
%81 = load double, double* %18
%82 = fmul double %80, %81
store double %82, double* %28
%83 = load double, double* %28
%84 = load double*, double** %20
%85 = load i32, i32* %25
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
%88 = load double, double* %87
%89 = fadd double %88, %83
store double %89, double* %87
br label %90
90: ; preds = %79, %66, %51
%91 = load double*, double** %20
%92 = load i32, i32* %13
%93 = call double @cost(double* %91, i32 %92)
store double %93, double* %26
%94 = load double, double* %26
%95 = load double*, double** %15
%96 = load i32, i32* %16
%97 = call i32 @self_adj_index_search(i32* %22, double %94, double* %95, i32 %96)
%98 = load double*, double** %14
%99 = load i32, i32* %22
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
%102 = load double, double* %101
%103 = fneg double %102
%104 = load double, double* %26
%105 = load double, double* %17
%106 = fdiv double %104, %105
%107 = fsub double %103, %106
%108 = load double*, double** %14
%109 = load i32, i32* %21
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = fadd double %107, %112
%114 = load double*, double** %12
%115 = load double, double* %114
%116 = load double, double* %17
%117 = fdiv double %115, %116
%118 = fadd double %113, %117
store double %118, double* %27
%119 = load double, double* %27
%120 = fcmp ogt double %119, 0.000000e+00
br i1 %120, label %121, label %122
121: ; preds = %90
br label %125
122: ; preds = %90
%123 = load double, double* %27
%124 = call double @exp(double %123)
br label %125
125: ; preds = %122, %121
%126 = phi double [ 1.000000e+00, %121 ], [ %124, %122 ]
%127 = load double*, double** %19
store double %126, double* %127
%128 = call double (...) @uniformrng()
store double %128, double* %28
%129 = load double*, double** %19
%130 = load double, double* %129
%131 = load double, double* %28
%132 = fcmp ogt double %130, %131
br i1 %132, label %133, label %154
133: ; preds = %125
%134 = load double, double* %26
%135 = load double*, double** %12
store double %134, double* %135
store i32 1, i32* %23
br label %136
136: ; preds = %150, %133
%137 = load i32, i32* %23
%138 = load i32, i32* %13
%139 = icmp sle i32 %137, %138
br i1 %139, label %140, label %153
140: ; preds = %136
%141 = load double*, double** %20
%142 = load i32, i32* %23
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = load double*, double** %11
%147 = load i32, i32* %23
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %146, i64 %148
store double %145, double* %149
br label %150
150: ; preds = %140
%151 = load i32, i32* %23
%152 = add nsw i32 %151, 1
store i32 %152, i32* %23
br label %136
153: ; preds = %136
br label %154
154: ; preds = %153, %125
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 = sext i32 %152 to i64
%156 = getelementptr inbounds double, double* %9, i64 %155
%157 = load double, double* %156
%158 = fadd double %157, %154
store double %158, double* %156
%159 = call double (...) @uniformrng()
%160 = fcmp olt double %159, 5.000000e-01
%161 = icmp sgt i32 %2, 1
%162 = and i1 %161, %160
br i1 %162, label %163, label %175
163: ; preds = %151
%164 = add nsw i32 %2, -1
%165 = call i32 @integerrng(i32 1, i32 %164)
%166 = icmp sge i32 %165, %152
%167 = zext i1 %166 to i32
%168 = add nsw i32 %165, %167
%169 = call double (...) @normalrng()
%170 = fmul double %169, %7
%171 = sext i32 %168 to i64
%172 = getelementptr inbounds double, double* %9, i64 %171
%173 = load double, double* %172
%174 = fadd double %173, %170
store double %174, double* %172
br label %175
175: ; preds = %163, %151
%176 = call double @cost(double* %9, i32 %2)
%177 = call i32 @self_adj_index_search(i32* %12, double %176, double* %4, i32 %5)
%178 = load i32, i32* %12
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %3, i64 %179
%181 = load double, double* %180
%182 = fneg double %181
%183 = fdiv double %176, %6
%184 = fsub double %182, %183
%185 = load i32, i32* %11
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %3, i64 %186
%188 = load double, double* %187
%189 = fadd double %184, %188
%190 = load double, double* %1
%191 = fdiv double %190, %6
%192 = fadd double %189, %191
%193 = fcmp ogt double %192, 0.000000e+00
br i1 %193, label %196, label %194
194: ; preds = %175
%195 = call double @exp(double %192)
br label %196
196: ; preds = %175, %194
%197 = phi double [ %195, %194 ], [ 1.000000e+00, %175 ]
store double %197, double* %8
%198 = call double (...) @uniformrng()
%199 = load double, double* %8
%200 = fcmp ogt double %199, %198
br i1 %200, label %201, label %335
201: ; preds = %196
store double %176, double* %1
br i1 %17, label %335, label %202
202: ; preds = %201
%203 = add nuw i32 %2, 1
%204 = zext i32 %203 to i64
%205 = add nsw i64 %204, -1
%206 = icmp ult i64 %205, 4
br i1 %206, label %297, label %207
207: ; preds = %202
%208 = getelementptr double, double* %0, i64 1
%209 = getelementptr double, double* %0, i64 %204
%210 = getelementptr double, double* %9, i64 1
%211 = getelementptr double, double* %9, i64 %204
%212 = icmp ult double* %208, %211
%213 = icmp ult double* %210, %209
%214 = and i1 %212, %213
br i1 %214, label %297, label %215
215: ; preds = %207
%216 = and i64 %205, -4
%217 = or i64 %216, 1
%218 = add nsw i64 %216, -4
%219 = lshr exact i64 %218, 2
%220 = add nuw nsw i64 %219, 1
%221 = and i64 %220, 3
%222 = icmp ult i64 %218, 12
br i1 %222, label %275, label %223
223: ; preds = %215
%224 = and i64 %220, 9223372036854775804
br label %225
225: ; preds = %225, %223
%226 = phi i64 [ 0, %223 ], [ %272, %225 ]
%227 = phi i64 [ 0, %223 ], [ %273, %225 ]
%228 = or i64 %226, 1
%229 = getelementptr inbounds double, double* %9, i64 %228
%230 = bitcast double* %229 to <2 x double>*
%231 = load <2 x double>, <2 x double>* %230
%232 = getelementptr inbounds double, double* %229, i64 2
%233 = bitcast double* %232 to <2 x double>*
%234 = load <2 x double>, <2 x double>* %233
%235 = getelementptr inbounds double, double* %0, i64 %228
%236 = bitcast double* %235 to <2 x double>*
store <2 x double> %231, <2 x double>* %236
%237 = getelementptr inbounds double, double* %235, i64 2
%238 = bitcast double* %237 to <2 x double>*
store <2 x double> %234, <2 x double>* %238
%239 = or i64 %226, 5
%240 = getelementptr inbounds double, double* %9, i64 %239
%241 = bitcast double* %240 to <2 x double>*
%242 = load <2 x double>, <2 x double>* %241
%243 = getelementptr inbounds double, double* %240, i64 2
%244 = bitcast double* %243 to <2 x double>*
%245 = load <2 x double>, <2 x double>* %244
%246 = getelementptr inbounds double, double* %0, i64 %239
%247 = bitcast double* %246 to <2 x double>*
store <2 x double> %242, <2 x double>* %247
%248 = getelementptr inbounds double, double* %246, i64 2
%249 = bitcast double* %248 to <2 x double>*
store <2 x double> %245, <2 x double>* %249
%250 = or i64 %226, 9
%251 = getelementptr inbounds double, double* %9, i64 %250
%252 = bitcast double* %251 to <2 x double>*
%253 = load <2 x double>, <2 x double>* %252
%254 = getelementptr inbounds double, double* %251, i64 2
%255 = bitcast double* %254 to <2 x double>*
%256 = load <2 x double>, <2 x double>* %255
%257 = getelementptr inbounds double, double* %0, i64 %250
%258 = bitcast double* %257 to <2 x double>*
store <2 x double> %253, <2 x double>* %258
%259 = getelementptr inbounds double, double* %257, i64 2
%260 = bitcast double* %259 to <2 x double>*
store <2 x double> %256, <2 x double>* %260
%261 = or i64 %226, 13
%262 = getelementptr inbounds double, double* %9, i64 %261
%263 = bitcast double* %262 to <2 x double>*
%264 = load <2 x double>, <2 x double>* %263
%265 = getelementptr inbounds double, double* %262, i64 2
%266 = bitcast double* %265 to <2 x double>*
%267 = load <2 x double>, <2 x double>* %266
%268 = getelementptr inbounds double, double* %0, i64 %261
%269 = bitcast double* %268 to <2 x double>*
store <2 x double> %264, <2 x double>* %269
%270 = getelementptr inbounds double, double* %268, i64 2
%271 = bitcast double* %270 to <2 x double>*
store <2 x double> %267, <2 x double>* %271
%272 = add nuw i64 %226, 16
%273 = add nuw i64 %227, 4
%274 = icmp eq i64 %273, %224
br i1 %274, label %275, label %225
275: ; preds = %225, %215
%276 = phi i64 [ 0, %215 ], [ %272, %225 ]
%277 = icmp eq i64 %221, 0
br i1 %277, label %295, label %278
278: ; preds = %275, %278
%279 = phi i64 [ %292, %278 ], [ %276, %275 ]
%280 = phi i64 [ %293, %278 ], [ 0, %275 ]
%281 = or i64 %279, 1
%282 = getelementptr inbounds double, double* %9, i64 %281
%283 = bitcast double* %282 to <2 x double>*
%284 = load <2 x double>, <2 x double>* %283
%285 = getelementptr inbounds double, double* %282, i64 2
%286 = bitcast double* %285 to <2 x double>*
%287 = load <2 x double>, <2 x double>* %286
%288 = getelementptr inbounds double, double* %0, i64 %281
%289 = bitcast double* %288 to <2 x double>*
store <2 x double> %284, <2 x double>* %289
%290 = getelementptr inbounds double, double* %288, i64 2
%291 = bitcast double* %290 to <2 x double>*
store <2 x double> %287, <2 x double>* %291
%292 = add nuw i64 %279, 4
%293 = add i64 %280, 1
%294 = icmp eq i64 %293, %221
br i1 %294, label %295, label %278
295: ; preds = %278, %275
%296 = icmp eq i64 %205, %216
br i1 %296, label %335, label %297
297: ; preds = %207, %202, %295
%298 = phi i64 [ 1, %207 ], [ 1, %202 ], [ %217, %295 ]
%299 = sub nsw i64 %204, %298
%300 = xor i64 %298, -1
%301 = add nsw i64 %300, %204
%302 = and i64 %299, 3
%303 = icmp eq i64 %302, 0
br i1 %303, label %313, label %304
304: ; preds = %297, %304
%305 = phi i64 [ %310, %304 ], [ %298, %297 ]
%306 = phi i64 [ %311, %304 ], [ 0, %297 ]
%307 = getelementptr inbounds double, double* %9, i64 %305
%308 = load double, double* %307
%309 = getelementptr inbounds double, double* %0, i64 %305
store double %308, double* %309
%310 = add nuw nsw i64 %305, 1
%311 = add i64 %306, 1
%312 = icmp eq i64 %311, %302
br i1 %312, label %313, label %304
313: ; preds = %304, %297
%314 = phi i64 [ %298, %297 ], [ %310, %304 ]
%315 = icmp ult i64 %301, 3
br i1 %315, label %335, label %316
316: ; preds = %313, %316
%317 = phi i64 [ %333, %316 ], [ %314, %313 ]
%318 = getelementptr inbounds double, double* %9, i64 %317
%319 = load double, double* %318
%320 = getelementptr inbounds double, double* %0, i64 %317
store double %319, double* %320
%321 = add nuw nsw i64 %317, 1
%322 = getelementptr inbounds double, double* %9, i64 %321
%323 = load double, double* %322
%324 = getelementptr inbounds double, double* %0, i64 %321
store double %323, double* %324
%325 = add nuw nsw i64 %317, 2
%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 %317, 3
%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 %317, 4
%334 = icmp eq i64 %333, %204
br i1 %334, label %335, label %316
335: ; preds = %313, %316, %295, %201, %196
ret void
}