user: What would the C source look like for the assembly code provided here:

```asm
<resample_z>:
  endbr64
  push   %r15
  push   %r14
  mov    %r9,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x98,%rsp
  mov    %edi,0x8c(%rsp)
  movslq 0xe8(%rsp),%rdi
  mov    0xf0(%rsp),%esi
  mov    %rdx,0x78(%rsp)
  mov    %edi,0x54(%rsp)
  shl    $0x2,%rdi
  mov    0xd0(%rsp),%r13
  mov    %esi,0x88(%rsp)
  mov    0xd8(%rsp),%r12
  mov    %rcx,(%rsp)
  mov    0xe0(%rsp),%r15
  movsd  %xmm0,0x58(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <malloc@plt>
  mov    %rax,0x40(%rsp)
  mov    0x54(%rsp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  mov    %rax,0x80(%rsp)
  call   <malloc@plt>
  mov    0x8c(%rsp),%esi
  mov    %rax,0x48(%rsp)
  test   %esi,%esi
  jle    L26
  mov    0x88(%rsp),%esi
  mov    (%rsp),%r11
  mov    %r13,%r10
  mov    %rbx,0x18(%rsp)
  mov    %rbp,0x30(%rsp)
  movsd  0x8(%rsp),%xmm1
  mov    %r14,%r13
  lea    0x1(%rsi),%eax
  movsd  D18(%rip),%xmm2
  mov    %r15,0x38(%rsp)
  mov    %r12,%r15
  movq   $0x1,0x70(%rsp)
  cltq
  lea    -0x8(,%rax,8),%rax
  mov    %rax,0x60(%rsp)
  nopw   0x0(%rax,%rax,1)
L31:
  mov    0x78(%rsp),%rax
  mov    0x70(%rsp),%rbx
  mov    -0x4(%rax,%rbx,4),%eax
  test   %eax,%eax
  jle    L53
  movq   $0x0,0x68(%rsp)
  mov    0x30(%rsp),%rax
  mov    (%rax),%rdx
  nopw   0x0(%rax,%rax,1)
L83:
  mov    0x68(%rsp),%rax
  mov    (%rdx,%rax,4),%ecx
  lea    0x0(,%rax,4),%rbx
  mov    %rbx,0x20(%rsp)
  test   %ecx,%ecx
  jle    L91
  mov    0x68(%rsp),%rbx
  mov    (%r15),%rax
  mov    (%rax,%rbx,8),%rsi
  mov    (%r10),%rax
  lea    0x0(,%rbx,8),%r14
  mov    (%rax,%rbx,8),%rbp
  mov    0x18(%rsp),%rax
  xor    %ebx,%ebx
  mov    (%rax),%rcx
  mov    0x80(%rsp),%rax
  sub    $0x8,%rax
  mov    %rax,0x28(%rsp)
  add    %rcx,%rax
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L66:
  lea    -0x8(,%rax,8),%rdx
L33:
  mov    0x18(%rsp),%rax
  mov    0x30(%rsp),%rdi
  add    $0x1,%rbx
  mov    0x20(%rsp),%r9
  mov    (%rax),%rcx
  mov    0x28(%rsp),%rax
  add    %rcx,%rax
  add    %rcx,%rdx
  movsd  (%rax),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rdx),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  mov    (%rdi),%rdx
  lea    0x1(%rbx),%edi
  cmp    %edi,(%rdx,%r9,1)
  jl     L91
L48:
  lea    0x0(,%rbx,4),%r12
  mov    0x0(%r13),%rdi
  mov    (%rsi,%rbx,4),%esi
  add    %r12,%rbp
  movslq 0x0(%rbp),%r8
  mov    (%rdi,%r14,1),%rdi
  shl    $0x3,%r8
  mov    (%rdi,%rbx,4),%edi
  lea    -0x8(%r8),%rdx
  cmp    $0x1,%esi
  jne    L36
  mov    -0x8(%r11,%r8,1),%r8
  mov    0x60(%rsp),%r9
  add    %r8,%r9
  movsd  (%r9),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%r9)
  movslq %edi,%r9
  lea    -0x8(%r8,%r9,8),%r8
  movsd  (%r8),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%r8)
L36:
  movsd  (%rax),%xmm0
  add    %rcx,%rdx
  mov    %r10,0x10(%rsp)
  sub    $0x8,%rsp
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rdx),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  mov    %r11,%rdx
  push   0x50(%rsp)
  push   0x50(%rsp)
  mov    0x50(%rsp),%rax
  push   (%rax)
  movsd  0x78(%rsp),%xmm0
  mov    $0x2,%eax
  mov    0x74(%rsp),%r9d
  mov    0xa8(%rsp),%r8d
  mov    %r11,0x20(%rsp)
  movsd  %xmm1,0x28(%rsp)
  call   <sample_Mult_labeled_stop@plt>
  mov    0x30(%rsp),%r10
  add    $0x20,%rsp
  mov    (%rsp),%r11
  mov    %eax,0x0(%rbp)
  mov    (%r15),%rax
  movsd  0x8(%rsp),%xmm1
  mov    (%rax,%r14,1),%rsi
  mov    D18(%rip),%rax
  movq   %rax,%xmm2
  mov    (%r10),%rax
  cmpl   $0x1,(%rsi,%r12,1)
  mov    (%rax,%r14,1),%rbp
  movslq 0x0(%rbp,%r12,1),%rax
  jne    L66
  shl    $0x3,%rax
  mov    0x60(%rsp),%rcx
  lea    -0x8(%rax),%rdx
  mov    -0x8(%r11,%rax,1),%rax
  add    %rax,%rcx
  movsd  (%rcx),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rcx)
  mov    0x0(%r13),%rcx
  mov    (%rcx,%r14,1),%rcx
  movslq (%rcx,%r12,1),%rcx
  lea    -0x8(%rax,%rcx,8),%rax
  movsd  (%rax),%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L33
  nopl   (%rax)
L91:
  addq   $0x1,0x68(%rsp)
  mov    0x78(%rsp),%rbx
  mov    0x68(%rsp),%rax
  mov    0x70(%rsp),%rsi
  add    $0x1,%eax
  cmp    %eax,-0x4(%rbx,%rsi,4)
  jge    L83
L53:
  addq   $0x1,0x70(%rsp)
  add    $0x8,%r10
  mov    0x70(%rsp),%rax
  add    $0x8,%r13
  addq   $0x8,0x18(%rsp)
  add    $0x8,%r15
  addq   $0x8,0x30(%rsp)
  addq   $0x8,0x38(%rsp)
  cmp    %eax,0x8c(%rsp)
  jge    L31
L26:
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D18
type_infered: f64

tool: D18: 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);
}
```