#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 array[20];
  int count, c, length, i;
  scanf("%d", &length);
  for (i = 1; i <= length; i++) {
    scanf("%d", &array[i]);
  }
  for (count = 0; count <= length; count++) {
    printf("%d", count);
    for (c = 1; c <= length; c++) {
      if (array[c] == count) {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x6c(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jg     117b <main+0x5b>
movslq -0x70(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe98(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1146 <main+0x26>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jg     1200 <main+0xe0>
mov    -0x64(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jg     11e4 <main+0xc4>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
cmp    -0x64(%rbp),%eax
jne    11d1 <main+0xb1>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11a6 <main+0x86>
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1182 <main+0x62>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    117d <main+0x4d>
lea    0x14(%rsp),%r15
xor    %ebx,%ebx
lea    0xea0(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%rbx
add    $0x4,%r15
cmp    %rax,%rbx
jl     1160 <main+0x30>
test   %eax,%eax
js     11f3 <main+0xc3>
lea    0xe78(%rip),%r14
xor    %r15d,%r15d
jmp    11a8 <main+0x78>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
cmp    0xc(%rsp),%r15d
mov    %eax,%r15d
jge    11f3 <main+0xc3>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1190 <main+0x60>
xor    %ebx,%ebx
jmp    11dc <main+0xac>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %eax,%rcx
add    $0x1,%rbx
cmp    %rcx,%rbx
jge    1190 <main+0x60>
cmp    %r15d,0x14(%rsp,%rbx,4)
jne    11d0 <main+0xa0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
jmp    11d0 <main+0xa0>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 [20 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* %5)
store i32 1, i32* %6
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %8
20: ; preds = %8
store i32 0, i32* %3
br label %21
21: ; preds = %47, %20
%22 = load i32, i32* %3
%23 = load i32, i32* %5
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %50
25: ; preds = %21
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
store i32 1, i32* %4
br label %28
28: ; preds = %42, %25
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %45
32: ; preds = %28
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = load i32, i32* %3
%38 = icmp eq i32 %36, %37
br i1 %38, label %39, label %41
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, %32
br label %42
42: ; preds = %41
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %28
45: ; preds = %28
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %21
50: ; preds = %21
ret i32 0
}

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