#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 */
typedef int /*<<< orphan*/ string;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
scalar_t__ isalpha(char);
scalar_t__ islower(char);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(void) {
  int i, alpha[26] = {0};
  char string[1201];
  while (fgets(string, sizeof(string), stdin) != NULL) {
    for (i = 0; i < strlen(string); i++) {
      if (isalpha(string[i])) {
        if (islower(string[i])) {
          alpha[string[i] - 'a']++;
        } else {
          alpha[string[i] - 'A']++;
        }
      }
    }
  }
  for (i = 0; i < 26; i++)
    printf("%c : %d\n", i + 'a', alpha[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x540,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1060 <memset@plt>
lea    -0x530(%rbp),%rdi
mov    0x2e58(%rip),%rax
mov    (%rax),%edx
mov    $0x4b1,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1262 <main+0x102>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x534(%rbp)
lea    -0x530(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x534(%rbp),%eax
cmp    %ecx,%eax
jge    125d <main+0xfd>
movslq -0x8(%rbp),%rax
movsbl -0x530(%rbp,%rax,1),%edi
ff
call   1080 <isalpha@plt>
cmp    $0x0,%rax
je     124a <main+0xea>
movslq -0x8(%rbp),%rax
movsbl -0x530(%rbp,%rax,1),%edi
ff
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1229 <main+0xc9>
movslq -0x8(%rbp),%rax
movsbl -0x530(%rbp,%rax,1),%eax
ff
sub    $0x61,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    1245 <main+0xe5>
movslq -0x8(%rbp),%rax
movsbl -0x530(%rbp,%rax,1),%eax
ff
sub    $0x41,%eax
cltq
mov    -0x70(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
jmp    124a <main+0xea>
jmp    124f <main+0xef>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ad <main+0x4d>
jmp    1182 <main+0x22>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    129b <main+0x13b>
mov    -0x8(%rbp),%esi
add    $0x61,%esi
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%edx
lea    0xd78(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1269 <main+0x109>
xor    %eax,%eax
add    $0x540,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x530,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
mov    0x2e5c(%rip),%r14
mov    (%r14),%edx
lea    0x70(%rsp),%rdi
mov    $0x4b1,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     122b <main+0xdb>
lea    0x70(%rsp),%r15
jmp    11c5 <main+0x75>
xchg   %ax,%ax
mov    (%r14),%edx
mov    %r15,%rdi
mov    $0x4b1,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     122b <main+0xdb>
mov    %r15,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11b0 <main+0x60>
xor    %ebx,%ebx
jmp    11f3 <main+0xa3>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11b0 <main+0x60>
movsbl 0x70(%rsp,%rbx,1),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
je     11e0 <main+0x90>
movsbl 0x70(%rsp,%rbx,1),%edi
call   1030 <islower@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
movsbq 0x70(%rsp,%rbx,1),%rax
shl    $0x5,%rcx
add    %rax,%rcx
addl   $0x1,-0x184(%rsp,%rcx,4)
01
jmp    11e0 <main+0x90>
xor    %ebx,%ebx
lea    0xdcc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsp,%rbx,4),%edx
lea    0x61(%rbx),%esi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x1a,%rbx
jne    1240 <main+0xf0>
xor    %eax,%eax
add    $0x530,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [9 x i8] c"%c : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [26 x i32]
%4 = alloca [1201 x i8]
store i32 0, i32* %1
%5 = bitcast [26 x i32]* %3 to i8*
br label %6
6: ; preds = %58, %0
%7 = getelementptr inbounds [1201 x i8], [1201 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32* @fgets(i8* %7, i32 1201, i32 %8)
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %59
11: ; preds = %6
store i32 0, i32* %2
br label %12
12: ; preds = %55, %11
%13 = load i32, i32* %2
%14 = getelementptr inbounds [1201 x i8], [1201 x i8]* %4, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %58
17: ; preds = %12
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [1201 x i8], [1201 x i8]* %4, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = call i64 @isalpha(i8 signext %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %54
24: ; preds = %17
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [1201 x i8], [1201 x i8]* %4, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = call i64 @islower(i8 signext %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %42
31: ; preds = %24
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [1201 x i8], [1201 x i8]* %4, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = sub nsw i32 %36, 97
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = add nsw i32 %40, 1
store i32 %41, i32* %39
br label %53
42: ; preds = %24
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [1201 x i8], [1201 x i8]* %4, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = sub nsw i32 %47, 65
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = add nsw i32 %51, 1
store i32 %52, i32* %50
br label %53
53: ; preds = %42, %31
br label %54
54: ; preds = %53, %17
br label %55
55: ; preds = %54
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %12
58: ; preds = %12
br label %6
59: ; preds = %6
store i32 0, i32* %2
br label %60
60: ; preds = %71, %59
%61 = load i32, i32* %2
%62 = icmp slt i32 %61, 26
br i1 %62, label %63, label %74
63: ; preds = %60
%64 = load i32, i32* %2
%65 = add nsw i32 %64, 97
%66 = load i32, i32* %2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %67
%69 = load i32, i32* %68
%70 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %65, i32 %69)
br label %71
71: ; preds = %63
%72 = load i32, i32* %2
%73 = add nsw i32 %72, 1
store i32 %73, i32* %2
br label %60
74: ; preds = %60
ret i32 0
}

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