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

```asm
<FDFT>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x78,%rsp
  movsd  %xmm0,0x30(%rsp)
  test   %edx,%edx
  jle    L53
  pxor   %xmm0,%xmm0
  movslq %edx,%rdx
  xor    %eax,%eax
  movapd %xmm0,%xmm2
  nopl   0x0(%rax,%rax,1)
L68:
  addsd  0x0(%r13,%rax,8),%xmm2
  addsd  (%r12,%rax,8),%xmm0
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L68
L13:
  pxor   %xmm7,%xmm7
  cvtsi2sd %ebp,%xmm7
  divsd  %xmm7,%xmm0
  movsd  %xmm7,0x38(%rsp)
  divsd  %xmm7,%xmm2
  movsd  %xmm0,0x48(%rsp)
  movapd %xmm1,%xmm0
  addsd  %xmm1,%xmm0
  addsd  D19(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,0x2c(%rsp)
  movsd  %xmm2,0x40(%rsp)
  test   %eax,%eax
  jle    L26
  movslq %eax,%rcx
  lea    0x0(,%rcx,8),%rbx
  lea    (%r15,%rbx,1),%rax
  cmp    %rax,%r14
  jae    L6
  lea    (%r14,%rbx,1),%rax
  cmp    %rax,%r15
  jb     L35
L6:
  mov    %rbx,%rdx
  xor    %esi,%esi
  mov    %r14,%rdi
  movsd  %xmm1,0x8(%rsp)
  call   <memset@plt>
  mov    %rbx,%rdx
  xor    %esi,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  movsd  0x8(%rsp),%xmm1
L65:
  test   %ebp,%ebp
  jle    L158
L94:
  xorpd  D15(%rip),%xmm1
  lea    -0x1(%rbp),%eax
  mov    %r13,%rbx
  mov    %r12,%r8
  subsd  D19(%rip),%xmm1
  mulsd  0x30(%rsp),%xmm1
  lea    0x8(%r13,%rax,8),%rax
  mov    %rax,0x50(%rsp)
  movslq 0x2c(%rsp),%r13
  lea    0x68(%rsp),%r12
  lea    0x60(%rsp),%rbp
  movsd  %xmm1,0x58(%rsp)
  nopl   (%rax)
L91:
  movsd  (%rbx),%xmm3
  subsd  0x40(%rsp),%xmm3
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mulsd  D35(%rip),%xmm3
  movsd  0x58(%rsp),%xmm0
  mov    %r8,0x20(%rsp)
  mulsd  %xmm3,%xmm0
  movsd  %xmm3,0x18(%rsp)
  call   <sincos@plt>
  movsd  0x18(%rsp),%xmm3
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mulsd  0x30(%rsp),%xmm3
  movsd  0x60(%rsp),%xmm1
  movsd  0x68(%rsp),%xmm2
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movapd %xmm3,%xmm0
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm2
  mov    0x20(%rsp),%r8
  mov    0x2c(%rsp),%edx
  movsd  0x60(%rsp),%xmm4
  movsd  (%r8),%xmm3
  movsd  0x68(%rsp),%xmm5
  movapd %xmm2,%xmm0
  subsd  0x48(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm1
  test   %edx,%edx
  jle    L5
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L124:
  movapd %xmm1,%xmm2
  movapd %xmm5,%xmm6
  movapd %xmm4,%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  %xmm0,%xmm6
  mulsd  %xmm5,%xmm2
  mulsd  %xmm4,%xmm0
  subsd  %xmm6,%xmm1
  addsd  %xmm2,%xmm0
  movapd %xmm3,%xmm2
  mulsd  %xmm1,%xmm2
  addsd  (%r14,%rax,8),%xmm2
  movsd  %xmm2,(%r14,%rax,8)
  movapd %xmm3,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  (%r15,%rax,8),%xmm2
  movsd  %xmm2,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %r13,%rax
  jne    L124
L5:
  add    $0x8,%rbx
  add    $0x8,%r8
  cmp    %rbx,0x50(%rsp)
  jne    L91
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L147
L158:
  mov    0x2c(%rsp),%ebx
  xor    %eax,%eax
  xchg   %ax,%ax
L74:
  movsd  (%r14,%rax,8),%xmm0
  movsd  0x38(%rsp),%xmm7
  divsd  %xmm7,%xmm0
  movsd  %xmm0,(%r14,%rax,8)
  movsd  (%r15,%rax,8),%xmm0
  divsd  %xmm7,%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rbx
  jne    L74
L147:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  xor    %eax,%eax
L84:
  movq   $0x0,(%r14,%rax,8)
  movq   $0x0,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L84
  jmp    L65
L53:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm2
  jmp    L13
L26:
  test   %ebp,%ebp
  jg     L94
  jmp    L147
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D19
data_type: f32[2]
name: extract_symbolic_data
arguments: data_label: D15
data_type: f32[4]
name: extract_symbolic_data
arguments: data_label: D35
data_type: f64

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

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

tool: D35: 6.283185307179586

assistant: ```c
void FDFT(double *x, double *y, int N, double df, double Nf, double *f_r, double *f_i) {
  int i, j, Ntot;
  double avx, avy, c, s, fval, val, yval;
  double xf0, xdf, sdf, cdf, s0, c0, xt, f0;
  for (i = 0, avx = 0., avy = 0.; i < N; i++) {
    avx += x[i];
    avy += y[i];
  }
  avx = avx / N;
  avy = avy / N;
  Ntot = 2 * Nf + 1;
  for (i = 0; i < Ntot; i++) {
    f_r[i] = 0.;
    f_i[i] = 0.;
  }
  for (j = 0; j < N; j++) {
    f0 = (-Nf - 1) * df;
    xt = 6.28318530717958647692528676656 * (x[j] - avx);
    xf0 = xt * f0;
    xdf = xt * df;
    s0 = sin(xf0);
    c0 = cos(xf0);
    sdf = sin(xdf);
    cdf = cos(xdf);
    yval = y[j] - avy;
    for (i = 0; i < Ntot; i++) {
      c = c0 * cdf - s0 * sdf;
      s = s0 * cdf + c0 * sdf;
      f_r[i] += yval * c;
      f_i[i] += yval * s;
      c0 = c;
      s0 = s;
    }
  }
  for (i = 0; i < Ntot; i++) {
    f_r[i] /= (double)N;
    f_i[i] /= (double)N;
  }
}
```