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


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   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     11f3 <main+0xd3>
cmpl   $0x20,-0x8(%rbp)
jne    117e <main+0x5e>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x20,%eax
jne    1179 <main+0x59>
jmp    1161 <main+0x41>
jmp    11e6 <main+0xc6>
cmpl   $0x9,-0x8(%rbp)
jne    11ad <main+0x8d>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x9,%eax
jne    11a8 <main+0x88>
jmp    1190 <main+0x70>
jmp    11e1 <main+0xc1>
cmpl   $0xa,-0x8(%rbp)
jne    11dc <main+0xbc>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
jne    11d7 <main+0xb7>
jmp    11bf <main+0x9f>
jmp    11dc <main+0xbc>
jmp    11e1 <main+0xc1>
jmp    11e6 <main+0xc6>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    114e <main+0x2e>
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>
cmp    (%rbx),%eax
je     11be <main+0x9e>
cmp    $0x9,%eax
je     1180 <main+0x60>
cmp    $0xa,%eax
je     11a0 <main+0x80>
cmp    $0x20,%eax
jne    1140 <main+0x20>
mov    $0x20,%edi
call   1030 <putchar@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x20,%eax
je     1170 <main+0x50>
jmp    1140 <main+0x20>
xchg   %ax,%ax
mov    $0x9,%edi
call   1030 <putchar@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x9,%eax
je     1190 <main+0x70>
jmp    1140 <main+0x20>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     11b0 <main+0x90>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

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