#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ chk_args(unsigned char *, int, int, int, int, int, int, int,
                            unsigned char *, int, int, int, int, int, int, int,
                            int *, int *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int RGB24toRGB24(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 * 3 + dest_y * dest_pitch;
    for (i = 0; i < dest_dy; i++) {
      memcpy(d, s, dest_dx * 3);
      s += src_pitch;
      d += dest_pitch;
    }
    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 * 3 + 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 char a;
        a = *s;
        *d = a;
        *(d + 3) = a;
        a = *(s + 1);
        *(d + 1) = a;
        *(d + 1 + 3) = a;
        a = *(s + 2);
        *(d + 2) = a;
        *(d + 2 + 3) = a;
        d += 2 * 3;
        s += 3;
        sx++;
        sdx--;
      }
      while (sdx >= 4) {
        register unsigned int a, b;
        a = *(unsigned int *)s;
        b = *(unsigned int *)(s + 4);
        *(unsigned int *)(d) = (a & 0x00FFFFFF) | (a << 24);
        *(unsigned int *)(d + 4) = (a >> 8) | (b << 24);
        *(unsigned int *)(d + 2 * 4) =
            ((b & 0xFF00) >> 8) | ((a & 0xFF000000) >> 16) | (b << 16);
        a = *(unsigned int *)(s + 8);
        *(unsigned int *)(d + 3 * 4) =
            (b >> 16) | ((a & 0xFF) << 16) | ((b & 0xFF0000) << 8);
        *(unsigned int *)(d + 4 * 4) = (b >> 24) | (a << 8);
        *(unsigned int *)(d + 5 * 4) = (a >> 24) | (a & 0xFFFFFF00);
        d += 4 * 2 * 3;
        s += 4 * 3;
        sdx -= 4;
      }
      while (sdx) {
        register unsigned char a;
        a = *s;
        *d = a;
        *(d + 3) = a;
        a = *(s + 1);
        *(d + 1) = a;
        *(d + 1 + 3) = a;
        a = *(s + 2);
        *(d + 2) = a;
        *(d + 2 + 3) = a;
        d += 2 * 3;
        s += 3;
        sdx--;
      }
      s -= src_dx * 3;
      d -= src_dx * 2 * 3;
      memcpy(d + dest_pitch, d, src_dx * 2 * 3);
      s += src_pitch;
      d += dest_pitch * 2;
    }
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<RGB24toRGB24>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    0x58(%rbp),%eax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x38(%rbp)
mov    %esi,-0x3c(%rbp)
mov    %edx,-0x40(%rbp)
mov    %ecx,-0x44(%rbp)
mov    %r8d,-0x48(%rbp)
mov    %r9d,-0x4c(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%r8d
mov    -0x4c(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,-0xc0(%rbp)
mov    0x18(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    0x28(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    0x30(%rbp),%r13d
mov    0x38(%rbp),%r12d
mov    0x40(%rbp),%r15d
mov    0x48(%rbp),%r14d
mov    0x50(%rbp),%ebx
mov    0x58(%rbp),%r11d
lea    -0x50(%rbp),%r10
lea    -0x54(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0xc0(%rbp),%eax
mov    %eax,(%rsp)
mov    -0xbc(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0xb8(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0xac(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    -0xa8(%rbp),%rax
mov    %r13d,0x20(%rsp)
mov    %r12d,0x28(%rsp)
mov    %r15d,0x30(%rsp)
mov    %r14d,0x38(%rsp)
mov    %ebx,0x40(%rsp)
mov    %r11d,0x48(%rsp)
mov    %r10,0x50(%rsp)
mov    %rax,0x58(%rsp)
call   1030 <chk_args@plt>
cmp    $0x0,%eax
jne    123a <RGB24toRGB24+0x11a>
movl   $0xffffffff,-0x2c(%rbp)
jmp    1724 <RGB24toRGB24+0x604>
cmpl   $0x0,0x38(%rbp)
jge    1261 <RGB24toRGB24+0x141>
mov    0x30(%rbp),%ecx
sub    $0x1,%ecx
imul   0x38(%rbp),%ecx
mov    0x20(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,0x20(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    1288 <RGB24toRGB24+0x168>
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x44(%rbp),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x1,-0x50(%rbp)
jne    133a <RGB24toRGB24+0x21a>
cmpl   $0x1,-0x54(%rbp)
jne    133a <RGB24toRGB24+0x21a>
mov    0x20(%rbp),%rax
imul   $0x3,0x40(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    0x48(%rbp),%ecx
imul   0x38(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    -0x4c(%rbp),%ecx
imul   -0x44(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    132e <RGB24toRGB24+0x20e>
mov    -0x68(%rbp),%rdi
mov    -0x60(%rbp),%rsi
imul   $0x3,0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    0x38(%rbp),%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x68(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    12e1 <RGB24toRGB24+0x1c1>
movl   $0x0,-0x2c(%rbp)
jmp    1724 <RGB24toRGB24+0x604>
cmpl   $0x2,-0x50(%rbp)
jne    171d <RGB24toRGB24+0x5fd>
cmpl   $0x2,-0x54(%rbp)
jne    171d <RGB24toRGB24+0x5fd>
mov    0x20(%rbp),%rax
imul   $0x3,0x40(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    0x48(%rbp),%ecx
imul   0x38(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x38(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    -0x4c(%rbp),%ecx
imul   -0x44(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    0x58(%rbp),%eax
jge    1711 <RGB24toRGB24+0x5f1>
mov    0x40(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    0x50(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x88(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xc1(%rbp)
je     13e1 <RGB24toRGB24+0x2c1>
cmpl   $0x0,-0x8c(%rbp)
setne  %al
mov    %al,-0xc1(%rbp)
mov    -0xc1(%rbp),%al
test   $0x1,%al
jne    13f4 <RGB24toRGB24+0x2d4>
jmp    14a2 <RGB24toRGB24+0x382>
mov    -0x78(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x8d(%rbp)
mov    -0x8d(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8d(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x78(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x8d(%rbp)
mov    -0x8d(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8d(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x78(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x8d(%rbp)
mov    -0x8d(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8d(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0x80(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x78(%rbp)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
mov    -0x8c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8c(%rbp)
jmp    13b7 <RGB24toRGB24+0x297>
jmp    14a7 <RGB24toRGB24+0x387>
cmpl   $0x4,-0x8c(%rbp)
jl     15d7 <RGB24toRGB24+0x4b7>
mov    -0x78(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x78(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x98(%rbp)
mov    -0x94(%rbp),%ecx
and    $0xffffff,%ecx
mov    -0x94(%rbp),%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x94(%rbp),%ecx
shr    $0x8,%ecx
mov    -0x98(%rbp),%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x98(%rbp),%ecx
and    $0xff00,%ecx
shr    $0x8,%ecx
mov    -0x94(%rbp),%eax
and    $0xff000000,%eax
shr    $0x10,%eax
or     %eax,%ecx
mov    -0x98(%rbp),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x78(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x98(%rbp),%ecx
shr    $0x10,%ecx
mov    -0x94(%rbp),%eax
and    $0xff,%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x98(%rbp),%eax
and    $0xff0000,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x98(%rbp),%ecx
shr    $0x18,%ecx
mov    -0x94(%rbp),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x94(%rbp),%ecx
shr    $0x18,%ecx
mov    -0x94(%rbp),%eax
and    $0xffffff00,%eax
or     %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x80(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x78(%rbp)
mov    -0x8c(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x8c(%rbp)
jmp    14a7 <RGB24toRGB24+0x387>
jmp    15dc <RGB24toRGB24+0x4bc>
cmpl   $0x0,-0x8c(%rbp)
je     1688 <RGB24toRGB24+0x568>
mov    -0x78(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,(%rax)
mov    -0x99(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x78(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x99(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x78(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x99(%rbp),%cl
mov    -0x80(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0x80(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x78(%rbp)
mov    -0x8c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8c(%rbp)
jmp    15dc <RGB24toRGB24+0x4bc>
imul   $0x3,0x50(%rbp),%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    0x50(%rbp),%eax
shl    $0x1,%eax
imul   $0x3,%eax,%ecx
mov    -0x80(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rdi
movslq -0x44(%rbp),%rax
add    %rax,%rdi
mov    -0x80(%rbp),%rsi
mov    0x50(%rbp),%eax
shl    $0x1,%eax
imul   $0x3,%eax,%edx
call   1040 <memcpy@plt>
mov    0x38(%rbp),%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x44(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x80(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1396 <RGB24toRGB24+0x276>
movl   $0x0,-0x2c(%rbp)
jmp    1724 <RGB24toRGB24+0x604>
movl   $0xffffffff,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB24toRGB24>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8d,%r10d
mov    %edx,%ebx
mov    %rdi,%r14
mov    0xb8(%rsp),%r11d
mov    0xb0(%rsp),%ebp
mov    0x90(%rsp),%r13d
mov    0x80(%rsp),%r15
mov    0x78(%rsp),%r12d
lea    0x28(%rsp),%rax
mov    %ecx,0x10(%rsp)
mov    %r10,%r8
mov    %r10,0x8(%rsp)
mov    %r9d,0x4(%rsp)
push   %rax
lea    0x34(%rsp),%rax
push   %rax
push   %r11
push   %rbp
mov    0xc8(%rsp),%ebp
push   %rbp
mov    0xc8(%rsp),%eax
push   %rax
mov    0xc8(%rsp),%eax
push   %rax
push   %r13
mov    0xc8(%rsp),%eax
push   %rax
push   %r15
push   %r12
mov    0xc8(%rsp),%eax
push   %rax
call   1030 <chk_args@plt>
add    $0x60,%rsp
mov    $0xffffffff,%edx
test   %eax,%eax
je     15e0 <RGB24toRGB24+0x4c0>
add    $0xffffffff,%r13d
mov    0x98(%rsp),%r9d
imul   %r9d,%r13d
movslq %r13d,%rax
neg    %rax
xor    %ecx,%ecx
test   %r9d,%r9d
cmovns %rcx,%rax
add    %rax,%r15
add    $0xffffffff,%ebx
mov    0x10(%rsp),%esi
imul   %esi,%ebx
movslq %ebx,%rax
neg    %rax
test   %esi,%esi
cmovns %rcx,%rax
add    %rax,%r14
mov    0x2c(%rsp),%ecx
mov    0x28(%rsp),%eax
cmp    $0x1,%ecx
jne    127f <RGB24toRGB24+0x15f>
cmp    $0x1,%eax
jne    127f <RGB24toRGB24+0x15f>
xor    %edx,%edx
test   %r12d,%r12d
jle    15e0 <RGB24toRGB24+0x4c0>
mov    0x8(%rsp),%rax
lea    (%rax,%rax,2),%eax
cltq
add    %rax,%r14
mov    0x4(%rsp),%eax
imul   %esi,%eax
movslq %eax,%rbx
add    %r14,%rbx
mov    0xa0(%rsp),%eax
lea    (%rax,%rax,2),%eax
cltq
add    %rax,%r15
mov    0xa8(%rsp),%eax
imul   %r9d,%eax
movslq %eax,%rbp
add    %r15,%rbp
mov    0x70(%rsp),%eax
lea    (%rax,%rax,2),%r14d
movslq %r9d,%r13
movslq %esi,%r15
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1040 <memcpy@plt>
add    %r13,%rbp
add    %r15,%rbx
add    $0xffffffff,%r12d
jne    1260 <RGB24toRGB24+0x140>
jmp    15de <RGB24toRGB24+0x4be>
cmp    $0x2,%ecx
jne    15e0 <RGB24toRGB24+0x4c0>
cmp    $0x2,%eax
jne    15e0 <RGB24toRGB24+0x4c0>
mov    0xb8(%rsp),%eax
test   %eax,%eax
jle    15de <RGB24toRGB24+0x4be>
mov    0x8(%rsp),%rax
lea    (%rax,%rax,2),%eax
cltq
add    %rax,%r14
mov    0x4(%rsp),%eax
imul   %esi,%eax
movslq %eax,%rbx
add    %r14,%rbx
mov    0xa0(%rsp),%edi
lea    (%rdi,%rdi,2),%eax
cltq
add    %rax,%r15
mov    0xa8(%rsp),%eax
imul   %r9d,%eax
movslq %eax,%rbp
add    %r15,%rbp
test   $0x3,%dil
setne  %al
mov    0xb0(%rsp),%ecx
mov    %rcx,%r8
mov    %r8d,%edx
add    $0xffffffff,%edx
setb   %cl
and    %al,%cl
mov    %cl,0x4(%rsp)
lea    (%r8,%r8,2),%eax
movslq %eax,%r12
neg    %r12
lea    (%r8,%r8,1),%eax
lea    (%rax,%rax,2),%r14d
movslq %r14d,%r13
neg    %r13
movslq %esi,%rax
mov    %rax,0x8(%rsp)
movslq %r9d,%rax
mov    %rax,0x30(%rsp)
add    %esi,%esi
movslq %esi,%rax
mov    %rax,0x10(%rsp)
lea    0x1(%rdi),%eax
test   $0x3,%al
setne  %al
mov    %edx,0x24(%rsp)
test   %edx,%edx
setne  %cl
and    %al,%cl
mov    %cl,0x3(%rsp)
lea    0x2(%rdi),%eax
test   $0x3,%al
setne  %al
mov    %r8d,%ecx
add    $0xfffffffe,%ecx
mov    %ecx,0x20(%rsp)
setne  %cl
and    %al,%cl
mov    %cl,0x2(%rsp)
add    $0xffffffff,%edi
test   $0x3,%dil
setne  %al
mov    %r8d,%ecx
add    $0xfffffffd,%ecx
mov    %ecx,0x1c(%rsp)
setne  %cl
and    %al,%cl
mov    %cl,0x1(%rsp)
lea    -0x4(%r8),%eax
mov    %eax,0x18(%rsp)
xor    %r15d,%r15d
jmp    13c8 <RGB24toRGB24+0x2a8>
nopl   0x0(%rax,%rax,1)
add    %r13,%rbx
add    %r12,%rbp
add    0x30(%rsp),%rbp
mov    0x8(%rsp),%rax
lea    (%rbx,%rax,1),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <memcpy@plt>
add    0x10(%rsp),%rbx
add    $0x1,%r15d
mov    0xb8(%rsp),%eax
cmp    %eax,%r15d
je     15de <RGB24toRGB24+0x4be>
cmpb   $0x0,0x4(%rsp)
je     1470 <RGB24toRGB24+0x350>
mov    0x0(%rbp),%al
mov    %al,(%rbx)
mov    %al,0x3(%rbx)
mov    0x1(%rbp),%al
mov    %al,0x1(%rbx)
mov    %al,0x4(%rbx)
mov    0x2(%rbp),%al
mov    %al,0x2(%rbx)
mov    %al,0x5(%rbx)
cmpb   $0x0,0x3(%rsp)
je     15a0 <RGB24toRGB24+0x480>
mov    0x3(%rbp),%al
mov    %al,0x6(%rbx)
mov    %al,0x9(%rbx)
mov    0x4(%rbp),%al
mov    %al,0x7(%rbx)
mov    %al,0xa(%rbx)
mov    0x5(%rbp),%al
mov    %al,0x8(%rbx)
mov    %al,0xb(%rbx)
cmpb   $0x0,0x2(%rsp)
je     15ae <RGB24toRGB24+0x48e>
mov    0x6(%rbp),%al
mov    %al,0xc(%rbx)
mov    %al,0xf(%rbx)
mov    0x7(%rbp),%al
mov    %al,0xd(%rbx)
mov    %al,0x10(%rbx)
mov    0x8(%rbp),%al
mov    %al,0xe(%rbx)
mov    %al,0x11(%rbx)
cmpb   $0x0,0x1(%rsp)
je     15bc <RGB24toRGB24+0x49c>
mov    0x9(%rbp),%al
mov    %al,0x12(%rbx)
mov    %al,0x15(%rbx)
mov    0xa(%rbp),%al
mov    %al,0x13(%rbx)
mov    %al,0x16(%rbx)
mov    0xb(%rbp),%al
mov    %al,0x14(%rbx)
mov    %al,0x17(%rbx)
add    $0x18,%rbx
add    $0xc,%rbp
mov    0x18(%rsp),%eax
jmp    15d0 <RGB24toRGB24+0x4b0>
mov    0xb0(%rsp),%eax
cmp    $0x4,%eax
jl     1507 <RGB24toRGB24+0x3e7>
mov    %eax,%r8d
mov    0x0(%rbp),%edx
mov    0x4(%rbp),%ecx
mov    %edx,%esi
and    $0xffffff,%esi
mov    %edx,%edi
shl    $0x18,%edi
or     %esi,%edi
mov    %edi,(%rbx)
mov    %ecx,%eax
shld   $0x18,%edx,%eax
mov    %eax,0x4(%rbx)
movzbl %ch,%eax
shr    $0x10,%edx
and    $0xff00,%edx
or     %eax,%edx
mov    %ecx,%eax
shl    $0x10,%eax
or     %edx,%eax
mov    %eax,0x8(%rbx)
mov    0x8(%rbp),%eax
mov    %ecx,%edx
shr    $0x10,%edx
movzbl %al,%esi
shl    $0x10,%esi
mov    %eax,%edi
shld   $0x8,%ecx,%edi
shl    $0x8,%ecx
and    $0xff000000,%ecx
or     %edx,%ecx
or     %esi,%ecx
mov    %ecx,0xc(%rbx)
mov    %edi,0x10(%rbx)
mov    %eax,%ecx
shr    $0x18,%ecx
and    $0xffffff00,%eax
or     %ecx,%eax
mov    %eax,0x14(%rbx)
add    $0x18,%rbx
add    $0xc,%rbp
lea    -0x4(%r8),%eax
cmp    $0x7,%r8d
ja     1480 <RGB24toRGB24+0x360>
test   %eax,%eax
je     1390 <RGB24toRGB24+0x270>
test   $0x1,%al
jne    1520 <RGB24toRGB24+0x400>
mov    %eax,%ecx
cmp    $0x1,%eax
jne    1550 <RGB24toRGB24+0x430>
jmp    1390 <RGB24toRGB24+0x270>
nop
mov    0x0(%rbp),%cl
mov    %cl,(%rbx)
mov    %cl,0x3(%rbx)
mov    0x1(%rbp),%cl
mov    %cl,0x1(%rbx)
mov    %cl,0x4(%rbx)
mov    0x2(%rbp),%cl
mov    %cl,0x2(%rbx)
mov    %cl,0x5(%rbx)
add    $0x6,%rbx
add    $0x3,%rbp
lea    -0x1(%rax),%ecx
cmp    $0x1,%eax
je     1390 <RGB24toRGB24+0x270>
xchg   %ax,%ax
movzbl 0x0(%rbp),%eax
mov    %al,(%rbx)
mov    %al,0x3(%rbx)
movzbl 0x1(%rbp),%eax
mov    %al,0x1(%rbx)
mov    %al,0x4(%rbx)
movzbl 0x2(%rbp),%eax
mov    %al,0x2(%rbx)
mov    %al,0x5(%rbx)
movzbl 0x3(%rbp),%eax
mov    %al,0x6(%rbx)
mov    %al,0x9(%rbx)
movzbl 0x4(%rbp),%eax
mov    %al,0x7(%rbx)
mov    %al,0xa(%rbx)
movzbl 0x5(%rbp),%eax
mov    %al,0x8(%rbx)
mov    %al,0xb(%rbx)
add    $0xc,%rbx
add    $0x6,%rbp
add    $0xfffffffe,%ecx
jne    1550 <RGB24toRGB24+0x430>
jmp    1390 <RGB24toRGB24+0x270>
nopl   (%rax)
add    $0x6,%rbx
add    $0x3,%rbp
mov    0x24(%rsp),%eax
jmp    15d0 <RGB24toRGB24+0x4b0>
add    $0xc,%rbx
add    $0x6,%rbp
mov    0x20(%rsp),%eax
jmp    15d0 <RGB24toRGB24+0x4b0>
add    $0x12,%rbx
add    $0x9,%rbp
mov    0x1c(%rsp),%eax
nopl   0x0(%rax,%rax,1)
cmp    $0x4,%eax
jge    1480 <RGB24toRGB24+0x360>
jmp    1507 <RGB24toRGB24+0x3e7>
xor    %edx,%edx
mov    %edx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RGB24toRGB24(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i8* %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15) {
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i8*
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i8*
%37 = alloca i8*
%38 = alloca i32
%39 = alloca i8*
%40 = alloca i8*
%41 = alloca i32
%42 = alloca i32
%43 = alloca i32
%44 = alloca i8
%45 = alloca i32
%46 = alloca i32
%47 = alloca i8
store i8* %0, i8** %18
store i32 %1, i32* %19
store i32 %2, i32* %20
store i32 %3, i32* %21
store i32 %4, i32* %22
store i32 %5, i32* %23
store i32 %6, i32* %24
store i32 %7, i32* %25
store i8* %8, i8** %26
store i32 %9, i32* %27
store i32 %10, i32* %28
store i32 %11, i32* %29
store i32 %12, i32* %30
store i32 %13, i32* %31
store i32 %14, i32* %32
store i32 %15, i32* %33
%48 = load i8*, i8** %18
%49 = load i32, i32* %19
%50 = load i32, i32* %20
%51 = load i32, i32* %21
%52 = load i32, i32* %22
%53 = load i32, i32* %23
%54 = load i32, i32* %24
%55 = load i32, i32* %25
%56 = load i8*, i8** %26
%57 = load i32, i32* %27
%58 = load i32, i32* %28
%59 = load i32, i32* %29
%60 = load i32, i32* %30
%61 = load i32, i32* %31
%62 = load i32, i32* %32
%63 = load i32, i32* %33
%64 = call i32 @chk_args(i8* %48, i32 %49, i32 %50, i32 %51, i32 %52, i32 %53, i32 %54, i32 %55, i8* %56, i32 %57, i32 %58, i32 %59, i32 %60, i32 %61, i32 %62, i32 %63, i32* %34, i32* %35)
%65 = icmp ne i32 %64, 0
br i1 %65, label %67, label %66
66: ; preds = %16
store i32 -1, i32* %17
br label %373
67: ; preds = %16
%68 = load i32, i32* %29
%69 = icmp slt i32 %68, 0
br i1 %69, label %70, label %79
70: ; preds = %67
%71 = load i32, i32* %28
%72 = sub nsw i32 %71, 1
%73 = load i32, i32* %29
%74 = mul nsw i32 %72, %73
%75 = load i8*, i8** %26
%76 = sext i32 %74 to i64
%77 = sub i64 0, %76
%78 = getelementptr inbounds i8, i8* %75, i64 %77
store i8* %78, i8** %26
br label %79
79: ; preds = %70, %67
%80 = load i32, i32* %21
%81 = icmp slt i32 %80, 0
br i1 %81, label %82, label %91
82: ; preds = %79
%83 = load i32, i32* %20
%84 = sub nsw i32 %83, 1
%85 = load i32, i32* %21
%86 = mul nsw i32 %84, %85
%87 = load i8*, i8** %18
%88 = sext i32 %86 to i64
%89 = sub i64 0, %88
%90 = getelementptr inbounds i8, i8* %87, i64 %89
store i8* %90, i8** %18
br label %91
91: ; preds = %82, %79
%92 = load i32, i32* %34
%93 = icmp eq i32 %92, 1
br i1 %93, label %94, label %140
94: ; preds = %91
%95 = load i32, i32* %35
%96 = icmp eq i32 %95, 1
br i1 %96, label %97, label %140
97: ; preds = %94
%98 = load i8*, i8** %26
%99 = load i32, i32* %30
%100 = mul nsw i32 %99, 3
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8, i8* %98, i64 %101
%103 = load i32, i32* %31
%104 = load i32, i32* %29
%105 = mul nsw i32 %103, %104
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %102, i64 %106
store i8* %107, i8** %36
%108 = load i8*, i8** %18
%109 = load i32, i32* %22
%110 = mul nsw i32 %109, 3
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8, i8* %108, i64 %111
%113 = load i32, i32* %23
%114 = load i32, i32* %21
%115 = mul nsw i32 %113, %114
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %112, i64 %116
store i8* %117, i8** %37
store i32 0, i32* %38
br label %118
118: ; preds = %136, %97
%119 = load i32, i32* %38
%120 = load i32, i32* %25
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %139
122: ; preds = %118
%123 = load i8*, i8** %37
%124 = load i8*, i8** %36
%125 = load i32, i32* %24
%126 = mul nsw i32 %125, 3
%127 = call i32 @memcpy(i8* %123, i8* %124, i32 %126)
%128 = load i32, i32* %29
%129 = load i8*, i8** %36
%130 = sext i32 %128 to i64
%131 = getelementptr inbounds i8, i8* %129, i64 %130
store i8* %131, i8** %36
%132 = load i32, i32* %21
%133 = load i8*, i8** %37
%134 = sext i32 %132 to i64
%135 = getelementptr inbounds i8, i8* %133, i64 %134
store i8* %135, i8** %37
br label %136
136: ; preds = %122
%137 = load i32, i32* %38
%138 = add nsw i32 %137, 1
store i32 %138, i32* %38
br label %118
139: ; preds = %118
store i32 0, i32* %17
br label %373
140: ; preds = %94, %91
%141 = load i32, i32* %34
%142 = icmp eq i32 %141, 2
br i1 %142, label %143, label %372
143: ; preds = %140
%144 = load i32, i32* %35
%145 = icmp eq i32 %144, 2
br i1 %145, label %146, label %372
146: ; preds = %143
%147 = load i8*, i8** %26
%148 = load i32, i32* %30
%149 = mul nsw i32 %148, 3
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8, i8* %147, i64 %150
%152 = load i32, i32* %31
%153 = load i32, i32* %29
%154 = mul nsw i32 %152, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %151, i64 %155
store i8* %156, i8** %39
%157 = load i8*, i8** %18
%158 = load i32, i32* %22
%159 = mul nsw i32 %158, 3
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i8, i8* %157, i64 %160
%162 = load i32, i32* %23
%163 = load i32, i32* %21
%164 = mul nsw i32 %162, %163
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i8, i8* %161, i64 %165
store i8* %166, i8** %40
store i32 0, i32* %41
br label %167
167: ; preds = %368, %146
%168 = load i32, i32* %41
%169 = load i32, i32* %33
%170 = icmp slt i32 %168, %169
br i1 %170, label %171, label %371
171: ; preds = %167
%172 = load i32, i32* %30
store i32 %172, i32* %42
%173 = load i32, i32* %32
store i32 %173, i32* %43
br label %174
174: ; preds = %183, %171
%175 = load i32, i32* %42
%176 = and i32 %175, 3
%177 = icmp ne i32 %176, 0
br i1 %177, label %178, label %181
178: ; preds = %174
%179 = load i32, i32* %43
%180 = icmp ne i32 %179, 0
br label %181
181: ; preds = %178, %174
%182 = phi i1 [ false, %174 ], [ %180, %178 ]
br i1 %182, label %183, label %219
183: ; preds = %181
%184 = load i8*, i8** %39
%185 = load i8, i8* %184
store i8 %185, i8* %44
%186 = load i8, i8* %44
%187 = load i8*, i8** %40
store i8 %186, i8* %187
%188 = load i8, i8* %44
%189 = load i8*, i8** %40
%190 = getelementptr inbounds i8, i8* %189, i64 3
store i8 %188, i8* %190
%191 = load i8*, i8** %39
%192 = getelementptr inbounds i8, i8* %191, i64 1
%193 = load i8, i8* %192
store i8 %193, i8* %44
%194 = load i8, i8* %44
%195 = load i8*, i8** %40
%196 = getelementptr inbounds i8, i8* %195, i64 1
store i8 %194, i8* %196
%197 = load i8, i8* %44
%198 = load i8*, i8** %40
%199 = getelementptr inbounds i8, i8* %198, i64 1
%200 = getelementptr inbounds i8, i8* %199, i64 3
store i8 %197, i8* %200
%201 = load i8*, i8** %39
%202 = getelementptr inbounds i8, i8* %201, i64 2
%203 = load i8, i8* %202
store i8 %203, i8* %44
%204 = load i8, i8* %44
%205 = load i8*, i8** %40
%206 = getelementptr inbounds i8, i8* %205, i64 2
store i8 %204, i8* %206
%207 = load i8, i8* %44
%208 = load i8*, i8** %40
%209 = getelementptr inbounds i8, i8* %208, i64 2
%210 = getelementptr inbounds i8, i8* %209, i64 3
store i8 %207, i8* %210
%211 = load i8*, i8** %40
%212 = getelementptr inbounds i8, i8* %211, i64 6
store i8* %212, i8** %40
%213 = load i8*, i8** %39
%214 = getelementptr inbounds i8, i8* %213, i64 3
store i8* %214, i8** %39
%215 = load i32, i32* %42
%216 = add nsw i32 %215, 1
store i32 %216, i32* %42
%217 = load i32, i32* %43
%218 = add nsw i32 %217, -1
store i32 %218, i32* %43
br label %174
219: ; preds = %181
br label %220
220: ; preds = %223, %219
%221 = load i32, i32* %43
%222 = icmp sge i32 %221, 4
br i1 %222, label %223, label %298
223: ; preds = %220
%224 = load i8*, i8** %39
%225 = bitcast i8* %224 to i32*
%226 = load i32, i32* %225
store i32 %226, i32* %45
%227 = load i8*, i8** %39
%228 = getelementptr inbounds i8, i8* %227, i64 4
%229 = bitcast i8* %228 to i32*
%230 = load i32, i32* %229
store i32 %230, i32* %46
%231 = load i32, i32* %45
%232 = and i32 %231, 16777215
%233 = load i32, i32* %45
%234 = shl i32 %233, 24
%235 = or i32 %232, %234
%236 = load i8*, i8** %40
%237 = bitcast i8* %236 to i32*
store i32 %235, i32* %237
%238 = load i32, i32* %45
%239 = lshr i32 %238, 8
%240 = load i32, i32* %46
%241 = shl i32 %240, 24
%242 = or i32 %239, %241
%243 = load i8*, i8** %40
%244 = getelementptr inbounds i8, i8* %243, i64 4
%245 = bitcast i8* %244 to i32*
store i32 %242, i32* %245
%246 = load i32, i32* %46
%247 = and i32 %246, 65280
%248 = lshr i32 %247, 8
%249 = load i32, i32* %45
%250 = and i32 %249, -16777216
%251 = lshr i32 %250, 16
%252 = or i32 %248, %251
%253 = load i32, i32* %46
%254 = shl i32 %253, 16
%255 = or i32 %252, %254
%256 = load i8*, i8** %40
%257 = getelementptr inbounds i8, i8* %256, i64 8
%258 = bitcast i8* %257 to i32*
store i32 %255, i32* %258
%259 = load i8*, i8** %39
%260 = getelementptr inbounds i8, i8* %259, i64 8
%261 = bitcast i8* %260 to i32*
%262 = load i32, i32* %261
store i32 %262, i32* %45
%263 = load i32, i32* %46
%264 = lshr i32 %263, 16
%265 = load i32, i32* %45
%266 = and i32 %265, 255
%267 = shl i32 %266, 16
%268 = or i32 %264, %267
%269 = load i32, i32* %46
%270 = and i32 %269, 16711680
%271 = shl i32 %270, 8
%272 = or i32 %268, %271
%273 = load i8*, i8** %40
%274 = getelementptr inbounds i8, i8* %273, i64 12
%275 = bitcast i8* %274 to i32*
store i32 %272, i32* %275
%276 = load i32, i32* %46
%277 = lshr i32 %276, 24
%278 = load i32, i32* %45
%279 = shl i32 %278, 8
%280 = or i32 %277, %279
%281 = load i8*, i8** %40
%282 = getelementptr inbounds i8, i8* %281, i64 16
%283 = bitcast i8* %282 to i32*
store i32 %280, i32* %283
%284 = load i32, i32* %45
%285 = lshr i32 %284, 24
%286 = load i32, i32* %45
%287 = and i32 %286, -256
%288 = or i32 %285, %287
%289 = load i8*, i8** %40
%290 = getelementptr inbounds i8, i8* %289, i64 20
%291 = bitcast i8* %290 to i32*
store i32 %288, i32* %291
%292 = load i8*, i8** %40
%293 = getelementptr inbounds i8, i8* %292, i64 24
store i8* %293, i8** %40
%294 = load i8*, i8** %39
%295 = getelementptr inbounds i8, i8* %294, i64 12
store i8* %295, i8** %39
%296 = load i32, i32* %43
%297 = sub nsw i32 %296, 4
store i32 %297, i32* %43
br label %220
298: ; preds = %220
br label %299
299: ; preds = %302, %298
%300 = load i32, i32* %43
%301 = icmp ne i32 %300, 0
br i1 %301, label %302, label %336
302: ; preds = %299
%303 = load i8*, i8** %39
%304 = load i8, i8* %303
store i8 %304, i8* %47
%305 = load i8, i8* %47
%306 = load i8*, i8** %40
store i8 %305, i8* %306
%307 = load i8, i8* %47
%308 = load i8*, i8** %40
%309 = getelementptr inbounds i8, i8* %308, i64 3
store i8 %307, i8* %309
%310 = load i8*, i8** %39
%311 = getelementptr inbounds i8, i8* %310, i64 1
%312 = load i8, i8* %311
store i8 %312, i8* %47
%313 = load i8, i8* %47
%314 = load i8*, i8** %40
%315 = getelementptr inbounds i8, i8* %314, i64 1
store i8 %313, i8* %315
%316 = load i8, i8* %47
%317 = load i8*, i8** %40
%318 = getelementptr inbounds i8, i8* %317, i64 1
%319 = getelementptr inbounds i8, i8* %318, i64 3
store i8 %316, i8* %319
%320 = load i8*, i8** %39
%321 = getelementptr inbounds i8, i8* %320, i64 2
%322 = load i8, i8* %321
store i8 %322, i8* %47
%323 = load i8, i8* %47
%324 = load i8*, i8** %40
%325 = getelementptr inbounds i8, i8* %324, i64 2
store i8 %323, i8* %325
%326 = load i8, i8* %47
%327 = load i8*, i8** %40
%328 = getelementptr inbounds i8, i8* %327, i64 2
%329 = getelementptr inbounds i8, i8* %328, i64 3
store i8 %326, i8* %329
%330 = load i8*, i8** %40
%331 = getelementptr inbounds i8, i8* %330, i64 6
store i8* %331, i8** %40
%332 = load i8*, i8** %39
%333 = getelementptr inbounds i8, i8* %332, i64 3
store i8* %333, i8** %39
%334 = load i32, i32* %43
%335 = add nsw i32 %334, -1
store i32 %335, i32* %43
br label %299
336: ; preds = %299
%337 = load i32, i32* %32
%338 = mul nsw i32 %337, 3
%339 = load i8*, i8** %39
%340 = sext i32 %338 to i64
%341 = sub i64 0, %340
%342 = getelementptr inbounds i8, i8* %339, i64 %341
store i8* %342, i8** %39
%343 = load i32, i32* %32
%344 = mul nsw i32 %343, 2
%345 = mul nsw i32 %344, 3
%346 = load i8*, i8** %40
%347 = sext i32 %345 to i64
%348 = sub i64 0, %347
%349 = getelementptr inbounds i8, i8* %346, i64 %348
store i8* %349, i8** %40
%350 = load i8*, i8** %40
%351 = load i32, i32* %21
%352 = sext i32 %351 to i64
%353 = getelementptr inbounds i8, i8* %350, i64 %352
%354 = load i8*, i8** %40
%355 = load i32, i32* %32
%356 = mul nsw i32 %355, 2
%357 = mul nsw i32 %356, 3
%358 = call i32 @memcpy(i8* %353, i8* %354, i32 %357)
%359 = load i32, i32* %29
%360 = load i8*, i8** %39
%361 = sext i32 %359 to i64
%362 = getelementptr inbounds i8, i8* %360, i64 %361
store i8* %362, i8** %39
%363 = load i32, i32* %21
%364 = mul nsw i32 %363, 2
%365 = load i8*, i8** %40
%366 = sext i32 %364 to i64
%367 = getelementptr inbounds i8, i8* %365, i64 %366
store i8* %367, i8** %40
br label %368
368: ; preds = %336
%369 = load i32, i32* %41
%370 = add nsw i32 %369, 1
store i32 %370, i32* %41
br label %167
371: ; preds = %167
store i32 0, i32* %17
br label %373
372: ; preds = %143, %140
store i32 -1, i32* %17
br label %373
373: ; preds = %372, %371, %139, %66
%374 = load i32, i32* %17
ret i32 %374
}

LLVM IR (-O2):
define i32 @RGB24toRGB24(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i8* %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15) {
%17 = alloca i32
%18 = alloca i32
%19 = bitcast i32* %17 to i8*
%20 = bitcast i32* %18 to i8*
%21 = call i32 @chk_args(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i8* %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32* %17, i32* %18)
%22 = icmp eq i32 %21, 0
br i1 %22, label %302, label %23
23: ; preds = %16
%24 = icmp slt i32 %11, 0
%25 = add nsw i32 %10, -1
%26 = mul nsw i32 %25, %11
%27 = sext i32 %26 to i64
%28 = sub nsw i64 0, %27
%29 = select i1 %24, i64 %28, i64 0
%30 = getelementptr i8, i8* %8, i64 %29
%31 = icmp slt i32 %3, 0
%32 = add nsw i32 %2, -1
%33 = mul nsw i32 %32, %3
%34 = sext i32 %33 to i64
%35 = sub nsw i64 0, %34
%36 = select i1 %31, i64 %35, i64 0
%37 = getelementptr i8, i8* %0, i64 %36
%38 = load i32, i32* %17
%39 = icmp eq i32 %38, 1
%40 = load i32, i32* %18
%41 = icmp eq i32 %40, 1
%42 = select i1 %39, i1 %41, i1 false
br i1 %42, label %43, label %70
43: ; preds = %23
%44 = icmp sgt i32 %7, 0
br i1 %44, label %45, label %302
45: ; preds = %43
%46 = mul nsw i32 %4, 3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %37, i64 %47
%49 = mul nsw i32 %5, %3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %48, i64 %50
%52 = mul nsw i32 %12, 3
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %30, i64 %53
%55 = mul nsw i32 %13, %11
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = mul nsw i32 %6, 3
%59 = sext i32 %11 to i64
%60 = sext i32 %3 to i64
br label %61
61: ; preds = %45, %61
%62 = phi i32 [ 0, %45 ], [ %68, %61 ]
%63 = phi i8* [ %51, %45 ], [ %67, %61 ]
%64 = phi i8* [ %57, %45 ], [ %66, %61 ]
%65 = call i32 @memcpy(i8* %63, i8* %64, i32 %58)
%66 = getelementptr inbounds i8, i8* %64, i64 %59
%67 = getelementptr inbounds i8, i8* %63, i64 %60
%68 = add nuw nsw i32 %62, 1
%69 = icmp eq i32 %68, %7
br i1 %69, label %302, label %61
70: ; preds = %23
%71 = icmp eq i32 %38, 2
%72 = icmp eq i32 %40, 2
%73 = select i1 %71, i1 %72, i1 false
br i1 %73, label %74, label %302
74: ; preds = %70
%75 = icmp sgt i32 %15, 0
br i1 %75, label %76, label %302
76: ; preds = %74
%77 = mul nsw i32 %4, 3
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %37, i64 %78
%80 = mul nsw i32 %5, %3
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %79, i64 %81
%83 = mul nsw i32 %12, 3
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %30, i64 %84
%86 = mul nsw i32 %13, %11
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = and i32 %12, 3
%90 = icmp ne i32 %89, 0
%91 = icmp ne i32 %14, 0
%92 = and i1 %90, %91
%93 = mul nsw i32 %14, 3
%94 = sext i32 %93 to i64
%95 = sub nsw i64 0, %94
%96 = mul nsw i32 %14, 6
%97 = sext i32 %96 to i64
%98 = sub nsw i64 0, %97
%99 = sext i32 %3 to i64
%100 = sext i32 %11 to i64
%101 = shl nsw i32 %3, 1
%102 = sext i32 %101 to i64
%103 = add nsw i32 %12, 1
%104 = add nsw i32 %14, -1
%105 = and i32 %103, 3
%106 = icmp ne i32 %105, 0
%107 = icmp ne i32 %104, 0
%108 = select i1 %106, i1 %107, i1 false
%109 = add nsw i32 %12, 2
%110 = add nsw i32 %14, -2
%111 = and i32 %109, 3
%112 = icmp ne i32 %111, 0
%113 = icmp ne i32 %110, 0
%114 = select i1 %112, i1 %113, i1 false
%115 = add nsw i32 %12, 3
%116 = add nsw i32 %14, -3
%117 = and i32 %115, 3
%118 = icmp ne i32 %117, 0
%119 = icmp ne i32 %116, 0
%120 = select i1 %118, i1 %119, i1 false
%121 = add nsw i32 %14, -4
br label %122
122: ; preds = %76, %291
%123 = phi i32 [ 0, %76 ], [ %300, %291 ]
%124 = phi i8* [ %82, %76 ], [ %299, %291 ]
%125 = phi i8* [ %88, %76 ], [ %298, %291 ]
br i1 %92, label %131, label %126
126: ; preds = %131, %144, %157, %170, %122
%127 = phi i8* [ %125, %122 ], [ %143, %131 ], [ %156, %144 ], [ %169, %157 ], [ %182, %170 ]
%128 = phi i8* [ %124, %122 ], [ %142, %131 ], [ %155, %144 ], [ %168, %157 ], [ %181, %170 ]
%129 = phi i32 [ %14, %122 ], [ %104, %131 ], [ %110, %144 ], [ %116, %157 ], [ %121, %170 ]
%130 = icmp sgt i32 %129, 3
br i1 %130, label %212, label %183
131: ; preds = %122
%132 = load i8, i8* %125
store i8 %132, i8* %124
%133 = getelementptr inbounds i8, i8* %124, i64 3
store i8 %132, i8* %133
%134 = getelementptr inbounds i8, i8* %125, i64 1
%135 = load i8, i8* %134
%136 = getelementptr inbounds i8, i8* %124, i64 1
store i8 %135, i8* %136
%137 = getelementptr inbounds i8, i8* %124, i64 4
store i8 %135, i8* %137
%138 = getelementptr inbounds i8, i8* %125, i64 2
%139 = load i8, i8* %138
%140 = getelementptr inbounds i8, i8* %124, i64 2
store i8 %139, i8* %140
%141 = getelementptr inbounds i8, i8* %124, i64 5
store i8 %139, i8* %141
%142 = getelementptr inbounds i8, i8* %124, i64 6
%143 = getelementptr inbounds i8, i8* %125, i64 3
br i1 %108, label %144, label %126
144: ; preds = %131
%145 = load i8, i8* %143
store i8 %145, i8* %142
%146 = getelementptr inbounds i8, i8* %124, i64 9
store i8 %145, i8* %146
%147 = getelementptr inbounds i8, i8* %125, i64 4
%148 = load i8, i8* %147
%149 = getelementptr inbounds i8, i8* %124, i64 7
store i8 %148, i8* %149
%150 = getelementptr inbounds i8, i8* %124, i64 10
store i8 %148, i8* %150
%151 = getelementptr inbounds i8, i8* %125, i64 5
%152 = load i8, i8* %151
%153 = getelementptr inbounds i8, i8* %124, i64 8
store i8 %152, i8* %153
%154 = getelementptr inbounds i8, i8* %124, i64 11
store i8 %152, i8* %154
%155 = getelementptr inbounds i8, i8* %124, i64 12
%156 = getelementptr inbounds i8, i8* %125, i64 6
br i1 %114, label %157, label %126
157: ; preds = %144
%158 = load i8, i8* %156
store i8 %158, i8* %155
%159 = getelementptr inbounds i8, i8* %124, i64 15
store i8 %158, i8* %159
%160 = getelementptr inbounds i8, i8* %125, i64 7
%161 = load i8, i8* %160
%162 = getelementptr inbounds i8, i8* %124, i64 13
store i8 %161, i8* %162
%163 = getelementptr inbounds i8, i8* %124, i64 16
store i8 %161, i8* %163
%164 = getelementptr inbounds i8, i8* %125, i64 8
%165 = load i8, i8* %164
%166 = getelementptr inbounds i8, i8* %124, i64 14
store i8 %165, i8* %166
%167 = getelementptr inbounds i8, i8* %124, i64 17
store i8 %165, i8* %167
%168 = getelementptr inbounds i8, i8* %124, i64 18
%169 = getelementptr inbounds i8, i8* %125, i64 9
br i1 %120, label %170, label %126
170: ; preds = %157
%171 = load i8, i8* %169
store i8 %171, i8* %168
%172 = getelementptr inbounds i8, i8* %124, i64 21
store i8 %171, i8* %172
%173 = getelementptr inbounds i8, i8* %125, i64 10
%174 = load i8, i8* %173
%175 = getelementptr inbounds i8, i8* %124, i64 19
store i8 %174, i8* %175
%176 = getelementptr inbounds i8, i8* %124, i64 22
store i8 %174, i8* %176
%177 = getelementptr inbounds i8, i8* %125, i64 11
%178 = load i8, i8* %177
%179 = getelementptr inbounds i8, i8* %124, i64 20
store i8 %178, i8* %179
%180 = getelementptr inbounds i8, i8* %124, i64 23
store i8 %178, i8* %180
%181 = getelementptr inbounds i8, i8* %124, i64 24
%182 = getelementptr inbounds i8, i8* %125, i64 12
br label %126
183: ; preds = %212, %126
%184 = phi i8* [ %127, %126 ], [ %258, %212 ]
%185 = phi i8* [ %128, %126 ], [ %257, %212 ]
%186 = phi i32 [ %129, %126 ], [ %259, %212 ]
%187 = icmp eq i32 %186, 0
br i1 %187, label %291, label %188
188: ; preds = %183
%189 = and i32 %186, 1
%190 = icmp eq i32 %189, 0
br i1 %190, label %205, label %191
191: ; preds = %188
%192 = load i8, i8* %184
store i8 %192, i8* %185
%193 = getelementptr inbounds i8, i8* %185, i64 3
store i8 %192, i8* %193
%194 = getelementptr inbounds i8, i8* %184, i64 1
%195 = load i8, i8* %194
%196 = getelementptr inbounds i8, i8* %185, i64 1
store i8 %195, i8* %196
%197 = getelementptr inbounds i8, i8* %185, i64 4
store i8 %195, i8* %197
%198 = getelementptr inbounds i8, i8* %184, i64 2
%199 = load i8, i8* %198
%200 = getelementptr inbounds i8, i8* %185, i64 2
store i8 %199, i8* %200
%201 = getelementptr inbounds i8, i8* %185, i64 5
store i8 %199, i8* %201
%202 = getelementptr inbounds i8, i8* %185, i64 6
%203 = getelementptr inbounds i8, i8* %184, i64 3
%204 = add nsw i32 %186, -1
br label %205
205: ; preds = %191, %188
%206 = phi i8* [ undef, %188 ], [ %202, %191 ]
%207 = phi i8* [ undef, %188 ], [ %203, %191 ]
%208 = phi i32 [ %186, %188 ], [ %204, %191 ]
%209 = phi i8* [ %185, %188 ], [ %202, %191 ]
%210 = phi i8* [ %184, %188 ], [ %203, %191 ]
%211 = icmp eq i32 %186, 1
br i1 %211, label %291, label %261
212: ; preds = %126, %212
%213 = phi i32 [ %259, %212 ], [ %129, %126 ]
%214 = phi i8* [ %257, %212 ], [ %128, %126 ]
%215 = phi i8* [ %258, %212 ], [ %127, %126 ]
%216 = bitcast i8* %215 to i32*
%217 = load i32, i32* %216
%218 = getelementptr inbounds i8, i8* %215, i64 4
%219 = bitcast i8* %218 to i32*
%220 = load i32, i32* %219
%221 = and i32 %217, 16777215
%222 = shl i32 %217, 24
%223 = or i32 %221, %222
%224 = bitcast i8* %214 to i32*
store i32 %223, i32* %224
%225 = call i32 @llvm.fshl.i32(i32 %220, i32 %217, i32 24)
%226 = getelementptr inbounds i8, i8* %214, i64 4
%227 = bitcast i8* %226 to i32*
store i32 %225, i32* %227
%228 = lshr i32 %220, 8
%229 = and i32 %228, 255
%230 = lshr i32 %217, 16
%231 = and i32 %230, 65280
%232 = or i32 %231, %229
%233 = shl i32 %220, 16
%234 = or i32 %232, %233
%235 = getelementptr inbounds i8, i8* %214, i64 8
%236 = bitcast i8* %235 to i32*
store i32 %234, i32* %236
%237 = getelementptr inbounds i8, i8* %215, i64 8
%238 = bitcast i8* %237 to i32*
%239 = load i32, i32* %238
%240 = lshr i32 %220, 16
%241 = shl i32 %239, 16
%242 = and i32 %241, 16711680
%243 = shl i32 %220, 8
%244 = and i32 %243, -16777216
%245 = or i32 %244, %240
%246 = or i32 %245, %242
%247 = getelementptr inbounds i8, i8* %214, i64 12
%248 = bitcast i8* %247 to i32*
store i32 %246, i32* %248
%249 = call i32 @llvm.fshl.i32(i32 %239, i32 %220, i32 8)
%250 = getelementptr inbounds i8, i8* %214, i64 16
%251 = bitcast i8* %250 to i32*
store i32 %249, i32* %251
%252 = lshr i32 %239, 24
%253 = and i32 %239, -256
%254 = or i32 %252, %253
%255 = getelementptr inbounds i8, i8* %214, i64 20
%256 = bitcast i8* %255 to i32*
store i32 %254, i32* %256
%257 = getelementptr inbounds i8, i8* %214, i64 24
%258 = getelementptr inbounds i8, i8* %215, i64 12
%259 = add nsw i32 %213, -4
%260 = icmp ugt i32 %213, 7
br i1 %260, label %212, label %183
261: ; preds = %205, %261
%262 = phi i32 [ %289, %261 ], [ %208, %205 ]
%263 = phi i8* [ %287, %261 ], [ %209, %205 ]
%264 = phi i8* [ %288, %261 ], [ %210, %205 ]
%265 = load i8, i8* %264
store i8 %265, i8* %263
%266 = getelementptr inbounds i8, i8* %263, i64 3
store i8 %265, i8* %266
%267 = getelementptr inbounds i8, i8* %264, i64 1
%268 = load i8, i8* %267
%269 = getelementptr inbounds i8, i8* %263, i64 1
store i8 %268, i8* %269
%270 = getelementptr inbounds i8, i8* %263, i64 4
store i8 %268, i8* %270
%271 = getelementptr inbounds i8, i8* %264, i64 2
%272 = load i8, i8* %271
%273 = getelementptr inbounds i8, i8* %263, i64 2
store i8 %272, i8* %273
%274 = getelementptr inbounds i8, i8* %263, i64 5
store i8 %272, i8* %274
%275 = getelementptr inbounds i8, i8* %263, i64 6
%276 = getelementptr inbounds i8, i8* %264, i64 3
%277 = load i8, i8* %276
store i8 %277, i8* %275
%278 = getelementptr inbounds i8, i8* %263, i64 9
store i8 %277, i8* %278
%279 = getelementptr inbounds i8, i8* %264, i64 4
%280 = load i8, i8* %279
%281 = getelementptr inbounds i8, i8* %263, i64 7
store i8 %280, i8* %281
%282 = getelementptr inbounds i8, i8* %263, i64 10
store i8 %280, i8* %282
%283 = getelementptr inbounds i8, i8* %264, i64 5
%284 = load i8, i8* %283
%285 = getelementptr inbounds i8, i8* %263, i64 8
store i8 %284, i8* %285
%286 = getelementptr inbounds i8, i8* %263, i64 11
store i8 %284, i8* %286
%287 = getelementptr inbounds i8, i8* %263, i64 12
%288 = getelementptr inbounds i8, i8* %264, i64 6
%289 = add nsw i32 %262, -2
%290 = icmp eq i32 %289, 0
br i1 %290, label %291, label %261
291: ; preds = %205, %261, %183
%292 = phi i8* [ %184, %183 ], [ %207, %205 ], [ %288, %261 ]
%293 = phi i8* [ %185, %183 ], [ %206, %205 ], [ %287, %261 ]
%294 = getelementptr inbounds i8, i8* %292, i64 %95
%295 = getelementptr inbounds i8, i8* %293, i64 %98
%296 = getelementptr inbounds i8, i8* %295, i64 %99
%297 = call i32 @memcpy(i8* %296, i8* %295, i32 %96)
%298 = getelementptr inbounds i8, i8* %294, i64 %100
%299 = getelementptr inbounds i8, i8* %295, i64 %102
%300 = add nuw nsw i32 %123, 1
%301 = icmp eq i32 %300, %15
br i1 %301, label %302, label %122
302: ; preds = %291, %61, %74, %43, %70, %16
%303 = phi i32 [ -1, %16 ], [ -1, %70 ], [ 0, %43 ], [ 0, %74 ], [ 0, %61 ], [ 0, %291 ]
ret i32 %303
}