#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 getline(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char line[1000];
  char striped[1000];
  int len;
  int count;
  int i, j;
  count = 1;
  printf("%d) ", count);
  while ((len = getline(line, 1000)) > 0) {
    for (i = 0; line[i] == '\t' || line[i] == ' '; ++i, --len)
      continue;
    for (j = 0; line[i] != '\0'; ++j)
      striped[j] = line[i++];
    striped[j] = '\0';
    while (--len > 0 && (striped[len] == '\n' || striped[len] == '\t' ||
                         striped[len] == ' '))
      continue;
    if (len > 1) {
      striped[++len] = '\n';
      striped[++len] = '\0';
      printf("line: %s", striped);
      printf("length: %d\n", len);
    }
    printf("%d) ", ++count);
  }
  printf("Done!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x7e8(%rbp)
mov    -0x7e8(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x7e4(%rbp)
cmp    $0x0,%eax
jle    1386 <main+0x266>
movl   $0x0,-0x7ec(%rbp)
movslq -0x7ec(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x7f1(%rbp)
je     11b5 <main+0x95>
movslq -0x7ec(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
sete   %al
mov    %al,-0x7f1(%rbp)
mov    -0x7f1(%rbp),%al
test   $0x1,%al
jne    11c8 <main+0xa8>
jmp    11f0 <main+0xd0>
jmp    11cd <main+0xad>
mov    -0x7ec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7ec(%rbp)
mov    -0x7e4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x7e4(%rbp)
jmp    117a <main+0x5a>
movl   $0x0,-0x7f0(%rbp)
movslq -0x7ec(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     124e <main+0x12e>
mov    -0x7ec(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x7ec(%rbp)
cltq
mov    -0x3f0(%rbp,%rax,1),%cl
movslq -0x7f0(%rbp),%rax
mov    %cl,-0x7e0(%rbp,%rax,1)
mov    -0x7f0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7f0(%rbp)
jmp    11fa <main+0xda>
movslq -0x7f0(%rbp),%rax
movb   $0x0,-0x7e0(%rbp,%rax,1)
mov    -0x7e4(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x7e4(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x7f2(%rbp)
jle    12e4 <main+0x1c4>
movslq -0x7e4(%rbp),%rax
movsbl -0x7e0(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x7f3(%rbp)
je     12d8 <main+0x1b8>
movslq -0x7e4(%rbp),%rax
movsbl -0x7e0(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x7f3(%rbp)
je     12d8 <main+0x1b8>
movslq -0x7e4(%rbp),%rax
movsbl -0x7e0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
sete   %al
mov    %al,-0x7f3(%rbp)
mov    -0x7f3(%rbp),%al
mov    %al,-0x7f2(%rbp)
mov    -0x7f2(%rbp),%al
test   $0x1,%al
jne    12f7 <main+0x1d7>
jmp    12fc <main+0x1dc>
jmp    125d <main+0x13d>
cmpl   $0x1,-0x7e4(%rbp)
jle    1364 <main+0x244>
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
cltq
movb   $0xa,-0x7e0(%rbp,%rax,1)
0a
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
cltq
movb   $0x0,-0x7e0(%rbp,%rax,1)
lea    -0x7e0(%rbp),%rsi
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7e4(%rbp),%esi
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7e8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x7e8(%rbp)
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1150 <main+0x30>
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7d8,%rsp
lea    0xeb8(%rip),%rdi
mov    $0x1,%r15d
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x3f0(%rsp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    12bd <main+0x18d>
lea    0x3f1(%rsp),%rbp
movabs $0x100000600,%r12
lea    0xe73(%rip),%r14
lea    0x3f0(%rsp),%r13
jmp    11c6 <main+0x96>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    12bd <main+0x18d>
mov    %eax,%esi
xor    %ecx,%ecx
xor    %edx,%edx
jmp    11da <main+0xaa>
xchg   %ax,%ax
add    $0x1,%rdx
add    $0x1,%ecx
add    $0xffffffff,%esi
movzbl 0x3f0(%rsp,%rdx,1),%ebx
cmp    $0x9,%bl
je     11d0 <main+0xa0>
cmp    $0x20,%bl
je     11d0 <main+0xa0>
mov    %edx,%esi
mov    0x3f0(%rsp,%rsi,1),%bl
mov    %eax,%eax
sub    %rdx,%rax
test   %bl,%bl
je     1230 <main+0x100>
mov    %ecx,%ecx
add    %rbp,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %bl,(%rsp,%rdx,1)
movzbl (%rcx,%rdx,1),%ebx
add    $0x1,%rdx
test   %bl,%bl
jne    1210 <main+0xe0>
jmp    1232 <main+0x102>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
mov    %edx,%ecx
movb   $0x0,(%rsp,%rcx,1)
cmp    $0x2,%eax
jl     11a0 <main+0x70>
mov    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rax),%rcx
mov    %ecx,%edx
movzbl (%rsp,%rdx,1),%edx
cmp    $0x20,%rdx
ja     1278 <main+0x148>
bt     %rdx,%r12
jae    1278 <main+0x148>
lea    0x1(%rcx),%rdx
mov    %rcx,%rax
cmp    $0x2,%rdx
ja     1250 <main+0x120>
jmp    11a0 <main+0x70>
cmp    $0x3,%eax
jb     11a0 <main+0x70>
mov    %eax,%ecx
movb   $0xa,(%rsp,%rcx,1)
mov    %r14,%rbx
lea    0x1(%rax),%r14d
movb   $0x0,(%rsp,%r14,1)
lea    0xd6b(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd63(%rip),%rdi
mov    %r14d,%esi
mov    %rbx,%r14
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11a0 <main+0x70>
lea    0xd56(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d) \00"
@.str.1 = [9 x i8] c"line: %s\00"
@.str.2 = [12 x i8] c"length: %d\0A\00"
@.str.3 = [7 x i8] c"Done!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [1000 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %5
%8 = load i32, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %107, %0
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%12 = call i32 @getline(i8* %11, i32 1000)
store i32 %12, i32* %4
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %111
14: ; preds = %10
store i32 0, i32* %6
br label %15
15: ; preds = %32, %14
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 9
br i1 %21, label %29, label %22
22: ; preds = %15
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 32
br label %29
29: ; preds = %22, %15
%30 = phi i1 [ true, %15 ], [ %28, %22 ]
br i1 %30, label %31, label %37
31: ; preds = %29
br label %32
32: ; preds = %31
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
%35 = load i32, i32* %4
%36 = add nsw i32 %35, -1
store i32 %36, i32* %4
br label %15
37: ; preds = %29
store i32 0, i32* %7
br label %38
38: ; preds = %54, %37
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %57
45: ; preds = %38
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
%48 = sext i32 %46 to i64
%49 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %52
store i8 %50, i8* %53
br label %54
54: ; preds = %45
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %38
57: ; preds = %38
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %59
store i8 0, i8* %60
br label %61
61: ; preds = %90, %57
%62 = load i32, i32* %4
%63 = add nsw i32 %62, -1
store i32 %63, i32* %4
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %88
65: ; preds = %61
%66 = load i32, i32* %4
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 10
br i1 %71, label %86, label %72
72: ; preds = %65
%73 = load i32, i32* %4
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 9
br i1 %78, label %86, label %79
79: ; preds = %72
%80 = load i32, i32* %4
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %81
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp eq i32 %84, 32
br label %86
86: ; preds = %79, %72, %65
%87 = phi i1 [ true, %72 ], [ true, %65 ], [ %85, %79 ]
br label %88
88: ; preds = %86, %61
%89 = phi i1 [ false, %61 ], [ %87, %86 ]
br i1 %89, label %90, label %91
90: ; preds = %88
br label %61
91: ; preds = %88
%92 = load i32, i32* %4
%93 = icmp sgt i32 %92, 1
br i1 %93, label %94, label %107
94: ; preds = %91
%95 = load i32, i32* %4
%96 = add nsw i32 %95, 1
store i32 %96, i32* %4
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %97
store i8 10, i8* %98
%99 = load i32, i32* %4
%100 = add nsw i32 %99, 1
store i32 %100, i32* %4
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %101
store i8 0, i8* %102
%103 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %103)
%105 = load i32, i32* %4
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %105)
br label %107
107: ; preds = %94, %91
%108 = load i32, i32* %5
%109 = add nsw i32 %108, 1
store i32 %109, i32* %5
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %109)
br label %10
111: ; preds = %10
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d) \00"
@.str.1 = [9 x i8] c"line: %s\00"
@.str.2 = [12 x i8] c"length: %d\0A\00"
@str = [6 x i8] c"Done!\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @getline(i8* %3, i32 1000)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %65
8: ; preds = %0, %60
%9 = phi i32 [ %63, %60 ], [ %6, %0 ]
%10 = phi i32 [ %61, %60 ], [ 1, %0 ]
br label %11
11: ; preds = %8, %21
%12 = phi i64 [ 0, %8 ], [ %22, %21 ]
%13 = phi i32 [ %9, %8 ], [ %23, %21 ]
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %12
%15 = load i8, i8* %14
switch i8 %15, label %16 [
i8 9, label %21
i8 32, label %21
]
16: ; preds = %11
%17 = and i64 %12, 4294967295
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %34, label %24
21: ; preds = %11, %11
%22 = add nuw i64 %12, 1
%23 = add nsw i32 %13, -1
br label %11
24: ; preds = %16, %24
%25 = phi i64 [ %28, %24 ], [ %17, %16 ]
%26 = phi i64 [ %30, %24 ], [ 0, %16 ]
%27 = phi i8 [ %32, %24 ], [ %19, %16 ]
%28 = add nuw i64 %25, 1
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %26
store i8 %27, i8* %29
%30 = add nuw i64 %26, 1
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %28
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 0
br i1 %33, label %34, label %24
34: ; preds = %24, %16
%35 = phi i64 [ 0, %16 ], [ %30, %24 ]
%36 = and i64 %35, 4294967295
%37 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %36
store i8 0, i8* %37
%38 = icmp sgt i32 %13, 1
br i1 %38, label %39, label %60
39: ; preds = %34
%40 = zext i32 %13 to i64
br label %41
41: ; preds = %39, %47
%42 = phi i64 [ %40, %39 ], [ %43, %47 ]
%43 = add nsw i64 %42, -1
%44 = and i64 %43, 4294967295
%45 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %44
%46 = load i8, i8* %45
switch i8 %46, label %49 [
i8 10, label %47
i8 9, label %47
i8 32, label %47
]
47: ; preds = %41, %41, %41
%48 = icmp ugt i64 %42, 2
br i1 %48, label %41, label %60
49: ; preds = %41
%50 = trunc i64 %42 to i32
%51 = icmp ugt i32 %50, 2
br i1 %51, label %52, label %60
52: ; preds = %49
%53 = and i64 %42, 4294967295
%54 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %53
store i8 10, i8* %54
%55 = add nuw nsw i32 %50, 1
%56 = zext i32 %55 to i64
%57 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %56
store i8 0, i8* %57
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %55)
br label %60
60: ; preds = %47, %34, %52, %49
%61 = add nuw nsw i32 %10, 1
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = call i32 @getline(i8* %3, i32 1000)
%64 = icmp sgt i32 %63, 0
br i1 %64, label %8, label %65
65: ; preds = %60, %0
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}