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

```asm
<audio_out_resample_6channel>:
  endbr64
  lea    -0x2(%rsi),%eax
  push   %r14
  mov    %rdx,%r10
  mov    %esi,%r11d
  shl    $0x10,%eax
  push   %r13
  cltd
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x2,%ecx
  idiv   %ecx
  cmp    $0x1,%ebx
  jle    L7
  lea    (%rcx,%rcx,2),%rdx
  mov    %r10,%r8
  xor    %r9d,%r9d
  mov    $0x10000,%ebp
  lea    0x18(%r10,%rdx,8),%r12
  nopl   (%rax)
L18:
  mov    %r9d,%edx
  movzwl %r9w,%esi
  mov    %ebp,%ecx
  add    $0x18,%r8
  sar    $0x10,%edx
  sub    %esi,%ecx
  add    %eax,%r9d
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%edx
  movslq %edx,%rdx
  mov    0x18(%rdi,%rdx,4),%r13d
  mov    (%rdi,%rdx,4),%r14d
  imul   %esi,%r13d
  imul   %ecx,%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,-0x18(%r8)
  mov    0x1c(%rdi,%rdx,4),%r13d
  mov    0x4(%rdi,%rdx,4),%r14d
  imul   %esi,%r13d
  imul   %ecx,%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,-0x14(%r8)
  mov    0x8(%rdi,%rdx,4),%r13d
  mov    0x20(%rdi,%rdx,4),%r14d
  imul   %ecx,%r13d
  imul   %esi,%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,-0x10(%r8)
  mov    0xc(%rdi,%rdx,4),%r13d
  mov    0x24(%rdi,%rdx,4),%r14d
  imul   %ecx,%r13d
  imul   %esi,%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,-0xc(%r8)
  mov    0x10(%rdi,%rdx,4),%r13d
  mov    0x28(%rdi,%rdx,4),%r14d
  imul   %ecx,%r13d
  imul   %esi,%r14d
  add    %r14d,%r13d
  sar    $0x10,%r13d
  mov    %r13d,-0x8(%r8)
  imul   0x14(%rdi,%rdx,4),%ecx
  imul   0x2c(%rdi,%rdx,4),%esi
  add    %esi,%ecx
  sar    $0x10,%ecx
  mov    %ecx,-0x4(%r8)
  cmp    %r8,%r12
  jne    L18
L7:
  lea    (%r11,%r11,2),%edx
  lea    (%rbx,%rbx,2),%eax
  add    %edx,%edx
  add    %eax,%eax
  movslq %edx,%rdx
  cltq
  shl    $0x2,%rdx
  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];
}
```