#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*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char frase[200], palavra[200];
  scanf(" %[^\n]s", frase);
  int j = 0;
  for (int i = 0; frase[i] != '\0'; i++) {
    palavra[j] = frase[i];
    if (palavra[j] == ' ') {
      if (frase[i + 1] != ' ' && frase[i + 1] != '\0')
        j = 0;
    } else
      j++;
  }
  palavra[j] = '\0';
  printf("%s", palavra);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x1a4(%rbp)
movl   $0x0,-0x1a8(%rbp)
movslq -0x1a8(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1214 <main+0xf4>
movslq -0x1a8(%rbp),%rax
mov    -0xd0(%rbp,%rax,1),%cl
movslq -0x1a4(%rbp),%rax
mov    %cl,-0x1a0(%rbp,%rax,1)
movslq -0x1a4(%rbp),%rax
movsbl -0x1a0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    11ec <main+0xcc>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
je     11e7 <main+0xc7>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     11e7 <main+0xc7>
movl   $0x0,-0x1a4(%rbp)
jmp    11fb <main+0xdb>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1200 <main+0xe0>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1159 <main+0x39>
movslq -0x1a4(%rbp),%rax
movb   $0x0,-0x1a0(%rbp,%rax,1)
lea    -0x1a0(%rbp),%rsi
lea    0xdd7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%dl
test   %dl,%dl
je     1181 <main+0x61>
xor    %eax,%eax
xor    %ecx,%ecx
jmp    1160 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ecx
movzbl 0x1(%rsp,%rax,1),%edx
add    $0x1,%rax
test   %dl,%dl
je     1183 <main+0x63>
movslq %ecx,%rsi
mov    %dl,0xd0(%rsp,%rsi,1)
cmp    $0x20,%dl
jne    1150 <main+0x30>
movzbl 0x1(%rsp,%rax,1),%edx
add    $0x1,%rax
test   $0xdf,%dl
je     115c <main+0x3c>
xor    %ecx,%ecx
jmp    115c <main+0x3c>
xor    %ecx,%ecx
movslq %ecx,%rax
movb   $0x0,0xd0(%rsp,%rax,1)
lea    0xe73(%rip),%rdi
lea    0xd0(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c" %[^\0A]s\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca [200 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 0, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %51, %0
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %54
15: ; preds = %8
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 %21
store i8 %19, i8* %22
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 32
br i1 %28, label %29, label %47
29: ; preds = %15
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 32
br i1 %36, label %37, label %46
37: ; preds = %29
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %37
store i32 0, i32* %4
br label %46
46: ; preds = %45, %37, %29
br label %50
47: ; preds = %15
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %50
50: ; preds = %47, %46
br label %51
51: ; preds = %50
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %8
54: ; preds = %8
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 %56
store i8 0, i8* %57
%58 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%59 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %58)
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [8 x i8] c" %[^\0A]s\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %30, %0
%9 = phi i32 [ 0, %0 ], [ %33, %30 ]
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %10
store i8 0, i8* %11
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
13: ; preds = %0, %30
%14 = phi i64 [ %32, %30 ], [ 0, %0 ]
%15 = phi i8 [ %31, %30 ], [ %6, %0 ]
%16 = phi i32 [ %33, %30 ], [ 0, %0 ]
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %17
store i8 %15, i8* %18
%19 = icmp eq i8 %15, 32
br i1 %19, label %20, label %25
20: ; preds = %13
%21 = add nuw i64 %14, 1
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 %21
%23 = load i8, i8* %22
switch i8 %23, label %24 [
i8 32, label %30
i8 0, label %30
]
24: ; preds = %20
br label %30
25: ; preds = %13
%26 = add nsw i32 %16, 1
%27 = add nuw i64 %14, 1
%28 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 %27
%29 = load i8, i8* %28
br label %30
30: ; preds = %20, %20, %25, %24
%31 = phi i8 [ %23, %20 ], [ %23, %20 ], [ %29, %25 ], [ %23, %24 ]
%32 = phi i64 [ %21, %20 ], [ %21, %20 ], [ %27, %25 ], [ %21, %24 ]
%33 = phi i32 [ %16, %20 ], [ %16, %20 ], [ %26, %25 ], [ 0, %24 ]
%34 = icmp eq i8 %31, 0
br i1 %34, label %8, label %13
}