#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*/ qc_imag_writergb(unsigned char *, int, unsigned char,
                                    unsigned char, unsigned char);
void qc_imag_bay2rgb_cottnoip(unsigned char *bay, int bay_line,
                              unsigned char *rgb, int rgb_line, int columns,
                              int rows, int bpp) {
  unsigned char *cur_bay, *cur_rgb;
  int bay_line2, rgb_line2;
  int total_columns;
  total_columns = (columns >> 1) - 1;
  rows = (rows >> 1) - 1;
  bay_line2 = 2 * bay_line;
  rgb_line2 = 2 * rgb_line;
  do {
    cur_bay = bay;
    cur_rgb = rgb;
    columns = total_columns;
    do {
      qc_imag_writergb(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0],
                       cur_bay[bay_line]);
      qc_imag_writergb(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[2],
                       cur_bay[bay_line + 2]);
      qc_imag_writergb(cur_rgb + rgb_line, bpp, cur_bay[bay_line2 + 1],
                       cur_bay[bay_line + 1], cur_bay[bay_line]);
      qc_imag_writergb(cur_rgb + rgb_line + bpp, bpp, cur_bay[bay_line2 + 1],
                       cur_bay[bay_line + 1], cur_bay[bay_line + 2]);
      cur_bay += 2;
      cur_rgb += 2 * bpp;
    } while (--columns);
    qc_imag_writergb(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0],
                     cur_bay[bay_line]);
    qc_imag_writergb(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[bay_line + 1],
                     cur_bay[bay_line]);
    qc_imag_writergb(cur_rgb + rgb_line, bpp, cur_bay[bay_line2 + 1],
                     cur_bay[bay_line + 1], cur_bay[bay_line]);
    qc_imag_writergb(cur_rgb + rgb_line + bpp, bpp, cur_bay[bay_line2 + 1],
                     cur_bay[bay_line + 1], cur_bay[bay_line]);
    bay += bay_line2;
    rgb += rgb_line2;
  } while (--rows);
  cur_bay = bay;
  cur_rgb = rgb;
  columns = total_columns;
  do {
    qc_imag_writergb(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0],
                     cur_bay[bay_line]);
    qc_imag_writergb(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[2],
                     cur_bay[bay_line + 2]);
    qc_imag_writergb(cur_rgb + rgb_line, bpp, cur_bay[1], cur_bay[bay_line + 1],
                     cur_bay[bay_line]);
    qc_imag_writergb(cur_rgb + rgb_line + bpp, bpp, cur_bay[1],
                     cur_bay[bay_line + 1], cur_bay[bay_line + 2]);
    cur_bay += 2;
    cur_rgb += 2 * bpp;
  } while (--columns);
  qc_imag_writergb(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0], cur_bay[bay_line]);
  qc_imag_writergb(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[bay_line + 1],
                   cur_bay[bay_line]);
  qc_imag_writergb(cur_rgb + rgb_line, bpp, cur_bay[1], cur_bay[bay_line + 1],
                   cur_bay[bay_line]);
  qc_imag_writergb(cur_rgb + rgb_line + bpp, bpp, cur_bay[1],
                   cur_bay[bay_line + 1], cur_bay[bay_line]);
}


