#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(void) {
  int c, nl = 0, sl = 0, tl = 0;
  int count = 0;
  c = getchar();
  while ((c = getchar()) != EOF) {
    if (c == ' ') {
      if (count == 0) {
        count++;
        putchar(c);
      } else
        putchar(c);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%eax
je     11aa <main+0x8a>
cmpl   $0x20,-0x8(%rbp)
jne    11a5 <main+0x85>
cmpl   $0x0,-0x18(%rbp)
jne    1198 <main+0x78>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    11a0 <main+0x80>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    11a5 <main+0x85>
jmp    1155 <main+0x35>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb2(%rip),%rbx
jmp    1147 <main+0x27>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     115c <main+0x3c>
cmp    $0x20,%eax
jne    1140 <main+0x20>
mov    $0x20,%edi
call   1030 <putchar@plt>
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
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (...) @getchar()
store i32 %7, i32* %2
br label %8
8: ; preds = %27, %0
%9 = call i32 (...) @getchar()
store i32 %9, i32* %2
%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* %2
%14 = icmp eq i32 %13, 32
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
%21 = load i32, i32* %2
%22 = call i32 @putchar(i32 %21)
br label %26
23: ; preds = %15
%24 = load i32, i32* %2
%25 = call i32 @putchar(i32 %24)
br label %26
26: ; preds = %23, %18
br label %27
27: ; preds = %26, %12
br label %8
28: ; preds = %8
%29 = load i32, i32* %1
ret i32 %29
}

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