user: Translate the below assembly code into C programming language:

```asm
<lsx_ddct>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  shl    $0x2,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L11
  mov    -0x24(%rbp),%eax
  sar    $0x2,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0x10(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <makewt@plt>
L11:
  mov    -0x38(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x24(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L5
  mov    -0x24(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <makect@plt>
L5:
  cmpl   $0x0,-0x28(%rbp)
  jns    L61
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x24(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L78
L134:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  subl   $0x2,-0x14(%rbp)
L78:
  cmpl   $0x1,-0x14(%rbp)
  jg     L134
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  addsd  -0x8(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  movsd  %xmm0,(%rax)
  cmpl   $0x4,-0x24(%rbp)
  jle    L51
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <rftbsub@plt>
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rcx
  mov    -0x30(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <bitrv2@plt>
  mov    -0x40(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <cftbsub@plt>
  jmp    L61
L51:
  cmpl   $0x4,-0x24(%rbp)
  jne    L61
  mov    -0x40(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <cftfsub@plt>
L61:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <dctsub@plt>
  cmpl   $0x0,-0x28(%rbp)
  js     L59
  cmpl   $0x4,-0x24(%rbp)
  jle    L54
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rcx
  mov    -0x30(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <bitrv2@plt>
  mov    -0x40(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <cftfsub@plt>
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <rftfsub@plt>
  jmp    L108
L54:
  cmpl   $0x4,-0x24(%rbp)
  jne    L108
  mov    -0x40(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <cftfsub@plt>
L108:
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x2,-0x14(%rbp)
  jmp    L25
L120:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x2,-0x14(%rbp)
L25:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L120
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L59:
  nop
  leave
  ret
```

assistant: ```c
void lsx_ddct(int n, int isgn, double *a, int *ip, double *w) {
  int j, nw, nc;
  double xr;
  nw = ip[0];
  if (n > (nw << 2)) {
    nw = n >> 2;
    makewt(nw, ip, w);
  }
  nc = ip[1];
  if (n > nc) {
    nc = n;
    makect(nc, ip, w + nw);
  }
  if (isgn < 0) {
    xr = a[n - 1];
    for (j = n - 2; j >= 2; j -= 2) {
      a[j + 1] = a[j] - a[j - 1];
      a[j] += a[j - 1];
    }
    a[1] = a[0] - xr;
    a[0] += xr;
    if (n > 4) {
      rftbsub(n, a, nc, w + nw);
      bitrv2(n, ip + 2, a);
      cftbsub(n, a, w);
    } else if (n == 4) {
      cftfsub(n, a, w);
    }
  }
  dctsub(n, a, nc, w + nw);
  if (isgn >= 0) {
    if (n > 4) {
      bitrv2(n, ip + 2, a);
      cftfsub(n, a, w);
      rftfsub(n, a, nc, w + nw);
    } else if (n == 4) {
      cftfsub(n, a, w);
    }
    xr = a[0] - a[1];
    a[0] += a[1];
    for (j = 2; j < n; j += 2) {
      a[j - 1] = a[j] - a[j + 1];
      a[j] += a[j + 1];
    }
    a[n - 1] = xr;
  }
}
```