#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int arr[5555], n, i, j, k;
  scanf("%d", &n);
  for (i = 0; i <= n - 1; i++) {
    scanf("%d", &arr[i]);
  }
  for (j = 0; j <= n - 1; j++) {
    printf("\n");
    {
      for (k = 0; k <= j; k++)
        printf("%d ", arr[n - k - 1]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x56e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x56d4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x56d8(%rbp)
mov    -0x56d8(%rbp),%eax
mov    -0x56d4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     119b <main+0x7b>
movslq -0x56d8(%rbp),%rax
lea    -0x56d0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x56d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x56d8(%rbp)
jmp    114f <main+0x2f>
movl   $0x0,-0x56dc(%rbp)
mov    -0x56dc(%rbp),%eax
mov    -0x56d4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1239 <main+0x119>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x56e0(%rbp)
mov    -0x56e0(%rbp),%eax
cmp    -0x56dc(%rbp),%eax
jg     1220 <main+0x100>
mov    -0x56d4(%rbp),%eax
sub    -0x56e0(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x56d0(%rbp,%rax,4),%esi
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x56e0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x56e0(%rbp)
jmp    11d4 <main+0xb4>
jmp    1225 <main+0x105>
mov    -0x56dc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x56dc(%rbp)
jmp    11a5 <main+0x85>
xor    %eax,%eax
add    $0x56e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x56e8,%rsp
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11e6 <main+0xb6>
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
lea    0xe99(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     1170 <main+0x40>
test   %eax,%eax
jle    11e6 <main+0xb6>
mov    $0x1,%ebx
lea    0xe66(%rip),%r14
xor    %r15d,%r15d
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%ebp
nop
mov    0xc(%rsp),%eax
add    %ebp,%eax
cltq
mov    0x10(%rsp,%rax,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%rbp,1),%eax
add    $0xffffffff,%eax
mov    %ebp,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%ebp
cmp    $0xffffffff,%eax
jne    11b0 <main+0x80>
add    $0x1,%r15d
add    $0x1,%ebx
cmp    0xc(%rsp),%r15d
jl     11a0 <main+0x70>
xor    %eax,%eax
add    $0x56e8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [5555 x i32]
%2 = alloca i32
%3 = bitcast [5555 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)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %10, label %38
8: ; preds = %10
%9 = icmp sgt i32 %15, 0
br i1 %9, label %18, label %38
10: ; preds = %0, %10
%11 = phi i64 [ %14, %10 ], [ 0, %0 ]
%12 = getelementptr inbounds [5555 x i32], [5555 x i32]* %1, i64 0, i64 %11
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = add nuw nsw i64 %11, 1
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %14, %16
br i1 %17, label %10, label %8
18: ; preds = %8, %33
%19 = phi i32 [ %37, %33 ], [ 1, %8 ]
%20 = phi i32 [ %34, %33 ], [ 0, %8 ]
%21 = call i32 @putchar(i32 10)
br label %22
22: ; preds = %18, %22
%23 = phi i32 [ 0, %18 ], [ %31, %22 ]
%24 = load i32, i32* %2
%25 = xor i32 %23, -1
%26 = add i32 %24, %25
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5555 x i32], [5555 x i32]* %1, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = add nuw nsw i32 %23, 1
%32 = icmp eq i32 %31, %19
br i1 %32, label %33, label %22
33: ; preds = %22
%34 = add nuw nsw i32 %20, 1
%35 = load i32, i32* %2
%36 = icmp slt i32 %34, %35
%37 = add nuw i32 %19, 1
br i1 %36, label %18, label %38
38: ; preds = %33, %0, %8
ret i32 0
}