#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 */

/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_add_epi32(int /*<<< orphan*/,
                                    int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm256_madd_epi16(int /*<<< orphan*/ const,
                                     int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm256_set1_epi32(int);
int /*<<< orphan*/ _mm256_srai_epi32(int /*<<< orphan*/, int);
void filter_8x1_2t_pixels(const __m256i *sig, const __m256i *f, __m256i *y0) {
  const __m256i rounding = _mm256_set1_epi32(1 << ((7) - 1));
  __m256i x0 = _mm256_madd_epi16(sig[0], *f);
  x0 = _mm256_add_epi32(x0, rounding);
  *y0 = _mm256_srai_epi32(x0, (7));
}


x86 assembly (clang, -O0):
<filter_8x1_2t_pixels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x40,%edi
call   1030 <_mm256_set1_epi32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1050 <_mm256_madd_epi16@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1060 <_mm256_add_epi32@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x7,%esi
call   1040 <_mm256_srai_epi32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_8x1_2t_pixels>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0x40,%edi
call   1030 <_mm256_set1_epi32@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    (%r15),%esi
call   1050 <_mm256_madd_epi16@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1060 <_mm256_add_epi32@plt>
mov    %eax,%edi
mov    $0x7,%esi
call   1040 <_mm256_srai_epi32@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @filter_8x1_2t_pixels(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = call i32 @_mm256_set1_epi32(i32 64)
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = call i32 @_mm256_madd_epi16(i32 %12, i32 %14)
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = call i32 @_mm256_add_epi32(i32 %16, i32 %17)
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = call i32 @_mm256_srai_epi32(i32 %19, i32 7)
%21 = load i32*, i32** %6
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @filter_8x1_2t_pixels(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @_mm256_set1_epi32(i32 64)
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 @_mm256_madd_epi16(i32 %5, i32 %6)
%8 = tail call i32 @_mm256_add_epi32(i32 %7, i32 %4)
%9 = tail call i32 @_mm256_srai_epi32(i32 %8, i32 7)
store i32 %9, i32* %2
ret void
}