#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_23__ TYPE_1__;

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

/* Variables and functions */
TYPE_1__ _mm_avg_epu16(TYPE_1__, TYPE_1__);
TYPE_1__ _mm_load_si128(TYPE_1__ *);
TYPE_1__ _mm_or_si128(TYPE_1__, TYPE_1__);
TYPE_1__ _mm_shufflehi_epi16(TYPE_1__, int);
TYPE_1__ _mm_shufflelo_epi16(TYPE_1__, int);
TYPE_1__ _mm_slli_si128(TYPE_1__, int);
TYPE_1__ _mm_srli_epi32(TYPE_1__, int);
TYPE_1__ _mm_srli_si128(TYPE_1__, int);
extern void avg_422_downsample_r_g_b_vectors_n_save_previous_sse2(
    __m128i *in_3_v16i_current_r_g_b_vectors,
    __m128i *in_3_v16i_previous_r_g_b_vectors,
    __m128i *out_3_v16i_avg_422_r_g_b_vectors) {
  __m128i scratch1 = {0x0LL, 0x0LL};
  __m128i scratch2 = {0x0LL, 0x0LL};
  __m128i scratch3 = {0x0LL, 0x0LL};
  (scratch1) = _mm_srli_si128(in_3_v16i_previous_r_g_b_vectors[0], 14);
  (scratch2) = _mm_srli_epi32(in_3_v16i_current_r_g_b_vectors[0], 16);
  (scratch3) = _mm_slli_si128((scratch2), 4);
  (scratch1) = _mm_or_si128((scratch1), (scratch3));
  (scratch1) = _mm_avg_epu16((scratch1), (scratch2));
  (scratch1) = _mm_avg_epu16((scratch1), in_3_v16i_current_r_g_b_vectors[0]);
  in_3_v16i_previous_r_g_b_vectors[0] =
      _mm_load_si128(&in_3_v16i_current_r_g_b_vectors[0]);
  (scratch1) = _mm_shufflehi_epi16((scratch1), 0xA0);
  out_3_v16i_avg_422_r_g_b_vectors[0] = _mm_shufflelo_epi16((scratch1), 0xA0);
  (scratch1) = _mm_srli_si128(in_3_v16i_previous_r_g_b_vectors[1], 14);
  (scratch2) = _mm_srli_epi32(in_3_v16i_current_r_g_b_vectors[1], 16);
  (scratch3) = _mm_slli_si128((scratch2), 4);
  (scratch1) = _mm_or_si128((scratch1), (scratch3));
  (scratch1) = _mm_avg_epu16((scratch1), (scratch2));
  (scratch1) = _mm_avg_epu16((scratch1), in_3_v16i_current_r_g_b_vectors[1]);
  in_3_v16i_previous_r_g_b_vectors[1] =
      _mm_load_si128(&in_3_v16i_current_r_g_b_vectors[1]);
  (scratch1) = _mm_shufflehi_epi16((scratch1), 0xA0);
  out_3_v16i_avg_422_r_g_b_vectors[1] = _mm_shufflelo_epi16((scratch1), 0xA0);
  (scratch1) = _mm_srli_si128(in_3_v16i_previous_r_g_b_vectors[2], 14);
  (scratch2) = _mm_srli_epi32(in_3_v16i_current_r_g_b_vectors[2], 16);
  (scratch3) = _mm_slli_si128((scratch2), 4);
  (scratch1) = _mm_or_si128((scratch1), (scratch3));
  (scratch1) = _mm_avg_epu16((scratch1), (scratch2));
  (scratch1) = _mm_avg_epu16((scratch1), in_3_v16i_current_r_g_b_vectors[2]);
  in_3_v16i_previous_r_g_b_vectors[2] =
      _mm_load_si128(&in_3_v16i_current_r_g_b_vectors[2]);
  (scratch1) = _mm_shufflehi_epi16((scratch1), 0xA0);
  out_3_v16i_avg_422_r_g_b_vectors[2] = _mm_shufflelo_epi16((scratch1), 0xA0);
}


