#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 /*<<< orphan*/ output(int, int, int, int, char *, int *);
int /*<<< orphan*/ scanf(char *, char *);
void create_letter_distribution_diagram() {
  int letters = 26, 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) {
    scanf("%c", &letter);
    if (letter != 'b') {
      for (i = 0; i < letters; i++) {
        if (letter == alphabet[i - ('z' - 'Z')] || letter == alphabet[i]) {
          times[i]++;
          if (times[i] < maximum) {
            times[i] = maximum;
          }
        }
      }
    } else {
      break;
    }
  }
  output(i, count, letters, maximum, alphabet, times);
}


x86 assembly (clang, -O0):
<create_letter_distribution_diagram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x370,%rsp
movl   $0x1a,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x338(%rbp)
movb   $0x61,-0x361(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x361(%rbp),%eax
cmp    $0x7a,%eax
jg     119d <create_letter_distribution_diagram+0x7d>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x330(%rbp,%rax,4)
mov    -0x361(%rbp),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x360(%rbp,%rax,1)
mov    -0x361(%rbp),%al
add    $0x1,%al
mov    %al,-0x361(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <create_letter_distribution_diagram+0x31>
jmp    11a2 <create_letter_distribution_diagram+0x82>
lea    0xe57(%rip),%rdi
lea    -0x361(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x361(%rbp),%eax
cmp    $0x62,%eax
je     1288 <create_letter_distribution_diagram+0x168>
movl   $0x0,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1283 <create_letter_distribution_diagram+0x163>
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     121f <create_letter_distribution_diagram+0xff>
movsbl -0x361(%rbp),%eax
movslq -0x334(%rbp),%rcx
movsbl -0x360(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    126a <create_letter_distribution_diagram+0x14a>
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    1265 <create_letter_distribution_diagram+0x145>
mov    -0x338(%rbp),%ecx
movslq -0x334(%rbp),%rax
mov    %ecx,-0x330(%rbp,%rax,4)
jmp    126a <create_letter_distribution_diagram+0x14a>
jmp    126f <create_letter_distribution_diagram+0x14f>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    11cf <create_letter_distribution_diagram+0xaf>
jmp    128d <create_letter_distribution_diagram+0x16d>
jmp    1292 <create_letter_distribution_diagram+0x172>
jmp    11a2 <create_letter_distribution_diagram+0x82>
mov    -0x334(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x338(%rbp),%ecx
lea    -0x360(%rbp),%r8
lea    -0x330(%rbp),%r9
call   1030 <output@plt>
add    $0x370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_letter_distribution_diagram>:
push   %r15
push   %r14
push   %rbx
sub    $0x350,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movq   $0x0,0x90(%rsp)
movaps 0xe9d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x7877767574737271,%rax
76 77 78
mov    %rax,0x20(%rsp)
movw   $0x7a79,0x28(%rsp)
movb   $0x7b,0xf(%rsp)
lea    0xe86(%rip),%r14
lea    0xf(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xf(%rsp),%al
xor    %ebx,%ebx
jmp    11c3 <create_letter_distribution_diagram+0xa3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xf(%rsp),%al
cmp    $0x62,%al
je     11f9 <create_letter_distribution_diagram+0xd9>
xor    %ecx,%ecx
jmp    11eb <create_letter_distribution_diagram+0xcb>
nopw   0x0(%rax,%rax,1)
mov    0x30(%rsp,%rcx,4),%edx
lea    0x1(%rdx),%esi
cmp    $0xffffffff,%edx
cmovl  %ebx,%esi
mov    %esi,0x30(%rsp,%rcx,4)
add    $0x1,%rcx
cmp    $0x1a,%rcx
je     11b0 <create_letter_distribution_diagram+0x90>
cmp    -0x10(%rsp,%rcx,1),%al
je     11d0 <create_letter_distribution_diagram+0xb0>
cmp    0x10(%rsp,%rcx,1),%al
je     11d0 <create_letter_distribution_diagram+0xb0>
jmp    11e1 <create_letter_distribution_diagram+0xc1>
lea    0x10(%rsp),%r8
lea    0x30(%rsp),%r9
mov    $0x1a,%edi
mov    $0x1a,%esi
mov    $0x1a,%edx
xor    %ecx,%ecx
call   1030 <output@plt>
add    $0x350,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\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 = alloca i8
%5 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 0
%6 = 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>* %6
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 16
store i8 113, i8* %7
%8 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 17
store i8 114, i8* %8
%9 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 18
store i8 115, i8* %9
%10 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 19
store i8 116, i8* %10
%11 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 20
store i8 117, i8* %11
%12 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 21
store i8 118, i8* %12
%13 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 22
store i8 119, i8* %13
%14 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 23
store i8 120, i8* %14
%15 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 24
store i8 121, i8* %15
%16 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 25
store i8 122, i8* %16
store i8 123, i8* %4
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%18 = load i8, i8* %4
%19 = icmp ne i8 %18, 98
br label %24
20: ; preds = %42
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%22 = load i8, i8* %4
%23 = icmp eq i8 %22, 98
br i1 %23, label %45, label %24
24: ; preds = %0, %20
%25 = phi i8 [ %22, %20 ], [ %18, %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 = %20
%46 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 0
%47 = call i32 @output(i32 26, i32 26, i32 26, i32 0, i8* %5, i32* %46)
ret void
}