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

```asm
<DFT>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %rsi,0x38(%rsp)
  mov    %edx,0x44(%rsp)
  movsd  %xmm0,0x48(%rsp)
  test   %edx,%edx
  jle    L49
  cmp    $0x1,%edx
  je     L22
  shr    %edx
  pxor   %xmm0,%xmm0
  xor    %eax,%eax
  shl    $0x4,%rdx
  movapd %xmm0,%xmm2
  nopw   0x0(%rax,%rax,1)
L73:
  mov    0x30(%rsp),%rsi
  mov    0x38(%rsp),%rdi
  movupd (%rsi,%rax,1),%xmm3
  movupd (%rdi,%rax,1),%xmm7
  add    $0x10,%rax
  addsd  %xmm3,%xmm2
  movaps %xmm3,(%rsp)
  movsd  0x8(%rsp),%xmm3
  addsd  %xmm7,%xmm0
  movaps %xmm7,(%rsp)
  addsd  %xmm3,%xmm2
  movsd  0x8(%rsp),%xmm3
  addsd  %xmm3,%xmm0
  cmp    %rdx,%rax
  jne    L73
  mov    0x44(%rsp),%edx
  mov    %edx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%edx
  je     L29
L18:
  mov    0x30(%rsp),%rdx
  cltq
  addsd  (%rdx,%rax,8),%xmm2
  mov    0x38(%rsp),%rdx
  addsd  (%rdx,%rax,8),%xmm0
L29:
  mov    0x44(%rsp),%edx
  pxor   %xmm3,%xmm3
  cvtsi2sd %edx,%xmm3
  divsd  %xmm3,%xmm0
  movsd  %xmm3,0x50(%rsp)
  divsd  %xmm3,%xmm2
  movsd  %xmm0,0x18(%rsp)
  movapd %xmm1,%xmm0
  addsd  %xmm1,%xmm0
  addsd  D23(%rip),%xmm0
  xorpd  D4(%rip),%xmm1
  mulsd  0x48(%rsp),%xmm1
  cvttsd2si %xmm0,%eax
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm2,0x10(%rsp)
  test   %eax,%eax
  jle    L67
  sub    $0x1,%eax
  mov    %rcx,%r15
  mov    %r8,%r14
  lea    0x8(%rcx,%rax,8),%rax
  mov    0x30(%rsp),%rcx
  mov    %rax,0x58(%rsp)
  lea    -0x1(%rdx),%eax
  lea    0x8(%rcx,%rax,8),%rax
  mov    %rax,0x20(%rsp)
L58:
  mov    0x44(%rsp),%eax
  movq   $0x0,(%r15)
  movq   $0x0,(%r14)
  test   %eax,%eax
  jle    L24
  mov    0x38(%rsp),%r12
  mov    0x30(%rsp),%r13
  lea    0x68(%rsp),%rbp
  lea    0x60(%rsp),%rbx
  movsd  D29(%rip),%xmm2
  mulsd  0x28(%rsp),%xmm2
  movsd  %xmm2,(%rsp)
  nopl   0x0(%rax)
L57:
  movsd  0x0(%r13),%xmm0
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  add    $0x8,%r13
  subsd  0x10(%rsp),%xmm0
  mulsd  (%rsp),%xmm0
  add    $0x8,%r12
  call   <sincos@plt>
  movsd  -0x8(%r12),%xmm0
  movsd  0x18(%rsp),%xmm4
  subsd  %xmm4,%xmm0
  mulsd  0x60(%rsp),%xmm0
  addsd  (%r15),%xmm0
  movsd  %xmm0,(%r15)
  movsd  -0x8(%r12),%xmm0
  subsd  %xmm4,%xmm0
  mulsd  0x68(%rsp),%xmm0
  addsd  (%r14),%xmm0
  movsd  %xmm0,(%r14)
  cmp    %r13,0x20(%rsp)
  jne    L57
L24:
  movsd  (%r15),%xmm0
  movsd  0x50(%rsp),%xmm7
  add    $0x8,%r15
  add    $0x8,%r14
  movsd  0x28(%rsp),%xmm1
  addsd  0x48(%rsp),%xmm1
  divsd  %xmm7,%xmm0
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm0,-0x8(%r15)
  movsd  -0x8(%r14),%xmm0
  divsd  %xmm7,%xmm0
  movsd  %xmm0,-0x8(%r14)
  cmp    0x58(%rsp),%r15
  jne    L58
L67:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L49:
  pxor   %xmm0,%xmm0
  movapd %xmm0,%xmm2
  jmp    L29
L22:
  pxor   %xmm0,%xmm0
  xor    %eax,%eax
  movapd %xmm0,%xmm2
  jmp    L18
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D23
type_infered: f32[2]
name: extract_symbolic_data
arguments: data_tag: D4
type_infered: f32[4]
name: extract_symbolic_data
arguments: data_tag: D29
type_infered: byte[8]

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

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

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

assistant: ```c
void DFT(double *x, double *y, int N, double df, double Nf, double *f_r, double *f_i) {
  int i, j, Ntot;
  double avx, avy, cosval, sinval, fval, val;
  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, fval = -Nf * df; i < Ntot; i++, fval += df) {
    for (j = 0, f_r[i] = 0., f_i[i] = 0.; j < N; j++) {
      val = -6.28318530717958647692528676656 * fval * (x[j] - avx);
      cosval = cos(val);
      sinval = sin(val);
      f_r[i] += (y[j] - avy) * cosval;
      f_i[i] += (y[j] - avy) * sinval;
    }
    f_r[i] /= (double)N;
    f_i[i] /= (double)N;
  }
}
```