user: 请将以下的汇编代码转换成C语言代码：

```asm
<resample_post_gamma>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r12d
  mov    %rsi,%rbp
  mov    %rdx,%r14
  mov    %r8,0x18(%rsp)
  mov    %r9,%r15
  mov    %ecx,0x14(%rsp)
  lea    0x1(%rcx),%eax
  movslq %eax,%r13
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    0x14(%rsp),%ecx
  test   %ecx,%ecx
  jle    L109
  mov    %ecx,%edx
  lea    (%rax,%rdx,8),%rdx
L54:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L54
L109:
  lea    -0x8(%rbx,%r13,8),%r8
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x14(%rsp),%xmm0
  mulsd  D10(%rip),%xmm0
  movsd  %xmm0,(%r8)
  test   %r12d,%r12d
  jle    L114
  mov    %rbp,%r13
  mov    0x60(%rsp),%rdi
  lea    -0x1(%r12),%eax
  lea    0x8(%rbp,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  movsd  D7(%rip),%xmm3
  pxor   %xmm5,%xmm5
  movapd %xmm3,%xmm2
  movapd %xmm5,%xmm4
  jmp    L119
L79:
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rsi)
  add    $0x1,%edx
  add    $0x4,%rax
  mov    (%r9),%rsi
  cmp    %edx,(%rsi,%r10,1)
  jl     L60
L20:
  movsd  (%r8),%xmm0
  mov    %rdi,%r11
  mov    (%rdi),%rsi
  mov    (%rsi,%rcx,1),%rsi
  movapd %xmm3,%xmm1
  cmpl   $0x2,(%rsi,%rax,1)
  je     L90
  movapd %xmm5,%xmm1
L90:
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%r8)
  mov    (%r15),%rsi
  mov    (%rsi,%rcx,1),%rsi
  movslq (%rsi,%rax,1),%rsi
  lea    -0x8(%rbx,%rsi,8),%rsi
  movsd  (%rsi),%xmm0
  mov    (%r11),%r11
  mov    (%r11,%rcx,1),%r11
  movapd %xmm2,%xmm1
  cmpl   $0x2,(%r11,%rax,1)
  je     L79
  movapd %xmm4,%xmm1
  jmp    L79
L60:
  add    $0x1,%ebp
  add    $0x4,%r10
  cmp    %ebp,(%r12)
  jl     L39
L135:
  mov    %r13,%r9
  mov    0x0(%r13),%rsi
  lea    (%r10,%r10,1),%rcx
  mov    $0x0,%eax
  mov    $0x1,%edx
  cmpl   $0x0,(%rsi,%r10,1)
  jg     L20
  jmp    L60
L39:
  add    $0x4,%r14
  add    $0x8,%r13
  add    $0x8,%r15
  add    $0x8,%rdi
  cmp    0x8(%rsp),%r13
  je     L114
L119:
  mov    %r14,%r12
  mov    $0x0,%r10d
  mov    $0x1,%ebp
  cmpl   $0x0,(%r14)
  jg     L135
  jmp    L39
L114:
  mov    0x14(%rsp),%edx
  mov    %rbx,%rsi
  mov    0x18(%rsp),%rdi
  call   <sample_Delta@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: tag: D10
type_guessed: f64
name: unpack_data
arguments: tag: D7
type_guessed: f64

tool: D10: 0

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