#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*/ bukva_broi(char *, int *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdin;
int main() {
  char str[1000];
  int j, cnt[26] = {0};
  fgets(str, 1000, stdin);
  bukva_broi(str, cnt);
  for (j = 0; j < 26; j++) {
    if (cnt[j] != 0) {
      printf("%c - %d\n", j + 'a', cnt[j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x460(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1040 <memset@plt>
lea    -0x3f0(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1050 <fgets@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x460(%rbp),%rsi
call   1060 <bukva_broi@plt>
movl   $0x0,-0x3f4(%rbp)
cmpl   $0x1a,-0x3f4(%rbp)
jge    11fa <main+0xba>
movslq -0x3f4(%rbp),%rax
cmpl   $0x0,-0x460(%rbp,%rax,4)
je     11e1 <main+0xa1>
mov    -0x3f4(%rbp),%esi
add    $0x61,%esi
movslq -0x3f4(%rbp),%rax
mov    -0x460(%rbp,%rax,4),%edx
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    11e6 <main+0xa6>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    119c <main+0x5c>
xor    %eax,%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x458,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <fgets@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <bukva_broi@plt>
xor    %ebx,%ebx
lea    0xe6e(%rip),%r14
jmp    11aa <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    $0x1a,%rbx
je     11be <main+0x8e>
mov    (%rsp,%rbx,4),%edx
test   %edx,%edx
je     11a0 <main+0x70>
lea    0x61(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x458,%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 [1000 x i8]
%3 = alloca i32
%4 = alloca [26 x i32]
store i32 0, i32* %1
%5 = bitcast [26 x i32]* %4 to i8*
%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)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 0
%11 = call i32 @bukva_broi(i8* %9, i32* %10)
store i32 0, i32* %3
br label %12
12: ; preds = %30, %0
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 26
br i1 %14, label %15, label %33
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %29
21: ; preds = %15
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 97
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [26 x i32], [26 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %27)
br label %29
29: ; preds = %21, %15
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %12
33: ; preds = %12
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 = alloca [26 x i32]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = bitcast [26 x i32]* %2 to i8*
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %3, i32 1000, i32 %5)
%7 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 0
%8 = call i32 @bukva_broi(i8* %3, i32* %7)
br label %9
9: ; preds = %0, %18
%10 = phi i64 [ 0, %0 ], [ %19, %18 ]
%11 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = trunc i64 %10 to i32
%16 = add i32 %15, 97
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %12)
br label %18
18: ; preds = %9, %14
%19 = add nuw nsw i64 %10, 1
%20 = icmp eq i64 %19, 26
br i1 %20, label %21, label %9
21: ; preds = %18
ret i32 0
}