#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 num, cur, digits[10], i;
  for (i = 0; i < 10; i++)
    digits[i] = 0;
  scanf("%d", &num);
  for (; num > 0; num /= 10) {
    cur = num % 10;
    digits[cur]++;
  }
  for (i = 0; i < 10; i++) {
    if (digits[i] > 0)
      printf("%d.\t%d\n", i, digits[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    115a <main+0x3a>
movslq -0x44(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1136 <main+0x16>
lea    0xe9f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    11a4 <main+0x84>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    116a <main+0x4a>
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    11ee <main+0xce>
movslq -0x44(%rbp),%rax
cmpl   $0x0,-0x40(%rbp,%rax,4)
jle    11db <main+0xbb>
mov    -0x44(%rbp),%esi
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
jmp    11e0 <main+0xc0>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11ab <main+0x8b>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
lea    0xebf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    119a <main+0x7a>
mov    $0xcccccccd,%ecx
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    1160 <main+0x40>
mov    %eax,0xc(%rsp)
mov    0x10(%rsp),%edx
test   %edx,%edx
jle    119a <main+0x7a>
lea    0xe70(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x14(%rsp),%edx
test   %edx,%edx
jle    11b3 <main+0x93>
lea    0xe5a(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x18(%rsp),%edx
test   %edx,%edx
jle    11cc <main+0xac>
lea    0xe41(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0x1c(%rsp),%edx
test   %edx,%edx
jle    11e5 <main+0xc5>
lea    0xe28(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
test   %edx,%edx
jle    11fe <main+0xde>
lea    0xe0f(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x24(%rsp),%edx
test   %edx,%edx
jle    1217 <main+0xf7>
lea    0xdf6(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    0x28(%rsp),%edx
test   %edx,%edx
jle    1230 <main+0x110>
lea    0xddd(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    0x2c(%rsp),%edx
test   %edx,%edx
jle    1249 <main+0x129>
lea    0xdc4(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    0x30(%rsp),%edx
test   %edx,%edx
jle    1262 <main+0x142>
lea    0xdab(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0x34(%rsp),%edx
test   %edx,%edx
jle    127b <main+0x15b>
lea    0xd92(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

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