#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*/ printf(char *);
int /*<<< orphan*/ putchar(int);
void main() {
  int c;
  int space = 0;
  printf("please press the word\n");
  while ((c = getchar()) != EOF) {
    if (c != ' ' && c != '\n' && c != '\t') {
      putchar(c);
      space = 0;
      continue;
    } else
      space++;
    if (space == 1)
      printf("1\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
je     11ba <main+0x8a>
cmpl   $0x20,-0x4(%rbp)
je     1196 <main+0x66>
cmpl   $0xa,-0x4(%rbp)
je     1196 <main+0x66>
cmpl   $0x9,-0x4(%rbp)
je     1196 <main+0x66>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
jmp    114b <main+0x1b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11b5 <main+0x85>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
jmp    114b <main+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e97(%rip),%rbx
cmp    (%rbx),%eax
jne    1160 <main+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x100000600,%r15
lea    0xea5(%rip),%r14
xor    %ebp,%ebp
jmp    1194 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
je     1155 <main+0x25>
cmp    $0x20,%eax
ja     1180 <main+0x50>
mov    %eax,%ecx
bt     %rcx,%r15
jae    1180 <main+0x50>
test   %ebp,%ebp
je     11b0 <main+0x80>
add    $0x1,%ebp
jmp    1189 <main+0x59>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x1,%ebp
jmp    1189 <main+0x59>

LLVM IR (-O0):
@.str = [23 x i8] c"please press the word\0A\00"
@EOF = global i32 0
@.str.1 = [3 x i8] c"1\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %28, %17, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %1
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %29
8: ; preds = %4
%9 = load i32, i32* %1
%10 = icmp ne i32 %9, 32
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %1
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %1
%16 = icmp ne i32 %15, 9
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %1
%19 = call i32 @putchar(i32 %18)
store i32 0, i32* %2
br label %4
20: ; preds = %14, %11, %8
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %23
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
br label %4
29: ; preds = %4
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@str = [22 x i8] c"please press the word\00"
@str.2 = [2 x i8] c"1\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %20, label %5
5: ; preds = %0, %10
%6 = phi i32 [ %12, %10 ], [ %2, %0 ]
%7 = phi i32 [ %11, %10 ], [ 0, %0 ]
switch i32 %6, label %8 [
i32 32, label %15
i32 10, label %15
i32 9, label %15
]
8: ; preds = %5
%9 = tail call i32 @putchar(i32 %6)
br label %10
10: ; preds = %15, %18, %8
%11 = phi i32 [ 0, %8 ], [ 1, %18 ], [ %16, %15 ]
%12 = tail call i32 (...) @getchar()
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %20, label %5
15: ; preds = %5, %5, %5
%16 = add nsw i32 %7, 1
%17 = icmp eq i32 %7, 0
br i1 %17, label %18, label %10
18: ; preds = %15
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
br label %10
20: ; preds = %10, %0
ret void
}