#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*/ normalise(char *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdin;
int main() {
  char string[1001];
  int frequency[27] = {0};
  fgets(string, 1000, stdin);
  normalise(string);
  for (int i = 0; string[i] != '\0'; i++) {
    frequency[string[i] - 'a']++;
  }
  for (int i = 0; i < 26; i++)
    if (frequency[i])
      printf("%c - %d\n", i + 'a', frequency[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x460(%rbp),%rdi
xor    %esi,%esi
mov    $0x6c,%edx
call   1050 <memset@plt>
lea    -0x3f0(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1060 <fgets@plt>
lea    -0x3f0(%rbp),%rdi
call   1030 <normalise@plt>
movl   $0x0,-0x464(%rbp)
movslq -0x464(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     11e6 <main+0xa6>
movslq -0x464(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x61,%eax
cltq
mov    -0x460(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x460(%rbp,%rax,4)
mov    -0x464(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x464(%rbp)
jmp    1195 <main+0x55>
movl   $0x0,-0x468(%rbp)
cmpl   $0x1a,-0x468(%rbp)
jge    124e <main+0x10e>
movslq -0x468(%rbp),%rax
cmpl   $0x0,-0x460(%rbp,%rax,4)
je     1235 <main+0xf5>
mov    -0x468(%rbp),%esi
add    $0x61,%esi
movslq -0x468(%rbp),%rax
mov    -0x460(%rbp,%rax,4),%edx
lea    0xdd0(%rip),%rdi
call   1040 <printf@plt>
jmp    123a <main+0xfa>
mov    -0x468(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x468(%rbp)
jmp    11f0 <main+0xb0>
mov    -0x4(%rbp),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x468,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x5c(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <normalise@plt>
mov    0x70(%rsp),%al
test   %al,%al
je     11a7 <main+0x77>
lea    0x71(%rsp),%rcx
nop
movsbq %al,%rax
addl   $0x1,-0x184(%rsp,%rax,4)
01
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1190 <main+0x60>
xor    %ebx,%ebx
lea    0xe50(%rip),%r14
jmp    11ca <main+0x9a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x1a,%rbx
je     11de <main+0xae>
mov    (%rsp,%rbx,4),%edx
test   %edx,%edx
je     11c0 <main+0x90>
lea    0x61(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
xor    %eax,%eax
add    $0x468,%rsp
pop    %rbx
pop    %r14
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 [1001 x i8]
%3 = alloca [27 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [27 x i32]* %3 to i8*
%7 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 1000, i32 %8)
%10 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%11 = call i32 @normalise(i8* %10)
store i32 0, i32* %4
br label %12
12: ; preds = %30, %0
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %33
19: ; preds = %12
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 97
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [27 x i32], [27 x i32]* %3, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = add nsw i32 %28, 1
store i32 %29, i32* %27
br label %30
30: ; preds = %19
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %12
33: ; preds = %12
store i32 0, i32* %5
br label %34
34: ; preds = %52, %33
%35 = load i32, i32* %5
%36 = icmp slt i32 %35, 26
br i1 %36, label %37, label %55
37: ; preds = %34
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [27 x i32], [27 x i32]* %3, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %51
43: ; preds = %37
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 97
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [27 x i32], [27 x i32]* %3, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %45, i32 %49)
br label %51
51: ; preds = %43, %37
br label %52
52: ; preds = %51
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
store i32 %54, i32* %5
br label %34
55: ; preds = %34
%56 = load i32, i32* %1
ret i32 %56
}

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