#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int c, i, nwhite, nother;
  int ndigit[10];
  nwhite = 0;
  nother = 0;
  for (i = 0; i < 10; i++) {
    ndigit[i] = 0;
  }
  while ((c = getchar()) != EOF) {
    if (c > '0' && c < '9') {
      ++ndigit[c - '0'];
    } else if (c == ' ' || c == '\n' || c == '\t') {
      ++nwhite;
    } else {
      ++nother;
    }
  }
  for (i = 0; i < 10; i++) {
    printf("%d -> %d\n", i, ndigit[i]);
  }
  printf("White Spaces -> %d \nOther Characters-> %d\n", nwhite, nother);
}


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,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1168 <main+0x48>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x24>
jmp    116d <main+0x4d>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e6a(%rip),%rcx
cmp    (%rcx),%eax
je     11f1 <main+0xd1>
cmpl   $0x30,-0x8(%rbp)
jle    11b2 <main+0x92>
cmpl   $0x39,-0x8(%rbp)
jge    11b2 <main+0x92>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
cltq
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
jmp    11ec <main+0xcc>
cmpl   $0x20,-0x8(%rbp)
je     11d0 <main+0xb0>
cmpl   $0xa,-0x8(%rbp)
je     11d0 <main+0xb0>
cmpl   $0x9,-0x8(%rbp)
jne    11de <main+0xbe>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e7 <main+0xc7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ec <main+0xcc>
jmp    116d <main+0x4d>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1227 <main+0x107>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f8 <main+0xd8>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x40(%rsp)
xor    %r13d,%r13d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e93(%rip),%rbx
mov    $0x0,%r9d
mov    $0x0,%esi
mov    $0x0,%edi
mov    $0x0,%r8d
mov    $0x0,%r14d
mov    $0x0,%r15d
mov    $0x0,%r12d
mov    $0x0,%r10d
mov    $0x0,%edx
mov    $0x0,%ebp
mov    $0x0,%ecx
cmp    (%rbx),%eax
je     1215 <main+0xf5>
movabs $0x100000600,%r14
xor    %r15d,%r15d
xor    %ebp,%ebp
jmp    11c3 <main+0xa3>
nopw   0x0(%rax,%rax,1)
add    $0xffffffd0,%eax
addl   $0x1,0x20(%rsp,%rax,4)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     11e3 <main+0xc3>
lea    -0x31(%rax),%ecx
cmp    $0x7,%ecx
jbe    11b0 <main+0x90>
cmp    $0x20,%eax
ja     11dd <main+0xbd>
mov    %eax,%eax
bt     %rax,%r14
jae    11dd <main+0xbd>
add    $0x1,%ebp
jmp    11b8 <main+0x98>
add    $0x1,%r15d
jmp    11b8 <main+0x98>
mov    0x20(%rsp),%edx
mov    0x24(%rsp),%r10d
mov    0x28(%rsp),%r12d
mov    %r15d,%ecx
mov    0x2c(%rsp),%r15d
mov    0x30(%rsp),%r14d
mov    0x34(%rsp),%r8d
mov    0x38(%rsp),%edi
mov    0x3c(%rsp),%esi
mov    0x40(%rsp),%r9d
mov    0x44(%rsp),%r13d
mov    %r8d,0x8(%rsp)
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %r9d,0x14(%rsp)
mov    %ecx,0x18(%rsp)
mov    %r13d,0x1c(%rsp)
lea    0xdc9(%rip),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    %r10d,%ebx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x2,%esi
mov    %r12d,%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x3,%esi
mov    %r15d,%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x4,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x5,%esi
mov    0x8(%rsp),%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x6,%esi
mov    0xc(%rsp),%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x7,%esi
mov    0x10(%rsp),%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x8,%esi
mov    0x14(%rsp),%edx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    $0x9,%esi
mov    0x1c(%rsp),%edx
call   1030 <printf@plt>
lea    0xd2b(%rip),%rdi
mov    %ebp,%esi
mov    0x18(%rsp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [10 x i8] c"%d -> %d\0A\00"
@.str.1 = [43 x i8] c"White Spaces -> %d \0AOther Characters-> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10 x i32]
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %3
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %7
17: ; preds = %7
br label %18
18: ; preds = %51, %17
%19 = call i32 (...) @getchar()
store i32 %19, i32* %2
%20 = load i32, i32* @EOF
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %52
22: ; preds = %18
%23 = load i32, i32* %2
%24 = icmp sgt i32 %23, 48
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 57
br i1 %27, label %28, label %35
28: ; preds = %25
%29 = load i32, i32* %2
%30 = sub nsw i32 %29, 48
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = add nsw i32 %33, 1
store i32 %34, i32* %32
br label %51
35: ; preds = %25, %22
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 32
br i1 %37, label %44, label %38
38: ; preds = %35
%39 = load i32, i32* %2
%40 = icmp eq i32 %39, 10
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i32, i32* %2
%43 = icmp eq i32 %42, 9
br i1 %43, label %44, label %47
44: ; preds = %41, %38, %35
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
br label %50
47: ; preds = %41
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
store i32 %49, i32* %5
br label %50
50: ; preds = %47, %44
br label %51
51: ; preds = %50, %28
br label %18
52: ; preds = %18
store i32 0, i32* %3
br label %53
53: ; preds = %63, %52
%54 = load i32, i32* %3
%55 = icmp slt i32 %54, 10
br i1 %55, label %56, label %66
56: ; preds = %53
%57 = load i32, i32* %3
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %57, i32 %61)
br label %63
63: ; preds = %56
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %53
66: ; preds = %53
%67 = load i32, i32* %4
%68 = load i32, i32* %5
%69 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %67, i32 %68)
%70 = load i32, i32* %1
ret i32 %70
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [10 x i8] c"%d -> %d\0A\00"
@.str.1 = [43 x i8] c"White Spaces -> %d \0AOther Characters-> %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %27, label %51
6: ; preds = %68
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%14 = load i32, i32* %13
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%16 = load i32, i32* %15
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%18 = load i32, i32* %17
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%20 = load i32, i32* %19
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%22 = load i32, i32* %21
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%24 = load i32, i32* %23
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%26 = load i32, i32* %25
br label %27
27: ; preds = %6, %0
%28 = phi i32 [ 0, %0 ], [ %26, %6 ]
%29 = phi i32 [ 0, %0 ], [ %24, %6 ]
%30 = phi i32 [ 0, %0 ], [ %22, %6 ]
%31 = phi i32 [ 0, %0 ], [ %20, %6 ]
%32 = phi i32 [ 0, %0 ], [ %18, %6 ]
%33 = phi i32 [ 0, %0 ], [ %16, %6 ]
%34 = phi i32 [ 0, %0 ], [ %14, %6 ]
%35 = phi i32 [ 0, %0 ], [ %12, %6 ]
%36 = phi i32 [ 0, %0 ], [ %10, %6 ]
%37 = phi i32 [ 0, %0 ], [ %8, %6 ]
%38 = phi i32 [ 0, %0 ], [ %69, %6 ]
%39 = phi i32 [ 0, %0 ], [ %70, %6 ]
%40 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 %37)
%41 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 %36)
%42 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2, i32 %35)
%43 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3, i32 %34)
%44 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4, i32 %33)
%45 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i32 %32)
%46 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6, i32 %31)
%47 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7, i32 %30)
%48 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8, i32 %29)
%49 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 %28)
%50 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %39)
ret i32 0
51: ; preds = %0, %68
%52 = phi i32 [ %71, %68 ], [ %3, %0 ]
%53 = phi i32 [ %70, %68 ], [ 0, %0 ]
%54 = phi i32 [ %69, %68 ], [ 0, %0 ]
%55 = add i32 %52, -49
%56 = icmp ult i32 %55, 8
br i1 %56, label %57, label %63
57: ; preds = %51
%58 = add nsw i32 %52, -48
%59 = zext i32 %58 to i64
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = add nsw i32 %61, 1
store i32 %62, i32* %60
br label %68
63: ; preds = %51
switch i32 %52, label %66 [
i32 32, label %64
i32 10, label %64
i32 9, label %64
]
64: ; preds = %63, %63, %63
%65 = add nsw i32 %54, 1
br label %68
66: ; preds = %63
%67 = add nsw i32 %53, 1
br label %68
68: ; preds = %64, %66, %57
%69 = phi i32 [ %54, %57 ], [ %65, %64 ], [ %54, %66 ]
%70 = phi i32 [ %53, %57 ], [ %53, %64 ], [ %67, %66 ]
%71 = tail call i32 (...) @getchar()
%72 = load i32, i32* @EOF
%73 = icmp eq i32 %71, %72
br i1 %73, label %6, label %51
}