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

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

/* Variables and functions */
TYPE_1__ _mm_add_epi32(TYPE_1__, TYPE_1__);
TYPE_1__ _mm_madd_epi16(TYPE_1__, TYPE_1__ const);
TYPE_1__ _mm_packs_epi32(TYPE_1__, TYPE_1__);
TYPE_1__ _mm_srli_epi32(TYPE_1__, int);
extern void
convert_ga_br_vectors_to_y_vector_sse2(__m128i *in_4_v16i_ag_rb_vectors,
                                       __m128i *out_1_v16i_y_vector) {
  static const __m128i agYCoeffs = {0x00004B7D00004B7DLL, 0x00004B7D00004B7DLL};
  static const __m128i rbYCoeffs = {0x26460E9826460E98LL, 0x26460E9826460E98LL};
  __m128i y1Scratch = {0x0LL, 0x0LL};
  __m128i y2Scratch = {0x0LL, 0x0LL};
  __m128i scratch = {0x0LL, 0x0LL};
  (y1Scratch) = _mm_madd_epi16(in_4_v16i_ag_rb_vectors[0], (agYCoeffs));
  (scratch) = _mm_madd_epi16(in_4_v16i_ag_rb_vectors[1], (rbYCoeffs));
  (y1Scratch) = _mm_add_epi32((y1Scratch), (scratch));
  (y1Scratch) = _mm_srli_epi32((y1Scratch), 15);
  (y2Scratch) = _mm_madd_epi16(in_4_v16i_ag_rb_vectors[2], (agYCoeffs));
  (scratch) = _mm_madd_epi16(in_4_v16i_ag_rb_vectors[3], (rbYCoeffs));
  (y2Scratch) = _mm_add_epi32((y2Scratch), (scratch));
  (y2Scratch) = _mm_srli_epi32((y2Scratch), 15);
  *out_1_v16i_y_vector = _mm_packs_epi32((y1Scratch), (y2Scratch));
}


