#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*/ printf(char *, char *);
int /*<<< orphan*/ unescape(char *, char *);
int main(int argc, char *argv[]) {
  char t[100];
  char t1[100];
  char s[] = "a	b";
  char s1[] = "a\\tb\\n";
  escape(s, t);
  printf("%s\n", t);
  unescape(s1, t1);
  printf("%s", t1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0xf4(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0xfb(%rbp)
mov    0xea0(%rip),%ax
mov    %ax,-0xf7(%rbp)
mov    0xe95(%rip),%al
mov    %al,-0xf5(%rbp)
lea    -0xf4(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <escape@plt>
lea    -0x80(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
lea    -0xfb(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1040 <unescape@plt>
lea    -0xf0(%rbp),%rsi
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xf0,%rsp
movl   $0x620961,0x4(%rsp)
movl   $0x6e5c62,0xb(%rsp)
movl   $0x62745c61,0x8(%rsp)
62
lea    0x4(%rsp),%rdi
lea    0x80(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <escape@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <unescape@plt>
lea    0xe7e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [4 x i8] c"a\09b\00"
@__const.main.s1 = [7 x i8] c"a\\tb\\n\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [4 x i8]
%9 = alloca [7 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [4 x i8]* %8 to i8*
%11 = bitcast [7 x i8]* %9 to i8*
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i32 @escape(i8* %12, i8* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%19 = call i32 @unescape(i8* %17, i8* %18)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [7 x i8] c"a\\tb\\n\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca i32
%6 = alloca [7 x i8]
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = bitcast i32* %5 to i8*
store i32 6424929, i32* %5
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%11 = call i32 @escape(i8* %9, i8* %7)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%13 = call i32 @unescape(i8* %10, i8* %8)
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}