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

```asm
<ximage_convert_rgb565_br>:
  endbr64
  test   %r9d,%r9d
  jle    L52
  push   %r14
  movslq %esi,%r11
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r9d,%ebx
  movslq %ecx,%r9
  test   %r8d,%r8d
  jle    L24
  lea    -0x1(%r8),%r12d
  movdqa D43(%rip),%xmm3
  movdqa D21(%rip),%xmm8
  mov    %rdx,%r10
  mov    %r12d,%eax
  mov    %r12d,%r13d
  movdqa D3(%rip),%xmm7
  xor    %esi,%esi
  shr    $0x4,%eax
  movdqa D22(%rip),%xmm6
  and    $0xfffffff0,%r13d
  pxor   %xmm4,%xmm4
  lea    -0x1(%rax),%ebp
  movdqa D42(%rip),%xmm5
  add    $0x1,%rbp
  shl    $0x6,%rbp
  nopl   (%rax)
L67:
  mov    %rdi,%rax
  mov    %r10,%rdx
  lea    0x0(%rbp,%rdi,1),%rcx
  cmp    $0xf,%r12d
  jbe    L41
  nopl   (%rax)
L5:
  movdqu (%rax),%xmm1
  movdqu 0x10(%rax),%xmm0
  add    $0x40,%rax
  add    $0x20,%rdx
  movdqu -0x20(%rax),%xmm10
  movdqu -0x30(%rax),%xmm9
  pand   %xmm3,%xmm0
  pand   %xmm3,%xmm1
  movdqu -0x10(%rax),%xmm11
  packuswb %xmm0,%xmm1
  movdqu -0x10(%rax),%xmm0
  pand   %xmm3,%xmm10
  psrlw  $0x8,%xmm9
  psrlw  $0x8,%xmm11
  movdqa %xmm1,%xmm2
  pand   %xmm3,%xmm0
  psrlw  $0x8,%xmm2
  pand   %xmm3,%xmm1
  packuswb %xmm0,%xmm10
  movdqa %xmm10,%xmm0
  pand   %xmm3,%xmm10
  psrlw  $0x8,%xmm0
  packuswb %xmm10,%xmm1
  packuswb %xmm0,%xmm2
  movdqu -0x40(%rax),%xmm0
  pand   %xmm8,%xmm1
  psrlw  $0x8,%xmm0
  packuswb %xmm9,%xmm0
  movdqu -0x20(%rax),%xmm9
  pand   %xmm3,%xmm0
  psrlw  $0x8,%xmm9
  packuswb %xmm11,%xmm9
  pand   %xmm3,%xmm9
  packuswb %xmm9,%xmm0
  movdqa %xmm0,%xmm9
  psrlw  $0x5,%xmm9
  pand   %xmm7,%xmm9
  por    %xmm9,%xmm1
  movdqa %xmm2,%xmm9
  punpckhbw %xmm4,%xmm2
  punpcklbw %xmm4,%xmm9
  psllw  $0x5,%xmm2
  movdqa %xmm1,%xmm10
  psllw  $0x5,%xmm9
  punpcklbw %xmm4,%xmm10
  pand   %xmm6,%xmm2
  pand   %xmm6,%xmm9
  punpckhbw %xmm4,%xmm1
  por    %xmm10,%xmm9
  movdqa %xmm0,%xmm10
  punpckhbw %xmm4,%xmm0
  punpcklbw %xmm4,%xmm10
  psllw  $0xb,%xmm0
  por    %xmm2,%xmm1
  psllw  $0xb,%xmm10
  pand   %xmm5,%xmm0
  pand   %xmm5,%xmm10
  por    %xmm0,%xmm1
  por    %xmm10,%xmm9
  movups %xmm1,-0x10(%rdx)
  movups %xmm9,-0x20(%rdx)
  cmp    %rax,%rcx
  jne    L5
  movslq %r13d,%rcx
  nopl   0x0(%rax)
L49:
  movzbl 0x1(%rdi,%rcx,4),%r14d
  movzbl 0x2(%rdi,%rcx,4),%eax
  mov    %r14d,%edx
  shl    $0x5,%eax
  shl    $0xb,%edx
  and    $0x1f00,%ax
  shr    $0x5,%r14b
  and    $0xe000,%dx
  or     %edx,%eax
  movzbl (%rdi,%rcx,4),%edx
  and    $0xfffffff8,%edx
  or     %r14d,%edx
  movzbl %dl,%edx
  or     %edx,%eax
  mov    %ax,(%r10,%rcx,2)
  add    $0x1,%rcx
  cmp    %ecx,%r8d
  jg     L49
  add    $0x1,%esi
  add    %r11,%rdi
  add    %r9,%r10
  cmp    %esi,%ebx
  jne    L67
L24:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L41:
  xor    %ecx,%ecx
  jmp    L49
L52:
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D43
type: byte[16]
name: parse_data
arguments: data_tag: D21
type: byte[16]
name: parse_data
arguments: data_tag: D3
type: byte[16]
name: parse_data
arguments: data_tag: D22
type: byte[16]
name: parse_data
arguments: data_tag: D42
type: byte[16]

tool: {"D43": [0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00]}

tool: {"D21": [0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8]}

tool: {"D3": [0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07]}

tool: {"D22": [0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f,0x00,0x1f]}

tool: {"D42": [0x00,0xe0,0x00,0xe0,0x00,0xe0,0x00,0xe0,0x00,0xe0,0x00,0xe0,0x00,0xe0,0x00,0xe0]}

assistant: ```c
void ximage_convert_rgb565_br(const unsigned char *__restrict src, int srcstride, unsigned char *__restrict dst, int dststride, int w, int h) {
  unsigned char r, g, b;
  int x, y;
  for (y = 0; y < h; y++) {
    for (x = 0; x < w; x++) {
      r = src[4 * x + 0];
      g = src[4 * x + 1];
      b = src[4 * x + 2];
      ((unsigned short *)dst)[x] = (r & 0xF8) | ((g & 0xE0) >> 5) | ((g & 0x1C) << 11) | ((b & 0xF8) << 5);
    }
    src += srcstride;
    dst += dststride;
  }
}
```