#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 getchar();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int c, n;
  char buf[100];
  n = 0;
  while ((c = getchar()) != EOF) {
    if (c != '\n') {
      if (n < 100) {
        buf[n++] = c;
      }
    } else {
      for (--n; buf[n] == '\t' || buf[n] == ' '; --n)
        ;
      buf[n + 1] = '\0';
      if (n > 0) {
        printf("[%s]\n", buf);
      }
      n = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     1209 <main+0xe9>
cmpl   $0xa,-0x8(%rbp)
je     1181 <main+0x61>
cmpl   $0x64,-0xc(%rbp)
jge    117c <main+0x5c>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %cl,-0x70(%rbp,%rax,1)
jmp    1204 <main+0xe4>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x71(%rbp)
je     11b3 <main+0x93>
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    11c3 <main+0xa3>
jmp    11d6 <main+0xb6>
jmp    11c8 <main+0xa8>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    118a <main+0x6a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x70(%rbp,%rax,1)
cmpl   $0x0,-0xc(%rbp)
jle    11fd <main+0xdd>
lea    -0x70(%rbp),%rsi
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eac(%rip),%r13
cmp    0x0(%r13),%eax
jne    1153 <main+0x33>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    -0x1(%rsp),%r12
movabs $0xffffffff00000000,%r14
ff ff ff
mov    %rsp,%r15
xor    %ecx,%ecx
jmp    1181 <main+0x61>
nopl   0x0(%rax)
mov    %ecx,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebp,%ecx
cmp    0x0(%r13),%eax
je     1142 <main+0x22>
cmp    $0xa,%eax
jne    11e0 <main+0xc0>
movslq %ecx,%rax
lea    (%r12,%rax,1),%rdx
shl    $0x20,%rax
jmp    11aa <main+0x8a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %r14,%rax
add    $0xffffffff,%ecx
add    $0xffffffffffffffff,%rdx
movzbl (%rdx),%ebx
cmp    $0x20,%bl
je     11a0 <main+0x80>
cmp    $0x9,%bl
je     11a0 <main+0x80>
sar    $0x20,%rax
movb   $0x0,(%rsp,%rax,1)
xor    %ebp,%ebp
cmp    $0x2,%ecx
jl     1172 <main+0x52>
lea    0xe33(%rip),%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
jmp    1172 <main+0x52>
nopw   0x0(%rax,%rax,1)
cmp    $0x63,%ecx
jg     1170 <main+0x50>
movslq %ecx,%rdx
add    $0x1,%ecx
mov    %al,(%rsp,%rdx,1)
jmp    1170 <main+0x50>

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

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