user: Please show me the C implementation that matches the assembly code listed below:

```asm
<dfct>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x58,%rsp
  mov    (%rcx),%eax
  mov    %edi,0x18(%rsp)
  mov    %eax,0x34(%rsp)
  shl    $0x3,%eax
  mov    %rcx,0x28(%rsp)
  mov    %r8,0x38(%rsp)
  cmp    %edi,%eax
  jl     L150
L143:
  mov    0x28(%rsp),%rax
  mov    0x18(%rsp),%edi
  mov    0x4(%rax),%eax
  mov    %edi,%r14d
  sar    %r14d
  mov    %eax,0x1c(%rsp)
  add    %eax,%eax
  cmp    %edi,%eax
  jl     L3
L107:
  movslq 0x18(%rsp),%r12
  movsd  0x0(%rbp),%xmm1
  movslq %r14d,%rdx
  movsd  0x0(%rbp,%rdx,8),%xmm0
  lea    0x0(,%rdx,8),%rax
  mov    %r12,%rdi
  shl    $0x3,%r12
  movapd %xmm1,%xmm2
  lea    0x0(%rbp,%r12,1),%rcx
  movsd  (%rcx),%xmm3
  mov    %rcx,0x40(%rsp)
  addsd  %xmm3,%xmm2
  subsd  %xmm3,%xmm1
  movsd  %xmm1,0x0(%rbp)
  movapd %xmm2,%xmm1
  subsd  %xmm0,%xmm1
  addsd  %xmm2,%xmm0
  movsd  %xmm1,(%rbx)
  movsd  %xmm0,(%rbx,%rdx,8)
  cmp    $0x2,%edi
  jle    L33
  mov    %edi,%r15d
  sar    $0x2,%r15d
  cmp    $0x7,%edi
  jle    L64
  movslq %r15d,%rsi
  mov    %r12,%rcx
  lea    -0x8(,%rdx,8),%rdx
  mov    %rsi,0x8(%rsp)
  sub    %rax,%rcx
  mov    $0x1,%eax
  add    %rbp,%rcx
  nopl   0x0(%rax)
L184:
  movsd  0x0(%rbp,%rax,8),%xmm2
  movsd  (%rcx,%rdx,1),%xmm5
  movsd  0x0(%rbp,%rdx,1),%xmm1
  movsd  (%rcx,%rax,8),%xmm4
  movapd %xmm2,%xmm0
  subsd  %xmm5,%xmm2
  addsd  %xmm5,%xmm0
  movapd %xmm1,%xmm3
  subsd  %xmm4,%xmm1
  addsd  %xmm4,%xmm3
  movsd  %xmm2,0x0(%rbp,%rax,8)
  movsd  %xmm1,0x0(%rbp,%rdx,1)
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  addsd  %xmm3,%xmm0
  movsd  %xmm1,(%rbx,%rax,8)
  add    $0x1,%rax
  movsd  %xmm0,(%rbx,%rdx,1)
  sub    $0x8,%rdx
  cmp    %rax,%rsi
  jne    L184
L37:
  mov    0x18(%rsp),%edx
  mov    0x8(%rsp),%rdi
  mov    %rbp,%rsi
  lea    -0x8(%rbp,%r12,1),%r13
  lea    -0x2(%r14),%r12d
  sub    %r15d,%edx
  lea    0x0(%rbp,%rdi,8),%rax
  movslq %edx,%rdx
  movsd  (%rax),%xmm0
  lea    0x0(%rbp,%rdx,8),%rdx
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rbx,%rdi,8)
  movsd  (%rax),%xmm0
  subsd  (%rdx),%xmm0
  mov    0x38(%rsp),%rdi
  mov    0x1c(%rsp),%edx
  movsd  %xmm0,(%rax)
  movslq 0x34(%rsp),%rax
  lea    (%rdi,%rax,8),%rax
  mov    %r14d,%edi
  mov    %rax,%rcx
  mov    %rax,0x20(%rsp)
  call   <dctsub@plt>
  cmp    $0x4,%r14d
  jg     L199
  je     L176
  movsd  0x0(%rbp),%xmm0
  subsd  0x8(%rbp),%xmm0
  movsd  %xmm0,0x0(%r13)
  movsd  0x8(%rbp),%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x8(%rbp)
  cmp    $0x1,%r12d
  jle    L70
L147:
  lea    0x1(%r12,%r12,1),%edx
  movslq %r12d,%rax
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
  nopw   0x0(%rax,%rax,1)
L94:
  movsd  0x0(%rbp,%rax,8),%xmm0
  addsd  0x8(%rbp,%rax,8),%xmm0
  sub    $0x20,%rdx
  movsd  %xmm0,0x20(%rdx)
  movsd  0x0(%rbp,%rax,8),%xmm0
  subsd  0x8(%rbp,%rax,8),%xmm0
  sub    $0x2,%rax
  movsd  %xmm0,0x10(%rdx)
  cmp    $0x1,%eax
  jg     L94
L70:
  lea    0x10(%rbx),%rax
  mov    $0x2,%r12d
  mov    %rax,(%rsp)
  lea    0x8(%rbx),%rax
  mov    %rax,0x48(%rsp)
  mov    $0x10,%eax
  cmp    $0x1,%r15d
  jle    L137
  nopl   (%rax)
L179:
  mov    0x20(%rsp),%rcx
  mov    0x1c(%rsp),%edx
  mov    %rbx,%rsi
  mov    %r15d,%edi
  call   <dctsub@plt>
  mov    0x18(%rsp),%eax
  sub    %r12d,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%r14
  movslq %r12d,%rax
  mov    %rax,0x10(%rsp)
  lea    0x0(%rbp,%rax,8),%r13
  cmp    $0x4,%r15d
  jg     L238
  je     L204
  movsd  (%rbx),%xmm0
  subsd  0x8(%rbx),%xmm0
  movsd  %xmm0,(%r14)
  movsd  (%rbx),%xmm0
  addsd  0x8(%rbx),%xmm0
  movsd  %xmm0,0x0(%r13)
  cmp    $0x3,%r15d
  jne    L114
  lea    0x0(,%r12,4),%eax
  cltq
  lea    0x0(,%rax,8),%rdi
  sub    0x10(%rsp),%rax
  shl    $0x3,%rax
L142:
  mov    0x10(%rsp),%rcx
  add    %rbp,%rax
  mov    $0x2,%edx
  shl    $0x4,%rcx
  cs nopw 0x0(%rax,%rax,1)
L119:
  movsd  (%rbx,%rdx,8),%xmm0
  subsd  0x8(%rbx,%rdx,8),%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rbx,%rdx,8),%xmm0
  addsd  0x8(%rbx,%rdx,8),%xmm0
  add    $0x2,%rdx
  movsd  %xmm0,(%rax,%rcx,1)
  add    %rdi,%rax
  cmp    %edx,%r15d
  jg     L119
  nopl   0x0(%rax,%rax,1)
L114:
  mov    0x8(%rsp),%rdi
  mov    %r15d,%esi
  mov    %rbx,%rax
  add    %r12d,%r12d
  sar    %esi
  mov    %rdi,%rcx
  lea    0x10(,%rdi,8),%r11
  shl    $0x4,%rdi
  movslq %esi,%r10
  neg    %rcx
  mov    %rdi,%rdx
  lea    0x0(,%r10,8),%r9
  shl    $0x3,%rcx
  sub    %rcx,%rax
  cmp    $0xfffffffffffffff8,%rcx
  setne  %r8b
  cmp    $0x1,%esi
  setne  %dil
  and    %r8d,%edi
  cmp    (%rsp),%rax
  setae  %r8b
  and    %r8d,%edi
  mov    $0x8,%r8d
  sub    %rcx,%r8
  sub    %r9,%r8
  cmp    %r9,%r8
  setge  %r8b
  test   %r8b,%dil
  je     L47
  lea    0x8(%rdx),%rdi
  sub    %r9,%rdi
  cmp    %r9,%rdi
  jl     L47
  mov    %rbx,%r8
  lea    -0x8(%rbx,%rdx,1),%rdx
  mov    %rbx,%r9
  sub    %rcx,%r8
  lea    -0x18(%r8),%rcx
  lea    -0x8(%r8),%rdi
  mov    %esi,%r8d
  shr    %r8d
  lea    -0x1(%r8),%r11d
  mov    %rcx,%r8
  shl    $0x4,%r11
  sub    %r11,%r8
  jmp    L294
  nopl   0x0(%rax)
L241:
  sub    $0x10,%rcx
L294:
  movupd (%rdx),%xmm0
  movupd (%rax),%xmm7
  sub    $0x10,%rdx
  add    $0x10,%rax
  add    $0x10,%r9
  shufpd $0x1,%xmm0,%xmm0
  subpd  %xmm7,%xmm0
  movups %xmm0,-0x10(%r9)
  movupd 0x10(%rdx),%xmm0
  movupd -0x10(%rax),%xmm5
  shufpd $0x1,%xmm0,%xmm0
  addpd  %xmm5,%xmm0
  shufpd $0x1,%xmm0,%xmm0
  movups %xmm0,(%rdi)
  mov    %rcx,%rdi
  cmp    %r8,%rcx
  jne    L241
  mov    %esi,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%sil
  je     L286
  mov    %r15d,%edx
  lea    (%r15,%rax,1),%edi
  sub    %eax,%edx
  movslq %edi,%rdi
  lea    (%r15,%rdx,1),%ecx
  lea    (%rbx,%rdi,8),%rdi
  movslq %edx,%rdx
  movslq %ecx,%rcx
  lea    (%rbx,%rcx,8),%rcx
  movsd  (%rcx),%xmm0
  subsd  (%rdi),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  movsd  (%rdi),%xmm0
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rbx,%rdx,8)
L286:
  add    %esi,%r15d
  movslq %r15d,%r15
  movsd  (%rbx,%r15,8),%xmm0
  movsd  %xmm0,(%rbx,%r10,8)
L80:
  movslq %esi,%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%r15
  jmp    L179
  xchg   %ax,%ax
L33:
  movsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x8(%rbp)
  movsd  (%rbx),%xmm0
  movsd  %xmm0,0x10(%rbp)
  movsd  0x8(%rbx),%xmm0
L202:
  movsd  %xmm0,0x0(%rbp)
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L238:
  mov    0x28(%rsp),%rax
  mov    0x34(%rsp),%ecx
  mov    %rbx,%rsi
  mov    %r15d,%edi
  mov    0x38(%rsp),%r8
  lea    0x8(%rax),%rdx
  call   <cftfsub@plt>
  mov    0x20(%rsp),%rcx
  mov    %rbx,%rsi
  mov    %r15d,%edi
  mov    0x1c(%rsp),%edx
  call   <rftfsub@plt>
L251:
  movsd  (%rbx),%xmm0
  subsd  0x8(%rbx),%xmm0
  lea    0x0(,%r12,4),%r8d
  movslq %r8d,%rcx
  mov    0x10(%rsp),%rax
  lea    0x0(,%rcx,8),%rdi
  movsd  %xmm0,(%r14)
  mov    %rcx,%r14
  lea    (%rcx,%rax,1),%rdx
  movsd  0x8(%rbx),%xmm0
  sub    %rax,%r14
  lea    -0x3(%r15),%eax
  shl    $0x3,%rdx
  addsd  (%rbx),%xmm0
  shr    %eax
  lea    0x1(%rax),%esi
  mov    $0x18,%eax
  mov    %esi,0x30(%rsp)
  sub    $0x1,%rsi
  mov    %rsi,%r9
  movsd  %xmm0,0x0(%r13)
  shl    $0x4,%r9
  add    $0x18,%r9
  cmp    $0x2,%r15d
  cmovle %rax,%r9
  xor    %eax,%eax
  mov    %rax,%r10
  add    %rbx,%r9
  cmp    $0x2,%r15d
  cmovle %rax,%rsi
  imul   %rdi,%rsi
  test   %r8d,%r8d
  cmovs  %rsi,%r10
  cmovs  %rax,%rsi
  lea    0x0(,%r14,8),%rax
  lea    (%rsi,%rdx,1),%r11
  add    %rbp,%r11
  cmp    %r11,(%rsp)
  lea    (%r10,%rdx,1),%r11
  seta   %r13b
  add    %rbp,%r11
  cmp    %r11,%r9
  setb   %r11b
  add    %rcx,%r14
  shl    $0x3,%r14
  or     %r11d,%r13d
  cmp    %rdx,%r14
  setne  %r11b
  cmp    $0x16,%r15d
  setg   %r14b
  and    %r14d,%r11d
  test   %r11b,%r13b
  je     L142
  add    %rax,%rsi
  add    %rbp,%rsi
  cmp    %rsi,(%rsp)
  seta   %sil
  add    %rax,%r10
  add    %rbp,%r10
  cmp    %r10,%r9
  setb   %r9b
  or     %sil,%r9b
  je     L142
  cmp    $0x2,%r15d
  mov    $0x1,%r9d
  cmovg  0x30(%rsp),%r9d
  mov    (%rsp),%rsi
  shl    $0x4,%rcx
  add    %rbp,%rax
  add    %rbp,%rdx
  mov    %r9d,%r10d
  shr    %r10d
  sub    $0x1,%r10d
  shl    $0x5,%r10
  lea    0x30(%rbx,%r10,1),%r10
  nopl   0x0(%rax,%rax,1)
L40:
  movupd (%rsi),%xmm0
  movupd 0x10(%rsi),%xmm1
  add    $0x20,%rsi
  movlpd -0x18(%rsi),%xmm1
  movhpd -0x10(%rsi),%xmm0
  subpd  %xmm1,%xmm0
  movlpd %xmm0,(%rax)
  movhpd %xmm0,(%rax,%rdi,1)
  movupd -0x20(%rsi),%xmm0
  movupd -0x10(%rsi),%xmm1
  add    %rcx,%rax
  movlpd -0x18(%rsi),%xmm1
  movhpd -0x10(%rsi),%xmm0
  addpd  %xmm1,%xmm0
  movlpd %xmm0,(%rdx)
  movhpd %xmm0,(%rdx,%rdi,1)
  add    %rcx,%rdx
  cmp    %r10,%rsi
  jne    L40
  mov    %r9d,%ecx
  mov    %r9d,%edx
  mov    %r8d,%eax
  and    $0xfffffffe,%ecx
  or     $0x1,%edx
  imul   %ecx,%eax
  add    %edx,%edx
  cmp    %ecx,%r9d
  je     L114
  movslq %edx,%rdx
  add    %r8d,%eax
  lea    (%rbx,%rdx,8),%rcx
  lea    0x8(%rbx,%rdx,8),%rdx
  mov    %eax,%esi
  add    %r12d,%eax
  movsd  (%rcx),%xmm0
  subsd  (%rdx),%xmm0
  sub    %r12d,%esi
  cltq
  movslq %esi,%rsi
  movsd  %xmm0,0x0(%rbp,%rsi,8)
  movsd  (%rcx),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  jmp    L114
  nopw   0x0(%rax,%rax,1)
L47:
  lea    -0x10(%rbx,%r11,1),%rax
  mov    0x48(%rsp),%r11
  lea    -0x1(%rsi),%edi
  add    %rbx,%rdx
  add    0x8(%rsp),%rdi
  lea    (%r11,%rdi,8),%rdi
  nopl   0x0(%rax)
L158:
  movsd  (%rdx),%xmm0
  subsd  (%rax),%xmm0
  add    $0x8,%rax
  sub    $0x8,%rdx
  movsd  %xmm0,-0x8(%rax,%rcx,1)
  movsd  -0x8(%rax),%xmm0
  addsd  0x8(%rdx),%xmm0
  movsd  %xmm0,0x8(%rdx,%rcx,1)
  cmp    %rax,%rdi
  jne    L158
  add    %esi,%r15d
  movslq %r15d,%r15
  movsd  (%rbx,%r15,8),%xmm0
  movsd  %xmm0,(%rbx,%r10,8)
  cmp    $0x1,%esi
  jne    L80
  movslq %r12d,%rax
  shl    $0x3,%rax
L137:
  movsd  (%rbx),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,1)
  movsd  0x10(%rbx),%xmm0
  subsd  0x8(%rbx),%xmm0
  mov    0x40(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  0x10(%rbx),%xmm0
  addsd  0x8(%rbx),%xmm0
  jmp    L202
  nopl   0x0(%rax)
L204:
  mov    0x28(%rsp),%rax
  mov    0x38(%rsp),%r8
  mov    %rbx,%rsi
  mov    $0x4,%edi
  mov    0x34(%rsp),%ecx
  lea    0x8(%rax),%rdx
  call   <cftfsub@plt>
  jmp    L251
L3:
  mov    0x38(%rsp),%rdi
  movslq 0x34(%rsp),%rax
  mov    0x28(%rsp),%rsi
  lea    (%rdi,%rax,8),%rdx
  mov    %r14d,%edi
  call   <makect@plt>
  mov    %r14d,0x1c(%rsp)
  jmp    L107
L150:
  mov    %edi,%eax
  mov    %r8,%rdx
  mov    %rcx,%rsi
  sar    $0x3,%eax
  mov    %eax,%edi
  mov    %eax,0x34(%rsp)
  call   <makewt@plt>
  jmp    L143
L64:
  movslq %r15d,%rax
  mov    %rax,0x8(%rsp)
  jmp    L37
L199:
  mov    0x28(%rsp),%rax
  mov    0x34(%rsp),%ecx
  mov    %rbp,%rsi
  mov    %r14d,%edi
  mov    0x38(%rsp),%r8
  lea    0x8(%rax),%rdx
  call   <cftfsub@plt>
  mov    0x20(%rsp),%rcx
  mov    %rbp,%rsi
  mov    %r14d,%edi
  mov    0x1c(%rsp),%edx
  call   <rftfsub@plt>
L185:
  movsd  0x0(%rbp),%xmm0
  subsd  0x8(%rbp),%xmm0
  movsd  %xmm0,0x0(%r13)
  movsd  0x8(%rbp),%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x8(%rbp)
  jmp    L147
L176:
  mov    0x28(%rsp),%rax
  mov    0x38(%rsp),%r8
  mov    %rbp,%rsi
  mov    $0x4,%edi
  mov    0x34(%rsp),%ecx
  lea    0x8(%rax),%rdx
  call   <cftfsub@plt>
  jmp    L185
```

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];
  }
}
```