user: 请将以下的汇编代码转换成C语言代码:

```asm
<rgb15tobgr15>:
  endbr64
  mov    %rdi,%rcx
  mov    %rsi,%rdi
  mov    %edx,%esi
  shr    %esi
  je     L14
  lea    0x8(%rcx),%rdx
  mov    %rdi,%rax
  lea    -0x1(%rsi),%r9d
  sub    %rdx,%rax
  cmp    $0x10,%rax
  jbe    L46
  cmp    $0x3,%r9d
  jbe    L46
  mov    %r9d,%r8d
  mov    %rcx,%rdx
  mov    %rdi,%rax
  movdqa D16(%rip),%xmm5
  shr    $0x2,%r8d
  movdqa D24(%rip),%xmm4
  movdqa D25(%rip),%xmm3
  sub    $0x1,%r8d
  shl    $0x5,%r8
  lea    0x20(%rcx,%r8,1),%r8
  nopl   0x0(%rax,%rax,1)
L61:
  movdqu (%rdx),%xmm1
  movdqu 0x10(%rdx),%xmm6
  add    $0x20,%rdx
  add    $0x20,%rax
  shufps $0x88,%xmm6,%xmm1
  movdqa %xmm1,%xmm0
  movdqa %xmm1,%xmm2
  pand   %xmm3,%xmm1
  psrad  $0xa,%xmm0
  pslld  $0xa,%xmm2
  pand   %xmm5,%xmm0
  pand   %xmm4,%xmm2
  por    %xmm2,%xmm0
  por    %xmm1,%xmm0
  pshufd $0x55,%xmm0,%xmm1
  movd   %xmm0,-0x20(%rax)
  movd   %xmm1,-0x18(%rax)
  movdqa %xmm0,%xmm1
  punpckhdq %xmm0,%xmm1
  pshufd $0xff,%xmm0,%xmm0
  movd   %xmm1,-0x10(%rax)
  movd   %xmm0,-0x8(%rax)
  cmp    %r8,%rdx
  jne    L61
  mov    %r9d,%eax
  and    $0xfffffffc,%eax
  lea    (%rax,%rax,1),%r11d
  mov    (%rcx,%r11,4),%r9d
  mov    %r11,%r8
  mov    %r9d,%edx
  mov    %r9d,%r10d
  and    $0x3e0,%r9d
  shl    $0xa,%edx
  sar    $0xa,%r10d
  and    $0x7c00,%edx
  and    $0x1f,%r10d
  or     %r10d,%edx
  or     %r9d,%edx
  mov    %edx,(%rdi,%r11,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%esi
  jbe    L14
  lea    0x2(%r11),%r10d
  mov    (%rcx,%r10,4),%r9d
  mov    %r9d,%edx
  mov    %r9d,%r11d
  and    $0x3e0,%r9d
  sar    $0xa,%edx
  shl    $0xa,%r11d
  and    $0x1f,%edx
  and    $0x7c00,%r11d
  or     %r11d,%edx
  or     %r9d,%edx
  mov    %edx,(%rdi,%r10,4)
  lea    0x2(%rax),%edx
  cmp    %edx,%esi
  jbe    L14
  lea    0x4(%r8),%r10d
  add    $0x3,%eax
  mov    (%rcx,%r10,4),%r9d
  mov    %r9d,%edx
  mov    %r9d,%r11d
  and    $0x3e0,%r9d
  sar    $0xa,%edx
  shl    $0xa,%r11d
  and    $0x1f,%edx
  and    $0x7c00,%r11d
  or     %r11d,%edx
  or     %r9d,%edx
  mov    %edx,(%rdi,%r10,4)
  cmp    %eax,%esi
  jbe    L14
  add    $0x6,%r8d
  mov    (%rcx,%r8,4),%edx
  mov    %edx,%eax
  mov    %edx,%ecx
  and    $0x3e0,%edx
  sar    $0xa,%eax
  shl    $0xa,%ecx
  and    $0x1f,%eax
  and    $0x7c00,%ecx
  or     %ecx,%eax
  or     %edx,%eax
  mov    %eax,(%rdi,%r8,4)
  ret
  cs nopw 0x0(%rax,%rax,1)
L46:
  mov    %esi,%esi
  xor    %r8d,%r8d
  nopl   (%rax)
L40:
  mov    (%rcx,%r8,8),%edx
  mov    %edx,%eax
  mov    %edx,%r9d
  and    $0x3e0,%edx
  shl    $0xa,%eax
  sar    $0xa,%r9d
  and    $0x7c00,%eax
  and    $0x1f,%r9d
  or     %r9d,%eax
  or     %edx,%eax
  mov    %eax,(%rdi,%r8,8)
  add    $0x1,%r8
  cmp    %r8,%rsi
  jne    L40
L14:
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D16
type_guessed: byte[16]
name: unpack_data
arguments: data_label: D24
type_guessed: byte[16]
name: unpack_data
arguments: data_label: D25
type_guessed: byte[16]

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

tool: {"D24": [0x00,0x7c,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x7c,0x00,0x00]}

tool: {"D25": [0xe0,0x03,0x00,0x00,0xe0,0x03,0x00,0x00,0xe0,0x03,0x00,0x00,0xe0,0x03,0x00,0x00]}

assistant: ```c
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, unsigned int src_size) {
  unsigned i;
  unsigned num_pixels = src_size >> 1;
  for (i = 0; i < num_pixels; i++) {
    unsigned b, g, r;
    register uint16_t rgb;
    rgb = src[2 * i];
    r = rgb & 0x1F;
    g = (rgb & 0x3E0) >> 5;
    b = (rgb & 0x7C00) >> 10;
    dst[2 * i] = (b & 0x1F) | ((g & 0x1F) << 5) | ((r & 0x1F) << 10);
  }
}
```