#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 */
scalar_t__ EOF;
scalar_t__ isalpha(char);
scalar_t__ islower(char);
int /*<<< orphan*/ printf(char *, char, int);
scalar_t__ scanf(char *, char *);
char tolower(char);
int main(void) {
  int alpha[26] = {0}, i;
  char c;
  while (scanf("%c", &c) != EOF) {
    if (isalpha(c) != 0) {
      if (islower(c) != 0) {
        alpha[c - 'a']++;
      } else {
        alpha[tolower(c) - 'a']++;
      }
    }
  }
  for (i = 0; i < 26; i++)
    printf("%c : %d\n", 'a' + i, alpha[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1050 <memset@plt>
lea    0xe77(%rip),%rdi
lea    -0x75(%rbp),%rsi
call   1080 <scanf@plt>
mov    0x2e4f(%rip),%rcx
cmp    (%rcx),%rax
je     1207 <main+0xa7>
movsbl -0x75(%rbp),%edi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
je     1202 <main+0xa2>
movsbl -0x75(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     11e1 <main+0x81>
movsbl -0x75(%rbp),%eax
sub    $0x61,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    11fd <main+0x9d>
movsbl -0x75(%rbp),%edi
call   1060 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    1202 <main+0xa2>
jmp    1182 <main+0x22>
movl   $0x0,-0x74(%rbp)
cmpl   $0x1a,-0x74(%rbp)
jge    1243 <main+0xe3>
mov    -0x74(%rbp),%eax
add    $0x61,%eax
movslq -0x74(%rbp),%rcx
mov    -0x70(%rbp,%rcx,4),%edx
lea    0xdd6(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    120e <main+0xae>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x70(%rsp)
lea    0xe73(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x2e4a(%rip),%r15
cmp    (%r15),%rax
jne    11db <main+0x8b>
xor    %ebx,%ebx
lea    0xe57(%rip),%r14
nopl   0x0(%rax)
lea    0x61(%rbx),%eax
mov    0x10(%rsp,%rbx,4),%edx
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x1a,%rbx
jne    11b0 <main+0x60>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe1e(%rip),%r14
lea    0xf(%rsp),%rbx
jmp    120c <main+0xbc>
nopl   0x0(%rax)
movsbq %al,%rax
addl   $0x1,-0x174(%rsp,%rax,4)
01
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmp    (%r15),%rax
je     11a3 <main+0x53>
movsbl 0xf(%rsp),%edi
call   1060 <isalpha@plt>
test   %rax,%rax
je     11fc <main+0xac>
movsbl 0xf(%rsp),%edi
call   1030 <islower@plt>
mov    %rax,%rcx
movzbl 0xf(%rsp),%eax
test   %rcx,%rcx
jne    11f0 <main+0xa0>
movsbl %al,%edi
call   1050 <tolower@plt>
jmp    11f0 <main+0xa0>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.1 = [9 x i8] c"%c : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [26 x i32]
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = bitcast [26 x i32]* %2 to i8*
br label %6
6: ; preds = %36, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %6
%11 = load i8, i8* %4
%12 = call i64 @isalpha(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %36
14: ; preds = %10
%15 = load i8, i8* %4
%16 = call i64 @islower(i8 signext %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 97
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
store i32 %25, i32* %23
br label %35
26: ; preds = %14
%27 = load i8, i8* %4
%28 = call signext i8 @tolower(i8 signext %27)
%29 = sext i8 %28 to i32
%30 = sub nsw i32 %29, 97
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = add nsw i32 %33, 1
store i32 %34, i32* %32
br label %35
35: ; preds = %26, %18
br label %36
36: ; preds = %35, %10
br label %6
37: ; preds = %6
store i32 0, i32* %3
br label %38
38: ; preds = %50, %37
%39 = load i32, i32* %3
%40 = icmp slt i32 %39, 26
br i1 %40, label %41, label %53
41: ; preds = %38
%42 = load i32, i32* %3
%43 = add nsw i32 97, %42
%44 = trunc i32 %43 to i8
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %44, i32 %48)
br label %50
50: ; preds = %41
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %38
53: ; preds = %38
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.1 = [9 x i8] c"%c : %d\0A\00"
define i32 @main() {
%1 = alloca [26 x i32]
%2 = alloca i8
%3 = bitcast [26 x i32]* %1 to i8*
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %29, label %7
7: ; preds = %0, %25
%8 = load i8, i8* %2
%9 = call i64 @isalpha(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %25, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = call i64 @islower(i8 signext %12)
%14 = icmp eq i64 %13, 0
%15 = load i8, i8* %2
br i1 %14, label %16, label %18
16: ; preds = %11
%17 = call signext i8 @tolower(i8 signext %15)
br label %18
18: ; preds = %11, %16
%19 = phi i8 [ %17, %16 ], [ %15, %11 ]
%20 = sext i8 %19 to i64
%21 = add nsw i64 %20, -97
%22 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
store i32 %24, i32* %22
br label %25
25: ; preds = %18, %7
%26 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%27 = load i64, i64* @EOF
%28 = icmp eq i64 %26, %27
br i1 %28, label %29, label %7
29: ; preds = %25, %0
br label %30
30: ; preds = %29, %30
%31 = phi i64 [ %37, %30 ], [ 0, %29 ]
%32 = trunc i64 %31 to i8
%33 = add nuw nsw i8 %32, 97
%34 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 %31
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %33, i32 %35)
%37 = add nuw nsw i64 %31, 1
%38 = icmp eq i64 %37, 26
br i1 %38, label %39, label %30
39: ; preds = %30
ret i32 0
}