#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, s, i, a;
  int arr[500];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  s = i - 1;
  i = 0;
  while (i < s) {
    a = arr[i];
    arr[i] = arr[s];
    arr[s] = a;
    i++;
    s--;
  }
  for (i = 0; i < n; i++) {
    printf("%d\n", arr[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1181 <main+0x61>
movslq -0x10(%rbp),%rax
lea    -0x7f0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe92(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <main+0x29>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e6 <main+0xc6>
movslq -0x10(%rbp),%rax
mov    -0x7f0(%rbp,%rax,4),%eax
mov    %eax,-0x14(%rbp)
movslq -0xc(%rbp),%rax
mov    -0x7f0(%rbp,%rax,4),%ecx
movslq -0x10(%rbp),%rax
mov    %ecx,-0x7f0(%rbp,%rax,4)
mov    -0x14(%rbp),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x7f0(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1191 <main+0x71>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121e <main+0xfe>
movslq -0x10(%rbp),%rax
mov    -0x7f0(%rbp,%rax,4),%esi
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ed <main+0xcd>
mov    -0x4(%rbp),%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11da <main+0xba>
lea    0x10(%rsp),%rbx
xor    %r15d,%r15d
lea    0xea9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%r15
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r15
jl     1160 <main+0x40>
cmp    $0x2,%r15d
jl     11b2 <main+0x92>
add    $0xfffffffffffffffe,%r15
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    0x10(%rsp,%rcx,4),%edx
mov    0x14(%rsp,%r15,4),%esi
mov    %esi,0x10(%rsp,%rcx,4)
mov    %edx,0x14(%rsp,%r15,4)
add    $0x1,%rcx
lea    -0x1(%r15),%rdx
cmp    %r15,%rcx
mov    %rdx,%r15
jl     1190 <main+0x70>
test   %eax,%eax
jle    11da <main+0xba>
xor    %ebx,%ebx
lea    0xe44(%rip),%r14
nop
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     11c0 <main+0xa0>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
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 [500 x i32]
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %4
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %8
20: ; preds = %8
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %3
store i32 0, i32* %4
br label %23
23: ; preds = %27, %20
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %47
27: ; preds = %23
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 %29
%31 = load i32, i32* %30
store i32 %31, i32* %5
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 %37
store i32 %35, i32* %38
%39 = load i32, i32* %5
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 %41
store i32 %39, i32* %42
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
%45 = load i32, i32* %3
%46 = add nsw i32 %45, -1
store i32 %46, i32* %3
br label %23
47: ; preds = %23
store i32 0, i32* %4
br label %48
48: ; preds = %58, %47
%49 = load i32, i32* %4
%50 = load i32, i32* %2
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %61
52: ; preds = %48
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [500 x i32], [500 x i32]* %6, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %52
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %48
61: ; preds = %48
%62 = load i32, i32* %1
ret i32 %62
}

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 [500 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [500 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %14, label %43
8: ; preds = %14
%9 = trunc i64 %18 to i32
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = and i64 %18, 4294967295
%13 = add nsw i64 %12, -1
br label %24
14: ; preds = %0, %14
%15 = phi i64 [ %18, %14 ], [ 0, %0 ]
%16 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, 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 %8
22: ; preds = %24, %8
%23 = icmp sgt i32 %19, 0
br i1 %23, label %34, label %43
24: ; preds = %11, %24
%25 = phi i64 [ 0, %11 ], [ %31, %24 ]
%26 = phi i64 [ %13, %11 ], [ %32, %24 ]
%27 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %25
%28 = load i32, i32* %27
%29 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %26
%30 = load i32, i32* %29
store i32 %30, i32* %27
store i32 %28, i32* %29
%31 = add nuw nsw i64 %25, 1
%32 = add nsw i64 %26, -1
%33 = icmp slt i64 %31, %32
br i1 %33, label %24, label %22
34: ; preds = %22, %34
%35 = phi i64 [ %39, %34 ], [ 0, %22 ]
%36 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = add nuw nsw i64 %35, 1
%40 = load i32, i32* %1
%41 = sext i32 %40 to i64
%42 = icmp slt i64 %39, %41
br i1 %42, label %34, label %43
43: ; preds = %34, %0, %22
ret i32 0
}