#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);
int main(int arc, char *argv[]) {
  int c, prev;
  c = 0;
  prev = 'a';
  while ((c = getchar()) != EOF) {
    if ((prev == ' ') || (prev == '\t') || (prev == '\n')) {
      if ((c == ' ') || (c == '\t') || (c == '\n'))
        continue;
    }
    prev = c;
    putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x61,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     11b6 <main+0x96>
cmpl   $0x20,-0x18(%rbp)
je     117b <main+0x5b>
cmpl   $0x9,-0x18(%rbp)
je     117b <main+0x5b>
cmpl   $0xa,-0x18(%rbp)
jne    11a3 <main+0x83>
cmpl   $0x20,-0x14(%rbp)
je     1199 <main+0x79>
cmpl   $0x9,-0x14(%rbp)
je     1199 <main+0x79>
cmpl   $0xa,-0x14(%rbp)
jne    119e <main+0x7e>
jmp    1144 <main+0x24>
jmp    11a3 <main+0x83>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb2(%rip),%r15
cmp    (%r15),%eax
jne    1146 <main+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r14d
mov    $0x61,%ebx
movabs $0x100000600,%r12
mov    %r14d,%ebp
nopl   0x0(%rax,%rax,1)
cmp    $0x20,%ebx
ja     118a <main+0x6a>
mov    %ebx,%eax
bt     %rax,%r12
jae    118a <main+0x6a>
cmp    $0x20,%ebp
ja     118d <main+0x6d>
mov    %ebp,%eax
bt     %rax,%r12
jae    118d <main+0x6d>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
jne    1160 <main+0x40>
jmp    113b <main+0x1b>
mov    %r14d,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r14d
mov    %ebp,%ebx
cmp    (%r15),%eax
jne    1158 <main+0x38>
jmp    113b <main+0x1b>

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %22, label %6
6: ; preds = %2, %16
%7 = phi i32 [ %19, %16 ], [ %3, %2 ]
%8 = phi i32 [ %17, %16 ], [ 97, %2 ]
br label %9
9: ; preds = %6, %12
%10 = phi i32 [ %7, %6 ], [ %13, %12 ]
switch i32 %8, label %16 [
i32 32, label %11
i32 10, label %11
i32 9, label %11
]
11: ; preds = %9, %9, %9
switch i32 %10, label %16 [
i32 32, label %12
i32 10, label %12
i32 9, label %12
]
12: ; preds = %11, %11, %11
%13 = tail call i32 (...) @getchar()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %22, label %9
16: ; preds = %11, %9
%17 = phi i32 [ %10, %11 ], [ %7, %9 ]
%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 %6
22: ; preds = %16, %12, %2
ret i32 0
}