#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 *, int, char);
int main() {
  int i;
  char c;
  char data['Z'];
  for (i = 'A'; i <= 'Z'; ++i)
    data[i] = 0;
  while ((c = getchar()) != EOF) {
    if (c >= 'a')
      c -= 'a' - 'A';
    if (c >= 'A' && c <= 'Z')
      ++data[c];
  }
  for (i = 'A'; i <= 'Z'; ++i)
    printf("%c: %d\t", i, data[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jg     1157 <main+0x37>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
jmp    115c <main+0x3c>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2e78(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11c1 <main+0xa1>
movsbl -0x9(%rbp),%eax
cmp    $0x61,%eax
jl     1192 <main+0x72>
movsbl -0x9(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jl     11bc <main+0x9c>
movsbl -0x9(%rbp),%eax
cmp    $0x5a,%eax
jg     11bc <main+0x9c>
movsbq -0x9(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x70(%rbp,%rax,1)
jmp    115c <main+0x3c>
movl   $0x41,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jg     11f8 <main+0xd8>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
lea    0xe20(%rip),%rdi
movsbl -0x70(%rbp,%rax,1),%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c8 <main+0xa8>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x4b(%rsp)
movups %xmm0,0x41(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea6(%rip),%rbx
jmp    1157 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
je     117a <main+0x5a>
lea    -0x20(%rax),%ecx
cmp    $0x61,%al
movzbl %al,%edx
movzbl %cl,%eax
cmovl  %edx,%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1150 <main+0x30>
movzbl %al,%eax
addb   $0x1,(%rsp,%rax,1)
jmp    1150 <main+0x30>
mov    $0x41,%ebx
lea    0xe7a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movsbl (%rsp,%rbx,1),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x5b,%rbx
jne    1190 <main+0x70>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i8 0
@.str = [8 x i8] c"%c: %d\09\00"
define i32 @main() {
%1 = alloca [90 x i8]
%2 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 65
%4 = tail call signext i8 (...) @getchar()
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
br i1 %6, label %23, label %7
7: ; preds = %0, %19
%8 = phi i8 [ %20, %19 ], [ %4, %0 ]
%9 = icmp sgt i8 %8, 96
%10 = add i8 %8, -32
%11 = select i1 %9, i8 %10, i8 %8
%12 = add i8 %11, -65
%13 = icmp ult i8 %12, 26
br i1 %13, label %14, label %19
14: ; preds = %7
%15 = zext i8 %11 to i64
%16 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = add i8 %17, 1
store i8 %18, i8* %16
br label %19
19: ; preds = %14, %7
%20 = tail call signext i8 (...) @getchar()
%21 = load i8, i8* @EOF
%22 = icmp eq i8 %20, %21
br i1 %22, label %23, label %7
23: ; preds = %19, %0
br label %24
24: ; preds = %23, %24
%25 = phi i64 [ %30, %24 ], [ 65, %23 ]
%26 = getelementptr inbounds [90 x i8], [90 x i8]* %1, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = trunc i64 %25 to i32
%29 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %28, i8 signext %27)
%30 = add nuw nsw i64 %25, 1
%31 = icmp eq i64 %30, 91
br i1 %31, label %32, label %24
32: ; preds = %24
ret i32 0
}