#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 EXIT_SUCCESS;
int getchar();
int gtline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  int len, c;
  char line[81];
  while ((len = gtline(line, 81)) > 0) {
    if (len == 81 - 1 && line[81 - 2] != '\n') {
      printf("%s", line);
      while ((c = getchar()) != EOF && c != '\n')
        putchar(c);
      putchar('\n');
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x51,%esi
call   1050 <gtline@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    11f3 <main+0xb3>
cmpl   $0x50,-0x14(%rbp)
jne    11ee <main+0xae>
movsbl -0x21(%rbp),%eax
cmp    $0xa,%eax
je     11ee <main+0xae>
lea    -0x70(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2e39(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x71(%rbp)
je     11c4 <main+0x84>
cmpl   $0xa,-0x18(%rbp)
setne  %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    11d4 <main+0x94>
jmp    11e4 <main+0xa4>
mov    -0x18(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    119a <main+0x5a>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1159 <main+0x19>
mov    0x2dde(%rip),%rax
mov    (%rax),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsp,%rdi
mov    $0x51,%esi
call   1050 <gtline@plt>
test   %eax,%eax
jle    11ca <main+0x8a>
lea    0xe9f(%rip),%r14
mov    %rsp,%r15
mov    0x2e7d(%rip),%rbx
jmp    118b <main+0x4b>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x51,%esi
call   1050 <gtline@plt>
test   %eax,%eax
jle    11ca <main+0x8a>
cmp    $0x50,%eax
jne    117a <main+0x3a>
cmpb   $0xa,0x4f(%rsp)
je     117a <main+0x3a>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%eax
je     1170 <main+0x30>
cmp    (%rbx),%eax
je     1170 <main+0x30>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x70>
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%5 = call i32 @gtline(i8* %4, i32 81)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %36
7: ; preds = %2
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 79
br label %9
9: ; preds = %7, %33
%10 = phi i32 [ %5, %7 ], [ %34, %33 ]
%11 = icmp eq i32 %10, 80
%12 = load i8, i8* %8
%13 = icmp ne i8 %12, 10
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %15, label %33
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%17 = call i32 (...) @getchar()
%18 = load i32, i32* @EOF
%19 = icmp ne i32 %17, %18
%20 = icmp ne i32 %17, 10
%21 = and i1 %20, %19
br i1 %21, label %22, label %31
22: ; preds = %15, %22
%23 = phi i32 [ %26, %22 ], [ %17, %15 ]
%24 = trunc i32 %23 to i8
%25 = call i32 @putchar(i8 signext %24)
%26 = call i32 (...) @getchar()
%27 = load i32, i32* @EOF
%28 = icmp ne i32 %26, %27
%29 = icmp ne i32 %26, 10
%30 = and i1 %29, %28
br i1 %30, label %22, label %31
31: ; preds = %22, %15
%32 = call i32 @putchar(i8 signext 10)
br label %33
33: ; preds = %31, %9
%34 = call i32 @gtline(i8* %4, i32 81)
%35 = icmp sgt i32 %34, 0
br i1 %35, label %9, label %36
36: ; preds = %33, %2
%37 = load i32, i32* @EXIT_SUCCESS
ret i32 %37
}