#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);
int main() {
  int c;
  int flag = 0;
  while ((c = getchar()) != EOF) {
    if ((c == ' ') || (c == '\t')) {
      flag = 1;
    }
    if ((flag == 1) && (c != ' ') && (c != '\t')) {
      printf("\n%c", c);
      flag = 0;
    } else {
      printf("%c", c);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     11b7 <main+0x97>
cmpl   $0x20,-0x8(%rbp)
je     1163 <main+0x43>
cmpl   $0x9,-0x8(%rbp)
jne    116a <main+0x4a>
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11a3 <main+0x83>
cmpl   $0x20,-0x8(%rbp)
je     11a3 <main+0x83>
cmpl   $0x9,-0x8(%rbp)
je     11a3 <main+0x83>
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
jmp    11b2 <main+0x92>
mov    -0x8(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%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),%rbx
cmp    (%rbx),%eax
jne    1146 <main+0x26>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xeb4(%rip),%r14
lea    0xeac(%rip),%r15
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cmp    $0x9,%eax
je     116a <main+0x4a>
cmp    $0x20,%eax
jne    1180 <main+0x60>
mov    $0x1,%ecx
jmp    1185 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%ecx
je     11a0 <main+0x80>
mov    %r14,%rdi
mov    %ecx,%ebp
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebp,%ecx
cmp    (%rbx),%eax
jne    1160 <main+0x40>
jmp    1139 <main+0x19>
cmp    $0x20,%eax
je     116a <main+0x4a>
xor    %ebp,%ebp
mov    $0x1,%ecx
mov    %r15,%rdi
cmp    $0x9,%eax
je     1185 <main+0x65>
jmp    118a <main+0x6a>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"\0A%c\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %30, %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 %31
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 1, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 32
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 9
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
store i32 0, i32* %3
br label %30
27: ; preds = %21, %18, %15
%28 = load i32, i32* %2
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %24
br label %4
31: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"\0A%c\00"
@.str.1 = [3 x i8] c"%c\00"
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, %12
%5 = phi i32 [ %16, %12 ], [ %1, %0 ]
%6 = phi i32 [ %14, %12 ], [ 0, %0 ]
switch i32 %5, label %7 [
i32 32, label %10
i32 9, label %10
]
7: ; preds = %4
%8 = icmp eq i32 %6, 1
br i1 %8, label %9, label %10
9: ; preds = %7
switch i32 %5, label %12 [
i32 32, label %10
i32 9, label %10
]
10: ; preds = %4, %4, %9, %9, %7
%11 = phi i32 [ 1, %9 ], [ 1, %9 ], [ %6, %7 ], [ 1, %4 ], [ 1, %4 ]
br label %12
12: ; preds = %9, %10
%13 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %10 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %9 ]
%14 = phi i32 [ %11, %10 ], [ 0, %9 ]
%15 = tail call i32 @printf(i8* %13, i32 %5)
%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 = %12, %0
ret i32 0
}