#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 *, ...);
main() {
  int tc[128];
  int c, i;
  for (i = 0; i < 128; ++i)
    tc[i] = 0;
  while ((c = getchar()) != EOF) {
    tc[c] += 1;
  }
  for (i = 0; i < 128; ++i) {
    if (tc[i] <= 0)
      continue;
    if (i == '\t')
      printf("\\t => ");
    else if (i == '\n')
      printf("\\n => ");
    else if (i == ' ')
      printf("SPACE => ");
    else
      printf("%3c => ", i);
    int j;
    for (j = 0; j < tc[i]; ++j) {
      printf("=");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x218(%rbp)
cmpl   $0x80,-0x218(%rbp)
jge    1172 <main+0x52>
movslq -0x218(%rbp),%rax
movl   $0x0,-0x210(%rbp,%rax,4)
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x218(%rbp)
jmp    113c <main+0x1c>
jmp    1177 <main+0x57>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x214(%rbp)
mov    0x2e5d(%rip),%rcx
cmp    (%rcx),%eax
je     11b0 <main+0x90>
movslq -0x214(%rbp),%rax
mov    -0x210(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x210(%rbp,%rax,4)
jmp    1177 <main+0x57>
movl   $0x0,-0x218(%rbp)
cmpl   $0x80,-0x218(%rbp)
jge    12ca <main+0x1aa>
movslq -0x218(%rbp),%rax
cmpl   $0x0,-0x210(%rbp,%rax,4)
jg     11e4 <main+0xc4>
jmp    12b6 <main+0x196>
cmpl   $0x9,-0x218(%rbp)
jne    1204 <main+0xe4>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1262 <main+0x142>
cmpl   $0xa,-0x218(%rbp)
jne    1224 <main+0x104>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125d <main+0x13d>
cmpl   $0x20,-0x218(%rbp)
jne    1244 <main+0x124>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1258 <main+0x138>
mov    -0x218(%rbp),%esi
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125d <main+0x13d>
jmp    1262 <main+0x142>
movl   $0x0,-0x21c(%rbp)
mov    -0x21c(%rbp),%eax
movslq -0x218(%rbp),%rcx
cmp    -0x210(%rbp,%rcx,4),%eax
jge    12a8 <main+0x188>
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x21c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21c(%rbp)
jmp    126c <main+0x14c>
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x218(%rbp)
jmp    11ba <main+0x9a>
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsp,%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   1050 <memset@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e7a(%rip),%rbx
cmp    (%rbx),%eax
je     1191 <main+0x51>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cltq
addl   $0x1,(%rsp,%rax,4)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%eax
jne    1180 <main+0x40>
lea    0xe76(%rip),%r14
lea    0xe68(%rip),%r12
lea    0xe5a(%rip),%r15
lea    0xe6b(%rip),%r13
xor    %ebx,%ebx
jmp    11cd <main+0x8d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x80,%rbx
je     122b <main+0xeb>
mov    (%rsp,%rbx,4),%ebp
test   %ebp,%ebp
jle    11c0 <main+0x80>
cmp    $0x20,%ebx
je     11ed <main+0xad>
cmp    $0xa,%ebx
je     11e8 <main+0xa8>
cmp    $0x9,%ebx
jne    11f9 <main+0xb9>
mov    %r15,%rdi
jmp    11f0 <main+0xb0>
mov    %r12,%rdi
jmp    11f0 <main+0xb0>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1210 <main+0xd0>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11c0 <main+0x80>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [7 x i8] c"\\t => \00"
@.str.1 = [7 x i8] c"\\n => \00"
@.str.2 = [10 x i8] c"SPACE => \00"
@.str.3 = [8 x i8] c"%3c => \00"
define i32 @main() {
%1 = alloca [128 x i32]
%2 = bitcast [128 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 %15, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ %3, %0 ]
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
%12 = tail call i32 (...) @getchar()
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %6
15: ; preds = %6, %0
br label %16
16: ; preds = %15, %39
%17 = phi i64 [ %40, %39 ], [ 0, %15 ]
%18 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp slt i32 %19, 1
br i1 %20, label %39, label %21
21: ; preds = %16
%22 = trunc i64 %17 to i32
switch i32 %22, label %29 [
i32 9, label %23
i32 10, label %25
i32 32, label %27
]
23: ; preds = %21
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %31
25: ; preds = %21
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %31
27: ; preds = %21
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %31
29: ; preds = %21
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %22)
br label %31
31: ; preds = %23, %27, %29, %25
br label %32
32: ; preds = %31, %32
%33 = phi i32 [ %35, %32 ], [ 0, %31 ]
%34 = tail call i32 @putchar(i32 61)
%35 = add nuw nsw i32 %33, 1
%36 = icmp eq i32 %35, %19
br i1 %36, label %37, label %32
37: ; preds = %32
%38 = tail call i32 @putchar(i32 10)
br label %39
39: ; preds = %16, %37
%40 = add nuw nsw i64 %17, 1
%41 = icmp eq i64 %40, 128
br i1 %41, label %42, label %16
42: ; preds = %39
ret i32 0
}