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

```asm
<dfct>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r14d
  mov    %rsi,%r12
  mov    %rdx,%rbx
  mov    %rcx,0x18(%rsp)
  mov    %r8,0x10(%rsp)
  mov    (%rcx),%eax
  mov    %eax,0xc(%rsp)
  shl    $0x3,%eax
  cmp    %edi,%eax
  jl     L237
L11:
  mov    0x18(%rsp),%rax
  mov    0x4(%rax),%r15d
  lea    (%r15,%r15,1),%eax
  cmp    %r14d,%eax
  jl     L87
L45:
  mov    %r14d,%r13d
  sar    %r13d
  movslq %r13d,%rax
  movsd  (%r12,%rax,8),%xmm0
  movsd  (%r12),%xmm1
  movslq %r14d,%rdx
  lea    0x0(,%rdx,8),%rdi
  mov    %rdi,0x20(%rsp)
  lea    (%r12,%rdi,1),%rsi
  mov    %rsi,0x28(%rsp)
  movsd  (%rsi),%xmm3
  movapd %xmm1,%xmm2
  addsd  %xmm3,%xmm2
  subsd  %xmm3,%xmm1
  movsd  %xmm1,(%r12)
  movapd %xmm2,%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx)
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  cmp    $0x2,%r14d
  jle    L71
  mov    %r14d,%ebp
  sar    $0x2,%ebp
  cmp    $0x7,%r14d
  jle    L191
  lea    -0x8(,%rax,8),%rdx
  mov    %ebp,%esi
  neg    %rax
  lea    (%rdi,%rax,8),%rcx
  add    %r12,%rcx
  mov    $0x1,%eax
L175:
  movsd  (%r12,%rax,8),%xmm2
  movsd  (%rcx,%rdx,1),%xmm5
  movapd %xmm2,%xmm0
  addsd  %xmm5,%xmm0
  movsd  (%r12,%rdx,1),%xmm1
  movsd  (%rcx,%rax,8),%xmm4
  movapd %xmm1,%xmm3
  addsd  %xmm4,%xmm3
  subsd  %xmm5,%xmm2
  movsd  %xmm2,(%r12,%rax,8)
  subsd  %xmm4,%xmm1
  movsd  %xmm1,(%r12,%rdx,1)
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  movsd  %xmm1,(%rbx,%rax,8)
  addsd  %xmm3,%xmm0
  movsd  %xmm0,(%rbx,%rdx,1)
  add    $0x1,%rax
  sub    $0x8,%rdx
  cmp    %rsi,%rax
  jne    L175
L191:
  movslq %ebp,%rcx
  lea    (%r12,%rcx,8),%rax
  mov    %r14d,%edx
  sub    %ebp,%edx
  movslq %edx,%rdx
  lea    (%r12,%rdx,8),%rdx
  movsd  (%rax),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rbx,%rcx,8)
  movsd  (%rax),%xmm0
  subsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movslq 0xc(%rsp),%rax
  mov    0x10(%rsp),%rdi
  lea    (%rdi,%rax,8),%rax
  mov    %rax,(%rsp)
  mov    %rax,%rcx
  mov    %r15d,%edx
  mov    %r12,%rsi
  mov    %r13d,%edi
  call   <dctsub@plt>
  cmp    $0x4,%r13d
  jg     L84
  je     L205
  movsd  (%r12),%xmm0
  subsd  0x8(%r12),%xmm0
  mov    0x20(%rsp),%rax
  movsd  %xmm0,-0x8(%r12,%rax,1)
  movsd  0x8(%r12),%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,0x8(%r12)
  jmp    L211
L237:
  mov    %edi,%eax
  sar    $0x3,%eax
  mov    %eax,0xc(%rsp)
  mov    %r8,%rdx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <makewt@plt>
  jmp    L11
L87:
  mov    %r14d,%r15d
  sar    %r15d
  movslq 0xc(%rsp),%rax
  mov    0x10(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdx
  mov    0x18(%rsp),%rsi
  mov    %r15d,%edi
  call   <makect@plt>
  jmp    L45
L84:
  mov    0x18(%rsp),%rax
  lea    0x8(%rax),%rdx
  mov    0x10(%rsp),%r8
  mov    0xc(%rsp),%ecx
  mov    %r12,%rsi
  mov    %r13d,%edi
  call   <cftfsub@plt>
  mov    (%rsp),%rcx
  mov    %r15d,%edx
  mov    %r12,%rsi
  mov    %r13d,%edi
  call   <rftfsub@plt>
L74:
  movsd  (%r12),%xmm0
  subsd  0x8(%r12),%xmm0
  mov    0x20(%rsp),%rax
  movsd  %xmm0,-0x8(%r12,%rax,1)
  movsd  0x8(%r12),%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,0x8(%r12)
  sub    $0x2,%r13d
  movslq %r13d,%rax
  lea    0x1(%r13,%r13,1),%edx
  movslq %edx,%rdx
  lea    (%r12,%rdx,8),%rdx
L199:
  movsd  (%r12,%rax,8),%xmm0
  addsd  0x8(%r12,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  (%r12,%rax,8),%xmm0
  subsd  0x8(%r12,%rax,8),%xmm0
  movsd  %xmm0,-0x10(%rdx)
  sub    $0x2,%rax
  sub    $0x20,%rdx
  cmp    $0x1,%eax
  jg     L199
L211:
  cmp    $0x1,%ebp
  jle    L239
  mov    $0x2,%r13d
  mov    0x18(%rsp),%rax
  add    $0x8,%rax
  mov    %rax,0x18(%rsp)
  jmp    L13
L205:
  mov    0x18(%rsp),%rax
  lea    0x8(%rax),%rdx
  mov    0x10(%rsp),%r8
  mov    0xc(%rsp),%ecx
  mov    %r12,%rsi
  mov    $0x4,%edi
  call   <cftfsub@plt>
  jmp    L74
L161:
  mov    0x10(%rsp),%r8
  mov    0xc(%rsp),%ecx
  mov    0x18(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <cftfsub@plt>
  mov    (%rsp),%rcx
  mov    %r15d,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <rftfsub@plt>
L48:
  mov    %r14d,%eax
  sub    %r13d,%eax
  cltq
  movsd  (%rbx),%xmm0
  subsd  0x8(%rbx),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  movslq %r13d,%rax
  movsd  0x8(%rbx),%xmm0
  addsd  (%rbx),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
L5:
  lea    0x0(,%r13,4),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  movslq %r13d,%rcx
  sub    %rcx,%rax
  lea    (%r12,%rax,8),%rdx
  shl    $0x4,%rcx
  mov    $0x2,%eax
L233:
  movsd  (%rbx,%rax,8),%xmm0
  subsd  0x8(%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  (%rbx,%rax,8),%xmm0
  addsd  0x8(%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rcx,1)
  add    $0x2,%rax
  add    %rsi,%rdx
  cmp    %eax,%ebp
  jg     L233
  add    %r13d,%r13d
  mov    %ebp,%esi
  sar    %esi
L95:
  lea    0x0(%rbp,%rbp,1),%eax
  cltq
  lea    (%rbx,%rax,8),%rcx
  mov    %rcx,%rdx
  movslq %ebp,%rdi
  neg    %rdi
  shl    $0x3,%rdi
  add    %rdi,%rcx
  mov    $0x0,%eax
L228:
  movsd  (%rdx),%xmm0
  subsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  movsd  (%rdx),%xmm0
  addsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rdi,1)
  add    $0x1,%rax
  sub    $0x8,%rdx
  cmp    %eax,%esi
  jg     L228
  add    %esi,%ebp
  movslq %ebp,%rbp
  movsd  (%rbx,%rbp,8),%xmm0
  movslq %esi,%rax
  movsd  %xmm0,(%rbx,%rax,8)
  cmp    $0x1,%esi
  jle    L234
  mov    %esi,%ebp
L13:
  mov    (%rsp),%rcx
  mov    %r15d,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <dctsub@plt>
  cmp    $0x4,%ebp
  jg     L161
  je     L20
  mov    %r14d,%eax
  sub    %r13d,%eax
  cltq
  movsd  (%rbx),%xmm0
  subsd  0x8(%rbx),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  movslq %r13d,%rax
  movsd  (%rbx),%xmm0
  addsd  0x8(%rbx),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  cmp    $0x2,%ebp
  jg     L5
  add    %r13d,%r13d
  mov    %ebp,%esi
  sar    %esi
  test   %esi,%esi
  jg     L95
  lea    (%rsi,%rbp,1),%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  movslq %esi,%rsi
  movsd  %xmm0,(%rbx,%rsi,8)
L234:
  movsd  (%rbx),%xmm0
  movslq %r13d,%r13
  movsd  %xmm0,(%r12,%r13,8)
  movsd  0x10(%rbx),%xmm0
  subsd  0x8(%rbx),%xmm0
  mov    0x28(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  0x10(%rbx),%xmm0
  addsd  0x8(%rbx),%xmm0
L38:
  movsd  %xmm0,(%r12)
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L20:
  mov    0x10(%rsp),%r8
  mov    0xc(%rsp),%ecx
  mov    0x18(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x4,%edi
  call   <cftfsub@plt>
  jmp    L48
L239:
  mov    $0x2,%r13d
  jmp    L234
L71:
  movsd  (%r12),%xmm0
  movsd  %xmm0,0x8(%r12)
  movsd  (%rbx),%xmm0
  movsd  %xmm0,0x10(%r12)
  movsd  0x8(%rbx),%xmm0
  jmp    L38
```

