#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;
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n;
  double array[10], getfloat(double *);
  for (n = 0; n < 10; n++)
    array[n] = 0.0;
  for (n = 0; n < 10 && getfloat(&array[n]) != EOF; n++)
    ;
  for (n = 0; n < 10; n++)
    printf("%g ", array[n]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115b <main+0x3b>
movslq -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x61(%rbp)
jge    11a0 <main+0x80>
movslq -0x8(%rbp),%rax
lea    -0x60(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
call   1040 <getfloat@plt>
mov    0x2e5c(%rip),%rax
cvtsi2sdq (%rax),%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    11b0 <main+0x90>
jmp    11c3 <main+0xa3>
jmp    11b5 <main+0x95>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x42>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11fa <main+0xda>
movslq -0x8(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
lea    0xe1b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ca <main+0xaa>
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
xorpd  %xmm0,%xmm0
movapd %xmm0,0x40(%rsp)
movapd %xmm0,0x30(%rsp)
movapd %xmm0,0x20(%rsp)
movapd %xmm0,0x10(%rsp)
movapd %xmm0,(%rsp)
mov    %rsp,%rdi
call   1050 <getfloat@plt>
mov    0x2e83(%rip),%rbx
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    1176 <main+0x46>
jnp    125c <main+0x12c>
lea    0x8(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    1194 <main+0x64>
jnp    125c <main+0x12c>
lea    0x10(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    11b2 <main+0x82>
jnp    125c <main+0x12c>
lea    0x18(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    11d0 <main+0xa0>
jnp    125c <main+0x12c>
lea    0x20(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    11ea <main+0xba>
jnp    125c <main+0x12c>
lea    0x28(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    1204 <main+0xd4>
jnp    125c <main+0x12c>
lea    0x30(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    121e <main+0xee>
jnp    125c <main+0x12c>
lea    0x38(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    1238 <main+0x108>
jnp    125c <main+0x12c>
lea    0x40(%rsp),%rdi
call   1050 <getfloat@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    1252 <main+0x122>
jnp    125c <main+0x12c>
lea    0x48(%rsp),%rdi
call   1050 <getfloat@plt>
movsd  (%rsp),%xmm0
lea    0xd98(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x40(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x48(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%g \00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = bitcast [10 x double]* %1 to i8*
%3 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%4 = call double @getfloat(double* %3)
%5 = load i64, i64* @EOF
%6 = sitofp i64 %5 to double
%7 = fcmp une double %4, %6
br i1 %7, label %8, label %59
8: ; preds = %0
%9 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 1
%10 = call double @getfloat(double* %9)
%11 = load i64, i64* @EOF
%12 = sitofp i64 %11 to double
%13 = fcmp une double %10, %12
br i1 %13, label %14, label %59
14: ; preds = %8
%15 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 2
%16 = call double @getfloat(double* %15)
%17 = load i64, i64* @EOF
%18 = sitofp i64 %17 to double
%19 = fcmp une double %16, %18
br i1 %19, label %20, label %59
20: ; preds = %14
%21 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 3
%22 = call double @getfloat(double* %21)
%23 = load i64, i64* @EOF
%24 = sitofp i64 %23 to double
%25 = fcmp une double %22, %24
br i1 %25, label %26, label %59
26: ; preds = %20
%27 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 4
%28 = call double @getfloat(double* %27)
%29 = load i64, i64* @EOF
%30 = sitofp i64 %29 to double
%31 = fcmp une double %28, %30
br i1 %31, label %32, label %59
32: ; preds = %26
%33 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 5
%34 = call double @getfloat(double* %33)
%35 = load i64, i64* @EOF
%36 = sitofp i64 %35 to double
%37 = fcmp une double %34, %36
br i1 %37, label %38, label %59
38: ; preds = %32
%39 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 6
%40 = call double @getfloat(double* %39)
%41 = load i64, i64* @EOF
%42 = sitofp i64 %41 to double
%43 = fcmp une double %40, %42
br i1 %43, label %44, label %59
44: ; preds = %38
%45 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 7
%46 = call double @getfloat(double* %45)
%47 = load i64, i64* @EOF
%48 = sitofp i64 %47 to double
%49 = fcmp une double %46, %48
br i1 %49, label %50, label %59
50: ; preds = %44
%51 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 8
%52 = call double @getfloat(double* %51)
%53 = load i64, i64* @EOF
%54 = sitofp i64 %53 to double
%55 = fcmp une double %52, %54
br i1 %55, label %56, label %59
56: ; preds = %50
%57 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 9
%58 = call double @getfloat(double* %57)
br label %59
59: ; preds = %56, %50, %44, %38, %32, %26, %20, %14, %8, %0
%60 = load double, double* %3
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %60)
%62 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 1
%63 = load double, double* %62
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %63)
%65 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 2
%66 = load double, double* %65
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %66)
%68 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 3
%69 = load double, double* %68
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %69)
%71 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 4
%72 = load double, double* %71
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %72)
%74 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 5
%75 = load double, double* %74
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %75)
%77 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 6
%78 = load double, double* %77
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %78)
%80 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 7
%81 = load double, double* %80
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %81)
%83 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 8
%84 = load double, double* %83
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %84)
%86 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 9
%87 = load double, double* %86
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %87)
%89 = call i32 @putchar(i32 10)
ret i32 0
}