#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 */
scalar_t__ matrix(int, int, int);
double pow(double, int);
int /*<<< orphan*/ printf(char *, double, int);
double ran1(long *);
double wave_function(double **, double, double, int, int);
void mc_sampling(int dimension, int number_blocks, int number_particles,
                 int max_variations, int thermalization, int number_cycles,
                 double initial_correlation, double delta_correlation,
                 double *lowest_correlation, double *cumulative_e,
                 double *cumulative_e2) {
  int blocks, cycles, variate, accept, i, j;
  long idum;
  double wfnew, wfold, correlation5, energy, energy2, delta_e, lowest_energy;
  double correlation, **r_old, **r_new;
  double l, kinetic_factor, density, scale, four_epsilon;
  density = 0.3648 * 0.9;
  l = pow((number_particles / density), 0.3333333);
  scale = l / 4;
  kinetic_factor = 9.27647;
  four_epsilon = 40.88;
  correlation = initial_correlation - delta_correlation;
  idum = -1;
  r_old = (double **)matrix(number_particles, dimension, sizeof(**r_old));
  r_new = (double **)matrix(number_particles, dimension, sizeof(**r_new));
  for (i = 0; i < number_particles; i++) {
    for (j = 0; j < dimension; j++) {
      r_old[i][j] = r_new[i][j] = 0;
    }
  }
  for (i = 0; i < max_variations + 1; i++) {
    cumulative_e[i] = cumulative_e2[i] = 0;
  }
  lowest_energy = 0.;
  for (variate = 1; variate <= max_variations; variate++) {
    correlation += delta_correlation;
    correlation5 = pow(correlation, 5);
    energy = energy2 = 0;
    accept = 0;
    delta_e = 0;
    for (i = 0; i < number_particles; i++) {
      for (j = 0; j < dimension; j++) {
        r_old[i][j] = l * ran1(&idum);
      }
    }
    wfold = wave_function(r_old, correlation5, l, dimension, number_particles);
    for (blocks = 0; blocks <= number_blocks; blocks++) {
      energy = 0;
      for (cycles = 1; cycles <= number_cycles + thermalization; cycles++) {
        for (i = 0; i < number_particles; i++) {
          for (j = 0; j < dimension; j++) {
            r_new[i][j] = r_old[i][j] + scale * (ran1(&idum) - 0.5);
            if (r_new[i][j] < 0.)
              r_new[i][j] += l;
            if (r_new[i][j] > 0.)
              r_new[i][j] -= l;
          }
        }
        wfnew =
            wave_function(r_new, correlation5, l, dimension, number_particles);
        printf("wfnew/wfold %12.5E%12.5E\n", wfnew, wfold);
        if (ran1(&idum) <= wfnew / wfold) {
          for (i = 0; i < number_particles; i++) {
            for (j = 0; j < dimension; j++) {
              r_old[i][j] = r_new[i][j];
            }
          }
          wfold = wfnew;
          accept = accept + 1;
        }
        if (cycles > thermalization) {
          energy += delta_e;
        }
      }
      energy /= number_cycles;
      printf("Block %d energy %12.5E\n", blocks, energy);
      if (blocks != 0) {
        cumulative_e[variate] += energy;
        cumulative_e2[variate] += energy * energy;
      }
    }
    printf("variational parameter %12.5E accepted steps %d\n", correlation,
           accept);
    cumulative_e[variate] /= number_blocks * number_particles;
    cumulative_e2[variate] /=
        number_blocks * number_particles * number_particles;
  }
}


