void comp_etaY_grid(int n, int p, int S, int order, int m, int Nknots,
                    double *knots, double *knotsI, double *G, double *all_beta,
                    double *all_sigma, double *data, double *eta, double *ystar,
                    double ***Pijs) {
  double *all_mu, *yi_jp, *mu_p, *mu_jp, *eta_i, *sigma_jp;
  double Pij[n][p], Pjs[p][S], data_mat[n][p], eta_mat[n][p];
  int s, i, j, k, j1;
  for (i = 0; i < n; i++) {
    for (j = 0; j < p; j++) {
      eta_mat[i][j] = eta[j * n + i];
      data_mat[i][j] = data[j * n + i];
      Pij[i][j] = 0;
    }
  }
  for (j = 0; j < p; j++) {
    for (s = 0; s < S; s++) {
      Pjs[j][s] = 0;
    }
  }
  eta_i = (double *)calloc(p, sizeof(double));
  for (i = 0; i < n; i++) {
    for (j = 0; j < p; j++) {
      for (s = 0; s < S; s++) {
        all_mu = (double *)calloc(p * (p + 1) / 2, sizeof(double));
        mu_p = (double *)calloc(p, sizeof(double));
        all_mu_comp(eta_i, p, order, m, Nknots, knots, knotsI, all_beta,
                    all_mu);
        free(all_mu);
        free(mu_p);
      }
    }
  }
  double *prob_vec, prob_check;
  int *perm, *num_grid;
  prob_vec = (double *)calloc(S, sizeof(double));
  perm = (int *)calloc(S, sizeof(int));
  num_grid = (int *)calloc(1, sizeof(int));
  for (i = 0; i < n; i++) {
    for (j = 0; j < p; j++) {
      prob_check = 0;
      for (s = 0; s < S; s++) {
        if (Pij[i][j] > 0) {
          prob_vec[s] = Pijs[i][j][s] / Pij[i][j];
        } else {
          prob_vec[s] = 1.0 / S;
        }
        prob_check = prob_check + prob_vec[s];
      }
      if (prob_check < 1.0) {
        for (s = 0; s < S; s++)
          prob_vec[s] = 1 / S;
      }
      int nc = 0;
      for (s = 0; s < S; s++)
        if (S * prob_vec[s] > 0.1)
          nc++;
      if (nc > 200)
        walker_ProbSampleReplace(S, prob_vec, perm, 1, num_grid);
      else
        ProbSampleReplace(S, prob_vec, perm, 1, num_grid);
      eta_mat[i][j] = G[num_grid[0] - 1];
    }
  }
  free(prob_vec);
  free(perm);
  prob_vec = (double *)calloc(n, sizeof(double));
  perm = (int *)calloc(n, sizeof(int));
  free(prob_vec);
  free(perm);
  free(num_grid);
  free(eta_i);
}


