user: 请从给定的汇编指令推导出C源代码:

```asm
<resample_post_gamma>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x2,-0x1c(%rbp)
  jmp    L120
L98:
  movl   $0x1,-0xc(%rbp)
  jmp    L72
L68:
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xc(%rbp)
L72:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jle    L68
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x28(%rbp),%xmm1
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x18(%rbp)
  jmp    L89
L2:
  movl   $0x1,-0x14(%rbp)
  jmp    L5
L54:
  movl   $0x1,-0x10(%rbp)
  jmp    L107
L59:
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x1c(%rbp)
  jne    L44
  movsd  D7(%rip),%xmm0
  jmp    L80
L44:
  pxor   %xmm0,%xmm0
L80:
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x1c(%rbp)
  jne    L92
  movsd  D7(%rip),%xmm0
  jmp    L75
L92:
  pxor   %xmm0,%xmm0
L75:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  sub    $0x8,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L107:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  jle    L59
  addl   $0x1,-0x14(%rbp)
L5:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L54
  addl   $0x1,-0x18(%rbp)
L89:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L2
  mov    -0x28(%rbp),%edx
  mov    -0x8(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sample_Delta@plt>
  addl   $0x1,-0x1c(%rbp)
L120:
  cmpl   $0x2,-0x1c(%rbp)
  jle    L98
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D7
data_type: f64

tool: D7: 1

assistant: ```c
void resample_post_gamma(int D, int **M, int *N, int V, double *post_gamma, int ***w, int ***s) {
  int k_8;
  double *tmpSP4;
  int d_2;
  int n_74;
  int m_290;
  int dvv_loop_var_1;
  tmpSP4 = (double *)malloc(sizeof(double) * (1 + ((V) + (1)) - (1)));
  for (k_8 = 2; k_8 <= 2; k_8++) {
    for (dvv_loop_var_1 = 1; dvv_loop_var_1 <= V; dvv_loop_var_1++) {
      tmpSP4[dvv_loop_var_1 - 1] = 0.0;
    }
    tmpSP4[(V) + (1) - 1] = (0.0) * (((1) + (V)) - (1));
    for (d_2 = 1; d_2 <= D; d_2++) {
      for (n_74 = 1; n_74 <= N[d_2 - 1]; n_74++) {
        for (m_290 = 1; m_290 <= M[d_2 - 1][n_74 - 1]; m_290++) {
          tmpSP4[(V) + (1) - 1] += (1.0) * ((((k_8) == (s[d_2 - 1][n_74 - 1][m_290 - 1])) ? 1 : 0));
          tmpSP4[w[d_2 - 1][n_74 - 1][m_290 - 1] - 1] += (1.0) * ((((k_8) == (s[d_2 - 1][n_74 - 1][m_290 - 1])) ? 1 : 0));
        }
      }
    }
    sample_Delta(post_gamma, tmpSP4, V);
  }
  free(tmpSP4);
}
```