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

```asm
<fft_rec>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %esi,%ebx
  mov    %edx,%r13d
  mov    %rcx,%rbp
  mov    %r8,(%rsp)
  cmp    $0x2,%edi
  jne    L0
  movslq %esi,%rcx
  shl    $0x4,%rcx
  lea    0x0(%rbp,%rcx,1),%rdx
  lea    (%rsi,%r13,1),%eax
  cltq
  shl    $0x4,%rax
  add    %rax,%rbp
  mov    (%rsp),%rsi
  add    %rsi,%rax
  movsd  (%rdx),%xmm0
  subsd  0x0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  0x8(%rdx),%xmm0
  subsd  0x8(%rbp),%xmm0
  movsd  %xmm0,0x8(%rax)
  mov    %rsi,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  0x8(%rdx),%xmm0
  addsd  0x8(%rbp),%xmm0
  movsd  %xmm0,0x8(%rax)
L39:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L0:
  mov    %r9,%r14
  mov    %edi,%r15d
  shr    $0x1f,%r15d
  mov    %edi,0x18(%rsp)
  add    %edi,%r15d
  sar    %r15d
  lea    (%rdx,%rdx,1),%r12d
  mov    %r8,%r9
  mov    %r14,%r8
  mov    %r12d,%edx
  mov    %r15d,%edi
  call   <fft_rec>
  lea    (%rbx,%r13,1),%esi
  mov    (%rsp),%r9
  mov    %r14,%r8
  mov    %rbp,%rcx
  mov    %r12d,%edx
  mov    %r15d,%edi
  call   <fft_rec>
  mov    0x18(%rsp),%eax
  cmp    $0x1,%eax
  jle    L39
  movslq %r12d,%r12
  shl    $0x4,%r12
  mov    %r12,0x20(%rsp)
  movslq %ebx,%rbx
  shl    $0x4,%rbx
  lea    (%r14,%rbx,1),%rbp
  movslq %r13d,%r14
  shl    $0x4,%r14
  add    (%rsp),%rbx
  imul   %r15d,%r13d
  movslq %r13d,%r13
  shl    $0x4,%r13
  mov    $0x0,%r12d
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  movsd  %xmm6,0x28(%rsp)
L24:
  mov    %r12d,(%rsp)
  fildl  (%rsp)
  fldt   0xd9e(%rip)        # 2000 <_fini+0xcec>
  fmulp  %st,%st(1)
  fdivl  0x28(%rsp)
  fld    %st(0)
  fstpt  (%rsp)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  call   <cos@plt>
  movsd  %xmm0,0x28(%rsp)
  push   0x18(%rsp)
  push   0x18(%rsp)
  call   <sin@plt>
  movsd  0x0(%rbp,%r14,1),%xmm3
  movsd  0x8(%rbp,%r14,1),%xmm1
  movsd  0x38(%rsp),%xmm5
  movapd %xmm5,%xmm2
  mulsd  %xmm3,%xmm2
  movapd %xmm1,%xmm4
  mulsd  %xmm0,%xmm4
  addsd  %xmm4,%xmm2
  mulsd  %xmm5,%xmm1
  mulsd  %xmm0,%xmm3
  subsd  %xmm3,%xmm1
  movsd  0x0(%rbp),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rbx,%r13,1)
  movsd  0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rbx,%r13,1)
  addsd  0x0(%rbp),%xmm2
  movsd  %xmm2,(%rbx)
  addsd  0x8(%rbp),%xmm1
  movsd  %xmm1,0x8(%rbx)
  add    $0x1,%r12d
  add    0x40(%rsp),%rbp
  add    %r14,%rbx
  add    $0x20,%rsp
  cmp    %r12d,%r15d
  jg     L24
  jmp    L39
```

assistant: ```c
void fft_rec(int N, int offset, int delta, double (*x)[2], double (*X)[2], double (*XX)[2]) {
  int N2 = N / 2;
  int k;
  double cs, sn;
  int k00, k01, k10, k11;
  double tmp0, tmp1;
  if (N != 2) {
    fft_rec(N2, offset, 2 * delta, x, XX, X);
    fft_rec(N2, offset + delta, 2 * delta, x, XX, X);
    for (k = 0; k < N2; k++) {
      k00 = offset + k * delta;
      k01 = k00 + N2 * delta;
      k10 = offset + 2 * k * delta;
      k11 = k10 + delta;
      cs = cos((6.2831853071795864769252867665590057683943L) * k / (double)N);
      sn = sin((6.2831853071795864769252867665590057683943L) * k / (double)N);
      tmp0 = cs * XX[k11][0] + sn * XX[k11][1];
      tmp1 = cs * XX[k11][1] - sn * XX[k11][0];
      X[k01][0] = XX[k10][0] - tmp0;
      X[k01][1] = XX[k10][1] - tmp1;
      X[k00][0] = XX[k10][0] + tmp0;
      X[k00][1] = XX[k10][1] + tmp1;
    }
  } else {
    k00 = offset;
    k01 = k00 + delta;
    X[k01][0] = x[k00][0] - x[k01][0];
    X[k01][1] = x[k00][1] - x[k01][1];
    X[k00][0] = x[k00][0] + x[k01][0];
    X[k00][1] = x[k00][1] + x[k01][1];
  }
}
```