#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, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int length[15], i = 0, x = 0, p = 0;
  scanf("%d", &p);
  while (i < 15) {
    length[i] = 0;
    i++;
  }
  while (p > 0) {
    x = p % 10;
    length[x]++;
    p = p / 10;
  }
  for (i = 0; i < 15; i++) {
    if (length[i] != 0) {
      printf("\n%d : %d", i, length[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x4c(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xf,-0x44(%rbp)
jge    1178 <main+0x58>
movslq -0x44(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1154 <main+0x34>
jmp    117d <main+0x5d>
cmpl   $0x0,-0x4c(%rbp)
jle    11b7 <main+0x97>
mov    -0x4c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x4c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4c(%rbp)
jmp    117d <main+0x5d>
movl   $0x0,-0x44(%rbp)
cmpl   $0xf,-0x44(%rbp)
jge    1201 <main+0xe1>
movslq -0x44(%rbp),%rax
cmpl   $0x0,-0x40(%rbp,%rax,4)
je     11ee <main+0xce>
mov    -0x44(%rbp),%esi
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <main+0xd3>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11be <main+0x9e>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movl   $0x0,0xc(%rsp)
lea    0xed3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movups %xmm0,0x3c(%rsp)
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11aa <main+0x8a>
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %eax,%eax
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
addl   $0x1,0x10(%rsp,%rdi,4)
cmp    $0xa,%edx
jae    1170 <main+0x50>
mov    %eax,0xc(%rsp)
mov    0x10(%rsp),%edx
test   %edx,%edx
je     11aa <main+0x8a>
lea    0xe5d(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x14(%rsp),%edx
test   %edx,%edx
je     11c3 <main+0xa3>
lea    0xe47(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x18(%rsp),%edx
test   %edx,%edx
je     11dc <main+0xbc>
lea    0xe2e(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0x1c(%rsp),%edx
test   %edx,%edx
je     11f5 <main+0xd5>
lea    0xe15(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
test   %edx,%edx
je     120e <main+0xee>
lea    0xdfc(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x24(%rsp),%edx
test   %edx,%edx
je     1227 <main+0x107>
lea    0xde3(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    0x28(%rsp),%edx
test   %edx,%edx
je     1240 <main+0x120>
lea    0xdca(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    0x2c(%rsp),%edx
test   %edx,%edx
je     1259 <main+0x139>
lea    0xdb1(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    0x30(%rsp),%edx
test   %edx,%edx
je     1272 <main+0x152>
lea    0xd98(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0x34(%rsp),%edx
test   %edx,%edx
je     128b <main+0x16b>
lea    0xd7f(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

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

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