#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, array[10], getint(int *);
  for (n = 0; n < 10; n++)
    array[n] = 0;
  for (n = 0; n < 10 && getint(&array[n]) != EOF; n++)
    ;
  for (n = 0; n < 10; n++)
    printf("%d ", array[n]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115a <main+0x3a>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
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,-0x31(%rbp)
jge    1196 <main+0x76>
movslq -0x8(%rbp),%rax
lea    -0x30(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <getint@plt>
cltq
mov    0x2e5b(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11a6 <main+0x86>
jmp    11b9 <main+0x99>
jmp    11ab <main+0x8b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x41>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11ee <main+0xce>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c0 <main+0xa0>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rdi
call   1050 <getint@plt>
cltq
mov    0x2e8d(%rip),%rbx
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x4(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x8(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0xc(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x10(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x14(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x18(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x1c(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x20(%rsp),%rdi
call   1050 <getint@plt>
cltq
cmp    %rax,(%rbx)
je     11fa <main+0xca>
lea    0x24(%rsp),%rdi
call   1050 <getint@plt>
mov    (%rsp),%esi
lea    0xdfc(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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