#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(void) {
  int kind[10], i, j, temp, num;
  while (1) {
    scanf("%d", &num);
    if (num == 0)
      break;
    for (i = 0; i < 10; i++)
      kind[i] = 0;
    for (i = 0; i < num; i++) {
      scanf("%d", &temp);
      kind[temp]++;
    }
    for (i = 0; i < 10; i++) {
      if (kind[i] == 0) {
        printf("-\n");
      } else {
        for (j = 0; j < kind[i]; j++)
          printf("*");
        printf("\n");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x40(%rbp)
jne    114e <main+0x2e>
jmp    1240 <main+0x120>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1179 <main+0x59>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1155 <main+0x35>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    11b9 <main+0x99>
lea    0xe6d(%rip),%rdi
lea    -0x3c(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1180 <main+0x60>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    123b <main+0x11b>
movslq -0x34(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
jne    11ea <main+0xca>
lea    0xe23(%rip),%rdi
call   1030 <printf@plt>
jmp    1228 <main+0x108>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
movslq -0x34(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jge    121c <main+0xfc>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11f1 <main+0xd1>
lea    0xde1(%rip),%rdi
call   1030 <printf@plt>
jmp    122d <main+0x10d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c0 <main+0xa0>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     122b <main+0xfb>
lea    0xe9e(%rip),%r13
lea    0xc(%rsp),%r14
lea    0xe95(%rip),%r15
lea    0x8(%rsp),%r12
jmp    1197 <main+0x67>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     122b <main+0xfb>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
test   %eax,%eax
jle    11de <main+0xae>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jl     11c0 <main+0x90>
xor    %ebx,%ebx
jmp    1206 <main+0xd6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
call   1040 <puts@plt>
add    $0x1,%rbx
cmp    $0xa,%rbx
je     1180 <main+0x50>
mov    0x10(%rsp,%rbx,4),%ebp
test   %ebp,%ebp
je     11f0 <main+0xc0>
jle    121f <main+0xef>
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11f8 <main+0xc8>
xor    %eax,%eax
add    $0x38,%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 = [3 x i8] c"-\0A\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
br label %7
7: ; preds = %0, %69
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %70
12: ; preds = %7
store i32 0, i32* %3
br label %13
13: ; preds = %20, %12
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %18
store i32 0, i32* %19
br label %20
20: ; preds = %16
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %13
23: ; preds = %13
store i32 0, i32* %3
br label %24
24: ; preds = %35, %23
%25 = load i32, i32* %3
%26 = load i32, i32* %6
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = add nsw i32 %33, 1
store i32 %34, i32* %32
br label %35
35: ; preds = %28
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %24
38: ; preds = %24
store i32 0, i32* %3
br label %39
39: ; preds = %66, %38
%40 = load i32, i32* %3
%41 = icmp slt i32 %40, 10
br i1 %41, label %42, label %69
42: ; preds = %39
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %65
50: ; preds = %42
store i32 0, i32* %4
br label %51
51: ; preds = %60, %50
%52 = load i32, i32* %4
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = icmp slt i32 %52, %56
br i1 %57, label %58, label %63
58: ; preds = %51
%59 = call i32 @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 %51
63: ; preds = %51
%64 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %65
65: ; preds = %63, %48
br label %66
66: ; preds = %65
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 1
store i32 %68, i32* %3
br label %39
69: ; preds = %39
br label %7
70: ; preds = %11
ret i32 0
}

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