#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, i, box[100], bound = 0, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &box[i]);
    if (box[i] > bound) {
      bound = box[i];
    }
  }
  for (i = bound; i > 0; i--) {
    for (j = 0; j < n; j++) {
      if (box[j] >= i) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b8 <main+0x98>
movslq -0xc(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe88(%rip),%rdi
call   1040 <scanf@plt>
movslq -0xc(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
cmp    -0x1a4(%rbp),%eax
jle    11a5 <main+0x85>
movslq -0xc(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
mov    %eax,-0x1a4(%rbp)
jmp    11aa <main+0x8a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <main+0x33>
mov    -0x1a4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    124b <main+0x12b>
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1231 <main+0x111>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
cmp    -0xc(%rbp),%eax
jl     120c <main+0xec>
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
jmp    1218 <main+0xf8>
lea    0xdf2(%rip),%rdi
call   1030 <printf@plt>
jmp    121d <main+0xfd>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    11d5 <main+0xb5>
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11c1 <main+0xa1>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1a8,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ec <main+0xcc>
xor    %r15d,%r15d
lea    0x10(%rsp),%rbx
lea    0xea8(%rip),%r14
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%rbx),%eax
cmp    %ebp,%eax
cmovg  %eax,%ebp
add    $0x1,%r15
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r15
jl     1160 <main+0x40>
test   %ebp,%ebp
jle    11ec <main+0xcc>
nopl   0x0(%rax,%rax,1)
test   %eax,%eax
jle    11d0 <main+0xb0>
xor    %ebx,%ebx
jmp    11b3 <main+0x93>
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jge    11d0 <main+0xb0>
mov    $0x20,%edi
cmp    %ebp,0x10(%rsp,%rbx,4)
jl     11a0 <main+0x80>
mov    $0x2a,%edi
jmp    11a0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%ebp
jl     11ec <main+0xcc>
add    $0xffffffff,%ebp
mov    0xc(%rsp),%eax
test   %eax,%eax
jg     1194 <main+0x74>
jmp    11d0 <main+0xb0>
xor    %eax,%eax
add    $0x1a8,%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"*\00"
@.str.2 = [2 x i8] c" \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 i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %8
8: ; preds = %29, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %5
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %28
23: ; preds = %12
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %5
br label %28
28: ; preds = %23, %12
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %8
32: ; preds = %8
%33 = load i32, i32* %5
store i32 %33, i32* %3
br label %34
34: ; preds = %59, %32
%35 = load i32, i32* %3
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %62
37: ; preds = %34
store i32 0, i32* %6
br label %38
38: ; preds = %54, %37
%39 = load i32, i32* %6
%40 = load i32, i32* %2
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %57
42: ; preds = %38
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = load i32, i32* %3
%48 = icmp sge i32 %46, %47
br i1 %48, label %49, label %51
49: ; preds = %42
%50 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %53
51: ; preds = %42
%52 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
br label %54
54: ; preds = %53
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
br label %38
57: ; preds = %38
%58 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %59
59: ; preds = %57
%60 = load i32, i32* %3
%61 = add nsw i32 %60, -1
store i32 %61, i32* %3
br label %34
62: ; preds = %34
ret i32 0
}

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