#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(int);
int main() {
  int c, nl, nw, nc, wl, state;
  state = 0;
  nl = nw = nc = wl = 0;
  while ((c = getchar()) != EOF) {
    ++nc;
    if (c == '\n')
      ++nl;
    if (c == ' ' || c == '\n' || c == '\t')
      state = 0;
    else if (state == 0) {
      putchar('\n');
      state = 1;
      wl = 0;
      ++nw;
    }
    if (state == 1)
      ++wl;
    putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     1201 <main+0xe1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1187 <main+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     11a5 <main+0x85>
cmpl   $0xa,-0x8(%rbp)
je     11a5 <main+0x85>
cmpl   $0x9,-0x8(%rbp)
jne    11b1 <main+0x91>
movl   $0x0,-0x1c(%rbp)
jmp    11e1 <main+0xc1>
cmpl   $0x0,-0x1c(%rbp)
jne    11dc <main+0xbc>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e1 <main+0xc1>
cmpl   $0x1,-0x1c(%rbp)
jne    11f4 <main+0xd4>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r14
cmp    (%r14),%eax
jne    1147 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebx
movabs $0x100000600,%r15
xor    %eax,%eax
jmp    1187 <main+0x67>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%ebp
test   %eax,%eax
je     1198 <main+0x78>
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    %ebp,%eax
cmp    (%r14),%ebx
je     113a <main+0x1a>
cmp    $0x20,%ebx
ja     1160 <main+0x40>
xor    %ebp,%ebp
mov    %ebx,%ecx
bt     %rcx,%r15
jb     1170 <main+0x50>
jmp    1160 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1170 <main+0x50>

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
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %8
8: ; preds = %44, %0
%9 = call i32 (...) @getchar()
store i32 %9, i32* %2
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %47
12: ; preds = %8
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %12
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 32
br i1 %22, label %29, label %23
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 10
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 9
br i1 %28, label %29, label %30
29: ; preds = %26, %23, %20
store i32 0, i32* %7
br label %38
30: ; preds = %26
%31 = load i32, i32* %7
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = call i32 @putchar(i32 10)
store i32 1, i32* %7
store i32 0, i32* %6
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %37
37: ; preds = %33, %30
br label %38
38: ; preds = %37, %29
%39 = load i32, i32* %7
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %44
44: ; preds = %41, %38
%45 = load i32, i32* %2
%46 = call i32 @putchar(i32 %45)
br label %8
47: ; preds = %8
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 %17, label %4
4: ; preds = %0, %11
%5 = phi i32 [ %14, %11 ], [ %1, %0 ]
%6 = phi i32 [ %12, %11 ], [ 0, %0 ]
switch i32 %5, label %7 [
i32 32, label %11
i32 10, label %11
i32 9, label %11
]
7: ; preds = %4
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @putchar(i32 10)
br label %11
11: ; preds = %7, %9, %4, %4, %4
%12 = phi i32 [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 1, %9 ], [ 1, %7 ]
%13 = tail call i32 @putchar(i32 %5)
%14 = tail call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %4
17: ; preds = %11, %0
ret i32 0
}