#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ sstride;
typedef scalar_t__ src;
typedef scalar_t__ dstride;
typedef int /*<<< orphan*/ dst;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_si128(int /*<<< orphan*/ *);
int /*<<< orphan*/ _mm_packus_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi16(int);
int /*<<< orphan*/ _mm_srli_epi16(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_store_si128(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int pixel_split_bayer_planes_8u(uint8_t *dst[4], int dstride,
                                const uint8_t *src, int sstride, int width,
                                int height) {
  __m128i mask;
  int i, j;
  for (i = 0; i < 4; i++) {
    if (!(((uintptr_t)(dst[i]) & 0xf) == 0) ||
        !(((uintptr_t)(dstride)&0xf) == 0)) {
      fprintf(stderr,
              "pixel_split_bayer_planes_8u: dst[%d] is not "
              "16-byte aligned\n",
              i);
      return -1;
    }
  }
  if (!(((uintptr_t)(src)&0xf) == 0) || !(((uintptr_t)(sstride)&0xf) == 0)) {
    fprintf(stderr, "pixel_split_bayer_planes_8u: src is not 16-byte "
                    "aligned\n");
    return -1;
  }
  if (!(((uintptr_t)(sstride)&0x1f) == 0))
    width -= 8;
  mask = _mm_set1_epi16(0xff);
  for (i = 0; i < height; i++) {
    uint8_t *drow1 = dst[0] + i * dstride;
    uint8_t *drow2 = dst[1] + i * dstride;
    uint8_t *drow3 = dst[2] + i * dstride;
    uint8_t *drow4 = dst[3] + i * dstride;
    const uint8_t *srow = src + 2 * i * sstride;
    for (j = 0; j < width; j += 16) {
      __m128i s1, s2, t1, t2, out;
      s1 = _mm_load_si128((__m128i *)(srow + 2 * j));
      s2 = _mm_load_si128((__m128i *)(srow + 2 * j + 16));
      t1 = _mm_and_si128(s1, mask);
      t2 = _mm_and_si128(s2, mask);
      out = _mm_packus_epi16(t1, t2);
      _mm_store_si128((__m128i *)(drow1 + j), out);
      t1 = _mm_srli_epi16(s1, 8);
      t2 = _mm_srli_epi16(s2, 8);
      out = _mm_packus_epi16(t1, t2);
      _mm_store_si128((__m128i *)(drow2 + j), out);
      s1 = _mm_load_si128((__m128i *)(srow + sstride + 2 * j));
      s2 = _mm_load_si128((__m128i *)(srow + sstride + 2 * j + 16));
      t1 = _mm_and_si128(s1, mask);
      t2 = _mm_and_si128(s2, mask);
      out = _mm_packus_epi16(t1, t2);
      _mm_store_si128((__m128i *)(drow3 + j), out);
      t1 = _mm_srli_epi16(s1, 8);
      t2 = _mm_srli_epi16(s2, 8);
      out = _mm_packus_epi16(t1, t2);
      _mm_store_si128((__m128i *)(drow4 + j), out);
    }
  }
  if ((((uintptr_t)(sstride)&0x1f) == 0))
    return 0;
  const uint8_t *scol1 = src + 2 * width;
  const uint8_t *scol2 = src + 2 * width + sstride;
  uint8_t *dcol1 = dst[0] + width;
  uint8_t *dcol2 = dst[1] + width;
  uint8_t *dcol3 = dst[2] + width;
  uint8_t *dcol4 = dst[3] + width;
  __m128i t2 = _mm_set1_epi16(0);
  for (i = 0; i < height; i++) {
    __m128i s1, t1, out;
    s1 = _mm_load_si128((__m128i *)(scol1 + 2 * i * sstride));
    t1 = _mm_and_si128(s1, mask);
    out = _mm_packus_epi16(t1, t2);
    _mm_store_si128((__m128i *)(dcol1 + i * dstride), out);
    t1 = _mm_srli_epi16(s1, 8);
    out = _mm_packus_epi16(t1, t2);
    _mm_store_si128((__m128i *)(dcol2 + i * dstride), out);
    s1 = _mm_load_si128((__m128i *)(scol2 + 2 * i * sstride));
    t1 = _mm_and_si128(s1, mask);
    out = _mm_packus_epi16(t1, t2);
    _mm_store_si128((__m128i *)(dcol3 + i * dstride), out);
    t1 = _mm_srli_epi16(s1, 8);
    out = _mm_packus_epi16(t1, t2);
    _mm_store_si128((__m128i *)(dcol4 + i * dstride), out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<pixel_split_bayer_planes_8u>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    1207 <pixel_split_bayer_planes_8u+0x97>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
and    $0xf,%rax
cmp    $0x0,%rax
jne    11ce <pixel_split_bayer_planes_8u+0x5e>
movslq -0x14(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
je     11f4 <pixel_split_bayer_planes_8u+0x84>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
mov    -0x34(%rbp),%edx
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1759 <pixel_split_bayer_planes_8u+0x5e9>
jmp    11f9 <pixel_split_bayer_planes_8u+0x89>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1198 <pixel_split_bayer_planes_8u+0x28>
mov    -0x20(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
jne    122b <pixel_split_bayer_planes_8u+0xbb>
movslq -0x24(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
je     124e <pixel_split_bayer_planes_8u+0xde>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
lea    0xe02(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1759 <pixel_split_bayer_planes_8u+0x5e9>
movslq -0x24(%rbp),%rax
and    $0x1f,%rax
cmp    $0x0,%rax
je     1269 <pixel_split_bayer_planes_8u+0xf9>
mov    -0x28(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x28(%rbp)
mov    $0xff,%edi
call   1060 <_mm_set1_epi16@plt>
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    14e2 <pixel_split_bayer_planes_8u+0x372>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x34(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x34(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x34(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x34(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    14cf <pixel_split_bayer_planes_8u+0x35f>
mov    -0x60(%rbp),%rdi
mov    -0x38(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x38(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
add    $0x40,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,-0x70(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x70(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x40(%rbp),%rdi
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x74(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0x64(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,-0x70(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x70(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x48(%rbp),%rdi
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x74(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0x60(%rbp),%rdi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x38(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%rdi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x38(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
add    $0x40,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,-0x70(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x70(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x50(%rbp),%rdi
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x74(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0x64(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,-0x70(%rbp)
mov    -0x6c(%rbp),%edi
mov    -0x70(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0x74(%rbp)
mov    -0x58(%rbp),%rdi
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x74(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0x38(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x38(%rbp)
jmp    131f <pixel_split_bayer_planes_8u+0x1af>
jmp    14d4 <pixel_split_bayer_planes_8u+0x364>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    127d <pixel_split_bayer_planes_8u+0x10d>
movslq -0x24(%rbp),%rax
and    $0x1f,%rax
cmp    $0x0,%rax
jne    1500 <pixel_split_bayer_planes_8u+0x390>
movl   $0x0,-0x4(%rbp)
jmp    1759 <pixel_split_bayer_planes_8u+0x5e9>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x28(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x28(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0x28(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
xor    %edi,%edi
call   1060 <_mm_set1_epi16@plt>
mov    %eax,-0xac(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1752 <pixel_split_bayer_planes_8u+0x5e2>
mov    -0x80(%rbp),%rdi
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,-0xb0(%rbp)
mov    -0xb0(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%edi
mov    -0xac(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0xb8(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0x34(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xb8(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0xb0(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%edi
mov    -0xac(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0xb8(%rbp)
mov    -0x98(%rbp),%rdi
mov    -0x34(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xb8(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0x88(%rbp),%rdi
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,-0xb0(%rbp)
mov    -0xb0(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%edi
mov    -0xac(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0xb8(%rbp)
mov    -0xa0(%rbp),%rdi
mov    -0x34(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xb8(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0xb0(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%edi
mov    -0xac(%rbp),%esi
call   1040 <_mm_packus_epi16@plt>
mov    %eax,-0xb8(%rbp)
mov    -0xa8(%rbp),%rdi
mov    -0x34(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xb8(%rbp),%esi
call   1070 <_mm_store_si128@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    15b9 <pixel_split_bayer_planes_8u+0x449>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_split_bayer_planes_8u>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdx,%rbp
mov    %esi,%ebx
xor    %edx,%edx
test   $0xf,%bl
jne    11b9 <pixel_split_bayer_planes_8u+0x49>
mov    (%rdi),%rax
and    $0xf,%eax
test   %rax,%rax
jne    11b9 <pixel_split_bayer_planes_8u+0x49>
mov    $0x1,%edx
testb  $0xf,0x8(%rdi)
jne    11b9 <pixel_split_bayer_planes_8u+0x49>
mov    $0x2,%edx
testb  $0xf,0x10(%rdi)
jne    11b9 <pixel_split_bayer_planes_8u+0x49>
mov    $0x3,%edx
testb  $0xf,0x18(%rdi)
je     11e9 <pixel_split_bayer_planes_8u+0x79>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
lea    0xe37(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   $0xf,%bpl
jne    11f6 <pixel_split_bayer_planes_8u+0x86>
movslq %ecx,%rax
test   $0xf,%al
je     120f <pixel_split_bayer_planes_8u+0x9f>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
lea    0xe37(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    11d0 <pixel_split_bayer_planes_8u+0x60>
mov    %r9d,%r14d
mov    %rdi,0x68(%rsp)
mov    %rbp,0x60(%rsp)
lea    -0x8(%r8),%r13d
mov    %rax,0x28(%rsp)
test   $0x1f,%al
cmove  %r8d,%r13d
mov    $0xff,%edi
call   1060 <_mm_set1_epi16@plt>
mov    %eax,0xc(%rsp)
movslq %ebx,%rbx
mov    %r14d,%ecx
mov    %r14d,0x54(%rsp)
test   %r14d,%r14d
mov    %rcx,0x30(%rsp)
jle    1460 <pixel_split_bayer_planes_8u+0x2f0>
mov    0x28(%rsp),%rax
lea    (%rax,%rax,1),%edx
mov    %edx,0x58(%rsp)
lea    0x0(,%rax,4),%rax
mov    %rax,0x80(%rsp)
xor    %eax,%eax
mov    %rax,0x70(%rsp)
movl   $0x0,0x10(%rsp)
xor    %edx,%edx
mov    %rbx,0x38(%rsp)
mov    %r13d,0x5c(%rsp)
jmp    12b8 <pixel_split_bayer_planes_8u+0x148>
mov    0x78(%rsp),%rdx
add    $0x1,%rdx
mov    0x10(%rsp),%eax
add    0x58(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x38(%rsp),%rbx
add    %rbx,0x70(%rsp)
mov    0x30(%rsp),%rcx
cmp    %rcx,%rdx
je     1460 <pixel_split_bayer_planes_8u+0x2f0>
mov    %rdx,0x78(%rsp)
test   %r13d,%r13d
jle    128b <pixel_split_bayer_planes_8u+0x11b>
movslq 0x10(%rsp),%rax
mov    0x60(%rsp),%rcx
lea    (%rcx,%rax,4),%r12
mov    0x68(%rsp),%rsi
mov    (%rsi),%rax
mov    0x8(%rsi),%rcx
mov    0x10(%rsi),%rdx
mov    0x18(%rsi),%rsi
mov    0x70(%rsp),%rdi
lea    (%rsi,%rdi,4),%rbx
lea    (%rdx,%rdi,4),%rdx
mov    %rdx,0x20(%rsp)
lea    (%rcx,%rdi,4),%rbp
lea    (%rax,%rdi,4),%rax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,0x14(%rsp)
mov    %rbp,0x40(%rsp)
mov    %rbx,0x48(%rsp)
mov    %r12,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%r13d
lea    0x40(%r12),%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%r14d
mov    %r13d,%edi
mov    0xc(%rsp),%ebx
mov    %ebx,%esi
call   1090 <_mm_and_si128@plt>
mov    %ebx,%esi
mov    %eax,%r15d
mov    %r14d,%edi
call   1090 <_mm_and_si128@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   1040 <_mm_packus_epi16@plt>
mov    0x18(%rsp),%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    %r13d,%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <_mm_packus_epi16@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    0x80(%rsp),%rbx
lea    (%r12,%rbx,1),%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%r14d
lea    (%r12,%rbx,1),%rdi
add    $0x40,%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%r13d
mov    %r14d,%edi
mov    0xc(%rsp),%ebp
mov    %ebp,%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,%ebx
mov    %r13d,%edi
mov    %ebp,%esi
call   1090 <_mm_and_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <_mm_packus_epi16@plt>
mov    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    %r14d,%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,%ebx
mov    %r13d,%edi
mov    0x5c(%rsp),%r13d
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %ebx,%edi
mov    0x48(%rsp),%rbx
mov    %eax,%esi
call   1040 <_mm_packus_epi16@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    0x14(%rsp),%eax
sub    $0xffffffffffffff80,%r12
add    $0x40,%rbx
add    $0x40,%rbp
mov    %rbp,0x20(%rsp)
mov    0x40(%rsp),%rbp
add    $0x40,%rbp
add    $0x40,%r15
mov    %r15,0x18(%rsp)
add    $0x10,%eax
cmp    %eax,%r13d
jg     1310 <pixel_split_bayer_planes_8u+0x1a0>
jmp    128b <pixel_split_bayer_planes_8u+0x11b>
mov    0x28(%rsp),%r14
test   $0x1f,%r14b
je     15de <pixel_split_bayer_planes_8u+0x46e>
movslq %r13d,%r12
shl    $0x2,%r12
mov    0x68(%rsp),%rax
mov    (%rax),%rcx
add    %r12,%rcx
mov    %rcx,0x20(%rsp)
mov    0x8(%rax),%rcx
add    %r12,%rcx
mov    %rcx,0x18(%rsp)
mov    %r13d,%r15d
mov    0x10(%rax),%r13
add    %r12,%r13
add    0x18(%rax),%r12
xor    %ebp,%ebp
xor    %edi,%edi
call   1060 <_mm_set1_epi16@plt>
cmpl   $0x0,0x54(%rsp)
jle    11d5 <pixel_split_bayer_planes_8u+0x65>
add    %r15d,%r15d
movslq %r15d,%rdx
mov    0x60(%rsp),%rcx
lea    (%rcx,%rdx,4),%rcx
mov    %rcx,0x48(%rsp)
lea    (%rcx,%r14,4),%rcx
mov    %rcx,0x40(%rsp)
add    %r14d,%r14d
mov    %r14,0x28(%rsp)
shl    $0x2,%rbx
mov    %rbx,0x38(%rsp)
xor    %ebp,%ebp
xor    %r14d,%r14d
mov    0x30(%rsp),%rcx
mov    %r12,%rbx
mov    %r13,%r15
mov    0x18(%rsp),%r13
mov    %eax,0x14(%rsp)
mov    0x14(%rsp),%r12d
mov    %rbx,0x18(%rsp)
mov    %rcx,0x30(%rsp)
movslq %r14d,%r14
mov    0x48(%rsp),%rax
lea    (%rax,%r14,4),%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    0xc(%rsp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,%edi
mov    %r12d,%esi
call   1040 <_mm_packus_epi16@plt>
mov    0x20(%rsp),%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,%edi
mov    %r12d,%esi
call   1040 <_mm_packus_epi16@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    0x40(%rsp),%rax
lea    (%rax,%r14,4),%rdi
call   1030 <_mm_load_si128@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    0xc(%rsp),%esi
call   1090 <_mm_and_si128@plt>
mov    %eax,%edi
mov    %r12d,%esi
call   1040 <_mm_packus_epi16@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    %ebx,%edi
mov    0x18(%rsp),%rbx
mov    $0x8,%esi
call   1050 <_mm_srli_epi16@plt>
mov    %eax,%edi
mov    %r12d,%esi
call   1040 <_mm_packus_epi16@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1070 <_mm_store_si128@plt>
mov    0x30(%rsp),%rcx
mov    0x38(%rsp),%rax
add    %rax,0x20(%rsp)
add    %rax,%r13
add    %rax,%r15
add    %rax,%rbx
add    0x28(%rsp),%r14d
add    $0xffffffffffffffff,%rcx
jne    1500 <pixel_split_bayer_planes_8u+0x390>
jmp    11d5 <pixel_split_bayer_planes_8u+0x65>
xor    %ebp,%ebp
jmp    11d5 <pixel_split_bayer_planes_8u+0x65>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"pixel_split_bayer_planes_8u: dst[%d] is not 16-byte aligned\0A\00"
@.str.1 = [57 x i8] c"pixel_split_bayer_planes_8u: src is not 16-byte aligned\0A\00"
define i32 @pixel_split_bayer_planes_8u(i32** nocapture %0, i32 %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = and i32 %1, 15
%8 = icmp eq i32 %7, 0
%9 = load i32*, i32** %0
%10 = ptrtoint i32* %9 to i64
%11 = and i64 %10, 15
%12 = icmp eq i64 %11, 0
%13 = and i1 %8, %12
br i1 %13, label %18, label %14
14: ; preds = %30, %24, %18, %6
%15 = phi i32 [ 0, %6 ], [ 1, %18 ], [ 2, %24 ], [ 3, %30 ]
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %161
18: ; preds = %6
%19 = getelementptr inbounds i32*, i32** %0, i64 1
%20 = load i32*, i32** %19
%21 = ptrtoint i32* %20 to i64
%22 = and i64 %21, 15
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %14
24: ; preds = %18
%25 = getelementptr inbounds i32*, i32** %0, i64 2
%26 = load i32*, i32** %25
%27 = ptrtoint i32* %26 to i64
%28 = and i64 %27, 15
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %14
30: ; preds = %24
%31 = getelementptr inbounds i32*, i32** %0, i64 3
%32 = load i32*, i32** %31
%33 = ptrtoint i32* %32 to i64
%34 = and i64 %33, 15
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %14
36: ; preds = %30
%37 = ptrtoint i32* %2 to i64
%38 = and i64 %37, 15
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %36
%41 = sext i32 %3 to i64
%42 = and i64 %41, 15
%43 = icmp eq i64 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %40, %36
%45 = load i32, i32* @stderr
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
br label %161
47: ; preds = %40
%48 = and i64 %41, 31
%49 = icmp eq i64 %48, 0
%50 = add nsw i32 %4, -8
%51 = select i1 %49, i32 %4, i32 %50
%52 = tail call i32 @_mm_set1_epi16(i32 255)
%53 = icmp sgt i32 %5, 0
br i1 %53, label %54, label %113
54: ; preds = %47
%55 = shl i32 %3, 1
%56 = icmp sgt i32 %51, 0
%57 = sext i32 %1 to i64
%58 = zext i32 %5 to i64
br label %59
59: ; preds = %54, %110
%60 = phi i64 [ 0, %54 ], [ %111, %110 ]
%61 = load i32*, i32** %0
%62 = mul nsw i64 %60, %57
%63 = getelementptr inbounds i32, i32* %61, i64 %62
%64 = load i32*, i32** %19
%65 = getelementptr inbounds i32, i32* %64, i64 %62
%66 = load i32*, i32** %25
%67 = getelementptr inbounds i32, i32* %66, i64 %62
%68 = load i32*, i32** %31
%69 = getelementptr inbounds i32, i32* %68, i64 %62
%70 = trunc i64 %60 to i32
%71 = mul i32 %55, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %2, i64 %72
br i1 %56, label %74, label %110
74: ; preds = %59
%75 = getelementptr inbounds i32, i32* %73, i64 %41
br label %76
76: ; preds = %74, %76
%77 = phi i64 [ 0, %74 ], [ %107, %76 ]
%78 = shl nuw nsw i64 %77, 1
%79 = getelementptr inbounds i32, i32* %73, i64 %78
%80 = tail call i32 @_mm_load_si128(i32* %79)
%81 = getelementptr inbounds i32, i32* %79, i64 16
%82 = tail call i32 @_mm_load_si128(i32* %81)
%83 = tail call i32 @_mm_and_si128(i32 %80, i32 %52)
%84 = tail call i32 @_mm_and_si128(i32 %82, i32 %52)
%85 = tail call i32 @_mm_packus_epi16(i32 %83, i32 %84)
%86 = getelementptr inbounds i32, i32* %63, i64 %77
%87 = tail call i32 @_mm_store_si128(i32* %86, i32 %85)
%88 = tail call i32 @_mm_srli_epi16(i32 %80, i32 8)
%89 = tail call i32 @_mm_srli_epi16(i32 %82, i32 8)
%90 = tail call i32 @_mm_packus_epi16(i32 %88, i32 %89)
%91 = getelementptr inbounds i32, i32* %65, i64 %77
%92 = tail call i32 @_mm_store_si128(i32* %91, i32 %90)
%93 = getelementptr inbounds i32, i32* %75, i64 %78
%94 = tail call i32 @_mm_load_si128(i32* %93)
%95 = getelementptr inbounds i32, i32* %93, i64 16
%96 = tail call i32 @_mm_load_si128(i32* %95)
%97 = tail call i32 @_mm_and_si128(i32 %94, i32 %52)
%98 = tail call i32 @_mm_and_si128(i32 %96, i32 %52)
%99 = tail call i32 @_mm_packus_epi16(i32 %97, i32 %98)
%100 = getelementptr inbounds i32, i32* %67, i64 %77
%101 = tail call i32 @_mm_store_si128(i32* %100, i32 %99)
%102 = tail call i32 @_mm_srli_epi16(i32 %94, i32 8)
%103 = tail call i32 @_mm_srli_epi16(i32 %96, i32 8)
%104 = tail call i32 @_mm_packus_epi16(i32 %102, i32 %103)
%105 = getelementptr inbounds i32, i32* %69, i64 %77
%106 = tail call i32 @_mm_store_si128(i32* %105, i32 %104)
%107 = add nuw i64 %77, 16
%108 = trunc i64 %107 to i32
%109 = icmp sgt i32 %51, %108
br i1 %109, label %76, label %110
110: ; preds = %76, %59
%111 = add nuw nsw i64 %60, 1
%112 = icmp eq i64 %111, %58
br i1 %112, label %113, label %59
113: ; preds = %110, %47
br i1 %49, label %161, label %114
114: ; preds = %113
%115 = shl nsw i32 %51, 1
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i32, i32* %2, i64 %116
%118 = getelementptr inbounds i32, i32* %117, i64 %41
%119 = load i32*, i32** %0
%120 = sext i32 %51 to i64
%121 = getelementptr inbounds i32, i32* %119, i64 %120
%122 = load i32*, i32** %19
%123 = getelementptr inbounds i32, i32* %122, i64 %120
%124 = load i32*, i32** %25
%125 = getelementptr inbounds i32, i32* %124, i64 %120
%126 = load i32*, i32** %31
%127 = getelementptr inbounds i32, i32* %126, i64 %120
%128 = tail call i32 @_mm_set1_epi16(i32 0)
br i1 %53, label %129, label %161
129: ; preds = %114
%130 = shl i32 %3, 1
%131 = sext i32 %1 to i64
%132 = zext i32 %5 to i64
br label %133
133: ; preds = %129, %133
%134 = phi i64 [ 0, %129 ], [ %159, %133 ]
%135 = trunc i64 %134 to i32
%136 = mul i32 %130, %135
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32, i32* %117, i64 %137
%139 = tail call i32 @_mm_load_si128(i32* %138)
%140 = tail call i32 @_mm_and_si128(i32 %139, i32 %52)
%141 = tail call i32 @_mm_packus_epi16(i32 %140, i32 %128)
%142 = mul nsw i64 %134, %131
%143 = getelementptr inbounds i32, i32* %121, i64 %142
%144 = tail call i32 @_mm_store_si128(i32* %143, i32 %141)
%145 = tail call i32 @_mm_srli_epi16(i32 %139, i32 8)
%146 = tail call i32 @_mm_packus_epi16(i32 %145, i32 %128)
%147 = getelementptr inbounds i32, i32* %123, i64 %142
%148 = tail call i32 @_mm_store_si128(i32* %147, i32 %146)
%149 = getelementptr inbounds i32, i32* %118, i64 %137
%150 = tail call i32 @_mm_load_si128(i32* %149)
%151 = tail call i32 @_mm_and_si128(i32 %150, i32 %52)
%152 = tail call i32 @_mm_packus_epi16(i32 %151, i32 %128)
%153 = getelementptr inbounds i32, i32* %125, i64 %142
%154 = tail call i32 @_mm_store_si128(i32* %153, i32 %152)
%155 = tail call i32 @_mm_srli_epi16(i32 %150, i32 8)
%156 = tail call i32 @_mm_packus_epi16(i32 %155, i32 %128)
%157 = getelementptr inbounds i32, i32* %127, i64 %142
%158 = tail call i32 @_mm_store_si128(i32* %157, i32 %156)
%159 = add nuw nsw i64 %134, 1
%160 = icmp eq i64 %159, %132
br i1 %160, label %161, label %133
161: ; preds = %133, %114, %113, %44, %14
%162 = phi i32 [ -1, %14 ], [ -1, %44 ], [ 0, %113 ], [ 0, %114 ], [ 0, %133 ]
ret i32 %162
}