#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 */
typedef struct TYPE_8__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  int member_0;
  int member_1;
};
typedef TYPE_1__ __m128i;

/* Variables and functions */
TYPE_1__ _mm_shufflehi_epi16(TYPE_1__, int);
TYPE_1__ _mm_shufflelo_epi16(TYPE_1__, int);
extern void nnb_422_downsample_r_g_b_vectors_sse2(
    __m128i *in_3_v16i_r_g_b_vectors,
    __m128i *out_3_v16i_nnb_422_r_g_b_vectors) {
  __m128i scratch1 = {0x0LL, 0x0LL};
  (scratch1) = _mm_shufflehi_epi16(in_3_v16i_r_g_b_vectors[0], 0xA0);
  out_3_v16i_nnb_422_r_g_b_vectors[0] = _mm_shufflelo_epi16((scratch1), 0xA0);
  (scratch1) = _mm_shufflehi_epi16(in_3_v16i_r_g_b_vectors[1], 0xA0);
  out_3_v16i_nnb_422_r_g_b_vectors[1] = _mm_shufflelo_epi16((scratch1), 0xA0);
  (scratch1) = _mm_shufflehi_epi16(in_3_v16i_r_g_b_vectors[2], 0xA0);
  out_3_v16i_nnb_422_r_g_b_vectors[2] = _mm_shufflelo_epi16((scratch1), 0xA0);
}


