#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);
int main(void) {
  int c;
  int chars[94] = {0};
  int height = 0;
  printf("\nInput: ");
  while ((c = getchar()) != EOF)
    if (c >= 33 && c <= 126) {
      ++chars[c - 33];
      if (chars[c - 33] > height)
        height = chars[c - 33];
    }
  printf("\n%29cx-axis = character    y-axis = quantity\n\n", ' ');
  for (int row = height; row > 0; --row) {
    printf("%3d ", row);
    for (int col = 0; col < 94; ++col) {
      if (row - chars[col] > 0)
        printf("%c", ' ');
      else
        printf("%c", '|');
    }
    putchar('\n');
  }
  printf("    ");
  for (int col = 0; col < 94; ++col)
    putchar('-');
  printf("\n    ");
  for (int col = 0; col < 94; ++col)
    printf("%c", col + 33);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x180(%rbp),%rdi
xor    %esi,%esi
mov    $0x178,%edx
call   1050 <memset@plt>
movl   $0x0,-0x184(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e5a(%rip),%rcx
cmp    (%rcx),%eax
je     11fd <main+0xbd>
cmpl   $0x21,-0x8(%rbp)
jl     11f8 <main+0xb8>
cmpl   $0x7e,-0x8(%rbp)
jg     11f8 <main+0xb8>
mov    -0x8(%rbp),%eax
sub    $0x21,%eax
cltq
mov    -0x180(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x180(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
sub    $0x21,%eax
cltq
mov    -0x180(%rbp,%rax,4),%eax
cmp    -0x184(%rbp),%eax
jle    11f3 <main+0xb3>
mov    -0x8(%rbp),%eax
sub    $0x21,%eax
cltq
mov    -0x180(%rbp,%rax,4),%eax
mov    %eax,-0x184(%rbp)
jmp    11f8 <main+0xb8>
jmp    117d <main+0x3d>
lea    0xe05(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x184(%rbp),%eax
mov    %eax,-0x188(%rbp)
cmpl   $0x0,-0x188(%rbp)
jle    12d3 <main+0x193>
mov    -0x188(%rbp),%esi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18c(%rbp)
cmpl   $0x5e,-0x18c(%rbp)
jge    12b5 <main+0x175>
mov    -0x188(%rbp),%eax
movslq -0x18c(%rbp),%rcx
sub    -0x180(%rbp,%rcx,4),%eax
cmp    $0x0,%eax
jle    1289 <main+0x149>
lea    0xdc5(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    129c <main+0x15c>
lea    0xdad(%rip),%rdi
mov    $0x7c,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12a1 <main+0x161>
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    1247 <main+0x107>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x188(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x188(%rbp)
jmp    121c <main+0xdc>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x190(%rbp)
cmpl   $0x5e,-0x190(%rbp)
jge    1316 <main+0x1d6>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x190(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x190(%rbp)
jmp    12eb <main+0x1ab>
lea    0xd23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x194(%rbp)
cmpl   $0x5e,-0x194(%rbp)
jge    1366 <main+0x226>
mov    -0x194(%rbp),%esi
add    $0x21,%esi
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    132e <main+0x1ee>
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x180,%rsp
mov    %rsp,%rdi
mov    $0x178,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
mov    0x2e61(%rip),%r14
cmp    (%r14),%eax
jne    11a4 <main+0x54>
lea    0xe76(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1251 <main+0x101>
xor    %r15d,%r15d
jmp    11bc <main+0x6c>
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    (%r14),%eax
je     11d8 <main+0x88>
add    $0xffffffdf,%eax
cmp    $0x5d,%eax
ja     11b0 <main+0x60>
mov    %eax,%eax
mov    (%rsp,%rax,4),%ecx
lea    0x1(%rcx),%edx
mov    %edx,(%rsp,%rax,4)
cmp    %r15d,%ecx
cmovge %edx,%r15d
jmp    11b0 <main+0x60>
lea    0xe2a(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15d,%r15d
jle    1251 <main+0x101>
lea    0xe41(%rip),%r14
jmp    1217 <main+0xc7>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%r15),%eax
cmp    $0x1,%r15d
mov    %eax,%r15d
jle    1251 <main+0x101>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %ebx,%ebx
jmp    123f <main+0xef>
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x5e,%rbx
je     1200 <main+0xb0>
mov    $0x20,%edi
cmp    (%rsp,%rbx,4),%r15d
jg     1230 <main+0xe0>
mov    $0x7c,%edi
jmp    1230 <main+0xe0>
lea    0xde6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5e,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1270 <main+0x120>
lea    0xdb7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x21,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    12a0 <main+0x150>
lea    0xd80(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x180,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\0AInput: \00"
@EOF = global i32 0
@.str.1 = [47 x i8] c"\0A%29cx-axis = character y-axis = quantity\0A\0A\00"
@.str.2 = [5 x i8] c"%3d \00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [5 x i8] c" \00"
@.str.5 = [6 x i8] c"\0A \00"
@.str.6 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [94 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = bitcast [94 x i32]* %3 to i8*
store i32 0, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %42, %0
%12 = call i32 (...) @getchar()
store i32 %12, i32* %2
%13 = load i32, i32* @EOF
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %43
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp sge i32 %16, 33
br i1 %17, label %18, label %42
18: ; preds = %15
%19 = load i32, i32* %2
%20 = icmp sle i32 %19, 126
br i1 %20, label %21, label %42
21: ; preds = %18
%22 = load i32, i32* %2
%23 = sub nsw i32 %22, 33
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [94 x i32], [94 x i32]* %3, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1
store i32 %27, i32* %25
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 33
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [94 x i32], [94 x i32]* %3, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %4
%34 = icmp sgt i32 %32, %33
br i1 %34, label %35, label %41
35: ; preds = %21
%36 = load i32, i32* %2
%37 = sub nsw i32 %36, 33
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [94 x i32], [94 x i32]* %3, i64 0, i64 %38
%40 = load i32, i32* %39
store i32 %40, i32* %4
br label %41
41: ; preds = %35, %21
br label %42
42: ; preds = %41, %18, %15
br label %11
43: ; preds = %11
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 32)
%45 = load i32, i32* %4
store i32 %45, i32* %5
br label %46
46: ; preds = %73, %43
%47 = load i32, i32* %5
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %76
49: ; preds = %46
%50 = load i32, i32* %5
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %50)
store i32 0, i32* %6
br label %52
52: ; preds = %68, %49
%53 = load i32, i32* %6
%54 = icmp slt i32 %53, 94
br i1 %54, label %55, label %71
55: ; preds = %52
%56 = load i32, i32* %5
%57 = load i32, i32* %6
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [94 x i32], [94 x i32]* %3, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = sub nsw i32 %56, %60
%62 = icmp sgt i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %55
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 32)
br label %67
65: ; preds = %55
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 124)
br label %67
67: ; preds = %65, %63
br label %68
68: ; preds = %67
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
br label %52
71: ; preds = %52
%72 = call i32 @putchar(i8 signext 10)
br label %73
73: ; preds = %71
%74 = load i32, i32* %5
%75 = add nsw i32 %74, -1
store i32 %75, i32* %5
br label %46
76: ; preds = %46
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %7
br label %78
78: ; preds = %83, %76
%79 = load i32, i32* %7
%80 = icmp slt i32 %79, 94
br i1 %80, label %81, label %86
81: ; preds = %78
%82 = call i32 @putchar(i8 signext 45)
br label %83
83: ; preds = %81
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 1
store i32 %85, i32* %7
br label %78
86: ; preds = %78
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %8
br label %88
88: ; preds = %95, %86
%89 = load i32, i32* %8
%90 = icmp slt i32 %89, 94
br i1 %90, label %91, label %98
91: ; preds = %88
%92 = load i32, i32* %8
%93 = add nsw i32 %92, 33
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %93)
br label %95
95: ; preds = %91
%96 = load i32, i32* %8
%97 = add nsw i32 %96, 1
store i32 %97, i32* %8
br label %88
98: ; preds = %88
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0AInput: \00"
@EOF = global i32 0
@.str.1 = [47 x i8] c"\0A%29cx-axis = character y-axis = quantity\0A\0A\00"
@.str.2 = [5 x i8] c"%3d \00"
@.str.4 = [5 x i8] c" \00"
@.str.5 = [6 x i8] c"\0A \00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [94 x i32]
%2 = bitcast [94 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 32)
br label %29
9: ; preds = %0, %21
%10 = phi i32 [ %23, %21 ], [ %4, %0 ]
%11 = phi i32 [ %22, %21 ], [ 0, %0 ]
%12 = add i32 %10, -33
%13 = icmp ult i32 %12, 94
br i1 %13, label %14, label %21
14: ; preds = %9
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds [94 x i32], [94 x i32]* %1, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %16
%19 = icmp slt i32 %17, %11
%20 = select i1 %19, i32 %11, i32 %18
br label %21
21: ; preds = %14, %9
%22 = phi i32 [ %11, %9 ], [ %20, %14 ]
%23 = tail call i32 (...) @getchar()
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %9
26: ; preds = %21
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 32)
%28 = icmp sgt i32 %22, 0
br i1 %28, label %31, label %29
29: ; preds = %34, %7, %26
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %49
31: ; preds = %26, %34
%32 = phi i32 [ %36, %34 ], [ %22, %26 ]
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %32)
br label %38
34: ; preds = %38
%35 = tail call i32 @putchar(i8 signext 10)
%36 = add nsw i32 %32, -1
%37 = icmp sgt i32 %32, 1
br i1 %37, label %31, label %29
38: ; preds = %31, %38
%39 = phi i64 [ 0, %31 ], [ %45, %38 ]
%40 = getelementptr inbounds [94 x i32], [94 x i32]* %1, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = icmp sgt i32 %32, %41
%43 = select i1 %42, i32 32, i32 124
%44 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 %43)
%45 = add nuw nsw i64 %39, 1
%46 = icmp eq i64 %45, 94
br i1 %46, label %34, label %38
47: ; preds = %49
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %56
49: ; preds = %29, %49
%50 = phi i32 [ 0, %29 ], [ %52, %49 ]
%51 = tail call i32 @putchar(i8 signext 45)
%52 = add nuw nsw i32 %50, 1
%53 = icmp eq i32 %52, 94
br i1 %53, label %47, label %49
54: ; preds = %56
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
56: ; preds = %47, %56
%57 = phi i32 [ 0, %47 ], [ %60, %56 ]
%58 = add nuw nsw i32 %57, 33
%59 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 %58)
%60 = add nuw nsw i32 %57, 1
%61 = icmp eq i32 %60, 94
br i1 %61, label %54, label %56
}