#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 /*<<< orphan*/ copy(char *, char *);
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  char mas_de_80[1000];
  while ((len = getline(line, 1000)) > 0) {
    if (len + 1 > 80) {
      copy(mas_de_80, line);
      printf("String de mas de 80 caracteres:\n%s", mas_de_80);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1199 <main+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x50,%eax
jle    1194 <main+0x64>
lea    -0x7e0(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1040 <copy@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    119e <main+0x6e>
lea    0x3f0(%rsp),%r14
mov    %rsp,%rbx
lea    0xea1(%rip),%r15
jmp    1181 <main+0x51>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    119e <main+0x6e>
cmp    $0x50,%eax
jb     1170 <main+0x40>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <copy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"String de mas de 80 caracteres:\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %19, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @getline(i8* %6, i32 1000)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
%12 = icmp sgt i32 %11, 80
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%16 = call i32 @copy(i8* %14, i8* %15)
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %13, %9
br label %5
20: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"String de mas de 80 caracteres:\0A%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @getline(i8* %3, i32 1000)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %0, %13
%8 = phi i32 [ %14, %13 ], [ %5, %0 ]
%9 = icmp ugt i32 %8, 79
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i32 @copy(i8* %4, i8* %3)
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %13
13: ; preds = %10, %7
%14 = call i32 @getline(i8* %3, i32 1000)
%15 = icmp sgt i32 %14, 0
br i1 %15, label %7, label %16
16: ; preds = %13, %0
ret i32 0
}