#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*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char, int);
int sscanf(char *, char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char buffer[1100], str[1001];
  int alpha[26];
  if (fgets(buffer, sizeof(buffer), stdin) == NULL) {
    exit(EXIT_FAILURE);
  }
  if (sscanf(buffer, "%s", str) != 1) {
    exit(EXIT_FAILURE);
  }
  for (int i = 0; i < 26; i++) {
    alpha[i] = 0;
  }
  for (int i = 0; str[i] != '\0'; i++) {
    if (str[i] >= 'a' && str[i] <= 'z') {
      alpha[str[i] - 'a']++;
    } else if (str[i] >= 'A' && str[i] <= 'Z') {
      alpha[str[i] - 'A']++;
    }
  }
  for (int i = 0; i < 26; i++) {
    if (alpha[i] != 0) {
      printf("%c: %d ", 'a' + i, alpha[i]);
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x450(%rbp),%rdi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
mov    $0x44c,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    1184 <main+0x44>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    -0x450(%rbp),%rdi
lea    -0x840(%rbp),%rdx
lea    0xe67(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     11b5 <main+0x75>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
movl   $0x0,-0x8b4(%rbp)
cmpl   $0x1a,-0x8b4(%rbp)
jge    11f2 <main+0xb2>
movslq -0x8b4(%rbp),%rax
movl   $0x0,-0x8b0(%rbp,%rax,4)
mov    -0x8b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8b4(%rbp)
jmp    11bf <main+0x7f>
movl   $0x0,-0x8b8(%rbp)
movslq -0x8b8(%rbp),%rax
movsbl -0x840(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     12e1 <main+0x1a1>
movslq -0x8b8(%rbp),%rax
movsbl -0x840(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     126e <main+0x12e>
movslq -0x8b8(%rbp),%rax
movsbl -0x840(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     126e <main+0x12e>
movslq -0x8b8(%rbp),%rax
movsbl -0x840(%rbp,%rax,1),%eax
ff
sub    $0x61,%eax
cltq
mov    -0x8b0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8b0(%rbp,%rax,4)
jmp    12c8 <main+0x188>
movslq -0x8b8(%rbp),%rax
movsbl -0x840(%rbp,%rax,1),%eax
ff
cmp    $0x41,%eax
jl     12c3 <main+0x183>
movslq -0x8b8(%rbp),%rax
movsbl -0x840(%rbp,%rax,1),%eax
ff
cmp    $0x5a,%eax
jg     12c3 <main+0x183>
movslq -0x8b8(%rbp),%rax
movsbl -0x840(%rbp,%rax,1),%eax
ff
sub    $0x41,%eax
cltq
mov    -0x8b0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8b0(%rbp,%rax,4)
jmp    12c8 <main+0x188>
jmp    12cd <main+0x18d>
mov    -0x8b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8b8(%rbp)
jmp    11fc <main+0xbc>
movl   $0x0,-0x8bc(%rbp)
cmpl   $0x1a,-0x8bc(%rbp)
jge    134c <main+0x20c>
movslq -0x8bc(%rbp),%rax
cmpl   $0x0,-0x8b0(%rbp,%rax,4)
je     1333 <main+0x1f3>
mov    -0x8bc(%rbp),%eax
add    $0x61,%eax
movslq -0x8bc(%rbp),%rcx
mov    -0x8b0(%rbp,%rcx,4),%edx
lea    0xcd8(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1338 <main+0x1f8>
mov    -0x8bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8bc(%rbp)
jmp    12eb <main+0x1ab>
mov    0x2c7d(%rip),%rax
mov    (%rax),%eax
add    $0x8c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x8b8,%rsp
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
lea    0x460(%rsp),%rdi
mov    $0x44c,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1255 <main+0x115>
lea    0xe8b(%rip),%rsi
lea    0x460(%rsp),%rdi
lea    0x70(%rsp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1255 <main+0x115>
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    0x70(%rsp),%dl
test   %dl,%dl
je     1211 <main+0xd1>
mov    $0xffffff9f,%ecx
lea    0x71(%rsp),%rax
add    $0x20,%rcx
jmp    11f5 <main+0xb5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbq %dl,%rdx
add    %edx,%esi
addl   $0x1,(%rsp,%rsi,4)
movzbl (%rax),%edx
add    $0x1,%rax
test   %dl,%dl
je     1211 <main+0xd1>
lea    -0x61(%rdx),%edi
mov    $0xffffff9f,%esi
cmp    $0x1a,%dil
jb     11e0 <main+0xa0>
lea    -0x41(%rdx),%edi
mov    %rcx,%rsi
cmp    $0x19,%dil
jbe    11e0 <main+0xa0>
jmp    11ea <main+0xaa>
xor    %ebx,%ebx
lea    0xde9(%rip),%r14
jmp    122a <main+0xea>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x1a,%rbx
je     1241 <main+0x101>
mov    (%rsp,%rbx,4),%edx
test   %edx,%edx
je     1220 <main+0xe0>
lea    0x61(%rbx),%eax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1220 <main+0xe0>
mov    0x2d88(%rip),%rax
mov    (%rax),%eax
add    $0x8b8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"%c: %d \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [1100 x i8]
%2 = alloca [1001 x i8]
%3 = alloca [26 x i32]
%4 = bitcast [26 x i32]* %3 to i8*
%5 = getelementptr inbounds [1100 x i8], [1100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32* @fgets(i8* %5, i32 1100, i32 %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %0
%14 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i8, i8* %6
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %39, %16
br label %46
20: ; preds = %13
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %16, %39
%24 = phi i64 [ %40, %39 ], [ 0, %16 ]
%25 = phi i8 [ %42, %39 ], [ %17, %16 ]
%26 = sext i8 %25 to i64
%27 = add i8 %25, -97
%28 = icmp ult i8 %27, 26
br i1 %28, label %32, label %29
29: ; preds = %23
%30 = add i8 %25, -65
%31 = icmp ult i8 %30, 26
br i1 %31, label %32, label %39
32: ; preds = %29, %23
%33 = phi i64 [ 4294967199, %23 ], [ 4294967231, %29 ]
%34 = add nsw i64 %33, %26
%35 = and i64 %34, 4294967295
%36 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = add nsw i32 %37, 1
store i32 %38, i32* %36
br label %39
39: ; preds = %32, %29
%40 = add nuw i64 %24, 1
%41 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 0
br i1 %43, label %19, label %23
44: ; preds = %55
%45 = load i32, i32* @EXIT_SUCCESS
ret i32 %45
46: ; preds = %19, %55
%47 = phi i64 [ %56, %55 ], [ 0, %19 ]
%48 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %55, label %51
51: ; preds = %46
%52 = trunc i64 %47 to i8
%53 = add nuw nsw i8 %52, 97
%54 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext %53, i32 %49)
br label %55
55: ; preds = %46, %51
%56 = add nuw nsw i64 %47, 1
%57 = icmp eq i64 %56, 26
br i1 %57, label %44, label %46
}