#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*/ escape(char *, char *);
int getline(char *, int);
int /*<<< orphan*/ inv_escape(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[1000];
  char t[1000];
  int len;
  int estado = 0;
  while ((len = getline(s, 1000)) > 0) {
    if (estado) {
      escape(s, t);
      printf("%s", s);
      estado = 0;
    } else {
      inv_escape(s, t);
      printf("%s", s);
      estado = 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x7e8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x7e4(%rbp)
cmp    $0x0,%eax
jle    11f3 <main+0xb3>
cmpl   $0x0,-0x7e8(%rbp)
je     11be <main+0x7e>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1060 <escape@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x7e8(%rbp)
jmp    11ee <main+0xae>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1030 <inv_escape@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe21(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x7e8(%rbp)
jmp    115c <main+0x1c>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x7d8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    11b9 <main+0x79>
xor    %ebp,%ebp
mov    %rsp,%rbx
lea    0x3f0(%rsp),%r14
lea    0xe8e(%rip),%r15
jmp    11a6 <main+0x66>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <inv_escape@plt>
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    11b9 <main+0x79>
mov    %rbx,%rdi
mov    %r14,%rsi
test   %ebp,%ebp
je     1180 <main+0x40>
call   1060 <escape@plt>
xor    %ebp,%ebp
jmp    118a <main+0x4a>
xor    %eax,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [1000 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
br label %6
6: ; preds = %25, %0
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%8 = call i32 @getline(i8* %7, i32 1000)
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%16 = call i32 @escape(i8* %14, i8* %15)
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 0, i32* %5
br label %25
19: ; preds = %10
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%22 = call i32 @inv_escape(i8* %20, i8* %21)
%23 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %23)
store i32 1, i32* %5
br label %25
25: ; preds = %19, %13
br label %6
26: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%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 %19
7: ; preds = %0, %14
%8 = phi i32 [ %15, %14 ], [ 0, %0 ]
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @escape(i8* %3, i8* %4)
br label %14
12: ; preds = %7
%13 = call i32 @inv_escape(i8* %3, i8* %4)
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ 0, %10 ], [ 1, %12 ]
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%17 = call i32 @getline(i8* %3, i32 1000)
%18 = icmp sgt i32 %17, 0
br i1 %18, label %7, label %19
19: ; preds = %14, %0
ret i32 0
}