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

/* Type definitions */
struct TYPE_25__ {
  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_shuffle_epi32(TYPE_1__, int);
TYPE_1__ _mm_slli_si128(TYPE_1__, int);
TYPE_1__ _mm_srli_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_ag_rb_vectors_n_save_previous_sse2(
    __m128i *in_4_v16i_current_ag_rb_vectors,
    __m128i *in_2_v16i_previous_ag_rb_vectors,
    __m128i *out_2_v16i_avg_422_ag_rb_vectors) {
  __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_srli_si128(in_2_v16i_previous_ag_rb_vectors[0], 12);
  in_2_v16i_previous_ag_rb_vectors[0] = _mm_load_si128(&((scratch1)));
  (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_srli_si128(in_2_v16i_previous_ag_rb_vectors[1], 12);
  in_2_v16i_previous_ag_rb_vectors[1] = _mm_load_si128(&((scratch1)));
  (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));
}


x86 assembly (clang, -O0):
<avg_422_downsample_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   1070 <_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   1070 <_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    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0xc,%esi
call   1060 <_mm_srli_si128@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xf8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0xf8(%rbp),%rax
mov    %rcx,-0x68(%rbp)
mov    -0x68(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <_mm_or_si128@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <_mm_avg_epu16@plt>
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <_mm_avg_epu16@plt>
mov    %rax,%rcx
mov    -0xf0(%rbp),%rax
mov    %rcx,-0x88(%rbp)
mov    -0x88(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x8d,%esi
call   1070 <_mm_shuffle_epi32@plt>
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x8d,%esi
call   1070 <_mm_shuffle_epi32@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <_mm_unpacklo_epi64@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <_mm_unpackhi_epi64@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0xc,%esi
call   1060 <_mm_srli_si128@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,%rcx
mov    -0xe8(%rbp),%rax
mov    %rcx,-0xb8(%rbp)
mov    -0xb8(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <_mm_slli_si128@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <_mm_or_si128@plt>
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <_mm_avg_epu16@plt>
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <_mm_avg_epu16@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_ag_rb_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,%r12
mov    (%rdi),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,%rbx
mov    0x10(%r12),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1090 <_mm_unpacklo_epi64@plt>
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <_mm_unpackhi_epi64@plt>
mov    %rax,%r13
mov    (%r15),%rdi
mov    $0xc,%esi
call   1050 <_mm_srli_si128@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,(%r15)
mov    (%rsp),%rdi
mov    $0x4,%esi
call   10a0 <_mm_slli_si128@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1070 <_mm_or_si128@plt>
mov    (%rsp),%rsi
mov    %rax,%rdi
call   1080 <_mm_avg_epu16@plt>
mov    %r13,%rdi
mov    %rax,%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,(%r14)
mov    0x8(%r12),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,%rbx
mov    0x18(%r12),%rdi
mov    $0x8d,%esi
call   1060 <_mm_shuffle_epi32@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1090 <_mm_unpacklo_epi64@plt>
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <_mm_unpackhi_epi64@plt>
mov    %rax,%rbx
mov    0x8(%r15),%rdi
mov    $0xc,%esi
call   1050 <_mm_srli_si128@plt>
mov    %rax,%rbp
mov    %rsp,%rdi
call   1030 <_mm_load_si128@plt>
mov    %rax,0x8(%r15)
mov    (%rsp),%rdi
mov    $0x4,%esi
call   10a0 <_mm_slli_si128@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1070 <_mm_or_si128@plt>
mov    (%rsp),%rsi
mov    %rax,%rdi
call   1080 <_mm_avg_epu16@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1080 <_mm_avg_epu16@plt>
mov    %rax,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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