#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(void) {
  int x;
  int x2;
  int temp;
  int c0 = 0;
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  int c4 = 0;
  int c5 = 0;
  int c6 = 0;
  int c7 = 0;
  int c8 = 0;
  int c9 = 0;
  printf("Insert your number - \n");
  scanf("%d", &x);
  x2 = x;
  while (x2 > 0) {
    temp = x2 % 10;
    if (temp == 0)
      c0++;
    if (temp == 1)
      c1++;
    if (temp == 2)
      c2++;
    if (temp == 3)
      c3++;
    if (temp == 4)
      c4++;
    if (temp == 5)
      c5++;
    if (temp == 6)
      c6++;
    if (temp == 7)
      c7++;
    if (temp == 8)
      c8++;
    if (temp == 9)
      c9++;
    x2 = x2 / 10;
  }
  printf("\n");
  printf("\nFound '0' - %d times", c0);
  printf("\nFound '1' - %d times", c1);
  printf("\nFound '2' - %d times", c2);
  printf("\nFound '3' - %d times", c3);
  printf("\nFound '4' - %d times", c4);
  printf("\nFound '5' - %d times", c5);
  printf("\nFound '6' - %d times", c6);
  printf("\nFound '7' - %d times", c7);
  printf("\nFound '8' - %d times", c8);
  printf("\nFound '9' - %d times", c9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%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)
movl   $0x0,-0x38(%rbp)
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1282 <main+0x162>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    11c4 <main+0xa4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    11d7 <main+0xb7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    11ea <main+0xca>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x3,-0x10(%rbp)
jne    11fd <main+0xdd>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x4,-0x10(%rbp)
jne    1210 <main+0xf0>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x5,-0x10(%rbp)
jne    1223 <main+0x103>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x6,-0x10(%rbp)
jne    1236 <main+0x116>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x7,-0x10(%rbp)
jne    1249 <main+0x129>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x8,-0x10(%rbp)
jne    125c <main+0x13c>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x9,-0x10(%rbp)
jne    126f <main+0x14f>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1199 <main+0x79>
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%esi
lea    0xdad(%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
lea    0xfb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xec7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
pxor   %xmm5,%xmm5
test   %eax,%eax
jle    11e0 <main+0xa0>
xor    %ebx,%ebx
mov    $0xcccccccd,%ecx
movdqa 0xe82(%rip),%xmm0
movdqa 0xe8a(%rip),%xmm1
xor    %ebp,%ebp
pxor   %xmm4,%xmm4
nopl   0x0(%rax)
mov    %eax,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %eax,%edi
sub    %esi,%edi
movd   %edi,%xmm2
pshufd $0x0,%xmm2,%xmm2
movdqa %xmm2,%xmm3
pcmpeqd %xmm0,%xmm3
psubd  %xmm3,%xmm5
pcmpeqd %xmm1,%xmm2
psubd  %xmm2,%xmm4
xor    %esi,%esi
cmp    $0x8,%edi
sete   %sil
add    %esi,%ebp
xor    %esi,%esi
cmp    $0x9,%edi
sete   %sil
add    %esi,%ebx
cmp    $0x9,%eax
mov    %edx,%eax
ja     1190 <main+0x50>
jmp    11e8 <main+0xa8>
xor    %ebp,%ebp
xor    %ebx,%ebx
pxor   %xmm4,%xmm4
movdqa %xmm5,0x10(%rsp)
movdqa %xmm4,0x20(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe14(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
pshufd $0x55,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe11(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
pshufd $0xee,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe0e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
pshufd $0xff,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movdqa 0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe09(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
pshufd $0x55,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe06(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
pshufd $0xee,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe03(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
pshufd $0xff,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe00(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe08(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe0e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

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

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