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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     11d9 <main+0xb9>
cmpl   $0x20,-0x8(%rbp)
je     115c <main+0x3c>
cmpl   $0x9,-0x8(%rbp)
jne    1163 <main+0x43>
movl   $0xa,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    11cc <main+0xac>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     11a7 <main+0x87>
mov    $0x1,%al
cmpl   $0x20,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     11a7 <main+0x87>
cmpl   $0x9,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    11b7 <main+0x97>
jmp    11c6 <main+0xa6>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
jmp    117f <main+0x5f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ecx
mov    $0xa,%ebp
movabs $0x100000600,%rbx
jmp    1175 <main+0x55>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ecx
cmp    (%r14),%eax
je     1137 <main+0x17>
cmp    $0x9,%ecx
mov    %ecx,%eax
cmove  %ebp,%eax
cmp    $0x20,%ecx
cmove  %ebp,%eax
cmp    $0xa,%eax
jne    1160 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x20,%eax
ja     1160 <main+0x40>
mov    %eax,%ecx
bt     %rcx,%rbx
jb     11a0 <main+0x80>
jmp    1160 <main+0x40>

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