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

/* Type definitions */
struct TYPE_26__ {
  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_shuffle_epi32(TYPE_1__, int);
TYPE_1__ _mm_slli_si128(TYPE_1__, int);
TYPE_1__ _mm_unpackhi_epi64(TYPE_1__, TYPE_1__);
TYPE_1__ _mm_unpacklo_epi64(TYPE_1__, TYPE_1__);
extern void avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2(
    __m128i *in_4_v16i_current_ag_rb_vectors, __m128i *previous,
    __m128i *out_2_v16i_avg_422_ag_rb_vectors) {
  static const __m128i keep_1st = {0x00000000FFFFFFFFLL, 0x0000000000000000LL};
  __m128i scratch1 = {0x0LL, 0x0LL};
  __m128i scratch2 = {0x0LL, 0x0LL};
  __m128i scratch3 = {0x0LL, 0x0LL};
  __m128i scratch4 = {0x0LL, 0x0LL};
  (scratch4) = _mm_shuffle_epi32(in_4_v16i_current_ag_rb_vectors[0], 0x8D);
  (scratch2) = _mm_shuffle_epi32(in_4_v16i_current_ag_rb_vectors[2], 0x8D);
  (scratch1) = _mm_unpacklo_epi64((scratch4), (scratch2));
  (scratch4) = _mm_unpackhi_epi64((scratch4), (scratch2));
  (scratch2) = _mm_and_si128(in_4_v16i_current_ag_rb_vectors[0], (keep_1st));
  (scratch3) = _mm_slli_si128((scratch1), 4);
  (scratch2) = _mm_or_si128((scratch2), (scratch3));
  (scratch2) = _mm_avg_epu16((scratch2), (scratch1));
  out_2_v16i_avg_422_ag_rb_vectors[0] = _mm_avg_epu16((scratch4), (scratch2));
  (scratch4) = _mm_shuffle_epi32(in_4_v16i_current_ag_rb_vectors[1], 0x8D);
  (scratch2) = _mm_shuffle_epi32(in_4_v16i_current_ag_rb_vectors[3], 0x8D);
  (scratch1) = _mm_unpacklo_epi64((scratch4), (scratch2));
  (scratch4) = _mm_unpackhi_epi64((scratch4), (scratch2));
  (scratch2) = _mm_and_si128(in_4_v16i_current_ag_rb_vectors[1], (keep_1st));
  (scratch3) = _mm_slli_si128((scratch1), 4);
  (scratch2) = _mm_or_si128((scratch2), (scratch3));
  (scratch2) = _mm_avg_epu16((scratch2), (scratch1));
  out_2_v16i_avg_422_ag_rb_vectors[1] = _mm_avg_epu16((scratch4), (scratch2));
  previous[0] = _mm_load_si128(&in_4_v16i_current_ag_rb_vectors[2]);
  previous[1] = _mm_load_si128(&in_4_v16i_current_ag_rb_vectors[3]);
}


x86 assembly (clang, -O0):
<avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%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>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <_mm_unpacklo_epi64@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <_mm_unpackhi_epi64@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    0xd9e(%rip),%rsi
call   1090 <_mm_and_si128@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1070 <_mm_or_si128@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,%rcx
mov    -0xf8(%rbp),%rax
mov    %rcx,-0x80(%rbp)
mov    -0x80(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <_mm_unpacklo_epi64@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <_mm_unpackhi_epi64@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0xc7f(%rip),%rsi
call   1090 <_mm_and_si128@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1070 <_mm_or_si128@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,%rcx
mov    -0xf0(%rbp),%rax
mov    %rcx,-0xc8(%rbp)
mov    -0xc8(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0xe8(%rbp),%rax
mov    %rcx,-0xd0(%rbp)
mov    -0xd0(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0xe0(%rbp),%rax
mov    %rcx,-0xd8(%rbp)
mov    -0xd8(%rbp),%rcx
mov    %rcx,0x8(%rax)
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r12
mov    %rsi,0x10(%rsp)
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x8d,%esi
call   1050 <_mm_shuffle_epi32@plt>
mov    %rax,%r13
lea    0x10(%rbx),%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rbx),%rdi
mov    $0x8d,%esi
call   1050 <_mm_shuffle_epi32@plt>
mov    %rax,%rbp
mov    %r13,%rdi
mov    %rax,%rsi
call   1090 <_mm_unpacklo_epi64@plt>
mov    %rax,%r15
mov    %r13,%rdi
mov    %rbp,%rsi
call   1040 <_mm_unpackhi_epi64@plt>
mov    %rax,%r13
mov    (%rbx),%rdi
mov    $0xffffffff,%esi
call   1080 <_mm_and_si128@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    $0x4,%esi
call   10a0 <_mm_slli_si128@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1060 <_mm_or_si128@plt>
mov    %rax,%rdi
mov    %r15,%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %r13,%rdi
mov    %rax,%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,(%r12)
mov    0x8(%rbx),%rdi
mov    $0x8d,%esi
call   1050 <_mm_shuffle_epi32@plt>
mov    %rax,%r15
lea    0x18(%rbx),%r13
mov    0x18(%rbx),%rdi
mov    $0x8d,%esi
call   1050 <_mm_shuffle_epi32@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %rax,%rsi
call   1090 <_mm_unpacklo_epi64@plt>
mov    %rax,%r14
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <_mm_unpackhi_epi64@plt>
mov    %rax,%rbp
mov    0x8(%rbx),%rdi
mov    $0xffffffff,%esi
call   1080 <_mm_and_si128@plt>
mov    %rax,%rbx
mov    %r14,%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    %r14,%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1070 <_mm_avg_epu16@plt>
mov    %rax,0x8(%r12)
mov    0x8(%rsp),%rdi
call   1030 <_mm_load_si128@plt>
mov    0x10(%rsp),%rbx
mov    %rax,(%rbx)
mov    %r13,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,0x8(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_26__ = type { i32, i32 }
@avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2.keep_1st = internal constant %struct.TYPE_26__ { i32 -1, i32 0 }
define void @avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2(%struct.TYPE_26__* %0, %struct.TYPE_26__* %1, %struct.TYPE_26__* %2) {
%4 = alloca %struct.TYPE_26__*
%5 = alloca %struct.TYPE_26__*
%6 = alloca %struct.TYPE_26__*
%7 = alloca %struct.TYPE_26__
%8 = alloca %struct.TYPE_26__
%9 = alloca %struct.TYPE_26__
%10 = alloca %struct.TYPE_26__
%11 = alloca %struct.TYPE_26__
%12 = alloca %struct.TYPE_26__
%13 = alloca %struct.TYPE_26__
%14 = alloca %struct.TYPE_26__
%15 = alloca %struct.TYPE_26__
%16 = alloca %struct.TYPE_26__
%17 = alloca %struct.TYPE_26__
%18 = alloca %struct.TYPE_26__
%19 = alloca %struct.TYPE_26__
%20 = alloca %struct.TYPE_26__
%21 = alloca %struct.TYPE_26__
%22 = alloca %struct.TYPE_26__
%23 = alloca %struct.TYPE_26__
%24 = alloca %struct.TYPE_26__
%25 = alloca %struct.TYPE_26__
%26 = alloca %struct.TYPE_26__
%27 = alloca %struct.TYPE_26__
%28 = alloca %struct.TYPE_26__
%29 = alloca %struct.TYPE_26__
%30 = alloca %struct.TYPE_26__
store %struct.TYPE_26__* %0, %struct.TYPE_26__** %4
store %struct.TYPE_26__* %1, %struct.TYPE_26__** %5
store %struct.TYPE_26__* %2, %struct.TYPE_26__** %6
%31 = bitcast %struct.TYPE_26__* %7 to i8*
%32 = bitcast %struct.TYPE_26__* %8 to i8*
%33 = bitcast %struct.TYPE_26__* %9 to i8*
%34 = bitcast %struct.TYPE_26__* %10 to i8*
%35 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%36 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %35, i64 0
%37 = bitcast %struct.TYPE_26__* %36 to i64*
%38 = load i64, i64* %37
%39 = call i64 @_mm_shuffle_epi32(i64 %38, i32 141)
%40 = bitcast %struct.TYPE_26__* %11 to i64*
store i64 %39, i64* %40
%41 = bitcast %struct.TYPE_26__* %10 to i8*
%42 = bitcast %struct.TYPE_26__* %11 to i8*
%43 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%44 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %43, i64 2
%45 = bitcast %struct.TYPE_26__* %44 to i64*
%46 = load i64, i64* %45
%47 = call i64 @_mm_shuffle_epi32(i64 %46, i32 141)
%48 = bitcast %struct.TYPE_26__* %12 to i64*
store i64 %47, i64* %48
%49 = bitcast %struct.TYPE_26__* %8 to i8*
%50 = bitcast %struct.TYPE_26__* %12 to i8*
%51 = bitcast %struct.TYPE_26__* %10 to i64*
%52 = load i64, i64* %51
%53 = bitcast %struct.TYPE_26__* %8 to i64*
%54 = load i64, i64* %53
%55 = call i64 @_mm_unpacklo_epi64(i64 %52, i64 %54)
%56 = bitcast %struct.TYPE_26__* %13 to i64*
store i64 %55, i64* %56
%57 = bitcast %struct.TYPE_26__* %7 to i8*
%58 = bitcast %struct.TYPE_26__* %13 to i8*
%59 = bitcast %struct.TYPE_26__* %10 to i64*
%60 = load i64, i64* %59
%61 = bitcast %struct.TYPE_26__* %8 to i64*
%62 = load i64, i64* %61
%63 = call i64 @_mm_unpackhi_epi64(i64 %60, i64 %62)
%64 = bitcast %struct.TYPE_26__* %14 to i64*
store i64 %63, i64* %64
%65 = bitcast %struct.TYPE_26__* %10 to i8*
%66 = bitcast %struct.TYPE_26__* %14 to i8*
%67 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%68 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %67, i64 0
%69 = bitcast %struct.TYPE_26__* %68 to i64*
%70 = load i64, i64* %69
%71 = load i64, i64* bitcast (%struct.TYPE_26__* @avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2.keep_1st to i64*)
%72 = call i64 @_mm_and_si128(i64 %70, i64 %71)
%73 = bitcast %struct.TYPE_26__* %15 to i64*
store i64 %72, i64* %73
%74 = bitcast %struct.TYPE_26__* %8 to i8*
%75 = bitcast %struct.TYPE_26__* %15 to i8*
%76 = bitcast %struct.TYPE_26__* %7 to i64*
%77 = load i64, i64* %76
%78 = call i64 @_mm_slli_si128(i64 %77, i32 4)
%79 = bitcast %struct.TYPE_26__* %16 to i64*
store i64 %78, i64* %79
%80 = bitcast %struct.TYPE_26__* %9 to i8*
%81 = bitcast %struct.TYPE_26__* %16 to i8*
%82 = bitcast %struct.TYPE_26__* %8 to i64*
%83 = load i64, i64* %82
%84 = bitcast %struct.TYPE_26__* %9 to i64*
%85 = load i64, i64* %84
%86 = call i64 @_mm_or_si128(i64 %83, i64 %85)
%87 = bitcast %struct.TYPE_26__* %17 to i64*
store i64 %86, i64* %87
%88 = bitcast %struct.TYPE_26__* %8 to i8*
%89 = bitcast %struct.TYPE_26__* %17 to i8*
%90 = bitcast %struct.TYPE_26__* %8 to i64*
%91 = load i64, i64* %90
%92 = bitcast %struct.TYPE_26__* %7 to i64*
%93 = load i64, i64* %92
%94 = call i64 @_mm_avg_epu16(i64 %91, i64 %93)
%95 = bitcast %struct.TYPE_26__* %18 to i64*
store i64 %94, i64* %95
%96 = bitcast %struct.TYPE_26__* %8 to i8*
%97 = bitcast %struct.TYPE_26__* %18 to i8*
%98 = load %struct.TYPE_26__*, %struct.TYPE_26__** %6
%99 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %98, i64 0
%100 = bitcast %struct.TYPE_26__* %10 to i64*
%101 = load i64, i64* %100
%102 = bitcast %struct.TYPE_26__* %8 to i64*
%103 = load i64, i64* %102
%104 = call i64 @_mm_avg_epu16(i64 %101, i64 %103)
%105 = bitcast %struct.TYPE_26__* %19 to i64*
store i64 %104, i64* %105
%106 = bitcast %struct.TYPE_26__* %99 to i8*
%107 = bitcast %struct.TYPE_26__* %19 to i8*
%108 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%109 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %108, i64 1
%110 = bitcast %struct.TYPE_26__* %109 to i64*
%111 = load i64, i64* %110
%112 = call i64 @_mm_shuffle_epi32(i64 %111, i32 141)
%113 = bitcast %struct.TYPE_26__* %20 to i64*
store i64 %112, i64* %113
%114 = bitcast %struct.TYPE_26__* %10 to i8*
%115 = bitcast %struct.TYPE_26__* %20 to i8*
%116 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%117 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %116, i64 3
%118 = bitcast %struct.TYPE_26__* %117 to i64*
%119 = load i64, i64* %118
%120 = call i64 @_mm_shuffle_epi32(i64 %119, i32 141)
%121 = bitcast %struct.TYPE_26__* %21 to i64*
store i64 %120, i64* %121
%122 = bitcast %struct.TYPE_26__* %8 to i8*
%123 = bitcast %struct.TYPE_26__* %21 to i8*
%124 = bitcast %struct.TYPE_26__* %10 to i64*
%125 = load i64, i64* %124
%126 = bitcast %struct.TYPE_26__* %8 to i64*
%127 = load i64, i64* %126
%128 = call i64 @_mm_unpacklo_epi64(i64 %125, i64 %127)
%129 = bitcast %struct.TYPE_26__* %22 to i64*
store i64 %128, i64* %129
%130 = bitcast %struct.TYPE_26__* %7 to i8*
%131 = bitcast %struct.TYPE_26__* %22 to i8*
%132 = bitcast %struct.TYPE_26__* %10 to i64*
%133 = load i64, i64* %132
%134 = bitcast %struct.TYPE_26__* %8 to i64*
%135 = load i64, i64* %134
%136 = call i64 @_mm_unpackhi_epi64(i64 %133, i64 %135)
%137 = bitcast %struct.TYPE_26__* %23 to i64*
store i64 %136, i64* %137
%138 = bitcast %struct.TYPE_26__* %10 to i8*
%139 = bitcast %struct.TYPE_26__* %23 to i8*
%140 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%141 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %140, i64 1
%142 = bitcast %struct.TYPE_26__* %141 to i64*
%143 = load i64, i64* %142
%144 = load i64, i64* bitcast (%struct.TYPE_26__* @avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2.keep_1st to i64*)
%145 = call i64 @_mm_and_si128(i64 %143, i64 %144)
%146 = bitcast %struct.TYPE_26__* %24 to i64*
store i64 %145, i64* %146
%147 = bitcast %struct.TYPE_26__* %8 to i8*
%148 = bitcast %struct.TYPE_26__* %24 to i8*
%149 = bitcast %struct.TYPE_26__* %7 to i64*
%150 = load i64, i64* %149
%151 = call i64 @_mm_slli_si128(i64 %150, i32 4)
%152 = bitcast %struct.TYPE_26__* %25 to i64*
store i64 %151, i64* %152
%153 = bitcast %struct.TYPE_26__* %9 to i8*
%154 = bitcast %struct.TYPE_26__* %25 to i8*
%155 = bitcast %struct.TYPE_26__* %8 to i64*
%156 = load i64, i64* %155
%157 = bitcast %struct.TYPE_26__* %9 to i64*
%158 = load i64, i64* %157
%159 = call i64 @_mm_or_si128(i64 %156, i64 %158)
%160 = bitcast %struct.TYPE_26__* %26 to i64*
store i64 %159, i64* %160
%161 = bitcast %struct.TYPE_26__* %8 to i8*
%162 = bitcast %struct.TYPE_26__* %26 to i8*
%163 = bitcast %struct.TYPE_26__* %8 to i64*
%164 = load i64, i64* %163
%165 = bitcast %struct.TYPE_26__* %7 to i64*
%166 = load i64, i64* %165
%167 = call i64 @_mm_avg_epu16(i64 %164, i64 %166)
%168 = bitcast %struct.TYPE_26__* %27 to i64*
store i64 %167, i64* %168
%169 = bitcast %struct.TYPE_26__* %8 to i8*
%170 = bitcast %struct.TYPE_26__* %27 to i8*
%171 = load %struct.TYPE_26__*, %struct.TYPE_26__** %6
%172 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %171, i64 1
%173 = bitcast %struct.TYPE_26__* %10 to i64*
%174 = load i64, i64* %173
%175 = bitcast %struct.TYPE_26__* %8 to i64*
%176 = load i64, i64* %175
%177 = call i64 @_mm_avg_epu16(i64 %174, i64 %176)
%178 = bitcast %struct.TYPE_26__* %28 to i64*
store i64 %177, i64* %178
%179 = bitcast %struct.TYPE_26__* %172 to i8*
%180 = bitcast %struct.TYPE_26__* %28 to i8*
%181 = load %struct.TYPE_26__*, %struct.TYPE_26__** %5
%182 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %181, i64 0
%183 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%184 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %183, i64 2
%185 = call i64 @_mm_load_si128(%struct.TYPE_26__* %184)
%186 = bitcast %struct.TYPE_26__* %29 to i64*
store i64 %185, i64* %186
%187 = bitcast %struct.TYPE_26__* %182 to i8*
%188 = bitcast %struct.TYPE_26__* %29 to i8*
%189 = load %struct.TYPE_26__*, %struct.TYPE_26__** %5
%190 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %189, i64 1
%191 = load %struct.TYPE_26__*, %struct.TYPE_26__** %4
%192 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %191, i64 3
%193 = call i64 @_mm_load_si128(%struct.TYPE_26__* %192)
%194 = bitcast %struct.TYPE_26__* %30 to i64*
store i64 %193, i64* %194
%195 = bitcast %struct.TYPE_26__* %190 to i8*
%196 = bitcast %struct.TYPE_26__* %30 to i8*
ret void
}

LLVM IR (-O2):
%struct.TYPE_26__ = type { i32, i32 }
define void @avg_422_downsample_first_ag_rb_vectors_n_save_previous_sse2(%struct.TYPE_26__* %0, %struct.TYPE_26__* nocapture writeonly %1, %struct.TYPE_26__* nocapture writeonly %2) {
%4 = bitcast %struct.TYPE_26__* %0 to i64*
%5 = load i64, i64* %4
%6 = tail call i64 @_mm_shuffle_epi32(i64 %5, i32 141)
%7 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %0, i64 2
%8 = bitcast %struct.TYPE_26__* %7 to i64*
%9 = load i64, i64* %8
%10 = tail call i64 @_mm_shuffle_epi32(i64 %9, i32 141)
%11 = tail call i64 @_mm_unpacklo_epi64(i64 %6, i64 %10)
%12 = tail call i64 @_mm_unpackhi_epi64(i64 %6, i64 %10)
%13 = load i64, i64* %4
%14 = tail call i64 @_mm_and_si128(i64 %13, i64 4294967295)
%15 = tail call i64 @_mm_slli_si128(i64 %11, i32 4)
%16 = tail call i64 @_mm_or_si128(i64 %14, i64 %15)
%17 = tail call i64 @_mm_avg_epu16(i64 %16, i64 %11)
%18 = tail call i64 @_mm_avg_epu16(i64 %12, i64 %17)
%19 = bitcast %struct.TYPE_26__* %2 to i64*
store i64 %18, i64* %19
%20 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %0, i64 1
%21 = bitcast %struct.TYPE_26__* %20 to i64*
%22 = load i64, i64* %21
%23 = tail call i64 @_mm_shuffle_epi32(i64 %22, i32 141)
%24 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %0, i64 3
%25 = bitcast %struct.TYPE_26__* %24 to i64*
%26 = load i64, i64* %25
%27 = tail call i64 @_mm_shuffle_epi32(i64 %26, i32 141)
%28 = tail call i64 @_mm_unpacklo_epi64(i64 %23, i64 %27)
%29 = tail call i64 @_mm_unpackhi_epi64(i64 %23, i64 %27)
%30 = load i64, i64* %21
%31 = tail call i64 @_mm_and_si128(i64 %30, i64 4294967295)
%32 = tail call i64 @_mm_slli_si128(i64 %28, i32 4)
%33 = tail call i64 @_mm_or_si128(i64 %31, i64 %32)
%34 = tail call i64 @_mm_avg_epu16(i64 %33, i64 %28)
%35 = tail call i64 @_mm_avg_epu16(i64 %29, i64 %34)
%36 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %2, i64 1
%37 = bitcast %struct.TYPE_26__* %36 to i64*
store i64 %35, i64* %37
%38 = tail call i64 @_mm_load_si128(%struct.TYPE_26__* %7)
%39 = bitcast %struct.TYPE_26__* %1 to i64*
store i64 %38, i64* %39
%40 = tail call i64 @_mm_load_si128(%struct.TYPE_26__* %24)
%41 = getelementptr inbounds %struct.TYPE_26__, %struct.TYPE_26__* %1, i64 1
%42 = bitcast %struct.TYPE_26__* %41 to i64*
store i64 %40, i64* %42
ret void
}