#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*/ PrintSubTitles(char *);
int /*<<< orphan*/ PrintTitles(char *);
int /*<<< orphan*/ copia();
int obtenlinea();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int longitud;
  extern int max;
  extern char linea_max[1000];
  max = 0;
  PrintSubTitles("");
  PrintSubTitles("Inciso a");
  printf("\n a) Modifica el programa para que imprima sólo aquellas líneas que "
         "tienen más de 80 caracteres.\n");
  PrintSubTitles("");
  PrintSubTitles("");
  while ((longitud = obtenlinea()) > 0) {
    if (longitud >= 80) {
      copia();
      printf("\n%s \n", linea_max);
    }
  }
  PrintTitles("By: Gabriela Flores Bracamontes");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e72(%rip),%rax
movl   $0x0,(%rax)
lea    0xf00(%rip),%rdi
call   1040 <PrintSubTitles@plt>
lea    0xe81(%rip),%rdi
call   1040 <PrintSubTitles@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xeda(%rip),%rdi
call   1040 <PrintSubTitles@plt>
lea    0xece(%rip),%rdi
call   1040 <PrintSubTitles@plt>
mov    $0x0,%al
call   1030 <obtenlinea@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    11e8 <main+0x98>
cmpl   $0x50,-0x8(%rbp)
jl     11e3 <main+0x93>
mov    $0x0,%al
call   1050 <copia@plt>
lea    0xe99(%rip),%rdi
mov    0x2e04(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11aa <main+0x5a>
lea    0xe85(%rip),%rdi
call   1070 <PrintTitles@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e6d(%rip),%rax
movl   $0x0,(%rax)
lea    0xe96(%rip),%rbx
mov    %rbx,%rdi
call   1050 <PrintSubTitles@plt>
lea    0xe79(%rip),%rdi
call   1050 <PrintSubTitles@plt>
lea    0xe9c(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <PrintSubTitles@plt>
mov    %rbx,%rdi
call   1050 <PrintSubTitles@plt>
xor    %eax,%eax
call   1030 <obtenlinea@plt>
test   %eax,%eax
jle    11f6 <main+0x96>
lea    0xe4f(%rip),%r14
mov    0x2e1f(%rip),%rbx
jmp    11db <main+0x7b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <obtenlinea@plt>
test   %eax,%eax
jle    11f6 <main+0x96>
cmp    $0x50,%eax
jb     11d0 <main+0x70>
xor    %eax,%eax
call   1060 <copia@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    11d0 <main+0x70>
lea    0xe12(%rip),%rdi
call   1080 <PrintTitles@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@max = external global i32
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"Inciso a\00"
@.str.2 = [101 x i8] c"\0A a) Modifica el programa para que imprima s\C3\B3lo aquellas l\C3\ADneas que tienen m\C3\A1s de 80 caracteres.\0A\00"
@.str.3 = [6 x i8] c"\0A%s \0A\00"
@linea_max = external global [1000 x i8]
@.str.4 = [32 x i8] c"By: Gabriela Flores Bracamontes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* @max
%3 = call i32 @PrintSubTitles(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @PrintSubTitles(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @PrintSubTitles(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @PrintSubTitles(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %17, %0
%9 = call i32 (...) @obtenlinea()
store i32 %9, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 80
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = call i32 (...) @copia()
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
br label %17
17: ; preds = %14, %11
br label %8
18: ; preds = %8
%19 = call i32 @PrintTitles(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@max = external global i32
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"Inciso a\00"
@.str.3 = [6 x i8] c"\0A%s \0A\00"
@linea_max = external global [1000 x i8]
@.str.4 = [32 x i8] c"By: Gabriela Flores Bracamontes\00"
@str = [100 x i8] c"\0A a) Modifica el programa para que imprima s\C3\B3lo aquellas l\C3\ADneas que tienen m\C3\A1s de 80 caracteres.\00"
define i32 @main() {
store i32 0, i32* @max
%1 = tail call i32 @PrintSubTitles(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PrintSubTitles(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @PrintSubTitles(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @PrintSubTitles(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @obtenlinea()
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %0, %14
%9 = phi i32 [ %15, %14 ], [ %6, %0 ]
%10 = icmp ugt i32 %9, 79
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 (...) @copia()
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
br label %14
14: ; preds = %11, %8
%15 = tail call i32 (...) @obtenlinea()
%16 = icmp sgt i32 %15, 0
br i1 %16, label %8, label %17
17: ; preds = %14, %0
%18 = tail call i32 @PrintTitles(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}