#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() {
  char c, prev;
  prev = EOF;
  while ((c = getchar()) != EOF) {
    if (c == '\n' || c == ' ' || c == '\t')
      c = '\n';
    if (prev != '\n')
      putchar(c);
    prev = c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%al
mov    %al,-0x6(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e99(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11a6 <main+0x86>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1181 <main+0x61>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1181 <main+0x61>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1185 <main+0x65>
movb   $0xa,-0x5(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0xa,%eax
je     119b <main+0x7b>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
jmp    113b <main+0x1b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ebd(%rip),%r14
mov    (%r14),%bpl
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
jne    1141 <main+0x21>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0xa,%ebx
jmp    115c <main+0x3c>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
je     113a <main+0x1a>
mov    %ebp,%ecx
lea    -0x9(%rax),%edx
cmp    $0x2,%dl
movzbl %al,%eax
mov    %eax,%ebp
cmovb  %ebx,%ebp
cmp    $0x20,%al
cmove  %ebx,%ebp
cmp    $0xa,%cl
je     1150 <main+0x30>
movsbl %bpl,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x30>

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

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