#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 *, char, int);
void create_letter_distribution_diagram() {
  int count = 0, times[200], i, maximum = 0;
  char alphabet[26], letter;
  for (letter = 'a', count = 0; letter <= 'z'; letter++, count++) {
    times[count] = 0;
    alphabet[count] = letter;
  }
  while (1) {
    letter = getchar();
    if (letter == EOF) {
      break;
    }
    for (i = 0; i < 26; i++) {
      if (letter == alphabet[i - ('z' - 'Z')] || letter == alphabet[i]) {
        times[i]++;
        if (times[i] < maximum) {
          times[i] = maximum;
        }
      }
    }
  }
  for (i = maximum; i >= 0; i++) {
    for (count = 0; count < 26; count++) {
      if (times[count] == i) {
        printf("\n%c: %d", alphabet[i], count);
      }
    }
  }
}


x86 assembly (clang, -O0):
<create_letter_distribution_diagram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x370,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x338(%rbp)
movb   $0x61,-0x361(%rbp)
movl   $0x0,-0x4(%rbp)
movsbl -0x361(%rbp),%eax
cmp    $0x7a,%eax
jg     1196 <create_letter_distribution_diagram+0x76>
movslq -0x4(%rbp),%rax
movl   $0x0,-0x330(%rbp,%rax,4)
mov    -0x361(%rbp),%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x360(%rbp,%rax,1)
mov    -0x361(%rbp),%al
add    $0x1,%al
mov    %al,-0x361(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <create_letter_distribution_diagram+0x2a>
jmp    119b <create_letter_distribution_diagram+0x7b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x361(%rbp)
movsbl -0x361(%rbp),%eax
mov    0x2e32(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    11c6 <create_letter_distribution_diagram+0xa6>
jmp    1287 <create_letter_distribution_diagram+0x167>
movl   $0x0,-0x334(%rbp)
cmpl   $0x1a,-0x334(%rbp)
jge    1282 <create_letter_distribution_diagram+0x162>
movsbl -0x361(%rbp),%eax
mov    -0x334(%rbp),%ecx
sub    $0x20,%ecx
movslq %ecx,%rcx
movsbl -0x360(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     121e <create_letter_distribution_diagram+0xfe>
movsbl -0x361(%rbp),%eax
movslq -0x334(%rbp),%rcx
movsbl -0x360(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    1269 <create_letter_distribution_diagram+0x149>
movslq -0x334(%rbp),%rax
mov    -0x330(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x330(%rbp,%rax,4)
movslq -0x334(%rbp),%rax
mov    -0x330(%rbp,%rax,4),%eax
cmp    -0x338(%rbp),%eax
jge    1264 <create_letter_distribution_diagram+0x144>
mov    -0x338(%rbp),%ecx
movslq -0x334(%rbp),%rax
mov    %ecx,-0x330(%rbp,%rax,4)
jmp    1269 <create_letter_distribution_diagram+0x149>
jmp    126e <create_letter_distribution_diagram+0x14e>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    11d0 <create_letter_distribution_diagram+0xb0>
jmp    119b <create_letter_distribution_diagram+0x7b>
mov    -0x338(%rbp),%eax
mov    %eax,-0x334(%rbp)
cmpl   $0x0,-0x334(%rbp)
jl     1314 <create_letter_distribution_diagram+0x1f4>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1a,-0x4(%rbp)
jge    12fb <create_letter_distribution_diagram+0x1db>
movslq -0x4(%rbp),%rax
mov    -0x330(%rbp,%rax,4),%eax
cmp    -0x334(%rbp),%eax
jne    12e8 <create_letter_distribution_diagram+0x1c8>
movslq -0x334(%rbp),%rax
mov    -0x360(%rbp,%rax,1),%al
mov    -0x4(%rbp),%edx
lea    0xd20(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    12ed <create_letter_distribution_diagram+0x1cd>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12a7 <create_letter_distribution_diagram+0x187>
jmp    1300 <create_letter_distribution_diagram+0x1e0>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    1293 <create_letter_distribution_diagram+0x173>
add    $0x370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_letter_distribution_diagram>:
push   %r15
push   %r14
push   %rbx
sub    $0x340,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movq   $0x0,0x80(%rsp)
movaps 0xea0(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x7877767574737271,%rax
76 77 78
mov    %rax,0x10(%rsp)
movw   $0x7a79,0x18(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e5e(%rip),%r14
jmp    1197 <create_letter_distribution_diagram+0x77>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
je     11c8 <create_letter_distribution_diagram+0xa8>
xor    %ecx,%ecx
jmp    11bb <create_letter_distribution_diagram+0x9b>
mov    0x20(%rsp,%rcx,4),%edx
lea    0x1(%rdx),%esi
cmp    $0xffffffff,%edx
cmovl  %ebx,%esi
mov    %esi,0x20(%rsp,%rcx,4)
add    $0x1,%rcx
cmp    $0x1a,%rcx
je     1190 <create_letter_distribution_diagram+0x70>
cmp    -0x20(%rsp,%rcx,1),%al
je     11a0 <create_letter_distribution_diagram+0x80>
cmp    (%rsp,%rcx,1),%al
je     11a0 <create_letter_distribution_diagram+0x80>
jmp    11b1 <create_letter_distribution_diagram+0x91>
xor    %r15d,%r15d
lea    0xe3e(%rip),%r14
jmp    11e4 <create_letter_distribution_diagram+0xc4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r15
xor    %ebx,%ebx
jmp    11fa <create_letter_distribution_diagram+0xda>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x1a,%rbx
je     11e0 <create_letter_distribution_diagram+0xc0>
mov    0x20(%rsp,%rbx,4),%eax
cmp    %rax,%r15
jne    11f0 <create_letter_distribution_diagram+0xd0>
movsbl (%rsp,%r15,1),%esi
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
jmp    11f0 <create_letter_distribution_diagram+0xd0>

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

LLVM IR (-O2):
@EOF = global i8 0
@.str = [8 x i8] c"\0A%c: %d\00"
define void @create_letter_distribution_diagram() {
%1 = alloca [200 x i32]
%2 = bitcast [200 x i32]* %1 to i8*
%3 = alloca [26 x i8]
%4 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 0
%5 = bitcast [26 x i8]* %3 to <16 x i8>*
store <16 x i8> <i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111, i8 112>, <16 x i8>* %5
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 16
store i8 113, i8* %6
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 17
store i8 114, i8* %7
%8 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 18
store i8 115, i8* %8
%9 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 19
store i8 116, i8* %9
%10 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 20
store i8 117, i8* %10
%11 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 21
store i8 118, i8* %11
%12 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 22
store i8 119, i8* %12
%13 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 23
store i8 120, i8* %13
%14 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 24
store i8 121, i8* %14
%15 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 25
store i8 122, i8* %15
%16 = tail call signext i8 (...) @getchar()
%17 = load i8, i8* @EOF
%18 = icmp eq i8 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %20, %0
br label %45
20: ; preds = %42
%21 = tail call signext i8 (...) @getchar()
%22 = load i8, i8* @EOF
%23 = icmp eq i8 %21, %22
br i1 %23, label %19, label %24
24: ; preds = %0, %20
%25 = phi i8 [ %21, %20 ], [ %16, %0 ]
br label %26
26: ; preds = %24, %42
%27 = phi i64 [ 0, %24 ], [ %43, %42 ]
%28 = add nuw nsw i64 %27, -32
%29 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %25, %30
br i1 %31, label %36, label %32
32: ; preds = %26
%33 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 %27
%34 = load i8, i8* %33
%35 = icmp eq i8 %25, %34
br i1 %35, label %36, label %42
36: ; preds = %32, %26
%37 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %27
%38 = load i32, i32* %37
%39 = add nsw i32 %38, 1
%40 = icmp slt i32 %38, -1
%41 = select i1 %40, i32 0, i32 %39
store i32 %41, i32* %37
br label %42
42: ; preds = %36, %32
%43 = add nuw nsw i64 %27, 1
%44 = icmp eq i64 %43, 26
br i1 %44, label %20, label %26
45: ; preds = %19, %61
%46 = phi i64 [ %62, %61 ], [ 0, %19 ]
%47 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 %46
br label %48
48: ; preds = %45, %58
%49 = phi i64 [ 0, %45 ], [ %59, %58 ]
%50 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = zext i32 %51 to i64
%53 = icmp eq i64 %46, %52
br i1 %53, label %54, label %58
54: ; preds = %48
%55 = load i8, i8* %47
%56 = trunc i64 %49 to i32
%57 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %55, i32 %56)
br label %58
58: ; preds = %48, %54
%59 = add nuw nsw i64 %49, 1
%60 = icmp eq i64 %59, 26
br i1 %60, label %61, label %48
61: ; preds = %58
%62 = add nuw i64 %46, 1
br label %45
}