#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 *, float);
int main(void) {
  int n;
  float array[100];
  for (n = 0; n < 100 && getfloat(&array[n]) != EOF; n++)
    printf("%g ", array[n]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0x8(%rbp)
mov    %al,-0x1a1(%rbp)
jge    1175 <main+0x55>
movslq -0x8(%rbp),%rax
lea    -0x1a0(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <getfloat@plt>
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x1a1(%rbp)
mov    -0x1a1(%rbp),%al
test   $0x1,%al
jne    1188 <main+0x68>
jmp    11af <main+0x8f>
movslq -0x8(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x190,%rsp
xor    %ebx,%ebx
mov    0x2eb3(%rip),%r15
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
lea    (%rsp,%rbx,1),%rdi
call   1040 <getfloat@plt>
cmp    (%r15),%rax
je     1168 <main+0x48>
movss  (%rsp,%rbx,1),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    $0x190,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%g \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x float]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %22, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 %9
%11 = call i64 @getfloat(float* %10)
%12 = load i64, i64* @EOF
%13 = icmp ne i64 %11, %12
br label %14
14: ; preds = %7, %4
%15 = phi i1 [ false, %4 ], [ %13, %7 ]
br i1 %15, label %16, label %25
16: ; preds = %14
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 %18
%20 = load float, float* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %4
25: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%g \00"
define i32 @main() {
%1 = alloca [100 x float]
%2 = bitcast [100 x float]* %1 to i8*
br label %3
3: ; preds = %0, %9
%4 = phi i64 [ 0, %0 ], [ %12, %9 ]
%5 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 %4
%6 = call i64 @getfloat(float* %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = load float, float* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %10)
%12 = add nuw nsw i64 %4, 1
%13 = icmp eq i64 %12, 100
br i1 %13, label %14, label %3
14: ; preds = %9, %3
ret i32 0
}