#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 get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000 + 1];
  int i;
  while ((len = get_line(line, 1000 + 1)) != 0) {
    if (len > 1) {
      for (i = len - 1; line[i] == ' ' || line[i] == '\t' || line[i] == '\n';
           --i)
        ;
      line[++i] = '\n';
      line[++i] = '\0';
      printf("%s", line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e9,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1236 <main+0x116>
cmpl   $0x1,-0x8(%rbp)
jle    1231 <main+0x111>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x404(%rbp)
movslq -0x404(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x405(%rbp)
je     11c0 <main+0xa0>
movslq -0x404(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%ecx
ff
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x405(%rbp)
je     11c0 <main+0xa0>
movslq -0x404(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
sete   %al
mov    %al,-0x405(%rbp)
mov    -0x405(%rbp),%al
test   $0x1,%al
jne    11d3 <main+0xb3>
jmp    11ec <main+0xcc>
jmp    11d8 <main+0xb8>
mov    -0x404(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x404(%rbp)
jmp    1165 <main+0x45>
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
cltq
movb   $0xa,-0x400(%rbp,%rax,1)
0a
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
cltq
movb   $0x0,-0x400(%rbp,%rax,1)
lea    -0x400(%rbp),%rsi
lea    0xdd4(%rip),%rdi
call   1040 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f8,%rsp
mov    %rsp,%rdi
mov    $0x3e9,%esi
call   1030 <get_line@plt>
test   %eax,%eax
je     11e8 <main+0xc8>
lea    -0x1(%rsp),%r15
movabs $0x100000000,%r12
lea    0xea4(%rip),%r14
mov    %rsp,%r13
movabs $0x100000600,%rbx
movabs $0xffffffff00000000,%rbp
ff ff ff
jmp    11b2 <main+0x92>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rcx
sar    $0x20,%rcx
movb   $0xa,(%rsp,%rcx,1)
add    %r12,%rax
sar    $0x20,%rax
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0x3e9,%esi
call   1030 <get_line@plt>
test   %eax,%eax
je     11e8 <main+0xc8>
cmp    $0x2,%eax
jl     11a1 <main+0x81>
mov    %eax,%eax
lea    (%r15,%rax,1),%rcx
shl    $0x20,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
cmp    $0x20,%rdx
ja     1180 <main+0x60>
bt     %rdx,%rbx
jae    1180 <main+0x60>
add    %rbp,%rax
add    $0xffffffffffffffff,%rcx
jmp    11d0 <main+0xb0>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1001 x i8]
%2 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1001)
%4 = icmp eq i32 %3, 0
br i1 %4, label %28, label %5
5: ; preds = %0, %25
%6 = phi i32 [ %26, %25 ], [ %3, %0 ]
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = zext i32 %6 to i64
br label %10
10: ; preds = %15, %8
%11 = phi i64 [ %9, %8 ], [ %12, %15 ]
%12 = add nsw i64 %11, -1
%13 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
switch i8 %14, label %16 [
i8 32, label %15
i8 9, label %15
i8 10, label %15
]
15: ; preds = %10, %10, %10
br label %10
16: ; preds = %10
%17 = shl i64 %11, 32
%18 = ashr exact i64 %17, 32
%19 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 %18
store i8 10, i8* %19
%20 = shl i64 %11, 32
%21 = add i64 %20, 4294967296
%22 = ashr exact i64 %21, 32
%23 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 %22
store i8 0, i8* %23
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %25
25: ; preds = %16, %5
%26 = call i32 @get_line(i8* %2, i32 1001)
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %5
28: ; preds = %25, %0
ret i32 0
}