assistant: ```c
void dfct(int n, double *a, double *t, int *ip, double *w) {
  void makewt(int nw, int *ip, double *w);
  void makect(int nc, int *ip, double *c);
  void cftfsub(int n, double *a, int *ip, int nw, double *w);
  void rftfsub(int n, double *a, int nc, double *c);
  void dctsub(int n, double *a, int nc, double *c);
  int j, k, l, m, mh, nw, nc;
  double xr, xi, yr, yi;
  nw = ip[0];
  if (n > (nw << 3)) {
    nw = n >> 3;
    makewt(nw, ip, w);
  }
  nc = ip[1];
  if (n > (nc << 1)) {
    nc = n >> 1;
    makect(nc, ip, w + nw);
  }
  m = n >> 1;
  yi = a[m];
  xi = a[0] + a[n];
  a[0] -= a[n];
  t[0] = xi - yi;
  t[m] = xi + yi;
  if (n > 2) {
    mh = m >> 1;
    for (j = 1; j < mh; j++) {
      k = m - j;
      xr = a[j] - a[n - j];
      xi = a[j] + a[n - j];
      yr = a[k] - a[n - k];
      yi = a[k] + a[n - k];
      a[j] = xr;
      a[k] = yr;
      t[j] = xi - yi;
      t[k] = xi + yi;
    }
    t[mh] = a[mh] + a[n - mh];
    a[mh] -= a[n - mh];
    dctsub(m, a, nc, w + nw);
    if (m > 4) {
      cftfsub(m, a, ip + 2, nw, w);
      rftfsub(m, a, nc, w + nw);
    } else if (m == 4) {
      cftfsub(m, a, ip + 2, nw, w);
    }
    a[n - 1] = a[0] - a[1];
    a[1] = a[0] + a[1];
    for (j = m - 2; j >= 2; j -= 2) {
      a[2 * j + 1] = a[j] + a[j + 1];
      a[2 * j - 1] = a[j] - a[j + 1];
    }
    l = 2;
    m = mh;
    while (m >= 2) {
      dctsub(m, t, nc, w + nw);
      if (m > 4) {
        cftfsub(m, t, ip + 2, nw, w);
        rftfsub(m, t, nc, w + nw);
      } else if (m == 4) {
        cftfsub(m, t, ip + 2, nw, w);
      }
      a[n - l] = t[0] - t[1];
      a[l] = t[0] + t[1];
      k = 0;
      for (j = 2; j < m; j += 2) {
        k += l << 2;
        a[k - l] = t[j] - t[j + 1];
        a[k + l] = t[j] + t[j + 1];
      }
      l <<= 1;
      mh = m >> 1;
      for (j = 0; j < mh; j++) {
        k = m - j;
        t[j] = t[m + k] - t[m + j];
        t[k] = t[m + k] + t[m + j];
      }
      t[mh] = t[m + mh];
      m = mh;
    }
    a[l] = t[0];
    a[n] = t[2] - t[1];
    a[0] = t[2] + t[1];
  } else {
    a[1] = a[0];
    a[2] = t[0];
    a[0] = t[1];
  }
}
```