#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 s[1000];
  int i, j, k;
  fgets(s, 1000, stdin);
  for (j = 0; j < 26; j++) {
    k = 0;
    for (i = 0; i < strlen(s); i++) {
      if (s[i] == 'a' + j)
        k++;
      if (s[i] == 'A' + j)
        k++;
    }
    if (k != 0) {
      printf("%c - %d\n", 'a' + j, k);
    }
  }
  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)
cmpl   $0x1a,-0x3f8(%rbp)
jge    126a <main+0x13a>
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    1226 <main+0xf6>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f8(%rbp),%ecx
add    $0x61,%ecx
cmp    %ecx,%eax
jne    11de <main+0xae>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f8(%rbp),%ecx
add    $0x41,%ecx
cmp    %ecx,%eax
jne    120d <main+0xdd>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
jmp    1212 <main+0xe2>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1187 <main+0x57>
cmpl   $0x0,-0x3fc(%rbp)
je     1251 <main+0x121>
mov    -0x3f8(%rbp),%eax
add    $0x61,%eax
mov    -0x3fc(%rbp),%edx
lea    0xdb7(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
jmp    1256 <main+0x126>
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
jmp    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    $0x3e8,%rsp
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r12
mov    %r12,%rdi
mov    $0x3e8,%esi
call   1050 <fgets@plt>
xor    %r15d,%r15d
jmp    116a <main+0x3a>
nop
add    $0x1,%r15d
cmp    $0x1a,%r15d
je     11d7 <main+0xa7>
mov    %r12,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1160 <main+0x30>
lea    0x61(%r15),%r13d
lea    0x41(%r15),%ebx
xor    %r14d,%r14d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rsp,%r14,1),%eax
xor    %ecx,%ecx
cmp    %eax,%r13d
sete   %cl
add    %ebp,%ecx
xor    %ebp,%ebp
cmp    %eax,%ebx
sete   %bpl
add    %ecx,%ebp
add    $0x1,%r14
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%r14
jl     1190 <main+0x60>
test   %ebp,%ebp
je     1160 <main+0x30>
lea    0x61(%r15),%eax
movsbl %al,%esi
lea    0xe32(%rip),%rdi
mov    %ebp,%edx
call   1040 <printf@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%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 = %56, %0
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 26
br i1 %11, label %12, label %59
12: ; preds = %9
store i32 0, i32* %5
store i32 0, i32* %3
br label %13
13: ; preds = %43, %12
%14 = load i32, i32* %3
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %46
18: ; preds = %13
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i32, i32* %4
%25 = add nsw i32 97, %24
%26 = icmp eq i32 %23, %25
br i1 %26, label %27, label %30
27: ; preds = %18
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %30
30: ; preds = %27, %18
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = load i32, i32* %4
%37 = add nsw i32 65, %36
%38 = icmp eq i32 %35, %37
br i1 %38, label %39, label %42
39: ; preds = %30
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %42
42: ; preds = %39, %30
br label %43
43: ; preds = %42
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %13
46: ; preds = %13
%47 = load i32, i32* %5
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %55
49: ; preds = %46
%50 = load i32, i32* %4
%51 = add nsw i32 97, %50
%52 = trunc i32 %51 to i8
%53 = load i32, i32* %5
%54 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %52, i32 %53)
br label %55
55: ; preds = %49, %46
br label %56
56: ; preds = %55
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %9
59: ; preds = %9
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 = %0, %34
%6 = phi i32 [ 0, %0 ], [ %35, %34 ]
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %34
9: ; preds = %5
%10 = add nuw nsw i32 %6, 97
%11 = add nuw nsw i32 %6, 65
br label %12
12: ; preds = %9, %12
%13 = phi i64 [ 0, %9 ], [ %24, %12 ]
%14 = phi i32 [ 0, %9 ], [ %23, %12 ]
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %13
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %10, %17
%19 = zext i1 %18 to i32
%20 = add nsw i32 %14, %19
%21 = icmp eq i32 %11, %17
%22 = zext i1 %21 to i32
%23 = add nsw i32 %20, %22
%24 = add nuw nsw i64 %13, 1
%25 = call i32 @strlen(i8* %2)
%26 = sext i32 %25 to i64
%27 = icmp slt i64 %24, %26
br i1 %27, label %12, label %28
28: ; preds = %12
%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, 97
%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 = add nuw nsw i32 %6, 1
%36 = icmp eq i32 %35, 26
br i1 %36, label %37, label %5
37: ; preds = %34
ret i32 0
}