#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i, c, lcounter = 0;
  int histo[11];
  for (i = 0; i < 11; i++)
    histo[i] = 0;
  while ((c = getchar()) != EOF) {
    if (!(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z')) {
      if (lcounter >= 11)
        lcounter = 10;
      histo[lcounter] = histo[lcounter] + 1;
      lcounter = 0;
    } else {
      ++lcounter;
    }
  }
  for (i = 1; i < 11; i++) {
    int j;
    printf("%2d ", i);
    for (j = 0; j < histo[i]; j++)
      printf("X");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jge    1161 <main+0x41>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
jmp    1166 <main+0x46>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%eax
je     11e5 <main+0xc5>
cmpl   $0x61,-0xc(%rbp)
jl     1193 <main+0x73>
cmpl   $0x7a,-0xc(%rbp)
jle    11d7 <main+0xb7>
cmpl   $0x41,-0xc(%rbp)
jl     11a7 <main+0x87>
cmpl   $0x5a,-0xc(%rbp)
jle    11d7 <main+0xb7>
cmpl   $0xb,-0x10(%rbp)
jl     11b8 <main+0x98>
movl   $0xa,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
movslq -0x10(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
movl   $0x0,-0x10(%rbp)
jmp    11e0 <main+0xc0>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <main+0x46>
movl   $0x1,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jge    1257 <main+0x137>
mov    -0x8(%rbp),%esi
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
jge    123b <main+0x11b>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    120e <main+0xee>
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ec <main+0xcc>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x1c(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e91(%rip),%rbx
cmp    (%rbx),%eax
jne    11bc <main+0x8c>
mov    $0x1,%ebx
lea    0xe99(%rip),%r14
jmp    1184 <main+0x54>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0xb,%rbx
je     11b1 <main+0x81>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%rbx,4),%ebp
test   %ebp,%ebp
jle    1170 <main+0x40>
nopw   0x0(%rax,%rax,1)
mov    $0x58,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11a0 <main+0x70>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0xa,%r14d
xor    %ebp,%ebp
jmp    11e2 <main+0xb2>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
je     115b <main+0x2b>
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
jb     11d0 <main+0xa0>
cmp    $0xa,%ebp
cmovge %r14d,%ebp
movslq %ebp,%rax
addl   $0x1,(%rsp,%rax,4)
xor    %ebp,%ebp
jmp    11d3 <main+0xa3>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"%2d \00"
@.str.1 = [2 x i8] c"X\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [11 x i32]
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %2
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 11
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [11 x i32], [11 x i32]* %5, i64 0, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
br label %18
18: ; preds = %50, %17
%19 = call i32 (...) @getchar()
store i32 %19, i32* %3
%20 = load i32, i32* @EOF
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %51
22: ; preds = %18
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 122
br i1 %27, label %47, label %28
28: ; preds = %25, %22
%29 = load i32, i32* %3
%30 = icmp sge i32 %29, 65
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %3
%33 = icmp sle i32 %32, 90
br i1 %33, label %47, label %34
34: ; preds = %31, %28
%35 = load i32, i32* %4
%36 = icmp sge i32 %35, 11
br i1 %36, label %37, label %38
37: ; preds = %34
store i32 10, i32* %4
br label %38
38: ; preds = %37, %34
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [11 x i32], [11 x i32]* %5, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [11 x i32], [11 x i32]* %5, i64 0, i64 %45
store i32 %43, i32* %46
store i32 0, i32* %4
br label %50
47: ; preds = %31, %25
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %50
50: ; preds = %47, %38
br label %18
51: ; preds = %18
store i32 1, i32* %2
br label %52
52: ; preds = %72, %51
%53 = load i32, i32* %2
%54 = icmp slt i32 %53, 11
br i1 %54, label %55, label %75
55: ; preds = %52
%56 = load i32, i32* %2
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %56)
store i32 0, i32* %6
br label %58
58: ; preds = %67, %55
%59 = load i32, i32* %6
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [11 x i32], [11 x i32]* %5, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = icmp slt i32 %59, %63
br i1 %64, label %65, label %70
65: ; preds = %58
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %67
67: ; preds = %65
%68 = load i32, i32* %6
%69 = add nsw i32 %68, 1
store i32 %69, i32* %6
br label %58
70: ; preds = %58
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %72
72: ; preds = %70
%73 = load i32, i32* %2
%74 = add nsw i32 %73, 1
store i32 %74, i32* %2
br label %52
75: ; preds = %52
%76 = load i32, i32* %1
ret i32 %76
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"%2d \00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %26, label %6
6: ; preds = %0, %21
%7 = phi i32 [ %23, %21 ], [ %3, %0 ]
%8 = phi i32 [ %22, %21 ], [ 0, %0 ]
%9 = and i32 %7, -33
%10 = add i32 %9, -65
%11 = icmp ult i32 %10, 26
br i1 %11, label %19, label %12
12: ; preds = %6
%13 = icmp slt i32 %8, 10
%14 = select i1 %13, i32 %8, i32 10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %16
br label %21
19: ; preds = %6
%20 = add nsw i32 %8, 1
br label %21
21: ; preds = %19, %12
%22 = phi i32 [ %20, %19 ], [ 0, %12 ]
%23 = tail call i32 (...) @getchar()
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %6
26: ; preds = %21, %0
br label %27
27: ; preds = %26, %39
%28 = phi i64 [ %41, %39 ], [ 1, %26 ]
%29 = trunc i64 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 %28
%32 = load i32, i32* %31
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %27, %34
%35 = phi i32 [ %37, %34 ], [ 0, %27 ]
%36 = tail call i32 @putchar(i32 88)
%37 = add nuw nsw i32 %35, 1
%38 = icmp eq i32 %37, %32
br i1 %38, label %39, label %34
39: ; preds = %34, %27
%40 = tail call i32 @putchar(i32 10)
%41 = add nuw nsw i64 %28, 1
%42 = icmp eq i64 %41, 11
br i1 %42, label %43, label %27
43: ; preds = %39
ret i32 0
}