x86 assembly (clang, -O0):
<nnb_422_downsample_r_g_b_vectors_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0xa0,%esi
call   1050 <_mm_shufflehi_epi16@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflelo_epi16@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0xa0,%esi
call   1050 <_mm_shufflehi_epi16@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflelo_epi16@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
mov    %rcx,-0x38(%rbp)
mov    -0x38(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0xa0,%esi
call   1050 <_mm_shufflehi_epi16@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflelo_epi16@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
mov    %rcx,-0x48(%rbp)
mov    -0x48(%rbp),%rcx
mov    %rcx,0x10(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nnb_422_downsample_r_g_b_vectors_sse2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflehi_epi16@plt>
mov    %rax,%rdi
mov    $0xa0,%esi
call   1030 <_mm_shufflelo_epi16@plt>
mov    %rax,(%r14)
mov    0x8(%rbx),%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflehi_epi16@plt>
mov    %rax,%rdi
mov    $0xa0,%esi
call   1030 <_mm_shufflelo_epi16@plt>
mov    %rax,0x8(%r14)
mov    0x10(%rbx),%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflehi_epi16@plt>
mov    %rax,%rdi
mov    $0xa0,%esi
call   1030 <_mm_shufflelo_epi16@plt>
mov    %rax,0x10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_8__ = type { i32, i32 }
define void @nnb_422_downsample_r_g_b_vectors_sse2(%struct.TYPE_8__* %0, %struct.TYPE_8__* %1) {
%3 = alloca %struct.TYPE_8__*
%4 = alloca %struct.TYPE_8__*
%5 = alloca %struct.TYPE_8__
%6 = alloca %struct.TYPE_8__
%7 = alloca %struct.TYPE_8__
%8 = alloca %struct.TYPE_8__
%9 = alloca %struct.TYPE_8__
%10 = alloca %struct.TYPE_8__
%11 = alloca %struct.TYPE_8__
store %struct.TYPE_8__* %0, %struct.TYPE_8__** %3
store %struct.TYPE_8__* %1, %struct.TYPE_8__** %4
%12 = bitcast %struct.TYPE_8__* %5 to i8*
%13 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%14 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %13, i64 0
%15 = bitcast %struct.TYPE_8__* %14 to i64*
%16 = load i64, i64* %15
%17 = call i64 @_mm_shufflehi_epi16(i64 %16, i32 160)
%18 = bitcast %struct.TYPE_8__* %6 to i64*
store i64 %17, i64* %18
%19 = bitcast %struct.TYPE_8__* %5 to i8*
%20 = bitcast %struct.TYPE_8__* %6 to i8*
%21 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%22 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %21, i64 0
%23 = bitcast %struct.TYPE_8__* %5 to i64*
%24 = load i64, i64* %23
%25 = call i64 @_mm_shufflelo_epi16(i64 %24, i32 160)
%26 = bitcast %struct.TYPE_8__* %7 to i64*
store i64 %25, i64* %26
%27 = bitcast %struct.TYPE_8__* %22 to i8*
%28 = bitcast %struct.TYPE_8__* %7 to i8*
%29 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%30 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %29, i64 1
%31 = bitcast %struct.TYPE_8__* %30 to i64*
%32 = load i64, i64* %31
%33 = call i64 @_mm_shufflehi_epi16(i64 %32, i32 160)
%34 = bitcast %struct.TYPE_8__* %8 to i64*
store i64 %33, i64* %34
%35 = bitcast %struct.TYPE_8__* %5 to i8*
%36 = bitcast %struct.TYPE_8__* %8 to i8*
%37 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%38 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %37, i64 1
%39 = bitcast %struct.TYPE_8__* %5 to i64*
%40 = load i64, i64* %39
%41 = call i64 @_mm_shufflelo_epi16(i64 %40, i32 160)
%42 = bitcast %struct.TYPE_8__* %9 to i64*
store i64 %41, i64* %42
%43 = bitcast %struct.TYPE_8__* %38 to i8*
%44 = bitcast %struct.TYPE_8__* %9 to i8*
%45 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%46 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %45, i64 2
%47 = bitcast %struct.TYPE_8__* %46 to i64*
%48 = load i64, i64* %47
%49 = call i64 @_mm_shufflehi_epi16(i64 %48, i32 160)
%50 = bitcast %struct.TYPE_8__* %10 to i64*
store i64 %49, i64* %50
%51 = bitcast %struct.TYPE_8__* %5 to i8*
%52 = bitcast %struct.TYPE_8__* %10 to i8*
%53 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%54 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %53, i64 2
%55 = bitcast %struct.TYPE_8__* %5 to i64*
%56 = load i64, i64* %55
%57 = call i64 @_mm_shufflelo_epi16(i64 %56, i32 160)
%58 = bitcast %struct.TYPE_8__* %11 to i64*
store i64 %57, i64* %58
%59 = bitcast %struct.TYPE_8__* %54 to i8*
%60 = bitcast %struct.TYPE_8__* %11 to i8*
ret void
}

LLVM IR (-O2):
%struct.TYPE_8__ = type { i32, i32 }
define void @nnb_422_downsample_r_g_b_vectors_sse2(%struct.TYPE_8__* nocapture %0, %struct.TYPE_8__* nocapture writeonly %1) {
%3 = bitcast %struct.TYPE_8__* %0 to i64*
%4 = load i64, i64* %3
%5 = tail call i64 @_mm_shufflehi_epi16(i64 %4, i32 160)
%6 = tail call i64 @_mm_shufflelo_epi16(i64 %5, i32 160)
%7 = bitcast %struct.TYPE_8__* %1 to i64*
store i64 %6, i64* %7
%8 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 1
%9 = bitcast %struct.TYPE_8__* %8 to i64*
%10 = load i64, i64* %9
%11 = tail call i64 @_mm_shufflehi_epi16(i64 %10, i32 160)
%12 = tail call i64 @_mm_shufflelo_epi16(i64 %11, i32 160)
%13 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %1, i64 1
%14 = bitcast %struct.TYPE_8__* %13 to i64*
store i64 %12, i64* %14
%15 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 2
%16 = bitcast %struct.TYPE_8__* %15 to i64*
%17 = load i64, i64* %16
%18 = tail call i64 @_mm_shufflehi_epi16(i64 %17, i32 160)
%19 = tail call i64 @_mm_shufflelo_epi16(i64 %18, i32 160)
%20 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %1, i64 2
%21 = bitcast %struct.TYPE_8__* %20 to i64*
store i64 %19, i64* %21
ret void
}