user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<IDCT>:
  endbr64
  cmp    $0x1,%esi
  je     L62
  push   %r13
  lea    0x20(%rdi),%r9
  mov    %rdi,%rax
  push   %r12
  push   %rbp
  push   %rbx
  jmp    L56
  nop
L32:
  lea    (%r12,%r8,1),%esi
  sub    %r12d,%r8d
  lea    (%r10,%rbp,1),%r12d
  sub    %ebp,%r10d
  imul   $0x16a,%r10d,%r10d
  lea    (%rsi,%r12,1),%ebp
  sub    %r12d,%esi
  add    $0x4,%rax
  lea    (%rdx,%rbx,1),%r13d
  sub    %ebx,%edx
  sar    $0x8,%r10d
  sub    %r12d,%r10d
  lea    (%r8,%r10,1),%r12d
  sub    %r10d,%r8d
  lea    (%rcx,%r11,1),%r10d
  sub    %r11d,%ecx
  mov    %ecx,%ebx
  imul   $0x115,%ecx,%ecx
  lea    0x0(%r13,%r10,1),%r11d
  sub    %r13d,%r10d
  sub    %edx,%ebx
  imul   $0x29d,%edx,%edx
  imul   $0x1d9,%ebx,%ebx
  imul   $0x16a,%r10d,%r10d
  sar    $0x8,%ecx
  sar    $0x8,%edx
  sar    $0x8,%ebx
  add    %ebx,%edx
  sar    $0x8,%r10d
  sub    %ebx,%ecx
  lea    0x0(%rbp,%r11,1),%ebx
  sub    %r11d,%edx
  sub    %r11d,%ebp
  mov    %ebx,-0x4(%rax)
  sub    %edx,%r10d
  lea    (%r12,%rdx,1),%r11d
  sub    %edx,%r12d
  mov    %ebp,0xdc(%rax)
  lea    (%r8,%r10,1),%edx
  add    %r10d,%ecx
  sub    %r10d,%r8d
  mov    %r11d,0x1c(%rax)
  mov    %edx,0x3c(%rax)
  lea    (%rsi,%rcx,1),%edx
  sub    %ecx,%esi
  mov    %r12d,0xbc(%rax)
  mov    %r8d,0x9c(%rax)
  mov    %edx,0x7c(%rax)
  mov    %esi,0x5c(%rax)
  cmp    %r9,%rax
  je     L78
L56:
  mov    0x20(%rax),%ecx
  mov    0x40(%rax),%r10d
  mov    0x60(%rax),%edx
  mov    0x80(%rax),%r12d
  mov    %ecx,%esi
  mov    0xa0(%rax),%ebx
  mov    0xc0(%rax),%ebp
  or     %r10d,%esi
  mov    0xe0(%rax),%r11d
  mov    (%rax),%r8d
  or     %edx,%esi
  or     %r12d,%esi
  or     %ebx,%esi
  or     %ebp,%esi
  or     %r11d,%esi
  jne    L32
  mov    %r8d,0xe0(%rax)
  add    $0x4,%rax
  mov    %r8d,0xbc(%rax)
  mov    %r8d,0x9c(%rax)
  mov    %r8d,0x7c(%rax)
  mov    %r8d,0x5c(%rax)
  mov    %r8d,0x3c(%rax)
  mov    %r8d,0x1c(%rax)
  cmp    %r9,%rax
  jne    L56
L78:
  lea    0x100(%rdi),%r12
  jmp    L58
  cs nopw 0x0(%rax,%rax,1)
