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

```asm
<dfct>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,0x14(%rsp)
  sar    %edi
  test   %edi,%edi
  jle    L72
  mov    %rsi,%rax
  movslq 0x14(%rsp),%rsi
  lea    -0x1(%rdi),%ecx
  lea    0x8(%r13),%rbp
  mov    %edi,%r15d
  lea    0x0(%rbp,%rcx,8),%rcx
  lea    0x0(%r13,%rsi,8),%rdx
  nop
L48:
  movsd  (%rax),%xmm0
  movsd  (%rdx),%xmm1
  add    $0x8,%rax
  sub    $0x8,%rdx
  movapd %xmm0,%xmm2
  addsd  %xmm1,%xmm0
  subsd  %xmm1,%xmm2
  movsd  %xmm2,-0x8(%rax)
  movsd  %xmm0,0x8(%rdx)
  cmp    %rax,%rcx
  jne    L48
  lea    0x0(%r13,%rsi,8),%rax
  movsd  (%rax),%xmm7
  mov    %rax,0x18(%rsp)
  movsd  %xmm7,0x8(%rsp)
  cmp    $0x1,%r15d
  jle    L26
  nopl   0x0(%rax)
L2:
  mov    %r13,%rdx
  mov    $0x1,%esi
  mov    %r15d,%edi
  movslq %r15d,%r14
  call   <ddct@plt>
  mov    %r15d,%r12d
  lea    0x0(%r13,%r14,8),%rbx
  sar    %r12d
  cmp    $0x2,%r15d
  jne    L84
  movsd  0x0(%r13),%xmm1
  movsd  0x8(%rsp),%xmm6
  movsd  (%rbx),%xmm0
  movsd  %xmm1,(%rbx)
  movapd %xmm6,%xmm1
  subsd  %xmm0,%xmm1
  addsd  %xmm6,%xmm0
  movsd  %xmm1,0x0(%r13)
  movsd  %xmm0,0x8(%rsp)
L70:
  movslq %r12d,%rax
  movsd  0x8(%rsp),%xmm5
  lea    0x0(%r13,%rax,8),%rdx
  lea    (%r15,%r12,1),%eax
  cltq
  movsd  (%rdx),%xmm0
  lea    0x0(%r13,%rax,8),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rax)
  movsd  0x0(%r13),%xmm1
  movsd  0x8(%r13),%xmm0
  mov    0x18(%rsp),%rax
  movsd  %xmm1,0x8(%r13)
  movapd %xmm5,%xmm1
  subsd  %xmm0,%xmm5
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%r13)
  movsd  %xmm5,(%rax)
L82:
  mov    0x14(%rsp),%edi
  add    $0x28,%rsp
  mov    %r13,%rsi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <bitrv1@plt>
  nopl   0x0(%rax)
L84:
  mov    %r13,%rsi
  mov    %r15d,%edi
  call   <bitrv1@plt>
  movsd  0x0(%r13),%xmm1
  movsd  0x8(%rsp),%xmm4
  movsd  (%rbx),%xmm0
  movsd  %xmm1,(%rbx)
  movapd %xmm4,%xmm1
  subsd  %xmm0,%xmm1
  addsd  %xmm4,%xmm0
  movsd  %xmm1,0x0(%r13)
  movsd  %xmm0,0x8(%rsp)
  cmp    $0x1,%r12d
  je     L38
  lea    -0x2(%r12),%esi
  mov    %r13,%rax
  mov    %rbx,%rdx
  lea    0x0(%rbp,%rsi,8),%rsi
  nopl   0x0(%rax)
L15:
  movsd  -0x8(%rdx,%r14,8),%xmm0
  movsd  -0x8(%rdx),%xmm2
  movsd  0x8(%rax),%xmm3
  movsd  0x8(%rax,%r14,8),%xmm1
  movsd  %xmm3,0x8(%rax,%r14,8)
  add    $0x8,%rax
  movsd  %xmm2,-0x8(%rdx,%r14,8)
  movapd %xmm0,%xmm2
  addsd  %xmm1,%xmm0
  sub    $0x8,%rdx
  subsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
  movsd  %xmm0,(%rdx)
  cmp    %rax,%rsi
  jne    L15
  add    %r12d,%r15d
  movslq %r12d,%rax
  movslq %r15d,%r15
  lea    0x0(%r13,%rax,8),%rdx
  lea    0x0(%r13,%r15,8),%rax
  movsd  (%rdx),%xmm0
  mov    %r12d,%r15d
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rax)
  jmp    L2
L72:
  movslq 0x14(%rsp),%rax
  lea    (%rsi,%rax,8),%rax
  movsd  (%rax),%xmm6
  mov    %rax,0x18(%rsp)
  movsd  %xmm6,0x8(%rsp)
L26:
  movsd  0x0(%r13),%xmm1
  movsd  0x8(%rsp),%xmm7
  movsd  0x8(%r13),%xmm0
  mov    0x18(%rsp),%rax
  movsd  %xmm1,0x8(%r13)
  movapd %xmm7,%xmm1
  cmpl   $0x3,0x14(%rsp)
  addsd  %xmm0,%xmm1
  subsd  %xmm0,%xmm7
  movsd  %xmm1,0x0(%r13)
  movsd  %xmm7,(%rax)
  je     L82
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L38:
  mov    $0x3,%r15d
  jmp    L70
```

assistant: ```c
void dfct(int n, double *a) {
  int j, k, m, mh;
  double xr, xi, yr, yi, an;
  m = n >> 1;
  for (j = 0; j < m; j++) {
    k = n - j;
    xr = a[j] + a[k];
    a[j] -= a[k];
    a[k] = xr;
  }
  an = a[n];
  while (m >= 2) {
    ddct(m, 1, a);
    if (m > 2) {
      bitrv1(m, a);
    }
    mh = m >> 1;
    xi = a[m];
    a[m] = a[0];
    a[0] = an - xi;
    an += xi;
    for (j = 1; j < mh; j++) {
      k = m - j;
      xr = a[m + k];
      xi = a[m + j];
      yr = a[j];
      yi = a[k];
      a[m + j] = yr;
      a[m + k] = yi;
      a[j] = xr - xi;
      a[k] = xr + xi;
    }
    xr = a[mh];
    a[mh] = a[m + mh];
    a[m + mh] = xr;
    m = mh;
  }
  xi = a[1];
  a[1] = a[0];
  a[0] = an + xi;
  a[n] = an - xi;
  if (n > 2) {
    bitrv1(n, a);
  }
}
```