#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 __m128;

/* Variables and functions */
int _mm_load_ps1(float const *);
int _mm_loadu_ps(float const *);
int _mm_setzero_ps();
int /*<<< orphan*/ _mm_storeu_ps(float *, int);
void Toeplitz_mat04(const float *a, const float *f, float *b) {
  __m128 ax, fx, bx = _mm_setzero_ps();
  ax = _mm_loadu_ps(a + 0);
  fx = _mm_load_ps1(f + 3);
  bx += ax * fx;
  ax = _mm_loadu_ps(a + 1);
  fx = _mm_load_ps1(f + 2);
  bx += ax * fx;
  ax = _mm_loadu_ps(a + 2);
  fx = _mm_load_ps1(f + 1);
  bx += ax * fx;
  ax = _mm_loadu_ps(a + 3);
  fx = _mm_load_ps1(f + 0);
  bx += ax * fx;
  _mm_storeu_ps(b, bx);
}


x86 assembly (clang, -O0):
<Toeplitz_mat04>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1060 <_mm_setzero_ps@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xc,%rdi
call   1030 <_mm_load_ps1@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1030 <_mm_load_ps1@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1030 <_mm_load_ps1@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_mm_load_ps1@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <_mm_storeu_ps@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Toeplitz_mat04>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
xor    %eax,%eax
call   1060 <_mm_setzero_ps@plt>
mov    %eax,%r12d
mov    %r13,%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,%ebp
lea    0xc(%r15),%rdi
call   1030 <_mm_load_ps1@plt>
imul   %eax,%ebp
add    %r12d,%ebp
lea    0x4(%r13),%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,%ebx
lea    0x8(%r15),%rdi
call   1030 <_mm_load_ps1@plt>
imul   %eax,%ebx
add    %ebp,%ebx
lea    0x8(%r13),%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,%ebp
lea    0x4(%r15),%rdi
call   1030 <_mm_load_ps1@plt>
imul   %eax,%ebp
add    %ebx,%ebp
add    $0xc,%r13
mov    %r13,%rdi
call   1050 <_mm_loadu_ps@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <_mm_load_ps1@plt>
imul   %eax,%ebx
add    %ebp,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <_mm_storeu_ps@plt>

LLVM IR (-O0):
define void @Toeplitz_mat04(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%10 = call i32 (...) @_mm_setzero_ps()
store i32 %10, i32* %9
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 0
%13 = call i32 @_mm_loadu_ps(float* %12)
store i32 %13, i32* %7
%14 = load float*, float** %5
%15 = getelementptr inbounds float, float* %14, i64 3
%16 = call i32 @_mm_load_ps1(float* %15)
store i32 %16, i32* %8
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %9
%21 = add nsw i32 %20, %19
store i32 %21, i32* %9
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 1
%24 = call i32 @_mm_loadu_ps(float* %23)
store i32 %24, i32* %7
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = call i32 @_mm_load_ps1(float* %26)
store i32 %27, i32* %8
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = mul nsw i32 %28, %29
%31 = load i32, i32* %9
%32 = add nsw i32 %31, %30
store i32 %32, i32* %9
%33 = load float*, float** %4
%34 = getelementptr inbounds float, float* %33, i64 2
%35 = call i32 @_mm_loadu_ps(float* %34)
store i32 %35, i32* %7
%36 = load float*, float** %5
%37 = getelementptr inbounds float, float* %36, i64 1
%38 = call i32 @_mm_load_ps1(float* %37)
store i32 %38, i32* %8
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = mul nsw i32 %39, %40
%42 = load i32, i32* %9
%43 = add nsw i32 %42, %41
store i32 %43, i32* %9
%44 = load float*, float** %4
%45 = getelementptr inbounds float, float* %44, i64 3
%46 = call i32 @_mm_loadu_ps(float* %45)
store i32 %46, i32* %7
%47 = load float*, float** %5
%48 = getelementptr inbounds float, float* %47, i64 0
%49 = call i32 @_mm_load_ps1(float* %48)
store i32 %49, i32* %8
%50 = load i32, i32* %7
%51 = load i32, i32* %8
%52 = mul nsw i32 %50, %51
%53 = load i32, i32* %9
%54 = add nsw i32 %53, %52
store i32 %54, i32* %9
%55 = load float*, float** %6
%56 = load i32, i32* %9
%57 = call i32 @_mm_storeu_ps(float* %55, i32 %56)
ret void
}

LLVM IR (-O2):
define void @Toeplitz_mat04(float* %0, float* %1, float* %2) {
%4 = tail call i32 (...) @_mm_setzero_ps()
%5 = tail call i32 @_mm_loadu_ps(float* %0)
%6 = getelementptr inbounds float, float* %1, i64 3
%7 = tail call i32 @_mm_load_ps1(float* %6)
%8 = mul nsw i32 %7, %5
%9 = add nsw i32 %8, %4
%10 = getelementptr inbounds float, float* %0, i64 1
%11 = tail call i32 @_mm_loadu_ps(float* %10)
%12 = getelementptr inbounds float, float* %1, i64 2
%13 = tail call i32 @_mm_load_ps1(float* %12)
%14 = mul nsw i32 %13, %11
%15 = add nsw i32 %9, %14
%16 = getelementptr inbounds float, float* %0, i64 2
%17 = tail call i32 @_mm_loadu_ps(float* %16)
%18 = getelementptr inbounds float, float* %1, i64 1
%19 = tail call i32 @_mm_load_ps1(float* %18)
%20 = mul nsw i32 %19, %17
%21 = add nsw i32 %15, %20
%22 = getelementptr inbounds float, float* %0, i64 3
%23 = tail call i32 @_mm_loadu_ps(float* %22)
%24 = tail call i32 @_mm_load_ps1(float* %1)
%25 = mul nsw i32 %24, %23
%26 = add nsw i32 %21, %25
%27 = tail call i32 @_mm_storeu_ps(float* %2, i32 %26)
ret void
}