#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*/ c_sfill(int, float, float *, int);
int /*<<< orphan*/ printf(char *, int, float);
int main() {
  float x[] = {1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0};
  int N = 8;
  int strideX = 1;
  c_sfill(N, 5.0f, x, strideX);
  for (int i = 0; i < 8; i++) {
    printf("x[ %i ] = %f\n", i, x[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
movss  0xe85(%rip),%xmm0
call   1040 <c_sfill@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x8,-0x3c(%rbp)
jge    11b8 <main+0x98>
mov    -0x3c(%rbp),%esi
movslq -0x3c(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1187 <main+0x67>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebc(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x8,%edi
mov    $0x1,%edx
call   1040 <c_sfill@plt>
movss  (%rsp),%xmm0
lea    0xece(%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>
movss  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
movss  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
movss  0x1c(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.x = [8 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, float -8.000000e+00]
@.str = [14 x i8] c"x[ %i ] = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x float]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [8 x float]* %2 to i8*
store i32 8, i32* %3
store i32 1, i32* %4
%7 = load i32, i32* %3
%8 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @c_sfill(i32 %7, float 5.000000e+00, float* %8, i32 %9)
store i32 0, i32* %5
br label %11
11: ; preds = %21, %0
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 8
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 %17
%19 = load float, float* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %15, float %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %11
24: ; preds = %11
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@__const.main.x = [8 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, float -8.000000e+00]
@.str = [14 x i8] c"x[ %i ] = %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call i32 @c_sfill(i32 8, float 5.000000e+00, float* %3, i32 1)
%5 = load float, float* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, float %5)
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 1
%8 = load float, float* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, float %8)
%10 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 2
%11 = load float, float* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, float %11)
%13 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 3
%14 = load float, float* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, float %14)
%16 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 4
%17 = load float, float* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, float %17)
%19 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 5
%20 = load float, float* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, float %20)
%22 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 6
%23 = load float, float* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, float %23)
%25 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 7
%26 = load float, float* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 7, float %26)
ret i32 0
}