#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 c, i, j;
  int nchar['z' - ' ' + 1];
  for (i = 0; i < 'z' - ' ' + 1; ++i)
    nchar[i] = 0;
  while ((c = getchar()) != EOF)
    if (c >= ' ' && c <= 'z')
      ++nchar[c - ' '];
  for (i = 0; i < 'z' - ' ' + 1; ++i) {
    printf("%c: ", i + ' ');
    for (j = 0; j < nchar[i]; ++j)
      printf("-");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5b,-0xc(%rbp)
jge    1160 <main+0x40>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x180(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x19>
jmp    1165 <main+0x45>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%eax
je     11b0 <main+0x90>
cmpl   $0x20,-0x8(%rbp)
jl     11ab <main+0x8b>
cmpl   $0x7a,-0x8(%rbp)
jg     11ab <main+0x8b>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cltq
mov    -0x180(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x180(%rbp,%rax,4)
jmp    1165 <main+0x45>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5b,-0xc(%rbp)
jge    1228 <main+0x108>
mov    -0xc(%rbp),%esi
add    $0x20,%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x180(%rbp,%rcx,4),%eax
jge    120c <main+0xec>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11dc <main+0xbc>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b7 <main+0x97>
mov    -0x4(%rbp),%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x170,%rsp
mov    %rsp,%rdi
mov    $0x16c,%edx
xor    %esi,%esi
call   1050 <memset@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e80(%rip),%rbx
jmp    1177 <main+0x37>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%eax
je     118b <main+0x4b>
add    $0xffffffe0,%eax
cmp    $0x5a,%eax
ja     1170 <main+0x30>
mov    %eax,%eax
addl   $0x1,(%rsp,%rax,4)
jmp    1170 <main+0x30>
lea    0xe6e(%rip),%r14
xor    %ebx,%ebx
jmp    11b4 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x5b,%rbx
je     11e1 <main+0xa1>
lea    0x20(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%rbx,4),%ebp
test   %ebp,%ebp
jle    11a0 <main+0x60>
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11d0 <main+0x90>
jmp    11a0 <main+0x60>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"%c: \00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [91 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 91
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [91 x i32], [91 x i32]* %5, i64 0, i64 %11
store i32 0, i32* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
br label %17
17: ; preds = %34, %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 %35
21: ; preds = %17
%22 = load i32, i32* %2
%23 = icmp sge i32 %22, 32
br i1 %23, label %24, label %34
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp sle i32 %25, 122
br i1 %26, label %27, label %34
27: ; preds = %24
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 32
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [91 x i32], [91 x i32]* %5, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = add nsw i32 %32, 1
store i32 %33, i32* %31
br label %34
34: ; preds = %27, %24, %21
br label %17
35: ; preds = %17
store i32 0, i32* %3
br label %36
36: ; preds = %57, %35
%37 = load i32, i32* %3
%38 = icmp slt i32 %37, 91
br i1 %38, label %39, label %60
39: ; preds = %36
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %41)
store i32 0, i32* %4
br label %43
43: ; preds = %52, %39
%44 = load i32, i32* %4
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [91 x i32], [91 x i32]* %5, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = icmp slt i32 %44, %48
br i1 %49, label %50, label %55
50: ; preds = %43
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %52
52: ; preds = %50
%53 = load i32, i32* %4
%54 = add nsw i32 %53, 1
store i32 %54, i32* %4
br label %43
55: ; preds = %43
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %57
57: ; preds = %55
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %36
60: ; preds = %36
%61 = load i32, i32* %1
ret i32 %61
}

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