#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 EXIT_SUCCESS;
int getchar();
scalar_t__ isalpha(int);
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  int c, prevc;
  bool end_word;
  end_word = false;
  prevc = EOF;
  while ((c = getchar()) != EOF) {
    if (isalpha(c)) {
      putchar(c);
    } else {
      if (isalpha(prevc))
        end_word = true;
    }
    if (end_word) {
      putchar('\n');
      end_word = false;
    }
    prevc = c;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%eax
je     11d8 <main+0xa8>
mov    -0x14(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     1194 <main+0x64>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11b2 <main+0x82>
mov    -0x18(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     11ad <main+0x7d>
movl   $0x1,-0x1c(%rbp)
jmp    11b2 <main+0x82>
cmpl   $0x0,-0x1c(%rbp)
je     11cd <main+0x9d>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1159 <main+0x29>
mov    0x2df9(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ead(%rip),%r14
mov    (%r14),%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1163 <main+0x33>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%ecx
movsbl %cl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebx,%ebp
cmp    (%r14),%eax
je     1186 <main+0x56>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <isalpha@plt>
test   %rax,%rax
jne    1150 <main+0x20>
mov    %ebp,%edi
call   1050 <isalpha@plt>
mov    $0xa,%cl
test   %rax,%rax
jne    1152 <main+0x22>
jmp    115a <main+0x2a>
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%9 = load i32, i32* @EOF
store i32 %9, i32* %7
br label %10
10: ; preds = %33, %2
%11 = call i32 (...) @getchar()
store i32 %11, i32* %6
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %35
14: ; preds = %10
%15 = load i32, i32* %6
%16 = call i64 @isalpha(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %6
%20 = trunc i32 %19 to i8
%21 = call i32 @putchar(i8 signext %20)
br label %28
22: ; preds = %14
%23 = load i32, i32* %7
%24 = call i64 @isalpha(i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 1, i32* %8
br label %27
27: ; preds = %26, %22
br label %28
28: ; preds = %27, %18
%29 = load i32, i32* %8
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %8
br label %33
33: ; preds = %31, %28
%34 = load i32, i32* %6
store i32 %34, i32* %7
br label %10
35: ; preds = %10
%36 = load i32, i32* @EXIT_SUCCESS
ret i32 %36
}

LLVM IR (-O2):
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 (...) @getchar()
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %24, label %7
7: ; preds = %2, %20
%8 = phi i32 [ %21, %20 ], [ %4, %2 ]
%9 = phi i32 [ %8, %20 ], [ %3, %2 ]
%10 = tail call i64 @isalpha(i32 %8)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = trunc i32 %8 to i8
br label %17
14: ; preds = %7
%15 = tail call i64 @isalpha(i32 %9)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14, %12
%18 = phi i8 [ %13, %12 ], [ 10, %14 ]
%19 = tail call i32 @putchar(i8 signext %18)
br label %20
20: ; preds = %17, %14
%21 = tail call i32 (...) @getchar()
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %7
24: ; preds = %20, %2
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}