user: What is the c source code of the assembly code below?

```asm
<resample_z>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %edi,%r15d
  mov    %edi,0xac(%rsp)
  mov    %rsi,%rbx
  mov    %rdx,0xa0(%rsp)
  movsd  %xmm0,0x70(%rsp)
  movsd  %xmm1,0x78(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %r8,%r14
  mov    %r9,%rbp
  movslq 0x108(%rsp),%rdi
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %rax,0x58(%rsp)
  mov    0x108(%rsp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x68(%rsp)
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,0x60(%rsp)
  test   %r15d,%r15d
  jle    L99
  mov    0x110(%rsp),%eax
  add    $0x1,%eax
  cltq
  lea    -0x8(,%rax,8),%rax
  mov    %rax,0x80(%rsp)
  mov    %rbx,0x98(%rsp)
  mov    0xf0(%rsp),%r15
  mov    %rbp,0x28(%rsp)
  mov    0x100(%rsp),%rax
  mov    %rax,0x48(%rsp)
  mov    0xf8(%rsp),%rax
  mov    %rax,0x50(%rsp)
  movq   $0x1,0x90(%rsp)
  jmp    L11
L4:
  mov    (%r15),%rax
  mov    (%rax,%r12,1),%rax
  movslq (%rax,%r13,4),%rax
  mov    0x30(%rsp),%rdi
  mov    0x80(%rsp),%rcx
  add    -0x8(%rdi,%rax,8),%rcx
  movsd  (%rcx),%xmm0
  subsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  mov    (%r15),%rax
  mov    (%rax,%r12,1),%rax
  movslq (%rax,%r13,4),%rax
  mov    0x28(%rsp),%rcx
  mov    (%rcx),%rdx
  mov    (%rdx,%r12,1),%rdx
  movslq (%rdx,%r13,4),%rdx
  mov    -0x8(%rdi,%rax,8),%rax
  lea    -0x8(%rax,%rdx,8),%rax
  movsd  (%rax),%xmm0
  subsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L43
L27:
  mov    0x18(%rsp),%rsi
  mov    0x8(%rsp),%rax
  add    (%rsi),%rax
  movsd  (%rax),%xmm0
  addsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    0x20(%rsp),%rax
  mov    (%rax),%rax
  mov    (%rax,%r12,1),%rax
  movslq (%rax,%rbx,1),%rdx
  mov    (%rsi),%rax
  lea    -0x8(%rax,%rdx,8),%rax
  movsd  (%rax),%xmm0
  addsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r13
  lea    0x1(%r13),%edx
  mov    0x40(%rsp),%rax
  mov    (%rax),%rax
  mov    0x38(%rsp),%rdi
  cmp    (%rax,%rdi,1),%edx
  jg     L95
L92:
  mov    0x50(%rsp),%rax
  mov    %rax,%rbp
  lea    0x0(,%r13,4),%rbx
  mov    (%rax),%rax
  mov    (%rax,%r12,1),%rax
  cmpl   $0x1,(%rax,%r13,4)
  je     L4
L43:
  mov    %r14,0x18(%rsp)
  mov    0x68(%rsp),%rax
  sub    $0x8,%rax
  mov    %rax,0x8(%rsp)
  add    (%r14),%rax
  movsd  (%rax),%xmm0
  subsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    %r15,0x20(%rsp)
  mov    (%r15),%rax
  mov    (%rax,%r12,1),%rax
  movslq (%rax,%rbx,1),%rdx
  mov    (%r14),%rax
  lea    -0x8(%rax,%rdx,8),%rax
  movsd  (%rax),%xmm0
  subsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    (%r15),%rax
  mov    %rbx,%rcx
  add    (%rax,%r12,1),%rcx
  mov    %rcx,0x10(%rsp)
  mov    0x0(%rbp),%rax
  mov    (%rax,%r12,1),%rax
  mov    (%rax,%rbx,1),%esi
  mov    0x28(%rsp),%rax
  mov    (%rax),%rax
  mov    (%rax,%r12,1),%rax
  mov    (%rax,%rbx,1),%edi
  sub    $0x8,%rsp
  push   0x68(%rsp)
  push   0x68(%rsp)
  mov    0x60(%rsp),%rax
  push   (%rax)
  movsd  0x98(%rsp),%xmm1
  movsd  0x90(%rsp),%xmm0
  mov    0x128(%rsp),%r9d
  mov    0x130(%rsp),%r8d
  mov    (%r14),%rcx
  mov    0x50(%rsp),%rdx
  mov    $0x2,%eax
  call   <sample_Mult_labeled_stop@plt>
  mov    0x30(%rsp),%rcx
  mov    %eax,(%rcx)
  mov    0x0(%rbp),%rax
  mov    (%rax,%r12,1),%rax
  add    $0x20,%rsp
  cmpl   $0x1,(%rax,%rbx,1)
  jne    L27
  mov    (%r15),%rax
  mov    (%rax,%r12,1),%rax
  movslq (%rax,%rbx,1),%rax
  mov    0x30(%rsp),%rcx
  mov    0x80(%rsp),%rdi
  add    -0x8(%rcx,%rax,8),%rdi
  movsd  (%rdi),%xmm0
  addsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rdi)
  mov    (%r15),%rax
  mov    (%rax,%r12,1),%rax
  movslq (%rax,%rbx,1),%rax
  mov    0x28(%rsp),%rdi
  mov    (%rdi),%rdx
  mov    (%rdx,%r12,1),%rdx
  movslq (%rdx,%rbx,1),%rdx
  mov    -0x8(%rcx,%rax,8),%rax
  lea    -0x8(%rax,%rdx,8),%rax
  movsd  (%rax),%xmm0
  addsd  D50(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L27
L95:
  addq   $0x1,0x88(%rsp)
  mov    0x88(%rsp),%rax
  add    $0x1,%eax
  mov    0xa0(%rsp),%rdi
  mov    0x90(%rsp),%rbx
  cmp    %eax,-0x4(%rdi,%rbx,4)
  jl     L119
L94:
  mov    0x98(%rsp),%rax
  mov    %rax,0x40(%rsp)
  mov    0x88(%rsp),%rbx
  lea    0x0(,%rbx,4),%rdi
  mov    %rdi,0x38(%rsp)
  mov    (%rax),%rax
  lea    0x0(,%rbx,8),%r12
  mov    $0x0,%r13d
  cmpl   $0x0,(%rax,%rbx,4)
  jg     L92
  jmp    L95
L119:
  addq   $0x1,0x90(%rsp)
  mov    0x90(%rsp),%rax
  addq   $0x8,0x98(%rsp)
  add    $0x8,%r14
  add    $0x8,%r15
  addq   $0x8,0x28(%rsp)
  addq   $0x8,0x48(%rsp)
  addq   $0x8,0x50(%rsp)
  cmp    %eax,0xac(%rsp)
  jl     L99
L11:
  movq   $0x0,0x88(%rsp)
  mov    0xa0(%rsp),%rax
  mov    0x90(%rsp),%rdi
  cmpl   $0x0,-0x4(%rax,%rdi,4)
  jg     L94
  jmp    L119
L99:
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_label: D50
data_type: f64

tool: D50: 1

assistant: ```c
void resample_z(int D, int **M, int *N, double alpha, double eta, double psi, double **post_beta, double **post_theta, int ***w, int ***z, int ***s, 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;
  int *labelIdx = (int *)malloc(K * sizeof(int));
  double *post_z = (double *)malloc((K + 1) * sizeof(double));
  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] += (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)));
        }
        post_theta[d_10 - 1][(K) + (1) - 1] += (0.0) - (1.0);
        post_theta[d_10 - 1][z[d_10 - 1][n_16 - 1][m_22 - 1] - 1] += (0.0) - (1.0);
        z[d_10 - 1][n_16 - 1][m_22 - 1] = sample_Mult_labeled_stop(w[d_10 - 1][n_16 - 1][m_22 - 1], s[d_10 - 1][n_16 - 1][m_22 - 1], post_beta, post_theta[d_10 - 1], V, K, alpha, eta, labels[d_10 - 1], labelIdx, post_z);
        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) * ((((z[d_10 - 1][n_16 - 1][m_22 - 1]) == (z[d_10 - 1][n_16 - 1][m_22 - 1])) ? 1 : 0));
          post_beta[z[d_10 - 1][n_16 - 1][m_22 - 1] - 1][w[d_10 - 1][n_16 - 1][m_22 - 1] - 1] += (1.0) * ((((z[d_10 - 1][n_16 - 1][m_22 - 1]) == (z[d_10 - 1][n_16 - 1][m_22 - 1])) ? 1 : 0));
        }
        post_theta[d_10 - 1][(K) + (1) - 1] += 1.0;
        post_theta[d_10 - 1][z[d_10 - 1][n_16 - 1][m_22 - 1] - 1] += 1.0;
      }
    }
  }
  free(labelIdx);
  free(post_z);
}
```