user: What is the c source code of the assembly code below?

```asm
<RGB555toRGB565>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %edx,0x18(%rsp)
  mov    %ecx,%ebp
  mov    %r8d,0x10(%rsp)
  mov    %r9d,%ebx
  mov    0x90(%rsp),%r15
  mov    0xa8(%rsp),%r13d
  mov    0xb0(%rsp),%r12d
  mov    0xc0(%rsp),%r14d
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x34(%rsp),%rax
  push   %rax
  lea    0x38(%rsp),%rax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  push   %r14
  mov    0xd8(%rsp),%eax
  push   %rax
  push   %r12
  push   %r13
  mov    0xd8(%rsp),%eax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  push   %r15
  mov    0xd8(%rsp),%eax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  call   <chk_args@plt>
  add    $0x60,%rsp
  test   %eax,%eax
  je     L256
  test   %r13d,%r13d
  js     L14
L98:
  test   %ebp,%ebp
  js     L25
L86:
  mov    0x30(%rsp),%eax
  cmp    $0x1,%eax
  je     L308
  cmp    $0x2,%eax
  jne    L109
  cmpl   $0x2,0x34(%rsp)
  jne    L185
  lea    (%r12,%r12,1),%edx
  movslq %edx,%rdx
  mov    %r13d,%eax
  imul   0xb8(%rsp),%eax
  cltq
  add    %rax,%rdx
  add    %r15,%rdx
  mov    0x10(%rsp),%eax
  add    %eax,%eax
  cltq
  imul   %ebp,%ebx
  movslq %ebx,%rcx
  lea    (%rax,%rcx,1),%rbx
  add    0x8(%rsp),%rbx
  cmpl   $0x0,0xc8(%rsp)
  jle    L267
  lea    0x0(,%r14,4),%eax
  mov    %eax,0x8(%rsp)
  cltq
  neg    %rax
  mov    %rax,0x10(%rsp)
  movslq %r13d,%r13
  lea    (%r14,%r14,1),%eax
  cltq
  sub    %rax,%r13
  mov    %r13,0x20(%rsp)
  lea    0x0(%rbp,%rbp,1),%eax
  cltq
  mov    %rax,0x18(%rsp)
  mov    $0x0,%r13d
  mov    %r12d,%r15d
  and    $0x3,%r15d
  lea    0x1(%r12,%r14,1),%r12d
  movslq %ebp,%rax
  mov    %rax,0x28(%rsp)
  jmp    L167
L14:
  mov    0xa0(%rsp),%eax
  sub    $0x1,%eax
  imul   %r13d,%eax
  cltq
  sub    %rax,%r15
  jmp    L98
L25:
  mov    0x18(%rsp),%eax
  sub    $0x1,%eax
  imul   %ebp,%eax
  cltq
  sub    %rax,0x8(%rsp)
  jmp    L86
L308:
  mov    $0xffffffff,%eax
  cmpl   $0x1,0x34(%rsp)
  jne    L125
  lea    (%r12,%r12,1),%eax
  cltq
  mov    %r13d,%edx
  imul   0xb8(%rsp),%edx
  movslq %edx,%rdx
  add    %rdx,%rax
  add    %r15,%rax
  mov    0x10(%rsp),%r8d
  add    %r8d,%r8d
  movslq %r8d,%r8
  imul   %ebp,%ebx
  movslq %ebx,%rdx
  add    %rdx,%r8
  add    0x8(%rsp),%r8
  cmpl   $0x0,0x88(%rsp)
  jle    L127
  mov    0x80(%rsp),%edi
  lea    (%rdi,%rdi,1),%edx
  sub    %edx,%r13d
  movslq %r13d,%r14
  sub    %edx,%ebp
  movslq %ebp,%r15
  mov    $0x0,%ebp
  mov    %r12d,%r13d
  and    $0x3,%r13d
  lea    0x1(%rdi,%r12,1),%r11d
  mov    %r14,0x8(%rsp)
  mov    %r15,0x10(%rsp)
  mov    %edi,%r14d
  mov    0x88(%rsp),%r15d
  jmp    L290
L62:
  mov    %rax,%r10
  jmp    L249
L6:
  mov    %r14d,%edi
L76:
  cmp    $0x3,%edi
  jle    L62
  lea    -0x4(%rdi),%ebx
  shr    $0x2,%ebx
  lea    0x1(%rbx),%r12d
  mov    %r12d,%r12d
  shl    $0x3,%r12
  lea    (%rax,%r12,1),%r10
  mov    %r8,%r9
L20:
  mov    (%rax),%esi
  mov    0x4(%rax),%ecx
  lea    (%rsi,%rsi,1),%edx
  and    $0xffc0ffc0,%edx
  and    $0x1f001f,%esi
  or     %esi,%edx
  mov    %edx,(%r9)
  lea    (%rcx,%rcx,1),%edx
  and    $0xffc0ffc0,%edx
  and    $0x1f001f,%ecx
  or     %ecx,%edx
  mov    %edx,0x4(%r9)
  add    $0x8,%r9
  add    $0x8,%rax
  cmp    %r10,%rax
  jne    L20
  add    %r12,%r8
  neg    %ebx
  lea    -0x4(%rdi,%rbx,4),%edi
L249:
  test   %edi,%edi
  je     L27
  mov    %edi,%ecx
  mov    $0x0,%edx
L266:
  movzwl (%r10,%rdx,2),%esi
  lea    (%rsi,%rsi,1),%eax
  and    $0xffffffc0,%eax
  and    $0x1f,%esi
  or     %esi,%eax
  mov    %ax,(%r8,%rdx,2)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L266
  lea    -0x1(%rdi),%eax
  lea    0x2(%rax,%rax,1),%rax
  add    %rax,%r8
  add    %rax,%r10
L27:
  mov    0x8(%rsp),%rax
  add    %r10,%rax
  add    0x10(%rsp),%r8
  add    $0x1,%ebp
  cmp    %ebp,%r15d
  je     L298
L290:
  test   %r13d,%r13d
  je     L6
  mov    %r14d,%edi
  test   %r14d,%r14d
  je     L6
L33:
  movzwl (%rax),%ecx
  lea    (%rcx,%rcx,1),%edx
  and    $0xffffffc0,%edx
  and    $0x1f,%ecx
  or     %ecx,%edx
  mov    %dx,(%r8)
  add    $0x2,%r8
  add    $0x2,%rax
  mov    %r11d,%edx
  sub    %edi,%edx
  sub    $0x1,%edi
  test   $0x3,%dl
  je     L76
  test   %edi,%edi
  jne    L33
  jmp    L76
L70:
  mov    %rdx,%rbp
  jmp    L80
L143:
  mov    %r14d,%ecx
L380:
  cmp    $0x3,%ecx
  jle    L70
  lea    -0x4(%rcx),%edi
  shr    $0x2,%edi
  lea    0x1(%rdi),%r8d
  mov    %r8d,%r8d
  lea    (%rdx,%r8,8),%rbp
  mov    %rbx,%rsi
L3:
  mov    (%rdx),%r9d
  lea    (%r9,%r9,1),%eax
  and    $0xffc0ffc0,%eax
  and    $0x1f001f,%r9d
  or     %r9d,%eax
  movzwl %ax,%r9d
  mov    %eax,%r10d
  shl    $0x10,%r10d
  or     %r10d,%r9d
  mov    %r9d,(%rsi)
  mov    %eax,%r9d
  mov    $0x0,%r9w
  shr    $0x10,%eax
  or     %r9d,%eax
  mov    %eax,0x4(%rsi)
  mov    0x4(%rdx),%r9d
  lea    (%r9,%r9,1),%eax
  and    $0xffc0ffc0,%eax
  and    $0x1f001f,%r9d
  or     %r9d,%eax
  movzwl %ax,%r9d
  mov    %eax,%r10d
  shl    $0x10,%r10d
  or     %r10d,%r9d
  mov    %r9d,0x8(%rsi)
  mov    %eax,%r9d
  mov    $0x0,%r9w
  shr    $0x10,%eax
  or     %r9d,%eax
  mov    %eax,0xc(%rsi)
  add    $0x10,%rsi
  add    $0x8,%rdx
  cmp    %rbp,%rdx
  jne    L3
  shl    $0x4,%r8
  add    %r8,%rbx
  neg    %edi
  lea    -0x4(%rcx,%rdi,4),%ecx
L80:
  test   %ecx,%ecx
  je     L104
  mov    %ecx,%edi
  mov    $0x0,%edx
L355:
  movzwl 0x0(%rbp,%rdx,2),%esi
  lea    (%rsi,%rsi,1),%eax
  and    $0xffffffc0,%eax
  and    $0x1f,%esi
  or     %esi,%eax
  mov    %ax,(%rbx,%rdx,4)
  mov    %ax,0x2(%rbx,%rdx,4)
  add    $0x1,%rdx
  cmp    %rdi,%rdx
  jne    L355
  lea    -0x1(%rcx),%eax
  add    $0x1,%rax
  lea    (%rbx,%rax,4),%rbx
  lea    0x0(%rbp,%rax,2),%rbp
L104:
  add    0x10(%rsp),%rbx
  mov    0x28(%rsp),%rax
  lea    (%rbx,%rax,1),%rdi
  mov    0x8(%rsp),%edx
  mov    %rbx,%rsi
  call   <memcpy@plt>
  mov    0x20(%rsp),%rax
  lea    0x0(%rbp,%rax,1),%rdx
  add    0x18(%rsp),%rbx
  add    $0x1,%r13d
  cmp    %r13d,0xc8(%rsp)
  je     L347
L167:
  test   %r15d,%r15d
  je     L143
  mov    %r14d,%ecx
  test   %r14d,%r14d
  je     L143
L163:
  movzwl (%rdx),%esi
  lea    (%rsi,%rsi,1),%eax
  and    $0xffffffc0,%eax
  and    $0x1f,%esi
  or     %esi,%eax
  mov    %ax,(%rbx)
  mov    %ax,0x2(%rbx)
  add    $0x4,%rbx
  add    $0x2,%rdx
  mov    %r12d,%eax
  sub    %ecx,%eax
  sub    $0x1,%ecx
  test   $0x3,%al
  je     L380
  test   %ecx,%ecx
  jne    L163
  jmp    L380
L256:
  mov    $0xffffffff,%eax
  jmp    L125
L127:
  mov    $0x0,%eax
  jmp    L125
L298:
  mov    $0x0,%eax
  jmp    L125
L109:
  mov    $0xffffffff,%eax
  jmp    L125
L185:
  mov    $0xffffffff,%eax
  jmp    L125
L267:
  mov    $0x0,%eax
  jmp    L125
L347:
  mov    $0x0,%eax
L125:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L246
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L246:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int RGB555toRGB565(unsigned char *dest_ptr, int dest_width, int dest_height, int dest_pitch, int dest_x, int dest_y, int dest_dx, int dest_dy, unsigned char *src_ptr, int src_width, int src_height, int src_pitch, int src_x, int src_y, int src_dx, int src_dy) {
  int scale_x, scale_y;
  if (!chk_args(dest_ptr, dest_width, dest_height, dest_pitch, dest_x, dest_y, dest_dx, dest_dy, src_ptr, src_width, src_height, src_pitch, src_x, src_y, src_dx, src_dy, &scale_x, &scale_y))
    return -1;
  if (src_pitch < 0)
    src_ptr -= (src_height - 1) * src_pitch;
  if (dest_pitch < 0)
    dest_ptr -= (dest_height - 1) * dest_pitch;
  if (scale_x == 1 && scale_y == 1) {
    unsigned char *s, *d;
    register int i;
    s = src_ptr + src_x * 2 + src_y * src_pitch;
    d = dest_ptr + dest_x * 2 + dest_y * dest_pitch;
    for (i = 0; i < dest_dy; i++) {
      register int sx = src_x, ddx = dest_dx;
      while ((sx & 3) && ddx) {
        register unsigned short c = *(unsigned short *)s;
        *(unsigned short *)d = (c & 0x1F) | ((c & 0x7FE0) << 1);
        d += 2;
        s += 2;
        sx++;
        ddx--;
      }
      while (ddx >= 4) {
        register unsigned int a, b;
        a = *(unsigned int *)s;
        b = *(unsigned int *)(s + 4);
        *(unsigned int *)d = (a & 0x1F001F) | ((a & 0x7FE07FE0) << 1);
        *(unsigned int *)(d + 4) = (b & 0x1F001F) | ((b & 0x7FE07FE0) << 1);
        d += 2 * 4;
        s += 2 * 4;
        ddx -= 4;
      }
      while (ddx) {
        register unsigned short c = *(unsigned short *)s;
        *(unsigned short *)d = (c & 0x1F) | ((c & 0x7FE0) << 1);
        d += 2;
        s += 2;
        ddx--;
      }
      s += src_pitch - dest_dx * 2;
      d += dest_pitch - dest_dx * 2;
    }
    return 0;
  }
  if (scale_x == 2 && scale_y == 2) {
    unsigned char *s, *d;
    register int i;
    s = src_ptr + src_x * 2 + src_y * src_pitch;
    d = dest_ptr + dest_x * 2 + dest_y * dest_pitch;
    for (i = 0; i < src_dy; i++) {
      register int sx = src_x, sdx = src_dx;
      while ((sx & 3) && sdx) {
        register unsigned short a, b;
        a = *(unsigned short *)s;
        b = (a & 0x1F) | ((a & 0x7FE0) << 1);
        *(unsigned short *)d = b;
        *(unsigned short *)(d + 2) = b;
        d += 2 * 2;
        s += 2;
        sx++;
        sdx--;
      }
      while (sdx >= 4) {
        register unsigned int a, b;
        a = *(unsigned int *)s;
        b = (a & 0x1F001F) | ((a & 0x7FE07FE0) << 1);
        *(unsigned int *)d = (b & 0xFFFF) | (b << 16);
        *(unsigned int *)(d + 2 * 2) = (b & 0xFFFF0000) | (b >> 16);
        a = *(unsigned int *)(s + 2 * 2);
        b = (a & 0x1F001F) | ((a & 0x7FE07FE0) << 1);
        *(unsigned int *)(d + 2 * 2 * 2) = (b & 0xFFFF) | (b << 16);
        *(unsigned int *)(d + 3 * 2 * 2) = (b & 0xFFFF0000) | (b >> 16);
        d += 2 * 4 * 2;
        s += 4 * 2;
        sdx -= 4;
      }
      while (sdx) {
        register unsigned short a, b;
        a = *(unsigned short *)s;
        b = (a & 0x1F) | ((a & 0x7FE0) << 1);
        *(unsigned short *)d = b;
        *(unsigned short *)(d + 2) = b;
        d += 2 * 2;
        s += 2;
        sdx--;
      }
      s -= src_dx * 2;
      d -= src_dx * 2 * 2;
      memcpy(d + dest_pitch, d, src_dx * 2 * 2);
      s += src_pitch;
      d += dest_pitch * 2;
    }
    return 0;
  }
  return -1;
}
```