#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 *, char **);
int main() {
  int i = 0, digit, num[10] = {0}, len;
  char digits[100];
  scanf("%s", &digits);
  while (digits[i] != '\0') {
    digit = digits[i] - 48;
    num[digit]++;
    i++;
  }
  for (i = 0; i <= 9; i++) {
    if (num[i] != 0) {
      printf("\nnumber of %d-%d", i, num[i]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0xb0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x8(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     11b0 <main+0x80>
movslq -0x8(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
mov    %eax,-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
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x3c>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     11fa <main+0xca>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0x40(%rbp,%rax,4)
je     11e7 <main+0xb7>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
jmp    11ec <main+0xbc>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b7 <main+0x87>
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x98,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0xebd(%rip),%rdi
lea    0x30(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x30(%rsp),%al
test   %al,%al
je     118c <main+0x6c>
lea    0x31(%rsp),%rcx
nopw   0x0(%rax,%rax,1)
movsbq %al,%rax
addl   $0x1,-0xc0(%rsp,%rax,4)
01
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1160 <main+0x40>
mov    (%rsp),%edx
test   %edx,%edx
je     118c <main+0x6c>
lea    0xe7e(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%edx
test   %edx,%edx
je     11a5 <main+0x85>
lea    0xe68(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
test   %edx,%edx
je     11be <main+0x9e>
lea    0xe4f(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
test   %edx,%edx
je     11d7 <main+0xb7>
lea    0xe36(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
test   %edx,%edx
je     11f0 <main+0xd0>
lea    0xe1d(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x14(%rsp),%edx
test   %edx,%edx
je     1209 <main+0xe9>
lea    0xe04(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    0x18(%rsp),%edx
test   %edx,%edx
je     1222 <main+0x102>
lea    0xdeb(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    0x1c(%rsp),%edx
test   %edx,%edx
je     123b <main+0x11b>
lea    0xdd2(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
test   %edx,%edx
je     1254 <main+0x134>
lea    0xdb9(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0x24(%rsp),%edx
test   %edx,%edx
je     126d <main+0x14d>
lea    0xda0(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x98,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [17 x i8] c"\0Anumber of %d-%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca i32
%6 = alloca [100 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%7 = bitcast [10 x i32]* %4 to i8*
%8 = bitcast [100 x i8]* %6 to i8**
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %8)
br label %10
10: ; preds = %17, %0
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %31
17: ; preds = %10
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 48
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
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %10
31: ; preds = %10
store i32 0, i32* %2
br label %32
32: ; preds = %49, %31
%33 = load i32, i32* %2
%34 = icmp sle i32 %33, 9
br i1 %34, label %35, label %52
35: ; preds = %32
%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 = icmp ne i32 %39, 0
br i1 %40, label %41, label %48
41: ; preds = %35
%42 = load i32, i32* %2
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %46)
br label %48
48: ; preds = %41, %35
br label %49
49: ; preds = %48
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
store i32 %51, i32* %2
br label %32
52: ; preds = %32
%53 = load i32, i32* %1
ret i32 %53
}

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