#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_writergb10(unsigned char *, int, unsigned short,
                                      unsigned short, unsigned short);
void qc_imag_bay2rgb_cottnoip10(unsigned short *bay, int bay_line,
                                unsigned char *rgb, int rgb_line, int columns,
                                int rows, int bpp) {
  unsigned short *cur_bay;
  unsigned char *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_writergb10(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0],
                         cur_bay[bay_line]);
      qc_imag_writergb10(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[2],
                         cur_bay[bay_line + 2]);
      qc_imag_writergb10(cur_rgb + rgb_line, bpp, cur_bay[bay_line2 + 1],
                         cur_bay[bay_line + 1], cur_bay[bay_line]);
      qc_imag_writergb10(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_writergb10(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0],
                       cur_bay[bay_line]);
    qc_imag_writergb10(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[bay_line + 1],
                       cur_bay[bay_line]);
    qc_imag_writergb10(cur_rgb + rgb_line, bpp, cur_bay[bay_line2 + 1],
                       cur_bay[bay_line + 1], cur_bay[bay_line]);
    qc_imag_writergb10(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_writergb10(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0],
                       cur_bay[bay_line]);
    qc_imag_writergb10(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[2],
                       cur_bay[bay_line + 2]);
    qc_imag_writergb10(cur_rgb + rgb_line, bpp, cur_bay[1],
                       cur_bay[bay_line + 1], cur_bay[bay_line]);
    qc_imag_writergb10(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_writergb10(cur_rgb + 0, bpp, cur_bay[1], cur_bay[0],
                     cur_bay[bay_line]);
  qc_imag_writergb10(cur_rgb + bpp, bpp, cur_bay[1], cur_bay[bay_line + 1],
                     cur_bay[bay_line]);
  qc_imag_writergb10(cur_rgb + rgb_line, bpp, cur_bay[1], cur_bay[bay_line + 1],
                     cur_bay[bay_line]);
  qc_imag_writergb10(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_cottnoip10>:
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    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    (%rax),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%cx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@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,2),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@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,2),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x30(%rbp),%rax
add    $0x4,%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_cottnoip10+0x61>
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    (%rax),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@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,2),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@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,2),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x3c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x1,%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_cottnoip10+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    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    (%rax),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%cx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@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    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
movslq %r8d,%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x30(%rbp),%rax
add    $0x4,%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    13fe <qc_imag_bay2rgb_cottnoip10+0x2ee>
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    (%rax),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x38(%rbp),%rdi
movslq 0x10(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
mov    -0x38(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    0x10(%rbp),%esi
mov    -0x30(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@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    0x2(%rax),%dx
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%r8
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl (%rax,%r8,2),%r8d
call   1030 <qc_imag_writergb10@plt>
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @qc_imag_bay2rgb_cottnoip10(i16* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i16*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i16*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i16* %0, i16** %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 i16*, i16** %8
store i16* %31, i16** %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 i16*, i16** %15
%39 = getelementptr inbounds i16, i16* %38, i64 1
%40 = load i16, i16* %39
%41 = load i16*, i16** %15
%42 = getelementptr inbounds i16, i16* %41, i64 0
%43 = load i16, i16* %42
%44 = load i16*, i16** %15
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i16, i16* %44, i64 %46
%48 = load i16, i16* %47
%49 = call i32 @qc_imag_writergb10(i8* %36, i32 %37, i16 zeroext %40, i16 zeroext %43, i16 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 i16*, i16** %15
%56 = getelementptr inbounds i16, i16* %55, i64 1
%57 = load i16, i16* %56
%58 = load i16*, i16** %15
%59 = getelementptr inbounds i16, i16* %58, i64 2
%60 = load i16, i16* %59
%61 = load i16*, i16** %15
%62 = load i32, i32* %9
%63 = add nsw i32 %62, 2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i16, i16* %61, i64 %64
%66 = load i16, i16* %65
%67 = call i32 @qc_imag_writergb10(i8* %53, i32 %54, i16 zeroext %57, i16 zeroext %60, i16 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 i16*, i16** %15
%74 = load i32, i32* %17
%75 = add nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i16, i16* %73, i64 %76
%78 = load i16, i16* %77
%79 = load i16*, i16** %15
%80 = load i32, i32* %9
%81 = add nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i16, i16* %79, i64 %82
%84 = load i16, i16* %83
%85 = load i16*, i16** %15
%86 = load i32, i32* %9
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i16, i16* %85, i64 %87
%89 = load i16, i16* %88
%90 = call i32 @qc_imag_writergb10(i8* %71, i32 %72, i16 zeroext %78, i16 zeroext %84, i16 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 i16*, i16** %15
%100 = load i32, i32* %17
%101 = add nsw i32 %100, 1
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i16, i16* %99, i64 %102
%104 = load i16, i16* %103
%105 = load i16*, i16** %15
%106 = load i32, i32* %9
%107 = add nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i16, i16* %105, i64 %108
%110 = load i16, i16* %109
%111 = load i16*, i16** %15
%112 = load i32, i32* %9
%113 = add nsw i32 %112, 2
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i16, i16* %111, i64 %114
%116 = load i16, i16* %115
%117 = call i32 @qc_imag_writergb10(i8* %97, i32 %98, i16 zeroext %104, i16 zeroext %110, i16 zeroext %116)
%118 = load i16*, i16** %15
%119 = getelementptr inbounds i16, i16* %118, i64 2
store i16* %119, i16** %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 i16*, i16** %15
%134 = getelementptr inbounds i16, i16* %133, i64 1
%135 = load i16, i16* %134
%136 = load i16*, i16** %15
%137 = getelementptr inbounds i16, i16* %136, i64 0
%138 = load i16, i16* %137
%139 = load i16*, i16** %15
%140 = load i32, i32* %9
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i16, i16* %139, i64 %141
%143 = load i16, i16* %142
%144 = call i32 @qc_imag_writergb10(i8* %131, i32 %132, i16 zeroext %135, i16 zeroext %138, i16 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 i16*, i16** %15
%151 = getelementptr inbounds i16, i16* %150, i64 1
%152 = load i16, i16* %151
%153 = load i16*, i16** %15
%154 = load i32, i32* %9
%155 = add nsw i32 %154, 1
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds i16, i16* %153, i64 %156
%158 = load i16, i16* %157
%159 = load i16*, i16** %15
%160 = load i32, i32* %9
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i16, i16* %159, i64 %161
%163 = load i16, i16* %162
%164 = call i32 @qc_imag_writergb10(i8* %148, i32 %149, i16 zeroext %152, i16 zeroext %158, i16 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 i16*, i16** %15
%171 = load i32, i32* %17
%172 = add nsw i32 %171, 1
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i16, i16* %170, i64 %173
%175 = load i16, i16* %174
%176 = load i16*, i16** %15
%177 = load i32, i32* %9
%178 = add nsw i32 %177, 1
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds i16, i16* %176, i64 %179
%181 = load i16, i16* %180
%182 = load i16*, i16** %15
%183 = load i32, i32* %9
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i16, i16* %182, i64 %184
%186 = load i16, i16* %185
%187 = call i32 @qc_imag_writergb10(i8* %168, i32 %169, i16 zeroext %175, i16 zeroext %181, i16 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 i16*, i16** %15
%197 = load i32, i32* %17
%198 = add nsw i32 %197, 1
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i16, i16* %196, i64 %199
%201 = load i16, i16* %200
%202 = load i16*, i16** %15
%203 = load i32, i32* %9
%204 = add nsw i32 %203, 1
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds i16, i16* %202, i64 %205
%207 = load i16, i16* %206
%208 = load i16*, i16** %15
%209 = load i32, i32* %9
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i16, i16* %208, i64 %210
%212 = load i16, i16* %211
%213 = call i32 @qc_imag_writergb10(i8* %194, i32 %195, i16 zeroext %201, i16 zeroext %207, i16 zeroext %212)
%214 = load i32, i32* %17
%215 = load i16*, i16** %8
%216 = sext i32 %214 to i64
%217 = getelementptr inbounds i16, i16* %215, i64 %216
store i16* %217, i16** %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 i16*, i16** %8
store i16* %227, i16** %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 i16*, i16** %15
%235 = getelementptr inbounds i16, i16* %234, i64 1
%236 = load i16, i16* %235
%237 = load i16*, i16** %15
%238 = getelementptr inbounds i16, i16* %237, i64 0
%239 = load i16, i16* %238
%240 = load i16*, i16** %15
%241 = load i32, i32* %9
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds i16, i16* %240, i64 %242
%244 = load i16, i16* %243
%245 = call i32 @qc_imag_writergb10(i8* %232, i32 %233, i16 zeroext %236, i16 zeroext %239, i16 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 i16*, i16** %15
%252 = getelementptr inbounds i16, i16* %251, i64 1
%253 = load i16, i16* %252
%254 = load i16*, i16** %15
%255 = getelementptr inbounds i16, i16* %254, i64 2
%256 = load i16, i16* %255
%257 = load i16*, i16** %15
%258 = load i32, i32* %9
%259 = add nsw i32 %258, 2
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds i16, i16* %257, i64 %260
%262 = load i16, i16* %261
%263 = call i32 @qc_imag_writergb10(i8* %249, i32 %250, i16 zeroext %253, i16 zeroext %256, i16 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 i16*, i16** %15
%270 = getelementptr inbounds i16, i16* %269, i64 1
%271 = load i16, i16* %270
%272 = load i16*, i16** %15
%273 = load i32, i32* %9
%274 = add nsw i32 %273, 1
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds i16, i16* %272, i64 %275
%277 = load i16, i16* %276
%278 = load i16*, i16** %15
%279 = load i32, i32* %9
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds i16, i16* %278, i64 %280
%282 = load i16, i16* %281
%283 = call i32 @qc_imag_writergb10(i8* %267, i32 %268, i16 zeroext %271, i16 zeroext %277, i16 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 i16*, i16** %15
%293 = getelementptr inbounds i16, i16* %292, i64 1
%294 = load i16, i16* %293
%295 = load i16*, i16** %15
%296 = load i32, i32* %9
%297 = add nsw i32 %296, 1
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds i16, i16* %295, i64 %298
%300 = load i16, i16* %299
%301 = load i16*, i16** %15
%302 = load i32, i32* %9
%303 = add nsw i32 %302, 2
%304 = sext i32 %303 to i64
%305 = getelementptr inbounds i16, i16* %301, i64 %304
%306 = load i16, i16* %305
%307 = call i32 @qc_imag_writergb10(i8* %290, i32 %291, i16 zeroext %294, i16 zeroext %300, i16 zeroext %306)
%308 = load i16*, i16** %15
%309 = getelementptr inbounds i16, i16* %308, i64 2
store i16* %309, i16** %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 i16*, i16** %15
%324 = getelementptr inbounds i16, i16* %323, i64 1
%325 = load i16, i16* %324
%326 = load i16*, i16** %15
%327 = getelementptr inbounds i16, i16* %326, i64 0
%328 = load i16, i16* %327
%329 = load i16*, i16** %15
%330 = load i32, i32* %9
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds i16, i16* %329, i64 %331
%333 = load i16, i16* %332
%334 = call i32 @qc_imag_writergb10(i8* %321, i32 %322, i16 zeroext %325, i16 zeroext %328, i16 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 i16*, i16** %15
%341 = getelementptr inbounds i16, i16* %340, i64 1
%342 = load i16, i16* %341
%343 = load i16*, i16** %15
%344 = load i32, i32* %9
%345 = add nsw i32 %344, 1
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds i16, i16* %343, i64 %346
%348 = load i16, i16* %347
%349 = load i16*, i16** %15
%350 = load i32, i32* %9
%351 = sext i32 %350 to i64
%352 = getelementptr inbounds i16, i16* %349, i64 %351
%353 = load i16, i16* %352
%354 = call i32 @qc_imag_writergb10(i8* %338, i32 %339, i16 zeroext %342, i16 zeroext %348, i16 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 i16*, i16** %15
%361 = getelementptr inbounds i16, i16* %360, i64 1
%362 = load i16, i16* %361
%363 = load i16*, i16** %15
%364 = load i32, i32* %9
%365 = add nsw i32 %364, 1
%366 = sext i32 %365 to i64
%367 = getelementptr inbounds i16, i16* %363, i64 %366
%368 = load i16, i16* %367
%369 = load i16*, i16** %15
%370 = load i32, i32* %9
%371 = sext i32 %370 to i64
%372 = getelementptr inbounds i16, i16* %369, i64 %371
%373 = load i16, i16* %372
%374 = call i32 @qc_imag_writergb10(i8* %358, i32 %359, i16 zeroext %362, i16 zeroext %368, i16 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 i16*, i16** %15
%384 = getelementptr inbounds i16, i16* %383, i64 1
%385 = load i16, i16* %384
%386 = load i16*, i16** %15
%387 = load i32, i32* %9
%388 = add nsw i32 %387, 1
%389 = sext i32 %388 to i64
%390 = getelementptr inbounds i16, i16* %386, i64 %389
%391 = load i16, i16* %390
%392 = load i16*, i16** %15
%393 = load i32, i32* %9
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds i16, i16* %392, i64 %394
%396 = load i16, i16* %395
%397 = call i32 @qc_imag_writergb10(i8* %381, i32 %382, i16 zeroext %385, i16 zeroext %391, i16 zeroext %396)
ret void
}

LLVM IR (-O2):
define void @qc_imag_bay2rgb_cottnoip10(i16* 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 i16* [ %0, %7 ], [ %87, %63 ]
br label %31
31: ; preds = %31, %27
%32 = phi i16* [ %30, %27 ], [ %43, %31 ]
%33 = phi i8* [ %29, %27 ], [ %60, %31 ]
%34 = phi i32 [ %9, %27 ], [ %61, %31 ]
%35 = getelementptr inbounds i16, i16* %32, i64 1
%36 = load i16, i16* %35
%37 = load i16, i16* %32
%38 = getelementptr inbounds i16, i16* %32, i64 %14
%39 = load i16, i16* %38
%40 = tail call i32 @qc_imag_writergb10(i8* %33, i32 %6, i16 zeroext %36, i16 zeroext %37, i16 zeroext %39)
%41 = getelementptr inbounds i8, i8* %33, i64 %15
%42 = load i16, i16* %35
%43 = getelementptr inbounds i16, i16* %32, i64 2
%44 = load i16, i16* %43
%45 = getelementptr inbounds i16, i16* %32, i64 %17
%46 = load i16, i16* %45
%47 = tail call i32 @qc_imag_writergb10(i8* %41, i32 %6, i16 zeroext %42, i16 zeroext %44, i16 zeroext %46)
%48 = getelementptr inbounds i8, i8* %33, i64 %18
%49 = getelementptr inbounds i16, i16* %32, i64 %20
%50 = load i16, i16* %49
%51 = getelementptr inbounds i16, i16* %32, i64 %22
%52 = load i16, i16* %51
%53 = load i16, i16* %38
%54 = tail call i32 @qc_imag_writergb10(i8* %48, i32 %6, i16 zeroext %50, i16 zeroext %52, i16 zeroext %53)
%55 = getelementptr inbounds i8, i8* %48, i64 %15
%56 = load i16, i16* %49
%57 = load i16, i16* %51
%58 = load i16, i16* %45
%59 = tail call i32 @qc_imag_writergb10(i8* %55, i32 %6, i16 zeroext %56, i16 zeroext %57, i16 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 i16, i16* %32, i64 3
%65 = load i16, i16* %64
%66 = load i16, i16* %43
%67 = getelementptr inbounds i16, i16* %43, i64 %14
%68 = load i16, i16* %67
%69 = tail call i32 @qc_imag_writergb10(i8* %60, i32 %6, i16 zeroext %65, i16 zeroext %66, i16 zeroext %68)
%70 = getelementptr inbounds i8, i8* %60, i64 %15
%71 = load i16, i16* %64
%72 = getelementptr inbounds i16, i16* %43, i64 %22
%73 = load i16, i16* %72
%74 = load i16, i16* %67
%75 = tail call i32 @qc_imag_writergb10(i8* %70, i32 %6, i16 zeroext %71, i16 zeroext %73, i16 zeroext %74)
%76 = getelementptr inbounds i8, i8* %60, i64 %18
%77 = getelementptr inbounds i16, i16* %43, i64 %20
%78 = load i16, i16* %77
%79 = load i16, i16* %72
%80 = load i16, i16* %67
%81 = tail call i32 @qc_imag_writergb10(i8* %76, i32 %6, i16 zeroext %78, i16 zeroext %79, i16 zeroext %80)
%82 = getelementptr inbounds i8, i8* %76, i64 %15
%83 = load i16, i16* %77
%84 = load i16, i16* %72
%85 = load i16, i16* %67
%86 = tail call i32 @qc_imag_writergb10(i8* %82, i32 %6, i16 zeroext %83, i16 zeroext %84, i16 zeroext %85)
%87 = getelementptr inbounds i16, i16* %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 i16* [ %103, %91 ], [ %87, %63 ]
%93 = phi i8* [ %119, %91 ], [ %88, %63 ]
%94 = phi i32 [ %120, %91 ], [ %9, %63 ]
%95 = getelementptr inbounds i16, i16* %92, i64 1
%96 = load i16, i16* %95
%97 = load i16, i16* %92
%98 = getelementptr inbounds i16, i16* %92, i64 %14
%99 = load i16, i16* %98
%100 = tail call i32 @qc_imag_writergb10(i8* %93, i32 %6, i16 zeroext %96, i16 zeroext %97, i16 zeroext %99)
%101 = getelementptr inbounds i8, i8* %93, i64 %15
%102 = load i16, i16* %95
%103 = getelementptr inbounds i16, i16* %92, i64 2
%104 = load i16, i16* %103
%105 = getelementptr inbounds i16, i16* %92, i64 %17
%106 = load i16, i16* %105
%107 = tail call i32 @qc_imag_writergb10(i8* %101, i32 %6, i16 zeroext %102, i16 zeroext %104, i16 zeroext %106)
%108 = getelementptr inbounds i8, i8* %93, i64 %18
%109 = load i16, i16* %95
%110 = getelementptr inbounds i16, i16* %92, i64 %22
%111 = load i16, i16* %110
%112 = load i16, i16* %98
%113 = tail call i32 @qc_imag_writergb10(i8* %108, i32 %6, i16 zeroext %109, i16 zeroext %111, i16 zeroext %112)
%114 = getelementptr inbounds i8, i8* %108, i64 %15
%115 = load i16, i16* %95
%116 = load i16, i16* %110
%117 = load i16, i16* %105
%118 = tail call i32 @qc_imag_writergb10(i8* %114, i32 %6, i16 zeroext %115, i16 zeroext %116, i16 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 i16, i16* %92, i64 3
%124 = load i16, i16* %123
%125 = load i16, i16* %103
%126 = getelementptr inbounds i16, i16* %103, i64 %14
%127 = load i16, i16* %126
%128 = tail call i32 @qc_imag_writergb10(i8* %119, i32 %6, i16 zeroext %124, i16 zeroext %125, i16 zeroext %127)
%129 = getelementptr inbounds i8, i8* %119, i64 %15
%130 = load i16, i16* %123
%131 = getelementptr inbounds i16, i16* %103, i64 %22
%132 = load i16, i16* %131
%133 = load i16, i16* %126
%134 = tail call i32 @qc_imag_writergb10(i8* %129, i32 %6, i16 zeroext %130, i16 zeroext %132, i16 zeroext %133)
%135 = getelementptr inbounds i8, i8* %119, i64 %18
%136 = load i16, i16* %123
%137 = load i16, i16* %131
%138 = load i16, i16* %126
%139 = tail call i32 @qc_imag_writergb10(i8* %135, i32 %6, i16 zeroext %136, i16 zeroext %137, i16 zeroext %138)
%140 = getelementptr inbounds i8, i8* %135, i64 %15
%141 = load i16, i16* %123
%142 = load i16, i16* %131
%143 = load i16, i16* %126
%144 = tail call i32 @qc_imag_writergb10(i8* %140, i32 %6, i16 zeroext %141, i16 zeroext %142, i16 zeroext %143)
ret void
}