#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 EXIT_SUCCESS;
int /*<<< orphan*/ escape(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ unescape(char *, char *);
int main() {
  char input[] = "\\\\\\a\\bcde\\fghijkim\\nopqrs\\tu\\vwsyz";
  char t[50] = {0};
  char s[50] = {0};
  printf("origin:      %s\n", input);
  unescape(s, input);
  printf("unvisible:   %s\n", s);
  escape(t, s);
  printf("visible:     %s\n", t);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x23,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <unescape@plt>
lea    -0xb0(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1070 <escape@plt>
lea    -0x70(%rbp),%rsi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x7a7973,0x1f(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movw   $0x0,0xa0(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movw   $0x0,0x60(%rsp)
lea    0xe8b(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <unescape@plt>
lea    0xe7a(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <escape@plt>
lea    0xe6c(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.input = [35 x i8] c"\\\\\\a\\bcde\\fghijkim\\nopqrs\\tu\\vwsyz\00"
@.str = [17 x i8] c"origin: %s\0A\00"
@.str.1 = [17 x i8] c"unvisible: %s\0A\00"
@.str.2 = [17 x i8] c"visible: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [35 x i8]
%3 = alloca [50 x i8]
%4 = alloca [50 x i8]
store i32 0, i32* %1
%5 = bitcast [35 x i8]* %2 to i8*
%6 = bitcast [50 x i8]* %3 to i8*
%7 = bitcast [50 x i8]* %4 to i8*
%8 = getelementptr inbounds [35 x i8], [35 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [35 x i8], [35 x i8]* %2, i64 0, i64 0
%12 = call i32 @unescape(i8* %10, i8* %11)
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%17 = call i32 @escape(i8* %15, i8* %16)
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@__const.main.input = [35 x i8] c"\\\\\\a\\bcde\\fghijkim\\nopqrs\\tu\\vwsyz\00"
@.str = [17 x i8] c"origin: %s\0A\00"
@.str.1 = [17 x i8] c"unvisible: %s\0A\00"
@.str.2 = [17 x i8] c"visible: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [35 x i8]
%2 = alloca [50 x i8]
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @unescape(i8* %6, i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%10 = call i32 @escape(i8* %5, i8* %6)
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}