#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 */
char EOF;
scalar_t__ biggest_word_already_processed(int *, int);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int word_lengths[100];
  for (int i = 0; i < 100; ++i) {
    word_lengths[i] = 0;
  }
  char current_char = EOF;
  int current_word_length = 0;
  while ((current_char = getchar()) != EOF) {
    if (current_char == ' ' || current_char == '\n' || current_char == '\t') {
      if (current_word_length <= 100) {
        ++word_lengths[current_word_length - 1];
        current_word_length = 0;
      }
    } else {
      ++current_word_length;
    }
  }
  for (int i = 0; i < 100; ++i) {
    if (biggest_word_already_processed(word_lengths, i)) {
      break;
    }
    printf("%3d: ", i + 1);
    for (int j = 0; j < word_lengths[i]; ++j) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x64,-0x1a4(%rbp)
jge    117f <main+0x4f>
movslq -0x1a4(%rbp),%rax
movl   $0x0,-0x1a0(%rbp,%rax,4)
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    114c <main+0x1c>
mov    0x2e62(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1a5(%rbp)
movl   $0x0,-0x1ac(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1a5(%rbp)
movsbl %al,%eax
mov    0x2e39(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1236 <main+0x106>
movsbl -0x1a5(%rbp),%eax
cmp    $0x20,%eax
je     11ea <main+0xba>
movsbl -0x1a5(%rbp),%eax
cmp    $0xa,%eax
je     11ea <main+0xba>
movsbl -0x1a5(%rbp),%eax
cmp    $0x9,%eax
jne    1222 <main+0xf2>
cmpl   $0x64,-0x1ac(%rbp)
jg     121d <main+0xed>
mov    -0x1ac(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x1a0(%rbp,%rax,4)
movl   $0x0,-0x1ac(%rbp)
jmp    1231 <main+0x101>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1198 <main+0x68>
movl   $0x0,-0x1b0(%rbp)
cmpl   $0x64,-0x1b0(%rbp)
jge    12ed <main+0x1bd>
lea    -0x1a0(%rbp),%rdi
mov    -0x1b0(%rbp),%esi
call   1050 <biggest_word_already_processed@plt>
cmp    $0x0,%rax
je     126e <main+0x13e>
jmp    12ed <main+0x1bd>
mov    -0x1b0(%rbp),%esi
add    $0x1,%esi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1b4(%rbp)
mov    -0x1b4(%rbp),%eax
movslq -0x1b0(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
jge    12cb <main+0x19b>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    128f <main+0x15f>
lea    0xd36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b0(%rbp)
jmp    1240 <main+0x110>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x190,%rsp
mov    %rsp,%rdi
mov    $0x190,%edx
xor    %esi,%esi
call   1050 <memset@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e6c(%rip),%rbx
cmp    (%rbx),%al
jne    11f6 <main+0xa6>
mov    %rsp,%r15
lea    0xe76(%rip),%r14
xor    %ebx,%ebx
jmp    11a3 <main+0x53>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rbx
cmp    $0x64,%r12
je     11e4 <main+0x94>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <biggest_word_already_processed@plt>
test   %rax,%rax
jne    11e4 <main+0x94>
lea    0x1(%rbx),%r12
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,(%rsp,%rbx,4)
jle    1190 <main+0x40>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp,%rbx,4),%ebp
jl     11d0 <main+0x80>
jmp    1190 <main+0x40>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x100000600,%r14
xor    %ebp,%ebp
jmp    1222 <main+0xd2>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%al
je     1180 <main+0x30>
cmp    $0x20,%al
ja     1210 <main+0xc0>
movzbl %al,%eax
bt     %rax,%r14
jae    1210 <main+0xc0>
cmp    $0x64,%ebp
jg     1213 <main+0xc3>
movslq %ebp,%rax
addl   $0x1,-0x4(%rsp,%rax,4)
xor    %ebp,%ebp
jmp    1213 <main+0xc3>

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

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