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

```asm
<conv_0rgb1555_rgb565>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %r8d,%ebp
  push   %rbx
  mov    %r9d,%ebx
  sub    $0x58,%rsp
  mov    %rdi,0x18(%rsp)
  mov    $0xffc0,%edi
  mov    %edx,0x24(%rsp)
  mov    %ecx,0x40(%rsp)
  call   <_mm_set1_epi16@plt>
  mov    $0x1f,%edi
  mov    %eax,0x10(%rsp)
  call   <_mm_set1_epi16@plt>
  mov    $0x20,%edi
  mov    %eax,0x44(%rsp)
  call   <_mm_set1_epi16@plt>
  mov    %eax,0x14(%rsp)
  test   %r15d,%r15d
  jle    L8
  sar    %ebp
  sar    %ebx
  movl   $0x0,0x20(%rsp)
  mov    %r12,%r13
  movslq %ebp,%rax
  shl    $0x2,%rax
  mov    %rax,0x30(%rsp)
  movslq %ebx,%rax
  shl    $0x2,%rax
  mov    %rax,0x38(%rsp)
  lea    -0x8(%r14),%eax
  shr    $0x3,%eax
  add    $0x1,%eax
  mov    %eax,0x4c(%rsp)
  shl    $0x3,%eax
  mov    %eax,0x48(%rsp)
  nopl   (%rax)
L12:
  xor    %esi,%esi
  cmpl   $0x7,0x24(%rsp)
  jle    L50
  mov    0x4c(%rsp),%eax
  mov    0x18(%rsp),%rbx
  mov    %r13,0x28(%rsp)
  mov    0x44(%rsp),%r15d
  shl    $0x5,%rax
  add    %r13,%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L38:
  mov    %r13,%rdi
  add    $0x20,%r13
  call   <_mm_loadu_si128@plt>
  mov    $0x1,%esi
  mov    %eax,%edi
  mov    %eax,%r14d
  call   <_mm_slli_epi16@plt>
  mov    0x10(%rsp),%esi
  mov    %eax,%edi
  call   <_mm_and_si128@plt>
  mov    %r15d,%esi
  mov    %r14d,%edi
  mov    %eax,%r12d
  call   <_mm_and_si128@plt>
  mov    $0x4,%esi
  mov    %r14d,%edi
  mov    %eax,%ebp
  call   <_mm_srli_epi16@plt>
  mov    0x14(%rsp),%esi
  mov    %eax,%edi
  call   <_mm_and_si128@plt>
  mov    %ebp,%edi
  mov    %eax,%esi
  call   <_mm_or_si128@plt>
  mov    %r12d,%edi
  mov    %eax,%esi
  call   <_mm_or_si128@plt>
  mov    %rbx,%rdi
  add    $0x20,%rbx
  mov    %eax,%esi
  call   <_mm_storeu_si128@plt>
  cmp    %r13,0x8(%rsp)
  jne    L38
  mov    0x28(%rsp),%r13
  movslq 0x48(%rsp),%rsi
L50:
  mov    0x24(%rsp),%r8d
  cmp    %esi,%r8d
  jle    L37
  mov    0x18(%rsp),%rdi
  nop
L57:
  mov    0x0(%r13,%rsi,4),%edx
  mov    %edx,%ecx
  lea    (%rdx,%rdx,1),%eax
  and    $0x1f,%edx
  sar    $0x4,%ecx
  and    $0xffc0,%eax
  and    $0x20,%ecx
  or     %ecx,%eax
  or     %edx,%eax
  mov    %eax,(%rdi,%rsi,4)
  add    $0x1,%rsi
  cmp    %esi,%r8d
  jg     L57
L37:
  addl   $0x1,0x20(%rsp)
  mov    0x30(%rsp),%rdx
  mov    0x20(%rsp),%eax
  add    %rdx,0x18(%rsp)
  add    0x38(%rsp),%r13
  cmp    %eax,0x40(%rsp)
  jne    L12
L8:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void conv_0rgb1555_rgb565(void *output_, const void *input_, int width, int height, int out_stride, int in_stride) {
  const uint16_t *input = (const uint16_t *)input_;
  uint16_t *output = (uint16_t *)output_;
  int max_width = width - 7;
  const __m128i hi_mask = _mm_set1_epi16((int16_t)((0x1f << 11) | (0x1f << 6)));
  const __m128i lo_mask = _mm_set1_epi16(0x1f);
  const __m128i glow_mask = _mm_set1_epi16(1 << 5);
  for (int h = 0; h < height; h++, output += out_stride >> 1, input += in_stride >> 1) {
    int w;
    for (w = 0; w < max_width; w += 8) {
      const __m128i in = _mm_loadu_si128((const __m128i *)(input + w));
      __m128i rg = _mm_and_si128(_mm_slli_epi16(in, 1), hi_mask);
      __m128i b = _mm_and_si128(in, lo_mask);
      __m128i glow = _mm_and_si128(_mm_srli_epi16(in, 4), glow_mask);
      _mm_storeu_si128((__m128i *)(output + w), _mm_or_si128(rg, _mm_or_si128(b, glow)));
    }
    for (; w < width; w++) {
      uint16_t col = input[w];
      uint16_t rg = (col << 1) & ((0x1f << 11) | (0x1f << 6));
      uint16_t b = col & 0x1f;
      uint16_t glow = (col >> 4) & (1 << 5);
      output[w] = rg | b | glow;
    }
  }
}
```