#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 */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  char c;
  int alphasize = ('Z' - 'A');
  char letters[('Z' - 'A') + 1];
  int i;
  int n;
  for (i = 0; i <= alphasize; i++) {
    letters[i] = 0;
  }
  while ((c = getchar()) != EOF) {
    if (((c >= 'A') && (c <= 'Z'))) {
      letters[c - 'A']++;
    } else if ((c >= 'a') && (c <= 'z')) {
      letters[c - 'a']++;
    } else {
    }
  }
  printf("\t0         10        20        30        40\n");
  printf("\t|    5    |    15   |    25   |    35   |\n");
  printf("________|____|____|____|____|____|____|____|____|___\n");
  printf("\t|\n");
  for (i = 0; i <= alphasize; i++) {
    printf("%c %3d\t", i + 'A', letters[i]);
    for (n = 0; n <= letters[i]; n++) {
      if (n == 0) {
        printf("|");
      }
      if ((n) == letters[i]) {
        printf(">");
      } else {
        printf("-");
      }
    }
    printf("\n");
  }
  printf("________|___________________________________________\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x19,-0xc(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1160 <main+0x40>
movslq -0x34(%rbp),%rax
movb   $0x0,-0x30(%rbp,%rax,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113d <main+0x1d>
jmp    1165 <main+0x45>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e6f(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11f9 <main+0xd9>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     11b7 <main+0x97>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11b7 <main+0x97>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
cltq
mov    -0x30(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x30(%rbp,%rax,1)
jmp    11f4 <main+0xd4>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     11ea <main+0xca>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     11ea <main+0xca>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
cltq
mov    -0x30(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x30(%rbp,%rax,1)
jmp    11ef <main+0xcf>
jmp    11ef <main+0xcf>
jmp    11f4 <main+0xd4>
jmp    1165 <main+0x45>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     12f8 <main+0x1d8>
mov    -0x34(%rbp),%esi
add    $0x41,%esi
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edx
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
movslq -0x34(%rbp),%rcx
movsbl -0x30(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jg     12dc <main+0x1bc>
cmpl   $0x0,-0x38(%rbp)
jne    1294 <main+0x174>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
movslq -0x34(%rbp),%rcx
movsbl -0x30(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    12bb <main+0x19b>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c9 <main+0x1a9>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ce <main+0x1ae>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1268 <main+0x148>
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1238 <main+0x118>
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0xa(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e84(%rip),%rbx
cmp    (%rbx),%al
jne    1231 <main+0xf1>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
lea    0xefd(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5d(%rip),%r14
mov    $0x3e,%r15d
xor    %ebx,%ebx
jmp    11ce <main+0x8e>
nopl   (%rax)
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x1a,%rbx
je     1218 <main+0xd8>
movsbl (%rsp,%rbx,1),%ebp
lea    0x41(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
js     11ba <main+0x7a>
mov    $0x7c,%edi
call   1030 <putchar@plt>
test   %bpl,%bpl
je     11b0 <main+0x70>
mov    $0x2d,%edi
call   1030 <putchar@plt>
xchg   %ax,%ax
cmp    $0x1,%ebp
mov    $0x2d,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1200 <main+0xc0>
jmp    11ba <main+0x7a>
lea    0xe78(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffff9f,%ecx
lea    0x20(%rcx),%rbp
jmp    1259 <main+0x119>
nopl   0x0(%rax)
movsbq %al,%rax
add    %eax,%ecx
addb   $0x1,(%rsp,%rcx,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%al
je     116c <main+0x2c>
lea    -0x41(%rax),%edx
mov    %rbp,%rcx
cmp    $0x1a,%dl
jb     1240 <main+0x100>
lea    -0x61(%rax),%edx
mov    $0xffffff9f,%ecx
cmp    $0x19,%dl
jbe    1240 <main+0x100>
jmp    124a <main+0x10a>

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

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