L13:
  lea    0x0(%rbp,%rax,1),%esi
  sub    %ebp,%eax
  lea    (%r8,%rbx,1),%ebp
  sub    %ebx,%r8d
  imul   $0x16a,%r8d,%r8d
  lea    (%rsi,%rbp,1),%ebx
  sub    %ebp,%esi
  lea    (%rdx,%r11,1),%r13d
  sub    %r11d,%edx
  sar    $0x8,%r8d
  sub    %ebp,%r8d
  lea    (%rax,%r8,1),%ebp
  sub    %r8d,%eax
  lea    (%rcx,%r10,1),%r8d
  sub    %r10d,%ecx
  mov    %ecx,%r11d
  imul   $0x115,%ecx,%ecx
  lea    0x0(%r13,%r8,1),%r10d
  sub    %r13d,%r8d
  sub    %edx,%r11d
  imul   $0x29d,%edx,%edx
  imul   $0x1d9,%r11d,%r11d
  imul   $0x16a,%r8d,%r8d
  sar    $0x8,%ecx
  sar    $0x8,%edx
  sar    $0x8,%r11d
  add    %r11d,%edx
  sar    $0x8,%r8d
  sub    %r11d,%ecx
  lea    (%rbx,%r10,1),%r11d
  sub    %r10d,%edx
  sub    %r10d,%ebx
  sar    $0x5,%r11d
  sub    %edx,%r8d
  lea    0x0(%rbp,%rdx,1),%r10d
  sub    %edx,%ebp
  sar    $0x5,%ebx
  lea    (%rax,%r8,1),%edx
  sub    %r8d,%eax
  add    %r8d,%ecx
  sar    $0x5,%r10d
  sar    $0x5,%ebp
  sar    $0x5,%edx
  mov    %r11d,(%rdi)
  sar    $0x5,%eax
  mov    %ebx,0x1c(%rdi)
  mov    %eax,0x14(%rdi)
  lea    (%rsi,%rcx,1),%eax
  sub    %ecx,%esi
  sar    $0x5,%eax
  sar    $0x5,%esi
  mov    %r10d,0x4(%rdi)
  mov    %ebp,0x18(%rdi)
  mov    %edx,0x8(%rdi)
  mov    %eax,0x10(%rdi)
  mov    %esi,0xc(%rdi)
  mov    %r9,%rdi
  cmp    %r12,%r9
  je     L64
L60:
  add    $0x20,%r9
L58:
  mov    0x4(%rdi),%ecx
  mov    0x8(%rdi),%r8d
  mov    0xc(%rdi),%edx
  mov    0x10(%rdi),%ebp
  mov    %ecx,%esi
  mov    0x14(%rdi),%r11d
  mov    0x18(%rdi),%ebx
  or     %r8d,%esi
  mov    0x1c(%rdi),%r10d
  mov    (%rdi),%eax
  or     %edx,%esi
  or     %ebp,%esi
  or     %r11d,%esi
  or     %ebx,%esi
  or     %r10d,%esi
  jne    L13
  sar    $0x5,%eax
  mov    %eax,0x1c(%rdi)
  mov    %eax,0x18(%rdi)
  mov    %eax,0x14(%rdi)
  mov    %eax,0x10(%rdi)
  mov    %eax,0xc(%rdi)
  mov    %eax,0x8(%rdi)
  mov    %eax,0x4(%rdi)
  mov    %eax,(%rdi)
  mov    %r9,%rdi
  cmp    %r12,%r9
  jne    L60
L64:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L62:
  xor    %eax,%eax
  jmp    1050 <IDCT1@plt>
