user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<RGB24toRGB32>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x34(%rsp),%rax
  mov    0x90(%rsp),%r14
  movslq 0xa8(%rsp),%r12
  mov    0xb0(%rsp),%ebp
  mov    0xc0(%rsp),%ebx
  push   %rax
  lea    0x38(%rsp),%rax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  push   %rbx
  mov    0xd8(%rsp),%eax
  push   %rax
  push   %rbp
  push   %r12
  mov    0xd8(%rsp),%eax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  push   %r14
  mov    0xd8(%rsp),%eax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  mov    %r9d,0x78(%rsp)
  mov    %edx,0x70(%rsp)
  mov    %rdi,0x68(%rsp)
  call   <chk_args@plt>
  add    $0x60,%rsp
  test   %eax,%eax
  je     L158
  test   %r12d,%r12d
  mov    0x8(%rsp),%rdi
  mov    0x10(%rsp),%edx
  mov    0x18(%rsp),%r9d
  jns    L7
  mov    0xa0(%rsp),%eax
  sub    $0x1,%eax
  imul   %r12d,%eax
  cltq
  sub    %rax,%r14
L7:
  test   %r15d,%r15d
  jns    L248
  sub    $0x1,%edx
  imul   %r15d,%edx
  movslq %edx,%rax
  sub    %rax,%rdi
L248:
  mov    0x30(%rsp),%eax
  cmp    $0x1,%eax
  je     L173
  cmp    $0x2,%eax
  jne    L158
  cmpl   $0x2,0x34(%rsp)
  jne    L158
  imul   %r15d,%r9d
  lea    0x0(%rbp,%rbp,2),%eax
  mov    0xc8(%rsp),%ecx
  movslq %eax,%rdx
  mov    0xb8(%rsp),%eax
  imul   %r12d,%eax
  cltq
  add    %rdx,%rax
  movslq %r9d,%rdx
  add    %rax,%r14
  lea    0x0(,%r13,4),%eax
  cltq
  add    %rdx,%rax
  add    %rdi,%rax
  test   %ecx,%ecx
  jle    L352
  lea    0x0(,%rbx,8),%r13d
  movslq %r13d,%rdx
  neg    %rdx
  mov    %rdx,0x8(%rsp)
  lea    (%rbx,%rbx,2),%edx
  movslq %edx,%rdx
  sub    %rdx,%r12
  mov    %r12,0x18(%rsp)
  lea    (%r15,%r15,1),%r12d
  movslq %r12d,%rsi
  mov    %rsi,0x10(%rsp)
  movslq %r15d,%rsi
  xor    %r15d,%r15d
  mov    %rsi,0x20(%rsp)
  mov    %ebp,%esi
  and    $0x3,%esi
  mov    %esi,0x28(%rsp)
  lea    0x1(%rbx),%esi
  mov    %esi,0x2c(%rsp)
  nopl   0x0(%rax,%rax,1)
L250:
  mov    0x28(%rsp),%edx
  test   %edx,%edx
  je     L139
  mov    0x2c(%rsp),%edi
  mov    %ebx,%esi
  lea    (%rdi,%rbp,1),%ecx
  test   %ebx,%ebx
  jne    L156
  jmp    L287
  xchg   %ax,%ax
L26:
  test   %esi,%esi
  je     L287
L156:
  movzbl 0x1(%r14),%edx
  movzbl 0x2(%r14),%edi
  add    $0x8,%rax
  add    $0x3,%r14
  shl    $0x10,%edi
  shl    $0x8,%edx
  or     %edi,%edx
  movzbl -0x3(%r14),%edi
  or     %edi,%edx
  mov    %edx,-0x8(%rax)
  mov    %edx,-0x4(%rax)
  mov    %ecx,%edx
  sub    %esi,%edx
  sub    $0x1,%esi
  and    $0x3,%edx
  jne    L26
L333:
  mov    %rax,%r8
  cmp    $0x3,%esi
  jle    L50
  sub    $0x4,%esi
  mov    %r14,%rdi
  mov    %esi,%r10d
  shr    $0x2,%r10d
  lea    0x1(%r10),%r9d
  mov    %r9,%r8
  shl    $0x5,%r8
  add    %rax,%r8
  nopw   0x0(%rax,%rax,1)
L152:
  mov    (%rdi),%ecx
  mov    0x4(%rdi),%edx
  add    $0x20,%rax
  add    $0xc,%rdi
  mov    %ecx,%r11d
  shr    $0x18,%ecx
  and    $0xffffff,%r11d
  mov    %r11d,-0x20(%rax)
  mov    %r11d,-0x1c(%rax)
  mov    %edx,%r11d
  shr    $0x10,%edx
  shl    $0x8,%r11d
  or     %r11d,%ecx
  and    $0xffffff,%ecx
  mov    %ecx,-0x18(%rax)
  mov    %ecx,-0x14(%rax)
  mov    -0x4(%rdi),%ecx
  mov    %ecx,%r11d
  shr    $0x8,%ecx
  shl    $0x10,%r11d
  mov    %ecx,-0x8(%rax)
  or     %r11d,%edx
  mov    %ecx,-0x4(%rax)
  and    $0xffffff,%edx
  mov    %edx,-0x10(%rax)
  mov    %edx,-0xc(%rax)
  cmp    %rax,%r8
  jne    L152
  lea    (%r9,%r9,2),%rax
  neg    %r10d
  lea    (%r14,%rax,4),%r14
  lea    (%rsi,%r10,4),%esi
