#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*/ *gets(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ putchar(char);
int main() {
  char str[100];
  memset(str, 0, 100);
  while (gets(str) != NULL) {
    int i = 0;
    while (str[i] != 0) {
      if (str[i] == ' ') {
        i++;
        continue;
      }
      putchar(str[i]);
      i++;
    }
    putchar('\n');
    memset(str, 0, 100);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     11d9 <main+0xa9>
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11ba <main+0x8a>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x20,%eax
jne    119e <main+0x6e>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    116c <main+0x3c>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    116c <main+0x3c>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     11ab <main+0x7b>
xor    %ebx,%ebx
mov    %rsp,%r14
jmp    1164 <main+0x34>
nopl   (%rax)
add    $0x1,%rbx
movzbl (%rsp,%rbx,1),%eax
test   %al,%al
je     1180 <main+0x50>
cmp    $0x20,%al
je     1160 <main+0x30>
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
jmp    1164 <main+0x34>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
call   1050 <gets@plt>
mov    $0x0,%ebx
test   %rax,%rax
jne    1164 <main+0x34>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 100)
br label %6
6: ; preds = %36, %0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32* @gets(i8* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %40
10: ; preds = %6
store i32 0, i32* %3
br label %11
11: ; preds = %28, %25, %10
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %36
18: ; preds = %11
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 32
br i1 %24, label %25, label %28
25: ; preds = %18
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %11
28: ; preds = %18
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = call i32 @putchar(i8 signext %32)
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %11
36: ; preds = %11
%37 = call i32 @putchar(i8 signext 10)
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%39 = call i32 @memset(i8* %38, i32 0, i32 100)
br label %6
40: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 100)
%4 = call i32* @gets(i8* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %21, label %6
6: ; preds = %0, %12
%7 = phi i64 [ %13, %12 ], [ 0, %0 ]
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
switch i8 %9, label %14 [
i8 0, label %16
i8 32, label %10
]
10: ; preds = %6, %14
%11 = add nuw i64 %7, 1
br label %12
12: ; preds = %10, %16
%13 = phi i64 [ %11, %10 ], [ 0, %16 ]
br label %6
14: ; preds = %6
%15 = call i32 @putchar(i8 signext %9)
br label %10
16: ; preds = %6
%17 = call i32 @putchar(i8 signext 10)
%18 = call i32 @memset(i8* %2, i32 0, i32 100)
%19 = call i32* @gets(i8* %2)
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %12
21: ; preds = %16, %0
ret i32 0
}