#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,
                double **post_theta_train, int *entity_map, 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;
  double *theta_counts;
  tmp_post_z_3 = (double *)malloc(sizeof(double) * (1 + ((K) + (1)) - (1)));
  for (d_10 = 1; d_10 <= D; d_10++) {
    if (entity_map[d_10 - 1] == -1) {
      theta_counts = post_theta[d_10 - 1];
    } else {
      theta_counts = post_theta_train[entity_map[d_10 - 1]];
    }
    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++) {
        theta_counts[(K) + (1) - 1] += (0.0) - (1.0);
        theta_counts[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, theta_counts, 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));
        theta_counts[(K) + (1) - 1] += 1.0;
        theta_counts[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    $0x70,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
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    0x30(%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     16eb <resample_z+0x5bb>
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    11d0 <resample_z+0xa0>
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x68(%rbp)
jmp    11ed <resample_z+0xbd>
mov    -0x40(%rbp),%rax
mov    0x10(%rbp),%rcx
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x68(%rbp)
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     16d8 <resample_z+0x5a8>
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     16c5 <resample_z+0x595>
mov    -0x68(%rbp),%rax
mov    0x30(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xdb6(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
mov    0x20(%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  0xd70(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%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    0x20(%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    0x20(%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    0x38(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%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    0x20(%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    0x20(%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    0x18(%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    0x18(%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    -0x68(%rbp),%rdx
mov    0x38(%rbp),%ecx
mov    0x30(%rbp),%r8d
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    0x28(%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    0x20(%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    0x20(%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    0x20(%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    0x20(%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    0x38(%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    0x20(%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    0x20(%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    0x20(%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    0x18(%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    -0x68(%rbp),%rax
mov    0x30(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x999(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
mov    0x20(%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  0x953(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1214 <resample_z+0xe4>
jmp    16ca <resample_z+0x59a>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11f4 <resample_z+0xc4>
jmp    16dd <resample_z+0x5ad>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1193 <resample_z+0x63>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resample_z>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,0x38(%rsp)
mov    %r8,0x30(%rsp)
mov    %rcx,%r13
movsd  %xmm1,0x68(%rsp)
movsd  %xmm0,0x60(%rsp)
mov    %rdx,0x8(%rsp)
mov    %rsi,%r12
mov    %edi,%ebx
mov    0xd8(%rsp),%r14d
mov    0xd0(%rsp),%ecx
mov    %rcx,0x10(%rsp)
mov    0xc8(%rsp),%rax
mov    %rax,0x58(%rsp)
mov    0xc0(%rsp),%rbp
mov    0xb8(%rsp),%r15
mov    0xb0(%rsp),%rax
mov    %rax,0x28(%rsp)
lea    0x8(,%rcx,8),%edi
call   1050 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %rbx,(%rsp)
test   %ebx,%ebx
jle    13e4 <resample_z+0x2b4>
mov    %r15,%r9
mov    %rbp,%r8
mov    %r13,%rsi
movslq 0x10(%rsp),%r10
movslq %r14d,%r11
mov    (%rsp),%rax
add    $0x1,%eax
mov    %rax,(%rsp)
mov    $0x1,%r15d
movsd  0xe1a(%rip),%xmm1
mov    %r9,0x50(%rsp)
mov    %r12,0x48(%rsp)
mov    %r13,0x40(%rsp)
jmp    120e <resample_z+0xde>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    (%rsp),%r15
je     13e4 <resample_z+0x2b4>
mov    0x28(%rsp),%rax
movslq -0x4(%rax,%r15,4),%rax
cmp    $0xffffffffffffffff,%rax
mov    0x30(%rsp),%rcx
lea    -0x8(%rcx,%r15,8),%rdx
mov    0x38(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
cmove  %rdx,%rcx
mov    0x8(%rsp),%rax
mov    -0x4(%rax,%r15,4),%eax
test   %eax,%eax
jle    1200 <resample_z+0xd0>
mov    (%rcx),%rdx
mov    -0x8(%r12,%r15,8),%rbp
mov    $0x1,%ebx
mov    %r15,0x70(%rsp)
jmp    126f <resample_z+0x13f>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%rcx
movslq %eax,%rdi
cmp    %rdi,%rbx
mov    %rcx,%rbx
jge    1200 <resample_z+0xd0>
cmpl   $0x0,-0x4(%rbp,%rbx,4)
jle    1260 <resample_z+0x130>
mov    -0x8(%r8,%r15,8),%rax
mov    -0x8(%rax,%rbx,8),%r13
mov    -0x8(%r9,%r15,8),%rax
mov    -0x8(%rax,%rbx,8),%rax
mov    %rbx,0x18(%rsp)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rdx,%r10,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%r10,8)
movslq 0x0(%r13,%rbx,4),%rcx
movsd  -0x8(%rdx,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rdx,%rcx,8)
mov    -0x8(%rsi,%rcx,8),%rcx
movsd  (%rcx,%r11,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rcx,%r11,8)
movslq (%rax,%rbx,4),%rdi
movsd  -0x8(%rcx,%rdi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rcx,%rdi,8)
mov    0x58(%rsp),%rax
mov    -0x8(%rax,%r15,8),%r9
mov    %r11d,%ecx
mov    %r8,%r15
mov    0x10(%rsp),%r8
movsd  0x60(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
mov    %r10,%rbp
mov    %rdx,%r14
mov    %r11,%r13
call   1040 <sample_Mult_labeled@plt>
movsd  0xce3(%rip),%xmm2
movsd  0xcd3(%rip),%xmm1
mov    %r13,%r11
mov    %r14,%rdx
mov    %rbp,%r10
mov    0x50(%rsp),%r9
mov    %r15,%r8
mov    0x70(%rsp),%r15
mov    0x40(%rsp),%rsi
mov    0x48(%rsp),%r12
mov    -0x8(%r8,%r15,8),%rcx
mov    0x18(%rsp),%r14
mov    -0x8(%rcx,%r14,8),%r13
mov    %eax,0x0(%r13,%rbx,4)
movslq %eax,%rcx
mov    -0x8(%rsi,%rcx,8),%rbp
movsd  0x0(%rbp,%r11,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x0(%rbp,%r11,8)
mov    -0x8(%r9,%r15,8),%rax
mov    -0x8(%rax,%r14,8),%rax
movslq (%rax,%rbx,4),%rdi
movsd  -0x8(%rbp,%rdi,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,-0x8(%rbp,%rdi,8)
movsd  (%rdx,%r10,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rdx,%r10,8)
movsd  -0x8(%rdx,%rcx,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,-0x8(%rdx,%rcx,8)
mov    -0x8(%r12,%r15,8),%rbp
movslq -0x4(%rbp,%r14,4),%rdi
add    $0x1,%rbx
cmp    %rdi,%rbx
jl     12a0 <resample_z+0x170>
mov    0x8(%rsp),%rax
mov    -0x4(%rax,%r15,4),%eax
mov    0x18(%rsp),%rbx
jmp    1260 <resample_z+0x130>
mov    0x20(%rsp),%rdi
add    $0x78,%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, double** %7, i32* %8, i32*** %9, i32*** %10, i32** %11, i32 %12, i32 %13) {
%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 i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca double*
%33 = alloca i32
%34 = alloca i32
%35 = alloca double*
store i32 %0, i32* %15
store i32** %1, i32*** %16
store i32* %2, i32** %17
store double %3, double* %18
store double %4, double* %19
store double** %5, double*** %20
store double** %6, double*** %21
store double** %7, double*** %22
store i32* %8, i32** %23
store i32*** %9, i32**** %24
store i32*** %10, i32**** %25
store i32** %11, i32*** %26
store i32 %12, i32* %27
store i32 %13, i32* %28
%36 = load i32, i32* %27
%37 = add nsw i32 %36, 1
%38 = add nsw i32 1, %37
%39 = sub nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = mul i64 8, %40
%42 = trunc i64 %41 to i32
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to double*
store double* %44, double** %32
store i32 1, i32* %29
br label %45
45: ; preds = %499, %14
%46 = load i32, i32* %29
%47 = load i32, i32* %15
%48 = icmp sle i32 %46, %47
br i1 %48, label %49, label %502
49: ; preds = %45
%50 = load i32*, i32** %23
%51 = load i32, i32* %29
%52 = sub nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %50, i64 %53
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %64
57: ; preds = %49
%58 = load double**, double*** %21
%59 = load i32, i32* %29
%60 = sub nsw i32 %59, 1
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double*, double** %58, i64 %61
%63 = load double*, double** %62
store double* %63, double** %35
br label %75
64: ; preds = %49
%65 = load double**, double*** %22
%66 = load i32*, i32** %23
%67 = load i32, i32* %29
%68 = sub nsw i32 %67, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i32, i32* %66, i64 %69
%71 = load i32, i32* %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double*, double** %65, i64 %72
%74 = load double*, double** %73
store double* %74, double** %35
br label %75
75: ; preds = %64, %57
store i32 1, i32* %30
br label %76
76: ; preds = %495, %75
%77 = load i32, i32* %30
%78 = load i32*, i32** %17
%79 = load i32, i32* %29
%80 = sub nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i32, i32* %78, i64 %81
%83 = load i32, i32* %82
%84 = icmp sle i32 %77, %83
br i1 %84, label %85, label %498
85: ; preds = %76
store i32 1, i32* %31
br label %86
86: ; preds = %491, %85
%87 = load i32, i32* %31
%88 = load i32**, i32*** %16
%89 = load i32, i32* %29
%90 = sub nsw i32 %89, 1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32*, i32** %88, i64 %91
%93 = load i32*, i32** %92
%94 = load i32, i32* %30
%95 = sub nsw i32 %94, 1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %93, i64 %96
%98 = load i32, i32* %97
%99 = icmp sle i32 %87, %98
br i1 %99, label %100, label %494
100: ; preds = %86
%101 = load double*, double** %35
%102 = load i32, i32* %27
%103 = add nsw i32 %102, 1
%104 = sub nsw i32 %103, 1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %101, i64 %105
%107 = load double, double* %106
%108 = fadd double %107, -1.000000e+00
store double %108, double* %106
%109 = load double*, double** %35
%110 = load i32***, i32**** %25
%111 = load i32, i32* %29
%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* %30
%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* %31
%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 = sub nsw i32 %125, 1
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %109, i64 %127
%129 = load double, double* %128
%130 = fadd double %129, -1.000000e+00
store double %130, double* %128
%131 = load i32***, i32**** %25
%132 = load i32, i32* %29
%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* %30
%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 = load i32, i32* %31
%143 = sub nsw i32 %142, 1
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i32, i32* %141, i64 %144
%146 = load i32, i32* %145
%147 = load i32***, i32**** %25
%148 = load i32, i32* %29
%149 = sub nsw i32 %148, 1
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32**, i32*** %147, i64 %150
%152 = load i32**, i32*** %151
%153 = load i32, i32* %30
%154 = sub nsw i32 %153, 1
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i32*, i32** %152, i64 %155
%157 = load i32*, i32** %156
%158 = load i32, i32* %31
%159 = sub nsw i32 %158, 1
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i32, i32* %157, i64 %160
%162 = load i32, i32* %161
%163 = icmp eq i32 %146, %162
%164 = zext i1 %163 to i64
%165 = select i1 %163, i32 1, i32 0
%166 = sitofp i32 %165 to double
%167 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %166, double 0.000000e+00)
%168 = load double**, double*** %20
%169 = load i32***, i32**** %25
%170 = load i32, i32* %29
%171 = sub nsw i32 %170, 1
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds i32**, i32*** %169, i64 %172
%174 = load i32**, i32*** %173
%175 = load i32, i32* %30
%176 = sub nsw i32 %175, 1
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i32*, i32** %174, i64 %177
%179 = load i32*, i32** %178
%180 = load i32, i32* %31
%181 = sub nsw i32 %180, 1
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds i32, i32* %179, i64 %182
%184 = load i32, i32* %183
%185 = sub nsw i32 %184, 1
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double*, double** %168, i64 %186
%188 = load double*, double** %187
%189 = load i32, i32* %28
%190 = add nsw i32 %189, 1
%191 = sub nsw i32 %190, 1
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds double, double* %188, i64 %192
%194 = load double, double* %193
%195 = fadd double %194, %167
store double %195, double* %193
%196 = load i32***, i32**** %25
%197 = load i32, i32* %29
%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* %30
%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 = load i32, i32* %31
%208 = sub nsw i32 %207, 1
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i32, i32* %206, i64 %209
%211 = load i32, i32* %210
%212 = load i32***, i32**** %25
%213 = load i32, i32* %29
%214 = sub nsw i32 %213, 1
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds i32**, i32*** %212, i64 %215
%217 = load i32**, i32*** %216
%218 = load i32, i32* %30
%219 = sub nsw i32 %218, 1
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i32*, i32** %217, i64 %220
%222 = load i32*, i32** %221
%223 = load i32, i32* %31
%224 = sub nsw i32 %223, 1
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds i32, i32* %222, i64 %225
%227 = load i32, i32* %226
%228 = icmp eq i32 %211, %227
%229 = zext i1 %228 to i64
%230 = select i1 %228, i32 1, i32 0
%231 = sitofp i32 %230 to double
%232 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %231, double 0.000000e+00)
%233 = load double**, double*** %20
%234 = load i32***, i32**** %25
%235 = load i32, i32* %29
%236 = sub nsw i32 %235, 1
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds i32**, i32*** %234, i64 %237
%239 = load i32**, i32*** %238
%240 = load i32, i32* %30
%241 = sub nsw i32 %240, 1
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds i32*, i32** %239, i64 %242
%244 = load i32*, i32** %243
%245 = load i32, i32* %31
%246 = sub nsw i32 %245, 1
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds i32, i32* %244, i64 %247
%249 = load i32, i32* %248
%250 = sub nsw i32 %249, 1
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds double*, double** %233, i64 %251
%253 = load double*, double** %252
%254 = load i32***, i32**** %24
%255 = load i32, i32* %29
%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* %30
%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* %31
%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 = sub nsw i32 %269, 1
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %253, i64 %271
%273 = load double, double* %272
%274 = fadd double %273, %232
store double %274, double* %272
%275 = load i32***, i32**** %24
%276 = load i32, i32* %29
%277 = sub nsw i32 %276, 1
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds i32**, i32*** %275, i64 %278
%280 = load i32**, i32*** %279
%281 = load i32, i32* %30
%282 = sub nsw i32 %281, 1
%283 = sext i32 %282 to i64
%284 = getelementptr inbounds i32*, i32** %280, i64 %283
%285 = load i32*, i32** %284
%286 = load i32, i32* %31
%287 = sub nsw i32 %286, 1
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds i32, i32* %285, i64 %288
%290 = load i32, i32* %289
%291 = load double**, double*** %20
%292 = load double*, double** %35
%293 = load i32, i32* %28
%294 = load i32, i32* %27
%295 = load double, double* %18
%296 = load double, double* %19
%297 = load i32**, i32*** %26
%298 = load i32, i32* %29
%299 = sub nsw i32 %298, 1
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds i32*, i32** %297, i64 %300
%302 = load i32*, i32** %301
%303 = call i32 @sample_Mult_labeled(i32 %290, double** %291, double* %292, i32 %293, i32 %294, double %295, double %296, i32* %302)
%304 = load i32***, i32**** %25
%305 = load i32, i32* %29
%306 = sub nsw i32 %305, 1
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds i32**, i32*** %304, i64 %307
%309 = load i32**, i32*** %308
%310 = load i32, i32* %30
%311 = sub nsw i32 %310, 1
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds i32*, i32** %309, i64 %312
%314 = load i32*, i32** %313
%315 = load i32, i32* %31
%316 = sub nsw i32 %315, 1
%317 = sext i32 %316 to i64
%318 = getelementptr inbounds i32, i32* %314, i64 %317
store i32 %303, i32* %318
%319 = load i32***, i32**** %25
%320 = load i32, i32* %29
%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* %30
%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* %31
%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 = load i32***, i32**** %25
%336 = load i32, i32* %29
%337 = sub nsw i32 %336, 1
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds i32**, i32*** %335, i64 %338
%340 = load i32**, i32*** %339
%341 = load i32, i32* %30
%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* %31
%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 = icmp eq i32 %334, %350
%352 = zext i1 %351 to i64
%353 = select i1 %351, i32 1, i32 0
%354 = sitofp i32 %353 to double
%355 = load double**, double*** %20
%356 = load i32***, i32**** %25
%357 = load i32, i32* %29
%358 = sub nsw i32 %357, 1
%359 = sext i32 %358 to i64
%360 = getelementptr inbounds i32**, i32*** %356, i64 %359
%361 = load i32**, i32*** %360
%362 = load i32, i32* %30
%363 = sub nsw i32 %362, 1
%364 = sext i32 %363 to i64
%365 = getelementptr inbounds i32*, i32** %361, i64 %364
%366 = load i32*, i32** %365
%367 = load i32, i32* %31
%368 = sub nsw i32 %367, 1
%369 = sext i32 %368 to i64
%370 = getelementptr inbounds i32, i32* %366, i64 %369
%371 = load i32, i32* %370
%372 = sub nsw i32 %371, 1
%373 = sext i32 %372 to i64
%374 = getelementptr inbounds double*, double** %355, i64 %373
%375 = load double*, double** %374
%376 = load i32, i32* %28
%377 = add nsw i32 %376, 1
%378 = sub nsw i32 %377, 1
%379 = sext i32 %378 to i64
%380 = getelementptr inbounds double, double* %375, i64 %379
%381 = load double, double* %380
%382 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %354, double %381)
store double %382, double* %380
%383 = load i32***, i32**** %25
%384 = load i32, i32* %29
%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* %30
%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* %31
%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 = load i32***, i32**** %25
%400 = load i32, i32* %29
%401 = sub nsw i32 %400, 1
%402 = sext i32 %401 to i64
%403 = getelementptr inbounds i32**, i32*** %399, i64 %402
%404 = load i32**, i32*** %403
%405 = load i32, i32* %30
%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* %31
%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 = icmp eq i32 %398, %414
%416 = zext i1 %415 to i64
%417 = select i1 %415, i32 1, i32 0
%418 = sitofp i32 %417 to double
%419 = load double**, double*** %20
%420 = load i32***, i32**** %25
%421 = load i32, i32* %29
%422 = sub nsw i32 %421, 1
%423 = sext i32 %422 to i64
%424 = getelementptr inbounds i32**, i32*** %420, i64 %423
%425 = load i32**, i32*** %424
%426 = load i32, i32* %30
%427 = sub nsw i32 %426, 1
%428 = sext i32 %427 to i64
%429 = getelementptr inbounds i32*, i32** %425, i64 %428
%430 = load i32*, i32** %429
%431 = load i32, i32* %31
%432 = sub nsw i32 %431, 1
%433 = sext i32 %432 to i64
%434 = getelementptr inbounds i32, i32* %430, i64 %433
%435 = load i32, i32* %434
%436 = sub nsw i32 %435, 1
%437 = sext i32 %436 to i64
%438 = getelementptr inbounds double*, double** %419, i64 %437
%439 = load double*, double** %438
%440 = load i32***, i32**** %24
%441 = load i32, i32* %29
%442 = sub nsw i32 %441, 1
%443 = sext i32 %442 to i64
%444 = getelementptr inbounds i32**, i32*** %440, i64 %443
%445 = load i32**, i32*** %444
%446 = load i32, i32* %30
%447 = sub nsw i32 %446, 1
%448 = sext i32 %447 to i64
%449 = getelementptr inbounds i32*, i32** %445, i64 %448
%450 = load i32*, i32** %449
%451 = load i32, i32* %31
%452 = sub nsw i32 %451, 1
%453 = sext i32 %452 to i64
%454 = getelementptr inbounds i32, i32* %450, i64 %453
%455 = load i32, i32* %454
%456 = sub nsw i32 %455, 1
%457 = sext i32 %456 to i64
%458 = getelementptr inbounds double, double* %439, i64 %457
%459 = load double, double* %458
%460 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %418, double %459)
store double %460, double* %458
%461 = load double*, double** %35
%462 = load i32, i32* %27
%463 = add nsw i32 %462, 1
%464 = sub nsw i32 %463, 1
%465 = sext i32 %464 to i64
%466 = getelementptr inbounds double, double* %461, i64 %465
%467 = load double, double* %466
%468 = fadd double %467, 1.000000e+00
store double %468, double* %466
%469 = load double*, double** %35
%470 = load i32***, i32**** %25
%471 = load i32, i32* %29
%472 = sub nsw i32 %471, 1
%473 = sext i32 %472 to i64
%474 = getelementptr inbounds i32**, i32*** %470, i64 %473
%475 = load i32**, i32*** %474
%476 = load i32, i32* %30
%477 = sub nsw i32 %476, 1
%478 = sext i32 %477 to i64
%479 = getelementptr inbounds i32*, i32** %475, i64 %478
%480 = load i32*, i32** %479
%481 = load i32, i32* %31
%482 = sub nsw i32 %481, 1
%483 = sext i32 %482 to i64
%484 = getelementptr inbounds i32, i32* %480, i64 %483
%485 = load i32, i32* %484
%486 = sub nsw i32 %485, 1
%487 = sext i32 %486 to i64
%488 = getelementptr inbounds double, double* %469, i64 %487
%489 = load double, double* %488
%490 = fadd double %489, 1.000000e+00
store double %490, double* %488
br label %491
491: ; preds = %100
%492 = load i32, i32* %31
%493 = add nsw i32 %492, 1
store i32 %493, i32* %31
br label %86
494: ; preds = %86
br label %495
495: ; preds = %494
%496 = load i32, i32* %30
%497 = add nsw i32 %496, 1
store i32 %497, i32* %30
br label %76
498: ; preds = %76
br label %499
499: ; preds = %498
%500 = load i32, i32* %29
%501 = add nsw i32 %500, 1
store i32 %501, i32* %29
br label %45
502: ; preds = %45
%503 = load double*, double** %32
%504 = call i32 @free(double* %503)
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, double** nocapture %7, i32* nocapture %8, i32*** nocapture %9, i32*** nocapture %10, i32** nocapture %11, i32 %12, i32 %13) {
%15 = shl i32 %12, 3
%16 = add i32 %15, 8
%17 = tail call i64 @malloc(i32 %16)
%18 = icmp slt i32 %0, 1
br i1 %18, label %131, label %19
19: ; preds = %14
%20 = sext i32 %12 to i64
%21 = sext i32 %13 to i64
%22 = add nuw i32 %0, 1
%23 = zext i32 %22 to i64
br label %24
24: ; preds = %19, %128
%25 = phi i64 [ 1, %19 ], [ %129, %128 ]
%26 = add nsw i64 %25, -1
%27 = getelementptr inbounds i32, i32* %8, i64 %26
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, -1
%30 = getelementptr inbounds double*, double** %6, i64 %26
%31 = sext i32 %28 to i64
%32 = getelementptr inbounds double*, double** %7, i64 %31
%33 = select i1 %29, double** %30, double** %32
%34 = load double*, double** %33
%35 = getelementptr inbounds i32, i32* %2, i64 %26
%36 = load i32, i32* %35
%37 = icmp slt i32 %36, 1
br i1 %37, label %128, label %38
38: ; preds = %24
%39 = getelementptr inbounds i32*, i32** %1, i64 %26
%40 = getelementptr inbounds double, double* %34, i64 %20
%41 = getelementptr inbounds i32**, i32*** %10, i64 %26
%42 = getelementptr inbounds i32**, i32*** %9, i64 %26
%43 = getelementptr inbounds i32*, i32** %11, i64 %26
%44 = load i32*, i32** %39
br label %45
45: ; preds = %38, %122
%46 = phi i32 [ %36, %38 ], [ %123, %122 ]
%47 = phi i32* [ %44, %38 ], [ %124, %122 ]
%48 = phi i64 [ 1, %38 ], [ %125, %122 ]
%49 = add nsw i64 %48, -1
%50 = getelementptr inbounds i32, i32* %47, i64 %49
%51 = load i32, i32* %50
%52 = icmp slt i32 %51, 1
br i1 %52, label %122, label %53
53: ; preds = %45
%54 = load i32**, i32*** %41
%55 = getelementptr inbounds i32*, i32** %54, i64 %49
%56 = load i32*, i32** %55
%57 = load i32**, i32*** %42
%58 = getelementptr inbounds i32*, i32** %57, i64 %49
%59 = load i32*, i32** %58
br label %60
60: ; preds = %53, %60
%61 = phi i32* [ %59, %53 ], [ %101, %60 ]
%62 = phi i32* [ %56, %53 ], [ %90, %60 ]
%63 = phi i64 [ 1, %53 ], [ %114, %60 ]
%64 = load double, double* %40
%65 = fadd double %64, -1.000000e+00
store double %65, double* %40
%66 = add nsw i64 %63, -1
%67 = getelementptr inbounds i32, i32* %62, i64 %66
%68 = load i32, i32* %67
%69 = add nsw i32 %68, -1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %34, i64 %70
%72 = load double, double* %71
%73 = fadd double %72, -1.000000e+00
store double %73, double* %71
%74 = getelementptr inbounds double*, double** %5, i64 %70
%75 = load double*, double** %74
%76 = getelementptr inbounds double, double* %75, i64 %21
%77 = load double, double* %76
%78 = fadd double %77, -1.000000e+00
store double %78, double* %76
%79 = getelementptr inbounds i32, i32* %61, i64 %66
%80 = load i32, i32* %79
%81 = add nsw i32 %80, -1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %75, i64 %82
%84 = load double, double* %83
%85 = fadd double %84, -1.000000e+00
store double %85, double* %83
%86 = load i32*, i32** %43
%87 = tail call i32 @sample_Mult_labeled(i32 %80, double** %5, double* %34, i32 %13, i32 %12, double %3, double %4, i32* %86)
%88 = load i32**, i32*** %41
%89 = getelementptr inbounds i32*, i32** %88, i64 %49
%90 = load i32*, i32** %89
%91 = getelementptr inbounds i32, i32* %90, i64 %66
store i32 %87, i32* %91
%92 = add nsw i32 %87, -1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double*, double** %5, i64 %93
%95 = load double*, double** %94
%96 = getelementptr inbounds double, double* %95, i64 %21
%97 = load double, double* %96
%98 = fadd double %97, 1.000000e+00
store double %98, double* %96
%99 = load i32**, i32*** %42
%100 = getelementptr inbounds i32*, i32** %99, i64 %49
%101 = load i32*, i32** %100
%102 = getelementptr inbounds i32, i32* %101, i64 %66
%103 = load i32, i32* %102
%104 = add nsw i32 %103, -1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %95, i64 %105
%107 = load double, double* %106
%108 = fadd double %107, 1.000000e+00
store double %108, double* %106
%109 = load double, double* %40
%110 = fadd double %109, 1.000000e+00
store double %110, double* %40
%111 = getelementptr inbounds double, double* %34, i64 %93
%112 = load double, double* %111
%113 = fadd double %112, 1.000000e+00
store double %113, double* %111
%114 = add nuw nsw i64 %63, 1
%115 = load i32*, i32** %39
%116 = getelementptr inbounds i32, i32* %115, i64 %49
%117 = load i32, i32* %116
%118 = sext i32 %117 to i64
%119 = icmp slt i64 %63, %118
br i1 %119, label %60, label %120
120: ; preds = %60
%121 = load i32, i32* %35
br label %122
122: ; preds = %120, %45
%123 = phi i32 [ %121, %120 ], [ %46, %45 ]
%124 = phi i32* [ %115, %120 ], [ %47, %45 ]
%125 = add nuw nsw i64 %48, 1
%126 = sext i32 %123 to i64
%127 = icmp slt i64 %48, %126
br i1 %127, label %45, label %128
128: ; preds = %122, %24
%129 = add nuw nsw i64 %25, 1
%130 = icmp eq i64 %129, %23
br i1 %130, label %131, label %24
131: ; preds = %128, %14
%132 = inttoptr i64 %17 to double*
%133 = tail call i32 @free(double* %132)
ret void
}