#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 readline(char *, int);
main() {
  int len, c;
  int max;
  char line[1000];
  while ((len = readline(line, 1000)) > 0) {
    if (line[len - 1] != '\n') {
      while ((c = getchar()) != EOF && c != '\n') {
        ++len;
      }
      if (c == '\n') {
        ++len;
      }
    }
    if (len > 80) {
      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    $0x3e8,%esi
call   1040 <readline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1208 <main+0xd8>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
je     11e6 <main+0xb6>
jmp    117d <main+0x4d>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2e56(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x401(%rbp)
je     11ad <main+0x7d>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0x401(%rbp)
mov    -0x401(%rbp),%al
test   $0x1,%al
jne    11c0 <main+0x90>
jmp    11ce <main+0x9e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117d <main+0x4d>
cmpl   $0xa,-0xc(%rbp)
jne    11e1 <main+0xb1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e6 <main+0xb6>
cmpl   $0x50,-0x8(%rbp)
jle    1203 <main+0xd3>
lea    -0x400(%rbp),%rsi
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <readline@plt>
test   %eax,%eax
jle    11c3 <main+0x93>
lea    0xeaa(%rip),%r14
mov    %rsp,%r15
mov    0x2e88(%rip),%r12
jmp    1181 <main+0x51>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    $0x3e8,%esi
call   1040 <readline@plt>
test   %eax,%eax
jle    11c3 <main+0x93>
lea    -0x1(%rax),%ebx
cmpb   $0xa,(%rsp,%rbx,1)
je     11b1 <main+0x81>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ecx
add    $0x1,%ebx
cmp    $0xa,%eax
je     11a7 <main+0x77>
cmp    (%r12),%ecx
jne    1190 <main+0x60>
xor    %eax,%eax
cmp    $0xa,%ecx
sete   %al
add    %ebx,%eax
cmp    $0x51,%eax
jl     1170 <main+0x40>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [3 x i8] c"%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 @readline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %32
5: ; preds = %0, %29
%6 = phi i32 [ %30, %29 ], [ %3, %0 ]
%7 = add nsw i32 %6, -1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 10
br i1 %11, label %24, label %12
12: ; preds = %5, %12
%13 = phi i32 [ %19, %12 ], [ %6, %5 ]
%14 = call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
%17 = icmp ne i32 %14, 10
%18 = and i1 %17, %16
%19 = add nsw i32 %13, 1
br i1 %18, label %12, label %20
20: ; preds = %12
%21 = icmp eq i32 %14, 10
%22 = zext i1 %21 to i32
%23 = add nsw i32 %13, %22
br label %24
24: ; preds = %20, %5
%25 = phi i32 [ %6, %5 ], [ %23, %20 ]
%26 = icmp sgt i32 %25, 80
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %29
29: ; preds = %27, %24
%30 = call i32 @readline(i8* %2, i32 1000)
%31 = icmp sgt i32 %30, 0
br i1 %31, label %5, label %32
32: ; preds = %29, %0
ret i32 0
}