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

```asm
<audio_out_resample_6channel>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r11d
  mov    %rdx,%r10
  mov    %ecx,%ebx
  lea    -0x2(%rsi),%eax
  shl    $0x10,%eax
  lea    -0x2(%rcx),%ecx
  cltd
  idiv   %ecx
  cmp    $0x1,%ebx
  jle    L12
  mov    %r10,%r8
  lea    -0x2(%rbx),%edx
  lea    (%rdx,%rdx,2),%rdx
  lea    0x18(%r10,%rdx,8),%r12
  mov    $0x0,%r9d
  mov    $0x10000,%ebp
L2:
  movzwl %r9w,%esi
  mov    %r9d,%edx
  sar    $0x10,%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  movslq %edx,%rdx
  mov    %ebp,%ecx
  sub    %esi,%ecx
  mov    %esi,%r13d
  imul   0x18(%rdi,%rdx,4),%r13d
  mov    %ecx,%r14d
  imul   (%rdi,%rdx,4),%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,(%r8)
  mov    %esi,%r13d
  imul   0x1c(%rdi,%rdx,4),%r13d
  mov    %ecx,%r14d
  imul   0x4(%rdi,%rdx,4),%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,0x4(%r8)
  mov    %ecx,%r13d
  imul   0x8(%rdi,%rdx,4),%r13d
  mov    %esi,%r14d
  imul   0x20(%rdi,%rdx,4),%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,0x8(%r8)
  mov    %ecx,%r13d
  imul   0xc(%rdi,%rdx,4),%r13d
  mov    %esi,%r14d
  imul   0x24(%rdi,%rdx,4),%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,0xc(%r8)
  mov    %ecx,%r13d
  imul   0x10(%rdi,%rdx,4),%r13d
  mov    %esi,%r14d
  imul   0x28(%rdi,%rdx,4),%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,0x10(%r8)
  imul   0x14(%rdi,%rdx,4),%ecx
  imul   0x2c(%rdi,%rdx,4),%esi
  add    %esi,%ecx
  sar    $0x10,%ecx
  mov    %ecx,0x14(%r8)
  add    %eax,%r9d
  add    $0x18,%r8
  cmp    %r12,%r8
  jne    L2
L12:
  lea    (%r11,%r11,2),%edx
  add    %edx,%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  lea    (%rbx,%rbx,2),%eax
  add    %eax,%eax
  cltq
  shl    $0x2,%rax
  mov    -0x18(%rdi,%rdx,1),%ecx
  mov    %ecx,-0x18(%r10,%rax,1)
  mov    -0x14(%rdi,%rdx,1),%ecx
  mov    %ecx,-0x14(%r10,%rax,1)
  mov    -0x10(%rdi,%rdx,1),%ecx
  mov    %ecx,-0x10(%r10,%rax,1)
  mov    -0xc(%rdi,%rdx,1),%ecx
  mov    %ecx,-0xc(%r10,%rax,1)
  mov    -0x8(%rdi,%rdx,1),%ecx
  mov    %ecx,-0x8(%r10,%rax,1)
  mov    -0x4(%rdi,%rdx,1),%edx
  mov    %edx,-0x4(%r10,%rax,1)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void audio_out_resample_6channel(int16_t *input_samples, uint32_t in_samples, int16_t *output_samples, uint32_t out_samples) {
  int osample;
  uint32_t isample = 0;
  uint32_t istep = ((in_samples - 2) << 16) / (out_samples - 2);
  for (osample = 0; osample < out_samples - 1; osample++) {
    int s1;
    int s2;
    int16_t os;
    uint32_t t = isample & 0xffff;
    s1 = input_samples[(isample >> 16) * 6];
    s2 = input_samples[(isample >> 16) * 6 + 6];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[osample * 6] = os;
    s1 = input_samples[(isample >> 16) * 6 + 1];
    s2 = input_samples[(isample >> 16) * 6 + 7];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[(osample * 6) + 1] = os;
    s1 = input_samples[(isample >> 16) * 6 + 2];
    s2 = input_samples[(isample >> 16) * 6 + 8];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[(osample * 6) + 2] = os;
    s1 = input_samples[(isample >> 16) * 6 + 3];
    s2 = input_samples[(isample >> 16) * 6 + 9];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[(osample * 6) + 3] = os;
    s1 = input_samples[(isample >> 16) * 6 + 4];
    s2 = input_samples[(isample >> 16) * 6 + 10];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[(osample * 6) + 4] = os;
    s1 = input_samples[(isample >> 16) * 6 + 5];
    s2 = input_samples[(isample >> 16) * 6 + 11];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[(osample * 6) + 5] = os;
    isample += istep;
  }
  output_samples[out_samples * 6 - 6] = input_samples[in_samples * 6 - 6];
  output_samples[out_samples * 6 - 5] = input_samples[in_samples * 6 - 5];
  output_samples[out_samples * 6 - 4] = input_samples[in_samples * 6 - 4];
  output_samples[out_samples * 6 - 3] = input_samples[in_samples * 6 - 3];
  output_samples[out_samples * 6 - 2] = input_samples[in_samples * 6 - 2];
  output_samples[out_samples * 6 - 1] = input_samples[in_samples * 6 - 1];
}
```