#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 *);
scalar_t__ getLine(char *, int);
int /*<<< orphan*/ invEscape(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
main() {
  char s[100];
  char t[2 * 100];
  while (getLine(s, 100) > 0) {
    escape(s, t);
    printf("%s\n", t);
    invEscape(s, t);
    printf("%s\n", t);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getLine@plt>
cmp    $0x0,%rax
jle    11b5 <main+0x75>
lea    -0x70(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1060 <escape@plt>
lea    -0x140(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1030 <invEscape@plt>
lea    -0x140(%rbp),%rsi
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
jmp    1152 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x140,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1050 <getLine@plt>
test   %rax,%rax
jle    11ae <main+0x6e>
mov    %rsp,%r14
lea    0x70(%rsp),%rbx
lea    0xe93(%rip),%r15
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <escape@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <invEscape@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x64,%esi
call   1050 <getLine@plt>
test   %rax,%rax
jg     1170 <main+0x30>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i64 @getLine(i8* %3, i32 100)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = call i32 @escape(i8* %3, i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 @invEscape(i8* %3, i8* %4)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%12 = call i64 @getLine(i8* %3, i32 100)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}