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

```asm
<vp8_short_fdct4x4_c>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L13
L26:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswl %ax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  cwtl
  add    %edx,%eax
  shl    $0x3,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movswl %ax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  cwtl
  add    %edx,%eax
  shl    $0x3,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  cwtl
  mov    -0x10(%rbp),%rdx
  add    $0x4,%rdx
  movzwl (%rdx),%edx
  movswl %dx,%edx
  sub    %edx,%eax
  shl    $0x3,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  cwtl
  mov    -0x10(%rbp),%rdx
  add    $0x6,%rdx
  movzwl (%rdx),%edx
  movswl %dx,%edx
  sub    %edx,%eax
  shl    $0x3,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  sub    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%eax
  imul   $0x8a9,%eax,%edx
  mov    -0x14(%rbp),%eax
  imul   $0x14e8,%eax,%eax
  add    %edx,%eax
  add    $0x38a4,%eax
  sar    $0xc,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  mov    %dx,(%rax)
  mov    -0x14(%rbp),%eax
  imul   $0x8a9,%eax,%edx
  mov    -0x18(%rbp),%eax
  imul   $0xffffeb18,%eax,%eax
  add    %edx,%eax
  add    $0x1d4c,%eax
  sar    $0xc,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x6,%rax
  mov    %dx,(%rax)
  mov    -0x44(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cltq
  add    %rax,%rax
  add    %rax,-0x10(%rbp)
  addq   $0x8,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L13:
  cmpl   $0x3,-0x24(%rbp)
  jle    L26
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L33
L28:
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  movswl %ax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x18,%rax
  movzwl (%rax),%eax
  cwtl
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  movzwl (%rax),%eax
  movswl %ax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x10,%rax
  movzwl (%rax),%eax
  cwtl
  add    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  movzwl (%rax),%eax
  cwtl
  mov    -0x10(%rbp),%rdx
  add    $0x10,%rdx
  movzwl (%rdx),%edx
  movswl %dx,%edx
  sub    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%eax
  cwtl
  mov    -0x10(%rbp),%rdx
  add    $0x18,%rdx
  movzwl (%rdx),%edx
  movswl %dx,%edx
  sub    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x20(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  add    $0x7,%eax
  sar    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x7,%eax
  sar    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%eax
  imul   $0x8a9,%eax,%edx
  mov    -0x14(%rbp),%eax
  imul   $0x14e8,%eax,%eax
  add    %edx,%eax
  add    $0x2ee0,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  cmpl   $0x0,-0x14(%rbp)
  setne  %al
  movzbl %al,%eax
  add    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  mov    %dx,(%rax)
  mov    -0x14(%rbp),%eax
  imul   $0x8a9,%eax,%edx
  mov    -0x18(%rbp),%eax
  imul   $0xffffeb18,%eax,%eax
  add    %edx,%eax
  add    $0xc738,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x18,%rax
  mov    %dx,(%rax)
  addq   $0x2,-0x10(%rbp)
  addq   $0x2,-0x8(%rbp)
  addl   $0x1,-0x24(%rbp)
L33:
  cmpl   $0x3,-0x24(%rbp)
  jle    L28
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void vp8_short_fdct4x4_c(short *input, short *output, int pitch) {
  int i;
  int a1, b1, c1, d1;
  short *ip = input;
  short *op = output;
  for (i = 0; i < 4; i++) {
    a1 = ((ip[0] + ip[3]) << 3);
    b1 = ((ip[1] + ip[2]) << 3);
    c1 = ((ip[1] - ip[2]) << 3);
    d1 = ((ip[0] - ip[3]) << 3);
    op[0] = a1 + b1;
    op[2] = a1 - b1;
    op[1] = (c1 * 2217 + d1 * 5352 + 14500) >> 12;
    op[3] = (d1 * 2217 - c1 * 5352 + 7500) >> 12;
    ip += pitch / 2;
    op += 4;
  }
  ip = output;
  op = output;
  for (i = 0; i < 4; i++) {
    a1 = ip[0] + ip[12];
    b1 = ip[4] + ip[8];
    c1 = ip[4] - ip[8];
    d1 = ip[0] - ip[12];
    op[0] = (a1 + b1 + 7) >> 4;
    op[8] = (a1 - b1 + 7) >> 4;
    op[4] = ((c1 * 2217 + d1 * 5352 + 12000) >> 16) + (d1 != 0);
    op[12] = (d1 * 2217 - c1 * 5352 + 51000) >> 16;
    ip++;
    op++;
  }
}
```