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

```asm
<jpegdct>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movw   $0x1,-0x78(%rbp)
  movw   $0x0,-0x76(%rbp)
  movw   $0xd,-0x74(%rbp)
  movw   $0x8,-0x72(%rbp)
  jmp    L49
L9:
  movw   $0x0,-0x7c(%rbp)
  jmp    L59
L47:
  movw   $0x0,-0x7a(%rbp)
  jmp    L57
L52:
  movswl -0x78(%rbp),%edx
  movswl -0x7a(%rbp),%eax
  imul   %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  movswl %ax,%ecx
  movswl -0x78(%rbp),%eax
  movswl -0x7a(%rbp),%esi
  mov    $0x7,%edx
  sub    %esi,%edx
  imul   %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cwtl
  lea    (%rcx,%rax,1),%edx
  movswl -0x7a(%rbp),%eax
  movslq %edx,%rdx
  cltq
  mov    %rdx,-0x70(%rbp,%rax,8)
  movswl -0x78(%rbp),%edx
  movswl -0x7a(%rbp),%eax
  imul   %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cwtl
  movswl -0x78(%rbp),%edx
  movswl -0x7a(%rbp),%esi
  mov    $0x7,%ecx
  sub    %esi,%ecx
  imul   %ecx,%edx
  movslq %edx,%rdx
  lea    (%rdx,%rdx,1),%rcx
  mov    -0x88(%rbp),%rdx
  add    %rcx,%rdx
  movzwl (%rdx),%edx
  movswl %dx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  movswl -0x7a(%rbp),%ecx
  mov    $0x7,%eax
  sub    %ecx,%eax
  movslq %edx,%rdx
  cltq
  mov    %rdx,-0x70(%rbp,%rax,8)
  movzwl -0x7a(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x7a(%rbp)
L57:
  cmpw   $0x3,-0x7a(%rbp)
  jle    L52
  mov    -0x70(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x70(%rbp),%rax
  mov    -0x58(%rbp),%rdx
  sub    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x68(%rbp),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x68(%rbp),%rax
  mov    -0x60(%rbp),%rdx
  sub    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movswl -0x76(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%rdx
  mov    %rdx,%rax
  mov    %eax,%edx
  mov    -0x88(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    -0x20(%rbp),%rcx
  sub    %rcx,%rax
  mov    %rax,%rdx
  movswl -0x76(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%rdx
  movswl -0x78(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    (%rax,%rax,1),%rcx
  mov    -0x88(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  mov    -0x90(%rbp),%rax
  add    $0x14,%rax
  movzwl (%rax),%eax
  cwtl
  imul   %edx,%eax
  cltq
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %eax,%esi
  mov    -0x28(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  add    $0x12,%rax
  movzwl (%rax),%eax
  movswq %ax,%rax
  imul   %rax,%rdx
  movswl -0x74(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%rdx
  mov    %rdx,%rax
  lea    (%rsi,%rax,1),%edx
  movswl -0x78(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    (%rax,%rax,1),%rcx
  mov    -0x88(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    %eax,%esi
  mov    -0x18(%rbp),%rdx
  mov    -0x90(%rbp),%rax
  add    $0x16,%rax
  movzwl (%rax),%eax
  movswq %ax,%rax
  imul   %rax,%rdx
  movswl -0x74(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%rdx
  mov    %rdx,%rax
  lea    (%rsi,%rax,1),%ecx
  movswl -0x78(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  mov    -0x90(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  cwtl
  imul   %edx,%eax
  cltq
  mov    %rax,-0x70(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %eax,%edx
  mov    -0x40(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  mov    -0x90(%rbp),%rax
  movzwl (%rax),%eax
  cwtl
  imul   %edx,%eax
  cltq
  mov    %rax,-0x68(%rbp)
  mov    -0x50(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x48(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  mov    -0x90(%rbp),%rax
  add    $0x10,%rax
  movzwl (%rax),%eax
  cwtl
  imul   %edx,%eax
  cltq
  mov    %rax,-0x30(%rbp)
  mov    -0x60(%rbp),%rax
  movswl %ax,%edx
  mov    -0x90(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  cwtl
  imul   %edx,%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x58(%rbp),%rax
  movswl %ax,%edx
  mov    -0x90(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  cwtl
  imul   %edx,%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %eax,%edx
  mov    -0x90(%rbp),%rax
  add    $0x8,%rax
  movzwl (%rax),%eax
  imul   %eax,%edx
  mov    -0x70(%rbp),%rax
  add    %eax,%edx
  mov    -0x60(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  movswl -0x74(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%ecx
  movswl -0x78(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    %eax,%edx
  mov    -0x90(%rbp),%rax
  add    $0xc,%rax
  movzwl (%rax),%eax
  imul   %eax,%edx
  mov    -0x68(%rbp),%rax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  movswl -0x74(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%ecx
  movswl -0x78(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    %eax,%edx
  mov    -0x90(%rbp),%rax
  add    $0xa,%rax
  movzwl (%rax),%eax
  imul   %eax,%edx
  mov    -0x68(%rbp),%rax
  add    %eax,%edx
  mov    -0x60(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  movswl -0x74(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%ecx
  movswl -0x78(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    %eax,%edx
  mov    -0x90(%rbp),%rax
  add    $0xe,%rax
  movzwl (%rax),%eax
  imul   %eax,%edx
  mov    -0x70(%rbp),%rax
  add    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %edx,%eax
  movswl %ax,%edx
  movswl -0x74(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  movswq -0x78(%rbp),%rax
  lea    (%rax,%rax,1),%rcx
  mov    -0x88(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
  movzwl -0x7c(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x7c(%rbp)
  movswq -0x72(%rbp),%rax
  add    %rax,%rax
  add    %rax,-0x88(%rbp)
L59:
  cmpw   $0x7,-0x7c(%rbp)
  jle    L47
  movzwl -0x78(%rbp),%eax
  add    $0x7,%eax
  mov    %ax,-0x78(%rbp)
  movzwl -0x76(%rbp),%eax
  add    $0x3,%eax
  mov    %ax,-0x76(%rbp)
  movzwl -0x74(%rbp),%eax
  add    $0x3,%eax
  mov    %ax,-0x74(%rbp)
  movzwl -0x72(%rbp),%eax
  sub    $0x7,%eax
  mov    %ax,-0x72(%rbp)
  addq   $0xffffffffffffff80,-0x88(%rbp)
L49:
  cmpw   $0x8,-0x78(%rbp)
  jle    L9
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L45
  call   <__stack_chk_fail@plt>
L45:
  leave
  ret
```

