#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 argc, char *argv[]) {
  int c0 = 0;
  int c1 = 0;
  for (; (c1 = getchar()) != EOF; c0 = c1)
    if (' ' != c0 || ' ' != c1)
      putchar(c1);
  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   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     1191 <main+0x71>
mov    $0x20,%eax
cmp    -0x14(%rbp),%eax
jne    1179 <main+0x59>
mov    $0x20,%eax
cmp    -0x18(%rbp),%eax
je     1181 <main+0x61>
mov    -0x18(%rbp),%edi
call   1030 <putchar@plt>
jmp    1186 <main+0x66>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %ebx,%ebx
jmp    1163 <main+0x43>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     1137 <main+0x17>
mov    %ebx,%ecx
mov    %eax,%ebx
cmp    $0x20,%ecx
jne    1150 <main+0x30>
cmp    $0x20,%ebx
je     1157 <main+0x37>
jmp    1150 <main+0x30>

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