#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 */
int EOF;
int EXIT_SUCCESS;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int cnt = 0, numbers[1000];
  int c;
  while (scanf("%d", &numbers[cnt++]) == 1) {
  }
  while ((c = getchar()) != EOF && c != '\n') {
  }
  for (int i = 2; i <= cnt; i++) {
    printf("%d ", numbers[cnt - i]);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
lea    -0xfb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe95(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    117e <main+0x4e>
jmp    1149 <main+0x19>
jmp    1183 <main+0x53>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0xfb4(%rbp)
xor    %eax,%eax
mov    0x2e4d(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xfb9(%rbp)
je     11b9 <main+0x89>
cmpl   $0xa,-0xfb4(%rbp)
setne  %al
mov    %al,-0xfb9(%rbp)
mov    -0xfb9(%rbp),%al
test   $0x1,%al
jne    11cc <main+0x9c>
jmp    11d1 <main+0xa1>
jmp    1183 <main+0x53>
movl   $0x2,-0xfb8(%rbp)
mov    -0xfb8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     121c <main+0xec>
mov    -0x8(%rbp),%eax
sub    -0xfb8(%rbp),%eax
cltq
mov    -0xfb0(%rbp,%rax,4),%esi
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
mov    -0xfb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfb8(%rbp)
jmp    11db <main+0xab>
mov    0x2db5(%rip),%rax
mov    (%rax),%eax
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xfa8,%rsp
xor    %r15d,%r15d
mov    %rsp,%rbx
lea    0xeb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%r15d
add    $0x4,%rbx
cmp    $0x1,%eax
je     1150 <main+0x20>
lea    0x1(%r15),%ebp
mov    0x2e75(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1190 <main+0x60>
cmp    (%rbx),%eax
jne    1180 <main+0x50>
cmp    $0x1,%r15d
je     11c5 <main+0x95>
movslq %r15d,%rax
lea    (%rsp,%rax,4),%r15
mov    %ebp,%ebp
neg    %rbp
mov    $0xfffffffffffffffe,%rbx
lea    0xe53(%rip),%r14
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    %rbx,%rbp
jne    11b0 <main+0x80>
mov    0x2e0c(%rip),%rax
mov    (%rax),%eax
add    $0xfa8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
@.str.1 = [4 x i8] c"%d \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %9
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %6
br label %6
14: ; preds = %6
br label %15
15: ; preds = %24, %14
%16 = call i32 (...) @getchar()
store i32 %16, i32* %4
%17 = load i32, i32* @EOF
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 10
br label %22
22: ; preds = %19, %15
%23 = phi i1 [ false, %15 ], [ %21, %19 ]
br i1 %23, label %24, label %25
24: ; preds = %22
br label %15
25: ; preds = %22
store i32 2, i32* %5
br label %26
26: ; preds = %38, %25
%27 = load i32, i32* %5
%28 = load i32, i32* %2
%29 = icmp sle i32 %27, %28
br i1 %29, label %30, label %41
30: ; preds = %26
%31 = load i32, i32* %2
%32 = load i32, i32* %5
%33 = sub nsw i32 %31, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %30
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %26
41: ; preds = %26
%42 = load i32, i32* @EXIT_SUCCESS
ret i32 %42
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
@.str.1 = [4 x i8] c"%d \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [1000 x i32]
%2 = bitcast [1000 x i32]* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ %5, %3 ], [ 0, %0 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds [1000 x i32], [1000 x i32]* %1, i64 0, i64 %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %11
%12 = call i32 (...) @getchar()
%13 = load i32, i32* @EOF
%14 = icmp ne i32 %12, %13
%15 = icmp ne i32 %12, 10
%16 = and i1 %15, %14
br i1 %16, label %11, label %17
17: ; preds = %11
%18 = icmp eq i32 %10, 0
br i1 %18, label %24, label %19
19: ; preds = %17
%20 = shl i64 %5, 32
%21 = ashr exact i64 %20, 32
%22 = add i64 %4, 2
%23 = and i64 %22, 4294967295
br label %26
24: ; preds = %26, %17
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
26: ; preds = %19, %26
%27 = phi i64 [ 2, %19 ], [ %32, %26 ]
%28 = sub nsw i64 %21, %27
%29 = getelementptr inbounds [1000 x i32], [1000 x i32]* %1, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = add nuw nsw i64 %27, 1
%33 = icmp eq i64 %32, %23
br i1 %33, label %24, label %26
}