#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 */
long EOF;
long getchar();
int /*<<< orphan*/ putchar(long);
void e_1_9() {
  long c, spaceCount;
  spaceCount = 0;
  while ((c = getchar()) != EOF) {
    if (c == ' ') {
      if (++spaceCount == 1) {
        putchar(c);
      }
    } else {
      putchar(c);
      spaceCount = 0;
    }
  }
}


x86 assembly (clang, -O0):
<e_1_9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
je     1190 <e_1_9+0x70>
cmpq   $0x20,-0x8(%rbp)
jne    117a <e_1_9+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x1,%rax
jne    1175 <e_1_9+0x55>
mov    -0x8(%rbp),%rdi
call   1030 <putchar@plt>
jmp    118b <e_1_9+0x6b>
mov    -0x8(%rbp),%rdi
call   1030 <putchar@plt>
movq   $0x0,-0x10(%rbp)
jmp    1130 <e_1_9+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_1_9>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%rax
jne    113f <e_1_9+0x1f>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %ebx,%ebx
jmp    1166 <e_1_9+0x46>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ebx,%ebx
mov    %rax,%rdi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%rax
je     1137 <e_1_9+0x17>
cmp    $0x20,%rax
jne    1150 <e_1_9+0x30>
test   %rbx,%rbx
je     1177 <e_1_9+0x57>
add    $0x1,%rbx
jmp    115a <e_1_9+0x3a>
mov    $0x1,%ebx
mov    $0x20,%eax
jmp    1152 <e_1_9+0x32>

LLVM IR (-O0):
@EOF = global i64 0
define void @e_1_9() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %2
br label %3
3: ; preds = %21, %0
%4 = call i64 (...) @getchar()
store i64 %4, i64* %1
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %22
7: ; preds = %3
%8 = load i64, i64* %1
%9 = icmp eq i64 %8, 32
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i64, i64* %2
%12 = add nsw i64 %11, 1
store i64 %12, i64* %2
%13 = icmp eq i64 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i64, i64* %1
%16 = call i32 @putchar(i64 %15)
br label %17
17: ; preds = %14, %10
br label %21
18: ; preds = %7
%19 = load i64, i64* %1
%20 = call i32 @putchar(i64 %19)
store i64 0, i64* %2
br label %21
21: ; preds = %18, %17
br label %3
22: ; preds = %3
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
define void @e_1_9() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %20, label %4
4: ; preds = %0, %15
%5 = phi i64 [ %17, %15 ], [ %1, %0 ]
%6 = phi i64 [ %16, %15 ], [ 0, %0 ]
%7 = icmp eq i64 %5, 32
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = add nsw i64 %6, 1
%10 = icmp eq i64 %6, 0
br i1 %10, label %11, label %15
11: ; preds = %4, %8
%12 = phi i64 [ 32, %8 ], [ %5, %4 ]
%13 = phi i64 [ 1, %8 ], [ 0, %4 ]
%14 = tail call i32 @putchar(i64 %12)
br label %15
15: ; preds = %11, %8
%16 = phi i64 [ %9, %8 ], [ %13, %11 ]
%17 = tail call i64 (...) @getchar()
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %4
20: ; preds = %15, %0
ret void
}