#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 /*<<< orphan*/ invert_escape(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char es[1000], ies[1000];
  char *et = "'asdf\t  \t \nasd\n";
  char *iet = "'asdf\\t  \\t a\\nasd\\n";
  escape(es, et);
  invert_escape(ies, iet);
  printf("%s\n", es);
  printf("%s\n", ies);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
lea    0xebe(%rip),%rax
mov    %rax,-0x7e8(%rbp)
lea    0xec0(%rip),%rax
mov    %rax,-0x7f0(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x7e8(%rbp),%rsi
call   1050 <escape@plt>
lea    -0x7e0(%rbp),%rdi
mov    -0x7f0(%rbp),%rsi
call   1030 <invert_escape@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
lea    0xebd(%rip),%rsi
lea    0x3f0(%rsp),%r14
mov    %r14,%rdi
call   1050 <escape@plt>
lea    0xeb6(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <invert_escape@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"'asdf\09 \09 \0Aasd\0A\00"
@.str.1 = [21 x i8] c"'asdf\\t \\t a\\nasd\\n\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = alloca i8*
%4 = alloca i8*
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @escape(i8* %5, i8* %6)
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = call i32 @invert_escape(i8* %8, i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"'asdf\09 \09 \0Aasd\0A\00"
@.str.1 = [21 x i8] c"'asdf\\t \\t a\\nasd\\n\00"
@.str.2 = [4 x i8] c"%s\0A\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 @escape(i8* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @invert_escape(i8* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}