#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);
double normalrng();
double pow(int, double);
int /*<<< orphan*/ self_adj_index_search(int *, double, double *, int);
int /*<<< orphan*/ uniformdirectionrng(double *, int);
double uniformrng();
void Mutation_HitAndRun(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;
  double fz_new;
  double rat;
  double un;
  self_adj_index_search(&k_old, *fz, grid_points, grid_size);
  uniformdirectionrng(z_new, N_dimension);
  un = normalrng() * scl * pow(k_old / (grid_size + 1.0), 0.5);
  for (i = 1; i <= N_dimension; i++)
    z_new[i] = z[i] + z_new[i] * 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_HitAndRun>:
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>
mov    0x18(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <uniformdirectionrng@plt>
mov    $0x0,%al
call   1080 <normalrng@plt>
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
cvtsi2sdl -0x44(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xe1d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xe01(%rip),%xmm0
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     126a <Mutation_HitAndRun+0xfa>
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%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    121c <Mutation_HitAndRun+0xac>
mov    0x18(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <cost@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%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  -0x58(%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,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1309 <Mutation_HitAndRun+0x199>
movsd  0xd09(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1318 <Mutation_HitAndRun+0x1a8>
movsd  -0x60(%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,-0x68(%rbp)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    1391 <Mutation_HitAndRun+0x221>
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     138c <Mutation_HitAndRun+0x21c>
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    1358 <Mutation_HitAndRun+0x1e8>
jmp    1391 <Mutation_HitAndRun+0x221>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mutation_HitAndRun>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x38(%rsp)
mov    %r9d,%r13d
mov    %r8,%rbp
mov    %rcx,0x30(%rsp)
mov    %edx,%r12d
mov    %rdi,%rbx
mov    0x88(%rsp),%r14
mov    %rsi,0x40(%rsp)
movsd  (%rsi),%xmm0
lea    0x8(%rsp),%rdi
mov    %r8,%rsi
mov    %r9d,%edx
call   1050 <self_adj_index_search@plt>
mov    %r14,%rdi
mov    %r12d,%esi
call   1060 <uniformdirectionrng@plt>
xor    %eax,%eax
call   1080 <normalrng@plt>
xorps  %xmm1,%xmm1
cvtsi2sdl 0x8(%rsp),%xmm1
cvtsi2sd %r13d,%xmm2
addsd  0xe1c(%rip),%xmm2
movaps %xmm0,0x10(%rsp)
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
movsd  0xe0f(%rip),%xmm0
call   1090 <pow@plt>
movapd 0x10(%rsp),%xmm7
test   %r12d,%r12d
jle    13b6 <Mutation_HitAndRun+0x246>
mulsd  0x28(%rsp),%xmm7
mulsd  %xmm0,%xmm7
mov    %r12d,%r8d
lea    0x1(%r8),%rax
mov    $0x1,%ecx
cmp    $0x4,%r12d
jb     1356 <Mutation_HitAndRun+0x1e6>
lea    0x8(%r14),%rdx
lea    (%rbx,%rax,8),%rsi
cmp    %rsi,%rdx
jae    124b <Mutation_HitAndRun+0xdb>
lea    (%r14,%rax,8),%rdx
lea    0x8(%rbx),%rsi
cmp    %rdx,%rsi
jb     1356 <Mutation_HitAndRun+0x1e6>
mov    %r8d,%ecx
and    $0xfffffffc,%ecx
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
lea    -0x4(%rcx),%rdx
mov    %rdx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
test   %rdx,%rdx
je     14c8 <Mutation_HitAndRun+0x358>
movabs $0x7ffffffffffffffc,%rdx
ff ff 7f
or     $0x2,%rdx
and    %rdi,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd 0x8(%rbx,%rsi,8),%xmm1
movupd 0x18(%rbx,%rsi,8),%xmm2
movupd 0x8(%r14,%rsi,8),%xmm3
movupd 0x18(%r14,%rsi,8),%xmm4
movupd 0x28(%r14,%rsi,8),%xmm5
movupd 0x38(%r14,%rsi,8),%xmm6
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm4
addpd  %xmm2,%xmm4
movupd %xmm3,0x8(%r14,%rsi,8)
movupd %xmm4,0x18(%r14,%rsi,8)
movupd 0x28(%rbx,%rsi,8),%xmm1
movupd 0x38(%rbx,%rsi,8),%xmm2
mulpd  %xmm0,%xmm5
addpd  %xmm1,%xmm5
mulpd  %xmm0,%xmm6
addpd  %xmm2,%xmm6
movupd %xmm5,0x28(%r14,%rsi,8)
movupd %xmm6,0x38(%r14,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdx
jne    1290 <Mutation_HitAndRun+0x120>
test   $0x1,%dil
je     134d <Mutation_HitAndRun+0x1dd>
shl    $0x3,%rsi
or     $0x8,%rsi
movupd (%rbx,%rsi,1),%xmm1
movupd 0x10(%rbx,%rsi,1),%xmm2
movupd (%r14,%rsi,1),%xmm3
movupd 0x10(%r14,%rsi,1),%xmm4
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm4
addpd  %xmm2,%xmm4
movupd %xmm3,(%r14,%rsi,1)
movupd %xmm4,0x10(%r14,%rsi,1)
cmp    %rcx,%r8
je     13b6 <Mutation_HitAndRun+0x246>
or     $0x1,%rcx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
jne    1379 <Mutation_HitAndRun+0x209>
movsd  (%r14,%rcx,8),%xmm0
mulsd  %xmm7,%xmm0
addsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
add    $0x1,%rcx
add    %rax,%rdx
je     13b6 <Mutation_HitAndRun+0x246>
xchg   %ax,%ax
movsd  (%r14,%rcx,8),%xmm0
mulsd  %xmm7,%xmm0
addsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
movsd  0x8(%r14,%rcx,8),%xmm0
mulsd  %xmm7,%xmm0
addsd  0x8(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r14,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    1380 <Mutation_HitAndRun+0x210>
mov    0x80(%rsp),%r15
mov    %r14,%rdi
mov    %r12d,%esi
call   1040 <cost@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
call   1050 <self_adj_index_search@plt>
movslq 0xc(%rsp),%rax
mov    0x30(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm1
xorpd  0xc1a(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x38(%rsp),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movslq 0x8(%rsp),%rax
addsd  (%rcx,%rax,8),%xmm1
mov    0x40(%rsp),%rbp
movsd  0x0(%rbp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    143a <Mutation_HitAndRun+0x2ca>
movsd  0xbc8(%rip),%xmm0
jmp    143f <Mutation_HitAndRun+0x2cf>
call   1070 <exp@plt>
movsd  %xmm0,(%r15)
xor    %eax,%eax
call   1030 <uniformrng@plt>
movsd  (%r15),%xmm1
ucomisd %xmm0,%xmm1
jbe    15fb <Mutation_HitAndRun+0x48b>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x0(%rbp)
test   %r12d,%r12d
jle    15fb <Mutation_HitAndRun+0x48b>
mov    %r12d,%edx
lea    0x1(%rdx),%rax
mov    $0x1,%ecx
cmp    $0x4,%r12d
jb     1587 <Mutation_HitAndRun+0x417>
lea    0x8(%rbx),%rsi
lea    (%r14,%rax,8),%rdi
cmp    %rdi,%rsi
jae    14a2 <Mutation_HitAndRun+0x332>
lea    (%rbx,%rax,8),%rsi
lea    0x8(%r14),%rdi
cmp    %rsi,%rdi
jb     1587 <Mutation_HitAndRun+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    14d9 <Mutation_HitAndRun+0x369>
xor    %edi,%edi
jmp    1546 <Mutation_HitAndRun+0x3d6>
xor    %esi,%esi
test   $0x1,%dil
jne    1310 <Mutation_HitAndRun+0x1a0>
jmp    134d <Mutation_HitAndRun+0x1dd>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nop
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    14e0 <Mutation_HitAndRun+0x370>
test   %rbp,%rbp
je     157e <Mutation_HitAndRun+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    1550 <Mutation_HitAndRun+0x3e0>
cmp    %rcx,%rdx
je     15fb <Mutation_HitAndRun+0x48b>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     15b5 <Mutation_HitAndRun+0x445>
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    15a0 <Mutation_HitAndRun+0x430>
cmp    $0x3,%rdx
jb     15fb <Mutation_HitAndRun+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    15c0 <Mutation_HitAndRun+0x450>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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