#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 /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, k = 0;
  scanf("%d", &n);
  int help = n;
  int a[1000];
  for (i = 0; i < n; i++) {
    scanf("%d", &k);
    a[i + 1] = k;
  }
  a[n + 1] = '\0';
  do {
    printf("%d\n", a[help]);
    help--;
  } while (help > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1192 <main+0x72>
lea    0xe97(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0xfc0(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x0,-0xfc0(%rbp,%rax,4)
movslq -0x14(%rbp),%rax
mov    -0xfc0(%rbp,%rax,4),%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     11a5 <main+0x85>
xor    %eax,%eax
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xfb8,%rsp
movl   $0x0,0x8(%rsp)
lea    0xec3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%r12
test   %r12,%r12
jle    1183 <main+0x63>
xor    %ebx,%ebx
lea    0xea6(%rip),%r14
lea    0x8(%rsp),%r15
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x14(%rsp,%rbx,4)
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1160 <main+0x40>
jmp    1186 <main+0x66>
mov    %r12d,%eax
cltq
movl   $0x0,0x14(%rsp,%rax,4)
add    $0x1,%r12
lea    0xe68(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp,%r12,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%r12
cmp    $0x1,%r12
jg     11a0 <main+0x80>
xor    %eax,%eax
add    $0xfb8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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