user: Converte this assembly snippet into its equivalent C code:

```asm
<cftfsub>:
  endbr64
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0xf,%edi
  jg     L109
  cmp    $0x4,%edi
  jle    L84
  mov    $0x2,%ebx
L74:
  movslq %ebx,%rcx
  xor    %edx,%edx
  shl    $0x3,%rcx
  lea    0x0(%rbp,%rcx,1),%rdi
  lea    (%rdi,%rcx,1),%rsi
  add    %rsi,%rcx
L85:
  movsd  (%rdi),%xmm5
  movsd  0x0(%rbp,%rdx,8),%xmm2
  add    $0x10,%rdi
  add    $0x10,%rsi
  movsd  0x8(%rbp,%rdx,8),%xmm0
  movsd  -0x8(%rdi),%xmm1
  add    $0x10,%rcx
  movapd %xmm2,%xmm4
  subsd  %xmm5,%xmm2
  movsd  -0x10(%rcx),%xmm8
  movsd  -0x8(%rcx),%xmm7
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm0
  addsd  %xmm5,%xmm4
  addsd  %xmm1,%xmm3
  movsd  -0x10(%rsi),%xmm1
  movapd %xmm2,%xmm9
  movsd  -0x8(%rsi),%xmm2
  movapd %xmm1,%xmm6
  subsd  %xmm8,%xmm1
  addsd  %xmm8,%xmm6
  movapd %xmm2,%xmm5
  subsd  %xmm7,%xmm2
  addsd  %xmm7,%xmm5
  movapd %xmm4,%xmm7
  addsd  %xmm6,%xmm7
  subsd  %xmm6,%xmm4
  movsd  %xmm7,0x0(%rbp,%rdx,8)
  movapd %xmm3,%xmm7
  subsd  %xmm5,%xmm3
  addsd  %xmm5,%xmm7
  movsd  %xmm7,0x8(%rbp,%rdx,8)
  add    $0x2,%rdx
  movsd  %xmm3,-0x8(%rsi)
  movapd %xmm9,%xmm3
  subsd  %xmm2,%xmm3
  movsd  %xmm4,-0x10(%rsi)
  addsd  %xmm9,%xmm2
  movsd  %xmm3,-0x10(%rdi)
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm0
  addsd  %xmm1,%xmm3
  movsd  %xmm3,-0x8(%rdi)
  movsd  %xmm2,-0x10(%rcx)
  movsd  %xmm0,-0x8(%rcx)
  cmp    %edx,%ebx
  jg     L85
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L84:
  je     L107
L135:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L109:
  mov    %rdx,%r13
  call   <cft1st@plt>
  cmp    $0x7f,%r12d
  jle    L0
  mov    $0x10,%esi
  mov    $0x80,%ebx
  jmp    L69
  xchg   %ax,%ax
L161:
  mov    %eax,%ebx
L69:
  mov    %r13,%rcx
  mov    %rbp,%rdx
  mov    %r12d,%edi
  call   <cftmdl@plt>
  lea    0x0(,%rbx,8),%eax
  mov    %ebx,%esi
  cmp    %r12d,%eax
  jle    L161
  lea    (%rbx,%rbx,1),%eax
  cmp    %r12d,%eax
  jge    L96
  test   %ebx,%ebx
  jg     L74
  jmp    L135
L96:
  jne    L135
  test   %ebx,%ebx
  jg     L155
  jmp    L135
  nopl   0x0(%rax,%rax,1)
L107:
  mov    $0x2,%ebx
L155:
  movslq %ebx,%rax
  xor    %ecx,%ecx
  lea    0x0(%rbp,%rax,8),%rdx
  lea    0x8(%rbp),%rax
  nopl   0x0(%rax,%rax,1)
L179:
  movsd  -0x8(%rax),%xmm0
  movsd  (%rdx),%xmm2
  add    $0x2,%ecx
  add    $0x10,%rdx
  movsd  (%rax),%xmm1
  add    $0x10,%rax
  movapd %xmm0,%xmm4
  subsd  %xmm2,%xmm0
  addsd  %xmm2,%xmm4
  movapd %xmm1,%xmm3
  subsd  -0x8(%rdx),%xmm3
  movsd  %xmm4,-0x18(%rax)
  addsd  -0x8(%rdx),%xmm1
  movsd  %xmm1,-0x10(%rax)
  movsd  %xmm0,-0x10(%rdx)
  movsd  %xmm3,-0x8(%rdx)
  cmp    %ebx,%ecx
  jl     L179
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L0:
  cmp    $0x20,%r12d
  jg     L41
  jne    L135
  mov    $0x10,%ebx
  jmp    L155
L41:
  mov    $0x10,%ebx
  jmp    L74
```

assistant: ```c
void cftfsub(int n, double *a, double *w) {
  int j, j1, j2, j3, l;
  double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  l = 2;
  if (n >= 16) {
    cft1st(n, a, w);
    l = 16;
    while ((l << 3) <= n) {
      cftmdl(n, l, a, w);
      l <<= 3;
    }
  }
  if ((l << 1) < n) {
    for (j = 0; j < l; j += 2) {
      j1 = j + l;
      j2 = j1 + l;
      j3 = j2 + l;
      x0r = a[j] + a[j1];
      x0i = a[j + 1] + a[j1 + 1];
      x1r = a[j] - a[j1];
      x1i = a[j + 1] - a[j1 + 1];
      x2r = a[j2] + a[j3];
      x2i = a[j2 + 1] + a[j3 + 1];
      x3r = a[j2] - a[j3];
      x3i = a[j2 + 1] - a[j3 + 1];
      a[j] = x0r + x2r;
      a[j + 1] = x0i + x2i;
      a[j2] = x0r - x2r;
      a[j2 + 1] = x0i - x2i;
      a[j1] = x1r - x3i;
      a[j1 + 1] = x1i + x3r;
      a[j3] = x1r + x3i;
      a[j3 + 1] = x1i - x3r;
    }
  } else if ((l << 1) == n) {
    for (j = 0; j < l; j += 2) {
      j1 = j + l;
      x0r = a[j] - a[j1];
      x0i = a[j + 1] - a[j1 + 1];
      a[j] += a[j1];
      a[j + 1] += a[j1 + 1];
      a[j1] = x0r;
      a[j1 + 1] = x0i;
    }
  }
}
```