#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 */
typedef size_t V;
typedef int K;

/* Variables and functions */
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int sample_Mult_labeled(int, double **, double *, int, int, double, double,
                        int *);
void resample_z(int D, int **M, int *N, double alpha, double eta,
                double **post_beta, double **post_theta, int ***w, int ***z,
                int **labels, int K, int V) {
  int d_10;
  int n_16;
  int m_22;
  double *tmp_post_z_3;
  int tmp_idx_z_3;
  int dvv_loop_var_1;
  tmp_post_z_3 = (double *)malloc(sizeof(double) * (1 + ((K) + (1)) - (1)));
  for (d_10 = 1; d_10 <= D; d_10++) {
    for (n_16 = 1; n_16 <= N[d_10 - 1]; n_16++) {
      for (m_22 = 1; m_22 <= M[d_10 - 1][n_16 - 1]; m_22++) {
        post_theta[d_10 - 1][(K) + (1) - 1] += (0.0) - (1.0);
        post_theta[d_10 - 1][z[d_10 - 1][n_16 - 1][m_22 - 1] - 1] +=
            (0.0) - (1.0);
        post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1][(V) + (1) - 1] +=
            (0.0) - ((1.0) * ((((z[d_10 - 1][n_16 - 1][m_22 - 1]) ==
                                (z[d_10 - 1][n_16 - 1][m_22 - 1]))
                                   ? 1
                                   : 0)));
        post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1]
                 [w[d_10 - 1][n_16 - 1][m_22 - 1] - 1] +=
            (0.0) - ((1.0) * ((((z[d_10 - 1][n_16 - 1][m_22 - 1]) ==
                                (z[d_10 - 1][n_16 - 1][m_22 - 1]))
                                   ? 1
                                   : 0)));
        z[d_10 - 1][n_16 - 1][m_22 - 1] = sample_Mult_labeled(
            w[d_10 - 1][n_16 - 1][m_22 - 1], post_beta, post_theta[d_10 - 1], V,
            K, alpha, eta, labels[d_10 - 1]);
        post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1][(V) + (1) - 1] +=
            (1.0) * ((((z[d_10 - 1][n_16 - 1][m_22 - 1]) ==
                       (z[d_10 - 1][n_16 - 1][m_22 - 1]))
                          ? 1
                          : 0));
        post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1]
                 [w[d_10 - 1][n_16 - 1][m_22 - 1] - 1] +=
            (1.0) * ((((z[d_10 - 1][n_16 - 1][m_22 - 1]) ==
                       (z[d_10 - 1][n_16 - 1][m_22 - 1]))
                          ? 1
                          : 0));
        post_theta[d_10 - 1][(K) + (1) - 1] += 1.0;
        post_theta[d_10 - 1][z[d_10 - 1][n_16 - 1][m_22 - 1] - 1] += 1.0;
      }
    }
  }
  free(tmp_post_z_3);
}


