#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, i = 0;
  char line[1000];
  while ((c = getchar()) != EOF)
    if (c != '\t' && c != ' ' && c != '\n')
      line[i++] = c;
    else if (c == '\n')
      printf("input line %s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%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     11b5 <main+0x95>
cmpl   $0x9,-0x8(%rbp)
je     118e <main+0x6e>
cmpl   $0x20,-0x8(%rbp)
je     118e <main+0x6e>
cmpl   $0xa,-0x8(%rbp)
je     118e <main+0x6e>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %cl,-0x400(%rbp,%rax,1)
jmp    11b0 <main+0x90>
cmpl   $0xa,-0x8(%rbp)
jne    11ab <main+0x8b>
lea    -0x400(%rbp),%rsi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0x90>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x3e8,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ead(%rip),%rbx
cmp    (%rbx),%eax
jne    114f <main+0x2f>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xeaa(%rip),%r14
mov    %rsp,%r15
xor    %ebp,%ebp
jmp    1176 <main+0x56>
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     113f <main+0x1f>
cmp    $0x9,%eax
je     116b <main+0x4b>
cmp    $0xa,%eax
je     1160 <main+0x40>
cmp    $0x20,%eax
je     116b <main+0x4b>
movslq %ebp,%rcx
add    $0x1,%ebp
mov    %al,(%rsp,%rcx,1)
jmp    116b <main+0x4b>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [14 x i8] c"input line %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1000 x i8]
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %32, %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 %33
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 9
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 32
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 10
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i32, i32* %2
%20 = trunc i32 %19 to i8
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %23
store i8 %20, i8* %24
br label %32
25: ; preds = %15, %12, %9
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 10
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %18
br label %5
33: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [14 x i8] c"input line %s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 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 %21, label %6
6: ; preds = %0, %16
%7 = phi i32 [ %18, %16 ], [ %3, %0 ]
%8 = phi i32 [ %17, %16 ], [ 0, %0 ]
switch i32 %7, label %9 [
i32 10, label %14
i32 9, label %16
i32 32, label %16
]
9: ; preds = %6
%10 = trunc i32 %7 to i8
%11 = add nsw i32 %8, 1
%12 = sext i32 %8 to i64
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %12
store i8 %10, i8* %13
br label %16
14: ; preds = %6
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %16
16: ; preds = %6, %6, %14, %9
%17 = phi i32 [ %11, %9 ], [ %8, %14 ], [ %8, %6 ], [ %8, %6 ]
%18 = call i32 (...) @getchar()
%19 = load i32, i32* @EOF
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %6
21: ; preds = %16, %0
ret i32 0
}