#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_theta_train, int *entity_map, 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;
  double *theta_counts;
  post_s = (double *)malloc(sizeof(double) * 3);
  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++) {
        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    $0x90,%rsp
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %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     17c4 <resample_s+0x674>
mov    0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    11fa <resample_s+0xaa>
mov    -0x48(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x78(%rbp)
jmp    1217 <resample_s+0xc7>
mov    -0x50(%rbp),%rax
mov    0x10(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x78(%rbp)
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     17b1 <resample_s+0x661>
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     179e <resample_s+0x64e>
mov    0x38(%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    1372 <resample_s+0x222>
mov    -0x40(%rbp),%rax
mov    0x30(%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    0x50(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd1a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    0x30(%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    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  0xc9c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    13e2 <resample_s+0x292>
mov    0x18(%rbp),%rax
mov    0x50(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc71(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%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  0xc27(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
mov    0x38(%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  0xbdd(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xbc3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  -0x28(%rbp),%xmm0
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    (%rax,%rcx,4),%esi
mov    -0x40(%rbp),%rax
mov    0x30(%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    0x50(%rbp),%r8d
xor    %edi,%edi
mov    $0x1,%ecx
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    0x20(%rbp),%rdx
xor    %edi,%edi
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    %ecx,%esi
call   1070 <ldf_Mult_smooth@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
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    (%rax,%rcx,4),%esi
mov    0x18(%rbp),%rdx
mov    0x50(%rbp),%r8d
xor    %edi,%edi
mov    $0x1,%ecx
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    0x20(%rbp),%rdx
xor    %edi,%edi
mov    $0x2,%r8d
mov    $0x1,%ecx
mov    %r8d,%esi
call   1070 <ldf_Mult_smooth@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%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    0x38(%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    0x38(%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    16cc <resample_s+0x57c>
mov    -0x40(%rbp),%rax
mov    0x30(%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    0x50(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x9bd(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    0x30(%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    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  0x943(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1734 <resample_s+0x5e4>
mov    0x18(%rbp),%rax
mov    0x50(%rbp),%ecx
add    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0x91c(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%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  0x8d6(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
mov    0x38(%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  0x890(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
movsd  0x87a(%rip),%xmm0
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    123e <resample_s+0xee>
jmp    17a3 <resample_s+0x653>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    121e <resample_s+0xce>
jmp    17b6 <resample_s+0x666>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11bd <resample_s+0x6d>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
add    $0x90,%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    %rcx,%r14
movsd  %xmm3,0x50(%rsp)
movsd  %xmm2,0x78(%rsp)
movsd  %xmm1,0x70(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,0x38(%rsp)
mov    %edi,%r15d
mov    0x100(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0xe8(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0xe0(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0xd8(%rsp),%r13
mov    0xd0(%rsp),%rbp
mov    0xc8(%rsp),%r12
mov    $0x18,%edi
call   1060 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r15,0x8(%rsp)
test   %r15d,%r15d
jle    151b <resample_s+0x3cb>
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  0xdfb(%rip),%xmm1
mov    %r14,0x68(%rsp)
mov    %r13,0x48(%rsp)
mov    %r12,0x60(%rsp)
mov    %r8,0x58(%rsp)
jmp    122f <resample_s+0xdf>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdi
cmp    0x8(%rsp),%rdi
je     151b <resample_s+0x3cb>
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,%ebx
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(%rbx),%rdx
movslq %ecx,%rsi
cmp    %rsi,%rbx
mov    %rdx,%rbx
jge    1220 <resample_s+0xd0>
cmpl   $0x0,-0x4(%rax,%rbx,4)
jle    1269 <resample_s+0x119>
mov    0x40(%rsp),%rax
mov    -0x8(%rax,%rdi,8),%rax
mov    -0x8(%rax,%rbx,8),%rcx
xor    %r15d,%r15d
jmp    131b <resample_s+0x1cb>
cs nopw 0x0(%rax,%rax,1)
movsd  (%rsi),%xmm0
movsd  0xd5c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
mov    0x48(%rsp),%r13
mov    -0x8(%r13,%rdi,8),%rsi
mov    -0x8(%rsi,%rbx,8),%rsi
movslq (%rsi,%r15,4),%rsi
movsd  -0x8(%rdx,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rdx,%rsi,8)
cltq
movsd  -0x8(%rbp,%rax,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp,%rax,8)
movsd  0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rbp)
mov    0x38(%rsp),%rax
mov    -0x8(%rax,%rdi,8),%rax
movslq -0x4(%rax,%rbx,4),%rdx
add    $0x1,%r15
cmp    %rdx,%r15
movsd  0xceb(%rip),%xmm1
jge    1260 <resample_s+0x110>
movslq (%rcx,%r15,4),%rax
cmp    $0x1,%rax
jne    1380 <resample_s+0x230>
mov    0x10(%rsp),%rcx
mov    -0x8(%rcx,%rdi,8),%rcx
mov    -0x8(%rcx,%rbx,8),%rcx
movslq (%rcx,%r15,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(%r13,%rdi,8),%rsi
mov    -0x8(%rsi,%rbx,8),%rsi
movslq (%rsi,%r15,4),%rsi
movsd  -0x8(%rdx,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rdx,%rsi,8)
jmp    13c5 <resample_s+0x275>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r8)
mov    -0x8(%r13,%rdi,8),%rcx
mov    -0x8(%rcx,%rbx,8),%rcx
movslq (%rcx,%r15,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,%rbx,8),%rcx
movslq (%rcx,%r15,4),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rdi,%r12
movsd  -0x8(%rbp,%rax,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp,%rax,8)
movsd  0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rbp)
mov    (%r14,%rcx,8),%rdx
xor    %edi,%edi
movsd  0x70(%rsp),%xmm0
mov    $0x1,%ecx
mov    0x4(%rsp),%r14d
mov    %r14d,%r8d
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,0x18(%rsp)
xor    %edi,%edi
movsd  0x50(%rsp),%xmm0
mov    $0x1,%esi
mov    %rbp,%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1070 <ldf_Mult_smooth@plt>
addsd  0x18(%rsp),%xmm0
mov    0x30(%rsp),%r13
movsd  %xmm0,0x0(%r13)
mov    0x48(%rsp),%rax
mov    -0x8(%rax,%r12,8),%rax
mov    -0x8(%rax,%rbx,8),%rax
mov    (%rax,%r15,4),%esi
xor    %edi,%edi
movsd  0x78(%rsp),%xmm0
mov    0x60(%rsp),%r12
mov    %r12,%rdx
mov    $0x1,%ecx
mov    %r14d,%r8d
call   1070 <ldf_Mult_smooth@plt>
movsd  %xmm0,0x18(%rsp)
xor    %edi,%edi
movsd  0x50(%rsp),%xmm0
mov    $0x2,%esi
mov    %rbp,%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1070 <ldf_Mult_smooth@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%r13)
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <normalizeLog@plt>
mov    %r13,%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,%rbx,8),%rcx
mov    %eax,(%rcx,%r15,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,%rbx,8),%rdx
movslq (%rdx,%r15,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, i32* %10, double* %11, double* %12, i32*** %13, i32*** %14, i32*** %15, i32** %16, i32 %17, i32 %18) {
%20 = alloca i32
%21 = alloca i32**
%22 = alloca i32*
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double**
%28 = alloca double**
%29 = alloca double**
%30 = alloca i32*
%31 = alloca double*
%32 = alloca double*
%33 = alloca i32***
%34 = alloca i32***
%35 = alloca i32***
%36 = alloca i32**
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
%41 = alloca i32
%42 = alloca double*
%43 = alloca i32
%44 = alloca i32
%45 = alloca double*
store i32 %0, i32* %20
store i32** %1, i32*** %21
store i32* %2, i32** %22
store double %3, double* %23
store double %4, double* %24
store double %5, double* %25
store double %6, double* %26
store double** %7, double*** %27
store double** %8, double*** %28
store double** %9, double*** %29
store i32* %10, i32** %30
store double* %11, double** %31
store double* %12, double** %32
store i32*** %13, i32**** %33
store i32*** %14, i32**** %34
store i32*** %15, i32**** %35
store i32** %16, i32*** %36
store i32 %17, i32* %37
store i32 %18, i32* %38
%46 = call i64 @malloc(i32 24)
%47 = inttoptr i64 %46 to double*
store double* %47, double** %42
store i32 1, i32* %39
br label %48
48: ; preds = %495, %19
%49 = load i32, i32* %39
%50 = load i32, i32* %20
%51 = icmp sle i32 %49, %50
br i1 %51, label %52, label %498
52: ; preds = %48
%53 = load i32*, i32** %30
%54 = load i32, i32* %39
%55 = sub nsw i32 %54, 1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %53, i64 %56
%58 = load i32, i32* %57
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %67
60: ; preds = %52
%61 = load double**, double*** %28
%62 = load i32, i32* %39
%63 = sub nsw i32 %62, 1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double*, double** %61, i64 %64
%66 = load double*, double** %65
store double* %66, double** %45
br label %78
67: ; preds = %52
%68 = load double**, double*** %29
%69 = load i32*, i32** %30
%70 = load i32, i32* %39
%71 = sub nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %69, i64 %72
%74 = load i32, i32* %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double*, double** %68, i64 %75
%77 = load double*, double** %76
store double* %77, double** %45
br label %78
78: ; preds = %67, %60
store i32 1, i32* %40
br label %79
79: ; preds = %491, %78
%80 = load i32, i32* %40
%81 = load i32*, i32** %22
%82 = load i32, i32* %39
%83 = sub nsw i32 %82, 1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %81, i64 %84
%86 = load i32, i32* %85
%87 = icmp sle i32 %80, %86
br i1 %87, label %88, label %494
88: ; preds = %79
store i32 1, i32* %41
br label %89
89: ; preds = %487, %88
%90 = load i32, i32* %41
%91 = load i32**, i32*** %21
%92 = load i32, i32* %39
%93 = sub nsw i32 %92, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32*, i32** %91, i64 %94
%96 = load i32*, i32** %95
%97 = load i32, i32* %40
%98 = sub nsw i32 %97, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %96, i64 %99
%101 = load i32, i32* %100
%102 = icmp sle i32 %90, %101
br i1 %102, label %103, label %490
103: ; preds = %89
%104 = load i32***, i32**** %35
%105 = load i32, i32* %39
%106 = sub nsw i32 %105, 1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32**, i32*** %104, i64 %107
%109 = load i32**, i32*** %108
%110 = load i32, i32* %40
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i32*, i32** %109, i64 %112
%114 = load i32*, i32** %113
%115 = load i32, i32* %41
%116 = sub nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i32, i32* %114, i64 %117
%119 = load i32, i32* %118
%120 = icmp eq i32 %119, 1
br i1 %120, label %121, label %192
121: ; preds = %103
%122 = load double**, double*** %27
%123 = load i32***, i32**** %34
%124 = load i32, i32* %39
%125 = sub nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i32**, i32*** %123, i64 %126
%128 = load i32**, i32*** %127
%129 = load i32, i32* %40
%130 = sub nsw i32 %129, 1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i32*, i32** %128, i64 %131
%133 = load i32*, i32** %132
%134 = load i32, i32* %41
%135 = sub nsw i32 %134, 1
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i32, i32* %133, i64 %136
%138 = load i32, i32* %137
%139 = sub nsw i32 %138, 1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double*, double** %122, i64 %140
%142 = load double*, double** %141
%143 = load i32, i32* %38
%144 = add nsw i32 %143, 1
%145 = sub nsw i32 %144, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %142, i64 %146
%148 = load double, double* %147
%149 = fsub double %148, 1.000000e+00
store double %149, double* %147
%150 = load double**, double*** %27
%151 = load i32***, i32**** %34
%152 = load i32, i32* %39
%153 = sub nsw i32 %152, 1
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i32**, i32*** %151, i64 %154
%156 = load i32**, i32*** %155
%157 = load i32, i32* %40
%158 = sub nsw i32 %157, 1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i32*, i32** %156, i64 %159
%161 = load i32*, i32** %160
%162 = load i32, i32* %41
%163 = sub nsw i32 %162, 1
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i32, i32* %161, i64 %164
%166 = load i32, i32* %165
%167 = sub nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double*, double** %150, i64 %168
%170 = load double*, double** %169
%171 = load i32***, i32**** %33
%172 = load i32, i32* %39
%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* %40
%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* %41
%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 %223
192: ; preds = %103
%193 = load double*, double** %31
%194 = load i32, i32* %38
%195 = add nsw i32 %194, 1
%196 = sub nsw i32 %195, 1
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double, double* %193, i64 %197
%199 = load double, double* %198
%200 = fsub double %199, 1.000000e+00
store double %200, double* %198
%201 = load double*, double** %31
%202 = load i32***, i32**** %33
%203 = load i32, i32* %39
%204 = sub nsw i32 %203, 1
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds i32**, i32*** %202, i64 %205
%207 = load i32**, i32*** %206
%208 = load i32, i32* %40
%209 = sub nsw i32 %208, 1
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i32*, i32** %207, i64 %210
%212 = load i32*, i32** %211
%213 = load i32, i32* %41
%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 = sub nsw i32 %217, 1
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds double, double* %201, i64 %219
%221 = load double, double* %220
%222 = fsub double %221, 1.000000e+00
store double %222, double* %220
br label %223
223: ; preds = %192, %121
%224 = load double*, double** %32
%225 = load i32***, i32**** %35
%226 = load i32, i32* %39
%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* %40
%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 i32, i32* %41
%237 = sub nsw i32 %236, 1
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds i32, i32* %235, i64 %238
%240 = load i32, i32* %239
%241 = sub nsw i32 %240, 1
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %224, i64 %242
%244 = load double, double* %243
%245 = fsub double %244, 1.000000e+00
store double %245, double* %243
%246 = load double*, double** %32
%247 = getelementptr inbounds double, double* %246, i64 2
%248 = load double, double* %247
%249 = fsub double %248, 1.000000e+00
store double %249, double* %247
%250 = load double, double* %24
%251 = load i32***, i32**** %33
%252 = load i32, i32* %39
%253 = sub nsw i32 %252, 1
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds i32**, i32*** %251, i64 %254
%256 = load i32**, i32*** %255
%257 = load i32, i32* %40
%258 = sub nsw i32 %257, 1
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds i32*, i32** %256, i64 %259
%261 = load i32*, i32** %260
%262 = load i32, i32* %41
%263 = sub nsw i32 %262, 1
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds i32, i32* %261, i64 %264
%266 = load i32, i32* %265
%267 = load double**, double*** %27
%268 = load i32***, i32**** %34
%269 = load i32, i32* %39
%270 = sub nsw i32 %269, 1
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds i32**, i32*** %268, i64 %271
%273 = load i32**, i32*** %272
%274 = load i32, i32* %40
%275 = sub nsw i32 %274, 1
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds i32*, i32** %273, i64 %276
%278 = load i32*, i32** %277
%279 = load i32, i32* %41
%280 = sub nsw i32 %279, 1
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds i32, i32* %278, i64 %281
%283 = load i32, i32* %282
%284 = sub nsw i32 %283, 1
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds double*, double** %267, i64 %285
%287 = load double*, double** %286
%288 = load i32, i32* %38
%289 = call double @ldf_Mult_smooth(i32 0, double %250, i32 %266, double* %287, i32 1, i32 %288)
%290 = load double, double* %26
%291 = load double*, double** %32
%292 = call double @ldf_Mult_smooth(i32 0, double %290, i32 1, double* %291, i32 1, i32 2)
%293 = fadd double %289, %292
%294 = load double*, double** %42
%295 = getelementptr inbounds double, double* %294, i64 0
store double %293, double* %295
%296 = load double, double* %25
%297 = load i32***, i32**** %33
%298 = load i32, i32* %39
%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 = load i32, i32* %40
%304 = sub nsw i32 %303, 1
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds i32*, i32** %302, i64 %305
%307 = load i32*, i32** %306
%308 = load i32, i32* %41
%309 = sub nsw i32 %308, 1
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds i32, i32* %307, i64 %310
%312 = load i32, i32* %311
%313 = load double*, double** %31
%314 = load i32, i32* %38
%315 = call double @ldf_Mult_smooth(i32 0, double %296, i32 %312, double* %313, i32 1, i32 %314)
%316 = load double, double* %26
%317 = load double*, double** %32
%318 = call double @ldf_Mult_smooth(i32 0, double %316, i32 2, double* %317, i32 1, i32 2)
%319 = fadd double %315, %318
%320 = load double*, double** %42
%321 = getelementptr inbounds double, double* %320, i64 1
store double %319, double* %321
%322 = load double*, double** %42
%323 = call i32 @normalizeLog(double* %322, i32 1, i32 2)
%324 = load double*, double** %42
%325 = call i32 @sample_Mult(double* %324, i32 1, i32 2)
%326 = load i32***, i32**** %35
%327 = load i32, i32* %39
%328 = sub nsw i32 %327, 1
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds i32**, i32*** %326, i64 %329
%331 = load i32**, i32*** %330
%332 = load i32, i32* %40
%333 = sub nsw i32 %332, 1
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds i32*, i32** %331, i64 %334
%336 = load i32*, i32** %335
%337 = load i32, i32* %41
%338 = sub nsw i32 %337, 1
%339 = sext i32 %338 to i64
%340 = getelementptr inbounds i32, i32* %336, i64 %339
store i32 %325, i32* %340
%341 = load i32***, i32**** %35
%342 = load i32, i32* %39
%343 = sub nsw i32 %342, 1
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds i32**, i32*** %341, i64 %344
%346 = load i32**, i32*** %345
%347 = load i32, i32* %40
%348 = sub nsw i32 %347, 1
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds i32*, i32** %346, i64 %349
%351 = load i32*, i32** %350
%352 = load i32, i32* %41
%353 = sub nsw i32 %352, 1
%354 = sext i32 %353 to i64
%355 = getelementptr inbounds i32, i32* %351, i64 %354
%356 = load i32, i32* %355
%357 = icmp eq i32 %356, 1
br i1 %357, label %358, label %429
358: ; preds = %223
%359 = load double**, double*** %27
%360 = load i32***, i32**** %34
%361 = load i32, i32* %39
%362 = sub nsw i32 %361, 1
%363 = sext i32 %362 to i64
%364 = getelementptr inbounds i32**, i32*** %360, i64 %363
%365 = load i32**, i32*** %364
%366 = load i32, i32* %40
%367 = sub nsw i32 %366, 1
%368 = sext i32 %367 to i64
%369 = getelementptr inbounds i32*, i32** %365, i64 %368
%370 = load i32*, i32** %369
%371 = load i32, i32* %41
%372 = sub nsw i32 %371, 1
%373 = sext i32 %372 to i64
%374 = getelementptr inbounds i32, i32* %370, i64 %373
%375 = load i32, i32* %374
%376 = sub nsw i32 %375, 1
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds double*, double** %359, i64 %377
%379 = load double*, double** %378
%380 = load i32, i32* %38
%381 = add nsw i32 %380, 1
%382 = sub nsw i32 %381, 1
%383 = sext i32 %382 to i64
%384 = getelementptr inbounds double, double* %379, i64 %383
%385 = load double, double* %384
%386 = fadd double %385, 1.000000e+00
store double %386, double* %384
%387 = load double**, double*** %27
%388 = load i32***, i32**** %34
%389 = load i32, i32* %39
%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* %40
%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* %41
%400 = sub nsw i32 %399, 1
%401 = sext i32 %400 to i64
%402 = getelementptr inbounds i32, i32* %398, i64 %401
%403 = load i32, i32* %402
%404 = sub nsw i32 %403, 1
%405 = sext i32 %404 to i64
%406 = getelementptr inbounds double*, double** %387, i64 %405
%407 = load double*, double** %406
%408 = load i32***, i32**** %33
%409 = load i32, i32* %39
%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* %40
%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* %41
%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 %460
429: ; preds = %223
%430 = load double*, double** %31
%431 = load i32, i32* %38
%432 = add nsw i32 %431, 1
%433 = sub nsw i32 %432, 1
%434 = sext i32 %433 to i64
%435 = getelementptr inbounds double, double* %430, i64 %434
%436 = load double, double* %435
%437 = fadd double %436, 1.000000e+00
store double %437, double* %435
%438 = load double*, double** %31
%439 = load i32***, i32**** %33
%440 = load i32, i32* %39
%441 = sub nsw i32 %440, 1
%442 = sext i32 %441 to i64
%443 = getelementptr inbounds i32**, i32*** %439, i64 %442
%444 = load i32**, i32*** %443
%445 = load i32, i32* %40
%446 = sub nsw i32 %445, 1
%447 = sext i32 %446 to i64
%448 = getelementptr inbounds i32*, i32** %444, i64 %447
%449 = load i32*, i32** %448
%450 = load i32, i32* %41
%451 = sub nsw i32 %450, 1
%452 = sext i32 %451 to i64
%453 = getelementptr inbounds i32, i32* %449, i64 %452
%454 = load i32, i32* %453
%455 = sub nsw i32 %454, 1
%456 = sext i32 %455 to i64
%457 = getelementptr inbounds double, double* %438, i64 %456
%458 = load double, double* %457
%459 = fadd double %458, 1.000000e+00
store double %459, double* %457
br label %460
460: ; preds = %429, %358
%461 = load double*, double** %32
%462 = load i32***, i32**** %35
%463 = load i32, i32* %39
%464 = sub nsw i32 %463, 1
%465 = sext i32 %464 to i64
%466 = getelementptr inbounds i32**, i32*** %462, i64 %465
%467 = load i32**, i32*** %466
%468 = load i32, i32* %40
%469 = sub nsw i32 %468, 1
%470 = sext i32 %469 to i64
%471 = getelementptr inbounds i32*, i32** %467, i64 %470
%472 = load i32*, i32** %471
%473 = load i32, i32* %41
%474 = sub nsw i32 %473, 1
%475 = sext i32 %474 to i64
%476 = getelementptr inbounds i32, i32* %472, i64 %475
%477 = load i32, i32* %476
%478 = sub nsw i32 %477, 1
%479 = sext i32 %478 to i64
%480 = getelementptr inbounds double, double* %461, i64 %479
%481 = load double, double* %480
%482 = fadd double %481, 1.000000e+00
store double %482, double* %480
%483 = load double*, double** %32
%484 = getelementptr inbounds double, double* %483, i64 2
%485 = load double, double* %484
%486 = fadd double %485, 1.000000e+00
store double %486, double* %484
br label %487
487: ; preds = %460
%488 = load i32, i32* %41
%489 = add nsw i32 %488, 1
store i32 %489, i32* %41
br label %89
490: ; preds = %89
br label %491
491: ; preds = %490
%492 = load i32, i32* %40
%493 = add nsw i32 %492, 1
store i32 %493, i32* %40
br label %79
494: ; preds = %79
br label %495
495: ; preds = %494
%496 = load i32, i32* %39
%497 = add nsw i32 %496, 1
store i32 %497, i32* %39
br label %48
498: ; preds = %48
%499 = load double*, double** %42
%500 = call i32 @free(double* %499)
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** nocapture readnone %9, i32* nocapture readnone %10, double* %11, double* %12, i32*** nocapture %13, i32*** nocapture %14, i32*** nocapture %15, i32** nocapture readnone %16, i32 %17, i32 %18) {
%20 = tail call i64 @malloc(i32 24)
%21 = inttoptr i64 %20 to double*
%22 = icmp slt i32 %0, 1
br i1 %22, label %184, label %23
23: ; preds = %19
%24 = sext i32 %18 to i64
%25 = getelementptr inbounds double, double* %11, i64 %24
%26 = getelementptr inbounds double, double* %12, i64 2
%27 = getelementptr inbounds double, double* %21, i64 1
%28 = add nuw i32 %0, 1
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %23, %181
%31 = phi i64 [ 1, %23 ], [ %182, %181 ]
%32 = add nsw i64 %31, -1
%33 = getelementptr inbounds i32, i32* %2, i64 %32
%34 = load i32, i32* %33
%35 = icmp slt i32 %34, 1
br i1 %35, label %181, label %36
36: ; preds = %30
%37 = getelementptr inbounds i32*, i32** %1, i64 %32
%38 = getelementptr inbounds i32**, i32*** %15, i64 %32
%39 = getelementptr inbounds i32**, i32*** %13, i64 %32
%40 = getelementptr inbounds i32**, i32*** %14, i64 %32
%41 = load i32*, i32** %37
br label %42
42: ; preds = %36, %175
%43 = phi i32 [ %34, %36 ], [ %176, %175 ]
%44 = phi i32* [ %41, %36 ], [ %177, %175 ]
%45 = phi i64 [ 1, %36 ], [ %178, %175 ]
%46 = add nsw i64 %45, -1
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = load i32, i32* %47
%49 = icmp slt i32 %48, 1
br i1 %49, label %175, label %50
50: ; preds = %42
%51 = load i32**, i32*** %38
%52 = getelementptr inbounds i32*, i32** %51, i64 %46
%53 = load i32*, i32** %52
br label %54
54: ; preds = %50, %145
%55 = phi i32* [ %53, %50 ], [ %131, %145 ]
%56 = phi i64 [ 1, %50 ], [ %167, %145 ]
%57 = add nsw i64 %56, -1
%58 = getelementptr inbounds i32, i32* %55, i64 %57
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 1
br i1 %60, label %61, label %84
61: ; preds = %54
%62 = load i32**, i32*** %40
%63 = getelementptr inbounds i32*, i32** %62, i64 %46
%64 = load i32*, i32** %63
%65 = getelementptr inbounds i32, i32* %64, i64 %57
%66 = load i32, i32* %65
%67 = add nsw i32 %66, -1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double*, double** %7, i64 %68
%70 = load double*, double** %69
%71 = getelementptr inbounds double, double* %70, i64 %24
%72 = load double, double* %71
%73 = fadd double %72, -1.000000e+00
store double %73, double* %71
%74 = load i32**, i32*** %39
%75 = getelementptr inbounds i32*, i32** %74, i64 %46
%76 = load i32*, i32** %75
%77 = getelementptr inbounds i32, i32* %76, i64 %57
%78 = load i32, i32* %77
%79 = add nsw i32 %78, -1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %70, i64 %80
%82 = load double, double* %81
%83 = fadd double %82, -1.000000e+00
store double %83, double* %81
br label %104
84: ; preds = %54
%85 = load double, double* %25
%86 = fadd double %85, -1.000000e+00
store double %86, double* %25
%87 = load i32**, i32*** %39
%88 = getelementptr inbounds i32*, i32** %87, i64 %46
%89 = load i32*, i32** %88
%90 = getelementptr inbounds i32, i32* %89, i64 %57
%91 = load i32, i32* %90
%92 = add nsw i32 %91, -1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %11, i64 %93
%95 = load double, double* %94
%96 = fadd double %95, -1.000000e+00
store double %96, double* %94
%97 = load i32**, i32*** %40
%98 = getelementptr inbounds i32*, i32** %97, i64 %46
%99 = load i32*, i32** %98
%100 = getelementptr inbounds i32, i32* %99, i64 %57
%101 = load i32, i32* %100
%102 = add nsw i32 %101, -1
%103 = sext i32 %102 to i64
br label %104
104: ; preds = %84, %61
%105 = phi i64 [ %103, %84 ], [ %68, %61 ]
%106 = phi i32 [ %91, %84 ], [ %78, %61 ]
%107 = add nsw i32 %59, -1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %12, i64 %108
%110 = load double, double* %109
%111 = fadd double %110, -1.000000e+00
store double %111, double* %109
%112 = load double, double* %26
%113 = fadd double %112, -1.000000e+00
store double %113, double* %26
%114 = getelementptr inbounds double*, double** %7, i64 %105
%115 = load double*, double** %114
%116 = tail call double @ldf_Mult_smooth(i32 0, double %4, i32 %106, double* %115, i32 1, i32 %18)
%117 = tail call double @ldf_Mult_smooth(i32 0, double %6, i32 1, double* %12, i32 1, i32 2)
%118 = fadd double %116, %117
store double %118, double* %21
%119 = load i32**, i32*** %39
%120 = getelementptr inbounds i32*, i32** %119, i64 %46
%121 = load i32*, i32** %120
%122 = getelementptr inbounds i32, i32* %121, i64 %57
%123 = load i32, i32* %122
%124 = tail call double @ldf_Mult_smooth(i32 0, double %5, i32 %123, double* %11, i32 1, i32 %18)
%125 = tail call double @ldf_Mult_smooth(i32 0, double %6, i32 2, double* %12, i32 1, i32 2)
%126 = fadd double %124, %125
store double %126, double* %27
%127 = tail call i32 @normalizeLog(double* %21, i32 1, i32 2)
%128 = tail call i32 @sample_Mult(double* %21, i32 1, i32 2)
%129 = load i32**, i32*** %38
%130 = getelementptr inbounds i32*, i32** %129, i64 %46
%131 = load i32*, i32** %130
%132 = getelementptr inbounds i32, i32* %131, i64 %57
store i32 %128, i32* %132
%133 = icmp eq i32 %128, 1
br i1 %133, label %134, label %145
134: ; preds = %104
%135 = load i32**, i32*** %40
%136 = getelementptr inbounds i32*, i32** %135, i64 %46
%137 = load i32*, i32** %136
%138 = getelementptr inbounds i32, i32* %137, i64 %57
%139 = load i32, i32* %138
%140 = add nsw i32 %139, -1
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double*, double** %7, i64 %141
%143 = load double*, double** %142
%144 = getelementptr inbounds double, double* %143, i64 %24
br label %145
145: ; preds = %104, %134
%146 = phi double* [ %144, %134 ], [ %25, %104 ]
%147 = phi double* [ %143, %134 ], [ %11, %104 ]
%148 = load double, double* %146
%149 = fadd double %148, 1.000000e+00
store double %149, double* %146
%150 = load i32**, i32*** %39
%151 = getelementptr inbounds i32*, i32** %150, i64 %46
%152 = load i32*, i32** %151
%153 = getelementptr inbounds i32, i32* %152, i64 %57
%154 = load i32, i32* %153
%155 = add nsw i32 %154, -1
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %147, i64 %156
%158 = load double, double* %157
%159 = fadd double %158, 1.000000e+00
store double %159, double* %157
%160 = add nsw i32 %128, -1
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %12, i64 %161
%163 = load double, double* %162
%164 = fadd double %163, 1.000000e+00
store double %164, double* %162
%165 = load double, double* %26
%166 = fadd double %165, 1.000000e+00
store double %166, double* %26
%167 = add nuw nsw i64 %56, 1
%168 = load i32*, i32** %37
%169 = getelementptr inbounds i32, i32* %168, i64 %46
%170 = load i32, i32* %169
%171 = sext i32 %170 to i64
%172 = icmp slt i64 %56, %171
br i1 %172, label %54, label %173
173: ; preds = %145
%174 = load i32, i32* %33
br label %175
175: ; preds = %173, %42
%176 = phi i32 [ %174, %173 ], [ %43, %42 ]
%177 = phi i32* [ %168, %173 ], [ %44, %42 ]
%178 = add nuw nsw i64 %45, 1
%179 = sext i32 %176 to i64
%180 = icmp slt i64 %45, %179
br i1 %180, label %42, label %181
181: ; preds = %175, %30
%182 = add nuw nsw i64 %31, 1
%183 = icmp eq i64 %182, %29
br i1 %183, label %184, label %30
184: ; preds = %181, %19
%185 = tail call i32 @free(double* %21)
ret void
}