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

```asm
<fdct>:
  endbr64
  push   %r15
  movslq %esi,%rax
  mov    %rdi,%r11
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %eax,-0x14(%rsp)
  mov    %rax,-0x20(%rsp)
  add    %rax,%rax
  mov    %rax,-0x30(%rsp)
  movl   $0x8,-0x28(%rsp)
  mov    %rdi,-0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L19:
  movswl 0xe(%r11),%eax
  movswl (%r11),%esi
  movswl 0x2(%r11),%ecx
  movswl 0x4(%r11),%edx
  lea    (%rsi,%rax,1),%r8d
  sub    %eax,%esi
  movswl 0xc(%r11),%eax
  movswl 0x8(%r11),%r9d
  lea    (%rcx,%rax,1),%edi
  sub    %eax,%ecx
  movswl 0xa(%r11),%eax
  lea    (%rdx,%rax,1),%r10d
  sub    %eax,%edx
  movswl 0x6(%r11),%eax
  lea    (%rdi,%r10,1),%r15d
  lea    (%rsi,%rdx,1),%ebp
  sub    %r10d,%edi
  lea    (%rax,%r9,1),%ebx
  sub    %r9d,%eax
  lea    (%rcx,%rdx,1),%r14d
  lea    (%rcx,%rax,1),%r10d
  lea    (%r8,%rbx,1),%r9d
  sub    %ebx,%r8d
  lea    (%rsi,%rax,1),%r12d
  lea    (%r10,%rbp,1),%ebx
  imul   $0x25a1,%ebx,%ebx
  lea    (%r8,%rdi,1),%r13d
  imul   $0xffffe333,%r12d,%r12d
  imul   $0xffffadfd,%r14d,%r14d
  imul   $0xfffff384,%ebp,%ebp
  imul   $0xffffc13b,%r10d,%r10d
  imul   $0x300b,%esi,%esi
  imul   $0x6254,%ecx,%ecx
  imul   $0x41b3,%edx,%edx
  add    %ebx,%r10d
  add    %ebp,%ebx
  imul   $0x1151,%r13d,%r13d
  add    %r12d,%esi
  lea    (%r9,%r15,1),%ebp
  sub    %r15d,%r9d
  imul   $0x187e,%r8d,%r8d
  add    %r14d,%ecx
  add    %ebx,%esi
  shl    $0x2,%ebp
  add    %r14d,%edx
  add    %r10d,%ecx
  sar    $0xb,%esi
  movd   %ebp,%xmm0
  sar    $0xb,%ecx
  add    %ebx,%edx
  shl    $0x2,%r9d
  pinsrw $0x1,%esi,%xmm0
  add    %r13d,%r8d
  sar    $0xb,%edx
  movd   %r9d,%xmm1
  sar    $0xb,%r8d
  imul   $0xffffc4df,%edi,%edi
  pinsrw $0x1,%edx,%xmm1
  imul   $0x98e,%eax,%eax
  movd   %r8d,%xmm3
  pinsrw $0x1,%ecx,%xmm3
  add    %r13d,%edi
  punpckldq %xmm3,%xmm0
  add    %r12d,%eax
  sar    $0xb,%edi
  add    %r10d,%eax
  movd   %edi,%xmm2
  sar    $0xb,%eax
  pinsrw $0x1,%eax,%xmm2
  punpckldq %xmm2,%xmm1
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,(%r11)
  add    -0x30(%rsp),%r11
  subl   $0x1,-0x28(%rsp)
  jne    L19
  mov    -0x14(%rsp),%eax
  mov    -0x20(%rsp),%rdx
  mov    -0x10(%rsp),%r15
  lea    0x0(,%rax,8),%r10d
  lea    (%rax,%rax,2),%r11d
  sub    %eax,%r10d
  lea    (%rax,%rax,4),%ebx
  lea    0x0(,%rdx,8),%rax
  add    %r11d,%r11d
  mov    %rax,-0x28(%rsp)
  lea    0x10(%r15),%rax
  movslq %r10d,%r10
  movslq %r11d,%r11
  mov    %rax,-0x20(%rsp)
  movslq %ebx,%rbx
  add    %r10,%r10
  lea    (%r11,%r11,1),%r12
  lea    0x0(,%rdx,4),%rbp
  add    %rbx,%rbx
  nopl   (%rax)
L17:
  movswl (%r15,%r10,1),%edx
  movswl (%r15),%eax
  mov    -0x30(%rsp),%rdi
  movswl (%r15,%r12,1),%ecx
  lea    (%rax,%rdx,1),%r8d
  sub    %edx,%eax
  movswl (%r15,%rbx,1),%esi
  mov    -0x28(%rsp),%r14
  movswl (%r15,%rdi,1),%edx
  movswl (%r15,%r14,1),%r9d
  lea    (%rdx,%rcx,1),%edi
  sub    %ecx,%edx
  movswl (%r15,%rbp,1),%ecx
  lea    (%rcx,%rsi,1),%r13d
  sub    %esi,%ecx
  movswl (%r15,%r11,1),%esi
  lea    (%rsi,%r9,1),%r14d
  sub    %r9d,%esi
  lea    (%r8,%r14,1),%r9d
  sub    %r14d,%r8d
  lea    (%rdi,%r13,1),%r14d
  sub    %r13d,%edi
  lea    (%r9,%r14,1),%r13d
  sub    %r14d,%r9d
  mov    -0x28(%rsp),%r14
  sar    $0x5,%r13d
  sar    $0x5,%r9d
  mov    %r13w,(%r15)
  lea    (%rdx,%rcx,1),%r13d
  mov    %r9w,(%r15,%r14,1)
  imul   $0xffffadfd,%r13d,%r13d
  lea    (%r8,%rdi,1),%r9d
  imul   $0x1151,%r9d,%r9d
  imul   $0x187e,%r8d,%r8d
  imul   $0xffffc4df,%edi,%edi
  add    %r9d,%r8d
  add    %r9d,%edi
  sar    $0x12,%r8d
  lea    (%rax,%rsi,1),%r9d
  sar    $0x12,%edi
  mov    %r8w,(%r15,%rbp,1)
  lea    (%rdx,%rsi,1),%r8d
  mov    %di,(%r15,%r12,1)
  imul   $0xffffe333,%r9d,%r9d
  lea    (%rax,%rcx,1),%edi
  imul   $0x98e,%esi,%esi
  lea    (%r8,%rdi,1),%r14d
  imul   $0x25a1,%r14d,%r14d
  imul   $0xffffc13b,%r8d,%r8d
  imul   $0xfffff384,%edi,%edi
  add    %r9d,%esi
  imul   $0x41b3,%ecx,%ecx
  imul   $0x6254,%edx,%edx
  add    %r14d,%r8d
  add    %r14d,%edi
  add    %r8d,%esi
  add    %r13d,%ecx
  sar    $0x12,%esi
  add    %edi,%ecx
  mov    %si,(%r15,%r10,1)
  sar    $0x12,%ecx
  add    %r13d,%edx
  add    $0x2,%r15
  imul   $0x300b,%eax,%eax
  add    %r8d,%edx
  mov    %cx,-0x2(%r15,%rbx,1)
  sar    $0x12,%edx
  mov    %dx,-0x2(%r15,%r11,1)
  add    %r9d,%eax
  add    %edi,%eax
  mov    -0x30(%rsp),%rdi
  sar    $0x12,%eax
  mov    %ax,-0x2(%r15,%rdi,1)
  cmp    -0x20(%rsp),%r15
  jne    L17
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void fdct(short int *blk, int lx) {
  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
  int tmp10, tmp11, tmp12, tmp13;
  int z1, z2, z3, z4, z5;
  int i;
  short int *block;
  int constant;
  block = blk;
  for (i = 0; i < 8; i++) {
    tmp0 = block[0] + block[7];
    tmp7 = block[0] - block[7];
    tmp1 = block[1] + block[6];
    tmp6 = block[1] - block[6];
    tmp2 = block[2] + block[5];
    tmp5 = block[2] - block[5];
    tmp3 = block[3] + block[4];
    tmp4 = block[3] - block[4];
    tmp10 = tmp0 + tmp3;
    tmp13 = tmp0 - tmp3;
    tmp11 = tmp1 + tmp2;
    tmp12 = tmp1 - tmp2;
    block[0] = ((tmp10 + tmp11) << 2);
    block[4] = ((tmp10 - tmp11) << 2);
    constant = 4433;
    z1 = (tmp12 + tmp13) * constant;
    constant = 6270;
    block[2] = (z1 + (tmp13 * constant)) >> (13 - 2);
    constant = -15137;
    block[6] = (z1 + (tmp12 * constant)) >> (13 - 2);
    z1 = tmp4 + tmp7;
    z2 = tmp5 + tmp6;
    z3 = tmp4 + tmp6;
    z4 = tmp5 + tmp7;
    constant = 9633;
    z5 = ((z3 + z4) * constant);
    constant = 2446;
    tmp4 = (tmp4 * constant);
    constant = 16819;
    tmp5 = (tmp5 * constant);
    constant = 25172;
    tmp6 = (tmp6 * constant);
    constant = 12299;
    tmp7 = (tmp7 * constant);
    constant = -7373;
    z1 = (z1 * constant);
    constant = -20995;
    z2 = (z2 * constant);
    constant = -16069;
    z3 = (z3 * constant);
    constant = -3196;
    z4 = (z4 * constant);
    z3 += z5;
    z4 += z5;
    block[7] = (tmp4 + z1 + z3) >> (13 - 2);
    block[5] = (tmp5 + z2 + z4) >> (13 - 2);
    block[3] = (tmp6 + z2 + z3) >> (13 - 2);
    block[1] = (tmp7 + z1 + z4) >> (13 - 2);
    block += lx;
  }
  block = blk;
  for (i = 0; i < 8; i++) {
    tmp0 = block[0] + block[7 * lx];
    tmp7 = block[0] - block[7 * lx];
    tmp1 = block[lx] + block[6 * lx];
    tmp6 = block[lx] - block[6 * lx];
    tmp2 = block[2 * lx] + block[5 * lx];
    tmp5 = block[2 * lx] - block[5 * lx];
    tmp3 = block[3 * lx] + block[4 * lx];
    tmp4 = block[3 * lx] - block[4 * lx];
    tmp10 = tmp0 + tmp3;
    tmp13 = tmp0 - tmp3;
    tmp11 = tmp1 + tmp2;
    tmp12 = tmp1 - tmp2;
    block[0] = (tmp10 + tmp11) >> (2 + 3);
    block[4 * lx] = (tmp10 - tmp11) >> (2 + 3);
    constant = 4433;
    z1 = ((tmp12 + tmp13) * constant);
    constant = 6270;
    block[2 * lx] = (z1 + (tmp13 * constant)) >> (13 + 2 + 3);
    constant = -15137;
    block[6 * lx] = (z1 + (tmp12 * constant)) >> (13 + 2 + 3);
    z1 = tmp4 + tmp7;
    z2 = tmp5 + tmp6;
    z3 = tmp4 + tmp6;
    z4 = tmp5 + tmp7;
    constant = 9633;
    z5 = ((z3 + z4) * constant);
    constant = 2446;
    tmp4 = (tmp4 * constant);
    constant = 16819;
    tmp5 = (tmp5 * constant);
    constant = 25172;
    tmp6 = (tmp6 * constant);
    constant = 12299;
    tmp7 = (tmp7 * constant);
    constant = -7373;
    z1 = (z1 * constant);
    constant = -20995;
    z2 = (z2 * constant);
    constant = -16069;
    z3 = (z3 * constant);
    constant = -3196;
    z4 = (z4 * constant);
    z3 += z5;
    z4 += z5;
    block[7 * lx] = (tmp4 + z1 + z3) >> (13 + 2 + 3);
    block[5 * lx] = (tmp5 + z2 + z4) >> (13 + 2 + 3);
    block[3 * lx] = (tmp6 + z2 + z3) >> (13 + 2 + 3);
    block[lx] = (tmp7 + z1 + z4) >> (13 + 2 + 3);
    block++;
  }
}
```