L50:
  test   %esi,%esi
  je     L258
  lea    (%r8,%rsi,8),%rax
  mov    %r14,%rcx
L8:
  movzbl 0x1(%rcx),%edx
  movzbl 0x2(%rcx),%edi
  add    $0x8,%r8
  add    $0x3,%rcx
  shl    $0x10,%edi
  shl    $0x8,%edx
  or     %edi,%edx
  movzbl -0x3(%rcx),%edi
  or     %edi,%edx
  mov    %edx,-0x8(%r8)
  mov    %edx,-0x4(%r8)
  cmp    %r8,%rax
  jne    L8
  lea    (%rsi,%rsi,2),%rdx
  add    %rdx,%r14
L287:
  mov    0x8(%rsp),%rsi
  mov    %r13d,%edx
  add    $0x1,%r15d
  lea    (%rax,%rsi,1),%r12
  mov    0x20(%rsp),%rax
  mov    %r12,%rsi
  lea    (%r12,%rax,1),%rdi
  call   <memcpy@plt>
  mov    0x10(%rsp),%rax
  add    0x18(%rsp),%r14
  add    %r12,%rax
  cmp    %r15d,0xc8(%rsp)
  jne    L250
L352:
  xor    %eax,%eax
L105:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L87
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L139:
  mov    %ebx,%esi
  jmp    L333
L173:
  cmpl   $0x1,0x34(%rsp)
  mov    $0xffffffff,%eax
  jne    L105
  mov    0xb8(%rsp),%eax
  mov    %r9d,%edx
  lea    0x0(%rbp,%rbp,2),%esi
  imul   %r15d,%edx
  movslq %esi,%rsi
  imul   %r12d,%eax
  movslq %edx,%rdx
  cltq
  add    %rax,%rsi
  lea    0x0(,%r13,4),%eax
  cltq
  add    %r14,%rsi
  add    %rdx,%rax
  add    %rdi,%rax
  mov    0x88(%rsp),%edi
  test   %edi,%edi
  jle    L352
  mov    0x80(%rsp),%ebx
  xor    %r11d,%r11d
  lea    0x0(,%rbx,4),%ecx
  mov    %ebx,%edx
  lea    0x1(%rbx,%rbp,1),%r10d
  sub    %ecx,%r15d
  sub    %ecx,%edx
  add    %edx,%r12d
  movslq %r15d,%r13
  mov    %ebp,%r15d
  mov    %ebx,%ebp
  movslq %r12d,%r12
  and    $0x3,%r15d
L153:
  test   %r15d,%r15d
  je     L247
  mov    %ebp,%ecx
  test   %ebp,%ebp
  jne    L186
  jmp    L88
L183:
  test   %ecx,%ecx
  je     L88
L186:
  movzbl 0x1(%rsi),%edx
  movzbl 0x2(%rsi),%edi
  add    $0x4,%rax
  add    $0x3,%rsi
  shl    $0x10,%edi
  shl    $0x8,%edx
  or     %edi,%edx
  movzbl -0x3(%rsi),%edi
  or     %edi,%edx
  mov    %edx,-0x4(%rax)
  mov    %r10d,%edx
  sub    %ecx,%edx
  sub    $0x1,%ecx
  and    $0x3,%edx
  jne    L183
L200:
  mov    %rax,%r8
  cmp    $0x3,%ecx
  jle    L226
  lea    -0x4(%rcx),%ebx
  mov    %rsi,%rdi
  mov    %ebx,0x8(%rsp)
  shr    $0x2,%ebx
  lea    0x1(%rbx),%r9d
  mov    %r9,%r8
  shl    $0x4,%r8
  add    %rax,%r8
  nopl   (%rax)
L207:
  mov    (%rdi),%ecx
  mov    0x4(%rdi),%edx
  add    $0x10,%rax
  add    $0xc,%rdi
  mov    %ecx,%r14d
  shr    $0x18,%ecx
  and    $0xffffff,%r14d
  mov    %r14d,-0x10(%rax)
  mov    %edx,%r14d
  shr    $0x10,%edx
  shl    $0x8,%r14d
  or     %r14d,%ecx
  and    $0xffffff,%ecx
  mov    %ecx,-0xc(%rax)
  mov    -0x4(%rdi),%ecx
  mov    %ecx,%r14d
  shr    $0x8,%ecx
  shl    $0x10,%r14d
  mov    %ecx,-0x4(%rax)
  or     %r14d,%edx
  and    $0xffffff,%edx
  mov    %edx,-0x8(%rax)
  cmp    %r8,%rax
  jne    L207
  lea    (%r9,%r9,2),%rax
  neg    %ebx
  lea    (%rsi,%rax,4),%rsi
  mov    0x8(%rsp),%eax
  lea    (%rax,%rbx,4),%ecx
