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

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

/* Variables and functions */
TYPE_1__ _mm_and_si128(TYPE_1__, TYPE_1__ const);
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);
extern void avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2(
    __m128i *in_3_v16i_current_r_g_b_vectors,
    __m128i *out_3_previous_r_g_b_vectors,
    __m128i *out_3_v16i_avg_422_r_g_b_vectors) {
  static const __m128i mask = {0x00000000000000FFLL, 0x0000000000000000LL};
  __m128i scratch1 = {0x0LL, 0x0LL};
  __m128i scratch2 = {0x0LL, 0x0LL};
  __m128i scratch3 = {0x0LL, 0x0LL};
  out_3_previous_r_g_b_vectors[0] =
      _mm_load_si128(&in_3_v16i_current_r_g_b_vectors[0]);
  out_3_previous_r_g_b_vectors[1] =
      _mm_load_si128(&in_3_v16i_current_r_g_b_vectors[1]);
  out_3_previous_r_g_b_vectors[2] =
      _mm_load_si128(&in_3_v16i_current_r_g_b_vectors[2]);
  (scratch1) = _mm_and_si128(in_3_v16i_current_r_g_b_vectors[0], (mask));
  (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]);
  (scratch1) = _mm_shufflehi_epi16((scratch1), 0xA0);
  out_3_v16i_avg_422_r_g_b_vectors[0] = _mm_shufflelo_epi16((scratch1), 0xA0);
  (scratch1) = _mm_and_si128(in_3_v16i_current_r_g_b_vectors[1], (mask));
  (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]);
  (scratch1) = _mm_shufflehi_epi16((scratch1), 0xA0);
  out_3_v16i_avg_422_r_g_b_vectors[1] = _mm_shufflelo_epi16((scratch1), 0xA0);
  (scratch1) = _mm_and_si128(in_3_v16i_current_r_g_b_vectors[2], (mask));
  (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]);
  (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_first_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,-0x138(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0x138(%rbp),%rax
mov    %rcx,-0x38(%rbp)
mov    -0x38(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0x130(%rbp),%rax
mov    %rcx,-0x40(%rbp)
mov    -0x40(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0x128(%rbp),%rax
mov    %rcx,-0x48(%rbp)
mov    -0x48(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    0xd96(%rip),%rsi
call   1090 <_mm_and_si128@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x10,%esi
call   1080 <_mm_srli_epi32@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1060 <_mm_or_si128@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    (%rax),%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   10a0 <_mm_shufflehi_epi16@plt>
mov    %rax,-0x80(%rbp)
mov    -0x80(%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,-0x88(%rbp)
mov    -0x88(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0xca3(%rip),%rsi
call   1090 <_mm_and_si128@plt>
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x10,%esi
call   1080 <_mm_srli_epi32@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1060 <_mm_or_si128@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    0x8(%rax),%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   10a0 <_mm_shufflehi_epi16@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xa0,%esi
call   1050 <_mm_shufflelo_epi16@plt>
mov    %rax,%rcx
mov    -0x118(%rbp),%rax
mov    %rcx,-0xc8(%rbp)
mov    -0xc8(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0xb83(%rip),%rsi
call   1090 <_mm_and_si128@plt>
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x10,%esi
call   1080 <_mm_srli_epi32@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1060 <_mm_or_si128@plt>
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,-0xf0(%rbp)
mov    -0xf0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rdi
mov    0x10(%rax),%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0x20(%rbp)
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_first_r_g_b_vectors_n_save_previous_sse2>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <_mm_load_si128@plt>
mov    %rax,(%rbx)
lea    0x8(%r15),%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,0x8(%rbx)
lea    0x10(%r15),%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,0x10(%rbx)
mov    (%r15),%rdi
mov    $0xff,%esi
call   1080 <_mm_and_si128@plt>
mov    %rax,%r12
mov    (%r15),%rdi
mov    $0x10,%esi
call   1070 <_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   1050 <_mm_or_si128@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <_mm_avg_epu16@plt>
mov    (%r15),%rsi
mov    %rax,%rdi
call   1060 <_mm_avg_epu16@plt>
mov    %rax,%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    $0xff,%esi
call   1080 <_mm_and_si128@plt>
mov    %rax,%r12
mov    0x8(%r15),%rdi
mov    $0x10,%esi
call   1070 <_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   1050 <_mm_or_si128@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <_mm_avg_epu16@plt>
mov    0x8(%r15),%rsi
mov    %rax,%rdi
call   1060 <_mm_avg_epu16@plt>
mov    %rax,%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    $0xff,%esi
call   1080 <_mm_and_si128@plt>
mov    %rax,%r12
mov    0x10(%r15),%rdi
mov    $0x10,%esi
call   1070 <_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   1050 <_mm_or_si128@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <_mm_avg_epu16@plt>
mov    0x10(%r15),%rsi
mov    %rax,%rdi
call   1060 <_mm_avg_epu16@plt>
mov    %rax,%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    %r14
pop    %r15
ret

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

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