#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 i, n;
  int number0 = 0, number1 = 0, number2 = 0, number3 = 0, number4 = 0,
      number5 = 0, number6 = 0, number7 = 0, number8 = 0, number9 = 0;
  do {
    scanf("%d", &i);
  } while (i > 1000000000);
  while (i != 0) {
    n = i % 10;
    i = i / 10;
    if (n == 0)
      number0++;
    if (n == 1)
      number1++;
    if (n == 2)
      number2++;
    if (n == 3)
      number3++;
    if (n == 4)
      number4++;
    if (n == 5)
      number5++;
    if (n == 6)
      number6++;
    if (n == 7)
      number7++;
    if (n == 8)
      number8++;
    if (n == 9)
      number9++;
  }
  printf("The number 0 was seen %d times \n", number0);
  printf("The number 1 was seen %d times \n", number1);
  printf("The number 2 was seen %d times \n", number2);
  printf("The number 3 was seen %d times \n", number3);
  printf("The number 4 was seen %d times \n", number4);
  printf("The number 5 was seen %d times \n", number5);
  printf("The number 6 was seen %d times \n", number6);
  printf("The number 7 was seen %d times \n", number7);
  printf("The number 8 was seen %d times \n", number8);
  printf("The number 9 was seen %d times \n", number9);
}


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    0xe84(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3b9aca00,-0x8(%rbp)
jg     1175 <main+0x55>
jmp    1197 <main+0x77>
cmpl   $0x0,-0x8(%rbp)
je     1280 <main+0x160>
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    11d0 <main+0xb0>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11e3 <main+0xc3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    11f6 <main+0xd6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    1209 <main+0xe9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    121c <main+0xfc>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x5,-0xc(%rbp)
jne    122f <main+0x10f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x6,-0xc(%rbp)
jne    1242 <main+0x122>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x7,-0xc(%rbp)
jne    1255 <main+0x135>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x8,-0xc(%rbp)
jne    1268 <main+0x148>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x9,-0xc(%rbp)
jne    127b <main+0x15b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1197 <main+0x77>
mov    -0x10(%rbp),%esi
lea    0xd79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xd8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xdaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xdc1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xde5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xdf7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xe09(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
lea    0xef3(%rip),%rbx
lea    0xc(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3b9aca00,%eax
jg     1140 <main+0x20>
pxor   %xmm5,%xmm5
test   %eax,%eax
je     11e6 <main+0xc6>
xor    %ebx,%ebx
movdqa 0xe94(%rip),%xmm0
movdqa 0xe9c(%rip),%xmm1
xor    %ebp,%ebp
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,%ebp
xor    %edx,%edx
cmp    $0x9,%esi
sete   %dl
add    %edx,%ebx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1180 <main+0x60>
mov    %eax,0xc(%rsp)
movdqa %xmm4,0x10(%rsp)
jmp    11f4 <main+0xd4>
xor    %ebp,%ebp
xor    %ebx,%ebx
pxor   %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqa %xmm5,0x20(%rsp)
movd   %xmm5,%esi
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
pshufd $0x55,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
pshufd $0xee,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
pshufd $0xff,0x20(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
pshufd $0x55,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
pshufd $0xee,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
pshufd $0xff,0x10(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

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

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