#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 a[1000], k, i = 0;
  scanf("%d", &k);
  do {
    scanf("%d", &a[i]);
    i++;
  } while (i < k);
  i = i - 1;
  do {
    printf("\n%d", a[i]);
    i--;
  } while (i != -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xfb8(%rbp)
lea    0xebe(%rip),%rdi
lea    -0xfb4(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0xfb8(%rbp),%rax
lea    -0xfb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe96(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xfb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfb8(%rbp)
mov    -0xfb8(%rbp),%eax
cmp    -0xfb4(%rbp),%eax
jl     114f <main+0x2f>
mov    -0xfb8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xfb8(%rbp)
movslq -0xfb8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%esi
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
mov    -0xfb8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xfb8(%rbp)
cmpl   $0xffffffff,-0xfb8(%rbp)
jne    11a0 <main+0x80>
xor    %eax,%eax
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xfb0,%rsp
lea    0xece(%rip),%r14
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
xor    %ebx,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rsp,%rbx,1),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
add    $0x1,%r15
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r15
jl     1150 <main+0x30>
lea    0xe87(%rip),%r14
nopl   0x0(%rax)
mov    0xc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xfffffffffffffffc,%rbx
jne    1180 <main+0x60>
xor    %eax,%eax
add    $0xfb0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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