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


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    1194 <main+0x74>
movslq -0x8(%rbp),%rax
lea    -0x30(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <getint@plt>
mov    0x2e5d(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    11a4 <main+0x84>
jmp    11c6 <main+0xa6>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x41>
mov    -0x4(%rbp),%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   1040 <getint@plt>
mov    0x2e9f(%rip),%rbx
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    (%rsp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x4(%rsp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x8(%rsp),%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0xc(%rsp),%esi
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x10(%rsp),%esi
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
lea    0x14(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x14(%rsp),%esi
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
lea    0x18(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x18(%rsp),%esi
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
lea    0x1c(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x1c(%rsp),%esi
lea    0xdb7(%rip),%rdi
call   1030 <printf@plt>
lea    0x20(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x20(%rsp),%esi
lea    0xd98(%rip),%rdi
call   1030 <printf@plt>
lea    0x24(%rsp),%rdi
call   1040 <getint@plt>
cmp    (%rbx),%rax
je     128c <main+0x16c>
mov    0x24(%rsp),%esi
lea    0xd79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%d\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 = %33, %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %25
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 i64 @getint(i32* %21)
%23 = load i64, i64* @EOF
%24 = icmp ne i64 %22, %23
br label %25
25: ; preds = %18, %15
%26 = phi i1 [ false, %15 ], [ %24, %18 ]
br i1 %26, label %27, label %36
27: ; preds = %25
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %27
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %15
36: ; preds = %25
%37 = load i32, i32* %1
ret i32 %37
}

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