#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() {
  int len = 0;
  char blanks[1000];
  char c;
  int full = 1;
  int i;
  while ((c = getchar()) != EOF) {
    if (c != '\n') {
      if (c == '\t' || c == ' ') {
        if (len < 1000 - 1)
          blanks[len++] = c;
        else
          len++;
      } else {
        full = 0;
        for (i = 0; i < len; ++i) {
          putchar(blanks[i]);
        }
        len = 0;
        putchar(c);
      }
    } else {
      if (full != 1)
        putchar('\n');
      len = 0;
      full = 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x3f8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x3f1(%rbp)
movsbl %al,%eax
mov    0x2e8e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     125f <main+0x13f>
movsbl -0x3f1(%rbp),%eax
cmp    $0xa,%eax
je     1232 <main+0x112>
movsbl -0x3f1(%rbp),%eax
cmp    $0x9,%eax
je     1195 <main+0x75>
movsbl -0x3f1(%rbp),%eax
cmp    $0x20,%eax
jne    11cf <main+0xaf>
cmpl   $0x3e7,-0x8(%rbp)
jge    11c1 <main+0xa1>
mov    -0x3f1(%rbp),%cl
mov    -0x8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
cltq
mov    %cl,-0x3f0(%rbp,%rax,1)
jmp    11ca <main+0xaa>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    122d <main+0x10d>
movl   $0x0,-0x3f8(%rbp)
movl   $0x0,-0x3fc(%rbp)
mov    -0x3fc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121a <main+0xfa>
movslq -0x3fc(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
jmp    11e3 <main+0xc3>
movl   $0x0,-0x8(%rbp)
movsbl -0x3f1(%rbp),%edi
call   1030 <putchar@plt>
jmp    125a <main+0x13a>
cmpl   $0x1,-0x3f8(%rbp)
je     1249 <main+0x129>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x3f8(%rbp)
jmp    1143 <main+0x23>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3f0,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eab(%rip),%r14
cmp    (%r14),%al
jne    1154 <main+0x34>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r12d
mov    $0x1,%r15d
xor    %eax,%eax
jmp    118f <main+0x6f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cmp    $0x1,%r15d
jne    11f2 <main+0xd2>
mov    $0x1,%r15d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r12d
mov    %ebp,%eax
cmp    (%r14),%r12b
je     1142 <main+0x22>
cmp    $0x9,%r12b
je     11a1 <main+0x81>
cmp    $0xa,%r12b
je     1170 <main+0x50>
cmp    $0x20,%r12b
jne    11c0 <main+0xa0>
lea    0x1(%rax),%ebp
cmp    $0x3e6,%eax
jg     117e <main+0x5e>
cltq
mov    %r12b,(%rsp,%rax,1)
jmp    117e <main+0x5e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %eax,%eax
jle    11e2 <main+0xc2>
mov    %eax,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11d0 <main+0xb0>
movsbl %r12b,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
xor    %r15d,%r15d
jmp    117e <main+0x5e>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1178 <main+0x58>

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %39, label %6
6: ; preds = %0, %33
%7 = phi i8 [ %36, %33 ], [ %3, %0 ]
%8 = phi i32 [ %35, %33 ], [ 1, %0 ]
%9 = phi i32 [ %34, %33 ], [ 0, %0 ]
switch i8 %7, label %10 [
i8 10, label %29
i8 32, label %14
i8 9, label %14
]
10: ; preds = %6
%11 = icmp sgt i32 %9, 0
br i1 %11, label %12, label %27
12: ; preds = %10
%13 = zext i32 %9 to i64
br label %20
14: ; preds = %6, %6
%15 = icmp slt i32 %9, 999
%16 = add nsw i32 %9, 1
br i1 %15, label %17, label %33
17: ; preds = %14
%18 = sext i32 %9 to i64
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %18
store i8 %7, i8* %19
br label %33
20: ; preds = %12, %20
%21 = phi i64 [ 0, %12 ], [ %25, %20 ]
%22 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = tail call i32 @putchar(i8 signext %23)
%25 = add nuw nsw i64 %21, 1
%26 = icmp eq i64 %25, %13
br i1 %26, label %27, label %20
27: ; preds = %20, %10
%28 = tail call i32 @putchar(i8 signext %7)
br label %33
29: ; preds = %6
%30 = icmp eq i32 %8, 1
br i1 %30, label %33, label %31
31: ; preds = %29
%32 = tail call i32 @putchar(i8 signext 10)
br label %33
33: ; preds = %14, %29, %31, %27, %17
%34 = phi i32 [ %16, %17 ], [ 0, %27 ], [ 0, %31 ], [ 0, %29 ], [ %16, %14 ]
%35 = phi i32 [ %8, %17 ], [ 0, %27 ], [ 1, %31 ], [ 1, %29 ], [ %8, %14 ]
%36 = tail call signext i8 (...) @getchar()
%37 = load i8, i8* @EOF
%38 = icmp eq i8 %36, %37
br i1 %38, label %39, label %6
39: ; preds = %33, %0
ret i32 0
}