#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x, n, a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0,
            j = 0;
  scanf("%d", &n);
  while (n != 0) {
    x = n % 10;
    if (x == 0)
      a++;
    if (x == 1)
      b++;
    if (x == 2)
      c++;
    if (x == 3)
      d++;
    if (x == 4)
      e++;
    if (x == 5)
      f++;
    if (x == 6)
      g++;
    if (x == 7)
      h++;
    if (x == 8)
      i++;
    if (x == 9)
      j++;
    n = n / 10;
  }
  printf("\n%d", a);
  printf("\n%d", b);
  printf("\n%d", c);
  printf("\n%d", d);
  printf("\n%d", e);
  printf("\n%d", f);
  printf("\n%d", g);
  printf("\n%d", h);
  printf("\n%d", i);
  printf("\n%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%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    0xe85(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
je     126e <main+0x14e>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11b0 <main+0x90>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11c3 <main+0xa3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11d6 <main+0xb6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    11e9 <main+0xc9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    11fc <main+0xdc>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    120f <main+0xef>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x6,-0x8(%rbp)
jne    1222 <main+0x102>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x7,-0x8(%rbp)
jne    1235 <main+0x115>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x8,-0x8(%rbp)
jne    1248 <main+0x128>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    125b <main+0x13b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1185 <main+0x65>
mov    -0x10(%rbp),%esi
lea    0xd88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xd79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xd5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xd3d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xd2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xd1f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xd10(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xd01(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xef2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
pxor   %xmm5,%xmm5
test   %eax,%eax
je     11d6 <main+0xb6>
xor    %ebx,%ebx
movdqa 0xead(%rip),%xmm0
movdqa 0xeb5(%rip),%xmm1
xor    %ebp,%ebp
pxor   %xmm4,%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   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,%ebp
xor    %edx,%edx
cmp    $0x9,%esi
sete   %dl
add    %edx,%ebx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1170 <main+0x50>
mov    %eax,0xc(%rsp)
movdqa %xmm4,0x10(%rsp)
jmp    11e4 <main+0xc4>
xor    %ebp,%ebp
xor    %ebx,%ebx
pxor   %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqa %xmm5,0x20(%rsp)
movd   %xmm5,%esi
lea    0xe2b(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
pshufd $0x55,0x20(%rsp),%xmm0
movd   %xmm0,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
pshufd $0xee,0x20(%rsp),%xmm0
movd   %xmm0,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
pshufd $0xff,0x20(%rsp),%xmm0
movd   %xmm0,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
pshufd $0x55,0x10(%rsp),%xmm0
movd   %xmm0,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
pshufd $0xee,0x10(%rsp),%xmm0
movd   %xmm0,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
pshufd $0xff,0x10(%rsp),%xmm0
movd   %xmm0,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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