#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*/ printf(char *, char, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  int n = 0, i = 0, p = 0, t = 0;
  char a[100];
  scanf("%s", a);
  i = strlen(a);
  while (n != i) {
    p = n + 1;
    t = 1;
    if (a[n] != '*') {
      while (p != i) {
        if (a[p] == a[n]) {
          t++;
          a[p] = '*';
        }
        p++;
      }
      printf("%c %d\n", a[n], t);
    }
    a[n] = '*';
    n++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1224 <main+0xf4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x2a,%eax
je     120d <main+0xdd>
jmp    11ad <main+0x7d>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11f3 <main+0xc3>
movslq -0x10(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
movslq -0x8(%rbp),%rcx
movsbl -0x80(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11e5 <main+0xb5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x10(%rbp),%rax
movb   $0x2a,-0x80(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ad <main+0x7d>
movslq -0x8(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%al
mov    -0x14(%rbp),%edx
lea    0xdfe(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
movb   $0x2a,-0x80(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117a <main+0x4a>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xebb(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
je     11dc <main+0xac>
mov    %eax,%r15d
lea    0x1(%rsp),%rbx
lea    -0x1(%r15),%r12
xor    %r13d,%r13d
lea    0xe8d(%rip),%r14
jmp    11a0 <main+0x70>
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movb   $0x2a,(%rsp,%r13,1)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r12
mov    %rbp,%r13
cmp    %r15,%rbp
je     11dc <main+0xac>
lea    0x1(%r13),%rbp
mov    (%rsp,%r13,1),%al
cmp    $0x2a,%al
je     118b <main+0x5b>
mov    $0x1,%edx
cmp    %r15,%rbp
je     1180 <main+0x50>
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    11ce <main+0x9e>
nop
movzbl (%rsp,%r13,1),%eax
add    $0x1,%rcx
cmp    %rcx,%r12
je     1180 <main+0x50>
cmp    %al,(%rbx,%rcx,1)
jne    11c0 <main+0x90>
add    $0x1,%edx
movb   $0x2a,(%rbx,%rcx,1)
jmp    11c0 <main+0x90>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%c %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [100 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %3
br label %11
11: ; preds = %57, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %63
15: ; preds = %11
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
store i32 1, i32* %5
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 42
br i1 %23, label %24, label %57
24: ; preds = %15
br label %25
25: ; preds = %47, %24
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = icmp ne i32 %26, %27
br i1 %28, label %29, label %50
29: ; preds = %25
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %34, %39
br i1 %40, label %41, label %47
41: ; preds = %29
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %45
store i8 42, i8* %46
br label %47
47: ; preds = %41, %29
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %25
50: ; preds = %25
%51 = load i32, i32* %2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = load i32, i32* %5
%56 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %54, i32 %55)
br label %57
57: ; preds = %50, %15
%58 = load i32, i32* %2
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 %59
store i8 42, i8* %60
%61 = load i32, i32* %2
%62 = add nsw i32 %61, 1
store i32 %62, i32* %2
br label %11
63: ; preds = %11
ret i32 0
}

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