user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<DFT_Wfunc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  movsd  %xmm0,-0x58(%rbp)
  movsd  %xmm1,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  movl   $0x0,-0x34(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  jmp    L12
L29:
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x34(%rbp)
L12:
  mov    -0x34(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L29
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4c(%rbp),%xmm1
  movsd  -0x28(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D21(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x2c(%rbp)
  movl   $0x0,-0x34(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movq   D16(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  -0x58(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  jmp    L39
L43:
  movl   $0x0,-0x30(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L5
L45:
  movsd  -0x20(%rbp),%xmm1
  movsd  D0(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x28(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x30(%rbp)
L5:
  mov    -0x30(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L45
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4c(%rbp),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4c(%rbp),%xmm1
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x34(%rbp)
  movsd  -0x20(%rbp),%xmm0
  addsd  -0x58(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
L39:
  mov    -0x34(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L43
  nop
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D21
type_guessed: f32[2]
name: retrieve_data
arguments: label: D16
type_guessed: f32[2]
name: retrieve_data
arguments: label: D0
type_guessed: byte[8]

tool: {"D21": [0.0,1.875]}

tool: {"D16": [0.0,-0.0]}

tool: {"D0": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0xc0]}

assistant: ```c
void DFT_Wfunc(double *x, int N, double df, double Nf, double *W_r, double *W_i) {
  int i, j, Ntot;
  double avx, cosval, sinval, fval, val;
  for (i = 0, avx = 0.; i < N; i++) {
    avx += x[i];
  }
  avx = avx / N;
  Ntot = 2 * Nf + 1;
  for (i = 0, fval = -Nf * df; i < Ntot; i++, fval += df) {
    for (j = 0, W_r[i] = 0., W_i[i] = 0.; j < N; j++) {
      val = -6.28318530717958647692528676656 * fval * (x[j] - avx);
      cosval = cos(val);
      sinval = sin(val);
      W_r[i] += cosval;
      W_i[i] += sinval;
    }
    W_r[i] /= (double)N;
    W_i[i] /= (double)N;
  }
}
```