#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char, int);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char mass[1000];
  int i, a, c;
  fgets(mass, 1000, stdin);
  a = 0;
  do {
    a++;
    c = 0;
    i = 0;
    while (i < strlen(mass)) {
      if (mass[i] == 'a' + a || mass[i] == 'A' + a) {
        c++;
      }
      i++;
    }
    if (c != 0)
      printf("%c - %d\n", 'a' + a, c);
  } while (a < 26);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x3f8(%rbp)
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
movl   $0x0,-0x3fc(%rbp)
movl   $0x0,-0x3f4(%rbp)
mov    -0x3f4(%rbp),%eax
mov    %eax,-0x400(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x400(%rbp),%eax
cmp    %ecx,%eax
jge    1214 <main+0xe4>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f8(%rbp),%ecx
add    $0x61,%ecx
cmp    %ecx,%eax
je     11f1 <main+0xc1>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f8(%rbp),%ecx
add    $0x41,%ecx
cmp    %ecx,%eax
jne    1200 <main+0xd0>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1189 <main+0x59>
cmpl   $0x0,-0x3fc(%rbp)
je     123f <main+0x10f>
mov    -0x3f8(%rbp),%eax
add    $0x61,%eax
mov    -0x3fc(%rbp),%edx
lea    0xdc9(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
jmp    1244 <main+0x114>
cmpl   $0x1a,-0x3f8(%rbp)
jl     1166 <main+0x36>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f8,%rsp
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    $0x3e8,%esi
call   1050 <fgets@plt>
xor    %ebx,%ebx
jmp    1165 <main+0x35>
cmp    $0x1a,%ebx
je     11db <main+0xab>
mov    %ebx,%r12d
lea    0x1(%r12),%ebx
mov    %r13,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1160 <main+0x30>
mov    %ebx,0xc(%rsp)
lea    0x62(%r12),%ebx
lea    0x42(%r12),%r14d
xor    %r15d,%r15d
xor    %ebp,%ebp
nopl   0x0(%rax)
movsbl 0x10(%rsp,%r15,1),%eax
cmp    %eax,%ebx
sete   %cl
cmp    %eax,%r14d
sete   %al
or     %cl,%al
movzbl %al,%eax
add    %eax,%ebp
add    $0x1,%r15
mov    %r13,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%r15
jl     1190 <main+0x60>
test   %ebp,%ebp
mov    0xc(%rsp),%ebx
je     1160 <main+0x30>
add    $0x62,%r12b
movsbl %r12b,%esi
lea    0xe2e(%rip),%rdi
mov    %ebp,%edx
call   1040 <printf@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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 [1000 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 1000, i32 %7)
store i32 0, i32* %4
br label %9
9: ; preds = %51, %0
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
store i32 0, i32* %5
store i32 0, i32* %3
br label %12
12: ; preds = %38, %9
%13 = load i32, i32* %3
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %41
17: ; preds = %12
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i32, i32* %4
%24 = add nsw i32 97, %23
%25 = icmp eq i32 %22, %24
br i1 %25, label %35, label %26
26: ; preds = %17
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = load i32, i32* %4
%33 = add nsw i32 65, %32
%34 = icmp eq i32 %31, %33
br i1 %34, label %35, label %38
35: ; preds = %26, %17
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %38
38: ; preds = %35, %26
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %12
41: ; preds = %12
%42 = load i32, i32* %5
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %50
44: ; preds = %41
%45 = load i32, i32* %4
%46 = add nsw i32 97, %45
%47 = trunc i32 %46 to i8
%48 = load i32, i32* %5
%49 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %47, i32 %48)
br label %50
50: ; preds = %44, %41
br label %51
51: ; preds = %50
%52 = load i32, i32* %4
%53 = icmp slt i32 %52, 26
br i1 %53, label %9, label %54
54: ; preds = %51
ret i32 0
}

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