#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 atoi(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
char *strtok(char *, char *);
int main() {
  int n, i;
  int nums[100];
  char str[10000];
  char *p;
  scanf("%d\n", &n);
  i = n - 1;
  gets(str);
  p = strtok(str, " ");
  nums[i] = atoi(p);
  while (p != NULL) {
    p = strtok(NULL, " ");
    if (p != NULL) {
      i--;
      nums[i] = atoi(p);
    }
  }
  for (i = 0; i < n; i++) {
    printf("%d", nums[i]);
    if (i != n - 1)
      printf(" ");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x28c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    -0x28b0(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x28b0(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x28b8(%rbp)
mov    -0x28b8(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
cmpq   $0x0,-0x28b8(%rbp)
je     1214 <main+0xc4>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe31(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x28b8(%rbp)
cmpq   $0x0,-0x28b8(%rbp)
je     120f <main+0xbf>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x28b8(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
jmp    11ba <main+0x6a>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1272 <main+0x122>
movslq -0xc(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     125f <main+0x10f>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1264 <main+0x114>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    121b <main+0xcb>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28b8,%rsp
lea    0xe8f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
movslq 0xc(%rsp),%r14
lea    0x1a0(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xe6d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strtok@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,0xc(%rsp,%r14,4)
test   %rbx,%rbx
je     11fd <main+0x9d>
lea    0xe49(%rip),%rsi
xor    %edi,%edi
call   1070 <strtok@plt>
test   %rax,%rax
je     11fd <main+0x9d>
add    $0xfffffffe,%r14d
movslq %r14d,%rcx
lea    (%rsp,%rcx,4),%rbx
add    $0x10,%rbx
lea    0xe27(%rip),%r14
nopl   (%rax)
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,(%rbx)
xor    %edi,%edi
mov    %r14,%rsi
call   1070 <strtok@plt>
add    $0xfffffffffffffffc,%rbx
test   %rax,%rax
jne    11e0 <main+0x80>
cmpl   $0x0,0xc(%rsp)
jle    1245 <main+0xe5>
lea    0xdfb(%rip),%r14
xor    %ebx,%ebx
jmp    121b <main+0xbb>
nop
add    $0x1,%rbx
cltq
cmp    %rax,%rbx
jge    1245 <main+0xe5>
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    %rcx,%rbx
je     1210 <main+0xb0>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
jmp    1210 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28b8,%rsp
pop    %rbx
pop    %r14
ret

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

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