#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, num = 0;
  fgets(s, 1000, stdin);
  for (j = 0; j < 26; j++, num = 0) {
    for (i = 0; i < strlen(s); i++)
      if (s[i] == 'a' + j || s[i] == 'A' + j)
        num++;
    if (num != 0)
      printf("%c-%d\n", 'a' + j, num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x3fc(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x3f8(%rbp)
cmpl   $0x1a,-0x3f8(%rbp)
jge    1265 <main+0x135>
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    1217 <main+0xe7>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f8(%rbp),%ecx
add    $0x61,%ecx
cmp    %ecx,%eax
je     11ef <main+0xbf>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    -0x3f8(%rbp),%ecx
add    $0x41,%ecx
cmp    %ecx,%eax
jne    11fe <main+0xce>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
jmp    1203 <main+0xd3>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1187 <main+0x57>
cmpl   $0x0,-0x3fc(%rbp)
je     1242 <main+0x112>
mov    -0x3f8(%rbp),%eax
add    $0x61,%eax
mov    -0x3fc(%rbp),%edx
lea    0xdc6(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
jmp    1247 <main+0x117>
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
movl   $0x0,-0x3fc(%rbp)
jmp    1170 <main+0x40>
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     11d5 <main+0xa5>
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
cmp    %eax,%r13d
sete   %cl
cmp    %eax,%ebx
sete   %al
or     %cl,%al
movzbl %al,%eax
add    %eax,%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    0xe34(%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 = [7 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
store i32 0, i32* %5
%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 = %53, %0
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 26
br i1 %11, label %12, label %56
12: ; preds = %9
store i32 0, i32* %3
br label %13
13: ; preds = %40, %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 %43
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 %36, label %27
27: ; preds = %18
%28 = load i32, i32* %3
%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* %4
%34 = add nsw i32 65, %33
%35 = icmp eq i32 %32, %34
br i1 %35, label %36, label %39
36: ; preds = %27, %18
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %39
39: ; preds = %36, %27
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %13
43: ; preds = %13
%44 = load i32, i32* %5
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %52
46: ; preds = %43
%47 = load i32, i32* %4
%48 = add nsw i32 97, %47
%49 = trunc i32 %48 to i8
%50 = load i32, i32* %5
%51 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %49, i32 %50)
br label %52
52: ; preds = %46, %43
br label %53
53: ; preds = %52
%54 = load i32, i32* %4
%55 = add nsw i32 %54, 1
store i32 %55, i32* %4
store i32 0, i32* %5
br label %9
56: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [7 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, %33
%6 = phi i32 [ 0, %0 ], [ %34, %33 ]
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %33
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 ], [ %23, %12 ]
%14 = phi i32 [ 0, %9 ], [ %22, %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 = icmp eq i32 %11, %17
%20 = select i1 %18, i1 true, i1 %19
%21 = zext i1 %20 to i32
%22 = add nuw nsw i32 %14, %21
%23 = add nuw nsw i64 %13, 1
%24 = call i32 @strlen(i8* %2)
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %23, %25
br i1 %26, label %12, label %27
27: ; preds = %12
%28 = icmp eq i32 %22, 0
br i1 %28, label %33, label %29
29: ; preds = %27
%30 = trunc i32 %6 to i8
%31 = add i8 %30, 97
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %31, i32 %22)
br label %33
33: ; preds = %5, %27, %29
%34 = add nuw nsw i32 %6, 1
%35 = icmp eq i32 %34, 26
br i1 %35, label %36, label %5
36: ; preds = %33
ret i32 0
}