user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<conv_0rgb1555_rgb565>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %edx,%r15d
  mov    %edx,0x1c(%rsp)
  mov    %ecx,%r14d
  mov    %ecx,0x48(%rsp)
  mov    %r8d,%ebp
  mov    %r9d,%ebx
  mov    $0xffc0,%edi
  call   <_mm_set1_epi16@plt>
  mov    %eax,0xc(%rsp)
  mov    $0x1f,%edi
  call   <_mm_set1_epi16@plt>
  mov    %eax,0x10(%rsp)
  mov    $0x20,%edi
  call   <_mm_set1_epi16@plt>
  mov    %eax,0x14(%rsp)
  test   %r14d,%r14d
  jle    L28
  sar    %ebp
  movslq %ebp,%rax
  shl    $0x2,%rax
  mov    %rax,0x30(%rsp)
  sar    %ebx
  movslq %ebx,%rax
  shl    $0x2,%rax
  mov    %rax,0x38(%rsp)
  lea    -0x8(%r15),%eax
  shr    $0x3,%eax
  lea    0x8(,%rax,8),%ecx
  mov    %ecx,0x4c(%rsp)
  movl   $0x0,0x18(%rsp)
  add    $0x1,%eax
  mov    %eax,%eax
  shl    $0x5,%rax
  mov    %rax,0x40(%rsp)
  jmp    L30
L36:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  add    0x30(%rsp),%r13
  add    0x38(%rsp),%r12
  cmp    %eax,0x48(%rsp)
  je     L28
L30:
  mov    %r12,%rbp
  mov    %r13,%r15
  mov    0x40(%rsp),%rax
  lea    (%rax,%r12,1),%r14
  mov    $0x0,%ecx
  cmpl   $0x7,0x1c(%rsp)
  jle    L65
  mov    %r13,0x20(%rsp)
  mov    %r12,0x28(%rsp)
L34:
  mov    %rbp,%rdi
  call   <_mm_loadu_si128@plt>
  mov    %eax,%ebx
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <_mm_slli_epi16@plt>
  mov    %eax,%edi
  mov    0xc(%rsp),%esi
  call   <_mm_and_si128@plt>
  mov    %eax,%r12d
  mov    0x10(%rsp),%esi
  mov    %ebx,%edi
  call   <_mm_and_si128@plt>
  mov    %eax,%r13d
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <_mm_srli_epi16@plt>
  mov    %eax,%edi
  mov    0x14(%rsp),%esi
  call   <_mm_and_si128@plt>
  mov    %eax,%esi
  mov    %r13d,%edi
  call   <_mm_or_si128@plt>
  mov    %eax,%esi
  mov    %r12d,%edi
  call   <_mm_or_si128@plt>
  mov    %eax,%esi
  mov    %r15,%rdi
  call   <_mm_storeu_si128@plt>
  add    $0x20,%rbp
  add    $0x20,%r15
  cmp    %r14,%rbp
  jne    L34
  mov    0x20(%rsp),%r13
  mov    0x28(%rsp),%r12
  mov    0x4c(%rsp),%ecx
L65:
  mov    0x1c(%rsp),%edi
  cmp    %ecx,%edi
  jle    L36
  movslq %ecx,%rcx
L52:
  mov    (%r12,%rcx,4),%edx
  lea    (%rdx,%rdx,1),%eax
  and    $0xffc0,%eax
  mov    %edx,%esi
  sar    $0x4,%esi
  and    $0x20,%esi
  or     %esi,%eax
  and    $0x1f,%edx
  or     %edx,%eax
  mov    %eax,0x0(%r13,%rcx,4)
  add    $0x1,%rcx
  cmp    %ecx,%edi
  jg     L52
  jmp    L36
L28:
  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;
    }
  }
}
```