#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0, i = 0;
  int counter0 = 0, counter1 = 0, counter2 = 0;
  int counter3 = 0, counter4 = 0, counter5 = 0;
  int counter6 = 0, counter7 = 0, counter8 = 0;
  int counter9 = 0;
  printf("Enter Number -");
  scanf("%d", &n);
  while (n != 0) {
    i = n % 10;
    n = n / 10;
    if (i == 0) {
      counter0++;
    }
    if (i == 1) {
      counter1++;
    }
    if (i == 2) {
      counter2++;
    }
    if (i == 3) {
      counter3++;
    }
    if (i == 4) {
      counter4++;
    }
    if (i == 5) {
      counter5++;
    }
    if (i == 6) {
      counter6++;
    }
    if (i == 7) {
      counter7++;
    }
    if (i == 8) {
      counter8++;
    }
    if (i == 9) {
      counter9++;
    }
  }
  printf("0 >>%d\n", counter0);
  printf("1 >>%d\n", counter1);
  printf("2 >>%d\n", counter2);
  printf("3 >>%d\n", counter3);
  printf("4 >>%d\n", counter4);
  printf("5 >>%d\n", counter5);
  printf("6 >>%d\n", counter6);
  printf("7 >>%d\n", counter7);
  printf("8 >>%d\n", counter8);
  printf("9 >>%d\n", counter9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe77(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     128a <main+0x16a>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11da <main+0xba>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11ed <main+0xcd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1200 <main+0xe0>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    1213 <main+0xf3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    1226 <main+0x106>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x5,-0xc(%rbp)
jne    1239 <main+0x119>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x6,-0xc(%rbp)
jne    124c <main+0x12c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x7,-0xc(%rbp)
jne    125f <main+0x13f>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x8,-0xc(%rbp)
jne    1272 <main+0x152>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x9,-0xc(%rbp)
jne    1285 <main+0x165>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a1 <main+0x81>
mov    -0x10(%rbp),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xd51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xd36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeeb(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
pxor   %xmm5,%xmm5
xor    %ebp,%ebp
test   %eax,%eax
je     11e6 <main+0xc6>
movdqa 0xe97(%rip),%xmm0
movdqa 0xe9f(%rip),%xmm1
xor    %ebx,%ebx
pxor   %xmm4,%xmm4
nopw   0x0(%rax,%rax,1)
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
movd   %esi,%xmm2
pshufd $0x0,%xmm2,%xmm2
movdqa %xmm2,%xmm3
pcmpeqd %xmm0,%xmm3
psubd  %xmm3,%xmm5
pcmpeqd %xmm1,%xmm2
psubd  %xmm2,%xmm4
xor    %edx,%edx
cmp    $0x8,%esi
sete   %dl
add    %edx,%ebx
xor    %edx,%edx
cmp    $0x9,%esi
sete   %dl
add    %edx,%ebp
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1180 <main+0x60>
mov    %eax,0xc(%rsp)
movdqa %xmm4,0x10(%rsp)
jmp    11f0 <main+0xd0>
pxor   %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqa %xmm5,0x20(%rsp)
movd   %xmm5,%esi
lea    0xe31(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0x55,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xee,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe0f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xff,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdfe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdee(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0x55,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xddd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xee,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdcc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xff,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdbb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdb5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdad(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter Number -\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"0 >>%d\0A\00"
@.str.3 = [8 x i8] c"1 >>%d\0A\00"
@.str.4 = [8 x i8] c"2 >>%d\0A\00"
@.str.5 = [8 x i8] c"3 >>%d\0A\00"
@.str.6 = [8 x i8] c"4 >>%d\0A\00"
@.str.7 = [8 x i8] c"5 >>%d\0A\00"
@.str.8 = [8 x i8] c"6 >>%d\0A\00"
@.str.9 = [8 x i8] c"7 >>%d\0A\00"
@.str.10 = [8 x i8] c"8 >>%d\0A\00"
@.str.11 = [8 x i8] c"9 >>%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %16
16: ; preds = %83, %0
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %84
19: ; preds = %16
%20 = load i32, i32* %2
%21 = srem i32 %20, 10
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = sdiv i32 %22, 10
store i32 %23, i32* %2
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %29
29: ; preds = %26, %19
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %35
35: ; preds = %32, %29
%36 = load i32, i32* %3
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %41
41: ; preds = %38, %35
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 3
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %47
47: ; preds = %44, %41
%48 = load i32, i32* %3
%49 = icmp eq i32 %48, 4
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load i32, i32* %8
%52 = add nsw i32 %51, 1
store i32 %52, i32* %8
br label %53
53: ; preds = %50, %47
%54 = load i32, i32* %3
%55 = icmp eq i32 %54, 5
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load i32, i32* %9
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
br label %59
59: ; preds = %56, %53
%60 = load i32, i32* %3
%61 = icmp eq i32 %60, 6
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load i32, i32* %10
%64 = add nsw i32 %63, 1
store i32 %64, i32* %10
br label %65
65: ; preds = %62, %59
%66 = load i32, i32* %3
%67 = icmp eq i32 %66, 7
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i32, i32* %11
%70 = add nsw i32 %69, 1
store i32 %70, i32* %11
br label %71
71: ; preds = %68, %65
%72 = load i32, i32* %3
%73 = icmp eq i32 %72, 8
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = load i32, i32* %12
%76 = add nsw i32 %75, 1
store i32 %76, i32* %12
br label %77
77: ; preds = %74, %71
%78 = load i32, i32* %3
%79 = icmp eq i32 %78, 9
br i1 %79, label %80, label %83
80: ; preds = %77
%81 = load i32, i32* %13
%82 = add nsw i32 %81, 1
store i32 %82, i32* %13
br label %83
83: ; preds = %80, %77
br label %16
84: ; preds = %16
%85 = load i32, i32* %4
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %85)
%87 = load i32, i32* %5
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %87)
%89 = load i32, i32* %6
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %89)
%91 = load i32, i32* %7
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %91)
%93 = load i32, i32* %8
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %93)
%95 = load i32, i32* %9
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %95)
%97 = load i32, i32* %10
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %97)
%99 = load i32, i32* %11
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %12
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %101)
%103 = load i32, i32* %13
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 %103)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter Number -\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"0 >>%d\0A\00"
@.str.3 = [8 x i8] c"1 >>%d\0A\00"
@.str.4 = [8 x i8] c"2 >>%d\0A\00"
@.str.5 = [8 x i8] c"3 >>%d\0A\00"
@.str.6 = [8 x i8] c"4 >>%d\0A\00"
@.str.7 = [8 x i8] c"5 >>%d\0A\00"
@.str.8 = [8 x i8] c"6 >>%d\0A\00"
@.str.9 = [8 x i8] c"7 >>%d\0A\00"
@.str.10 = [8 x i8] c"8 >>%d\0A\00"
@.str.11 = [8 x i8] c"9 >>%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %28, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %24, %7 ], [ 0, %0 ]
%9 = phi i32 [ %21, %7 ], [ 0, %0 ]
%10 = phi i32 [ %13, %7 ], [ %5, %0 ]
%11 = phi <8 x i32> [ %18, %7 ], [ zeroinitializer, %0 ]
%12 = srem i32 %10, 10
%13 = sdiv i32 %10, 10
%14 = insertelement <8 x i32> poison, i32 %12, i64 0
%15 = shufflevector <8 x i32> %14, <8 x i32> poison, <8 x i32> zeroinitializer
%16 = icmp eq <8 x i32> %15, <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%17 = zext <8 x i1> %16 to <8 x i32>
%18 = add nuw nsw <8 x i32> %11, %17
%19 = icmp eq i32 %12, 8
%20 = zext i1 %19 to i32
%21 = add nuw nsw i32 %9, %20
%22 = icmp eq i32 %12, 9
%23 = zext i1 %22 to i32
%24 = add nuw nsw i32 %8, %23
%25 = add i32 %10, 9
%26 = icmp ult i32 %25, 19
br i1 %26, label %27, label %7
27: ; preds = %7
store i32 %13, i32* %1
br label %28
28: ; preds = %27, %0
%29 = phi i32 [ %21, %27 ], [ 0, %0 ]
%30 = phi i32 [ %24, %27 ], [ 0, %0 ]
%31 = phi <8 x i32> [ %18, %27 ], [ zeroinitializer, %0 ]
%32 = extractelement <8 x i32> %31, i64 0
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = extractelement <8 x i32> %31, i64 1
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = extractelement <8 x i32> %31, i64 2
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %36)
%38 = extractelement <8 x i32> %31, i64 3
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %38)
%40 = extractelement <8 x i32> %31, i64 4
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %40)
%42 = extractelement <8 x i32> %31, i64 5
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %42)
%44 = extractelement <8 x i32> %31, i64 6
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %44)
%46 = extractelement <8 x i32> %31, i64 7
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %29)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 %30)
ret i32 0
}