#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];
  fgets(s, 1000, stdin);
  int i = 0, j, c;
  do {
    c = 0;
    j = 0;
    while (j < strlen(s)) {
      if (s[j] == 'a' + i) {
        c++;
      }
      if (s[j] == 'A' + i) {
        c++;
      }
      j++;
    }
    if (c != 0) {
      printf("%c - %d\n", 'a' + i, c);
    }
    i++;
  } while (i < 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,-0x3f4(%rbp)
movl   $0x0,-0x3fc(%rbp)
movl   $0x0,-0x3f8(%rbp)
mov    -0x3f8(%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 -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f4(%rbp),%ecx
add    $0x61,%ecx
cmp    %ecx,%eax
jne    11d1 <main+0xa1>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f4(%rbp),%ecx
add    $0x41,%ecx
cmp    %ecx,%eax
jne    1200 <main+0xd0>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
jmp    117a <main+0x4a>
cmpl   $0x0,-0x3fc(%rbp)
je     123f <main+0x10f>
mov    -0x3f4(%rbp),%eax
add    $0x61,%eax
mov    -0x3fc(%rbp),%edx
lea    0xdc9(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
cmpl   $0x1a,-0x3f4(%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    $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* %3
br label %9
9: ; preds = %54, %0
store i32 0, i32* %5
store i32 0, i32* %4
br label %10
10: ; preds = %39, %9
%11 = load i32, i32* %4
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %42
15: ; preds = %10
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %3
%22 = add nsw i32 97, %21
%23 = icmp eq i32 %20, %22
br i1 %23, label %24, label %27
24: ; preds = %15
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %27
27: ; preds = %24, %15
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = load i32, i32* %3
%34 = add nsw i32 65, %33
%35 = icmp eq i32 %32, %34
br i1 %35, label %36, label %39
36: ; preds = %27
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %39
39: ; preds = %36, %27
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %10
42: ; preds = %10
%43 = load i32, i32* %5
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %42
%46 = load i32, i32* %3
%47 = add nsw i32 97, %46
%48 = trunc i32 %47 to i8
%49 = load i32, i32* %5
%50 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %48, i32 %49)
br label %51
51: ; preds = %45, %42
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %54
54: ; preds = %51
%55 = load i32, i32* %3
%56 = icmp slt i32 %55, 26
br i1 %56, label %9, label %57
57: ; preds = %54
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 ], [ %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, %30, %28
%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
}