#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__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n;
  scanf("%d\n", &n);
  int *vetor = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &vetor[i]);
  }
  for (i = (n - 1); i >= 0; --i) {
    if (i == 0) {
      printf("%d\n", vetor[i]);
    } else {
      printf("%d ", vetor[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119e <main+0x6e>
mov    -0x18(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe79(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <main+0x39>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1201 <main+0xd1>
cmpl   $0x0,-0x8(%rbp)
jne    11d7 <main+0xa7>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
jmp    11ee <main+0xbe>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <main+0xc3>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11a7 <main+0x77>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%r14
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
shl    $0x2,%edi
call   1040 <malloc@plt>
cmpl   $0x0,0xc(%rsp)
jle    11e9 <main+0xb9>
mov    %rax,%r15
xor    %r13d,%r13d
lea    0xe8f(%rip),%r12
mov    %rax,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%r13
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r13
jl     1180 <main+0x50>
mov    %eax,%ebx
test   %ebx,%ebx
jle    11e9 <main+0xb9>
add    $0xffffffffffffffff,%rbx
xor    %r12d,%r12d
lea    0xe56(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %ebx,%ebx
mov    %ebx,%eax
cmove  %r12,%rax
mov    %r13,%rdi
cmove  %r14,%rdi
mov    (%r15,%rax,4),%esi
call   1030 <printf@plt>
lea    -0x1(%rbx),%rax
add    $0x1,%rbx
cmp    $0x1,%rbx
mov    %rax,%rbx
ja     11c0 <main+0x90>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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