x86 assembly (clang, -O0):
<comp_etaY_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
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)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
mov    %rax,-0x110(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x50(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x108(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    %rax,-0x100(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xf8(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x68(%rbp)
mov    %rax,-0x70(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
mov    %rax,-0xf0(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xe8(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x78(%rbp)
mov    %rax,-0x80(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
mov    %rax,-0xe0(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xd8(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x88(%rbp)
mov    %rax,-0x90(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13af <comp_etaY_grid+0x25f>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1396 <comp_etaY_grid+0x246>
mov    -0x108(%rbp),%rax
mov    -0x110(%rbp),%rdx
mov    -0xe8(%rbp),%rcx
mov    -0xf0(%rbp),%rdi
mov    -0xd8(%rbp),%rsi
mov    -0xe0(%rbp),%r9
mov    0x40(%rbp),%r8
mov    -0x9c(%rbp),%r10d
imul   -0x4(%rbp),%r10d
add    -0x98(%rbp),%r10d
movslq %r10d,%r10
movsd  (%r8,%r10,8),%xmm0
movslq -0x98(%rbp),%r8
imul   %r9,%r8
shl    $0x3,%r8
add    %r8,%rsi
movslq -0x9c(%rbp),%r8
movsd  %xmm0,(%rsi,%r8,8)
mov    0x38(%rbp),%rsi
mov    -0x9c(%rbp),%r8d
imul   -0x4(%rbp),%r8d
add    -0x98(%rbp),%r8d
movslq %r8d,%r8
movsd  (%rsi,%r8,8),%xmm0
movslq -0x98(%rbp),%rsi
imul   %rdi,%rsi
shl    $0x3,%rsi
add    %rsi,%rcx
movslq -0x9c(%rbp),%rsi
movsd  %xmm0,(%rcx,%rsi,8)
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    12ab <comp_etaY_grid+0x15b>
jmp    139b <comp_etaY_grid+0x24b>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1292 <comp_etaY_grid+0x142>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    143d <comp_etaY_grid+0x2ed>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1424 <comp_etaY_grid+0x2d4>
mov    -0xf8(%rbp),%rax
mov    -0x100(%rbp),%rdx
movslq -0x9c(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x94(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    13d2 <comp_etaY_grid+0x282>
jmp    1429 <comp_etaY_grid+0x2d9>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    13b9 <comp_etaY_grid+0x269>
movslq -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1567 <comp_etaY_grid+0x417>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    154e <comp_etaY_grid+0x3fe>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1535 <comp_etaY_grid+0x3e5>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %eax,%rdi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x28(%rbp),%r10
mov    -0x20(%rbp),%rax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1060 <all_mu_comp@plt>
add    $0x20,%rsp
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    148b <comp_etaY_grid+0x33b>
jmp    153a <comp_etaY_grid+0x3ea>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1472 <comp_etaY_grid+0x322>
jmp    1553 <comp_etaY_grid+0x403>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1459 <comp_etaY_grid+0x309>
movslq -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0xb0(%rbp)
movslq -0xc(%rbp),%rdi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0xc0(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    18a6 <comp_etaY_grid+0x756>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    188d <comp_etaY_grid+0x73d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    16fb <comp_etaY_grid+0x5ab>
mov    -0x108(%rbp),%rax
mov    -0x110(%rbp),%rdx
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    16a0 <comp_etaY_grid+0x550>
mov    -0x108(%rbp),%rax
mov    -0x110(%rbp),%rdx
mov    0x50(%rbp),%rcx
movslq -0x98(%rbp),%rsi
mov    (%rcx,%rsi,8),%rcx
movslq -0x9c(%rbp),%rsi
mov    (%rcx,%rsi,8),%rcx
movslq -0x94(%rbp),%rsi
movsd  (%rcx,%rsi,8),%xmm0
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0xb0(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    16c4 <comp_etaY_grid+0x574>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0x953(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0xb0(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0xb0(%rbp),%rax
movslq -0x94(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    15ee <comp_etaY_grid+0x49e>
movsd  0x8fd(%rip),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    1763 <comp_etaY_grid+0x613>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    175e <comp_etaY_grid+0x60e>
mov    $0x1,%eax
cltd
idivl  -0xc(%rbp)
cvtsi2sd %eax,%xmm0
mov    -0xb0(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    171b <comp_etaY_grid+0x5cb>
jmp    1763 <comp_etaY_grid+0x613>
movl   $0x0,-0xcc(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    17d8 <comp_etaY_grid+0x688>
cvtsi2sdl -0xc(%rbp),%xmm0
mov    -0xb0(%rbp),%rax
movslq -0x94(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  0x862(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17bf <comp_etaY_grid+0x66f>
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
jmp    17c4 <comp_etaY_grid+0x674>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1777 <comp_etaY_grid+0x627>
cmpl   $0xc8,-0xcc(%rbp)
jle    1811 <comp_etaY_grid+0x6c1>
mov    -0xc(%rbp),%edi
mov    -0xb0(%rbp),%rsi
mov    -0xc0(%rbp),%rdx
mov    -0xc8(%rbp),%r8
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <walker_ProbSampleReplace@plt>
jmp    1835 <comp_etaY_grid+0x6e5>
mov    -0xc(%rbp),%edi
mov    -0xb0(%rbp),%rsi
mov    -0xc0(%rbp),%rdx
mov    -0xc8(%rbp),%r8
mov    $0x1,%ecx
mov    $0x0,%al
call   1050 <ProbSampleReplace@plt>
mov    -0xd8(%rbp),%rax
mov    -0xe0(%rbp),%rdx
mov    0x20(%rbp),%rcx
mov    -0xc8(%rbp),%rsi
mov    (%rsi),%esi
sub    $0x1,%esi
movslq %esi,%rsi
movsd  (%rcx,%rsi,8),%xmm0
movslq -0x98(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x9c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    15ca <comp_etaY_grid+0x47a>
jmp    1892 <comp_etaY_grid+0x742>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    15b1 <comp_etaY_grid+0x461>
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc0(%rbp),%rdi
call   1030 <free@plt>
movslq -0x4(%rbp),%rdi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0xb0(%rbp)
movslq -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_etaY_grid>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %r9d,-0x50(%rbp)
mov    %r8d,-0x48(%rbp)
mov    %ecx,-0xe0(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %esi,%ebx
mov    0x50(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    %edi,%ecx
mov    %esi,%eax
mov    %rax,-0x60(%rbp)
mov    %rcx,-0xa8(%rbp)
imul   %rcx,%rax
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %edi,-0x40(%rbp)
test   %edi,%edi
jle    124f <comp_etaY_grid+0xef>
mov    -0x60(%rbp),%rdi
lea    0x0(,%rdi,8),%rcx
mov    -0xa8(%rbp),%rdx
lea    -0x1(%rdx),%rax
mov    %edx,%r15d
and    $0x3,%r15d
cmp    $0x3,%rax
mov    %rcx,%r14
jae    18c8 <comp_etaY_grid+0x768>
xor    %r13d,%r13d
test   %r15,%r15
je     124f <comp_etaY_grid+0xef>
imul   -0x60(%rbp),%r13
mov    -0x78(%rbp),%rax
lea    (%rax,%r13,8),%r12
jmp    1239 <comp_etaY_grid+0xd9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %rcx,%r12
add    $0xffffffffffffffff,%r15
je     124f <comp_etaY_grid+0xef>
test   %ebx,%ebx
jle    1230 <comp_etaY_grid+0xd0>
mov    %r12,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <memset@plt>
mov    %r14,%rcx
jmp    1230 <comp_etaY_grid+0xd0>
movslq %ebx,%rdi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0x70(%rbp)
cmpl   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    %rbx,-0x88(%rbp)
jle    1340 <comp_etaY_grid+0x1e0>
lea    0x1(%rbx),%eax
imul   %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%r15
xor    %eax,%eax
mov    -0xc0(%rbp),%r12
jmp    12af <comp_etaY_grid+0x14f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
cmp    -0x40(%rbp),%eax
je     1340 <comp_etaY_grid+0x1e0>
mov    %eax,-0x38(%rbp)
test   %ebx,%ebx
jle    12a0 <comp_etaY_grid+0x140>
xor    %eax,%eax
jmp    12d8 <comp_etaY_grid+0x178>
nopw   0x0(%rax,%rax,1)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    -0x88(%rbp),%rbx
cmp    %ebx,%eax
mov    -0x30(%rbp),%rdx
je     12a0 <comp_etaY_grid+0x140>
mov    %eax,-0xa0(%rbp)
test   %edx,%edx
mov    -0xd0(%rbp),%rbx
jle    12c0 <comp_etaY_grid+0x160>
mov    -0x30(%rbp),%rax
mov    %eax,%r14d
mov    $0x8,%esi
mov    %r15,%rdi
call   1080 <calloc@plt>
mov    %rax,%r13
sub    $0x8,%rsp
mov    -0x70(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    -0xe0(%rbp),%edx
mov    -0x48(%rbp),%ecx
mov    -0x50(%rbp),%r8d
mov    %r12,%r9
xor    %eax,%eax
push   %r13
push   -0x68(%rbp)
push   %rbx
call   1070 <all_mu_comp@plt>
add    $0x20,%rsp
mov    %r13,%rdi
call   1030 <free@plt>
add    $0xffffffff,%r14d
jne    12f0 <comp_etaY_grid+0x190>
jmp    12c0 <comp_etaY_grid+0x160>
movslq %edx,%r14
mov    $0x8,%esi
mov    %r14,%rdi
call   1080 <calloc@plt>
mov    %rax,%rbx
mov    $0x4,%esi
mov    %r14,%rdi
call   1080 <calloc@plt>
mov    %rax,-0x50(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    -0x30(%rbp),%rdx
mov    %rax,-0x48(%rbp)
cmpl   $0x0,-0x40(%rbp)
mov    -0x80(%rbp),%rsi
jle    1897 <comp_etaY_grid+0x737>
cvtsi2sd %edx,%xmm8
movsd  0xc6a(%rip),%xmm4
lea    0x1(%rdx),%eax
cmp    $0x3,%eax
mov    $0x0,%eax
cmovb  %edx,%eax
cvtsi2sd %eax,%xmm9
divsd  %xmm8,%xmm4
mov    %edx,%r14d
mov    %r14d,%eax
and    $0xfffffffc,%eax
mov    %rax,-0x58(%rbp)
add    $0xfffffffffffffffc,%rax
mov    %rax,-0xb0(%rbp)
mov    %rax,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %r14d,%r12d
and    $0xfffffffe,%r12d
movapd %xmm9,%xmm6
unpcklpd %xmm9,%xmm6
mov    %ecx,%r8d
and    $0x7,%r8d
mov    %rcx,%rax
and    $0xfffffffffffffff8,%rax
mov    %rax,-0xe8(%rbp)
movapd %xmm8,%xmm10
unpcklpd %xmm8,%xmm10
movabs $0x7ffffffffffffff8,%rdi
ff ff 7f
or     $0x6,%rdi
mov    %rcx,%rax
mov    %rcx,-0x108(%rbp)
and    %rcx,%rdi
mov    %rdi,-0xf8(%rbp)
mov    %rbx,%rax
add    $0x10,%rax
mov    %rax,-0xf0(%rbp)
mov    %r8,-0x100(%rbp)
shl    $0x5,%r8
xorpd  %xmm5,%xmm5
xor    %r15d,%r15d
movapd %xmm8,-0xe0(%rbp)
ff ff
movsd  %xmm4,-0x68(%rbp)
movapd %xmm9,-0xa0(%rbp)
ff ff
movapd %xmm6,-0xd0(%rbp)
ff
movapd %xmm10,-0xc0(%rbp)
ff ff
mov    %r8,-0x38(%rbp)
jmp    1491 <comp_etaY_grid+0x331>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    -0xa8(%rbp),%r15
je     1897 <comp_etaY_grid+0x737>
cmpl   $0x0,-0x88(%rbp)
jle    1480 <comp_etaY_grid+0x320>
mov    %r15,%rax
imul   -0x60(%rbp),%rax
mov    -0x78(%rbp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,-0x40(%rbp)
xor    %r13d,%r13d
jmp    1521 <comp_etaY_grid+0x3c1>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x30(%rbp),%rdi
mov    %rbx,%rsi
mov    -0x50(%rbp),%rdx
mov    $0x1,%ecx
mov    -0x48(%rbp),%r8
xor    %eax,%eax
call   1060 <ProbSampleReplace@plt>
xorpd  %xmm5,%xmm5
mov    -0x38(%rbp),%r8
movapd -0xc0(%rbp),%xmm10
ff ff
movapd -0xd0(%rbp),%xmm6
ff
movapd -0xa0(%rbp),%xmm9
ff ff
movsd  -0x68(%rbp),%xmm4
movapd -0xe0(%rbp),%xmm8
ff ff
mov    -0x80(%rbp),%rsi
mov    -0x30(%rbp),%rdx
add    $0x1,%r13
cmp    -0x60(%rbp),%r13
je     1480 <comp_etaY_grid+0x320>
test   %edx,%edx
jle    15d0 <comp_etaY_grid+0x470>
mov    -0x40(%rbp),%rax
movsd  (%rax,%r13,8),%xmm1
xorpd  %xmm0,%xmm0
xor    %eax,%eax
cmp    $0x1,%edx
jne    1587 <comp_etaY_grid+0x427>
test   $0x1,%r14b
je     15d4 <comp_etaY_grid+0x474>
ucomisd %xmm5,%xmm1
movapd %xmm4,%xmm2
jbe    1563 <comp_etaY_grid+0x403>
mov    (%rsi,%r15,8),%rcx
mov    (%rcx,%r13,8),%rcx
movsd  (%rcx,%rax,8),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
addsd  %xmm2,%xmm0
jmp    15d4 <comp_etaY_grid+0x474>
xchg   %ax,%ax
addsd  %xmm2,%xmm0
movsd  %xmm3,0x8(%rbx,%rax,8)
addsd  %xmm3,%xmm0
add    $0x2,%rax
cmp    %rax,%r12
je     153e <comp_etaY_grid+0x3de>
ucomisd %xmm5,%xmm1
movapd %xmm4,%xmm2
jbe    15a2 <comp_etaY_grid+0x442>
mov    (%rsi,%r15,8),%rcx
mov    (%rcx,%r13,8),%rcx
movsd  (%rcx,%rax,8),%xmm2
divsd  %xmm1,%xmm2
ucomisd %xmm5,%xmm1
movsd  %xmm2,(%rbx,%rax,8)
movapd %xmm4,%xmm3
jbe    1570 <comp_etaY_grid+0x410>
mov    (%rsi,%r15,8),%rcx
mov    (%rcx,%r13,8),%rcx
movsd  0x8(%rcx,%rax,8),%xmm3
divsd  %xmm1,%xmm3
jmp    1570 <comp_etaY_grid+0x410>
cs nopw 0x0(%rax,%rax,1)
nop
xorpd  %xmm0,%xmm0
movsd  0xa24(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    16ef <comp_etaY_grid+0x58f>
test   %edx,%edx
jle    16ef <comp_etaY_grid+0x58f>
cmp    $0x4,%edx
jae    1600 <comp_etaY_grid+0x4a0>
xor    %eax,%eax
jmp    16e0 <comp_etaY_grid+0x580>
nopw   0x0(%rax,%rax,1)
cmpq   $0x1c,-0xb0(%rbp)
1c
jae    1611 <comp_etaY_grid+0x4b1>
xor    %eax,%eax
jmp    16a5 <comp_etaY_grid+0x545>
mov    -0xe8(%rbp),%rcx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movupd %xmm6,(%rbx,%rax,8)
movupd %xmm6,0x10(%rbx,%rax,8)
movupd %xmm6,0x20(%rbx,%rax,8)
movupd %xmm6,0x30(%rbx,%rax,8)
movupd %xmm6,0x40(%rbx,%rax,8)
movupd %xmm6,0x50(%rbx,%rax,8)
movupd %xmm6,0x60(%rbx,%rax,8)
movupd %xmm6,0x70(%rbx,%rax,8)
movupd %xmm6,0x80(%rbx,%rax,8)
movupd %xmm6,0x90(%rbx,%rax,8)
movupd %xmm6,0xa0(%rbx,%rax,8)
movupd %xmm6,0xb0(%rbx,%rax,8)
movupd %xmm6,0xc0(%rbx,%rax,8)
movupd %xmm6,0xd0(%rbx,%rax,8)
movupd %xmm6,0xe0(%rbx,%rax,8)
movupd %xmm6,0xf0(%rbx,%rax,8)
add    $0x20,%rax
add    $0xfffffffffffffff8,%rcx
jne    1620 <comp_etaY_grid+0x4c0>
cmpq   $0x0,-0x100(%rbp)
je     16d4 <comp_etaY_grid+0x574>
mov    -0xf0(%rbp),%rcx
lea    (%rcx,%rax,8),%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
movupd %xmm6,-0x10(%rax,%rcx,1)
movupd %xmm6,(%rax,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%r8
jne    16c0 <comp_etaY_grid+0x560>
mov    -0x58(%rbp),%rcx
mov    %rcx,%rax
cmp    %r14,%rcx
je     16ef <comp_etaY_grid+0x58f>
movsd  %xmm9,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    16e0 <comp_etaY_grid+0x580>
test   %edx,%edx
jle    14c0 <comp_etaY_grid+0x360>
cmp    $0x4,%edx
jae    1710 <comp_etaY_grid+0x5b0>
xor    %ecx,%ecx
xor    %eax,%eax
movsd  0x8ff(%rip),%xmm9
jmp    1820 <comp_etaY_grid+0x6c0>
xchg   %ax,%ax
cmpq   $0x0,-0xb0(%rbp)
je     186a <comp_etaY_grid+0x70a>
xorpd  %xmm0,%xmm0
mov    -0xf8(%rbp),%rcx
xor    %eax,%eax
xorpd  %xmm1,%xmm1
movsd  0x8d0(%rip),%xmm9
movapd 0x8d0(%rip),%xmm7
movupd (%rbx,%rax,8),%xmm2
movupd 0x10(%rbx,%rax,8),%xmm3
movupd 0x20(%rbx,%rax,8),%xmm4
movupd 0x30(%rbx,%rax,8),%xmm5
mulpd  %xmm10,%xmm2
mulpd  %xmm10,%xmm3
movapd %xmm7,%xmm6
cmpltpd %xmm2,%xmm6
shufps $0xe8,%xmm6,%xmm6
psubd  %xmm6,%xmm0
movapd %xmm7,%xmm2
cmpltpd %xmm3,%xmm2
shufps $0xe8,%xmm2,%xmm2
psubd  %xmm2,%xmm1
mulpd  %xmm10,%xmm4
mulpd  %xmm10,%xmm5
movapd %xmm7,%xmm2
cmpltpd %xmm4,%xmm2
shufps $0xe8,%xmm2,%xmm2
psubd  %xmm2,%xmm0
movapd %xmm7,%xmm2
cmpltpd %xmm5,%xmm2
shufps $0xe8,%xmm2,%xmm2
psubd  %xmm2,%xmm1
add    $0x8,%rax
add    $0xfffffffffffffffe,%rcx
jne    1740 <comp_etaY_grid+0x5e0>
testb  $0x1,-0x108(%rbp)
je     17f9 <comp_etaY_grid+0x699>
movupd (%rbx,%rax,8),%xmm2
movupd 0x10(%rbx,%rax,8),%xmm3
mulpd  %xmm10,%xmm2
mulpd  %xmm10,%xmm3
movapd %xmm7,%xmm4
cmpltpd %xmm2,%xmm4
shufps $0xe8,%xmm4,%xmm4
psubd  %xmm4,%xmm0
movapd %xmm7,%xmm2
cmpltpd %xmm3,%xmm2
shufps $0xe8,%xmm2,%xmm2
psubd  %xmm2,%xmm1
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
mov    -0x58(%rbp),%rdx
mov    %rdx,%rcx
cmp    %r14,%rdx
je     183f <comp_etaY_grid+0x6df>
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
mulsd  %xmm8,%xmm0
xor    %edx,%edx
ucomisd %xmm9,%xmm0
seta   %dl
add    %edx,%eax
add    $0x1,%rcx
cmp    %rcx,%r14
jne    1820 <comp_etaY_grid+0x6c0>
cmp    $0xc9,%eax
jb     14c0 <comp_etaY_grid+0x360>
mov    -0x30(%rbp),%rdi
mov    %rbx,%rsi
mov    -0x50(%rbp),%rdx
mov    $0x1,%ecx
mov    -0x48(%rbp),%r8
xor    %eax,%eax
call   1040 <walker_ProbSampleReplace@plt>
jmp    14db <comp_etaY_grid+0x37b>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
movsd  0x78b(%rip),%xmm9
movapd 0x78b(%rip),%xmm7
testb  $0x1,-0x108(%rbp)
jne    17c2 <comp_etaY_grid+0x662>
jmp    17f9 <comp_etaY_grid+0x699>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
and    $0xfffffffc,%edx
mov    %rdx,-0x70(%rbp)
mov    %rdi,%rax
shl    $0x5,%rax
mov    %rax,-0xa0(%rbp)
shl    $0x4,%rdi
mov    %rdi,-0x38(%rbp)
lea    (%rcx,%rcx,2),%rax
mov    %rax,-0x58(%rbp)
xor    %r13d,%r13d
mov    -0x78(%rbp),%r12
jmp    1915 <comp_etaY_grid+0x7b5>
cs nopw 0x0(%rax,%rax,1)
add    $0x4,%r13
add    -0xa0(%rbp),%r12
cmp    %r13,-0x70(%rbp)
je     120f <comp_etaY_grid+0xaf>
test   %ebx,%ebx
jle    1900 <comp_etaY_grid+0x7a0>
mov    %r12,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <memset@plt>
lea    (%r12,%r14,1),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <memset@plt>
mov    -0x38(%rbp),%rax
lea    (%r12,%rax,1),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <memset@plt>
mov    -0x58(%rbp),%rax
lea    (%r12,%rax,1),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <memset@plt>
mov    %r14,%rcx
jmp    1900 <comp_etaY_grid+0x7a0>

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

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