#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;

/* Variables and functions */
int /*<<< orphan*/ free(double *);
double ldf_Mult_smooth(int /*<<< orphan*/, double, int, double *, int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ normalizeLog(double *, int, int);
int sample_Mult(double *, int, int);
void resample_s(int D, int **M, int *N, double alpha, double eta, double psi,
                double phi, double **post_beta, double **post_theta,
                double *post_gamma, double *post_pi, int ***w, int ***z,
                int ***s, int **labels, int K, int V) {
  int d_10;
  int n_16;
  int m_22;
  double *post_s;
  int tmp_idx_z_3;
  int dvv_loop_var_1;
  post_s = (double *)malloc(sizeof(double) * 3);
  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++) {
        if (s[d_10 - 1][n_16 - 1][m_22 - 1] == 1) {
          post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1][(V) + (1) - 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;
        } else {
          post_gamma[(V) + (1) - 1] -= 1.0;
          post_gamma[w[d_10 - 1][n_16 - 1][m_22 - 1] - 1] -= 1.0;
        }
        post_pi[s[d_10 - 1][n_16 - 1][m_22 - 1] - 1] -= 1;
        post_pi[2] -= 1;
        post_s[0] = (ldf_Mult_smooth(
                        0, eta, w[d_10 - 1][n_16 - 1][m_22 - 1],
                        post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1], 1, V)) +
                    (ldf_Mult_smooth(0, phi, 1, post_pi, 1, 2));
        post_s[1] = (ldf_Mult_smooth(0, psi, w[d_10 - 1][n_16 - 1][m_22 - 1],
                                     post_gamma, 1, V)) +
                    (ldf_Mult_smooth(0, phi, 2, post_pi, 1, 2));
        normalizeLog(post_s, 1, 2);
        s[d_10 - 1][n_16 - 1][m_22 - 1] = sample_Mult(post_s, 1, 2);
        if (s[d_10 - 1][n_16 - 1][m_22 - 1] == 1) {
          post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1][(V) + (1) - 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;
        } else {
          post_gamma[(V) + (1) - 1] += 1.0;
          post_gamma[w[d_10 - 1][n_16 - 1][m_22 - 1] - 1] += 1.0;
        }
        post_pi[s[d_10 - 1][n_16 - 1][m_22 - 1] - 1] += 1;
        post_pi[2] += 1;
      }
    }
  }
  free(post_s);
}


