#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 number[100] = {0};
  int integer = 0;
  scanf("%d", &integer);
  while (integer != 0) {
    number[integer % 10]++;
    integer = integer / 10;
  }
  for (integer = 0; integer < 10; integer++) {
    printf("\n %d --> %d\n", integer, number[integer]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
movl   $0x0,-0x1a4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x1a4(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x1a4(%rbp)
je     11ba <main+0x8a>
mov    -0x1a4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1a4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1a4(%rbp)
jmp    1172 <main+0x42>
movl   $0x0,-0x1a4(%rbp)
cmpl   $0xa,-0x1a4(%rbp)
jge    1205 <main+0xd5>
mov    -0x1a4(%rbp),%esi
movslq -0x1a4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%edx
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    11c4 <main+0x94>
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x1a8,%rsp
lea    0x10(%rsp),%rdi
xor    %ebp,%ebp
mov    $0x190,%edx
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x0,0xc(%rsp)
lea    0xea5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11a1 <main+0x71>
nopl   (%rax)
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
movslq %esi,%rdx
addl   $0x1,0x10(%rsp,%rdx,4)
add    $0x9,%ecx
cmp    $0x13,%ecx
jae    1170 <main+0x40>
movl   $0x0,0xc(%rsp)
lea    0xe53(%rip),%rbx
movslq %ebp,%rsi
mov    0x10(%rsp,%rsi,4),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ebp
mov    %ebp,0xc(%rsp)
cmp    $0x9,%eax
jl     11b0 <main+0x80>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"\0A %d --> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [100 x i32]* %2 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)
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = srem i32 %10, 10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 10
store i32 %17, i32* %3
br label %6
18: ; preds = %6
store i32 0, i32* %3
br label %19
19: ; preds = %29, %18
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = load i32, i32* %3
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %27)
br label %29
29: ; preds = %22
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %19
32: ; preds = %19
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"\0A %d --> %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca i32
%3 = bitcast [100 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%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 eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %9, %0
store i32 0, i32* %2
br label %19
9: ; preds = %0, %9
%10 = phi i32 [ %16, %9 ], [ %6, %0 ]
%11 = srem i32 %10, 10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
%16 = sdiv i32 %10, 10
%17 = add i32 %10, 9
%18 = icmp ult i32 %17, 19
br i1 %18, label %8, label %9
19: ; preds = %8, %19
%20 = phi i32 [ 0, %8 ], [ %26, %19 ]
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %23)
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = icmp slt i32 %25, 9
br i1 %27, label %19, label %28
28: ; preds = %19
ret i32 0
}