#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*/ copia();
int obtenlinea();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ voltea(char *);
int main(void) {
  int longitud;
  extern int max;
  extern char linea_max[1000];
  max = 0;
  while ((longitud = obtenlinea()) > 0)
    if (longitud > 80) {
      copia();
      printf("NO VOLTEA--------------------\n");
      printf("\n");
      printf("%s", linea_max);
      printf("\n");
      printf("VOLTEA-----------------------\n");
      printf("\n");
      voltea(linea_max);
      printf("\n");
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e82(%rip),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <obtenlinea@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    11fa <main+0xba>
cmpl   $0x50,-0x8(%rbp)
jle    11f5 <main+0xb5>
mov    $0x0,%al
call   1040 <copia@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    0x2e36(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2dfe(%rip),%rdi
call   1060 <voltea@plt>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    115c <main+0x1c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2e69(%rip),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
call   1040 <obtenlinea@plt>
test   %eax,%eax
jle    1216 <main+0xb6>
lea    0xe78(%rip),%r14
lea    0xe6e(%rip),%r15
mov    0x2e47(%rip),%rbx
lea    0xe81(%rip),%r12
jmp    11bb <main+0x5b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <obtenlinea@plt>
test   %eax,%eax
jle    1216 <main+0xb6>
cmp    $0x51,%eax
jb     11b0 <main+0x50>
xor    %eax,%eax
call   1060 <copia@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1080 <voltea@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@max = external global i32
@.str = [31 x i8] c"NO VOLTEA--------------------\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@linea_max = external global [1000 x i8]
@.str.3 = [31 x i8] c"VOLTEA-----------------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* @max
br label %3
3: ; preds = %19, %0
%4 = call i32 (...) @obtenlinea()
store i32 %4, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 80
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = call i32 (...) @copia()
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @voltea(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %9, %6
br label %3
20: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@max = external global i32
@.str.2 = [3 x i8] c"%s\00"
@linea_max = external global [1000 x i8]
@str = [30 x i8] c"NO VOLTEA--------------------\00"
@str.4 = [30 x i8] c"VOLTEA-----------------------\00"
define i32 @main() {
store i32 0, i32* @max
%1 = tail call i32 (...) @obtenlinea()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %19
3: ; preds = %0, %16
%4 = phi i32 [ %17, %16 ], [ %1, %0 ]
%5 = icmp ugt i32 %4, 80
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = tail call i32 (...) @copia()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @voltea(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
%15 = tail call i32 @putchar(i32 10)
br label %16
16: ; preds = %6, %3
%17 = tail call i32 (...) @obtenlinea()
%18 = icmp sgt i32 %17, 0
br i1 %18, label %3, label %19
19: ; preds = %16, %0
ret i32 0
}