#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 /*<<< orphan*/ putchar(char);
main() {
  int c;
  int nc[96];
  int i, j;
  for (i = 0; i < 96; i++)
    nc[i] = 0;
  while ((c = getchar()) != EOF) {
    if (c < 32 || c > 126)
      ++nc[95];
    else
      ++nc[c - 32];
  }
  for (i = 0; i < 96; i++) {
    if (i == 95)
      printf(". | ");
    else
      printf("%c | ", i + 32);
    for (j = 0; j < nc[i]; j++)
      putchar('#');
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x194(%rbp)
cmpl   $0x60,-0x194(%rbp)
jge    117f <main+0x4f>
movslq -0x194(%rbp),%rax
movl   $0x0,-0x190(%rbp,%rax,4)
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    114c <main+0x1c>
jmp    1184 <main+0x54>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e53(%rip),%rcx
cmp    (%rcx),%eax
je     11dd <main+0xad>
cmpl   $0x20,-0x8(%rbp)
jl     11b1 <main+0x81>
cmpl   $0x7e,-0x8(%rbp)
jle    11bf <main+0x8f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d8 <main+0xa8>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cltq
mov    -0x190(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x190(%rbp,%rax,4)
jmp    1184 <main+0x54>
movl   $0x0,-0x194(%rbp)
cmpl   $0x60,-0x194(%rbp)
jge    128b <main+0x15b>
cmpl   $0x5f,-0x194(%rbp)
jne    1214 <main+0xe4>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    122b <main+0xfb>
mov    -0x194(%rbp),%esi
add    $0x20,%esi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x198(%rbp)
mov    -0x198(%rbp),%eax
movslq -0x194(%rbp),%rcx
cmp    -0x190(%rbp,%rcx,4),%eax
jge    126d <main+0x13d>
mov    $0x23,%edi
call   1030 <putchar@plt>
mov    -0x198(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x198(%rbp)
jmp    1235 <main+0x105>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    11e7 <main+0xb7>
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x188,%rsp
mov    %rsp,%rdi
mov    $0x180,%edx
xor    %esi,%esi
call   1050 <memset@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e7e(%rip),%r14
cmp    (%r14),%eax
je     11a0 <main+0x60>
lea    0x17c(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
lea    -0x7f(%rax),%ecx
add    $0xffffffe0,%eax
cmp    $0xffffffa1,%ecx
lea    (%rsp,%rax,4),%rax
cmovb  %rbx,%rax
addl   $0x1,(%rax)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%r14),%eax
jne    1180 <main+0x40>
lea    0xe59(%rip),%r14
lea    0xe57(%rip),%r15
xor    %ebx,%ebx
jmp    11d4 <main+0x94>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x60,%rbx
je     1221 <main+0xe1>
cmp    $0x5f,%rbx
jne    11f0 <main+0xb0>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11fd <main+0xbd>
cs nopw 0x0(%rax,%rax,1)
lea    0x20(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%rbx,4),%ebp
test   %ebp,%ebp
jle    11c0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xd0>
jmp    11c0 <main+0x80>
xor    %eax,%eax
add    $0x188,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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