assistant: ```c
void jpegdct(short *d, short *r) {
  long int t[12];
  short i, j, k, m, n, p;
  for (k = 1, m = 0, n = 13, p = 8; k <= 8; k += 7, m += 3, n += 3, p -= 7, d -= 64) {
    for (i = 0; i < 8; i++, d += p) {
      for (j = 0; j < 4; j++) {
        t[j] = d[k * j] + d[k * (7 - j)];
        t[7 - j] = d[k * j] - d[k * (7 - j)];
      }
      t[8] = t[0] + t[3];
      t[9] = t[0] - t[3];
      t[10] = t[1] + t[2];
      t[11] = t[1] - t[2];
      d[0] = (t[8] + t[10]) >> m;
      d[4 * k] = (t[8] - t[10]) >> m;
      t[8] = (short)(t[11] + t[9]) * r[10];
      d[2 * k] = t[8] + (short)((t[9] * r[9]) >> n);
      d[6 * k] = t[8] + (short)((t[11] * r[11]) >> n);
      t[0] = (short)(t[4] + t[7]) * r[2];
      t[1] = (short)(t[5] + t[6]) * r[0];
      t[2] = t[4] + t[6];
      t[3] = t[5] + t[7];
      t[8] = (short)(t[2] + t[3]) * r[8];
      t[2] = (short)t[2] * r[1] + t[8];
      t[3] = (short)t[3] * r[3] + t[8];
      d[7 * k] = (short)(t[4] * r[4] + t[0] + t[2]) >> n;
      d[5 * k] = (short)(t[5] * r[6] + t[1] + t[3]) >> n;
      d[3 * k] = (short)(t[6] * r[5] + t[1] + t[2]) >> n;
      d[1 * k] = (short)(t[7] * r[7] + t[0] + t[3]) >> n;
    }
  }
}
```