L226:
  test   %ecx,%ecx
  je     L191
  lea    (%r8,%rcx,4),%rax
  mov    %rsi,%rdi
L338:
  movzbl 0x1(%rdi),%edx
  movzbl 0x2(%rdi),%r9d
  add    $0x4,%r8
  add    $0x3,%rdi
  shl    $0x10,%r9d
  shl    $0x8,%edx
  or     %r9d,%edx
  movzbl -0x3(%rdi),%r9d
  or     %r9d,%edx
  mov    %edx,-0x4(%r8)
  cmp    %rax,%r8
  jne    L338
  lea    (%rcx,%rcx,2),%rdx
  add    %rdx,%rsi
L88:
  add    %r12,%rsi
  add    %r13,%rax
  add    $0x1,%r11d
  cmp    %r11d,0x88(%rsp)
  jne    L153
  jmp    L352
L158:
  mov    $0xffffffff,%eax
  jmp    L105
L247:
  mov    %ebp,%ecx
  jmp    L200
L87:
  call   <__stack_chk_fail@plt>
L258:
  mov    %r8,%rax
  jmp    L287
L191:
  mov    %r8,%rax
  jmp    L88
```

assistant: ```c
int RGB24toRGB32(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 * 3 + src_y * src_pitch;
    d = dest_ptr + dest_x * 4 + dest_y * dest_pitch;
    for (i = 0; i < dest_dy; i++) {
      register int sx = src_x, ddx = dest_dx;
      while ((sx & 3) && ddx) {
        *(unsigned int *)d = (unsigned int)s[0] | (s[1] << 8) | (s[2] << 16);
        d += 4;
        s += 3;
        sx++;
        ddx--;
      }
      while (ddx >= 4) {
        register unsigned int a, b;
        a = *(unsigned int *)s;
        b = *(unsigned int *)(s + 4);
        *(unsigned int *)d = a & 0x00FFFFFF;
        *(unsigned int *)(d + 4) = ((a >> 24) | (b << 8)) & 0x00FFFFFF;
        a = *(unsigned int *)(s + 8);
        *(unsigned int *)(d + 8) = ((b >> 16) | (a << 16)) & 0x00FFFFFF;
        *(unsigned int *)(d + 12) = a >> 8;
        d += 4 * 4;
        s += 3 * 4;
        ddx -= 4;
      }
      while (ddx) {
        *(unsigned int *)d = (unsigned int)s[0] | (s[1] << 8) | (s[2] << 16);
        d += 4;
        s += 3;
        ddx--;
      }
      s += src_pitch - dest_dx * 3;
      d += dest_pitch - dest_dx * 4;
    }
    return 0;
  }
  if (scale_x == 2 && scale_y == 2) {
    unsigned char *s, *d;
    register int i;
    s = src_ptr + src_x * 3 + src_y * src_pitch;
    d = dest_ptr + dest_x * 4 + 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 int a;
        a = (unsigned int)s[0] | (s[1] << 8) | (s[2] << 16);
        *(unsigned int *)d = a;
        *(unsigned int *)(d + 4) = a;
        d += 2 * 4;
        s += 3;
        sx++;
        sdx--;
      }
      while (sdx >= 4) {
        register unsigned int a, b, c;
        a = *(unsigned int *)s;
        b = *(unsigned int *)(s + 4);
        c = a & 0x00FFFFFF;
        *(unsigned int *)(d) = c;
        *(unsigned int *)(d + 4) = c;
        c = ((a >> 24) | (b << 8)) & 0x00FFFFFF;
        *(unsigned int *)(d + 2 * 4) = c;
        *(unsigned int *)(d + 3 * 4) = c;
        a = *(unsigned int *)(s + 8);
        c = ((b >> 16) | (a << 16)) & 0x00FFFFFF;
        *(unsigned int *)(d + 4 * 4) = c;
        *(unsigned int *)(d + 5 * 4) = c;
        c = a >> 8;
        *(unsigned int *)(d + 6 * 4) = c;
        *(unsigned int *)(d + 7 * 4) = c;
        d += 4 * 2 * 4;
        s += 4 * 3;
        sdx -= 4;
      }
      while (sdx) {
        register unsigned int a;
        a = (unsigned int)s[0] | (s[1] << 8) | (s[2] << 16);
        *(unsigned int *)d = a;
        *(unsigned int *)(d + 4) = a;
        d += 2 * 4;
        s += 3;
        sdx--;
      }
      s -= src_dx * 3;
      d -= src_dx * 2 * 4;
      memcpy(d + dest_pitch, d, src_dx * 2 * 4);
      s += src_pitch;
      d += dest_pitch * 2;
    }
    return 0;
  }
  return -1;
}
```