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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <myGetline@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1234 <main+0x114>
mov    -0x4(%rbp),%eax
mov    %eax,-0x7e4(%rbp)
cmpl   $0x0,-0x7e4(%rbp)
jl     11fc <main+0xdc>
movslq -0x7e4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
je     1195 <main+0x75>
movslq -0x7e4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x9,%eax
jne    11a9 <main+0x89>
movslq -0x7e4(%rbp),%rax
movb   $0x0,-0x3f0(%rbp,%rax,1)
jmp    11e3 <main+0xc3>
movslq -0x7e4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
je     11d9 <main+0xb9>
movslq -0x7e4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
jne    11de <main+0xbe>
jmp    11e8 <main+0xc8>
jmp    11fc <main+0xdc>
jmp    11e8 <main+0xc8>
mov    -0x7e4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x7e4(%rbp)
jmp    1158 <main+0x38>
movsbl -0x3f0(%rbp),%eax
cmp    $0x0,%eax
je     122f <main+0x10f>
movsbl -0x3f0(%rbp),%eax
cmp    $0xa,%eax
je     122f <main+0x10f>
lea    -0x3f0(%rbp),%rsi
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
movsbl %al,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <myGetline@plt>
test   %eax,%eax
jle    11b8 <main+0x98>
mov    %rsp,%r15
lea    0xf3d(%rip),%r14
lea    0xeb2(%rip),%rbx
jmp    1161 <main+0x41>
mov    %r15,%rdi
mov    $0x3e8,%esi
call   1040 <myGetline@plt>
test   %eax,%eax
jle    11b8 <main+0x98>
mov    %eax,%eax
add    $0x1,%rax
jmp    1176 <main+0x56>
nopl   0x0(%rax)
add    $0xffffffffffffffff,%rax
jle    11a0 <main+0x80>
movzbl -0x1(%rsp,%rax,1),%ecx
cmp    $0x20,%rcx
ja     11a0 <main+0x80>
movslq (%rbx,%rcx,4),%rcx
add    %rbx,%rcx
jmp    *%rcx
movb   $0x0,-0x1(%rsp,%rax,1)
jmp    1170 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%al
test   %al,%al
je     1150 <main+0x30>
cmp    $0xa,%al
je     1150 <main+0x30>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define signext i8 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
%5 = alloca i32
store i32 0, i32* %2
br label %6
6: ; preds = %66, %0
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i32 @myGetline(i8* %7, i32 1000)
store i32 %8, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %67
10: ; preds = %6
%11 = load i32, i32* %1
store i32 %11, i32* %5
br label %12
12: ; preds = %50, %10
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %53
15: ; preds = %12
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1000 x i8], [1000 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 %29, label %22
22: ; preds = %15
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [1000 x i8], [1000 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 %29, label %33
29: ; preds = %22, %15
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %31
store i8 0, i8* %32
br label %49
33: ; preds = %22
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 10
br i1 %39, label %47, label %40
40: ; preds = %33
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %40, %33
br label %50
48: ; preds = %40
br label %53
49: ; preds = %29
br label %50
50: ; preds = %49, %47
%51 = load i32, i32* %5
%52 = add nsw i32 %51, -1
store i32 %52, i32* %5
br label %12
53: ; preds = %48, %12
%54 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %66
58: ; preds = %53
%59 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp ne i32 %61, 10
br i1 %62, label %63, label %66
63: ; preds = %58
%64 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%65 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %64)
br label %66
66: ; preds = %63, %58, %53
br label %6
67: ; preds = %6
ret i8 0
}

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