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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%eax
je     11bf <main+0x9f>
cmpl   $0x20,-0x8(%rbp)
je     1174 <main+0x54>
cmpl   $0xa,-0x8(%rbp)
je     1174 <main+0x54>
cmpl   $0x9,-0x8(%rbp)
jne    117b <main+0x5b>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11ac <main+0x8c>
cmpl   $0xa,-0x10(%rbp)
je     11a0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0xa,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    11ba <main+0x9a>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x1d>
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),%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
mov    $0xa,%ebp
movabs $0x100000600,%r15
jmp    1177 <main+0x57>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    %ebx,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     113a <main+0x1a>
cmp    $0x20,%ebx
ja     1160 <main+0x40>
mov    %ebx,%eax
bt     %rax,%r15
jae    1160 <main+0x40>
mov    $0xa,%ebx
cmp    $0xa,%ebp
jne    1160 <main+0x40>
jmp    1167 <main+0x47>

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

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, %12
%5 = phi i32 [ %14, %12 ], [ %1, %0 ]
%6 = phi i32 [ %13, %12 ], [ 10, %0 ]
switch i32 %5, label %9 [
i32 32, label %7
i32 10, label %7
i32 9, label %7
]
7: ; preds = %4, %4, %4
%8 = icmp eq i32 %6, 10
br i1 %8, label %12, label %9
9: ; preds = %4, %7
%10 = phi i32 [ 10, %7 ], [ %5, %4 ]
%11 = tail call i32 @putchar(i32 %10)
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ 10, %7 ], [ %10, %9 ]
%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 = %12, %0
ret i32 0
}