x86 assembly (clang, -O0):
<mc_sampling>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  0xe8b(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
cvtsi2sdl -0xc(%rbp),%xmm0
divsd  -0xb0(%rbp),%xmm0
ff
xor    %edi,%edi
call   1070 <pow@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0xe4f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xe1b(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movq   $0xffffffffffffffff,-0x48(%rbp)
ff
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x8,%edx
call   1050 <matrix@plt>
mov    %rax,-0x90(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x8,%edx
call   1050 <matrix@plt>
mov    %rax,-0x98(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12b2 <mc_sampling+0x162>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    129f <mc_sampling+0x14f>
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    124f <mc_sampling+0xff>
jmp    12a4 <mc_sampling+0x154>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    123c <mc_sampling+0xec>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    12f8 <mc_sampling+0x1a8>
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12b9 <mc_sampling+0x169>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1792 <mc_sampling+0x642>
movsd  -0x28(%rbp),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mov    $0x5,%edi
call   1070 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13e5 <mc_sampling+0x295>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13d2 <mc_sampling+0x282>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
lea    -0x48(%rbp),%rdi
call   1060 <ran1@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1378 <mc_sampling+0x228>
jmp    13d7 <mc_sampling+0x287>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1365 <mc_sampling+0x215>
mov    -0x90(%rbp),%rdi
movsd  -0x60(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <wave_function@plt>
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1727 <mc_sampling+0x5d7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jg     16a6 <mc_sampling+0x556>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1594 <mc_sampling+0x444>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1581 <mc_sampling+0x431>
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
lea    -0x48(%rbp),%rdi
call   1060 <ran1@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movsd  0xb6a(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    1520 <mc_sampling+0x3d0>
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    156e <mc_sampling+0x41e>
movsd  -0xa0(%rbp),%xmm1
ff
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1573 <mc_sampling+0x423>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1456 <mc_sampling+0x306>
jmp    1586 <mc_sampling+0x436>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1443 <mc_sampling+0x2f3>
mov    -0x98(%rbp),%rdi
movsd  -0x60(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <wave_function@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
cvttsd2si -0x58(%rbp),%esi
lea    0xa5f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x48(%rbp),%rdi
call   1060 <ran1@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1678 <mc_sampling+0x528>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1665 <mc_sampling+0x515>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1652 <mc_sampling+0x502>
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1608 <mc_sampling+0x4b8>
jmp    1657 <mc_sampling+0x507>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    15f5 <mc_sampling+0x4a5>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1693 <mc_sampling+0x543>
movsd  -0x78(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1698 <mc_sampling+0x548>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    142b <mc_sampling+0x2db>
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm0
cvttsd2si -0x68(%rbp),%esi
lea    0x978(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
je     1714 <mc_sampling+0x5c4>
movsd  -0x68(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1719 <mc_sampling+0x5c9>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1410 <mc_sampling+0x2c0>
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x38(%rbp),%esi
lea    0x921(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm1
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm1
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1307 <mc_sampling+0x1b7>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_sampling>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
movsd  %xmm1,0x70(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %r9d,0x20(%rsp)
mov    %r8d,0x1c(%rsp)
mov    %rcx,0x50(%rsp)
mov    %edx,%r14d
mov    %esi,0x10(%rsp)
mov    %edi,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  0xe6b(%rip),%xmm0
xor    %edi,%edi
call   1070 <pow@plt>
movapd %xmm0,0x60(%rsp)
movq   $0xffffffffffffffff,0xe0(%rsp)
mov    %r14d,%edi
mov    %r15d,%esi
mov    $0x8,%edx
call   1050 <matrix@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %r15d,%esi
mov    $0x8,%edx
call   1050 <matrix@plt>
mov    %rax,%rbx
mov    %r14d,%eax
mov    %rax,0x40(%rsp)
mov    %r15d,0xc(%rsp)
mov    %r15d,%r12d
mov    %r14d,0x18(%rsp)
test   %r14d,%r14d
jle    13e0 <mc_sampling+0x290>
mov    %r12d,%r11d
and    $0xfffffffc,%r11d
lea    -0x4(%r11),%r8
mov    %r8,0x30(%rsp)
shr    $0x2,%r8
add    $0x1,%r8
mov    %r8d,%r14d
and    $0x3,%r14d
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
and    %rax,%r8
mov    %r12d,%r13d
and    $0x3,%r13d
mov    %r14,%r9
shl    $0x5,%r9
xor    %r15d,%r15d
xorpd  %xmm0,%xmm0
jmp    124f <mc_sampling+0xff>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r15
cmp    0x40(%rsp),%r15
je     13e0 <mc_sampling+0x290>
cmpl   $0x0,0xc(%rsp)
jle    1240 <mc_sampling+0xf0>
mov    (%rbx,%r15,8),%rdx
mov    0x0(%rbp,%r15,8),%rax
cmpl   $0x4,0xc(%rsp)
jb     1280 <mc_sampling+0x130>
lea    (%rax,%r12,8),%rcx
cmp    %rcx,%rdx
jae    1314 <mc_sampling+0x1c4>
lea    (%rdx,%r12,8),%rcx
cmp    %rcx,%rax
jae    1314 <mc_sampling+0x1c4>
xor    %edi,%edi
mov    %rdi,%rsi
not    %rsi
add    %r12,%rsi
test   %r13,%r13
je     12ba <mc_sampling+0x16a>
mov    %r13,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movq   $0x0,(%rdx,%rdi,8)
movq   $0x0,(%rax,%rdi,8)
add    $0x1,%rdi
add    $0xffffffffffffffff,%rcx
jne    12a0 <mc_sampling+0x150>
cmp    $0x3,%rsi
jb     1240 <mc_sampling+0xf0>
movq   $0x0,(%rdx,%rdi,8)
movq   $0x0,(%rax,%rdi,8)
movq   $0x0,0x8(%rdx,%rdi,8)
movq   $0x0,0x8(%rax,%rdi,8)
movq   $0x0,0x10(%rdx,%rdi,8)
movq   $0x0,0x10(%rax,%rdi,8)
movq   $0x0,0x18(%rdx,%rdi,8)
movq   $0x0,0x18(%rax,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%r12
jne    12c0 <mc_sampling+0x170>
jmp    1240 <mc_sampling+0xf0>
cmpq   $0xc,0x30(%rsp)
jae    1320 <mc_sampling+0x1d0>
xor    %edi,%edi
jmp    1398 <mc_sampling+0x248>
mov    %r8,%r10
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nop
movupd %xmm0,(%rdx,%rdi,8)
movupd %xmm0,0x10(%rdx,%rdi,8)
movupd %xmm0,(%rax,%rdi,8)
movupd %xmm0,0x10(%rax,%rdi,8)
movupd %xmm0,0x20(%rdx,%rdi,8)
movupd %xmm0,0x30(%rdx,%rdi,8)
movupd %xmm0,0x20(%rax,%rdi,8)
movupd %xmm0,0x30(%rax,%rdi,8)
movupd %xmm0,0x40(%rdx,%rdi,8)
movupd %xmm0,0x50(%rdx,%rdi,8)
movupd %xmm0,0x40(%rax,%rdi,8)
movupd %xmm0,0x50(%rax,%rdi,8)
movupd %xmm0,0x60(%rdx,%rdi,8)
movupd %xmm0,0x70(%rdx,%rdi,8)
movupd %xmm0,0x60(%rax,%rdi,8)
movupd %xmm0,0x70(%rax,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%r10
jne    1330 <mc_sampling+0x1e0>
test   %r14,%r14
je     13cf <mc_sampling+0x27f>
lea    (%rax,%rdi,8),%rsi
add    $0x10,%rsi
lea    (%rdx,%rdi,8),%rcx
add    $0x10,%rcx
xor    %edi,%edi
nop
movupd %xmm0,-0x10(%rcx,%rdi,1)
movupd %xmm0,(%rcx,%rdi,1)
movupd %xmm0,-0x10(%rsi,%rdi,1)
movupd %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r9
jne    13b0 <mc_sampling+0x260>
mov    %r11,%rdi
cmp    %r12,%r11
je     1240 <mc_sampling+0xf0>
jmp    1282 <mc_sampling+0x132>
mov    0x50(%rsp),%r11
test   %r11d,%r11d
mov    0x18(%rsp),%r15d
js     1bda <mc_sampling+0xa8a>
mov    0x130(%rsp),%r9
mov    0x128(%rsp),%r10
lea    0x1(%r11),%ecx
cmp    $0x3,%r11d
jb     1427 <mc_sampling+0x2d7>
lea    (%r10,%rcx,8),%rax
cmp    %r9,%rax
jbe    14c4 <mc_sampling+0x374>
lea    (%r9,%rcx,8),%rax
cmp    %r10,%rax
jbe    14c4 <mc_sampling+0x374>
xor    %eax,%eax
mov    %rax,%rsi
not    %rsi
add    %rcx,%rsi
mov    %rcx,%rdx
and    $0x3,%rdx
je     145a <mc_sampling+0x30a>
nopl   0x0(%rax,%rax,1)
movq   $0x0,(%r9,%rax,8)
movq   $0x0,(%r10,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1440 <mc_sampling+0x2f0>
cmp    $0x3,%rsi
jb     15c8 <mc_sampling+0x478>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   $0x0,(%r9,%rax,8)
movq   $0x0,(%r10,%rax,8)
movq   $0x0,0x8(%r9,%rax,8)
movq   $0x0,0x8(%r10,%rax,8)
movq   $0x0,0x10(%r9,%rax,8)
movq   $0x0,0x10(%r10,%rax,8)
movq   $0x0,0x18(%r9,%rax,8)
movq   $0x0,0x18(%r10,%rax,8)
add    $0x4,%rax
cmp    %rax,%rcx
jne    1470 <mc_sampling+0x320>
jmp    15c8 <mc_sampling+0x478>
mov    %ecx,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%r8d
and    $0x3,%r8d
cmp    $0xc,%rsi
jae    14ec <mc_sampling+0x39c>
xor    %esi,%esi
jmp    1578 <mc_sampling+0x428>
movabs $0x7ffffffffffffffc,%rsi
ff ff 7f
and    %rsi,%rdx
xor    %esi,%esi
xorpd  %xmm0,%xmm0
nop
movupd %xmm0,(%r9,%rsi,8)
movupd %xmm0,0x10(%r9,%rsi,8)
movupd %xmm0,(%r10,%rsi,8)
movupd %xmm0,0x10(%r10,%rsi,8)
movupd %xmm0,0x20(%r9,%rsi,8)
movupd %xmm0,0x30(%r9,%rsi,8)
movupd %xmm0,0x20(%r10,%rsi,8)
movupd %xmm0,0x30(%r10,%rsi,8)
movupd %xmm0,0x40(%r9,%rsi,8)
movupd %xmm0,0x50(%r9,%rsi,8)
movupd %xmm0,0x40(%r10,%rsi,8)
movupd %xmm0,0x50(%r10,%rsi,8)
movupd %xmm0,0x60(%r9,%rsi,8)
movupd %xmm0,0x70(%r9,%rsi,8)
movupd %xmm0,0x60(%r10,%rsi,8)
movupd %xmm0,0x70(%r10,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdx
jne    1500 <mc_sampling+0x3b0>
test   %r8,%r8
je     15bf <mc_sampling+0x46f>
lea    (%r10,%rsi,8),%rdx
add    $0x10,%rdx
lea    (%r9,%rsi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%r8
xor    %edi,%edi
xorpd  %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movupd %xmm0,-0x10(%rsi,%rdi,1)
movupd %xmm0,(%rsi,%rdi,1)
movupd %xmm0,-0x10(%rdx,%rdi,1)
movupd %xmm0,(%rdx,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r8
jne    15a0 <mc_sampling+0x450>
cmp    %rcx,%rax
jne    1429 <mc_sampling+0x2d9>
test   %r11d,%r11d
movsd  0x28(%rsp),%xmm2
jle    1bda <mc_sampling+0xa8a>
movsd  0xa29(%rip),%xmm0
mulsd  0x60(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
subsd  0x70(%rsp),%xmm2
mov    0x20(%rsp),%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
xorpd  %xmm1,%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,0x5c(%rsp)
add    %edx,0x1c(%rsp)
mov    %r15d,%eax
imul   0x10(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x90(%rsp)
imul   %r15d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x88(%rsp)
mov    %r12d,%eax
and    $0xfffffffc,%eax
mov    %rax,0xd8(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0xd0(%rsp)
shr    $0x2,%rax
add    $0x1,%rax
mov    %eax,%edx
and    $0x3,%edx
movabs $0x7ffffffffffffffc,%rsi
ff ff 7f
and    %rsi,%rax
mov    %rax,0xc0(%rsp)
mov    %r12d,%r13d
and    $0x3,%r13d
mov    %rdx,0xc8(%rsp)
shl    $0x5,%rdx
mov    %rdx,0xb0(%rsp)
mov    $0x1,%eax
mov    %rax,0x48(%rsp)
lea    0xe0(%rsp),%r14
movsd  %xmm1,0xa8(%rsp)
mulsd  %xmm1,%xmm1
movsd  %xmm1,0xa0(%rsp)
mov    %rcx,0x98(%rsp)
mov    %r13,0xb8(%rsp)
jmp    1749 <mc_sampling+0x5f9>
movl   $0x0,0x14(%rsp)
movsd  0x28(%rsp),%xmm0
lea    0x96d(%rip),%rdi
mov    0x14(%rsp),%esi
call   1030 <printf@plt>
movsd  0x28(%rsp),%xmm2
mov    0x128(%rsp),%rax
mov    0x48(%rsp),%rdx
movsd  (%rax,%rdx,8),%xmm0
divsd  0x90(%rsp),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
mov    0x130(%rsp),%rax
movsd  (%rax,%rdx,8),%xmm0
divsd  0x88(%rsp),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
add    $0x1,%rdx
mov    0x98(%rsp),%rcx
mov    %rdx,0x48(%rsp)
cmp    %rcx,%rdx
je     1bda <mc_sampling+0xa8a>
addsd  0x70(%rsp),%xmm2
movsd  %xmm2,0x28(%rsp)
movapd %xmm2,%xmm0
mov    $0x5,%edi
call   1070 <pow@plt>
movsd  %xmm0,0x78(%rsp)
test   %r15d,%r15d
jle    17d0 <mc_sampling+0x680>
xor    %r15d,%r15d
jmp    178b <mc_sampling+0x63b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r15
cmp    0x40(%rsp),%r15
je     17d0 <mc_sampling+0x680>
cmpl   $0x0,0xc(%rsp)
jle    1780 <mc_sampling+0x630>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1060 <ran1@plt>
movapd 0x60(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mov    0x0(%rbp,%r15,8),%rax
movsd  %xmm0,(%rax,%r13,8)
add    $0x1,%r13
cmp    %r13,%r12
jne    17a0 <mc_sampling+0x650>
jmp    1780 <mc_sampling+0x630>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
movsd  0x78(%rsp),%xmm0
movapd 0x60(%rsp),%xmm1
mov    0xc(%rsp),%esi
mov    0x18(%rsp),%r15d
mov    %r15d,%edx
call   1040 <wave_function@plt>
cmpl   $0x0,0x10(%rsp)
js     16d0 <mc_sampling+0x580>
movapd %xmm0,%xmm3
xor    %eax,%eax
mov    %rax,0x38(%rsp)
movl   $0x0,0x14(%rsp)
jmp    1833 <mc_sampling+0x6e3>
mov    0x38(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x10(%rsp),%ecx
mov    %rax,0x38(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm3
je     16de <mc_sampling+0x58e>
cmpl   $0x0,0x1c(%rsp)
jle    1b70 <mc_sampling+0xa20>
mov    $0x1,%eax
jmp    186e <mc_sampling+0x71e>
cs nopw 0x0(%rax,%rax,1)
nop
addl   $0x1,0x14(%rsp)
movapd %xmm2,%xmm3
mov    0x80(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x1c(%rsp),%ecx
je     1b70 <mc_sampling+0xa20>
movsd  %xmm3,0x20(%rsp)
mov    %rax,0x80(%rsp)
test   %r15d,%r15d
jle    1960 <mc_sampling+0x810>
xor    %r13d,%r13d
jmp    189f <mc_sampling+0x74f>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    0x40(%rsp),%r13
je     1960 <mc_sampling+0x810>
cmpl   $0x0,0xc(%rsp)
jle    1890 <mc_sampling+0x740>
xor    %r15d,%r15d
jmp    18bf <mc_sampling+0x76f>
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,(%rax,%r15,8)
add    $0x1,%r15
cmp    %r15,%r12
je     1890 <mc_sampling+0x740>
mov    0x0(%rbp,%r13,8),%rax
movsd  (%rax,%r15,8),%xmm0
movsd  %xmm0,0x30(%rsp)
mov    %r14,%rdi
call   1060 <ran1@plt>
addsd  0x730(%rip),%xmm0
mulsd  0x50(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movapd %xmm0,%xmm1
xorpd  %xmm4,%xmm4
cmpltsd %xmm4,%xmm1
movapd %xmm1,%xmm2
movapd 0x60(%rsp),%xmm3
andpd  %xmm3,%xmm2
movsd  0x709(%rip),%xmm5
andnpd %xmm5,%xmm1
orpd   %xmm2,%xmm1
addsd  %xmm0,%xmm1
ucomisd %xmm4,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm1,%xmm2
andpd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
ja     193a <mc_sampling+0x7ea>
movapd %xmm0,%xmm2
mov    (%rbx,%r13,8),%rax
ucomisd %xmm0,%xmm4
ja     18b0 <mc_sampling+0x760>
movapd %xmm2,%xmm1
jmp    18b0 <mc_sampling+0x760>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
movsd  0x78(%rsp),%xmm0
movaps 0x60(%rsp),%xmm1
mov    0xc(%rsp),%esi
mov    0x18(%rsp),%r15d
mov    %r15d,%edx
call   1040 <wave_function@plt>
movsd  %xmm0,0x30(%rsp)
cvttsd2si 0x20(%rsp),%esi
lea    0x68e(%rip),%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1060 <ran1@plt>
movsd  0x20(%rsp),%xmm3
movsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm1
divsd  %xmm3,%xmm1
ucomisd %xmm0,%xmm1
jb     1859 <mc_sampling+0x709>
test   %r15d,%r15d
mov    0xb8(%rsp),%r13
mov    0xb0(%rsp),%r9
jle    1850 <mc_sampling+0x700>
xor    %r8d,%r8d
jmp    19ef <mc_sampling+0x89f>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r8
cmp    0x40(%rsp),%r8
je     1850 <mc_sampling+0x700>
cmpl   $0x0,0xc(%rsp)
jle    19e0 <mc_sampling+0x890>
mov    (%rbx,%r8,8),%rcx
mov    0x0(%rbp,%r8,8),%rdx
cmpl   $0x4,0xc(%rsp)
jb     1a18 <mc_sampling+0x8c8>
lea    (%rcx,%r12,8),%rax
cmp    %rax,%rdx
jae    1a8c <mc_sampling+0x93c>
lea    (%rdx,%r12,8),%rax
cmp    %rax,%rcx
jae    1a8c <mc_sampling+0x93c>
xor    %esi,%esi
mov    %rsi,%rdi
not    %rdi
add    %r12,%rdi
test   %r13,%r13
je     1a44 <mc_sampling+0x8f4>
mov    %r13,%rax
nopl   0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
add    $0x1,%rsi
add    $0xffffffffffffffff,%rax
jne    1a30 <mc_sampling+0x8e0>
cmp    $0x3,%rdi
jb     19e0 <mc_sampling+0x890>
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
movsd  0x8(%rcx,%rsi,8),%xmm0
movsd  %xmm0,0x8(%rdx,%rsi,8)
movsd  0x10(%rcx,%rsi,8),%xmm0
movsd  %xmm0,0x10(%rdx,%rsi,8)
movsd  0x18(%rcx,%rsi,8),%xmm0
movsd  %xmm0,0x18(%rdx,%rsi,8)
add    $0x4,%rsi
cmp    %rsi,%r12
jne    1a50 <mc_sampling+0x900>
jmp    19e0 <mc_sampling+0x890>
cmpq   $0xc,0xd0(%rsp)
jae    1a9b <mc_sampling+0x94b>
xor    %esi,%esi
jmp    1b0c <mc_sampling+0x9bc>
mov    0xc0(%rsp),%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nop
movups (%rcx,%rsi,8),%xmm0
movups 0x10(%rcx,%rsi,8),%xmm1
movups %xmm0,(%rdx,%rsi,8)
movups %xmm1,0x10(%rdx,%rsi,8)
movups 0x20(%rcx,%rsi,8),%xmm0
movups 0x30(%rcx,%rsi,8),%xmm1
movups %xmm0,0x20(%rdx,%rsi,8)
movups %xmm1,0x30(%rdx,%rsi,8)
movups 0x40(%rcx,%rsi,8),%xmm0
movups 0x50(%rcx,%rsi,8),%xmm1
movups %xmm0,0x40(%rdx,%rsi,8)
movups %xmm1,0x50(%rdx,%rsi,8)
movupd 0x60(%rcx,%rsi,8),%xmm0
movupd 0x70(%rcx,%rsi,8),%xmm1
movupd %xmm0,0x60(%rdx,%rsi,8)
movupd %xmm1,0x70(%rdx,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdi
jne    1ab0 <mc_sampling+0x960>
cmpq   $0x0,0xc8(%rsp)
je     1b4f <mc_sampling+0x9ff>
lea    (%rdx,%rsi,8),%rdi
add    $0x10,%rdi
lea    (%rcx,%rsi,8),%rax
add    $0x10,%rax
xor    %esi,%esi
nopl   0x0(%rax)
movupd -0x10(%rax,%rsi,1),%xmm0
movupd (%rax,%rsi,1),%xmm1
movupd %xmm0,-0x10(%rdi,%rsi,1)
movupd %xmm1,(%rdi,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%r9
jne    1b30 <mc_sampling+0x9e0>
mov    0xd8(%rsp),%rax
mov    %rax,%rsi
cmp    %r12,%rax
je     19e0 <mc_sampling+0x890>
jmp    1a1a <mc_sampling+0x8ca>
nopl   0x0(%rax,%rax,1)
movsd  %xmm3,0x20(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x38(%rsp),%xmm0
lea    0x4b4(%rip),%rdi
mov    0x5c(%rsp),%esi
call   1030 <printf@plt>
cmpl   $0x0,0x38(%rsp)
je     1810 <mc_sampling+0x6c0>
mov    0x128(%rsp),%rax
mov    0x48(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  0xa8(%rsp),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x130(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm0
addsd  0xa0(%rsp),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1810 <mc_sampling+0x6c0>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"wfnew/wfold %12.5E%12.5E\0A\00"
@.str.1 = [24 x i8] c"Block %d energy %12.5E\0A\00"
@.str.2 = [48 x i8] c"variational parameter %12.5E accepted steps %d\0A\00"
define void @mc_sampling(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, double %6, double %7, double* %8, double* %9, double* %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i64
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double**
%39 = alloca double**
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store i32 %3, i32* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store double %6, double* %18
store double %7, double* %19
store double* %8, double** %20
store double* %9, double** %21
store double* %10, double** %22
store double 3.283200e-01, double* %42
%45 = load i32, i32* %14
%46 = sitofp i32 %45 to double
%47 = load double, double* %42
%48 = fdiv double %46, %47
%49 = call double @pow(double %48, i32 0)
store double %49, double* %40
%50 = load double, double* %40
%51 = fdiv double %50, 4.000000e+00
store double %51, double* %43
store double 0x40228D8D79D0A676, double* %41
store double 4.088000e+01, double* %44
%52 = load double, double* %18
%53 = load double, double* %19
%54 = fsub double %52, %53
store double %54, double* %37
store i64 -1, i64* %29
%55 = load i32, i32* %14
%56 = load i32, i32* %12
%57 = call i64 @matrix(i32 %55, i32 %56, i32 8)
%58 = inttoptr i64 %57 to double**
store double** %58, double*** %38
%59 = load i32, i32* %14
%60 = load i32, i32* %12
%61 = call i64 @matrix(i32 %59, i32 %60, i32 8)
%62 = inttoptr i64 %61 to double**
store double** %62, double*** %39
store i32 0, i32* %27
br label %63
63: ; preds = %93, %11
%64 = load i32, i32* %27
%65 = load i32, i32* %14
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %96
67: ; preds = %63
store i32 0, i32* %28
br label %68
68: ; preds = %89, %67
%69 = load i32, i32* %28
%70 = load i32, i32* %12
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %92
72: ; preds = %68
%73 = load double**, double*** %39
%74 = load i32, i32* %27
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double*, double** %73, i64 %75
%77 = load double*, double** %76
%78 = load i32, i32* %28
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
store double 0.000000e+00, double* %80
%81 = load double**, double*** %38
%82 = load i32, i32* %27
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double*, double** %81, i64 %83
%85 = load double*, double** %84
%86 = load i32, i32* %28
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %85, i64 %87
store double 0.000000e+00, double* %88
br label %89
89: ; preds = %72
%90 = load i32, i32* %28
%91 = add nsw i32 %90, 1
store i32 %91, i32* %28
br label %68
92: ; preds = %68
br label %93
93: ; preds = %92
%94 = load i32, i32* %27
%95 = add nsw i32 %94, 1
store i32 %95, i32* %27
br label %63
96: ; preds = %63
store i32 0, i32* %27
br label %97
97: ; preds = %111, %96
%98 = load i32, i32* %27
%99 = load i32, i32* %15
%100 = add nsw i32 %99, 1
%101 = icmp slt i32 %98, %100
br i1 %101, label %102, label %114
102: ; preds = %97
%103 = load double*, double** %22
%104 = load i32, i32* %27
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %103, i64 %105
store double 0.000000e+00, double* %106
%107 = load double*, double** %21
%108 = load i32, i32* %27
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
store double 0.000000e+00, double* %110
br label %111
111: ; preds = %102
%112 = load i32, i32* %27
%113 = add nsw i32 %112, 1
store i32 %113, i32* %27
br label %97
114: ; preds = %97
store double 0.000000e+00, double* %36
store i32 1, i32* %25
br label %115
115: ; preds = %381, %114
%116 = load i32, i32* %25
%117 = load i32, i32* %15
%118 = icmp sle i32 %116, %117
br i1 %118, label %119, label %384
119: ; preds = %115
%120 = load double, double* %19
%121 = load double, double* %37
%122 = fadd double %121, %120
store double %122, double* %37
%123 = load double, double* %37
%124 = call double @pow(double %123, i32 5)
store double %124, double* %32
store double 0.000000e+00, double* %34
store double 0.000000e+00, double* %33
store i32 0, i32* %26
store double 0.000000e+00, double* %35
store i32 0, i32* %27
br label %125
125: ; preds = %150, %119
%126 = load i32, i32* %27
%127 = load i32, i32* %14
%128 = icmp slt i32 %126, %127
br i1 %128, label %129, label %153
129: ; preds = %125
store i32 0, i32* %28
br label %130
130: ; preds = %146, %129
%131 = load i32, i32* %28
%132 = load i32, i32* %12
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %149
134: ; preds = %130
%135 = load double, double* %40
%136 = call double @ran1(i64* %29)
%137 = fmul double %135, %136
%138 = load double**, double*** %38
%139 = load i32, i32* %27
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double*, double** %138, i64 %140
%142 = load double*, double** %141
%143 = load i32, i32* %28
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
store double %137, double* %145
br label %146
146: ; preds = %134
%147 = load i32, i32* %28
%148 = add nsw i32 %147, 1
store i32 %148, i32* %28
br label %130
149: ; preds = %130
br label %150
150: ; preds = %149
%151 = load i32, i32* %27
%152 = add nsw i32 %151, 1
store i32 %152, i32* %27
br label %125
153: ; preds = %125
%154 = load double**, double*** %38
%155 = load double, double* %32
%156 = load double, double* %40
%157 = load i32, i32* %12
%158 = load i32, i32* %14
%159 = call double @wave_function(double** %154, double %155, double %156, i32 %157, i32 %158)
store double %159, double* %31
store i32 0, i32* %23
br label %160
160: ; preds = %352, %153
%161 = load i32, i32* %23
%162 = load i32, i32* %13
%163 = icmp sle i32 %161, %162
br i1 %163, label %164, label %355
164: ; preds = %160
store double 0.000000e+00, double* %33
store i32 1, i32* %24
br label %165
165: ; preds = %320, %164
%166 = load i32, i32* %24
%167 = load i32, i32* %17
%168 = load i32, i32* %16
%169 = add nsw i32 %167, %168
%170 = icmp sle i32 %166, %169
br i1 %170, label %171, label %323
171: ; preds = %165
store i32 0, i32* %27
br label %172
172: ; preds = %253, %171
%173 = load i32, i32* %27
%174 = load i32, i32* %14
%175 = icmp slt i32 %173, %174
br i1 %175, label %176, label %256
176: ; preds = %172
store i32 0, i32* %28
br label %177
177: ; preds = %249, %176
%178 = load i32, i32* %28
%179 = load i32, i32* %12
%180 = icmp slt i32 %178, %179
br i1 %180, label %181, label %252
181: ; preds = %177
%182 = load double**, double*** %38
%183 = load i32, i32* %27
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double*, double** %182, i64 %184
%186 = load double*, double** %185
%187 = load i32, i32* %28
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds double, double* %186, i64 %188
%190 = load double, double* %189
%191 = load double, double* %43
%192 = call double @ran1(i64* %29)
%193 = fsub double %192, 5.000000e-01
%194 = call double @llvm.fmuladd.f64(double %191, double %193, double %190)
%195 = load double**, double*** %39
%196 = load i32, i32* %27
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double*, double** %195, i64 %197
%199 = load double*, double** %198
%200 = load i32, i32* %28
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
store double %194, double* %202
%203 = load double**, double*** %39
%204 = load i32, i32* %27
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds double*, double** %203, i64 %205
%207 = load double*, double** %206
%208 = load i32, i32* %28
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %207, i64 %209
%211 = load double, double* %210
%212 = fcmp olt double %211, 0.000000e+00
br i1 %212, label %213, label %225
213: ; preds = %181
%214 = load double, double* %40
%215 = load double**, double*** %39
%216 = load i32, i32* %27
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double*, double** %215, i64 %217
%219 = load double*, double** %218
%220 = load i32, i32* %28
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds double, double* %219, i64 %221
%223 = load double, double* %222
%224 = fadd double %223, %214
store double %224, double* %222
br label %225
225: ; preds = %213, %181
%226 = load double**, double*** %39
%227 = load i32, i32* %27
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double*, double** %226, i64 %228
%230 = load double*, double** %229
%231 = load i32, i32* %28
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %230, i64 %232
%234 = load double, double* %233
%235 = fcmp ogt double %234, 0.000000e+00
br i1 %235, label %236, label %248
236: ; preds = %225
%237 = load double, double* %40
%238 = load double**, double*** %39
%239 = load i32, i32* %27
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds double*, double** %238, i64 %240
%242 = load double*, double** %241
%243 = load i32, i32* %28
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds double, double* %242, i64 %244
%246 = load double, double* %245
%247 = fsub double %246, %237
store double %247, double* %245
br label %248
248: ; preds = %236, %225
br label %249
249: ; preds = %248
%250 = load i32, i32* %28
%251 = add nsw i32 %250, 1
store i32 %251, i32* %28
br label %177
252: ; preds = %177
br label %253
253: ; preds = %252
%254 = load i32, i32* %27
%255 = add nsw i32 %254, 1
store i32 %255, i32* %27
br label %172
256: ; preds = %172
%257 = load double**, double*** %39
%258 = load double, double* %32
%259 = load double, double* %40
%260 = load i32, i32* %12
%261 = load i32, i32* %14
%262 = call double @wave_function(double** %257, double %258, double %259, i32 %260, i32 %261)
store double %262, double* %30
%263 = load double, double* %30
%264 = load double, double* %31
%265 = fptosi double %264 to i32
%266 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %263, i32 %265)
%267 = call double @ran1(i64* %29)
%268 = load double, double* %30
%269 = load double, double* %31
%270 = fdiv double %268, %269
%271 = fcmp ole double %267, %270
br i1 %271, label %272, label %311
272: ; preds = %256
store i32 0, i32* %27
br label %273
273: ; preds = %304, %272
%274 = load i32, i32* %27
%275 = load i32, i32* %14
%276 = icmp slt i32 %274, %275
br i1 %276, label %277, label %307
277: ; preds = %273
store i32 0, i32* %28
br label %278
278: ; preds = %300, %277
%279 = load i32, i32* %28
%280 = load i32, i32* %12
%281 = icmp slt i32 %279, %280
br i1 %281, label %282, label %303
282: ; preds = %278
%283 = load double**, double*** %39
%284 = load i32, i32* %27
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds double*, double** %283, i64 %285
%287 = load double*, double** %286
%288 = load i32, i32* %28
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %287, i64 %289
%291 = load double, double* %290
%292 = load double**, double*** %38
%293 = load i32, i32* %27
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double*, double** %292, i64 %294
%296 = load double*, double** %295
%297 = load i32, i32* %28
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds double, double* %296, i64 %298
store double %291, double* %299
br label %300
300: ; preds = %282
%301 = load i32, i32* %28
%302 = add nsw i32 %301, 1
store i32 %302, i32* %28
br label %278
303: ; preds = %278
br label %304
304: ; preds = %303
%305 = load i32, i32* %27
%306 = add nsw i32 %305, 1
store i32 %306, i32* %27
br label %273
307: ; preds = %273
%308 = load double, double* %30
store double %308, double* %31
%309 = load i32, i32* %26
%310 = add nsw i32 %309, 1
store i32 %310, i32* %26
br label %311
311: ; preds = %307, %256
%312 = load i32, i32* %24
%313 = load i32, i32* %16
%314 = icmp sgt i32 %312, %313
br i1 %314, label %315, label %319
315: ; preds = %311
%316 = load double, double* %35
%317 = load double, double* %33
%318 = fadd double %317, %316
store double %318, double* %33
br label %319
319: ; preds = %315, %311
br label %320
320: ; preds = %319
%321 = load i32, i32* %24
%322 = add nsw i32 %321, 1
store i32 %322, i32* %24
br label %165
323: ; preds = %165
%324 = load i32, i32* %17
%325 = sitofp i32 %324 to double
%326 = load double, double* %33
%327 = fdiv double %326, %325
store double %327, double* %33
%328 = load i32, i32* %23
%329 = sitofp i32 %328 to double
%330 = load double, double* %33
%331 = fptosi double %330 to i32
%332 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %329, i32 %331)
%333 = load i32, i32* %23
%334 = icmp ne i32 %333, 0
br i1 %334, label %335, label %351
335: ; preds = %323
%336 = load double, double* %33
%337 = load double*, double** %21
%338 = load i32, i32* %25
%339 = sext i32 %338 to i64
%340 = getelementptr inbounds double, double* %337, i64 %339
%341 = load double, double* %340
%342 = fadd double %341, %336
store double %342, double* %340
%343 = load double, double* %33
%344 = load double, double* %33
%345 = load double*, double** %22
%346 = load i32, i32* %25
%347 = sext i32 %346 to i64
%348 = getelementptr inbounds double, double* %345, i64 %347
%349 = load double, double* %348
%350 = call double @llvm.fmuladd.f64(double %343, double %344, double %349)
store double %350, double* %348
br label %351
351: ; preds = %335, %323
br label %352
352: ; preds = %351
%353 = load i32, i32* %23
%354 = add nsw i32 %353, 1
store i32 %354, i32* %23
br label %160
355: ; preds = %160
%356 = load double, double* %37
%357 = load i32, i32* %26
%358 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), double %356, i32 %357)
%359 = load i32, i32* %13
%360 = load i32, i32* %14
%361 = mul nsw i32 %359, %360
%362 = sitofp i32 %361 to double
%363 = load double*, double** %21
%364 = load i32, i32* %25
%365 = sext i32 %364 to i64
%366 = getelementptr inbounds double, double* %363, i64 %365
%367 = load double, double* %366
%368 = fdiv double %367, %362
store double %368, double* %366
%369 = load i32, i32* %13
%370 = load i32, i32* %14
%371 = mul nsw i32 %369, %370
%372 = load i32, i32* %14
%373 = mul nsw i32 %371, %372
%374 = sitofp i32 %373 to double
%375 = load double*, double** %22
%376 = load i32, i32* %25
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds double, double* %375, i64 %377
%379 = load double, double* %378
%380 = fdiv double %379, %374
store double %380, double* %378
br label %381
381: ; preds = %355
%382 = load i32, i32* %25
%383 = add nsw i32 %382, 1
store i32 %383, i32* %25
br label %115
384: ; preds = %115
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"wfnew/wfold %12.5E%12.5E\0A\00"
@.str.1 = [24 x i8] c"Block %d energy %12.5E\0A\00"
@.str.2 = [48 x i8] c"variational parameter %12.5E accepted steps %d\0A\00"
define void @mc_sampling(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, double %6, double %7, double* nocapture readnone %8, double* nocapture %9, double* nocapture %10) {
%12 = alloca i64
%13 = bitcast i64* %12 to i8*
%14 = sitofp i32 %2 to double
%15 = fdiv double %14, 3.283200e-01
%16 = tail call double @pow(double %15, i32 0)
%17 = fmul double %16, 2.500000e-01
%18 = fsub double %6, %7
store i64 -1, i64* %12
%19 = tail call i64 @matrix(i32 %2, i32 %0, i32 8)
%20 = inttoptr i64 %19 to double**
%21 = tail call i64 @matrix(i32 %2, i32 %0, i32 8)
%22 = inttoptr i64 %21 to double**
%23 = icmp sgt i32 %2, 0
br i1 %23, label %24, label %128
24: ; preds = %11
%25 = icmp sgt i32 %0, 0
%26 = zext i32 %2 to i64
%27 = zext i32 %0 to i64
%28 = and i64 %27, 4294967292
%29 = add nsw i64 %28, -4
%30 = lshr exact i64 %29, 2
%31 = add nuw nsw i64 %30, 1
%32 = icmp ult i32 %0, 4
%33 = and i64 %27, 4294967292
%34 = and i64 %31, 3
%35 = icmp ult i64 %29, 12
%36 = and i64 %31, 9223372036854775804
%37 = icmp eq i64 %34, 0
%38 = icmp eq i64 %33, %27
%39 = and i64 %27, 3
%40 = icmp eq i64 %39, 0
br label %41
41: ; preds = %24, %241
%42 = phi i64 [ 0, %24 ], [ %242, %241 ]
br i1 %25, label %43, label %241
43: ; preds = %41
%44 = getelementptr inbounds double*, double** %22, i64 %42
%45 = load double*, double** %44
%46 = getelementptr inbounds double*, double** %20, i64 %42
%47 = load double*, double** %46
br i1 %32, label %113, label %48
48: ; preds = %43
%49 = getelementptr double, double* %45, i64 %27
%50 = getelementptr double, double* %47, i64 %27
%51 = icmp ult double* %45, %50
%52 = icmp ult double* %47, %49
%53 = and i1 %51, %52
br i1 %53, label %113, label %54
54: ; preds = %48
br i1 %35, label %96, label %55
55: ; preds = %54, %55
%56 = phi i64 [ %93, %55 ], [ 0, %54 ]
%57 = phi i64 [ %94, %55 ], [ 0, %54 ]
%58 = getelementptr inbounds double, double* %45, i64 %56
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %59
%60 = getelementptr inbounds double, double* %58, i64 2
%61 = bitcast double* %60 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %61
%62 = getelementptr inbounds double, double* %47, i64 %56
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %63
%64 = getelementptr inbounds double, double* %62, i64 2
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %65
%66 = or i64 %56, 4
%67 = getelementptr inbounds double, double* %45, i64 %66
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %68
%69 = getelementptr inbounds double, double* %67, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %70
%71 = getelementptr inbounds double, double* %47, i64 %66
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %72
%73 = getelementptr inbounds double, double* %71, i64 2
%74 = bitcast double* %73 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %74
%75 = or i64 %56, 8
%76 = getelementptr inbounds double, double* %45, i64 %75
%77 = bitcast double* %76 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %77
%78 = getelementptr inbounds double, double* %76, i64 2
%79 = bitcast double* %78 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %79
%80 = getelementptr inbounds double, double* %47, i64 %75
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %81
%82 = getelementptr inbounds double, double* %80, i64 2
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %83
%84 = or i64 %56, 12
%85 = getelementptr inbounds double, double* %45, i64 %84
%86 = bitcast double* %85 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %86
%87 = getelementptr inbounds double, double* %85, i64 2
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %88
%89 = getelementptr inbounds double, double* %47, i64 %84
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %90
%91 = getelementptr inbounds double, double* %89, i64 2
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %92
%93 = add nuw i64 %56, 16
%94 = add nuw i64 %57, 4
%95 = icmp eq i64 %94, %36
br i1 %95, label %96, label %55
96: ; preds = %55, %54
%97 = phi i64 [ 0, %54 ], [ %93, %55 ]
br i1 %37, label %112, label %98
98: ; preds = %96, %98
%99 = phi i64 [ %109, %98 ], [ %97, %96 ]
%100 = phi i64 [ %110, %98 ], [ 0, %96 ]
%101 = getelementptr inbounds double, double* %45, i64 %99
%102 = bitcast double* %101 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %102
%103 = getelementptr inbounds double, double* %101, i64 2
%104 = bitcast double* %103 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %104
%105 = getelementptr inbounds double, double* %47, i64 %99
%106 = bitcast double* %105 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %106
%107 = getelementptr inbounds double, double* %105, i64 2
%108 = bitcast double* %107 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %108
%109 = add nuw i64 %99, 4
%110 = add i64 %100, 1
%111 = icmp eq i64 %110, %34
br i1 %111, label %112, label %98
112: ; preds = %98, %96
br i1 %38, label %241, label %113
113: ; preds = %48, %43, %112
%114 = phi i64 [ 0, %48 ], [ 0, %43 ], [ %33, %112 ]
%115 = xor i64 %114, -1
%116 = add nsw i64 %115, %27
br i1 %40, label %125, label %117
117: ; preds = %113, %117
%118 = phi i64 [ %122, %117 ], [ %114, %113 ]
%119 = phi i64 [ %123, %117 ], [ 0, %113 ]
%120 = getelementptr inbounds double, double* %45, i64 %118
store double 0.000000e+00, double* %120
%121 = getelementptr inbounds double, double* %47, i64 %118
store double 0.000000e+00, double* %121
%122 = add nuw nsw i64 %118, 1
%123 = add i64 %119, 1
%124 = icmp eq i64 %123, %39
br i1 %124, label %125, label %117
125: ; preds = %117, %113
%126 = phi i64 [ %114, %113 ], [ %122, %117 ]
%127 = icmp ult i64 %116, 3
br i1 %127, label %241, label %226
128: ; preds = %241, %11
%129 = icmp slt i32 %3, 0
br i1 %129, label %515, label %130
130: ; preds = %128
%131 = add nuw i32 %3, 1
%132 = zext i32 %131 to i64
%133 = icmp ult i32 %3, 3
br i1 %133, label %209, label %134
134: ; preds = %130
%135 = getelementptr double, double* %10, i64 %132
%136 = getelementptr double, double* %9, i64 %132
%137 = icmp ugt double* %136, %10
%138 = icmp ugt double* %135, %9
%139 = and i1 %137, %138
br i1 %139, label %209, label %140
140: ; preds = %134
%141 = and i64 %132, 4294967292
%142 = add nsw i64 %141, -4
%143 = lshr exact i64 %142, 2
%144 = add nuw nsw i64 %143, 1
%145 = and i64 %144, 3
%146 = icmp ult i64 %142, 12
br i1 %146, label %190, label %147
147: ; preds = %140
%148 = and i64 %144, 9223372036854775804
br label %149
149: ; preds = %149, %147
%150 = phi i64 [ 0, %147 ], [ %187, %149 ]
%151 = phi i64 [ 0, %147 ], [ %188, %149 ]
%152 = getelementptr inbounds double, double* %10, i64 %150
%153 = bitcast double* %152 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %153
%154 = getelementptr inbounds double, double* %152, i64 2
%155 = bitcast double* %154 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %155
%156 = getelementptr inbounds double, double* %9, i64 %150
%157 = bitcast double* %156 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %157
%158 = getelementptr inbounds double, double* %156, i64 2
%159 = bitcast double* %158 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %159
%160 = or i64 %150, 4
%161 = getelementptr inbounds double, double* %10, i64 %160
%162 = bitcast double* %161 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %162
%163 = getelementptr inbounds double, double* %161, i64 2
%164 = bitcast double* %163 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %164
%165 = getelementptr inbounds double, double* %9, i64 %160
%166 = bitcast double* %165 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %166
%167 = getelementptr inbounds double, double* %165, i64 2
%168 = bitcast double* %167 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %168
%169 = or i64 %150, 8
%170 = getelementptr inbounds double, double* %10, i64 %169
%171 = bitcast double* %170 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %171
%172 = getelementptr inbounds double, double* %170, i64 2
%173 = bitcast double* %172 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %173
%174 = getelementptr inbounds double, double* %9, i64 %169
%175 = bitcast double* %174 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %175
%176 = getelementptr inbounds double, double* %174, i64 2
%177 = bitcast double* %176 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %177
%178 = or i64 %150, 12
%179 = getelementptr inbounds double, double* %10, i64 %178
%180 = bitcast double* %179 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %180
%181 = getelementptr inbounds double, double* %179, i64 2
%182 = bitcast double* %181 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %182
%183 = getelementptr inbounds double, double* %9, i64 %178
%184 = bitcast double* %183 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %184
%185 = getelementptr inbounds double, double* %183, i64 2
%186 = bitcast double* %185 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %186
%187 = add nuw i64 %150, 16
%188 = add nuw i64 %151, 4
%189 = icmp eq i64 %188, %148
br i1 %189, label %190, label %149
190: ; preds = %149, %140
%191 = phi i64 [ 0, %140 ], [ %187, %149 ]
%192 = icmp eq i64 %145, 0
br i1 %192, label %207, label %193
193: ; preds = %190, %193
%194 = phi i64 [ %204, %193 ], [ %191, %190 ]
%195 = phi i64 [ %205, %193 ], [ 0, %190 ]
%196 = getelementptr inbounds double, double* %10, i64 %194
%197 = bitcast double* %196 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %197
%198 = getelementptr inbounds double, double* %196, i64 2
%199 = bitcast double* %198 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %199
%200 = getelementptr inbounds double, double* %9, i64 %194
%201 = bitcast double* %200 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %201
%202 = getelementptr inbounds double, double* %200, i64 2
%203 = bitcast double* %202 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %203
%204 = add nuw i64 %194, 4
%205 = add i64 %195, 1
%206 = icmp eq i64 %205, %145
br i1 %206, label %207, label %193
207: ; preds = %193, %190
%208 = icmp eq i64 %141, %132
br i1 %208, label %244, label %209
209: ; preds = %134, %130, %207
%210 = phi i64 [ 0, %134 ], [ 0, %130 ], [ %141, %207 ]
%211 = xor i64 %210, -1
%212 = add nsw i64 %211, %132
%213 = and i64 %132, 3
%214 = icmp eq i64 %213, 0
br i1 %214, label %223, label %215
215: ; preds = %209, %215
%216 = phi i64 [ %220, %215 ], [ %210, %209 ]
%217 = phi i64 [ %221, %215 ], [ 0, %209 ]
%218 = getelementptr inbounds double, double* %10, i64 %216
store double 0.000000e+00, double* %218
%219 = getelementptr inbounds double, double* %9, i64 %216
store double 0.000000e+00, double* %219
%220 = add nuw nsw i64 %216, 1
%221 = add i64 %217, 1
%222 = icmp eq i64 %221, %213
br i1 %222, label %223, label %215
223: ; preds = %215, %209
%224 = phi i64 [ %210, %209 ], [ %220, %215 ]
%225 = icmp ult i64 %212, 3
br i1 %225, label %244, label %279
226: ; preds = %125, %226
%227 = phi i64 [ %239, %226 ], [ %126, %125 ]
%228 = getelementptr inbounds double, double* %45, i64 %227
store double 0.000000e+00, double* %228
%229 = getelementptr inbounds double, double* %47, i64 %227
store double 0.000000e+00, double* %229
%230 = add nuw nsw i64 %227, 1
%231 = getelementptr inbounds double, double* %45, i64 %230
store double 0.000000e+00, double* %231
%232 = getelementptr inbounds double, double* %47, i64 %230
store double 0.000000e+00, double* %232
%233 = add nuw nsw i64 %227, 2
%234 = getelementptr inbounds double, double* %45, i64 %233
store double 0.000000e+00, double* %234
%235 = getelementptr inbounds double, double* %47, i64 %233
store double 0.000000e+00, double* %235
%236 = add nuw nsw i64 %227, 3
%237 = getelementptr inbounds double, double* %45, i64 %236
store double 0.000000e+00, double* %237
%238 = getelementptr inbounds double, double* %47, i64 %236
store double 0.000000e+00, double* %238
%239 = add nuw nsw i64 %227, 4
%240 = icmp eq i64 %239, %27
br i1 %240, label %241, label %226
241: ; preds = %125, %226, %112, %41
%242 = add nuw nsw i64 %42, 1
%243 = icmp eq i64 %242, %26
br i1 %243, label %128, label %41
244: ; preds = %223, %279, %207
%245 = icmp slt i32 %3, 1
br i1 %245, label %515, label %246
246: ; preds = %244
%247 = icmp sgt i32 %0, 0
%248 = icmp slt i32 %1, 0
%249 = add i32 %5, %4
%250 = icmp slt i32 %249, 1
%251 = sitofp i32 %5 to double
%252 = fdiv double 0.000000e+00, %251
%253 = fptosi double %252 to i32
%254 = mul nsw i32 %2, %1
%255 = sitofp i32 %254 to double
%256 = mul nsw i32 %254, %2
%257 = sitofp i32 %256 to double
%258 = add nuw i32 %3, 1
%259 = zext i32 %258 to i64
%260 = zext i32 %2 to i64
%261 = zext i32 %0 to i64
%262 = zext i32 %2 to i64
%263 = zext i32 %0 to i64
%264 = zext i32 %2 to i64
%265 = zext i32 %0 to i64
%266 = and i64 %261, 4294967292
%267 = add nsw i64 %266, -4
%268 = lshr exact i64 %267, 2
%269 = add nuw nsw i64 %268, 1
%270 = icmp ult i32 %0, 4
%271 = and i64 %261, 4294967292
%272 = and i64 %269, 3
%273 = icmp ult i64 %267, 12
%274 = and i64 %269, 9223372036854775804
%275 = icmp eq i64 %272, 0
%276 = icmp eq i64 %271, %261
%277 = and i64 %261, 3
%278 = icmp eq i64 %277, 0
br label %294
279: ; preds = %223, %279
%280 = phi i64 [ %292, %279 ], [ %224, %223 ]
%281 = getelementptr inbounds double, double* %10, i64 %280
store double 0.000000e+00, double* %281
%282 = getelementptr inbounds double, double* %9, i64 %280
store double 0.000000e+00, double* %282
%283 = add nuw nsw i64 %280, 1
%284 = getelementptr inbounds double, double* %10, i64 %283
store double 0.000000e+00, double* %284
%285 = getelementptr inbounds double, double* %9, i64 %283
store double 0.000000e+00, double* %285
%286 = add nuw nsw i64 %280, 2
%287 = getelementptr inbounds double, double* %10, i64 %286
store double 0.000000e+00, double* %287
%288 = getelementptr inbounds double, double* %9, i64 %286
store double 0.000000e+00, double* %288
%289 = add nuw nsw i64 %280, 3
%290 = getelementptr inbounds double, double* %10, i64 %289
store double 0.000000e+00, double* %290
%291 = getelementptr inbounds double, double* %9, i64 %289
store double 0.000000e+00, double* %291
%292 = add nuw nsw i64 %280, 4
%293 = icmp eq i64 %292, %132
br i1 %293, label %244, label %279
294: ; preds = %246, %504
%295 = phi i64 [ 1, %246 ], [ %513, %504 ]
%296 = phi double [ %18, %246 ], [ %297, %504 ]
%297 = fadd double %296, %7
%298 = call double @pow(double %297, i32 5)
br i1 %23, label %299, label %314
299: ; preds = %294, %311
%300 = phi i64 [ %312, %311 ], [ 0, %294 ]
br i1 %247, label %301, label %311
301: ; preds = %299
%302 = getelementptr inbounds double*, double** %20, i64 %300
br label %303
303: ; preds = %301, %303
%304 = phi i64 [ 0, %301 ], [ %309, %303 ]
%305 = call double @ran1(i64* %12)
%306 = fmul double %16, %305
%307 = load double*, double** %302
%308 = getelementptr inbounds double, double* %307, i64 %304
store double %306, double* %308
%309 = add nuw nsw i64 %304, 1
%310 = icmp eq i64 %309, %261
br i1 %310, label %311, label %303
311: ; preds = %303, %299
%312 = add nuw nsw i64 %300, 1
%313 = icmp eq i64 %312, %260
br i1 %313, label %314, label %299
314: ; preds = %311, %294
%315 = call double @wave_function(double** %20, double %298, double %16, i32 %0, i32 %2)
br i1 %248, label %504, label %316
316: ; preds = %314
%317 = getelementptr inbounds double, double* %9, i64 %295
%318 = getelementptr inbounds double, double* %10, i64 %295
br label %319
319: ; preds = %316, %501
%320 = phi i32 [ 0, %316 ], [ %502, %501 ]
%321 = phi i32 [ 0, %316 ], [ %492, %501 ]
%322 = phi double [ %315, %316 ], [ %491, %501 ]
br i1 %250, label %490, label %323
323: ; preds = %319, %485
%324 = phi i32 [ %488, %485 ], [ 1, %319 ]
%325 = phi i32 [ %487, %485 ], [ %321, %319 ]
%326 = phi double [ %486, %485 ], [ %322, %319 ]
br i1 %23, label %327, label %355
327: ; preds = %323, %352
%328 = phi i64 [ %353, %352 ], [ 0, %323 ]
br i1 %247, label %329, label %352
329: ; preds = %327
%330 = getelementptr inbounds double*, double** %20, i64 %328
%331 = getelementptr inbounds double*, double** %22, i64 %328
br label %332
332: ; preds = %329, %332
%333 = phi i64 [ 0, %329 ], [ %350, %332 ]
%334 = load double*, double** %330
%335 = getelementptr inbounds double, double* %334, i64 %333
%336 = load double, double* %335
%337 = call double @ran1(i64* %12)
%338 = fadd double %337, -5.000000e-01
%339 = call double @llvm.fmuladd.f64(double %17, double %338, double %336)
%340 = load double*, double** %331
%341 = getelementptr inbounds double, double* %340, i64 %333
%342 = fcmp olt double %339, 0.000000e+00
%343 = select i1 %342, double %16, double -0.000000e+00
%344 = fadd double %339, %343
%345 = fcmp ogt double %344, 0.000000e+00
%346 = or i1 %342, %345
%347 = select i1 %345, double %16, double 0.000000e+00
%348 = fsub double %344, %347
%349 = select i1 %346, double %348, double %339
store double %349, double* %341
%350 = add nuw nsw i64 %333, 1
%351 = icmp eq i64 %350, %263
br i1 %351, label %352, label %332
352: ; preds = %332, %327
%353 = add nuw nsw i64 %328, 1
%354 = icmp eq i64 %353, %262
br i1 %354, label %355, label %327
355: ; preds = %352, %323
%356 = call double @wave_function(double** %22, double %298, double %16, i32 %0, i32 %2)
%357 = fptosi double %326 to i32
%358 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %356, i32 %357)
%359 = call double @ran1(i64* %12)
%360 = fdiv double %356, %326
%361 = fcmp ugt double %359, %360
br i1 %361, label %485, label %362
362: ; preds = %355
br i1 %23, label %363, label %483
363: ; preds = %362, %480
%364 = phi i64 [ %481, %480 ], [ 0, %362 ]
br i1 %247, label %365, label %480
365: ; preds = %363
%366 = getelementptr inbounds double*, double** %22, i64 %364
%367 = load double*, double** %366
%368 = getelementptr inbounds double*, double** %20, i64 %364
%369 = load double*, double** %368
br i1 %270, label %445, label %370
370: ; preds = %365
%371 = getelementptr double, double* %369, i64 %261
%372 = getelementptr double, double* %367, i64 %261
%373 = icmp ult double* %369, %372
%374 = icmp ult double* %367, %371
%375 = and i1 %373, %374
br i1 %375, label %445, label %376
376: ; preds = %370
br i1 %273, label %426, label %377
377: ; preds = %376, %377
%378 = phi i64 [ %423, %377 ], [ 0, %376 ]
%379 = phi i64 [ %424, %377 ], [ 0, %376 ]
%380 = getelementptr inbounds double, double* %367, i64 %378
%381 = bitcast double* %380 to <2 x double>*
%382 = load <2 x double>, <2 x double>* %381
%383 = getelementptr inbounds double, double* %380, i64 2
%384 = bitcast double* %383 to <2 x double>*
%385 = load <2 x double>, <2 x double>* %384
%386 = getelementptr inbounds double, double* %369, i64 %378
%387 = bitcast double* %386 to <2 x double>*
store <2 x double> %382, <2 x double>* %387
%388 = getelementptr inbounds double, double* %386, i64 2
%389 = bitcast double* %388 to <2 x double>*
store <2 x double> %385, <2 x double>* %389
%390 = or i64 %378, 4
%391 = getelementptr inbounds double, double* %367, i64 %390
%392 = bitcast double* %391 to <2 x double>*
%393 = load <2 x double>, <2 x double>* %392
%394 = getelementptr inbounds double, double* %391, i64 2
%395 = bitcast double* %394 to <2 x double>*
%396 = load <2 x double>, <2 x double>* %395
%397 = getelementptr inbounds double, double* %369, i64 %390
%398 = bitcast double* %397 to <2 x double>*
store <2 x double> %393, <2 x double>* %398
%399 = getelementptr inbounds double, double* %397, i64 2
%400 = bitcast double* %399 to <2 x double>*
store <2 x double> %396, <2 x double>* %400
%401 = or i64 %378, 8
%402 = getelementptr inbounds double, double* %367, i64 %401
%403 = bitcast double* %402 to <2 x double>*
%404 = load <2 x double>, <2 x double>* %403
%405 = getelementptr inbounds double, double* %402, i64 2
%406 = bitcast double* %405 to <2 x double>*
%407 = load <2 x double>, <2 x double>* %406
%408 = getelementptr inbounds double, double* %369, i64 %401
%409 = bitcast double* %408 to <2 x double>*
store <2 x double> %404, <2 x double>* %409
%410 = getelementptr inbounds double, double* %408, i64 2
%411 = bitcast double* %410 to <2 x double>*
store <2 x double> %407, <2 x double>* %411
%412 = or i64 %378, 12
%413 = getelementptr inbounds double, double* %367, i64 %412
%414 = bitcast double* %413 to <2 x double>*
%415 = load <2 x double>, <2 x double>* %414
%416 = getelementptr inbounds double, double* %413, i64 2
%417 = bitcast double* %416 to <2 x double>*
%418 = load <2 x double>, <2 x double>* %417
%419 = getelementptr inbounds double, double* %369, i64 %412
%420 = bitcast double* %419 to <2 x double>*
store <2 x double> %415, <2 x double>* %420
%421 = getelementptr inbounds double, double* %419, i64 2
%422 = bitcast double* %421 to <2 x double>*
store <2 x double> %418, <2 x double>* %422
%423 = add nuw i64 %378, 16
%424 = add nuw i64 %379, 4
%425 = icmp eq i64 %424, %274
br i1 %425, label %426, label %377
426: ; preds = %377, %376
%427 = phi i64 [ 0, %376 ], [ %423, %377 ]
br i1 %275, label %444, label %428
428: ; preds = %426, %428
%429 = phi i64 [ %441, %428 ], [ %427, %426 ]
%430 = phi i64 [ %442, %428 ], [ 0, %426 ]
%431 = getelementptr inbounds double, double* %367, i64 %429
%432 = bitcast double* %431 to <2 x double>*
%433 = load <2 x double>, <2 x double>* %432
%434 = getelementptr inbounds double, double* %431, i64 2
%435 = bitcast double* %434 to <2 x double>*
%436 = load <2 x double>, <2 x double>* %435
%437 = getelementptr inbounds double, double* %369, i64 %429
%438 = bitcast double* %437 to <2 x double>*
store <2 x double> %433, <2 x double>* %438
%439 = getelementptr inbounds double, double* %437, i64 2
%440 = bitcast double* %439 to <2 x double>*
store <2 x double> %436, <2 x double>* %440
%441 = add nuw i64 %429, 4
%442 = add i64 %430, 1
%443 = icmp eq i64 %442, %272
br i1 %443, label %444, label %428
444: ; preds = %428, %426
br i1 %276, label %480, label %445
445: ; preds = %370, %365, %444
%446 = phi i64 [ 0, %370 ], [ 0, %365 ], [ %271, %444 ]
%447 = xor i64 %446, -1
%448 = add nsw i64 %447, %261
br i1 %278, label %458, label %449
449: ; preds = %445, %449
%450 = phi i64 [ %455, %449 ], [ %446, %445 ]
%451 = phi i64 [ %456, %449 ], [ 0, %445 ]
%452 = getelementptr inbounds double, double* %367, i64 %450
%453 = load double, double* %452
%454 = getelementptr inbounds double, double* %369, i64 %450
store double %453, double* %454
%455 = add nuw nsw i64 %450, 1
%456 = add i64 %451, 1
%457 = icmp eq i64 %456, %277
br i1 %457, label %458, label %449
458: ; preds = %449, %445
%459 = phi i64 [ %446, %445 ], [ %455, %449 ]
%460 = icmp ult i64 %448, 3
br i1 %460, label %480, label %461
461: ; preds = %458, %461
%462 = phi i64 [ %478, %461 ], [ %459, %458 ]
%463 = getelementptr inbounds double, double* %367, i64 %462
%464 = load double, double* %463
%465 = getelementptr inbounds double, double* %369, i64 %462
store double %464, double* %465
%466 = add nuw nsw i64 %462, 1
%467 = getelementptr inbounds double, double* %367, i64 %466
%468 = load double, double* %467
%469 = getelementptr inbounds double, double* %369, i64 %466
store double %468, double* %469
%470 = add nuw nsw i64 %462, 2
%471 = getelementptr inbounds double, double* %367, i64 %470
%472 = load double, double* %471
%473 = getelementptr inbounds double, double* %369, i64 %470
store double %472, double* %473
%474 = add nuw nsw i64 %462, 3
%475 = getelementptr inbounds double, double* %367, i64 %474
%476 = load double, double* %475
%477 = getelementptr inbounds double, double* %369, i64 %474
store double %476, double* %477
%478 = add nuw nsw i64 %462, 4
%479 = icmp eq i64 %478, %265
br i1 %479, label %480, label %461
480: ; preds = %458, %461, %444, %363
%481 = add nuw nsw i64 %364, 1
%482 = icmp eq i64 %481, %264
br i1 %482, label %483, label %363
483: ; preds = %480, %362
%484 = add nsw i32 %325, 1
br label %485
485: ; preds = %483, %355
%486 = phi double [ %356, %483 ], [ %326, %355 ]
%487 = phi i32 [ %484, %483 ], [ %325, %355 ]
%488 = add nuw i32 %324, 1
%489 = icmp eq i32 %324, %249
br i1 %489, label %490, label %323
490: ; preds = %485, %319
%491 = phi double [ %322, %319 ], [ %486, %485 ]
%492 = phi i32 [ %321, %319 ], [ %487, %485 ]
%493 = sitofp i32 %320 to double
%494 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %493, i32 %253)
%495 = icmp eq i32 %320, 0
br i1 %495, label %501, label %496
496: ; preds = %490
%497 = load double, double* %317
%498 = fadd double %252, %497
store double %498, double* %317
%499 = load double, double* %318
%500 = call double @llvm.fmuladd.f64(double %252, double %252, double %499)
store double %500, double* %318
br label %501
501: ; preds = %490, %496
%502 = add nuw i32 %320, 1
%503 = icmp eq i32 %320, %1
br i1 %503, label %504, label %319
504: ; preds = %501, %314
%505 = phi i32 [ 0, %314 ], [ %492, %501 ]
%506 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), double %297, i32 %505)
%507 = getelementptr inbounds double, double* %9, i64 %295
%508 = load double, double* %507
%509 = fdiv double %508, %255
store double %509, double* %507
%510 = getelementptr inbounds double, double* %10, i64 %295
%511 = load double, double* %510
%512 = fdiv double %511, %257
store double %512, double* %510
%513 = add nuw nsw i64 %295, 1
%514 = icmp eq i64 %513, %259
br i1 %514, label %515, label %294
515: ; preds = %504, %128, %244
ret void
}