#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;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int a[66536], i, n;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    i--;
    printf("%d", a[i]);
    for (i--; i >= 0; i--) {
      printf(" %d", a[i]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40fc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec1(%rip),%rdi
lea    -0x40fb8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
je     1237 <main+0x117>
movl   $0x0,-0x40fb4(%rbp)
mov    -0x40fb4(%rbp),%eax
cmp    -0x40fb8(%rbp),%eax
jge    11ad <main+0x8d>
movslq -0x40fb4(%rbp),%rax
lea    -0x40fb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe6d(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x40fb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40fb4(%rbp)
jmp    1166 <main+0x46>
mov    -0x40fb4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40fb4(%rbp)
movslq -0x40fb4(%rbp),%rax
mov    -0x40fb0(%rbp,%rax,4),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40fb4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40fb4(%rbp)
cmpl   $0x0,-0x40fb4(%rbp)
jl     1224 <main+0x104>
movslq -0x40fb4(%rbp),%rax
mov    -0x40fb0(%rbp,%rax,4),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40fb4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40fb4(%rbp)
jmp    11e7 <main+0xc7>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x40fc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40fb8,%rsp
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e8f(%rip),%r13
cmp    0x0(%r13),%rax
jne    1173 <main+0x43>
xor    %eax,%eax
add    $0x40fb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe87(%rip),%r12
lea    0xe7f(%rip),%r14
lea    0xc(%rsp),%r15
jmp    11ab <main+0x7b>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
cmp    0x0(%r13),%rax
je     115f <main+0x2f>
cmpl   $0x0,0xc(%rsp)
mov    $0x0,%ebp
jle    11dd <main+0xad>
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11c0 <main+0x90>
movslq %ebp,%rbx
mov    0xc(%rsp,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%ebx
jl     1190 <main+0x60>
add    $0xfffffffe,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbp
jb     1200 <main+0xd0>
jmp    1190 <main+0x60>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c" %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [66536 x i32]
%4 = alloca i32
%5 = bitcast [66536 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %46, label %10
10: ; preds = %2, %41
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10, %13
%14 = phi i64 [ %17, %13 ], [ 0, %10 ]
%15 = getelementptr inbounds [66536 x i32], [66536 x i32]* %3, i64 0, i64 %14
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = add nuw nsw i64 %14, 1
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %13, label %21
21: ; preds = %13
%22 = trunc i64 %17 to i32
br label %23
23: ; preds = %21, %10
%24 = phi i32 [ 0, %10 ], [ %22, %21 ]
%25 = add nsw i32 %24, -1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [66536 x i32], [66536 x i32]* %3, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = icmp sgt i32 %24, 1
br i1 %30, label %31, label %41
31: ; preds = %23
%32 = add nsw i32 %24, -2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %31, %34
%35 = phi i64 [ %33, %31 ], [ %39, %34 ]
%36 = getelementptr inbounds [66536 x i32], [66536 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = add nsw i64 %35, -1
%40 = icmp eq i64 %35, 0
br i1 %40, label %41, label %34
41: ; preds = %34, %23
%42 = call i32 @putchar(i32 10)
%43 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%44 = load i64, i64* @EOF
%45 = icmp eq i64 %43, %44
br i1 %45, label %46, label %10
46: ; preds = %41, %2
ret i32 0
}