user: Please show me the C implementation that matches the assembly code listed below:

```asm
<inv_dct8_1d_internal_c>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%r14
  mov    %rdi,0x28(%rsp)
  mov    %esi,%ebx
  mov    %edx,%r13d
  mov    %ecx,%r15d
  mov    %r8d,%r12d
  test   %esi,%esi
  setg   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  lea    (%rbx,%rbx,1),%esi
  mov    %r12d,%r8d
  mov    %r15d,%ecx
  mov    %r13d,%edx
  mov    %r14,%rdi
  call   <inv_dct4_1d_internal_c@plt>
  movslq %ebx,%rcx
  mov    %rcx,(%rsp)
  lea    (%r14,%rcx,4),%rax
  mov    %rax,0x38(%rsp)
  mov    (%rax),%ebx
  shl    $0x3,%rcx
  mov    %rcx,0x20(%rsp)
  add    %rcx,%rax
  mov    %rax,0x8(%rsp)
  mov    (%rax),%ebp
  test   %r12d,%r12d
  je     L18
  imul   $0x31f,%ebx,%r12d
  add    $0x800,%r12d
  sar    $0xc,%r12d
  imul   $0xfffff71c,%ebp,%r14d
  add    $0x800,%r14d
  sar    $0xc,%r14d
  imul   $0xd4e,%ebp,%ebp
  add    $0x800,%ebp
  sar    $0xc,%ebp
  imul   $0xfb1,%ebx,%ebx
  add    $0x800,%ebx
  sar    $0xc,%ebx
L13:
  lea    (%r12,%r14,1),%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    %rax,0x40(%rsp)
  mov    %r12d,%edi
  sub    %r14d,%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    %rax,%r12
  lea    0x0(%rbp,%rbx,1),%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    %rax,0x10(%rsp)
  sub    %ebp,%ebx
  mov    %ebx,%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    %eax,%edx
  sub    %r12d,%edx
  imul   $0xb5,%edx,%edx
  sub    $0xffffff80,%edx
  sar    $0x8,%edx
  mov    %edx,0x18(%rsp)
  add    %r12d,%eax
  imul   $0xb5,%eax,%eax
  sub    $0xffffff80,%eax
  mov    %eax,%ecx
  sar    $0x8,%ecx
  mov    %ecx,0x1c(%rsp)
  mov    0x28(%rsp),%rsi
  mov    (%rsi),%esi
  mov    (%rsp),%rbx
  neg    %rbx
  lea    0x0(,%rbx,4),%r10
  mov    0x8(%rsp),%rbx
  mov    %r10,0x30(%rsp)
  add    %r10,%rbx
  mov    (%rbx),%r10d
  mov    %r10d,0x48(%rsp)
  mov    0x20(%rsp),%r14
  lea    (%rbx,%r14,1),%r12
  mov    (%r12),%r11d
  mov    %r11d,0x20(%rsp)
  lea    (%r12,%r14,1),%rbp
  mov    0x0(%rbp),%r14d
  mov    %esi,0x4c(%rsp)
  mov    %esi,%edi
  add    0x10(%rsp),%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    0x28(%rsp),%r8
  mov    %eax,(%r8)
  mov    0x1c(%rsp),%edi
  add    0x48(%rsp),%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    0x38(%rsp),%r8
  mov    %eax,(%r8)
  mov    0x18(%rsp),%edi
  add    0x20(%rsp),%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    %eax,(%rbx)
  mov    0x40(%rsp),%rbx
  lea    (%r14,%rbx,1),%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    0x8(%rsp),%r9
  mov    %eax,(%r9)
  sub    %ebx,%r14d
  mov    %r14d,%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    %eax,(%r12)
  mov    0x20(%rsp),%r11d
  sub    0x18(%rsp),%r11d
  mov    %r11d,%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    0x30(%rsp),%rdx
  lea    0x0(%rbp,%rdx,1),%rbx
  mov    %eax,(%rbx)
  mov    0x48(%rsp),%r10d
  sub    0x1c(%rsp),%r10d
  mov    %r10d,%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    %eax,0x0(%rbp)
  mov    0x4c(%rsp),%edi
  sub    0x10(%rsp),%edi
  mov    %r15d,%edx
  mov    %r13d,%esi
  call   <iclip@plt>
  mov    (%rsp),%rcx
  mov    %eax,(%rbx,%rcx,8)
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L18:
  mov    0x8(%rsp),%rax
  add    0x20(%rsp),%rax
  mov    (%rax),%edx
  mov    (%rsp),%rsi
  mov    (%rax,%rsi,8),%eax
  imul   $0x31f,%ebx,%esi
  imul   $0x4f,%eax,%ecx
  lea    0x800(%rsi,%rcx,1),%r12d
  sar    $0xc,%r12d
  sub    %eax,%r12d
  imul   $0x6a7,%edx,%esi
  imul   $0xfffffb8e,%ebp,%ecx
  lea    0x400(%rsi,%rcx,1),%r14d
  sar    $0xb,%r14d
  imul   $0x472,%edx,%edx
  imul   $0x6a7,%ebp,%ebp
  lea    0x400(%rdx,%rbp,1),%ebp
  sar    $0xb,%ebp
  imul   $0xffffffb1,%ebx,%edx
  imul   $0x31f,%eax,%eax
  lea    0x800(%rdx,%rax,1),%eax
  sar    $0xc,%eax
  add    %eax,%ebx
  jmp    L13
```

assistant: ```c
__attribute__((no)) void inv_dct8_1d_internal_c(int32_t *const c, const ptrdiff_t stride, const int min, const int max, const int tx64) {
  assert(stride > 0);
  inv_dct4_1d_internal_c(c, stride << 1, min, max, tx64);
  const int in1 = c[1 * stride], in3 = c[3 * stride];
  int t4a, t5a, t6a, t7a;
  if (tx64) {
    t4a = (in1 * 799 + 2048) >> 12;
    t5a = (in3 * -2276 + 2048) >> 12;
    t6a = (in3 * 3406 + 2048) >> 12;
    t7a = (in1 * 4017 + 2048) >> 12;
  } else {
    const int in5 = c[5 * stride], in7 = c[7 * stride];
    t4a = ((in1 * 799 - in7 * (4017 - 4096) + 2048) >> 12) - in7;
    t5a = (in5 * 1703 - in3 * 1138 + 1024) >> 11;
    t6a = (in5 * 1138 + in3 * 1703 + 1024) >> 11;
    t7a = ((in1 * (4017 - 4096) + in7 * 799 + 2048) >> 12) + in1;
  }
  const int t4 = iclip(t4a + t5a, min, max);
  t5a = iclip(t4a - t5a, min, max);
  const int t7 = iclip(t7a + t6a, min, max);
  t6a = iclip(t7a - t6a, min, max);
  const int t5 = ((t6a - t5a) * 181 + 128) >> 8;
  const int t6 = ((t6a + t5a) * 181 + 128) >> 8;
  const int t0 = c[0 * stride];
  const int t1 = c[2 * stride];
  const int t2 = c[4 * stride];
  const int t3 = c[6 * stride];
  c[0 * stride] = iclip(t0 + t7, min, max);
  c[1 * stride] = iclip(t1 + t6, min, max);
  c[2 * stride] = iclip(t2 + t5, min, max);
  c[3 * stride] = iclip(t3 + t4, min, max);
  c[4 * stride] = iclip(t3 - t4, min, max);
  c[5 * stride] = iclip(t2 - t5, min, max);
  c[6 * stride] = iclip(t1 - t6, min, max);
  c[7 * stride] = iclip(t0 - t7, min, max);
}
```