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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     119f <main+0x7f>
cmpl   $0x20,-0x4(%rbp)
je     1166 <main+0x46>
cmpl   $0xa,-0x4(%rbp)
je     1166 <main+0x46>
cmpl   $0x9,-0x4(%rbp)
jne    1172 <main+0x52>
movl   $0x0,-0x8(%rbp)
jmp    1192 <main+0x72>
cmpl   $0x0,-0x8(%rbp)
jne    118d <main+0x6d>
movl   $0x1,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1192 <main+0x72>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
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),%r14
cmp    (%r14),%eax
jne    1145 <main+0x25>
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>
cs nopw 0x0(%rax,%rax,1)
nop
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 void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %23, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %26
7: ; preds = %3
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 32
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 10
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 9
br i1 %15, label %16, label %17
16: ; preds = %13, %10, %7
store i32 0, i32* %2
br label %23
17: ; preds = %13
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
store i32 1, i32* %2
%21 = call i32 @putchar(i32 10)
br label %22
22: ; preds = %20, %17
br label %23
23: ; preds = %22, %16
%24 = load i32, i32* %1
%25 = call i32 @putchar(i32 %24)
br label %3
26: ; preds = %3
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @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 = %4, %4, %4, %7, %9
%12 = phi i32 [ 1, %9 ], [ 1, %7 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ]
%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 void
}