#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);
main() {
  int words[25];
  int c, i, nw, nc;
  int row, col;
  for (i = 0; i < 25; ++i)
    words[i] = 0;
  nw = nc = 0;
  row = col = 0;
  while ((c = getchar()) != EOF) {
    ++nc;
    if (c == ' ' || c == '\n' || c == '\t') {
      words[nw] = nc - 1;
      ++nw;
      nc = 0;
    }
  }
  for (row = 20; row >= 1; --row) {
    for (col = 0; col <= nw; ++col) {
      if (row <= words[col])
        putchar('*');
      else
        putchar(' ');
    }
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x78(%rbp)
cmpl   $0x19,-0x78(%rbp)
jge    115d <main+0x3d>
movslq -0x78(%rbp),%rax
movl   $0x0,-0x70(%rbp,%rax,4)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1139 <main+0x19>
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x84(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x74(%rbp)
mov    0x2e58(%rip),%rcx
cmp    (%rcx),%eax
je     11e2 <main+0xc2>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
cmpl   $0x20,-0x74(%rbp)
je     11bf <main+0x9f>
cmpl   $0xa,-0x74(%rbp)
je     11bf <main+0x9f>
cmpl   $0x9,-0x74(%rbp)
jne    11dd <main+0xbd>
mov    -0x80(%rbp),%ecx
sub    $0x1,%ecx
movslq -0x7c(%rbp),%rax
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
jmp    117f <main+0x5f>
movl   $0x14,-0x84(%rbp)
cmpl   $0x1,-0x84(%rbp)
jl     1279 <main+0x159>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jg     125b <main+0x13b>
mov    -0x84(%rbp),%eax
movslq -0x88(%rbp),%rcx
cmp    -0x70(%rbp,%rcx,4),%eax
jg     1238 <main+0x118>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1242 <main+0x122>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1247 <main+0x127>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1203 <main+0xe3>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x84(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x84(%rbp)
jmp    11ec <main+0xcc>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
xor    %r12d,%r12d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e84(%rip),%r14
cmp    (%r14),%eax
jne    11ce <main+0xae>
lea    0x1(%r12),%r14d
mov    $0x14,%r15d
jmp    1197 <main+0x77>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%r15),%eax
cmp    $0x1,%r15d
mov    %eax,%r15d
jbe    11c0 <main+0xa0>
test   %r12d,%r12d
js     1180 <main+0x60>
xor    %ebx,%ebx
jmp    11ae <main+0x8e>
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
je     1180 <main+0x60>
mov    $0x20,%edi
cmp    (%rsp,%rbx,4),%r15d
jg     11a0 <main+0x80>
mov    $0x2a,%edi
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
movabs $0x100000600,%r15
xor    %ecx,%ecx
xor    %r12d,%r12d
jmp    11f2 <main+0xd2>
nop
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebx,%ecx
cmp    (%r14),%eax
je     1169 <main+0x49>
lea    0x1(%rcx),%ebx
cmp    $0x20,%eax
ja     11e0 <main+0xc0>
mov    %eax,%eax
bt     %rax,%r15
jae    11e0 <main+0xc0>
movslq %r12d,%r12
mov    %ecx,(%rsp,%r12,4)
add    $0x1,%r12d
xor    %ebx,%ebx
jmp    11e0 <main+0xc0>

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

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