#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 /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stdin;
int main() {
  char *string;
  bool foundspace = false;
  fgets(string, 512, stdin);
  while (*string) {
    if (!foundspace && *string == ' ') {
      foundspace = true;
    } else if (foundspace) {
      printf("%c", *string);
    }
    string++;
  }
  return !foundspace;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11b3 <main+0x93>
cmpl   $0x0,-0x14(%rbp)
jne    1180 <main+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1180 <main+0x60>
movl   $0x1,-0x14(%rbp)
jmp    11a2 <main+0x82>
cmpl   $0x0,-0x14(%rbp)
je     119d <main+0x7d>
mov    -0x10(%rbp),%rax
lea    0xe6b(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
jmp    11a2 <main+0x82>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114d <main+0x2d>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1030 <fgets@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 512, i32 %5)
br label %7
7: ; preds = %28, %0
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %31
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %3
br label %28
20: ; preds = %14, %11
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %25)
br label %27
27: ; preds = %23, %20
br label %28
28: ; preds = %27, %19
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %2
br label %7
31: ; preds = %7
%32 = load i32, i32* %3
%33 = icmp ne i32 %32, 0
%34 = xor i1 %33, true
%35 = zext i1 %34 to i32
ret i32 %35
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgets(i8* undef, i32 512, i32 %1)
unreachable
}