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

```asm
<dct>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rsi,%r13
  mov    %edx,%esi
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x68,%rsp
  mov    %rcx,0x18(%rsp)
  mov    %edx,%ecx
  shl    %cl,%eax
  mov    %edx,0x38(%rsp)
  movslq %eax,%rdx
  mov    %eax,%ebp
  lea    -0x8(,%rdx,8),%rcx
  sar    %ebp
  cvttsd2si (%rbx),%edx
  movslq %ebp,%rdi
  mov    %rcx,0x28(%rsp)
  lea    (%r14,%rcx,1),%r15
  mov    %rdi,0x20(%rsp)
  shl    $0x3,%rdi
  mov    %rdi,0x30(%rsp)
  lea    0x0(%r13,%rdi,1),%r12
  cmp    %eax,%edx
  je     L34
  mov    $0x2,%eax
  mov    %esi,%ecx
  pxor   %xmm0,%xmm0
  add    %rdi,%rbx
  shl    %cl,%eax
  movsd  D33(%rip),%xmm1
  cvtsi2sd %eax,%xmm0
  mov    %rbx,%rax
  lea    (%rbx,%rdi,1),%rbx
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rsp)
  test   %ebp,%ebp
  jle    L68
  pxor   %xmm2,%xmm2
  lea    0x58(%rsp),%rdi
  mov    %ebp,0x3c(%rsp)
  movsd  D32(%rip),%xmm0
  mov    %r12,0x40(%rsp)
  mov    %rbx,%rbp
  movapd %xmm2,%xmm3
  mov    %rax,%r12
  mov    %r13,0x48(%rsp)
  mov    %rbx,%r13
  mov    %rdi,%rbx
  jmp    L54
  nop
L76:
  movapd %xmm3,%xmm0
  lea    0x50(%rsp),%rsi
  mov    %rbx,%rdi
  movsd  %xmm3,0x8(%rsp)
  call   <sincos@plt>
  movsd  0x50(%rsp),%xmm0
  movsd  0x58(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
L54:
  movapd %xmm0,%xmm1
  addsd  %xmm2,%xmm0
  add    $0x8,%r12
  add    $0x8,%r13
  mulsd  D4(%rip),%xmm0
  subsd  %xmm2,%xmm1
  addsd  0x10(%rsp),%xmm3
  mulsd  D4(%rip),%xmm1
  movsd  %xmm1,-0x8(%r12)
  movsd  %xmm0,-0x8(%r13)
  cmp    %rbp,%r12
  jne    L76
  mov    0x3c(%rsp),%ebp
  mov    0x40(%rsp),%r12
  mov    0x48(%rsp),%r13
L3:
  mov    %r15,%rcx
  mov    %r14,%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L6:
  movsd  (%rdx),%xmm0
  sub    $0x10,%rcx
  add    $0x10,%rdx
  movsd  %xmm0,0x0(%r13,%rax,8)
  movsd  0x10(%rcx),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L6
  mov    0x18(%rsp),%rbx
  mov    0x38(%rsp),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  call   <hartley@plt>
  movsd  0x0(%r13),%xmm0
  mov    0x20(%rsp),%rax
  mov    0x28(%rsp),%rdx
  movsd  %xmm0,(%r14)
  movsd  (%r12),%xmm0
  add    %r13,%rdx
  movsd  %xmm0,(%r14,%rax,8)
  mov    0x30(%rsp),%rax
  lea    0x8(%rbx,%rax,1),%rcx
  lea    (%rcx,%rax,1),%rbx
  cmp    $0x1,%ebp
  jle    L46
  lea    -0x1(%rbp),%esi
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L40:
  movsd  (%rcx,%rax,8),%xmm0
  movsd  (%rbx,%rax,8),%xmm1
  sub    $0x8,%rdx
  sub    $0x8,%r15
  mulsd  0x8(%rdx),%xmm1
  mulsd  0x8(%r13,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%r14,%rax,8)
  movsd  (%rbx,%rax,8),%xmm0
  movsd  (%rcx,%rax,8),%xmm1
  mulsd  0x8(%r13,%rax,8),%xmm0
  add    $0x1,%rax
  mulsd  0x8(%rdx),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%r15)
  cmp    %rsi,%rax
  jne    L40
L46:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L34:
  test   %ebp,%ebp
  jg     L3
L68:
  mov    0x18(%rsp),%rdx
  mov    0x38(%rsp),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <hartley@plt>
  movsd  0x0(%r13),%xmm0
  mov    0x20(%rsp),%rax
  movsd  %xmm0,(%r14)
  movsd  (%r12),%xmm0
  movsd  %xmm0,(%r14,%rax,8)
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: label: D33
type_guessed: f64
name: disassemble_data
arguments: label: D32
type_guessed: byte[8]
name: disassemble_data
arguments: label: D4
type_guessed: f64

tool: D33: 3.141592652598793

tool: {"D32": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D4: 0.707106781186547

assistant: ```c
void dct(x, y, m, tab) double *x, *y, *tab;
int m;
{
  int n, n2, i;
  double *cp1, *cp2, *xp1, *xp2, *yp1, *yp2;
  double arg, delta_w;
  n = 1 << m;
  n2 = n >> 1;
  if ((int)(*tab) != n) {
    delta_w = 3.141592652598793 / (2 * n);
    cp1 = tab + n2;
    cp2 = cp1 + n2;
    arg = 0;
    for (i = 0; i < n2; i++) {
      *(cp1++) = (double)(cos(arg) - sin(arg)) * 0.707106781186547;
      *(cp2++) = (double)(cos(arg) + sin(arg)) * 0.707106781186547;
      arg += delta_w;
    }
  }
  xp1 = x;
  xp2 = x + (n - 1);
  yp1 = y;
  yp2 = y + n2;
  for (i = 0; i < n2; i++) {
    *(yp1++) = *xp1;
    *(yp2++) = *xp2;
    xp1 += 2;
    xp2 -= 2;
  }
  hartley(y, m, tab);
  *x = *y;
  *(x + n2) = *(y + n2);
  cp1 = tab + n2 + 1;
  cp2 = cp1 + n2;
  xp1 = x + 1;
  xp2 = x + (n - 1);
  yp1 = y + 1;
  yp2 = y + (n - 1);
  for (i = 1; i < n2; i++) {
    *(xp1++) = (*cp1) * (*yp1) + (*cp2) * (*yp2);
    *(xp2--) = (*cp2++) * (*yp1++) - (*cp1++) * (*yp2--);
  }
}
```