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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%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,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe78(%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,-0x30(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x30(%rbp)
jne    11da <main+0xba>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x30(%rbp)
jne    11ed <main+0xcd>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0x30(%rbp)
jne    1200 <main+0xe0>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x3,-0x30(%rbp)
jne    1213 <main+0xf3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x4,-0x30(%rbp)
jne    1226 <main+0x106>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x5,-0x30(%rbp)
jne    1239 <main+0x119>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x6,-0x30(%rbp)
jne    124c <main+0x12c>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x7,-0x30(%rbp)
jne    125f <main+0x13f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x8,-0x30(%rbp)
jne    1272 <main+0x152>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x9,-0x30(%rbp)
jne    1285 <main+0x165>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11a1 <main+0x81>
mov    -0x34(%rbp),%esi
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeec(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11e8 <main+0xc8>
pxor   %xmm5,%xmm5
xor    %esi,%esi
movdqa 0xe98(%rip),%xmm0
movdqa 0xea0(%rip),%xmm1
xor    %ebx,%ebx
pxor   %xmm4,%xmm4
cs 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,%edi
sub    %edx,%edi
cmp    $0x1,%edi
adc    $0x0,%esi
movd   %edi,%xmm2
pshufd $0x0,%xmm2,%xmm2
movdqa %xmm2,%xmm3
pcmpeqd %xmm0,%xmm3
psubd  %xmm3,%xmm5
pcmpeqd %xmm1,%xmm2
psubd  %xmm2,%xmm4
xor    %edx,%edx
cmp    $0x9,%edi
sete   %dl
add    %edx,%ebx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1180 <main+0x60>
mov    %eax,0xc(%rsp)
movdqa %xmm4,0x20(%rsp)
movdqa %xmm5,0x10(%rsp)
jmp    11fe <main+0xde>
pxor   %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
xor    %esi,%esi
pxor   %xmm0,%xmm0
movdqa %xmm0,0x20(%rsp)
lea    0xe2e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe1e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0x55,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xee,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xff,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdeb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movdqa 0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xddb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0x55,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xee,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xdb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pshufd $0xff,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xda8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xda2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Vavedi chislo: \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* %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* %2
store i32 0, i32* %13
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 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* %12
%22 = load i32, i32* %2
%23 = sdiv i32 %22, 10
store i32 %23, i32* %2
%24 = load i32, i32* %12
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load i32, i32* %13
%28 = add nsw i32 %27, 1
store i32 %28, i32* %13
br label %29
29: ; preds = %26, %19
%30 = load i32, i32* %12
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %35
35: ; preds = %32, %29
%36 = load i32, i32* %12
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 1
store i32 %40, i32* %4
br label %41
41: ; preds = %38, %35
%42 = load i32, i32* %12
%43 = icmp eq i32 %42, 3
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %47
47: ; preds = %44, %41
%48 = load i32, i32* %12
%49 = icmp eq i32 %48, 4
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %53
53: ; preds = %50, %47
%54 = load i32, i32* %12
%55 = icmp eq i32 %54, 5
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
store i32 %58, i32* %7
br label %59
59: ; preds = %56, %53
%60 = load i32, i32* %12
%61 = icmp eq i32 %60, 6
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load i32, i32* %8
%64 = add nsw i32 %63, 1
store i32 %64, i32* %8
br label %65
65: ; preds = %62, %59
%66 = load i32, i32* %12
%67 = icmp eq i32 %66, 7
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i32, i32* %9
%70 = add nsw i32 %69, 1
store i32 %70, i32* %9
br label %71
71: ; preds = %68, %65
%72 = load i32, i32* %12
%73 = icmp eq i32 %72, 8
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = load i32, i32* %10
%76 = add nsw i32 %75, 1
store i32 %76, i32* %10
br label %77
77: ; preds = %74, %71
%78 = load i32, i32* %12
%79 = icmp eq i32 %78, 9
br i1 %79, label %80, label %83
80: ; preds = %77
%81 = load i32, i32* %11
%82 = add nsw i32 %81, 1
store i32 %82, i32* %11
br label %83
83: ; preds = %80, %77
br label %16
84: ; preds = %16
%85 = load i32, i32* %13
%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* %3
%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* %4
%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* %5
%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* %6
%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* %7
%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* %8
%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* %9
%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* %10
%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* %11
%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 = [16 x i8] c"Vavedi chislo: \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 ([16 x i8], [16 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 [ %16, %7 ], [ 0, %0 ]
%9 = phi i32 [ %24, %7 ], [ 0, %0 ]
%10 = phi i32 [ %13, %7 ], [ %5, %0 ]
%11 = phi <8 x i32> [ %21, %7 ], [ zeroinitializer, %0 ]
%12 = srem i32 %10, 10
%13 = sdiv i32 %10, 10
%14 = icmp eq i32 %12, 0
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %8, %15
%17 = insertelement <8 x i32> poison, i32 %12, i64 0
%18 = shufflevector <8 x i32> %17, <8 x i32> poison, <8 x i32> zeroinitializer
%19 = icmp eq <8 x i32> %18, <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
%20 = zext <8 x i1> %19 to <8 x i32>
%21 = add nuw nsw <8 x i32> %11, %20
%22 = icmp eq i32 %12, 9
%23 = zext i1 %22 to i32
%24 = add nuw nsw i32 %9, %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 [ %24, %27 ], [ 0, %0 ]
%30 = phi i32 [ %16, %27 ], [ 0, %0 ]
%31 = phi <8 x i32> [ %21, %27 ], [ zeroinitializer, %0 ]
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%33 = extractelement <8 x i32> %31, i64 0
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %33)
%35 = extractelement <8 x i32> %31, i64 1
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %35)
%37 = extractelement <8 x i32> %31, i64 2
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %37)
%39 = extractelement <8 x i32> %31, i64 3
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %39)
%41 = extractelement <8 x i32> %31, i64 4
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 %41)
%43 = extractelement <8 x i32> %31, i64 5
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %43)
%45 = extractelement <8 x i32> %31, i64 6
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %45)
%47 = extractelement <8 x i32> %31, i64 7
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %47)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 %29)
ret i32 0
}