#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();
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;
  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    $0x70,%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,-0x68(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     121b <Mutation_HitAndRun+0xbb>
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    11cd <Mutation_HitAndRun+0x6d>
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    12ba <Mutation_HitAndRun+0x15a>
movsd  0xd50(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    12c9 <Mutation_HitAndRun+0x169>
movsd  -0x60(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%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    1342 <Mutation_HitAndRun+0x1e2>
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     133d <Mutation_HitAndRun+0x1dd>
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    1309 <Mutation_HitAndRun+0x1a9>
jmp    1342 <Mutation_HitAndRun+0x1e2>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mutation_HitAndRun>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %r9d,%ebp
mov    %r8,%r12
mov    %rcx,0x10(%rsp)
mov    %edx,%r13d
mov    %rdi,%rbx
mov    0x68(%rsp),%r14
mov    %rsi,0x20(%rsp)
movsd  (%rsi),%xmm0
lea    0xc(%rsp),%rdi
mov    %r8,%rsi
mov    %r9d,%edx
call   1050 <self_adj_index_search@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1060 <uniformdirectionrng@plt>
xor    %eax,%eax
call   1080 <normalrng@plt>
test   %r13d,%r13d
jle    1366 <Mutation_HitAndRun+0x206>
mulsd  (%rsp),%xmm0
mov    %r13d,%r8d
lea    0x1(%r8),%rax
mov    $0x1,%ecx
cmp    $0x4,%r13d
jb     1306 <Mutation_HitAndRun+0x1a6>
lea    0x8(%r14),%rdx
lea    (%rbx,%rax,8),%rsi
cmp    %rsi,%rdx
jae    11fc <Mutation_HitAndRun+0x9c>
lea    (%r14,%rax,8),%rdx
lea    0x8(%rbx),%rsi
cmp    %rdx,%rsi
jb     1306 <Mutation_HitAndRun+0x1a6>
mov    %r8d,%ecx
and    $0xfffffffc,%ecx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rcx),%rdx
mov    %rdx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
test   %rdx,%rdx
je     1471 <Mutation_HitAndRun+0x311>
movabs $0x7ffffffffffffffc,%rdx
ff ff 7f
or     $0x2,%rdx
and    %rdi,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nop
movupd 0x8(%rbx,%rsi,8),%xmm2
movupd 0x18(%rbx,%rsi,8),%xmm3
movupd 0x8(%r14,%rsi,8),%xmm4
movupd 0x18(%r14,%rsi,8),%xmm5
movupd 0x28(%r14,%rsi,8),%xmm6
movupd 0x38(%r14,%rsi,8),%xmm7
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,0x8(%r14,%rsi,8)
movupd %xmm5,0x18(%r14,%rsi,8)
movupd 0x28(%rbx,%rsi,8),%xmm2
movupd 0x38(%rbx,%rsi,8),%xmm3
mulpd  %xmm1,%xmm6
addpd  %xmm2,%xmm6
mulpd  %xmm1,%xmm7
addpd  %xmm3,%xmm7
movupd %xmm6,0x28(%r14,%rsi,8)
movupd %xmm7,0x38(%r14,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdx
jne    1240 <Mutation_HitAndRun+0xe0>
test   $0x1,%dil
je     12fd <Mutation_HitAndRun+0x19d>
shl    $0x3,%rsi
or     $0x8,%rsi
movupd (%rbx,%rsi,1),%xmm2
movupd 0x10(%rbx,%rsi,1),%xmm3
movupd (%r14,%rsi,1),%xmm4
movupd 0x10(%r14,%rsi,1),%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,(%r14,%rsi,1)
movupd %xmm5,0x10(%r14,%rsi,1)
cmp    %rcx,%r8
je     1366 <Mutation_HitAndRun+0x206>
or     $0x1,%rcx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
jne    1329 <Mutation_HitAndRun+0x1c9>
movsd  (%r14,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rcx,8),%xmm1
movsd  %xmm1,(%r14,%rcx,8)
add    $0x1,%rcx
add    %rax,%rdx
je     1366 <Mutation_HitAndRun+0x206>
xchg   %ax,%ax
movsd  (%r14,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rcx,8),%xmm1
movsd  %xmm1,(%r14,%rcx,8)
movsd  0x8(%r14,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rbx,%rcx,8),%xmm1
movsd  %xmm1,0x8(%r14,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    1330 <Mutation_HitAndRun+0x1d0>
mov    0x60(%rsp),%r15
mov    %r14,%rdi
mov    %r13d,%esi
call   1040 <cost@plt>
movsd  %xmm0,(%rsp)
lea    0x8(%rsp),%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1050 <self_adj_index_search@plt>
movslq 0x8(%rsp),%rax
mov    0x10(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm1
xorpd  0xc5f(%rip),%xmm1
movsd  (%rsp),%xmm0
movsd  0x18(%rsp),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movslq 0xc(%rsp),%rax
addsd  (%rcx,%rax,8),%xmm1
mov    0x20(%rsp),%rbp
movsd  0x0(%rbp),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13e4 <Mutation_HitAndRun+0x284>
movsd  0xc2e(%rip),%xmm0
jmp    13e9 <Mutation_HitAndRun+0x289>
call   1070 <exp@plt>
movsd  %xmm0,(%r15)
xor    %eax,%eax
call   1030 <uniformrng@plt>
movsd  (%r15),%xmm1
ucomisd %xmm0,%xmm1
jbe    15ab <Mutation_HitAndRun+0x44b>
movsd  (%rsp),%xmm0
movsd  %xmm0,0x0(%rbp)
test   %r13d,%r13d
jle    15ab <Mutation_HitAndRun+0x44b>
mov    %r13d,%edx
lea    0x1(%rdx),%rax
mov    $0x1,%ecx
cmp    $0x4,%r13d
jb     1537 <Mutation_HitAndRun+0x3d7>
lea    0x8(%rbx),%rsi
lea    (%r14,%rax,8),%rdi
cmp    %rdi,%rsi
jae    144b <Mutation_HitAndRun+0x2eb>
lea    (%rbx,%rax,8),%rsi
lea    0x8(%r14),%rdi
cmp    %rsi,%rdi
jb     1537 <Mutation_HitAndRun+0x3d7>
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    1482 <Mutation_HitAndRun+0x322>
xor    %edi,%edi
jmp    14f6 <Mutation_HitAndRun+0x396>
xor    %esi,%esi
test   $0x1,%dil
jne    12c0 <Mutation_HitAndRun+0x160>
jmp    12fd <Mutation_HitAndRun+0x19d>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
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    1490 <Mutation_HitAndRun+0x330>
test   %rbp,%rbp
je     152e <Mutation_HitAndRun+0x3ce>
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    1500 <Mutation_HitAndRun+0x3a0>
cmp    %rcx,%rdx
je     15ab <Mutation_HitAndRun+0x44b>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     1565 <Mutation_HitAndRun+0x405>
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1550 <Mutation_HitAndRun+0x3f0>
cmp    $0x3,%rdx
jb     15ab <Mutation_HitAndRun+0x44b>
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    1570 <Mutation_HitAndRun+0x410>
add    $0x28,%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
store double %37, double* %26
store i32 1, i32* %23
br label %38
38: ; preds = %59, %10
%39 = load i32, i32* %23
%40 = load i32, i32* %13
%41 = icmp sle i32 %39, %40
br i1 %41, label %42, label %62
42: ; preds = %38
%43 = load double*, double** %11
%44 = load i32, i32* %23
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = load double*, double** %20
%49 = load i32, i32* %23
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
%52 = load double, double* %51
%53 = load double, double* %26
%54 = call double @llvm.fmuladd.f64(double %52, double %53, double %47)
%55 = load double*, double** %20
%56 = load i32, i32* %23
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
store double %54, double* %58
br label %59
59: ; preds = %42
%60 = load i32, i32* %23
%61 = add nsw i32 %60, 1
store i32 %61, i32* %23
br label %38
62: ; preds = %38
%63 = load double*, double** %20
%64 = load i32, i32* %13
%65 = call double @cost(double* %63, i32 %64)
store double %65, double* %24
%66 = load double, double* %24
%67 = load double*, double** %15
%68 = load i32, i32* %16
%69 = call i32 @self_adj_index_search(i32* %22, double %66, double* %67, i32 %68)
%70 = load double*, double** %14
%71 = load i32, i32* %22
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = fneg double %74
%76 = load double, double* %24
%77 = load double, double* %17
%78 = fdiv double %76, %77
%79 = fsub double %75, %78
%80 = load double*, double** %14
%81 = load i32, i32* %21
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
%85 = fadd double %79, %84
%86 = load double*, double** %12
%87 = load double, double* %86
%88 = load double, double* %17
%89 = fdiv double %87, %88
%90 = fadd double %85, %89
store double %90, double* %25
%91 = load double, double* %25
%92 = fcmp ogt double %91, 0.000000e+00
br i1 %92, label %93, label %94
93: ; preds = %62
br label %97
94: ; preds = %62
%95 = load double, double* %25
%96 = call double @exp(double %95)
br label %97
97: ; preds = %94, %93
%98 = phi double [ 1.000000e+00, %93 ], [ %96, %94 ]
%99 = load double*, double** %19
store double %98, double* %99
%100 = call double (...) @uniformrng()
store double %100, double* %26
%101 = load double*, double** %19
%102 = load double, double* %101
%103 = load double, double* %26
%104 = fcmp ogt double %102, %103
br i1 %104, label %105, label %126
105: ; preds = %97
%106 = load double, double* %24
%107 = load double*, double** %12
store double %106, double* %107
store i32 1, i32* %23
br label %108
108: ; preds = %122, %105
%109 = load i32, i32* %23
%110 = load i32, i32* %13
%111 = icmp sle i32 %109, %110
br i1 %111, label %112, label %125
112: ; preds = %108
%113 = load double*, double** %20
%114 = load i32, i32* %23
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %113, i64 %115
%117 = load double, double* %116
%118 = load double*, double** %11
%119 = load i32, i32* %23
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
store double %117, double* %121
br label %122
122: ; preds = %112
%123 = load i32, i32* %23
%124 = add nsw i32 %123, 1
store i32 %124, i32* %23
br label %108
125: ; preds = %108
br label %126
126: ; preds = %125, %97
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 = icmp slt i32 %2, 1
br i1 %20, label %142, label %21
21: ; preds = %10
%22 = add nuw i32 %2, 1
%23 = zext i32 %22 to i64
%24 = add nsw i64 %23, -1
%25 = icmp ult i64 %24, 4
br i1 %25, label %111, label %26
26: ; preds = %21
%27 = getelementptr double, double* %9, i64 1
%28 = getelementptr double, double* %9, i64 %23
%29 = getelementptr double, double* %0, i64 1
%30 = getelementptr double, double* %0, i64 %23
%31 = icmp ult double* %27, %30
%32 = icmp ult double* %29, %28
%33 = and i1 %31, %32
br i1 %33, label %111, label %34
34: ; preds = %26
%35 = and i64 %24, -4
%36 = or i64 %35, 1
%37 = insertelement <2 x double> poison, double %19, i64 0
%38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
%39 = insertelement <2 x double> poison, double %19, i64 0
%40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
%41 = add nsw i64 %35, -4
%42 = lshr exact i64 %41, 2
%43 = add nuw nsw i64 %42, 1
%44 = and i64 %43, 1
%45 = icmp eq i64 %41, 0
br i1 %45, label %88, label %46
46: ; preds = %34
%47 = and i64 %43, 9223372036854775806
br label %48
48: ; preds = %48, %46
%49 = phi i64 [ 0, %46 ], [ %85, %48 ]
%50 = phi i64 [ 0, %46 ], [ %86, %48 ]
%51 = or i64 %49, 1
%52 = getelementptr inbounds double, double* %0, i64 %51
%53 = bitcast double* %52 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = getelementptr inbounds double, double* %52, i64 2
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = getelementptr inbounds double, double* %9, i64 %51
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = getelementptr inbounds double, double* %58, i64 2
%62 = bitcast double* %61 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %60, <2 x double> %38, <2 x double> %54)
%65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %63, <2 x double> %40, <2 x double> %57)
%66 = bitcast double* %58 to <2 x double>*
store <2 x double> %64, <2 x double>* %66
%67 = bitcast double* %61 to <2 x double>*
store <2 x double> %65, <2 x double>* %67
%68 = or i64 %49, 5
%69 = getelementptr inbounds double, double* %0, i64 %68
%70 = bitcast double* %69 to <2 x double>*
%71 = load <2 x double>, <2 x double>* %70
%72 = getelementptr inbounds double, double* %69, i64 2
%73 = bitcast double* %72 to <2 x double>*
%74 = load <2 x double>, <2 x double>* %73
%75 = getelementptr inbounds double, double* %9, i64 %68
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = getelementptr inbounds double, double* %75, i64 2
%79 = bitcast double* %78 to <2 x double>*
%80 = load <2 x double>, <2 x double>* %79
%81 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %77, <2 x double> %38, <2 x double> %71)
%82 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %80, <2 x double> %40, <2 x double> %74)
%83 = bitcast double* %75 to <2 x double>*
store <2 x double> %81, <2 x double>* %83
%84 = bitcast double* %78 to <2 x double>*
store <2 x double> %82, <2 x double>* %84
%85 = add nuw i64 %49, 8
%86 = add i64 %50, 2
%87 = icmp eq i64 %86, %47
br i1 %87, label %88, label %48
88: ; preds = %48, %34
%89 = phi i64 [ 0, %34 ], [ %85, %48 ]
%90 = icmp eq i64 %44, 0
br i1 %90, label %109, label %91
91: ; preds = %88
%92 = or i64 %89, 1
%93 = getelementptr inbounds double, double* %0, i64 %92
%94 = bitcast double* %93 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94
%96 = getelementptr inbounds double, double* %93, i64 2
%97 = bitcast double* %96 to <2 x double>*
%98 = load <2 x double>, <2 x double>* %97
%99 = getelementptr inbounds double, double* %9, i64 %92
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %99, i64 2
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %101, <2 x double> %38, <2 x double> %95)
%106 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %104, <2 x double> %40, <2 x double> %98)
%107 = bitcast double* %99 to <2 x double>*
store <2 x double> %105, <2 x double>* %107
%108 = bitcast double* %102 to <2 x double>*
store <2 x double> %106, <2 x double>* %108
br label %109
109: ; preds = %88, %91
%110 = icmp eq i64 %24, %35
br i1 %110, label %142, label %111
111: ; preds = %26, %21, %109
%112 = phi i64 [ 1, %26 ], [ 1, %21 ], [ %36, %109 ]
%113 = xor i64 %112, -1
%114 = and i64 %23, 1
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %123
116: ; preds = %111
%117 = getelementptr inbounds double, double* %0, i64 %112
%118 = load double, double* %117
%119 = getelementptr inbounds double, double* %9, i64 %112
%120 = load double, double* %119
%121 = call double @llvm.fmuladd.f64(double %120, double %19, double %118)
store double %121, double* %119
%122 = add nuw nsw i64 %112, 1
br label %123
123: ; preds = %116, %111
%124 = phi i64 [ %112, %111 ], [ %122, %116 ]
%125 = sub nsw i64 0, %23
%126 = icmp eq i64 %113, %125
br i1 %126, label %142, label %127
127: ; preds = %123, %127
%128 = phi i64 [ %140, %127 ], [ %124, %123 ]
%129 = getelementptr inbounds double, double* %0, i64 %128
%130 = load double, double* %129
%131 = getelementptr inbounds double, double* %9, i64 %128
%132 = load double, double* %131
%133 = call double @llvm.fmuladd.f64(double %132, double %19, double %130)
store double %133, double* %131
%134 = add nuw nsw i64 %128, 1
%135 = getelementptr inbounds double, double* %0, i64 %134
%136 = load double, double* %135
%137 = getelementptr inbounds double, double* %9, i64 %134
%138 = load double, double* %137
%139 = call double @llvm.fmuladd.f64(double %138, double %19, double %136)
store double %139, double* %137
%140 = add nuw nsw i64 %128, 2
%141 = icmp eq i64 %140, %23
br i1 %141, label %142, label %127
142: ; preds = %123, %127, %109, %10
%143 = call double @cost(double* %9, i32 %2)
%144 = call i32 @self_adj_index_search(i32* %12, double %143, double* %4, i32 %5)
%145 = load i32, i32* %12
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %3, i64 %146
%148 = load double, double* %147
%149 = fneg double %148
%150 = fdiv double %143, %6
%151 = fsub double %149, %150
%152 = load i32, i32* %11
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %3, i64 %153
%155 = load double, double* %154
%156 = fadd double %151, %155
%157 = load double, double* %1
%158 = fdiv double %157, %6
%159 = fadd double %156, %158
%160 = fcmp ogt double %159, 0.000000e+00
br i1 %160, label %163, label %161
161: ; preds = %142
%162 = call double @exp(double %159)
br label %163
163: ; preds = %142, %161
%164 = phi double [ %162, %161 ], [ 1.000000e+00, %142 ]
store double %164, double* %8
%165 = call double (...) @uniformrng()
%166 = load double, double* %8
%167 = fcmp ogt double %166, %165
br i1 %167, label %168, label %302
168: ; preds = %163
store double %143, double* %1
br i1 %20, label %302, label %169
169: ; preds = %168
%170 = add nuw i32 %2, 1
%171 = zext i32 %170 to i64
%172 = add nsw i64 %171, -1
%173 = icmp ult i64 %172, 4
br i1 %173, label %264, label %174
174: ; preds = %169
%175 = getelementptr double, double* %0, i64 1
%176 = getelementptr double, double* %0, i64 %171
%177 = getelementptr double, double* %9, i64 1
%178 = getelementptr double, double* %9, i64 %171
%179 = icmp ult double* %175, %178
%180 = icmp ult double* %177, %176
%181 = and i1 %179, %180
br i1 %181, label %264, label %182
182: ; preds = %174
%183 = and i64 %172, -4
%184 = or i64 %183, 1
%185 = add nsw i64 %183, -4
%186 = lshr exact i64 %185, 2
%187 = add nuw nsw i64 %186, 1
%188 = and i64 %187, 3
%189 = icmp ult i64 %185, 12
br i1 %189, label %242, label %190
190: ; preds = %182
%191 = and i64 %187, 9223372036854775804
br label %192
192: ; preds = %192, %190
%193 = phi i64 [ 0, %190 ], [ %239, %192 ]
%194 = phi i64 [ 0, %190 ], [ %240, %192 ]
%195 = or i64 %193, 1
%196 = getelementptr inbounds double, double* %9, i64 %195
%197 = bitcast double* %196 to <2 x double>*
%198 = load <2 x double>, <2 x double>* %197
%199 = getelementptr inbounds double, double* %196, i64 2
%200 = bitcast double* %199 to <2 x double>*
%201 = load <2 x double>, <2 x double>* %200
%202 = getelementptr inbounds double, double* %0, i64 %195
%203 = bitcast double* %202 to <2 x double>*
store <2 x double> %198, <2 x double>* %203
%204 = getelementptr inbounds double, double* %202, i64 2
%205 = bitcast double* %204 to <2 x double>*
store <2 x double> %201, <2 x double>* %205
%206 = or i64 %193, 5
%207 = getelementptr inbounds double, double* %9, i64 %206
%208 = bitcast double* %207 to <2 x double>*
%209 = load <2 x double>, <2 x double>* %208
%210 = getelementptr inbounds double, double* %207, i64 2
%211 = bitcast double* %210 to <2 x double>*
%212 = load <2 x double>, <2 x double>* %211
%213 = getelementptr inbounds double, double* %0, i64 %206
%214 = bitcast double* %213 to <2 x double>*
store <2 x double> %209, <2 x double>* %214
%215 = getelementptr inbounds double, double* %213, i64 2
%216 = bitcast double* %215 to <2 x double>*
store <2 x double> %212, <2 x double>* %216
%217 = or i64 %193, 9
%218 = getelementptr inbounds double, double* %9, i64 %217
%219 = bitcast double* %218 to <2 x double>*
%220 = load <2 x double>, <2 x double>* %219
%221 = getelementptr inbounds double, double* %218, i64 2
%222 = bitcast double* %221 to <2 x double>*
%223 = load <2 x double>, <2 x double>* %222
%224 = getelementptr inbounds double, double* %0, i64 %217
%225 = bitcast double* %224 to <2 x double>*
store <2 x double> %220, <2 x double>* %225
%226 = getelementptr inbounds double, double* %224, i64 2
%227 = bitcast double* %226 to <2 x double>*
store <2 x double> %223, <2 x double>* %227
%228 = or i64 %193, 13
%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 = add nuw i64 %193, 16
%240 = add nuw i64 %194, 4
%241 = icmp eq i64 %240, %191
br i1 %241, label %242, label %192
242: ; preds = %192, %182
%243 = phi i64 [ 0, %182 ], [ %239, %192 ]
%244 = icmp eq i64 %188, 0
br i1 %244, label %262, label %245
245: ; preds = %242, %245
%246 = phi i64 [ %259, %245 ], [ %243, %242 ]
%247 = phi i64 [ %260, %245 ], [ 0, %242 ]
%248 = or i64 %246, 1
%249 = getelementptr inbounds double, double* %9, i64 %248
%250 = bitcast double* %249 to <2 x double>*
%251 = load <2 x double>, <2 x double>* %250
%252 = getelementptr inbounds double, double* %249, i64 2
%253 = bitcast double* %252 to <2 x double>*
%254 = load <2 x double>, <2 x double>* %253
%255 = getelementptr inbounds double, double* %0, i64 %248
%256 = bitcast double* %255 to <2 x double>*
store <2 x double> %251, <2 x double>* %256
%257 = getelementptr inbounds double, double* %255, i64 2
%258 = bitcast double* %257 to <2 x double>*
store <2 x double> %254, <2 x double>* %258
%259 = add nuw i64 %246, 4
%260 = add i64 %247, 1
%261 = icmp eq i64 %260, %188
br i1 %261, label %262, label %245
262: ; preds = %245, %242
%263 = icmp eq i64 %172, %183
br i1 %263, label %302, label %264
264: ; preds = %174, %169, %262
%265 = phi i64 [ 1, %174 ], [ 1, %169 ], [ %184, %262 ]
%266 = sub nsw i64 %171, %265
%267 = xor i64 %265, -1
%268 = add nsw i64 %267, %171
%269 = and i64 %266, 3
%270 = icmp eq i64 %269, 0
br i1 %270, label %280, label %271
271: ; preds = %264, %271
%272 = phi i64 [ %277, %271 ], [ %265, %264 ]
%273 = phi i64 [ %278, %271 ], [ 0, %264 ]
%274 = getelementptr inbounds double, double* %9, i64 %272
%275 = load double, double* %274
%276 = getelementptr inbounds double, double* %0, i64 %272
store double %275, double* %276
%277 = add nuw nsw i64 %272, 1
%278 = add i64 %273, 1
%279 = icmp eq i64 %278, %269
br i1 %279, label %280, label %271
280: ; preds = %271, %264
%281 = phi i64 [ %265, %264 ], [ %277, %271 ]
%282 = icmp ult i64 %268, 3
br i1 %282, label %302, label %283
283: ; preds = %280, %283
%284 = phi i64 [ %300, %283 ], [ %281, %280 ]
%285 = getelementptr inbounds double, double* %9, i64 %284
%286 = load double, double* %285
%287 = getelementptr inbounds double, double* %0, i64 %284
store double %286, double* %287
%288 = add nuw nsw i64 %284, 1
%289 = getelementptr inbounds double, double* %9, i64 %288
%290 = load double, double* %289
%291 = getelementptr inbounds double, double* %0, i64 %288
store double %290, double* %291
%292 = add nuw nsw i64 %284, 2
%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 %284, 3
%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 %284, 4
%301 = icmp eq i64 %300, %171
br i1 %301, label %302, label %283
302: ; preds = %280, %283, %262, %168, %163
ret void
}