#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 getc(int /*<<< orphan*/);
int /*<<< orphan*/ print_line(int *, int);
int /*<<< orphan*/ stdin;
int main() {
  int c, len = 0;
  int buf_line[256];
  while ((c = getc(stdin)) != EOF) {
    if (c == '\n') {
      if (len >= 80) {
        print_line(buf_line, len);
      }
      len = 0;
    } else {
      if (len < 256)
        buf_line[len++] = c;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
je     11b6 <main+0x96>
cmpl   $0xa,-0x8(%rbp)
jne    1188 <main+0x68>
cmpl   $0x50,-0xc(%rbp)
jl     117c <main+0x5c>
lea    -0x410(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_line@plt>
movl   $0x0,-0xc(%rbp)
jmp    11b1 <main+0x91>
cmpl   $0x100,-0xc(%rbp)
jge    11ac <main+0x8c>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %ecx,-0x410(%rbp,%rax,4)
jmp    11b1 <main+0x91>
jmp    1139 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    0x2eb4(%rip),%r15
mov    (%r15),%edi
call   1040 <getc@plt>
mov    0x2e9d(%rip),%rbx
cmp    (%rbx),%eax
jne    1157 <main+0x37>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
mov    %rsp,%r14
jmp    1170 <main+0x50>
xchg   %ax,%ax
mov    %esi,%ebp
mov    (%r15),%edi
call   1040 <getc@plt>
mov    %ebp,%esi
cmp    (%rbx),%eax
je     1147 <main+0x27>
cmp    $0xa,%eax
jne    1190 <main+0x70>
xor    %ebp,%ebp
cmp    $0x50,%esi
jl     1162 <main+0x42>
mov    %r14,%rdi
call   1030 <print_line@plt>
jmp    1162 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
cmp    $0xff,%esi
jg     1160 <main+0x40>
movslq %esi,%rcx
add    $0x1,%esi
mov    %eax,(%rsp,%rcx,4)
jmp    1160 <main+0x40>

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %31, %0
%6 = load i32, i32* @stdin
%7 = call i32 @getc(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %32
10: ; preds = %5
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 80
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 0
%18 = load i32, i32* %3
%19 = call i32 @print_line(i32* %17, i32 %18)
br label %20
20: ; preds = %16, %13
store i32 0, i32* %3
br label %31
21: ; preds = %10
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 256
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
%28 = sext i32 %26 to i64
%29 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %28
store i32 %25, i32* %29
br label %30
30: ; preds = %24, %21
br label %31
31: ; preds = %30, %20
br label %5
32: ; preds = %5
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define i32 @main() {
%1 = alloca [256 x i32]
%2 = bitcast [256 x i32]* %1 to i8*
%3 = load i32, i32* @stdin
%4 = call i32 @getc(i32 %3)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %29, label %7
7: ; preds = %0
%8 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 0
br label %9
9: ; preds = %7, %23
%10 = phi i32 [ %4, %7 ], [ %26, %23 ]
%11 = phi i32 [ 0, %7 ], [ %24, %23 ]
%12 = icmp eq i32 %10, 10
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = icmp sgt i32 %11, 79
br i1 %14, label %15, label %23
15: ; preds = %13
%16 = call i32 @print_line(i32* %8, i32 %11)
br label %23
17: ; preds = %9
%18 = icmp slt i32 %11, 256
br i1 %18, label %19, label %23
19: ; preds = %17
%20 = add nsw i32 %11, 1
%21 = sext i32 %11 to i64
%22 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 %21
store i32 %10, i32* %22
br label %23
23: ; preds = %13, %15, %17, %19
%24 = phi i32 [ %20, %19 ], [ %11, %17 ], [ 0, %15 ], [ 0, %13 ]
%25 = load i32, i32* @stdin
%26 = call i32 @getc(i32 %25)
%27 = load i32, i32* @EOF
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %9
29: ; preds = %23, %0
ret i32 0
}