x86 assembly (clang, -O0):
<convert_ga_br_vectors_to_y_vector_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    0xe5f(%rip),%rsi
call   1060 <_mm_madd_epi16@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0xe47(%rip),%rsi
call   1060 <_mm_madd_epi16@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <_mm_add_epi32@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xf,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0xdec(%rip),%rsi
call   1060 <_mm_madd_epi16@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdi
mov    0xdd4(%rip),%rsi
call   1060 <_mm_madd_epi16@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <_mm_add_epi32@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0xf,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <_mm_packs_epi32@plt>
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
mov    %rcx,-0x70(%rbp)
mov    -0x70(%rbp),%rcx
mov    %rcx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_ga_br_vectors_to_y_vector_sse2>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
movabs $0x4b7d00004b7d,%r15
mov    %r15,%rsi
call   1050 <_mm_madd_epi16@plt>
mov    %rax,%r12
mov    0x8(%rbx),%rdi
movabs $0x26460e9826460e98,%r13
0e 46 26
mov    %r13,%rsi
call   1050 <_mm_madd_epi16@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1040 <_mm_add_epi32@plt>
mov    %rax,%rdi
mov    $0xf,%esi
call   1060 <_mm_srli_epi32@plt>
mov    %rax,%r12
mov    0x10(%rbx),%rdi
mov    %r15,%rsi
call   1050 <_mm_madd_epi16@plt>
mov    %rax,%r15
mov    0x18(%rbx),%rdi
mov    %r13,%rsi
call   1050 <_mm_madd_epi16@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <_mm_add_epi32@plt>
mov    %rax,%rdi
mov    $0xf,%esi
call   1060 <_mm_srli_epi32@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1030 <_mm_packs_epi32@plt>
mov    %rax,(%r14)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_15__ = type { i32, i32 }
@convert_ga_br_vectors_to_y_vector_sse2.agYCoeffs = internal constant %struct.TYPE_15__ { i32 19325, i32 19325 }
@convert_ga_br_vectors_to_y_vector_sse2.rbYCoeffs = internal constant %struct.TYPE_15__ { i32 642125464, i32 642125464 }
define void @convert_ga_br_vectors_to_y_vector_sse2(%struct.TYPE_15__* %0, %struct.TYPE_15__* %1) {
%3 = alloca %struct.TYPE_15__*
%4 = alloca %struct.TYPE_15__*
%5 = alloca %struct.TYPE_15__
%6 = alloca %struct.TYPE_15__
%7 = alloca %struct.TYPE_15__
%8 = alloca %struct.TYPE_15__
%9 = alloca %struct.TYPE_15__
%10 = alloca %struct.TYPE_15__
%11 = alloca %struct.TYPE_15__
%12 = alloca %struct.TYPE_15__
%13 = alloca %struct.TYPE_15__
%14 = alloca %struct.TYPE_15__
%15 = alloca %struct.TYPE_15__
%16 = alloca %struct.TYPE_15__
store %struct.TYPE_15__* %0, %struct.TYPE_15__** %3
store %struct.TYPE_15__* %1, %struct.TYPE_15__** %4
%17 = bitcast %struct.TYPE_15__* %5 to i8*
%18 = bitcast %struct.TYPE_15__* %6 to i8*
%19 = bitcast %struct.TYPE_15__* %7 to i8*
%20 = load %struct.TYPE_15__*, %struct.TYPE_15__** %3
%21 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %20, i64 0
%22 = bitcast %struct.TYPE_15__* %21 to i64*
%23 = load i64, i64* %22
%24 = load i64, i64* bitcast (%struct.TYPE_15__* @convert_ga_br_vectors_to_y_vector_sse2.agYCoeffs to i64*)
%25 = call i64 @_mm_madd_epi16(i64 %23, i64 %24)
%26 = bitcast %struct.TYPE_15__* %8 to i64*
store i64 %25, i64* %26
%27 = bitcast %struct.TYPE_15__* %5 to i8*
%28 = bitcast %struct.TYPE_15__* %8 to i8*
%29 = load %struct.TYPE_15__*, %struct.TYPE_15__** %3
%30 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %29, i64 1
%31 = bitcast %struct.TYPE_15__* %30 to i64*
%32 = load i64, i64* %31
%33 = load i64, i64* bitcast (%struct.TYPE_15__* @convert_ga_br_vectors_to_y_vector_sse2.rbYCoeffs to i64*)
%34 = call i64 @_mm_madd_epi16(i64 %32, i64 %33)
%35 = bitcast %struct.TYPE_15__* %9 to i64*
store i64 %34, i64* %35
%36 = bitcast %struct.TYPE_15__* %7 to i8*
%37 = bitcast %struct.TYPE_15__* %9 to i8*
%38 = bitcast %struct.TYPE_15__* %5 to i64*
%39 = load i64, i64* %38
%40 = bitcast %struct.TYPE_15__* %7 to i64*
%41 = load i64, i64* %40
%42 = call i64 @_mm_add_epi32(i64 %39, i64 %41)
%43 = bitcast %struct.TYPE_15__* %10 to i64*
store i64 %42, i64* %43
%44 = bitcast %struct.TYPE_15__* %5 to i8*
%45 = bitcast %struct.TYPE_15__* %10 to i8*
%46 = bitcast %struct.TYPE_15__* %5 to i64*
%47 = load i64, i64* %46
%48 = call i64 @_mm_srli_epi32(i64 %47, i32 15)
%49 = bitcast %struct.TYPE_15__* %11 to i64*
store i64 %48, i64* %49
%50 = bitcast %struct.TYPE_15__* %5 to i8*
%51 = bitcast %struct.TYPE_15__* %11 to i8*
%52 = load %struct.TYPE_15__*, %struct.TYPE_15__** %3
%53 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %52, i64 2
%54 = bitcast %struct.TYPE_15__* %53 to i64*
%55 = load i64, i64* %54
%56 = load i64, i64* bitcast (%struct.TYPE_15__* @convert_ga_br_vectors_to_y_vector_sse2.agYCoeffs to i64*)
%57 = call i64 @_mm_madd_epi16(i64 %55, i64 %56)
%58 = bitcast %struct.TYPE_15__* %12 to i64*
store i64 %57, i64* %58
%59 = bitcast %struct.TYPE_15__* %6 to i8*
%60 = bitcast %struct.TYPE_15__* %12 to i8*
%61 = load %struct.TYPE_15__*, %struct.TYPE_15__** %3
%62 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %61, i64 3
%63 = bitcast %struct.TYPE_15__* %62 to i64*
%64 = load i64, i64* %63
%65 = load i64, i64* bitcast (%struct.TYPE_15__* @convert_ga_br_vectors_to_y_vector_sse2.rbYCoeffs to i64*)
%66 = call i64 @_mm_madd_epi16(i64 %64, i64 %65)
%67 = bitcast %struct.TYPE_15__* %13 to i64*
store i64 %66, i64* %67
%68 = bitcast %struct.TYPE_15__* %7 to i8*
%69 = bitcast %struct.TYPE_15__* %13 to i8*
%70 = bitcast %struct.TYPE_15__* %6 to i64*
%71 = load i64, i64* %70
%72 = bitcast %struct.TYPE_15__* %7 to i64*
%73 = load i64, i64* %72
%74 = call i64 @_mm_add_epi32(i64 %71, i64 %73)
%75 = bitcast %struct.TYPE_15__* %14 to i64*
store i64 %74, i64* %75
%76 = bitcast %struct.TYPE_15__* %6 to i8*
%77 = bitcast %struct.TYPE_15__* %14 to i8*
%78 = bitcast %struct.TYPE_15__* %6 to i64*
%79 = load i64, i64* %78
%80 = call i64 @_mm_srli_epi32(i64 %79, i32 15)
%81 = bitcast %struct.TYPE_15__* %15 to i64*
store i64 %80, i64* %81
%82 = bitcast %struct.TYPE_15__* %6 to i8*
%83 = bitcast %struct.TYPE_15__* %15 to i8*
%84 = load %struct.TYPE_15__*, %struct.TYPE_15__** %4
%85 = bitcast %struct.TYPE_15__* %5 to i64*
%86 = load i64, i64* %85
%87 = bitcast %struct.TYPE_15__* %6 to i64*
%88 = load i64, i64* %87
%89 = call i64 @_mm_packs_epi32(i64 %86, i64 %88)
%90 = bitcast %struct.TYPE_15__* %16 to i64*
store i64 %89, i64* %90
%91 = bitcast %struct.TYPE_15__* %84 to i8*
%92 = bitcast %struct.TYPE_15__* %16 to i8*
ret void
}