```

assistant: ```c
void IDCT(int *block, int k) {
  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
  int z5, z10, z11, z12, z13;
  int *ptr;
  int i;
  switch (k) {
  case 1:
    IDCT1(block);
    return;
  }
  ptr = block;
  for (i = 0; i < 8; i++, ptr++) {
    if ((ptr[8 * 1] | ptr[8 * 2] | ptr[8 * 3] | ptr[8 * 4] | ptr[8 * 5] | ptr[8 * 6] | ptr[8 * 7]) == 0) {
      ptr[8 * 0] = ptr[8 * 1] = ptr[8 * 2] = ptr[8 * 3] = ptr[8 * 4] = ptr[8 * 5] = ptr[8 * 6] = ptr[8 * 7] = ptr[8 * 0];
      continue;
    }
    z10 = ptr[8 * 0] + ptr[8 * 4];
    z11 = ptr[8 * 0] - ptr[8 * 4];
    z13 = ptr[8 * 2] + ptr[8 * 6];
    z12 = ((((ptr[8 * 2] - ptr[8 * 6]) * ((362))) >> (8))) - z13;
    tmp0 = z10 + z13;
    tmp3 = z10 - z13;
    tmp1 = z11 + z12;
    tmp2 = z11 - z12;
    z13 = ptr[8 * 3] + ptr[8 * 5];
    z10 = ptr[8 * 3] - ptr[8 * 5];
    z11 = ptr[8 * 1] + ptr[8 * 7];
    z12 = ptr[8 * 1] - ptr[8 * 7];
    z5 = ((((z12 - z10) * ((473))) >> (8)));
    tmp7 = z11 + z13;
    tmp6 = ((((z10) * ((669))) >> (8))) + z5 - tmp7;
    tmp5 = ((((z11 - z13) * ((362))) >> (8))) - tmp6;
    tmp4 = ((((z12) * ((277))) >> (8))) - z5 + tmp5;
    ptr[8 * 0] = (tmp0 + tmp7);
    ptr[8 * 7] = (tmp0 - tmp7);
    ptr[8 * 1] = (tmp1 + tmp6);
    ptr[8 * 6] = (tmp1 - tmp6);
    ptr[8 * 2] = (tmp2 + tmp5);
    ptr[8 * 5] = (tmp2 - tmp5);
    ptr[8 * 4] = (tmp3 + tmp4);
    ptr[8 * 3] = (tmp3 - tmp4);
  }
  ptr = block;
  for (i = 0; i < 8; i++, ptr += 8) {
    if ((ptr[1] | ptr[2] | ptr[3] | ptr[4] | ptr[5] | ptr[6] | ptr[7]) == 0) {
      ptr[0] = ptr[1] = ptr[2] = ptr[3] = ptr[4] = ptr[5] = ptr[6] = ptr[7] = (((ptr[0]) >> (2 + 3)));
      ;
      continue;
    }
    z10 = ptr[0] + ptr[4];
    z11 = ptr[0] - ptr[4];
    z13 = ptr[2] + ptr[6];
    z12 = ((((ptr[2] - ptr[6]) * ((362))) >> (8))) - z13;
    tmp0 = z10 + z13;
    tmp3 = z10 - z13;
    tmp1 = z11 + z12;
    tmp2 = z11 - z12;
    z13 = ptr[3] + ptr[5];
    z10 = ptr[3] - ptr[5];
    z11 = ptr[1] + ptr[7];
    z12 = ptr[1] - ptr[7];
    z5 = ((((z12 - z10) * ((473))) >> (8)));
    tmp7 = z11 + z13;
    tmp6 = ((((z10) * ((669))) >> (8))) + z5 - tmp7;
    tmp5 = ((((z11 - z13) * ((362))) >> (8))) - tmp6;
    tmp4 = ((((z12) * ((277))) >> (8))) - z5 + tmp5;
    ptr[0] = (((tmp0 + tmp7) >> (2 + 3)));
    ;
    ptr[7] = (((tmp0 - tmp7) >> (2 + 3)));
    ;
    ptr[1] = (((tmp1 + tmp6) >> (2 + 3)));
    ;
    ptr[6] = (((tmp1 - tmp6) >> (2 + 3)));
    ;
    ptr[2] = (((tmp2 + tmp5) >> (2 + 3)));
    ;
    ptr[5] = (((tmp2 - tmp5) >> (2 + 3)));
    ;
    ptr[4] = (((tmp3 + tmp4) >> (2 + 3)));
    ;
    ptr[3] = (((tmp3 - tmp4) >> (2 + 3)));
    ;
  }
}
```