#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 *);
void main(void) {
  int x = 0, y = 0, zero = 0, one = 0, two = 0, three = 0, four = 0, five = 0,
      six = 0, seven = 0, eight = 0, nine = 0;
  printf("Input number:");
  scanf("%d", &x);
  while (x != 0) {
    y = x % 10;
    x = x / 10;
    if (y == 0)
      zero++;
    if (y == 1)
      one++;
    if (y == 2)
      two++;
    if (y == 3)
      three++;
    if (y == 4)
      four++;
    if (y == 5)
      five++;
    if (y == 6)
      six++;
    if (y == 7)
      seven++;
    if (y == 8)
      eight++;
    if (y == 9)
      nine++;
  }
  printf("\n Number of digit zero: %d", zero);
  printf("\n Number of digit one: %d", one);
  printf("\n Number of digit two: %d", two);
  printf("\n Number of digit three: %d", three);
  printf("\n Number of digit four: %d", four);
  printf("\n Number of digit five: %d", five);
  printf("\n Number of digit six: %d", six);
  printf("\n Number of digit seven: %d", seven);
  printf("\n Number of digit eight: %d", eight);
  printf("\n Number of digit nine: %d", nine);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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)
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1283 <main+0x163>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11d3 <main+0xb3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11e6 <main+0xc6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11f9 <main+0xd9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    120c <main+0xec>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    121f <main+0xff>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    1232 <main+0x112>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x6,-0x8(%rbp)
jne    1245 <main+0x125>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x7,-0x8(%rbp)
jne    1258 <main+0x138>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x8,-0x8(%rbp)
jne    126b <main+0x14b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    127e <main+0x15e>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    119a <main+0x7a>
mov    -0xc(%rbp),%esi
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%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    0xf51(%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    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0x55,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe2f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xee,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xff,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe31(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe35(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0x55,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe37(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xee,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe39(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xff,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe3a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe48(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Input number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0A Number of digit zero: %d\00"
@.str.3 = [26 x i8] c"\0A Number of digit one: %d\00"
@.str.4 = [26 x i8] c"\0A Number of digit two: %d\00"
@.str.5 = [28 x i8] c"\0A Number of digit three: %d\00"
@.str.6 = [27 x i8] c"\0A Number of digit four: %d\00"
@.str.7 = [27 x i8] c"\0A Number of digit five: %d\00"
@.str.8 = [26 x i8] c"\0A Number of digit six: %d\00"
@.str.9 = [28 x i8] c"\0A Number of digit seven: %d\00"
@.str.10 = [28 x i8] c"\0A Number of digit eight: %d\00"
@.str.11 = [27 x i8] c"\0A Number of digit nine: %d\00"
define void @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 ([14 x i8], [14 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 ([27 x i8], [27 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 ([26 x i8], [26 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 ([26 x i8], [26 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 ([28 x i8], [28 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 ([27 x i8], [27 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 ([27 x i8], [27 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 ([26 x i8], [26 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 ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %29)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %30)
ret void
}