x86 assembly (clang, -O0):
<qc_imag_bay2rgb_cottnoip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x20(%rbp),%eax
sar    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x24(%rbp),%eax
sar    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    (%rax),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x30(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
mov    0x10(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jne    1171 <qc_imag_bay2rgb_cottnoip+0x61>
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    (%rax),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x3c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jne    115b <qc_imag_bay2rgb_cottnoip+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    (%rax),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x30(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
mov    0x10(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jne    13ea <qc_imag_bay2rgb_cottnoip+0x2da>
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    (%rax),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <qc_imag_writergb@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qc_imag_bay2rgb_cottnoip>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdx,%r12
mov    0xc0(%rsp),%eax
sar    %r8d
sar    %r9d
add    $0xffffffff,%r9d
movslq %esi,%r11
add    %esi,%esi
mov    %eax,0x4(%rsp)
movslq %eax,%rbx
lea    0x2(%r11),%rax
mov    %rax,0x40(%rsp)
movslq %ecx,%r10
add    %ecx,%ecx
lea    (%r11,%r11,1),%eax
add    $0x1,%eax
movslq %eax,%rdx
lea    0x1(%r11),%rax
mov    %rax,0x20(%rsp)
lea    (%rbx,%rbx,1),%eax
cltq
mov    %rax,0x60(%rsp)
movslq %esi,%rax
mov    %rax,0x80(%rsp)
movslq %ecx,%rax
mov    %rax,0x78(%rsp)
lea    (%rdi,%r11,1),%rsi
add    $0x1,%rsi
add    %rdi,%rdx
movslq %r8d,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,0x58(%rsp)
lea    (%rdi,%r11,1),%rcx
add    $0x2,%rcx
mov    %r11,0x28(%rsp)
mov    %rdi,%rbp
add    %r11,%rdi
mov    %r10,0x10(%rsp)
lea    (%rbx,%r10,1),%rax
mov    %rax,0x30(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rbp,0x18(%rsp)
mov    %rdi,0x8(%rsp)
mov    %rcx,0x68(%rsp)
mov    %rsi,0x70(%rsp)
mov    %rdx,0x38(%rsp)
mov    %r9d,0x54(%rsp)
xor    %r13d,%r13d
mov    %r12,0x48(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    0x18(%rsp),%rbp
movzbl 0x1(%rbp,%r13,2),%edx
movzbl 0x0(%rbp,%r13,2),%ecx
mov    0x8(%rsp),%rax
movzbl (%rax,%r13,2),%r8d
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <qc_imag_writergb@plt>
lea    (%r12,%rbx,1),%rdi
movzbl 0x1(%rbp,%r13,2),%edx
movzbl 0x2(%rbp,%r13,2),%ecx
mov    %rbx,%r15
mov    0x68(%rsp),%rbp
movzbl 0x0(%rbp,%r13,2),%r8d
mov    %r15d,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x10(%rsp),%rax
lea    (%r12,%rax,1),%rdi
mov    0x38(%rsp),%rbx
movzbl (%rbx,%r13,2),%edx
mov    0x70(%rsp),%r14
movzbl (%r14,%r13,2),%ecx
mov    0x8(%rsp),%rax
movzbl (%rax,%r13,2),%r8d
mov    %r15d,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x30(%rsp),%rax
lea    (%r12,%rax,1),%rdi
movzbl (%rbx,%r13,2),%edx
movzbl (%r14,%r13,2),%ecx
movzbl 0x0(%rbp,%r13,2),%r8d
mov    %r15,%rbx
mov    %ebx,%esi
call   1030 <qc_imag_writergb@plt>
add    0x60(%rsp),%r12
add    $0x1,%r13
cmp    %r13d,0x58(%rsp)
jne    11f0 <qc_imag_bay2rgb_cottnoip+0xe0>
mov    0x18(%rsp),%rbp
movzbl 0x1(%rbp,%r13,2),%edx
movzbl 0x0(%rbp,%r13,2),%ecx
mov    0x8(%rsp),%r15
movzbl (%r15,%r13,2),%r8d
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <qc_imag_writergb@plt>
lea    (%r12,%rbx,1),%rdi
movzbl 0x1(%rbp,%r13,2),%edx
mov    0x70(%rsp),%r14
movzbl (%r14,%r13,2),%ecx
movzbl (%r15,%r13,2),%r8d
mov    %ebx,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x10(%rsp),%rax
lea    (%r12,%rax,1),%rdi
mov    0x38(%rsp),%rax
movzbl (%rax,%r13,2),%edx
movzbl (%r14,%r13,2),%ecx
movzbl (%r15,%r13,2),%r8d
mov    %ebx,%esi
call   1030 <qc_imag_writergb@plt>
add    0x30(%rsp),%r12
mov    0x38(%rsp),%rax
movzbl (%rax,%r13,2),%edx
movzbl (%r14,%r13,2),%ecx
movzbl (%r15,%r13,2),%r8d
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x80(%rsp),%rax
add    %rax,%rbp
mov    0x48(%rsp),%r12
add    0x78(%rsp),%r12
add    %rax,%r14
mov    0x38(%rsp),%rdx
add    %rax,%rdx
mov    0x68(%rsp),%rcx
add    %rax,%rcx
add    %rax,%r15
mov    0x54(%rsp),%r9d
add    $0xffffffff,%r9d
mov    %r14,%rsi
mov    %r15,%rdi
jne    11c0 <qc_imag_bay2rgb_cottnoip+0xb0>
add    %rbp,0x20(%rsp)
add    %rbp,0x40(%rsp)
mov    0x28(%rsp),%rax
mov    %rbp,0x18(%rsp)
add    %rbp,%rax
add    %r12,0x10(%rsp)
lea    (%r12,%rbx,1),%rcx
mov    %rcx,0x8(%rsp)
add    %r12,0x30(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
mov    %r12,0x48(%rsp)
mov    %rax,0x28(%rsp)
mov    0x18(%rsp),%rbp
mov    0x20(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%r12,%r14,1),%rdi
movzbl 0x1(%rbp,%r15,2),%edx
movzbl 0x0(%rbp,%r15,2),%ecx
movzbl (%rax,%r15,2),%r8d
mov    0x4(%rsp),%r12d
mov    %r12d,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x8(%rsp),%rax
lea    (%rax,%r14,1),%rdi
movzbl 0x1(%rbp,%r15,2),%edx
movzbl 0x2(%rbp,%r15,2),%ecx
mov    0x40(%rsp),%rax
movzbl (%rax,%r15,2),%r8d
mov    %r12d,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x10(%rsp),%rax
lea    (%rax,%r14,1),%rdi
movzbl 0x1(%rbp,%r15,2),%edx
movzbl 0x0(%r13,%r15,2),%ecx
mov    0x28(%rsp),%rax
movzbl (%rax,%r15,2),%r8d
mov    %r12d,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x30(%rsp),%rax
lea    (%rax,%r14,1),%rdi
movzbl 0x1(%rbp,%r15,2),%edx
movzbl 0x0(%r13,%r15,2),%ecx
mov    0x40(%rsp),%rax
movzbl (%rax,%r15,2),%r8d
mov    %r12d,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x28(%rsp),%rax
mov    0x48(%rsp),%r12
add    $0x1,%r15
add    0x60(%rsp),%r14
cmp    %r15d,0x58(%rsp)
jne    13c0 <qc_imag_bay2rgb_cottnoip+0x2b0>
mov    0x18(%rsp),%r13
movzbl 0x1(%r13,%r15,2),%edx
movzbl 0x0(%r13,%r15,2),%ecx
movzbl (%rax,%r15,2),%r8d
add    %r14,%r12
mov    %r12,%rdi
mov    0x4(%rsp),%r12d
mov    %r12d,%esi
mov    %rax,%rbp
call   1030 <qc_imag_writergb@plt>
mov    0x8(%rsp),%rdi
add    %r14,%rdi
movzbl 0x1(%r13,%r15,2),%edx
mov    0x20(%rsp),%rax
movzbl (%rax,%r15,2),%ecx
movzbl 0x0(%rbp,%r15,2),%r8d
mov    %r12d,%esi
call   1030 <qc_imag_writergb@plt>
mov    0x10(%rsp),%r12
add    %r14,%r12
movzbl 0x1(%r13,%r15,2),%edx
mov    0x20(%rsp),%r14
movzbl (%r14,%r15,2),%ecx
movzbl 0x0(%rbp,%r15,2),%r8d
mov    %r12,%rdi
mov    0x4(%rsp),%esi
call   1030 <qc_imag_writergb@plt>
add    %rbx,%r12
movzbl 0x1(%r13,%r15,2),%edx
movzbl (%r14,%r15,2),%ecx
movzbl 0x0(%rbp,%r15,2),%r8d
mov    %r12,%rdi
mov    0x4(%rsp),%esi
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <qc_imag_writergb@plt>

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

LLVM IR (-O2):
define void @qc_imag_bay2rgb_cottnoip(i8* nocapture %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = ashr i32 %4, 1
%9 = add nsw i32 %8, -1
%10 = ashr i32 %5, 1
%11 = add nsw i32 %10, -1
%12 = shl nsw i32 %1, 1
%13 = shl nsw i32 %3, 1
%14 = sext i32 %1 to i64
%15 = sext i32 %6 to i64
%16 = add nsw i32 %1, 2
%17 = sext i32 %16 to i64
%18 = sext i32 %3 to i64
%19 = or i32 %12, 1
%20 = sext i32 %19 to i64
%21 = add nsw i32 %1, 1
%22 = sext i32 %21 to i64
%23 = shl nsw i32 %6, 1
%24 = sext i32 %23 to i64
%25 = sext i32 %12 to i64
%26 = sext i32 %13 to i64
br label %27
27: ; preds = %63, %7
%28 = phi i32 [ %11, %7 ], [ %89, %63 ]
%29 = phi i8* [ %2, %7 ], [ %88, %63 ]
%30 = phi i8* [ %0, %7 ], [ %87, %63 ]
br label %31
31: ; preds = %31, %27
%32 = phi i8* [ %30, %27 ], [ %43, %31 ]
%33 = phi i8* [ %29, %27 ], [ %60, %31 ]
%34 = phi i32 [ %9, %27 ], [ %61, %31 ]
%35 = getelementptr inbounds i8, i8* %32, i64 1
%36 = load i8, i8* %35
%37 = load i8, i8* %32
%38 = getelementptr inbounds i8, i8* %32, i64 %14
%39 = load i8, i8* %38
%40 = tail call i32 @qc_imag_writergb(i8* %33, i32 %6, i8 zeroext %36, i8 zeroext %37, i8 zeroext %39)
%41 = getelementptr inbounds i8, i8* %33, i64 %15
%42 = load i8, i8* %35
%43 = getelementptr inbounds i8, i8* %32, i64 2
%44 = load i8, i8* %43
%45 = getelementptr inbounds i8, i8* %32, i64 %17
%46 = load i8, i8* %45
%47 = tail call i32 @qc_imag_writergb(i8* %41, i32 %6, i8 zeroext %42, i8 zeroext %44, i8 zeroext %46)
%48 = getelementptr inbounds i8, i8* %33, i64 %18
%49 = getelementptr inbounds i8, i8* %32, i64 %20
%50 = load i8, i8* %49
%51 = getelementptr inbounds i8, i8* %32, i64 %22
%52 = load i8, i8* %51
%53 = load i8, i8* %38
%54 = tail call i32 @qc_imag_writergb(i8* %48, i32 %6, i8 zeroext %50, i8 zeroext %52, i8 zeroext %53)
%55 = getelementptr inbounds i8, i8* %48, i64 %15
%56 = load i8, i8* %49
%57 = load i8, i8* %51
%58 = load i8, i8* %45
%59 = tail call i32 @qc_imag_writergb(i8* %55, i32 %6, i8 zeroext %56, i8 zeroext %57, i8 zeroext %58)
%60 = getelementptr inbounds i8, i8* %33, i64 %24
%61 = add nsw i32 %34, -1
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %31
63: ; preds = %31
%64 = getelementptr inbounds i8, i8* %32, i64 3
%65 = load i8, i8* %64
%66 = load i8, i8* %43
%67 = getelementptr inbounds i8, i8* %43, i64 %14
%68 = load i8, i8* %67
%69 = tail call i32 @qc_imag_writergb(i8* %60, i32 %6, i8 zeroext %65, i8 zeroext %66, i8 zeroext %68)
%70 = getelementptr inbounds i8, i8* %60, i64 %15
%71 = load i8, i8* %64
%72 = getelementptr inbounds i8, i8* %43, i64 %22
%73 = load i8, i8* %72
%74 = load i8, i8* %67
%75 = tail call i32 @qc_imag_writergb(i8* %70, i32 %6, i8 zeroext %71, i8 zeroext %73, i8 zeroext %74)
%76 = getelementptr inbounds i8, i8* %60, i64 %18
%77 = getelementptr inbounds i8, i8* %43, i64 %20
%78 = load i8, i8* %77
%79 = load i8, i8* %72
%80 = load i8, i8* %67
%81 = tail call i32 @qc_imag_writergb(i8* %76, i32 %6, i8 zeroext %78, i8 zeroext %79, i8 zeroext %80)
%82 = getelementptr inbounds i8, i8* %76, i64 %15
%83 = load i8, i8* %77
%84 = load i8, i8* %72
%85 = load i8, i8* %67
%86 = tail call i32 @qc_imag_writergb(i8* %82, i32 %6, i8 zeroext %83, i8 zeroext %84, i8 zeroext %85)
%87 = getelementptr inbounds i8, i8* %30, i64 %25
%88 = getelementptr inbounds i8, i8* %29, i64 %26
%89 = add nsw i32 %28, -1
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %27
91: ; preds = %63, %91
%92 = phi i8* [ %103, %91 ], [ %87, %63 ]
%93 = phi i8* [ %119, %91 ], [ %88, %63 ]
%94 = phi i32 [ %120, %91 ], [ %9, %63 ]
%95 = getelementptr inbounds i8, i8* %92, i64 1
%96 = load i8, i8* %95
%97 = load i8, i8* %92
%98 = getelementptr inbounds i8, i8* %92, i64 %14
%99 = load i8, i8* %98
%100 = tail call i32 @qc_imag_writergb(i8* %93, i32 %6, i8 zeroext %96, i8 zeroext %97, i8 zeroext %99)
%101 = getelementptr inbounds i8, i8* %93, i64 %15
%102 = load i8, i8* %95
%103 = getelementptr inbounds i8, i8* %92, i64 2
%104 = load i8, i8* %103
%105 = getelementptr inbounds i8, i8* %92, i64 %17
%106 = load i8, i8* %105
%107 = tail call i32 @qc_imag_writergb(i8* %101, i32 %6, i8 zeroext %102, i8 zeroext %104, i8 zeroext %106)
%108 = getelementptr inbounds i8, i8* %93, i64 %18
%109 = load i8, i8* %95
%110 = getelementptr inbounds i8, i8* %92, i64 %22
%111 = load i8, i8* %110
%112 = load i8, i8* %98
%113 = tail call i32 @qc_imag_writergb(i8* %108, i32 %6, i8 zeroext %109, i8 zeroext %111, i8 zeroext %112)
%114 = getelementptr inbounds i8, i8* %108, i64 %15
%115 = load i8, i8* %95
%116 = load i8, i8* %110
%117 = load i8, i8* %105
%118 = tail call i32 @qc_imag_writergb(i8* %114, i32 %6, i8 zeroext %115, i8 zeroext %116, i8 zeroext %117)
%119 = getelementptr inbounds i8, i8* %93, i64 %24
%120 = add nsw i32 %94, -1
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %91
122: ; preds = %91
%123 = getelementptr inbounds i8, i8* %92, i64 3
%124 = load i8, i8* %123
%125 = load i8, i8* %103
%126 = getelementptr inbounds i8, i8* %103, i64 %14
%127 = load i8, i8* %126
%128 = tail call i32 @qc_imag_writergb(i8* %119, i32 %6, i8 zeroext %124, i8 zeroext %125, i8 zeroext %127)
%129 = getelementptr inbounds i8, i8* %119, i64 %15
%130 = load i8, i8* %123
%131 = getelementptr inbounds i8, i8* %103, i64 %22
%132 = load i8, i8* %131
%133 = load i8, i8* %126
%134 = tail call i32 @qc_imag_writergb(i8* %129, i32 %6, i8 zeroext %130, i8 zeroext %132, i8 zeroext %133)
%135 = getelementptr inbounds i8, i8* %119, i64 %18
%136 = load i8, i8* %123
%137 = load i8, i8* %131
%138 = load i8, i8* %126
%139 = tail call i32 @qc_imag_writergb(i8* %135, i32 %6, i8 zeroext %136, i8 zeroext %137, i8 zeroext %138)
%140 = getelementptr inbounds i8, i8* %135, i64 %15
%141 = load i8, i8* %123
%142 = load i8, i8* %131
%143 = load i8, i8* %126
%144 = tail call i32 @qc_imag_writergb(i8* %140, i32 %6, i8 zeroext %141, i8 zeroext %142, i8 zeroext %143)
ret void
}