#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 */
scalar_t__ EOF;
scalar_t__ getfloat(float *);
int /*<<< orphan*/ printf(char *, int, float);
int main() {
  int i;
  int arrsize = 3;
  float numbers[arrsize];
  for (i = 0; getfloat(&numbers[i]) != EOF && i < arrsize; i++)
    ;
  for (i = 0; i < arrsize; i++)
    printf("%d = %3.3f\n", i, numbers[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x28(%rbp),%rdi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <getfloat@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e64(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x29(%rbp)
je     119c <main+0x7c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11ac <main+0x8c>
jmp    11bf <main+0x9f>
jmp    11b1 <main+0x91>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x44>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11fc <main+0xdc>
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c6 <main+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
xor    %r15d,%r15d
mov    0x2eb2(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <getfloat@plt>
cmp    (%r14),%rax
je     115e <main+0x3e>
lea    0x1(%r15),%rax
add    $0x4,%rbx
cmp    $0x3,%r15
mov    %rax,%r15
jb     1140 <main+0x20>
movss  (%rsp),%xmm0
lea    0xe96(%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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [12 x i8] c"%d = %3.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 0, i32* %1
store i32 3, i32* %3
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %4
%9 = alloca float, i64 %7
store i64 %7, i64* %5
store i32 0, i32* %2
br label %10
10: ; preds = %24, %0
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %9, i64 %12
%14 = call i64 @getfloat(float* %13)
%15 = load i64, i64* @EOF
%16 = icmp ne i64 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %10
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br label %21
21: ; preds = %17, %10
%22 = phi i1 [ false, %10 ], [ %20, %17 ]
br i1 %22, label %23, label %27
23: ; preds = %21
br label %24
24: ; preds = %23
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %10
27: ; preds = %21
store i32 0, i32* %2
br label %28
28: ; preds = %39, %27
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %42
32: ; preds = %28
%33 = load i32, i32* %2
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds float, float* %9, i64 %35
%37 = load float, float* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %33, float %37)
br label %39
39: ; preds = %32
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %28
42: ; preds = %28
store i32 0, i32* %1
%43 = load i8*, i8** %4
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [12 x i8] c"%d = %3.3f\0A\00"
define i32 @main() {
%1 = alloca [3 x float]
br label %2
2: ; preds = %2, %0
%3 = phi i64 [ %10, %2 ], [ 0, %0 ]
%4 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 %3
%5 = call i64 @getfloat(float* %4)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
%8 = icmp ult i64 %3, 3
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw nsw i64 %3, 1
br i1 %9, label %2, label %11
11: ; preds = %2
%12 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 0
%13 = load float, float* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0, float %13)
%15 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 1
%16 = load float, float* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1, float %16)
%18 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 2
%19 = load float, float* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2, float %19)
ret i32 0
}