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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <getint@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e64(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x29(%rbp)
je     119c <main+0x7c>
mov    -0x1c(%rbp),%eax
cmp    -0x8(%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    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1164 <main+0x44>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f7 <main+0xd7>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c6 <main+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%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 <getint@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>
mov    (%rsp),%esi
lea    0xe98(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i32, i64 %7
store i64 %7, i64* %4
store i32 0, i32* %5
br label %10
10: ; preds = %24, %0
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = call i64 @getint(i32* %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* %5
%19 = load i32, i32* %2
%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* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %10
27: ; preds = %21
store i32 0, i32* %5
br label %28
28: ; preds = %38, %27
%29 = load i32, i32* %5
%30 = load i32, i32* %2
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %41
32: ; preds = %28
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %9, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %32
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %28
41: ; preds = %28
store i32 0, i32* %1
%42 = load i8*, i8** %3
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
br label %2
2: ; preds = %2, %0
%3 = phi i64 [ %10, %2 ], [ 0, %0 ]
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 %3
%5 = call i64 @getint(i32* %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 i32], [3 x i32]* %1, i64 0, i64 0
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}