x86 assembly (clang, -O0):
<resample_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
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    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    %r9,-0x50(%rbp)
mov    $0x18,%edi
call   1060 <malloc@plt>
mov    %rax,-0x68(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1768 <resample_s+0x618>
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     1755 <resample_s+0x605>
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jg     1742 <resample_s+0x5f2>
mov    0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    131c <resample_s+0x1cc>
mov    -0x40(%rbp),%rax
mov    0x20(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%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),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd70(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    0x20(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%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    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xcf2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    138c <resample_s+0x23c>
mov    -0x50(%rbp),%rax
mov    0x40(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xcc7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
mov    0x18(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc7d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    0x28(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc33(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xc19(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x28(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x40(%rbp),%rax
mov    0x20(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    0x40(%rbp),%r8d
xor    %edi,%edi
mov    $0x1,%ecx
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    0x10(%rbp),%rdx
xor    %edi,%edi
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    %ecx,%esi
call   1070 <ldf_Mult_smooth@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x50(%rbp),%rdx
mov    0x40(%rbp),%r8d
xor    %edi,%edi
mov    $0x1,%ecx
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    0x10(%rbp),%rdx
xor    %edi,%edi
mov    $0x2,%r8d
mov    $0x1,%ecx
mov    %r8d,%esi
call   1070 <ldf_Mult_smooth@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x68(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x68(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <normalizeLog@plt>
mov    -0x68(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1050 <sample_Mult@plt>
mov    %eax,%edx
mov    0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    0x28(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1670 <resample_s+0x520>
mov    -0x40(%rbp),%rax
mov    0x20(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%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),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xa19(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    0x20(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%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    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x99f(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    16d8 <resample_s+0x588>
mov    -0x50(%rbp),%rax
mov    0x40(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x978(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
mov    0x18(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x932(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    0x28(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x8ec(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movsd  0x8d6(%rip),%xmm0
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11e8 <resample_s+0x98>
jmp    1747 <resample_s+0x5f7>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11c8 <resample_s+0x78>
jmp    175a <resample_s+0x60a>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11b5 <resample_s+0x65>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resample_s>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9,%r12
mov    %rcx,%r14
movsd  %xmm3,0x50(%rsp)
movsd  %xmm2,0x78(%rsp)
movsd  %xmm1,0x70(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,0x38(%rsp)
mov    %edi,%ebx
mov    0xf0(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0xd8(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0xd0(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0xc8(%rsp),%r15
mov    0xc0(%rsp),%r13
mov    $0x18,%edi
call   1060 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %rbx,0x8(%rsp)
test   %ebx,%ebx
jle    151c <resample_s+0x3cc>
movslq 0x4(%rsp),%rax
mov    %rax,0x28(%rsp)
lea    (%r12,%rax,8),%r8
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
movsd  0xe02(%rip),%xmm1
mov    %r14,0x68(%rsp)
mov    %r15,0x48(%rsp)
mov    %r12,0x60(%rsp)
mov    %r8,0x58(%rsp)
jmp    122f <resample_s+0xdf>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rdi
cmp    0x8(%rsp),%rdi
je     151c <resample_s+0x3cc>
mov    0x20(%rsp),%rax
mov    -0x4(%rax,%rdi,4),%ecx
test   %ecx,%ecx
jle    1220 <resample_s+0xd0>
mov    0x38(%rsp),%rax
mov    -0x8(%rax,%rdi,8),%rax
mov    $0x1,%ebp
mov    %rdi,0x80(%rsp)
jmp    1278 <resample_s+0x128>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%rcx
mov    -0x4(%rcx,%rdi,4),%ecx
lea    0x1(%rbp),%rdx
movslq %ecx,%rsi
cmp    %rsi,%rbp
mov    %rdx,%rbp
jge    1220 <resample_s+0xd0>
cmpl   $0x0,-0x4(%rax,%rbp,4)
jle    1269 <resample_s+0x119>
mov    0x40(%rsp),%rax
mov    -0x8(%rax,%rdi,8),%rax
mov    -0x8(%rax,%rbp,8),%rcx
xor    %ebx,%ebx
jmp    131f <resample_s+0x1cf>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rsi),%xmm0
movsd  0xd5c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
mov    0x48(%rsp),%r15
mov    -0x8(%r15,%rdi,8),%rsi
mov    -0x8(%rsi,%rbp,8),%rsi
movslq (%rsi,%rbx,4),%rsi
movsd  -0x8(%rdx,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rdx,%rsi,8)
cltq
movsd  -0x8(%r13,%rax,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%r13,%rax,8)
movsd  0x10(%r13),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%r13)
mov    0x38(%rsp),%rax
mov    -0x8(%rax,%rdi,8),%rax
movslq -0x4(%rax,%rbp,4),%rdx
add    $0x1,%rbx
cmp    %rdx,%rbx
movsd  0xce7(%rip),%xmm1
jge    1260 <resample_s+0x110>
movslq (%rcx,%rbx,4),%rax
cmp    $0x1,%rax
jne    1380 <resample_s+0x230>
mov    0x10(%rsp),%rcx
mov    -0x8(%rcx,%rdi,8),%rcx
mov    -0x8(%rcx,%rbp,8),%rcx
movslq (%rcx,%rbx,4),%rcx
mov    -0x8(%r14,%rcx,8),%rdx
add    $0xffffffffffffffff,%rcx
mov    0x28(%rsp),%rsi
movsd  (%rdx,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
mov    -0x8(%r15,%rdi,8),%rsi
mov    -0x8(%rsi,%rbp,8),%rsi
movslq (%rsi,%rbx,4),%rsi
movsd  -0x8(%rdx,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rdx,%rsi,8)
jmp    13c5 <resample_s+0x275>
nopl   0x0(%rax,%rax,1)
movsd  (%r8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r8)
mov    -0x8(%r15,%rdi,8),%rcx
mov    -0x8(%rcx,%rbp,8),%rcx
movslq (%rcx,%rbx,4),%rsi
movsd  -0x8(%r12,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%r12,%rsi,8)
mov    0x10(%rsp),%rcx
mov    -0x8(%rcx,%rdi,8),%rcx
mov    -0x8(%rcx,%rbp,8),%rcx
movslq (%rcx,%rbx,4),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rdi,%r12
movsd  -0x8(%r13,%rax,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%r13,%rax,8)
movsd  0x10(%r13),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%r13)
mov    (%r14,%rcx,8),%rdx
xor    %edi,%edi
movsd  0x70(%rsp),%xmm0
mov    $0x1,%ecx
mov    0x4(%rsp),%r15d
mov    %r15d,%r8d
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,0x18(%rsp)
xor    %edi,%edi
movsd  0x50(%rsp),%xmm0
mov    $0x1,%esi
mov    %r13,%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1070 <ldf_Mult_smooth@plt>
addsd  0x18(%rsp),%xmm0
mov    0x30(%rsp),%r14
movsd  %xmm0,(%r14)
mov    0x48(%rsp),%rax
mov    -0x8(%rax,%r12,8),%rax
mov    -0x8(%rax,%rbp,8),%rax
mov    (%rax,%rbx,4),%esi
xor    %edi,%edi
movsd  0x78(%rsp),%xmm0
mov    0x60(%rsp),%r12
mov    %r12,%rdx
mov    $0x1,%ecx
mov    %r15d,%r8d
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,0x18(%rsp)
xor    %edi,%edi
movsd  0x50(%rsp),%xmm0
mov    $0x2,%esi
mov    %r13,%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1070 <ldf_Mult_smooth@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%r14)
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <normalizeLog@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1050 <sample_Mult@plt>
mov    0x68(%rsp),%r14
mov    0x40(%rsp),%rcx
mov    0x80(%rsp),%rdi
mov    -0x8(%rcx,%rdi,8),%rcx
mov    -0x8(%rcx,%rbp,8),%rcx
mov    %eax,(%rcx,%rbx,4)
mov    0x58(%rsp),%r8
mov    %r8,%rsi
mov    %r12,%rdx
cmp    $0x1,%eax
jne    12a0 <resample_s+0x150>
mov    0x10(%rsp),%rdx
mov    -0x8(%rdx,%rdi,8),%rdx
mov    -0x8(%rdx,%rbp,8),%rdx
movslq (%rdx,%rbx,4),%rdx
mov    -0x8(%r14,%rdx,8),%rdx
mov    0x28(%rsp),%rsi
lea    (%rdx,%rsi,8),%rsi
jmp    12a0 <resample_s+0x150>
mov    0x30(%rsp),%rdi
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @resample_s(i32 %0, i32** nocapture %1, i32* nocapture %2, double %3, double %4, double %5, double %6, double** nocapture %7, double** nocapture readnone %8, double* %9, double* %10, i32*** nocapture %11, i32*** nocapture %12, i32*** nocapture %13, i32** nocapture readnone %14, i32 %15, i32 %16) {
%18 = tail call i64 @malloc(i32 24)
%19 = inttoptr i64 %18 to double*
%20 = icmp slt i32 %0, 1
br i1 %20, label %182, label %21
21: ; preds = %17
%22 = sext i32 %16 to i64
%23 = getelementptr inbounds double, double* %9, i64 %22
%24 = getelementptr inbounds double, double* %10, i64 2
%25 = getelementptr inbounds double, double* %19, i64 1
%26 = add nuw i32 %0, 1
%27 = zext i32 %26 to i64
br label %28
28: ; preds = %21, %179
%29 = phi i64 [ 1, %21 ], [ %180, %179 ]
%30 = add nsw i64 %29, -1
%31 = getelementptr inbounds i32, i32* %2, i64 %30
%32 = load i32, i32* %31
%33 = icmp slt i32 %32, 1
br i1 %33, label %179, label %34
34: ; preds = %28
%35 = getelementptr inbounds i32*, i32** %1, i64 %30
%36 = getelementptr inbounds i32**, i32*** %13, i64 %30
%37 = getelementptr inbounds i32**, i32*** %11, i64 %30
%38 = getelementptr inbounds i32**, i32*** %12, i64 %30
%39 = load i32*, i32** %35
br label %40
40: ; preds = %34, %173
%41 = phi i32 [ %32, %34 ], [ %174, %173 ]
%42 = phi i32* [ %39, %34 ], [ %175, %173 ]
%43 = phi i64 [ 1, %34 ], [ %176, %173 ]
%44 = add nsw i64 %43, -1
%45 = getelementptr inbounds i32, i32* %42, i64 %44
%46 = load i32, i32* %45
%47 = icmp slt i32 %46, 1
br i1 %47, label %173, label %48
48: ; preds = %40
%49 = load i32**, i32*** %36
%50 = getelementptr inbounds i32*, i32** %49, i64 %44
%51 = load i32*, i32** %50
br label %52
52: ; preds = %48, %143
%53 = phi i32* [ %51, %48 ], [ %129, %143 ]
%54 = phi i64 [ 1, %48 ], [ %165, %143 ]
%55 = add nsw i64 %54, -1
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %82
59: ; preds = %52
%60 = load i32**, i32*** %38
%61 = getelementptr inbounds i32*, i32** %60, i64 %44
%62 = load i32*, i32** %61
%63 = getelementptr inbounds i32, i32* %62, i64 %55
%64 = load i32, i32* %63
%65 = add nsw i32 %64, -1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double*, double** %7, i64 %66
%68 = load double*, double** %67
%69 = getelementptr inbounds double, double* %68, i64 %22
%70 = load double, double* %69
%71 = fadd double %70, -1.000000e+00
store double %71, double* %69
%72 = load i32**, i32*** %37
%73 = getelementptr inbounds i32*, i32** %72, i64 %44
%74 = load i32*, i32** %73
%75 = getelementptr inbounds i32, i32* %74, i64 %55
%76 = load i32, i32* %75
%77 = add nsw i32 %76, -1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %68, i64 %78
%80 = load double, double* %79
%81 = fadd double %80, -1.000000e+00
store double %81, double* %79
br label %102
82: ; preds = %52
%83 = load double, double* %23
%84 = fadd double %83, -1.000000e+00
store double %84, double* %23
%85 = load i32**, i32*** %37
%86 = getelementptr inbounds i32*, i32** %85, i64 %44
%87 = load i32*, i32** %86
%88 = getelementptr inbounds i32, i32* %87, i64 %55
%89 = load i32, i32* %88
%90 = add nsw i32 %89, -1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %9, i64 %91
%93 = load double, double* %92
%94 = fadd double %93, -1.000000e+00
store double %94, double* %92
%95 = load i32**, i32*** %38
%96 = getelementptr inbounds i32*, i32** %95, i64 %44
%97 = load i32*, i32** %96
%98 = getelementptr inbounds i32, i32* %97, i64 %55
%99 = load i32, i32* %98
%100 = add nsw i32 %99, -1
%101 = sext i32 %100 to i64
br label %102
102: ; preds = %82, %59
%103 = phi i64 [ %101, %82 ], [ %66, %59 ]
%104 = phi i32 [ %89, %82 ], [ %76, %59 ]
%105 = add nsw i32 %57, -1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %10, i64 %106
%108 = load double, double* %107
%109 = fadd double %108, -1.000000e+00
store double %109, double* %107
%110 = load double, double* %24
%111 = fadd double %110, -1.000000e+00
store double %111, double* %24
%112 = getelementptr inbounds double*, double** %7, i64 %103
%113 = load double*, double** %112
%114 = tail call double @ldf_Mult_smooth(i32 0, double %4, i32 %104, double* %113, i32 1, i32 %16)
%115 = tail call double @ldf_Mult_smooth(i32 0, double %6, i32 1, double* %10, i32 1, i32 2)
%116 = fadd double %114, %115
store double %116, double* %19
%117 = load i32**, i32*** %37
%118 = getelementptr inbounds i32*, i32** %117, i64 %44
%119 = load i32*, i32** %118
%120 = getelementptr inbounds i32, i32* %119, i64 %55
%121 = load i32, i32* %120
%122 = tail call double @ldf_Mult_smooth(i32 0, double %5, i32 %121, double* %9, i32 1, i32 %16)
%123 = tail call double @ldf_Mult_smooth(i32 0, double %6, i32 2, double* %10, i32 1, i32 2)
%124 = fadd double %122, %123
store double %124, double* %25
%125 = tail call i32 @normalizeLog(double* %19, i32 1, i32 2)
%126 = tail call i32 @sample_Mult(double* %19, i32 1, i32 2)
%127 = load i32**, i32*** %36
%128 = getelementptr inbounds i32*, i32** %127, i64 %44
%129 = load i32*, i32** %128
%130 = getelementptr inbounds i32, i32* %129, i64 %55
store i32 %126, i32* %130
%131 = icmp eq i32 %126, 1
br i1 %131, label %132, label %143
132: ; preds = %102
%133 = load i32**, i32*** %38
%134 = getelementptr inbounds i32*, i32** %133, i64 %44
%135 = load i32*, i32** %134
%136 = getelementptr inbounds i32, i32* %135, i64 %55
%137 = load i32, i32* %136
%138 = add nsw i32 %137, -1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double*, double** %7, i64 %139
%141 = load double*, double** %140
%142 = getelementptr inbounds double, double* %141, i64 %22
br label %143
143: ; preds = %102, %132
%144 = phi double* [ %142, %132 ], [ %23, %102 ]
%145 = phi double* [ %141, %132 ], [ %9, %102 ]
%146 = load double, double* %144
%147 = fadd double %146, 1.000000e+00
store double %147, double* %144
%148 = load i32**, i32*** %37
%149 = getelementptr inbounds i32*, i32** %148, i64 %44
%150 = load i32*, i32** %149
%151 = getelementptr inbounds i32, i32* %150, i64 %55
%152 = load i32, i32* %151
%153 = add nsw i32 %152, -1
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %145, i64 %154
%156 = load double, double* %155
%157 = fadd double %156, 1.000000e+00
store double %157, double* %155
%158 = add nsw i32 %126, -1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %10, i64 %159
%161 = load double, double* %160
%162 = fadd double %161, 1.000000e+00
store double %162, double* %160
%163 = load double, double* %24
%164 = fadd double %163, 1.000000e+00
store double %164, double* %24
%165 = add nuw nsw i64 %54, 1
%166 = load i32*, i32** %35
%167 = getelementptr inbounds i32, i32* %166, i64 %44
%168 = load i32, i32* %167
%169 = sext i32 %168 to i64
%170 = icmp slt i64 %54, %169
br i1 %170, label %52, label %171
171: ; preds = %143
%172 = load i32, i32* %31
br label %173
173: ; preds = %171, %40
%174 = phi i32 [ %172, %171 ], [ %41, %40 ]
%175 = phi i32* [ %166, %171 ], [ %42, %40 ]
%176 = add nuw nsw i64 %43, 1
%177 = sext i32 %174 to i64
%178 = icmp slt i64 %43, %177
br i1 %178, label %40, label %179
179: ; preds = %173, %28
%180 = add nuw nsw i64 %29, 1
%181 = icmp eq i64 %180, %27
br i1 %181, label %182, label %28
182: ; preds = %179, %17
%183 = tail call i32 @free(double* %19)
ret void
}