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

```asm
<cfftf1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,0xc(%rsp)
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9d,0x2c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    0x4(%r8),%eax
  mov    %eax,0x28(%rsp)
  test   %eax,%eax
  jle    L187
  mov    %rcx,%r15
  mov    $0x2,%r13d
  movl   $0x0,0x8(%rsp)
  mov    $0x0,%r14d
  mov    $0x1,%r12d
  jmp    L25
L26:
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%rdx
  jmp    L99
L80:
  cmp    $0x5,%ebx
  jne    L172
  mov    0x8(%rsp),%r10d
  lea    0x0(%rbp,%r10,1),%edi
  lea    0x0(%rbp,%rdi,1),%eax
  movslq %edi,%r9
  movslq %r10d,%r8
  sub    $0x8,%rsp
  mov    0x34(%rsp),%edi
  push   %rdi
  lea    0x0(%rbp,%rax,1),%edi
  movslq %edi,%rdi
  lea    (%r15,%rdi,8),%rdi
  push   %rdi
  cltq
  lea    (%r15,%rax,8),%rax
  push   %rax
  lea    (%r15,%r9,8),%r9
  lea    (%r15,%r8,8),%r8
  mov    %ebp,%edi
  call   <passf5@plt>
  add    $0x20,%rsp
  xor    $0x1,%r14d
  jmp    L85
L23:
  mov    0x8(%rsp),%edi
  lea    0x0(%rbp,%rdi,1),%eax
  movslq %eax,%r8
  movslq %edi,%rdi
  mov    0x2c(%rsp),%r11d
  push   %r11
  add    %ebp,%eax
  cltq
  lea    (%r15,%rax,8),%rax
  push   %rax
  lea    (%r15,%r8,8),%r9
  lea    (%r15,%rdi,8),%r8
  mov    %ebp,%edi
  call   <passf4@plt>
  add    $0x10,%rsp
  xor    $0x1,%r14d
L85:
  sub    $0x1,%ebx
  imul   %ebp,%ebx
  add    %ebx,0x8(%rsp)
  add    $0x1,%r13
  lea    -0x1(%r13),%eax
  cmp    0x28(%rsp),%eax
  jg     L71
L25:
  mov    0x20(%rsp),%rax
  mov    (%rax,%r13,4),%ebx
  mov    %r12d,%esi
  imul   %ebx,%r12d
  mov    0xc(%rsp),%eax
  cltd
  idiv   %r12d
  lea    (%rax,%rax,1),%ebp
  test   %r14d,%r14d
  jne    L26
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rdx
L99:
  cmp    $0x4,%ebx
  je     L23
  jg     L80
  cmp    $0x2,%ebx
  je     L83
  cmp    $0x3,%ebx
  jne    L172
  mov    0x8(%rsp),%eax
  lea    0x0(%rbp,%rax,1),%edi
  movslq %edi,%rdi
  cltq
  sub    $0x8,%rsp
  mov    0x34(%rsp),%r11d
  push   %r11
  lea    (%r15,%rdi,8),%r9
  lea    (%r15,%rax,8),%r8
  mov    %ebp,%edi
  call   <passf3@plt>
  add    $0x10,%rsp
  xor    $0x1,%r14d
  jmp    L85
L83:
  movslq 0x8(%rsp),%rax
  mov    0x2c(%rsp),%r9d
  lea    (%r15,%rax,8),%r8
  mov    %ebp,%edi
  call   <passf2@plt>
  xor    $0x1,%r14d
  jmp    L85
L172:
  lea    0x34(%rsp),%rdi
  sub    $0x8,%rsp
  mov    0x34(%rsp),%eax
  push   %rax
  movslq 0x18(%rsp),%rax
  lea    (%r15,%rax,8),%rax
  push   %rax
  push   %rcx
  mov    %rdx,%r9
  mov    %ebp,%r8d
  imul   %esi,%r8d
  mov    %esi,%ecx
  mov    %ebx,%edx
  mov    %ebp,%esi
  call   <passf@plt>
  add    $0x20,%rsp
  cmpl   $0x0,0x34(%rsp)
  je     L85
  xor    $0x1,%r14d
  jmp    L85
L71:
  test   %r14d,%r14d
  je     L187
  mov    0xc(%rsp),%edx
  add    %edx,%edx
  mov    %edx,%ecx
  mov    $0x0,%eax
  test   %edx,%edx
  jle    L187
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%rsi
L28:
  movsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L28
L187:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L93
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L93:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void cfftf1(int n, double c[], double ch[], const double wa[], const int ifac[13 + 2], int isign) {
  int idot, i;
  int k1, l1, l2;
  int na, nf, ip, iw, ix2, ix3, ix4, nac, ido, idl1;
  double *cinput, *coutput;
  nf = ifac[1];
  na = 0;
  l1 = 1;
  iw = 0;
  for (k1 = 2; k1 <= nf + 1; k1++) {
    ip = ifac[k1];
    l2 = ip * l1;
    ido = n / l2;
    idot = ido + ido;
    idl1 = idot * l1;
    if (na) {
      cinput = ch;
      coutput = c;
    } else {
      cinput = c;
      coutput = ch;
    }
    switch (ip) {
    case 4:
      ix2 = iw + idot;
      ix3 = ix2 + idot;
      passf4(idot, l1, cinput, coutput, &wa[iw], &wa[ix2], &wa[ix3], isign);
      na = !na;
      break;
    case 2:
      passf2(idot, l1, cinput, coutput, &wa[iw], isign);
      na = !na;
      break;
    case 3:
      ix2 = iw + idot;
      passf3(idot, l1, cinput, coutput, &wa[iw], &wa[ix2], isign);
      na = !na;
      break;
    case 5:
      ix2 = iw + idot;
      ix3 = ix2 + idot;
      ix4 = ix3 + idot;
      passf5(idot, l1, cinput, coutput, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
      na = !na;
      break;
    default:
      passf(&nac, idot, ip, l1, idl1, cinput, coutput, &wa[iw], isign);
      if (nac != 0)
        na = !na;
    }
    l1 = l2;
    iw += (ip - 1) * idot;
  }
  if (na == 0)
    return;
  for (i = 0; i < 2 * n; i++)
    c[i] = ch[i];
}
```