#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 n;
  int i = 0;
  int d[10] = {0};
  scanf("%d", &n);
  if (n == 0)
    d[0]++;
  while (n > 0) {
    d[n % 10]++;
    n /= 10;
  }
  while (i < 10) {
    i = i + 1;
    if (d[i] != 0) {
      d[i] > 1 ? printf("%d>%d times\n", i, d[i])
               : printf("%d>%d time\n", i, 1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xea3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1179 <main+0x49>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    117e <main+0x4e>
cmpl   $0x0,-0x8(%rbp)
jle    11b4 <main+0x84>
mov    -0x8(%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    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x4e>
jmp    11b9 <main+0x89>
cmpl   $0xa,-0xc(%rbp)
jge    121f <main+0xef>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x40(%rbp,%rax,4)
je     121a <main+0xea>
movslq -0xc(%rbp),%rax
cmpl   $0x1,-0x40(%rbp,%rax,4)
jle    1206 <main+0xd6>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe07(%rip),%rdi
call   1030 <printf@plt>
jmp    121a <main+0xea>
mov    -0xc(%rbp),%esi
lea    0xe00(%rip),%rdi
mov    $0x1,%edx
call   1030 <printf@plt>
jmp    11b9 <main+0x89>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
lea    0xeba(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     1186 <main+0x66>
jle    118e <main+0x6e>
mov    $0xcccccccd,%ecx
nop
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)
jmp    118e <main+0x6e>
movl   $0x1,0x10(%rsp)
mov    $0x1,%ebx
lea    0xe69(%rip),%r14
lea    0xe6f(%rip),%r15
jmp    11c9 <main+0xa9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0xb,%rbx
je     11dd <main+0xbd>
mov    0x10(%rsp,%rbx,4),%edx
test   %edx,%edx
je     11bf <main+0x9f>
cmp    $0x2,%edx
jl     11b0 <main+0x90>
mov    %r14,%rdi
mov    %ebx,%esi
jmp    11ba <main+0x9a>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"%d>%d times\0A\00"
@.str.2 = [12 x i8] c"%d>%d time\0A\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 eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 1, i32* %9
br label %12
10: ; preds = %0
%11 = icmp sgt i32 %6, 0
br i1 %11, label %14, label %12
12: ; preds = %8, %13, %10
br label %23
13: ; preds = %14
store i32 %21, i32* %1
br label %12
14: ; preds = %10, %14
%15 = phi i32 [ %21, %14 ], [ %6, %10 ]
%16 = urem i32 %15, 10
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
%21 = udiv i32 %15, 10
%22 = icmp ult i32 %15, 10
br i1 %22, label %13, label %14
23: ; preds = %12, %36
%24 = phi i64 [ %25, %36 ], [ 0, %12 ]
%25 = add nuw nsw i64 %24, 1
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 0
br i1 %28, label %36, label %29
29: ; preds = %23
%30 = icmp sgt i32 %27, 1
%31 = trunc i64 %25 to i32
br i1 %30, label %32, label %34
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %27)
br label %36
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %31, i32 1)
br label %36
36: ; preds = %32, %34, %23
%37 = icmp eq i64 %25, 10
br i1 %37, label %38, label %23
38: ; preds = %36
ret i32 0
}