#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*/ putchar(char);
int main(void) {
  int cur_char;
  int cur_word_length;
  int histogram_index;
  int histogram_char;
  cur_word_length = 0;
  histogram_char = '*';
  while ((cur_char = getchar()) != EOF) {
    if (cur_char == ' ' || cur_char == '\n' || cur_char == '\t') {
      for (histogram_index = 0; histogram_index < cur_word_length;
           histogram_index++) {
        putchar(histogram_char);
      }
      putchar('\n');
      cur_word_length = 0;
    } else {
      cur_word_length++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2a,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%eax
je     11c4 <main+0xa4>
cmpl   $0x20,-0x8(%rbp)
je     1174 <main+0x54>
cmpl   $0xa,-0x8(%rbp)
je     1174 <main+0x54>
cmpl   $0x9,-0x8(%rbp)
jne    11b6 <main+0x96>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a0 <main+0x80>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117b <main+0x5b>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
jmp    11bf <main+0x9f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rbx
cmp    (%rbx),%eax
jne    113d <main+0x1d>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
movabs $0x100000600,%r14
xor    %ebp,%ebp
jmp    1167 <main+0x47>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1136 <main+0x16>
cmp    $0x20,%eax
ja     11a0 <main+0x80>
mov    %eax,%eax
bt     %rax,%r14
jae    11a0 <main+0x80>
test   %ebp,%ebp
jle    1150 <main+0x30>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x60>
jmp    1150 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
jmp    115c <main+0x3c>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 42, i32* %5
br label %6
6: ; preds = %36, %0
%7 = call i32 (...) @getchar()
store i32 %7, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 32
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 10
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 9
br i1 %18, label %19, label %33
19: ; preds = %16, %13, %10
store i32 0, i32* %4
br label %20
20: ; preds = %28, %19
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = load i32, i32* %5
%26 = trunc i32 %25 to i8
%27 = call i32 @putchar(i8 signext %26)
br label %28
28: ; preds = %24
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %20
31: ; preds = %20
%32 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %3
br label %36
33: ; preds = %16
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %36
36: ; preds = %33, %31
br label %6
37: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %23, label %4
4: ; preds = %0, %18
%5 = phi i32 [ %20, %18 ], [ %1, %0 ]
%6 = phi i32 [ %19, %18 ], [ 0, %0 ]
switch i32 %5, label %16 [
i32 32, label %7
i32 10, label %7
i32 9, label %7
]
7: ; preds = %4, %4, %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %14
9: ; preds = %7, %9
%10 = phi i32 [ %12, %9 ], [ 0, %7 ]
%11 = tail call i32 @putchar(i8 signext 42)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, %6
br i1 %13, label %14, label %9
14: ; preds = %9, %7
%15 = tail call i32 @putchar(i8 signext 10)
br label %18
16: ; preds = %4
%17 = add nsw i32 %6, 1
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ 0, %14 ], [ %17, %16 ]
%20 = tail call i32 (...) @getchar()
%21 = load i32, i32* @EOF
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %4
23: ; preds = %18, %0
ret i32 0
}