#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();
scalar_t__ isalnum(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
main() {
  int frenquency[128];
  int c, i, j;
  for (i = 0; i < 128; i++) {
    frenquency[i] = 0;
  }
  while ((c = getchar()) != EOF) {
    if (isalnum(c)) {
      frenquency[c]++;
    }
  }
  for (i = 0; i < 128; i++) {
    if (frenquency[i] == 0) {
      continue;
    }
    printf("%c: ", i);
    for (j = 0; j < frenquency[i]; j++) {
      putchar('*');
    }
    putchar('\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    1192 <main+0x52>
movslq -0x218(%rbp),%rax
movl   $0x0,-0x210(%rbp,%rax,4)
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x218(%rbp)
jmp    115c <main+0x1c>
jmp    1197 <main+0x57>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x214(%rbp)
mov    0x2e3d(%rip),%rcx
cmp    (%rcx),%eax
je     11e5 <main+0xa5>
mov    -0x214(%rbp),%edi
call   1050 <isalnum@plt>
cmp    $0x0,%rax
je     11e0 <main+0xa0>
movslq -0x214(%rbp),%rax
mov    -0x210(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x210(%rbp,%rax,4)
jmp    1197 <main+0x57>
movl   $0x0,-0x218(%rbp)
cmpl   $0x80,-0x218(%rbp)
jge    128b <main+0x14b>
movslq -0x218(%rbp),%rax
cmpl   $0x0,-0x210(%rbp,%rax,4)
jne    1219 <main+0xd9>
jmp    1277 <main+0x137>
mov    -0x218(%rbp),%esi
lea    0xdda(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x21c(%rbp)
mov    -0x21c(%rbp),%eax
movslq -0x218(%rbp),%rcx
cmp    -0x210(%rbp,%rcx,4),%eax
jge    126d <main+0x12d>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x21c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21c(%rbp)
jmp    1235 <main+0xf5>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x218(%rbp)
jmp    11ef <main+0xaf>
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   1060 <memset@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
mov    0x2e70(%rip),%r14
cmp    (%r14),%eax
jne    11df <main+0x8f>
xor    %ebx,%ebx
lea    0xe7a(%rip),%r14
jmp    11a7 <main+0x57>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x80,%rbx
je     11d1 <main+0x81>
mov    (%rsp,%rbx,4),%ebp
test   %ebp,%ebp
je     119a <main+0x4a>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
test   %ebp,%ebp
jle    1190 <main+0x40>
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11c0 <main+0x70>
jmp    1190 <main+0x40>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebx
jmp    1202 <main+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1070 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     117d <main+0x2d>
mov    %ebx,%edi
call   1050 <isalnum@plt>
test   %rax,%rax
je     11f0 <main+0xa0>
movslq %ebx,%rax
addl   $0x1,(%rsp,%rax,4)
jmp    11f0 <main+0xa0>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"%c: \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 = %31, %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 %32
21: ; preds = %17
%22 = load i32, i32* %3
%23 = call i64 @isalnum(i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
store i32 %30, i32* %28
br label %31
31: ; preds = %25, %21
br label %17
32: ; preds = %17
store i32 0, i32* %4
br label %33
33: ; preds = %60, %32
%34 = load i32, i32* %4
%35 = icmp slt i32 %34, 128
br i1 %35, label %36, label %63
36: ; preds = %33
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %36
br label %60
43: ; preds = %36
%44 = load i32, i32* %4
%45 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %44)
store i32 0, i32* %5
br label %46
46: ; preds = %55, %43
%47 = load i32, i32* %5
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = icmp slt i32 %47, %51
br i1 %52, label %53, label %58
53: ; preds = %46
%54 = call i32 @putchar(i8 signext 42)
br label %55
55: ; preds = %53
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %46
58: ; preds = %46
%59 = call i32 @putchar(i8 signext 10)
br label %60
60: ; preds = %58, %42
%61 = load i32, i32* %4
%62 = add nsw i32 %61, 1
store i32 %62, i32* %4
br label %33
63: ; preds = %33
%64 = load i32, i32* %1
ret i32 %64
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"%c: \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 %19, label %6
6: ; preds = %0, %15
%7 = phi i32 [ %16, %15 ], [ %3, %0 ]
%8 = tail call i64 @isalnum(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = sext i32 %7 to i64
%12 = getelementptr inbounds [128 x i32], [128 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, %36
%21 = phi i64 [ %37, %36 ], [ 0, %19 ]
%22 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %36, label %25
25: ; preds = %20
%26 = trunc i64 %21 to i32
%27 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = icmp sgt i32 %23, 0
br i1 %28, label %29, label %34
29: ; preds = %25, %29
%30 = phi i32 [ %32, %29 ], [ 0, %25 ]
%31 = tail call i32 @putchar(i8 signext 42)
%32 = add nuw nsw i32 %30, 1
%33 = icmp eq i32 %32, %23
br i1 %33, label %34, label %29
34: ; preds = %29, %25
%35 = tail call i32 @putchar(i8 signext 10)
br label %36
36: ; preds = %20, %34
%37 = add nuw nsw i64 %21, 1
%38 = icmp eq i64 %37, 128
br i1 %38, label %39, label %20
39: ; preds = %36
ret i32 0
}