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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x56f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x56e4(%rbp)
mov    -0x56e4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1197 <main+0x77>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
sub    -0x56e4(%rbp),%eax
cltq
lea    -0x56e0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe82(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x56e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x56e4(%rbp)
jmp    114c <main+0x2c>
movl   $0x0,-0x56e8(%rbp)
mov    -0x56e8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121e <main+0xfe>
movl   $0x0,-0x56ec(%rbp)
mov    -0x56ec(%rbp),%eax
cmp    -0x56e8(%rbp),%eax
jg     11fc <main+0xdc>
movslq -0x56ec(%rbp),%rax
mov    -0x56e0(%rbp,%rax,4),%esi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x56ec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x56ec(%rbp)
jmp    11ba <main+0x9a>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x56e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x56e8(%rbp)
jmp    11a1 <main+0x81>
xor    %eax,%eax
add    $0x56f0,%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>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11f0 <main+0xc0>
xor    %ebp,%ebp
mov    $0xffffffff,%ebx
lea    0xe98(%rip),%r14
nopl   0x0(%rax,%rax,1)
add    %ebx,%eax
cltq
lea    (%rsp,%rax,4),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%eax
add    $0xffffffff,%ebx
cmp    %eax,%ebp
jl     1170 <main+0x40>
test   %eax,%eax
jle    11f0 <main+0xc0>
mov    $0x1,%ebx
lea    0xe61(%rip),%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x10(%rsp,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11c0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
add    $0x1,%rbx
cmp    0xc(%rsp),%r15d
jl     11b0 <main+0x80>
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 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5555 x 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* %2)
store i32 0, i32* %4
br label %8
8: ; preds = %20, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [5555 x i32], [5555 x i32]* %3, i64 0, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %8
23: ; preds = %8
store i32 0, i32* %5
br label %24
24: ; preds = %44, %23
%25 = load i32, i32* %5
%26 = load i32, i32* %2
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %47
28: ; preds = %24
store i32 0, i32* %6
br label %29
29: ; preds = %39, %28
%30 = load i32, i32* %6
%31 = load i32, i32* %5
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %42
33: ; preds = %29
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [5555 x i32], [5555 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %33
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %29
42: ; preds = %29
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %24
47: ; preds = %24
ret i32 0
}

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