#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*/ descape(char *, char *);
int /*<<< orphan*/ escape(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char s[] = "no tab here\t ok?";
  char t[20];
  escape(s, t);
  printf("\n%s", s);
  printf("\n%s", t);
  printf("\n");
  descape(t, s);
  printf("\n%s", t);
  printf("\n%s", s);
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <escape@plt>
lea    -0x20(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <descape@plt>
lea    -0x40(%rbp),%rsi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
movaps 0xea0(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%r14
lea    0x20(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <escape@plt>
lea    0xe8e(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <descape@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe42(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s = [17 x i8] c"no tab here\09 ok?\00"
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [20 x i8]
%3 = bitcast [17 x i8]* %1 to i8*
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @escape(i8* %4, i8* %5)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%14 = call i32 @descape(i8* %12, i8* %13)
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [17 x i8] c"no tab here\09 ok?\00"
@.str = [4 x i8] c"\0A%s\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @escape(i8* %3, i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @putchar(i32 10)
%9 = call i32 @descape(i8* %4, i8* %3)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}