#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 */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main(void) {
  char c;
  int inorout = 0;
  while ((c = getchar()) != EOF) {
    if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))) {
      if (inorout == 0)
        inorout = 1;
      (void)putchar(c);
    } else if ((c == ' ') || (c == '\n')) {
      if (inorout == 1)
        (void)putchar('\n');
      inorout = 0;
    } else {
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11f1 <main+0xd1>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     116f <main+0x4f>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1189 <main+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     11a8 <main+0x88>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11a8 <main+0x88>
cmpl   $0x0,-0xc(%rbp)
jne    119a <main+0x7a>
movl   $0x1,-0xc(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    11ec <main+0xcc>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     11c2 <main+0xa2>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    11e2 <main+0xc2>
cmpl   $0x1,-0xc(%rbp)
jne    11d6 <main+0xb6>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
jmp    11e7 <main+0xc7>
jmp    11e7 <main+0xc7>
jmp    11ec <main+0xcc>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r15
cmp    (%r15),%al
jne    1147 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r14d
xor    %ebp,%ebp
jmp    117e <main+0x5e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %ebp,%ebp
cmove  %r14d,%ebp
mov    %ebp,%ebx
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %ebx,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%al
je     113a <main+0x1a>
mov    %eax,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x19,%cl
jbe    1160 <main+0x40>
cmp    $0x20,%al
je     1193 <main+0x73>
cmp    $0xa,%al
jne    1172 <main+0x52>
xor    %ebx,%ebx
mov    $0xa,%al
cmp    $0x1,%ebp
mov    $0x0,%ebp
je     1168 <main+0x48>
jmp    1172 <main+0x52>

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %49, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %50
10: ; preds = %4
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %26, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %33
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br i1 %25, label %26, label %33
26: ; preds = %22, %14
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %26
store i32 1, i32* %3
br label %30
30: ; preds = %29, %26
%31 = load i8, i8* %2
%32 = call i32 @putchar(i8 signext %31)
br label %49
33: ; preds = %22, %18
%34 = load i8, i8* %2
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 32
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i8, i8* %2
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 10
br i1 %40, label %41, label %47
41: ; preds = %37, %33
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @putchar(i8 signext 10)
br label %46
46: ; preds = %44, %41
store i32 0, i32* %3
br label %48
47: ; preds = %37
br label %48
48: ; preds = %47, %46
br label %49
49: ; preds = %48, %30
br label %4
50: ; preds = %4
ret i32 0
}

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