#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 c, i, j, nc;
  int lengths[20 - 1];
  nc = 0;
  for (i = 0; i < 20 - 1; ++i)
    lengths[i] = 0;
  while ((c = getchar()) != EOF) {
    if (c != ' ' && c != '\t' && c != '\n')
      ++nc;
    else if (nc > 0) {
      if (nc <= 20)
        ++lengths[nc];
      nc = 0;
    }
  }
  for (i = 0; i < 20 - 1; ++i) {
    printf("%3d|", i + 1);
    for (j = 0; j < lengths[i]; ++j)
      printf("*");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x13,-0xc(%rbp)
jge    1161 <main+0x41>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x60(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
jmp    1166 <main+0x46>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%eax
je     11df <main+0xbf>
cmpl   $0x20,-0x8(%rbp)
je     11ab <main+0x8b>
cmpl   $0x9,-0x8(%rbp)
je     11ab <main+0x8b>
cmpl   $0xa,-0x8(%rbp)
je     11ab <main+0x8b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11da <main+0xba>
cmpl   $0x0,-0x14(%rbp)
jle    11d5 <main+0xb5>
cmpl   $0x14,-0x14(%rbp)
jg     11ce <main+0xae>
movslq -0x14(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x60(%rbp,%rax,4)
movl   $0x0,-0x14(%rbp)
jmp    11da <main+0xba>
jmp    1166 <main+0x46>
movl   $0x0,-0xc(%rbp)
cmpl   $0x13,-0xc(%rbp)
jge    1254 <main+0x134>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,4),%eax
jge    1238 <main+0x118>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    120b <main+0xeb>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e6 <main+0xc6>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x3c(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e85(%rip),%rbx
cmp    (%rbx),%eax
jne    11ce <main+0x9e>
lea    0xe92(%rip),%r14
xor    %r15d,%r15d
jmp    1190 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x13,%r15
je     11c1 <main+0x91>
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    1180 <main+0x50>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x80>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x100000600,%r14
xor    %ecx,%ecx
jmp    11f6 <main+0xc6>
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %ecx,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %ebp,%ecx
cmp    (%rbx),%eax
je     1167 <main+0x37>
cmp    $0x20,%eax
ja     11e0 <main+0xb0>
mov    %eax,%eax
bt     %rax,%r14
jae    11e0 <main+0xb0>
test   %ecx,%ecx
jle    11e3 <main+0xb3>
xor    %ebp,%ebp
cmp    $0x14,%ecx
ja     11e5 <main+0xb5>
mov    %ecx,%eax
addl   $0x1,(%rsp,%rax,4)
jmp    11e5 <main+0xb5>

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

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