#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 box[100000], n = 0, i, j;
  while (1) {
    scanf("%d", &box[n]);
    if (box[n] < 0 || box[n] > 9) {
      break;
    }
    n++;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n - i - 1; j++) {
      printf(" ");
    }
    for (j = 0; j <= i; j++) {
      printf("%d", box[i]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61aa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x61a94(%rbp)
movslq -0x61a94(%rbp),%rax
lea    -0x61a90(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea8(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x61a94(%rbp),%rax
cmpl   $0x0,-0x61a90(%rbp,%rax,4)
jl     1187 <main+0x67>
movslq -0x61a94(%rbp),%rax
cmpl   $0x9,-0x61a90(%rbp,%rax,4)
09
jle    118c <main+0x6c>
jmp    11a0 <main+0x80>
mov    -0x61a94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a94(%rbp)
jmp    113c <main+0x1c>
movl   $0x0,-0x61a98(%rbp)
mov    -0x61a98(%rbp),%eax
cmp    -0x61a94(%rbp),%eax
jge    1273 <main+0x153>
movl   $0x0,-0x61a9c(%rbp)
mov    -0x61a9c(%rbp),%eax
mov    -0x61a94(%rbp),%ecx
sub    -0x61a98(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1205 <main+0xe5>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x61a9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a9c(%rbp)
jmp    11c6 <main+0xa6>
movl   $0x0,-0x61a9c(%rbp)
mov    -0x61a9c(%rbp),%eax
cmp    -0x61a98(%rbp),%eax
jg     1251 <main+0x131>
movslq -0x61a98(%rbp),%rax
mov    -0x61a90(%rbp,%rax,4),%esi
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x61a9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a9c(%rbp)
jmp    120f <main+0xef>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x61a98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a98(%rbp)
jmp    11aa <main+0x8a>
xor    %eax,%eax
add    $0x61aa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x61a98,%rsp
xor    %ebp,%ebp
lea    0xeb6(%rip),%r14
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rbx
lea    (%rsp,%rbp,1),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
lea    0x1(%rbx),%rax
add    $0x4,%rbp
cmpl   $0xa,0x10(%rsp,%rbx,4)
jb     1150 <main+0x20>
cmp    $0x1,%eax
je     1210 <main+0xe0>
lea    -0x2(%rax),%rcx
add    $0xffffffffffffffff,%rax
mov    %eax,%eax
mov    %rax,(%rsp)
mov    $0x1,%r14d
lea    0xe6a(%rip),%rbx
mov    %rcx,0x8(%rsp)
mov    %ecx,%r15d
xor    %ebp,%ebp
mov    0x8(%rsp),%rax
sub    %ebp,%eax
mov    %r15d,%r12d
mov    %r14d,%r13d
test   %eax,%eax
jle    11e0 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r12d
jne    11c0 <main+0x90>
mov    %r14d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x10(%rsp,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%r13d
jne    11e0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    $0x1,%r14d
add    $0xffffffff,%r15d
cmp    (%rsp),%rbp
jne    11a0 <main+0x70>
xor    %eax,%eax
add    $0x61a98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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