#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 *create_letter_distribiton_diagram(int, char *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char sentence[256];
  scanf("%s", sentence);
  int *result;
  int len = strlen(sentence);
  result = create_letter_distribiton_diagram(len, sentence);
  int count_letters;
  for (count_letters = 0; count_letters < 26; count_letters++) {
    printf("%c - %d\n", count_letters + 'a', *(result + count_letters));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x11c(%rbp)
mov    -0x11c(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1030 <create_letter_distribiton_diagram@plt>
mov    %rax,-0x118(%rbp)
movl   $0x0,-0x120(%rbp)
cmpl   $0x1a,-0x120(%rbp)
jge    11e1 <main+0xa1>
mov    -0x120(%rbp),%esi
add    $0x61,%esi
mov    -0x118(%rbp),%rax
movslq -0x120(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x120(%rbp)
jmp    119a <main+0x5a>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
lea    0xead(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <create_letter_distribiton_diagram@plt>
mov    %rax,%r15
xor    %ebx,%ebx
lea    0xe87(%rip),%r14
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%edx
lea    0x61(%rbx),%esi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x1a,%rbx
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"%c - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%12 = call i32* @create_letter_distribiton_diagram(i32 %10, i8* %11)
store i32* %12, i32** %3
store i32 0, i32* %5
br label %13
13: ; preds = %25, %0
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 26
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 97
%19 = load i32*, i32** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %23)
br label %25
25: ; preds = %16
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %13
28: ; preds = %13
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"%c - %d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 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 = call i32* @create_letter_distribiton_diagram(i32 %4, i8* %2)
br label %6
6: ; preds = %0, %6
%7 = phi i64 [ 0, %0 ], [ %13, %6 ]
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = add i32 %10, 97
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %9)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, 26
br i1 %14, label %15, label %6
15: ; preds = %6
ret i32 0
}