user: 请从给定的汇编指令推导出C源代码:

```asm
<audio_out_resample_stereo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x2,%eax
  shl    $0x10,%eax
  mov    -0x30(%rbp),%edx
  lea    -0x2(%rdx),%esi
  cltd
  idiv   %esi
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L4
L10:
  mov    -0x18(%rbp),%eax
  movzwl %ax,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  sar    $0x10,%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%eax
  sar    $0x10,%eax
  add    %eax,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    $0x10000,%eax
  sub    -0x10(%rbp),%eax
  imul   -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    %edx,%eax
  sar    $0x10,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%eax
  sar    $0x10,%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%eax
  sar    $0x10,%eax
  add    %eax,%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  mov    $0x10000,%eax
  sub    -0x10(%rbp),%eax
  imul   -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    %edx,%eax
  sar    $0x10,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L4:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L10
  mov    -0x2c(%rbp),%eax
  add    %eax,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%edx
  add    %edx,%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  lea    -0x8(%rdx),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x2c(%rbp),%eax
  add    %eax,%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%edx
  add    %edx,%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  lea    -0x4(%rdx),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void audio_out_resample_stereo(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) * 2];
    s2 = input_samples[(isample >> 16) * 2 + 2];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[osample * 2] = os;
    s1 = input_samples[(isample >> 16) * 2 + 1];
    s2 = input_samples[(isample >> 16) * 2 + 3];
    os = (s1 * (0x10000 - t) + s2 * t) >> 16;
    output_samples[(osample * 2) + 1] = os;
    isample += istep;
  }
  output_samples[out_samples * 2 - 2] = input_samples[in_samples * 2 - 2];
  output_samples[out_samples * 2 - 1] = input_samples[in_samples * 2 - 1];
}
```