#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 EXIT_SUCCESS;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  int c;
  bool prev_is_space;
  prev_is_space = false;
  while ((c = getchar()) != EOF) {
    if (c == ' ' && prev_is_space) {
      continue;
    } else {
      putchar(c);
      if (c == ' ')
        prev_is_space = true;
      else
        prev_is_space = false;
    }
  }
  return EXIT_SUCCESS;
}


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,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%eax
je     119e <main+0x7e>
cmpl   $0x20,-0x14(%rbp)
jne    116f <main+0x4f>
cmpl   $0x0,-0x18(%rbp)
je     116f <main+0x4f>
jmp    113d <main+0x1d>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x20,-0x14(%rbp)
jne    118d <main+0x6d>
movl   $0x1,-0x18(%rbp)
jmp    1194 <main+0x74>
movl   $0x0,-0x18(%rbp)
jmp    1199 <main+0x79>
jmp    113d <main+0x1d>
mov    0x2e33(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb7(%rip),%rbx
cmp    (%rbx),%eax
jne    1145 <main+0x25>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %ebp,%ebp
jmp    116b <main+0x4b>
nopl   0x0(%rax)
xor    %ebp,%ebp
cmp    $0x20,%eax
sete   %bpl
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1135 <main+0x15>
test   %ebp,%ebp
je     1150 <main+0x30>
mov    $0x1,%ebp
cmp    $0x20,%eax
je     1160 <main+0x40>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
@EXIT_SUCCESS = 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* %7
br label %8
8: ; preds = %27, %18, %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 %28
12: ; preds = %8
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 32
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
br label %8
19: ; preds = %15, %12
%20 = load i32, i32* %6
%21 = call i32 @putchar(i32 %20)
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 32
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 1, i32* %7
br label %26
25: ; preds = %19
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
br label %27
27: ; preds = %26
br label %8
28: ; preds = %8
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}

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