user: Demonstrate the C code that generates the assembly output below:

```asm
<resample_post_theta>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r12d
  mov    %edi,0x4(%rsp)
  mov    %esi,%r14d
  mov    %esi,(%rsp)
  mov    %rdx,%r13
  mov    %rcx,%r15
  mov    %r8,0x10(%rsp)
  mov    %r9,0x18(%rsp)
  lea    0x1(%rsi),%eax
  movslq %eax,%rbx
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L115
  lea    -0x8(%rax,%rbx,8),%rbx
  mov    0x68(%rsp),%r12
  lea    -0x1(%r14),%eax
  lea    0x8(%rbp,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x1,%r14d
  jmp    L68
L62:
  movsd  (%rbx),%xmm0
  addsd  D1(%rip),%xmm0
  movsd  %xmm0,(%rbx)
  mov    (%r12),%rcx
  mov    (%rcx,%rdi,1),%rcx
  movslq (%rcx,%rdx,1),%rcx
  lea    -0x8(%rbp,%rcx,8),%rcx
  movsd  (%rcx),%xmm0
  addsd  D1(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x1,%eax
  add    $0x4,%rdx
  mov    (%r8),%rcx
  cmp    %eax,(%rcx,%rsi,1)
  jge    L62
L8:
  add    $0x1,%r9d
  add    $0x4,%rsi
  cmp    %r9d,-0x4(%r15,%r14,4)
  jl     L80
L87:
  mov    %r13,%r8
  mov    0x0(%r13),%rcx
  lea    (%rsi,%rsi,1),%rdi
  mov    $0x0,%edx
  mov    $0x1,%eax
  cmpl   $0x0,(%rcx,%rsi,1)
  jg     L62
  jmp    L8
L80:
  cmpq   $0x0,0x60(%rsp)
  je     L81
  mov    0x60(%rsp),%rax
  mov    -0x4(%rax,%r14,4),%eax
  cmp    $0xffffffff,%eax
  jne    L3
L81:
  mov    0x10(%rsp),%rax
  mov    -0x8(%rax,%r14,8),%rdi
  mov    (%rsp),%edx
  mov    %rbp,%rsi
  call   <sample_Delta@plt>
L25:
  add    $0x1,%r14
  add    $0x8,%r13
  add    $0x8,%r12
  cmp    %r14d,0x4(%rsp)
  jl     L115
L68:
  mov    %rbp,%rax
  mov    0x8(%rsp),%rdx
  cmpl   $0x0,(%rsp)
  jle    L59
L39:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L39
L59:
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%rsp),%xmm0
  pxor   %xmm1,%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  mov    $0x0,%esi
  mov    $0x1,%r9d
  cmpl   $0x0,-0x4(%r15,%r14,4)
  jg     L87
  jmp    L80
L3:
  cltq
  mov    0x18(%rsp),%rdi
  mov    (%rdi,%rax,8),%rdi
  mov    (%rsp),%edx
  mov    %rbp,%rsi
  call   <add_dst@plt>
  jmp    L25
L115:
  mov    %rbp,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_label: D1
type: f64

tool: D1: 1

assistant: ```c
void resample_post_theta(int D, int K, int **M, int *N, double **post_theta, double **post_theta_train, int *entity_map, int ***z) {
  int d_9;
  double *tmpSP7;
  int n_3;
  int m_75;
  int dvv_loop_var_1;
  tmpSP7 = (double *)malloc(sizeof(double) * (1 + ((K) + (1)) - (1)));
  for (d_9 = 1; d_9 <= D; d_9++) {
    for (dvv_loop_var_1 = 1; dvv_loop_var_1 <= K; dvv_loop_var_1++) {
      tmpSP7[dvv_loop_var_1 - 1] = 0.0;
    }
    tmpSP7[(K) + (1) - 1] = (0.0) * (((1) + (K)) - (1));
    for (n_3 = 1; n_3 <= N[d_9 - 1]; n_3++) {
      for (m_75 = 1; m_75 <= M[d_9 - 1][n_3 - 1]; m_75++) {
        tmpSP7[(K) + (1) - 1] += 1.0;
        tmpSP7[z[d_9 - 1][n_3 - 1][m_75 - 1] - 1] += 1.0;
      }
    }
    if ((entity_map == NULL) || (entity_map[d_9 - 1] == -1)) {
      sample_Delta(post_theta[d_9 - 1], tmpSP7, K);
    } else {
      add_dst(post_theta_train[entity_map[d_9 - 1]], tmpSP7, K);
    }
  }
  free(tmpSP7);
}
```