x86 assembly (clang, -O0):
<avg_422_downsample_r_g_b_vectors_n_save_previous_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0xe,%esi
call   1060 <_mm_srli_si128@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x10,%esi
call   1090 <_mm_srli_epi32@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1070 <_mm_or_si128@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    (%rax),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x138(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0x138(%rbp),%rax
mov    %rcx,-0x68(%rbp)
mov    -0x68(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   10a0 <_mm_shufflehi_epi16@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   1050 <_mm_shufflelo_epi16@plt>
mov    %rax,%rcx
mov    -0x130(%rbp),%rax
mov    %rcx,-0x78(%rbp)
mov    -0x78(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0xe,%esi
call   1060 <_mm_srli_si128@plt>
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x10,%esi
call   1090 <_mm_srli_epi32@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1070 <_mm_or_si128@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    0x8(%rax),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0x128(%rbp),%rax
mov    %rcx,-0xb0(%rbp)
mov    -0xb0(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   10a0 <_mm_shufflehi_epi16@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   1050 <_mm_shufflelo_epi16@plt>
mov    %rax,%rcx
mov    -0x120(%rbp),%rax
mov    %rcx,-0xc0(%rbp)
mov    -0xc0(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0xe,%esi
call   1060 <_mm_srli_si128@plt>
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x10,%esi
call   1090 <_mm_srli_epi32@plt>
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1070 <_mm_or_si128@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    0x10(%rax),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0xf0(%rbp)
mov    -0xf0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0x118(%rbp),%rax
mov    %rcx,-0xf8(%rbp)
mov    -0xf8(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   10a0 <_mm_shufflehi_epi16@plt>
mov    %rax,-0x100(%rbp)
mov    -0x100(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x110(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   1050 <_mm_shufflelo_epi16@plt>
mov    %rax,%rcx
mov    -0x110(%rbp),%rax
mov    %rcx,-0x108(%rbp)
mov    -0x108(%rbp),%rcx
mov    %rcx,0x10(%rax)
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg_422_downsample_r_g_b_vectors_n_save_previous_sse2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
mov    (%rsi),%rdi
mov    $0xe,%esi
call   1050 <_mm_srli_si128@plt>
mov    %rax,%r12
mov    0x0(%r13),%rdi
mov    $0x10,%esi
call   1080 <_mm_srli_epi32@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
call   10a0 <_mm_slli_si128@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1060 <_mm_or_si128@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1070 <_mm_avg_epu16@plt>
mov    0x0(%r13),%rsi
mov    %rax,%rdi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,(%r15)
mov    %rbx,%rdi
mov    $0xa0,%esi
call   1090 <_mm_shufflehi_epi16@plt>
mov    %rax,%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflelo_epi16@plt>
mov    %rax,(%r14)
mov    0x8(%r15),%rdi
mov    $0xe,%esi
call   1050 <_mm_srli_si128@plt>
mov    %rax,%rbx
lea    0x8(%r13),%r12
mov    0x8(%r13),%rdi
mov    $0x10,%esi
call   1080 <_mm_srli_epi32@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    $0x4,%esi
call   10a0 <_mm_slli_si128@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1060 <_mm_or_si128@plt>
mov    %rax,%rdi
mov    %rbp,%rsi
call   1070 <_mm_avg_epu16@plt>
mov    0x8(%r13),%rsi
mov    %rax,%rdi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,0x8(%r15)
mov    %rbx,%rdi
mov    $0xa0,%esi
call   1090 <_mm_shufflehi_epi16@plt>
mov    %rax,%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflelo_epi16@plt>
mov    %rax,0x8(%r14)
mov    0x10(%r15),%rdi
mov    $0xe,%esi
call   1050 <_mm_srli_si128@plt>
mov    %rax,%rbx
lea    0x10(%r13),%r12
mov    0x10(%r13),%rdi
mov    $0x10,%esi
call   1080 <_mm_srli_epi32@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    $0x4,%esi
call   10a0 <_mm_slli_si128@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1060 <_mm_or_si128@plt>
mov    %rax,%rdi
mov    %rbp,%rsi
call   1070 <_mm_avg_epu16@plt>
mov    0x10(%r13),%rsi
mov    %rax,%rdi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,0x10(%r15)
mov    %rbx,%rdi
mov    $0xa0,%esi
call   1090 <_mm_shufflehi_epi16@plt>
mov    %rax,%rdi
mov    $0xa0,%esi
call   1040 <_mm_shufflelo_epi16@plt>
mov    %rax,0x10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_23__ = type { i32, i32 }
define void @avg_422_downsample_r_g_b_vectors_n_save_previous_sse2(%struct.TYPE_23__* %0, %struct.TYPE_23__* %1, %struct.TYPE_23__* %2) {
%4 = alloca %struct.TYPE_23__*
%5 = alloca %struct.TYPE_23__*
%6 = alloca %struct.TYPE_23__*
%7 = alloca %struct.TYPE_23__
%8 = alloca %struct.TYPE_23__
%9 = alloca %struct.TYPE_23__
%10 = alloca %struct.TYPE_23__
%11 = alloca %struct.TYPE_23__
%12 = alloca %struct.TYPE_23__
%13 = alloca %struct.TYPE_23__
%14 = alloca %struct.TYPE_23__
%15 = alloca %struct.TYPE_23__
%16 = alloca %struct.TYPE_23__
%17 = alloca %struct.TYPE_23__
%18 = alloca %struct.TYPE_23__
%19 = alloca %struct.TYPE_23__
%20 = alloca %struct.TYPE_23__
%21 = alloca %struct.TYPE_23__
%22 = alloca %struct.TYPE_23__
%23 = alloca %struct.TYPE_23__
%24 = alloca %struct.TYPE_23__
%25 = alloca %struct.TYPE_23__
%26 = alloca %struct.TYPE_23__
%27 = alloca %struct.TYPE_23__
%28 = alloca %struct.TYPE_23__
%29 = alloca %struct.TYPE_23__
%30 = alloca %struct.TYPE_23__
%31 = alloca %struct.TYPE_23__
%32 = alloca %struct.TYPE_23__
%33 = alloca %struct.TYPE_23__
%34 = alloca %struct.TYPE_23__
%35 = alloca %struct.TYPE_23__
%36 = alloca %struct.TYPE_23__
store %struct.TYPE_23__* %0, %struct.TYPE_23__** %4
store %struct.TYPE_23__* %1, %struct.TYPE_23__** %5
store %struct.TYPE_23__* %2, %struct.TYPE_23__** %6
%37 = bitcast %struct.TYPE_23__* %7 to i8*
%38 = bitcast %struct.TYPE_23__* %8 to i8*
%39 = bitcast %struct.TYPE_23__* %9 to i8*
%40 = load %struct.TYPE_23__*, %struct.TYPE_23__** %5
%41 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %40, i64 0
%42 = bitcast %struct.TYPE_23__* %41 to i64*
%43 = load i64, i64* %42
%44 = call i64 @_mm_srli_si128(i64 %43, i32 14)
%45 = bitcast %struct.TYPE_23__* %10 to i64*
store i64 %44, i64* %45
%46 = bitcast %struct.TYPE_23__* %7 to i8*
%47 = bitcast %struct.TYPE_23__* %10 to i8*
%48 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%49 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %48, i64 0
%50 = bitcast %struct.TYPE_23__* %49 to i64*
%51 = load i64, i64* %50
%52 = call i64 @_mm_srli_epi32(i64 %51, i32 16)
%53 = bitcast %struct.TYPE_23__* %11 to i64*
store i64 %52, i64* %53
%54 = bitcast %struct.TYPE_23__* %8 to i8*
%55 = bitcast %struct.TYPE_23__* %11 to i8*
%56 = bitcast %struct.TYPE_23__* %8 to i64*
%57 = load i64, i64* %56
%58 = call i64 @_mm_slli_si128(i64 %57, i32 4)
%59 = bitcast %struct.TYPE_23__* %12 to i64*
store i64 %58, i64* %59
%60 = bitcast %struct.TYPE_23__* %9 to i8*
%61 = bitcast %struct.TYPE_23__* %12 to i8*
%62 = bitcast %struct.TYPE_23__* %7 to i64*
%63 = load i64, i64* %62
%64 = bitcast %struct.TYPE_23__* %9 to i64*
%65 = load i64, i64* %64
%66 = call i64 @_mm_or_si128(i64 %63, i64 %65)
%67 = bitcast %struct.TYPE_23__* %13 to i64*
store i64 %66, i64* %67
%68 = bitcast %struct.TYPE_23__* %7 to i8*
%69 = bitcast %struct.TYPE_23__* %13 to i8*
%70 = bitcast %struct.TYPE_23__* %7 to i64*
%71 = load i64, i64* %70
%72 = bitcast %struct.TYPE_23__* %8 to i64*
%73 = load i64, i64* %72
%74 = call i64 @_mm_avg_epu16(i64 %71, i64 %73)
%75 = bitcast %struct.TYPE_23__* %14 to i64*
store i64 %74, i64* %75
%76 = bitcast %struct.TYPE_23__* %7 to i8*
%77 = bitcast %struct.TYPE_23__* %14 to i8*
%78 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%79 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %78, i64 0
%80 = bitcast %struct.TYPE_23__* %7 to i64*
%81 = load i64, i64* %80
%82 = bitcast %struct.TYPE_23__* %79 to i64*
%83 = load i64, i64* %82
%84 = call i64 @_mm_avg_epu16(i64 %81, i64 %83)
%85 = bitcast %struct.TYPE_23__* %15 to i64*
store i64 %84, i64* %85
%86 = bitcast %struct.TYPE_23__* %7 to i8*
%87 = bitcast %struct.TYPE_23__* %15 to i8*
%88 = load %struct.TYPE_23__*, %struct.TYPE_23__** %5
%89 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %88, i64 0
%90 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%91 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %90, i64 0
%92 = call i64 @_mm_load_si128(%struct.TYPE_23__* %91)
%93 = bitcast %struct.TYPE_23__* %16 to i64*
store i64 %92, i64* %93
%94 = bitcast %struct.TYPE_23__* %89 to i8*
%95 = bitcast %struct.TYPE_23__* %16 to i8*
%96 = bitcast %struct.TYPE_23__* %7 to i64*
%97 = load i64, i64* %96
%98 = call i64 @_mm_shufflehi_epi16(i64 %97, i32 160)
%99 = bitcast %struct.TYPE_23__* %17 to i64*
store i64 %98, i64* %99
%100 = bitcast %struct.TYPE_23__* %7 to i8*
%101 = bitcast %struct.TYPE_23__* %17 to i8*
%102 = load %struct.TYPE_23__*, %struct.TYPE_23__** %6
%103 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %102, i64 0
%104 = bitcast %struct.TYPE_23__* %7 to i64*
%105 = load i64, i64* %104
%106 = call i64 @_mm_shufflelo_epi16(i64 %105, i32 160)
%107 = bitcast %struct.TYPE_23__* %18 to i64*
store i64 %106, i64* %107
%108 = bitcast %struct.TYPE_23__* %103 to i8*
%109 = bitcast %struct.TYPE_23__* %18 to i8*
%110 = load %struct.TYPE_23__*, %struct.TYPE_23__** %5
%111 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %110, i64 1
%112 = bitcast %struct.TYPE_23__* %111 to i64*
%113 = load i64, i64* %112
%114 = call i64 @_mm_srli_si128(i64 %113, i32 14)
%115 = bitcast %struct.TYPE_23__* %19 to i64*
store i64 %114, i64* %115
%116 = bitcast %struct.TYPE_23__* %7 to i8*
%117 = bitcast %struct.TYPE_23__* %19 to i8*
%118 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%119 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %118, i64 1
%120 = bitcast %struct.TYPE_23__* %119 to i64*
%121 = load i64, i64* %120
%122 = call i64 @_mm_srli_epi32(i64 %121, i32 16)
%123 = bitcast %struct.TYPE_23__* %20 to i64*
store i64 %122, i64* %123
%124 = bitcast %struct.TYPE_23__* %8 to i8*
%125 = bitcast %struct.TYPE_23__* %20 to i8*
%126 = bitcast %struct.TYPE_23__* %8 to i64*
%127 = load i64, i64* %126
%128 = call i64 @_mm_slli_si128(i64 %127, i32 4)
%129 = bitcast %struct.TYPE_23__* %21 to i64*
store i64 %128, i64* %129
%130 = bitcast %struct.TYPE_23__* %9 to i8*
%131 = bitcast %struct.TYPE_23__* %21 to i8*
%132 = bitcast %struct.TYPE_23__* %7 to i64*
%133 = load i64, i64* %132
%134 = bitcast %struct.TYPE_23__* %9 to i64*
%135 = load i64, i64* %134
%136 = call i64 @_mm_or_si128(i64 %133, i64 %135)
%137 = bitcast %struct.TYPE_23__* %22 to i64*
store i64 %136, i64* %137
%138 = bitcast %struct.TYPE_23__* %7 to i8*
%139 = bitcast %struct.TYPE_23__* %22 to i8*
%140 = bitcast %struct.TYPE_23__* %7 to i64*
%141 = load i64, i64* %140
%142 = bitcast %struct.TYPE_23__* %8 to i64*
%143 = load i64, i64* %142
%144 = call i64 @_mm_avg_epu16(i64 %141, i64 %143)
%145 = bitcast %struct.TYPE_23__* %23 to i64*
store i64 %144, i64* %145
%146 = bitcast %struct.TYPE_23__* %7 to i8*
%147 = bitcast %struct.TYPE_23__* %23 to i8*
%148 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%149 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %148, i64 1
%150 = bitcast %struct.TYPE_23__* %7 to i64*
%151 = load i64, i64* %150
%152 = bitcast %struct.TYPE_23__* %149 to i64*
%153 = load i64, i64* %152
%154 = call i64 @_mm_avg_epu16(i64 %151, i64 %153)
%155 = bitcast %struct.TYPE_23__* %24 to i64*
store i64 %154, i64* %155
%156 = bitcast %struct.TYPE_23__* %7 to i8*
%157 = bitcast %struct.TYPE_23__* %24 to i8*
%158 = load %struct.TYPE_23__*, %struct.TYPE_23__** %5
%159 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %158, i64 1
%160 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%161 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %160, i64 1
%162 = call i64 @_mm_load_si128(%struct.TYPE_23__* %161)
%163 = bitcast %struct.TYPE_23__* %25 to i64*
store i64 %162, i64* %163
%164 = bitcast %struct.TYPE_23__* %159 to i8*
%165 = bitcast %struct.TYPE_23__* %25 to i8*
%166 = bitcast %struct.TYPE_23__* %7 to i64*
%167 = load i64, i64* %166
%168 = call i64 @_mm_shufflehi_epi16(i64 %167, i32 160)
%169 = bitcast %struct.TYPE_23__* %26 to i64*
store i64 %168, i64* %169
%170 = bitcast %struct.TYPE_23__* %7 to i8*
%171 = bitcast %struct.TYPE_23__* %26 to i8*
%172 = load %struct.TYPE_23__*, %struct.TYPE_23__** %6
%173 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %172, i64 1
%174 = bitcast %struct.TYPE_23__* %7 to i64*
%175 = load i64, i64* %174
%176 = call i64 @_mm_shufflelo_epi16(i64 %175, i32 160)
%177 = bitcast %struct.TYPE_23__* %27 to i64*
store i64 %176, i64* %177
%178 = bitcast %struct.TYPE_23__* %173 to i8*
%179 = bitcast %struct.TYPE_23__* %27 to i8*
%180 = load %struct.TYPE_23__*, %struct.TYPE_23__** %5
%181 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %180, i64 2
%182 = bitcast %struct.TYPE_23__* %181 to i64*
%183 = load i64, i64* %182
%184 = call i64 @_mm_srli_si128(i64 %183, i32 14)
%185 = bitcast %struct.TYPE_23__* %28 to i64*
store i64 %184, i64* %185
%186 = bitcast %struct.TYPE_23__* %7 to i8*
%187 = bitcast %struct.TYPE_23__* %28 to i8*
%188 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%189 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %188, i64 2
%190 = bitcast %struct.TYPE_23__* %189 to i64*
%191 = load i64, i64* %190
%192 = call i64 @_mm_srli_epi32(i64 %191, i32 16)
%193 = bitcast %struct.TYPE_23__* %29 to i64*
store i64 %192, i64* %193
%194 = bitcast %struct.TYPE_23__* %8 to i8*
%195 = bitcast %struct.TYPE_23__* %29 to i8*
%196 = bitcast %struct.TYPE_23__* %8 to i64*
%197 = load i64, i64* %196
%198 = call i64 @_mm_slli_si128(i64 %197, i32 4)
%199 = bitcast %struct.TYPE_23__* %30 to i64*
store i64 %198, i64* %199
%200 = bitcast %struct.TYPE_23__* %9 to i8*
%201 = bitcast %struct.TYPE_23__* %30 to i8*
%202 = bitcast %struct.TYPE_23__* %7 to i64*
%203 = load i64, i64* %202
%204 = bitcast %struct.TYPE_23__* %9 to i64*
%205 = load i64, i64* %204
%206 = call i64 @_mm_or_si128(i64 %203, i64 %205)
%207 = bitcast %struct.TYPE_23__* %31 to i64*
store i64 %206, i64* %207
%208 = bitcast %struct.TYPE_23__* %7 to i8*
%209 = bitcast %struct.TYPE_23__* %31 to i8*
%210 = bitcast %struct.TYPE_23__* %7 to i64*
%211 = load i64, i64* %210
%212 = bitcast %struct.TYPE_23__* %8 to i64*
%213 = load i64, i64* %212
%214 = call i64 @_mm_avg_epu16(i64 %211, i64 %213)
%215 = bitcast %struct.TYPE_23__* %32 to i64*
store i64 %214, i64* %215
%216 = bitcast %struct.TYPE_23__* %7 to i8*
%217 = bitcast %struct.TYPE_23__* %32 to i8*
%218 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%219 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %218, i64 2
%220 = bitcast %struct.TYPE_23__* %7 to i64*
%221 = load i64, i64* %220
%222 = bitcast %struct.TYPE_23__* %219 to i64*
%223 = load i64, i64* %222
%224 = call i64 @_mm_avg_epu16(i64 %221, i64 %223)
%225 = bitcast %struct.TYPE_23__* %33 to i64*
store i64 %224, i64* %225
%226 = bitcast %struct.TYPE_23__* %7 to i8*
%227 = bitcast %struct.TYPE_23__* %33 to i8*
%228 = load %struct.TYPE_23__*, %struct.TYPE_23__** %5
%229 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %228, i64 2
%230 = load %struct.TYPE_23__*, %struct.TYPE_23__** %4
%231 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %230, i64 2
%232 = call i64 @_mm_load_si128(%struct.TYPE_23__* %231)
%233 = bitcast %struct.TYPE_23__* %34 to i64*
store i64 %232, i64* %233
%234 = bitcast %struct.TYPE_23__* %229 to i8*
%235 = bitcast %struct.TYPE_23__* %34 to i8*
%236 = bitcast %struct.TYPE_23__* %7 to i64*
%237 = load i64, i64* %236
%238 = call i64 @_mm_shufflehi_epi16(i64 %237, i32 160)
%239 = bitcast %struct.TYPE_23__* %35 to i64*
store i64 %238, i64* %239
%240 = bitcast %struct.TYPE_23__* %7 to i8*
%241 = bitcast %struct.TYPE_23__* %35 to i8*
%242 = load %struct.TYPE_23__*, %struct.TYPE_23__** %6
%243 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %242, i64 2
%244 = bitcast %struct.TYPE_23__* %7 to i64*
%245 = load i64, i64* %244
%246 = call i64 @_mm_shufflelo_epi16(i64 %245, i32 160)
%247 = bitcast %struct.TYPE_23__* %36 to i64*
store i64 %246, i64* %247
%248 = bitcast %struct.TYPE_23__* %243 to i8*
%249 = bitcast %struct.TYPE_23__* %36 to i8*
ret void
}

LLVM IR (-O2):
%struct.TYPE_23__ = type { i32, i32 }
define void @avg_422_downsample_r_g_b_vectors_n_save_previous_sse2(%struct.TYPE_23__* %0, %struct.TYPE_23__* nocapture %1, %struct.TYPE_23__* nocapture writeonly %2) {
%4 = bitcast %struct.TYPE_23__* %1 to i64*
%5 = load i64, i64* %4
%6 = tail call i64 @_mm_srli_si128(i64 %5, i32 14)
%7 = bitcast %struct.TYPE_23__* %0 to i64*
%8 = load i64, i64* %7
%9 = tail call i64 @_mm_srli_epi32(i64 %8, i32 16)
%10 = tail call i64 @_mm_slli_si128(i64 %9, i32 4)
%11 = tail call i64 @_mm_or_si128(i64 %6, i64 %10)
%12 = tail call i64 @_mm_avg_epu16(i64 %11, i64 %9)
%13 = load i64, i64* %7
%14 = tail call i64 @_mm_avg_epu16(i64 %12, i64 %13)
%15 = tail call i64 @_mm_load_si128(%struct.TYPE_23__* %0)
store i64 %15, i64* %4
%16 = tail call i64 @_mm_shufflehi_epi16(i64 %14, i32 160)
%17 = tail call i64 @_mm_shufflelo_epi16(i64 %16, i32 160)
%18 = bitcast %struct.TYPE_23__* %2 to i64*
store i64 %17, i64* %18
%19 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %1, i64 1
%20 = bitcast %struct.TYPE_23__* %19 to i64*
%21 = load i64, i64* %20
%22 = tail call i64 @_mm_srli_si128(i64 %21, i32 14)
%23 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %0, i64 1
%24 = bitcast %struct.TYPE_23__* %23 to i64*
%25 = load i64, i64* %24
%26 = tail call i64 @_mm_srli_epi32(i64 %25, i32 16)
%27 = tail call i64 @_mm_slli_si128(i64 %26, i32 4)
%28 = tail call i64 @_mm_or_si128(i64 %22, i64 %27)
%29 = tail call i64 @_mm_avg_epu16(i64 %28, i64 %26)
%30 = load i64, i64* %24
%31 = tail call i64 @_mm_avg_epu16(i64 %29, i64 %30)
%32 = tail call i64 @_mm_load_si128(%struct.TYPE_23__* %23)
store i64 %32, i64* %20
%33 = tail call i64 @_mm_shufflehi_epi16(i64 %31, i32 160)
%34 = tail call i64 @_mm_shufflelo_epi16(i64 %33, i32 160)
%35 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %2, i64 1
%36 = bitcast %struct.TYPE_23__* %35 to i64*
store i64 %34, i64* %36
%37 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %1, i64 2
%38 = bitcast %struct.TYPE_23__* %37 to i64*
%39 = load i64, i64* %38
%40 = tail call i64 @_mm_srli_si128(i64 %39, i32 14)
%41 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %0, i64 2
%42 = bitcast %struct.TYPE_23__* %41 to i64*
%43 = load i64, i64* %42
%44 = tail call i64 @_mm_srli_epi32(i64 %43, i32 16)
%45 = tail call i64 @_mm_slli_si128(i64 %44, i32 4)
%46 = tail call i64 @_mm_or_si128(i64 %40, i64 %45)
%47 = tail call i64 @_mm_avg_epu16(i64 %46, i64 %44)
%48 = load i64, i64* %42
%49 = tail call i64 @_mm_avg_epu16(i64 %47, i64 %48)
%50 = tail call i64 @_mm_load_si128(%struct.TYPE_23__* %41)
store i64 %50, i64* %38
%51 = tail call i64 @_mm_shufflehi_epi16(i64 %49, i32 160)
%52 = tail call i64 @_mm_shufflelo_epi16(i64 %51, i32 160)
%53 = getelementptr inbounds %struct.TYPE_23__, %struct.TYPE_23__* %2, i64 2
%54 = bitcast %struct.TYPE_23__* %53 to i64*
store i64 %52, i64* %54
ret void
}