#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 i, n, num[10] = {0};
  scanf("%d", &n);
  while (n > 0) {
    if (n % 10 == 0) {
      num[0]++;
      n = n / 10;
    } else {
      num[n % 10]++;
      n = n / 10;
    }
  }
  for (i = 0; i <= 9; i++) {
    printf("\n The number %d is showed %d time/s.", i, num[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    11c5 <main+0x95>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1199 <main+0x69>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    11c0 <main+0x90>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    115f <main+0x2f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     11fb <main+0xcb>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cc <main+0x9c>
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
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
lea    0xeb5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11ce <main+0xae>
xor    %edx,%edx
mov    $0xcccccccd,%ecx
jmp    117e <main+0x5e>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%edi
addl   $0x1,0x10(%rsp,%rdi,4)
cmp    $0xa,%eax
mov    %esi,%eax
jb     1199 <main+0x79>
mov    %eax,%esi
imul   %rcx,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%edi
lea    (%rdi,%rdi,4),%ebp
mov    %eax,%edi
sub    %ebp,%edi
jne    1170 <main+0x50>
add    $0x1,%edx
jmp    1177 <main+0x57>
mov    %esi,0xc(%rsp)
mov    0x14(%rsp),%r12d
mov    0x18(%rsp),%r15d
mov    0x1c(%rsp),%r14d
mov    0x20(%rsp),%ebp
mov    0x24(%rsp),%r13d
mov    0x28(%rsp),%eax
mov    %eax,(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0x30(%rsp),%eax
mov    %eax,0x8(%rsp)
jmp    11f5 <main+0xd5>
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
xor    %r13d,%r13d
xor    %ebp,%ebp
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %edx,%edx
lea    0xe07(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r15d,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %r13d,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    (%rsp),%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    0x4(%rsp),%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    0x8(%rsp),%edx
call   1030 <printf@plt>
mov    0x34(%rsp),%edx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
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 = [37 x i8] c"\0A The number %d is showed %d time/s.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %4 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %7
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %15
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 10
store i32 %19, i32* %3
br label %29
20: ; preds = %10
%21 = load i32, i32* %3
%22 = srem i32 %21, 10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
%27 = load i32, i32* %3
%28 = sdiv i32 %27, 10
store i32 %28, i32* %3
br label %29
29: ; preds = %20, %14
br label %7
30: ; preds = %7
store i32 0, i32* %2
br label %31
31: ; preds = %41, %30
%32 = load i32, i32* %2
%33 = icmp sle i32 %32, 9
br i1 %33, label %34, label %44
34: ; preds = %31
%35 = load i32, i32* %2
%36 = load i32, i32* %2
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %35, i32 %39)
br label %41
41: ; preds = %34
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %31
44: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [37 x i8] c"\0A The number %d is showed %d time/s.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10 x i32]* %2 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 %47, label %25
8: ; preds = %60
store i32 %51, i32* %1
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%14 = load i32, i32* %13
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%16 = load i32, i32* %15
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%18 = load i32, i32* %17
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%20 = load i32, i32* %19
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%22 = load i32, i32* %21
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%24 = load i32, i32* %23
br label %25
25: ; preds = %8, %0
%26 = phi i32 [ %24, %8 ], [ 0, %0 ]
%27 = phi i32 [ %22, %8 ], [ 0, %0 ]
%28 = phi i32 [ %20, %8 ], [ 0, %0 ]
%29 = phi i32 [ %18, %8 ], [ 0, %0 ]
%30 = phi i32 [ %16, %8 ], [ 0, %0 ]
%31 = phi i32 [ %14, %8 ], [ 0, %0 ]
%32 = phi i32 [ %12, %8 ], [ 0, %0 ]
%33 = phi i32 [ %10, %8 ], [ 0, %0 ]
%34 = phi i32 [ %61, %8 ], [ 0, %0 ]
%35 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %33)
%37 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %32)
%38 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %31)
%39 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %30)
%40 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %29)
%41 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 %28)
%42 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 %27)
%43 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 %26)
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 %45)
ret i32 0
47: ; preds = %0, %60
%48 = phi i32 [ %61, %60 ], [ 0, %0 ]
%49 = phi i32 [ %51, %60 ], [ %6, %0 ]
%50 = urem i32 %49, 10
%51 = udiv i32 %49, 10
%52 = icmp eq i32 %50, 0
br i1 %52, label %53, label %55
53: ; preds = %47
%54 = add nsw i32 %48, 1
br label %60
55: ; preds = %47
%56 = zext i32 %50 to i64
%57 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = add nsw i32 %58, 1
store i32 %59, i32* %57
br label %60
60: ; preds = %55, %53
%61 = phi i32 [ %48, %55 ], [ %54, %53 ]
%62 = icmp ult i32 %49, 10
br i1 %62, label %8, label %47
}