user: Demonstrate the C code that generates the assembly output below:

```asm
<mix_mono_u16>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  xor    %edi,%edi
  sub    $0x38,%rsp
  cmp    $0x1,%esi
  setg   %dil
  call   <assert@plt>
  test   %r12,%r12
  je     L55
  movslq %ebp,%r9
  mov    %ebp,%r8d
  lea    -0x1(%rbp),%r11d
  lea    0x0(,%r9,8),%rsi
  and    $0xfffffffc,%r8d
  mov    %rsi,%rax
  mov    %r8d,%edx
  neg    %rax
  lea    0x0(,%rdx,8),%rcx
  mov    %r11d,%edx
  mov    %rax,0x28(%rsp)
  mov    D6(%rip),%rax
  lea    0x8(,%rdx,8),%r10
  sub    %r9,%rdx
  lea    0x8(,%rdx,8),%r14
  mov    %ebp,%edx
  mov    %rcx,0x10(%rsp)
  mov    %ebp,%ecx
  mov    (%rax),%edi
  mov    %ebp,%eax
  shr    %edx
  and    $0xfffffffe,%ecx
  shr    $0x2,%eax
  sub    $0x1,%edx
  mov    %ecx,0x4(%rsp)
  mov    %r10,%r13
  sub    $0x1,%eax
  add    $0x1,%rdx
  shl    $0x3,%rcx
  sub    %rsi,%r13
  add    $0x1,%rax
  shl    $0x4,%rdx
  mov    %rcx,0x8(%rsp)
  xor    %ecx,%ecx
  shl    $0x5,%rax
  mov    %rdx,0x18(%rsp)
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax)
L29:
  test   %ebp,%ebp
  jle    L84
  cmp    $0x2,%r11d
  jbe    L123
  mov    0x20(%rsp),%rsi
  mov    %rbx,%rax
  pxor   %xmm1,%xmm1
  lea    (%rsi,%rbx,1),%rdx
  nopw   0x0(%rax,%rax,1)
L36:
  movdqu (%rax),%xmm0
  movdqu 0x10(%rax),%xmm2
  add    $0x20,%rax
  shufps $0x88,%xmm2,%xmm0
  paddd  %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L36
  movdqa %xmm1,%xmm0
  mov    0x10(%rsp),%rsi
  mov    %r8d,%edx
  psrldq $0x8,%xmm0
  paddd  %xmm0,%xmm1
  add    %rbx,%rsi
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%eax
  cmp    %r8d,%ebp
  je     L9
  lea    0x1(%rdx),%r15d
  add    (%rsi),%eax
  cmp    %r15d,%ebp
  jle    L15
L52:
  add    $0x2,%edx
  add    0x8(%rsi),%eax
  cmp    %edx,%ebp
  jle    L9
  add    0x10(%rsi),%eax
L9:
  cltd
  lea    (%rbx,%r13,1),%rsi
  idiv   %ebp
  cmp    %eax,%edi
  cmovle %edi,%eax
  cltq
L79:
  mov    0x18(%rsp),%rdx
  movq   %rax,%xmm0
  add    %r14,%rbx
  punpcklqdq %xmm0,%xmm0
  add    %rbx,%rdx
  cs nopw 0x0(%rax,%rax,1)
L116:
  movups %xmm0,(%rbx)
  add    $0x10,%rbx
  cmp    %rbx,%rdx
  jne    L116
  mov    0x8(%rsp),%rdx
  lea    (%rsi,%rdx,1),%r15
  cmp    %ebp,0x4(%rsp)
  je     L81
L102:
  mov    %rax,(%r15)
L81:
  lea    (%rsi,%r10,1),%rbx
L88:
  add    %r9,%rcx
  cmp    %rcx,%r12
  ja     L29
L55:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L84:
  add    0x28(%rsp),%rbx
  jmp    L88
L123:
  xor    %edx,%edx
  mov    %rbx,%rsi
  xor    %eax,%eax
  lea    0x1(%rdx),%r15d
  add    (%rsi),%eax
  cmp    %r15d,%ebp
  jg     L52
L15:
  cltd
  lea    (%rbx,%r13,1),%r15
  idiv   %ebp
  mov    %r15,%rsi
  cmp    %edi,%eax
  cmovg  %edi,%eax
  cltq
  cmp    $0x1,%ebp
  je     L102
  jmp    L79
```

assistant: ```c
void mix_mono_u16(uint16_t *buf, int channels, size_t samples) {
  int c;
  size_t i = 0;
  do {
  } while (0);
  assert(channels > 1);
  while (i < samples) {
    int32_t mono = 0;
    for (c = 0; c < channels; c++)
      mono += *buf++;
    buf -= channels;
    mono /= channels;
    mono = ((mono) < (UINT16_MAX) ? (mono) : (UINT16_MAX));
    for (c = 0; c < channels; c++)
      *buf++ = (uint16_t)mono;
    i += channels;
  }
}
```