x86 assembly (clang, -O0):
<resample_z>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    0x20(%rbp),%eax
add    $0x1,%eax
add    $0x1,%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     16d6 <resample_z+0x5a6>
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     16c3 <resample_z+0x593>
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     16b0 <resample_z+0x580>
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xdff(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xdac(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
cvtsi2sd %eax,%xmm1
xorps  %xmm0,%xmm0
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x28(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
cvtsi2sd %eax,%xmm1
xorps  %xmm0,%xmm0
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    0x28(%rbp),%ecx
mov    0x20(%rbp),%r8d
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    0x18(%rbp),%rax
mov    -0x44(%rbp),%r9d
sub    $0x1,%r9d
movslq %r9d,%r9
mov    (%rax,%r9,8),%r9
call   1040 <sample_Mult_labeled@plt>
mov    %eax,%edx
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x28(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x9bb(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x48(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x4c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x968(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11be <resample_z+0x8e>
jmp    16b5 <resample_z+0x585>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    119e <resample_z+0x6e>
jmp    16c8 <resample_z+0x598>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    118b <resample_z+0x5b>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resample_z>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%r15
mov    %r8,%r12
mov    %rcx,%rbp
movsd  %xmm1,0x60(%rsp)
movsd  %xmm0,0x58(%rsp)
mov    %rdx,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    %edi,%r13d
mov    0xb8(%rsp),%ebx
mov    0xb0(%rsp),%r14d
mov    0xa8(%rsp),%rax
mov    %rax,0x50(%rsp)
mov    0xa0(%rsp),%rax
mov    %rax,0x18(%rsp)
lea    0x8(,%r14,8),%edi
call   1050 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    %r13,(%rsp)
test   %r13d,%r13d
jle    1394 <resample_z+0x264>
mov    %r14,%r8
mov    %rbp,%rsi
mov    %r12,%r11
movslq %r8d,%r14
movslq %ebx,%rcx
mov    (%rsp),%rax
add    $0x1,%eax
mov    %rax,(%rsp)
mov    $0x1,%ebx
movsd  0xe31(%rip),%xmm1
mov    %r15,0x48(%rsp)
mov    %rbp,0x40(%rsp)
mov    %r12,0x38(%rsp)
mov    %rcx,0x30(%rsp)
mov    0x10(%rsp),%r12
jmp    11fe <resample_z+0xce>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    (%rsp),%rbx
je     1394 <resample_z+0x264>
mov    0x8(%rsp),%rax
mov    -0x4(%rax,%rbx,4),%r9d
test   %r9d,%r9d
jle    11f0 <resample_z+0xc0>
mov    0x10(%rsp),%rax
mov    -0x8(%rax,%rbx,8),%rbp
mov    $0x1,%edi
jmp    122f <resample_z+0xff>
xchg   %ax,%ax
lea    0x1(%rdi),%rax
movslq %r9d,%rdx
cmp    %rdx,%rdi
mov    %rax,%rdi
jge    11f0 <resample_z+0xc0>
cmpl   $0x0,-0x4(%rbp,%rdi,4)
jle    1220 <resample_z+0xf0>
mov    -0x8(%r11,%rbx,8),%rdx
mov    0x18(%rsp),%rax
mov    -0x8(%rax,%rbx,8),%rax
mov    -0x8(%rax,%rdi,8),%r9
mov    -0x8(%r15,%rbx,8),%rax
mov    -0x8(%rax,%rdi,8),%rax
mov    %rdi,0x20(%rsp)
xor    %r13d,%r13d
nopl   0x0(%rax)
movsd  (%rdx,%r14,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%r14,8)
movslq (%r9,%r13,4),%rdi
movsd  -0x8(%rdx,%rdi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rdx,%rdi,8)
mov    -0x8(%rsi,%rdi,8),%rbp
movsd  0x0(%rbp,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
movslq (%rax,%r13,4),%rdi
movsd  -0x8(%rbp,%rdi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp,%rdi,8)
mov    0x50(%rsp),%rax
mov    -0x8(%rax,%rbx,8),%r9
movsd  0x58(%rsp),%xmm0
movsd  0x60(%rsp),%xmm1
mov    %r14,%rbp
mov    %r8,%r14
call   1040 <sample_Mult_labeled@plt>
movsd  0xd32(%rip),%xmm2
movsd  0xd22(%rip),%xmm1
mov    0x18(%rsp),%rdx
mov    %r14,%r8
mov    %rbp,%r14
mov    0x30(%rsp),%rcx
mov    0x40(%rsp),%rsi
mov    0x38(%rsp),%r11
mov    0x48(%rsp),%r15
mov    -0x8(%rdx,%rbx,8),%rdx
mov    0x20(%rsp),%r10
mov    -0x8(%rdx,%r10,8),%r9
mov    %eax,(%r9,%r13,4)
movslq %eax,%rbp
mov    -0x8(%rsi,%rbp,8),%rdx
movsd  (%rdx,%rcx,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
mov    -0x8(%r15,%rbx,8),%rax
mov    -0x8(%rax,%r10,8),%rax
movslq (%rax,%r13,4),%rdi
movsd  -0x8(%rdx,%rdi,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,-0x8(%rdx,%rdi,8)
mov    -0x8(%r11,%rbx,8),%rdx
movsd  (%rdx,%r14,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rdx,%r14,8)
movsd  -0x8(%rdx,%rbp,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,-0x8(%rdx,%rbp,8)
mov    -0x8(%r12,%rbx,8),%rbp
movslq -0x4(%rbp,%r10,4),%rdi
add    $0x1,%r13
cmp    %rdi,%r13
jl     1260 <resample_z+0x130>
mov    0x8(%rsp),%rax
mov    -0x4(%rax,%rbx,4),%r9d
mov    0x20(%rsp),%rdi
jmp    1220 <resample_z+0xf0>
mov    0x28(%rsp),%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @resample_z(i32 %0, i32** nocapture %1, i32* nocapture %2, double %3, double %4, double** %5, double** nocapture %6, i32*** nocapture %7, i32*** nocapture %8, i32** nocapture %9, i32 %10, i32 %11) {
%13 = shl i32 %10, 3
%14 = add i32 %13, 8
%15 = tail call i64 @malloc(i32 %14)
%16 = icmp slt i32 %0, 1
br i1 %16, label %126, label %17
17: ; preds = %12
%18 = sext i32 %10 to i64
%19 = sext i32 %11 to i64
%20 = add nuw i32 %0, 1
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %17, %123
%23 = phi i64 [ 1, %17 ], [ %124, %123 ]
%24 = add nsw i64 %23, -1
%25 = getelementptr inbounds i32, i32* %2, i64 %24
%26 = load i32, i32* %25
%27 = icmp slt i32 %26, 1
br i1 %27, label %123, label %28
28: ; preds = %22
%29 = getelementptr inbounds i32*, i32** %1, i64 %24
%30 = getelementptr inbounds double*, double** %6, i64 %24
%31 = getelementptr inbounds i32**, i32*** %8, i64 %24
%32 = getelementptr inbounds i32**, i32*** %7, i64 %24
%33 = getelementptr inbounds i32*, i32** %9, i64 %24
%34 = load i32*, i32** %29
br label %35
35: ; preds = %28, %117
%36 = phi i32 [ %26, %28 ], [ %118, %117 ]
%37 = phi i32* [ %34, %28 ], [ %119, %117 ]
%38 = phi i64 [ 1, %28 ], [ %120, %117 ]
%39 = add nsw i64 %38, -1
%40 = getelementptr inbounds i32, i32* %37, i64 %39
%41 = load i32, i32* %40
%42 = icmp slt i32 %41, 1
br i1 %42, label %117, label %43
43: ; preds = %35
%44 = load double*, double** %30
%45 = load i32**, i32*** %31
%46 = getelementptr inbounds i32*, i32** %45, i64 %39
%47 = load i32*, i32** %46
%48 = load i32**, i32*** %32
%49 = getelementptr inbounds i32*, i32** %48, i64 %39
%50 = load i32*, i32** %49
br label %51
51: ; preds = %43, %51
%52 = phi i32* [ %50, %43 ], [ %94, %51 ]
%53 = phi i32* [ %47, %43 ], [ %83, %51 ]
%54 = phi double* [ %44, %43 ], [ %102, %51 ]
%55 = phi i64 [ 1, %43 ], [ %109, %51 ]
%56 = getelementptr inbounds double, double* %54, i64 %18
%57 = load double, double* %56
%58 = fadd double %57, -1.000000e+00
store double %58, double* %56
%59 = add nsw i64 %55, -1
%60 = getelementptr inbounds i32, i32* %53, i64 %59
%61 = load i32, i32* %60
%62 = add nsw i32 %61, -1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %54, i64 %63
%65 = load double, double* %64
%66 = fadd double %65, -1.000000e+00
store double %66, double* %64
%67 = getelementptr inbounds double*, double** %5, i64 %63
%68 = load double*, double** %67
%69 = getelementptr inbounds double, double* %68, i64 %19
%70 = load double, double* %69
%71 = fadd double %70, -1.000000e+00
store double %71, double* %69
%72 = getelementptr inbounds i32, i32* %52, i64 %59
%73 = load i32, i32* %72
%74 = add nsw i32 %73, -1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %68, i64 %75
%77 = load double, double* %76
%78 = fadd double %77, -1.000000e+00
store double %78, double* %76
%79 = load i32*, i32** %33
%80 = tail call i32 @sample_Mult_labeled(i32 %73, double** %5, double* %54, i32 %11, i32 %10, double %3, double %4, i32* %79)
%81 = load i32**, i32*** %31
%82 = getelementptr inbounds i32*, i32** %81, i64 %39
%83 = load i32*, i32** %82
%84 = getelementptr inbounds i32, i32* %83, i64 %59
store i32 %80, i32* %84
%85 = add nsw i32 %80, -1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double*, double** %5, i64 %86
%88 = load double*, double** %87
%89 = getelementptr inbounds double, double* %88, i64 %19
%90 = load double, double* %89
%91 = fadd double %90, 1.000000e+00
store double %91, double* %89
%92 = load i32**, i32*** %32
%93 = getelementptr inbounds i32*, i32** %92, i64 %39
%94 = load i32*, i32** %93
%95 = getelementptr inbounds i32, i32* %94, i64 %59
%96 = load i32, i32* %95
%97 = add nsw i32 %96, -1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %88, i64 %98
%100 = load double, double* %99
%101 = fadd double %100, 1.000000e+00
store double %101, double* %99
%102 = load double*, double** %30
%103 = getelementptr inbounds double, double* %102, i64 %18
%104 = load double, double* %103
%105 = fadd double %104, 1.000000e+00
store double %105, double* %103
%106 = getelementptr inbounds double, double* %102, i64 %86
%107 = load double, double* %106
%108 = fadd double %107, 1.000000e+00
store double %108, double* %106
%109 = add nuw nsw i64 %55, 1
%110 = load i32*, i32** %29
%111 = getelementptr inbounds i32, i32* %110, i64 %39
%112 = load i32, i32* %111
%113 = sext i32 %112 to i64
%114 = icmp slt i64 %55, %113
br i1 %114, label %51, label %115
115: ; preds = %51
%116 = load i32, i32* %25
br label %117
117: ; preds = %115, %35
%118 = phi i32 [ %116, %115 ], [ %36, %35 ]
%119 = phi i32* [ %110, %115 ], [ %37, %35 ]
%120 = add nuw nsw i64 %38, 1
%121 = sext i32 %118 to i64
%122 = icmp slt i64 %38, %121
br i1 %122, label %35, label %123
123: ; preds = %117, %22
%124 = add nuw nsw i64 %23, 1
%125 = icmp eq i64 %124, %21
br i1 %125, label %126, label %22
126: ; preds = %123, %12
%127 = inttoptr i64 %15 to double*
%128 = tail call i32 @free(double* %127)
ret void
}