LLVM IR (-O2):
%struct.TYPE_15__ = type { i32, i32 }
define void @convert_ga_br_vectors_to_y_vector_sse2(%struct.TYPE_15__* nocapture %0, %struct.TYPE_15__* nocapture writeonly %1) {
%3 = bitcast %struct.TYPE_15__* %0 to i64*
%4 = load i64, i64* %3
%5 = tail call i64 @_mm_madd_epi16(i64 %4, i64 83000243014525)
%6 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %0, i64 1
%7 = bitcast %struct.TYPE_15__* %6 to i64*
%8 = load i64, i64* %7
%9 = tail call i64 @_mm_madd_epi16(i64 %8, i64 2757907868450950808)
%10 = tail call i64 @_mm_add_epi32(i64 %5, i64 %9)
%11 = tail call i64 @_mm_srli_epi32(i64 %10, i32 15)
%12 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %0, i64 2
%13 = bitcast %struct.TYPE_15__* %12 to i64*
%14 = load i64, i64* %13
%15 = tail call i64 @_mm_madd_epi16(i64 %14, i64 83000243014525)
%16 = getelementptr inbounds %struct.TYPE_15__, %struct.TYPE_15__* %0, i64 3
%17 = bitcast %struct.TYPE_15__* %16 to i64*
%18 = load i64, i64* %17
%19 = tail call i64 @_mm_madd_epi16(i64 %18, i64 2757907868450950808)
%20 = tail call i64 @_mm_add_epi32(i64 %15, i64 %19)
%21 = tail call i64 @_mm_srli_epi32(i64 %20, i32 15)
%22 = tail call i64 @_mm_packs_epi32(i64 %11, i64 %21)
%23 = bitcast %struct.TYPE_15__* %1 to i64*
store i64 %22, i64* %23
ret void
}