#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 *, ...);
main() {
  int i, j, c, count;
  int charac[15];
  count = 0;
  for (i = 0; i < 15; i++)
    charac[i] = 0;
  while ((c = getchar()) != EOF) {
    count++;
    if (c == ' ' || c == '\t' || c == '\n') {
      charac[count - 2] += 1;
      count = 0;
    }
  }
  for (i = 0; i < 15; i++) {
    printf("Long. %d ", i + 1);
    for (j = 0; j < charac[i]; j++)
      printf("#");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    1161 <main+0x41>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x50(%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,-0x10(%rbp)
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%eax
je     11c5 <main+0xa5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x20,-0x10(%rbp)
je     11a6 <main+0x86>
cmpl   $0x9,-0x10(%rbp)
je     11a6 <main+0x86>
cmpl   $0xa,-0x10(%rbp)
jne    11c0 <main+0xa0>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
cltq
mov    -0x50(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x50(%rbp,%rax,4)
movl   $0x0,-0x14(%rbp)
jmp    1166 <main+0x46>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    123a <main+0x11a>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x50(%rbp,%rcx,4),%eax
jge    121e <main+0xfe>
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f1 <main+0xd1>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cc <main+0xac>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x2c(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e8a(%rip),%rbx
cmp    (%rbx),%eax
jne    11be <main+0x8e>
lea    0xe97(%rip),%r14
xor    %r15d,%r15d
jmp    1180 <main+0x50>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0xf,%r15
je     11b1 <main+0x81>
mov    %r15,%rbx
add    $0x1,%r15
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%rbx,4),%ebp
test   %ebp,%ebp
jle    1170 <main+0x40>
nopl   0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11a0 <main+0x70>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x100000600,%r14
xor    %ecx,%ecx
jmp    11dd <main+0xad>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %ebp,%ecx
cmp    (%rbx),%eax
je     1162 <main+0x32>
lea    0x1(%rcx),%ebp
cmp    $0x20,%eax
ja     11d0 <main+0xa0>
mov    %eax,%eax
bt     %rax,%r14
jae    11d0 <main+0xa0>
movslq %ecx,%rax
addl   $0x1,-0x4(%rsp,%rax,4)
xor    %ebp,%ebp
jmp    11d0 <main+0xa0>

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

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