#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 *);
int /*<<< orphan*/ putchar(int);
main() {
  int state;
  state = 0;
  int c;
  int first;
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\n' || c == '\t') {
      state = 0;
    } else if (state == 0) {
      state = 1;
    }
    if (state == 1) {
      putchar(c);
      first = 0;
    } else if (first == 0) {
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
je     11dd <main+0xad>
cmpl   $0x20,-0xc(%rbp)
je     117d <main+0x4d>
cmpl   $0xa,-0xc(%rbp)
je     117d <main+0x4d>
cmpl   $0x9,-0xc(%rbp)
jne    1189 <main+0x59>
movl   $0x0,-0x8(%rbp)
jmp    119f <main+0x6f>
cmpl   $0x0,-0x8(%rbp)
jne    119a <main+0x6a>
movl   $0x1,-0x8(%rbp)
jmp    119f <main+0x6f>
cmpl   $0x1,-0x8(%rbp)
jne    11bd <main+0x8d>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
jmp    11d8 <main+0xa8>
cmpl   $0x0,-0x10(%rbp)
jne    11d3 <main+0xa3>
lea    0xe32(%rip),%rdi
call   1040 <printf@plt>
jmp    11d8 <main+0xa8>
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%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),%r15
cmp    (%r15),%eax
jne    1147 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x100000600,%r14
xor    %ebx,%ebx
jmp    1178 <main+0x58>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebp,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%eax
je     113a <main+0x1a>
cmp    $0x20,%eax
ja     1187 <main+0x67>
xor    %ebp,%ebp
mov    %eax,%ecx
bt     %rcx,%r14
jb     1160 <main+0x40>
mov    %ebx,%ebp
cmp    $0x1,%ebx
ja     1160 <main+0x40>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
jmp    116c <main+0x4c>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %36, %0
%6 = call i32 (...) @getchar()
store i32 %6, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %37
9: ; preds = %5
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 32
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 10
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 9
br i1 %17, label %18, label %19
18: ; preds = %15, %12, %9
store i32 0, i32* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 1, i32* %2
br label %23
23: ; preds = %22, %19
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %3
%29 = call i32 @putchar(i32 %28)
store i32 0, i32* %4
br label %36
30: ; preds = %24
%31 = load i32, i32* %4
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
br label %36
36: ; preds = %35, %27
br label %5
37: ; preds = %5
%38 = load i32, i32* %1
ret i32 %38
}

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 %19, label %4
4: ; preds = %0, %14
%5 = phi i32 [ %16, %14 ], [ %1, %0 ]
%6 = phi i32 [ %15, %14 ], [ 0, %0 ]
switch i32 %5, label %7 [
i32 32, label %11
i32 10, label %11
i32 9, label %11
]
7: ; preds = %4
%8 = icmp ult i32 %6, 2
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @putchar(i32 %5)
br label %14
11: ; preds = %7, %4, %4, %4
%12 = phi i32 [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ %6, %7 ]
%13 = tail call i32 @putchar(i32 10)
br label %14
14: ; preds = %11, %9
%15 = phi i32 [ %12, %11 ], [ 1, %9 ]
%16 = tail call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %4
19: ; preds = %14, %0
ret i32 0
}