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

/* Variables and functions */
int /*<<< orphan*/ Toeplitz_mat4(float *, float *, float *);
int /*<<< orphan*/ printf(char *, int, float);
void test_4(void) {
  float a[] = {1, 2, 3, 4, 5, 6, 7};
  float f[] = {1, 2, 3, 4};
  float b[4];
  Toeplitz_mat4(a, f, b);
  for (int i = 0; i < 4; i++)
    printf("%2d  %f\n", i, b[i]);
}


x86 assembly (clang, -O0):
<test_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <Toeplitz_mat4@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x4,-0x44(%rbp)
jge    11b1 <test_4+0x91>
mov    -0x44(%rbp),%esi
movslq -0x44(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1180 <test_4+0x60>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_4>:
push   %rbx
sub    $0x40,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <Toeplitz_mat4@plt>
movss  (%rsp),%xmm0
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_4.a = [7 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00]
@__const.test_4.f = [4 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00]
@.str = [9 x i8] c"%2d %f\0A\00"
define void @test_4() {
%1 = alloca [7 x float]
%2 = alloca [4 x float]
%3 = alloca [4 x float]
%4 = alloca i32
%5 = bitcast [7 x float]* %1 to i8*
%6 = bitcast [4 x float]* %2 to i8*
%7 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 0
%8 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%10 = call i32 @Toeplitz_mat4(float* %7, float* %8, float* %9)
store i32 0, i32* %4
br label %11
11: ; preds = %21, %0
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 4
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 %17
%19 = load float, float* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %15, float %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %11
24: ; preds = %11
ret void
}

LLVM IR (-O2):
@__const.test_4.a = [7 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00]
@__const.test_4.f = [4 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00]
@.str = [9 x i8] c"%2d %f\0A\00"
define void @test_4() {
%1 = alloca [7 x float]
%2 = alloca [4 x float]
%3 = alloca [4 x float]
%4 = bitcast [7 x float]* %1 to i8*
%5 = bitcast [4 x float]* %2 to i8*
%6 = bitcast [4 x float]* %3 to i8*
%7 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 0
%8 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%10 = call i32 @Toeplitz_mat4(float* %7, float* %8, float* %9)
%11 = load float, float* %9
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, float %11)
%13 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 1
%14 = load float, float* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, float %14)
%16 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 2
%17 = load float, float* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, float %17)
%19 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 3
%20 = load float, float* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3, float %20)
ret void
}