#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 *, ...);
int /*<<< orphan*/ unescape(char *, char *);
int main(int argc, char **argv) {
  char c_arryStr1[200] = "there is a enter:\nend,then is a blank: end!and "
                         "then, is a tab:\tend,finish";
  char c_arryStr2[200];
  printf("now, it is a string:\n");
  printf("%s\n", c_arryStr1);
  printf("after changed:\n");
  escape(c_arryStr2, c_arryStr1);
  printf("%s\n", c_arryStr2);
  printf("and, changed back is:\n");
  unescape(c_arryStr1, c_arryStr2);
  printf("%s\n", c_arryStr1);
  printf("Finish!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0xc8,%edx
call   1040 <memcpy@plt>
lea    0xf50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xf51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1060 <escape@plt>
lea    -0x1b0(%rbp),%rsi
lea    0xf1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
call   1050 <unescape@plt>
lea    -0xe0(%rbp),%rsi
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x198,%rsp
lea    0xeaf(%rip),%rsi
lea    0xd0(%rsp),%r14
mov    $0xc8,%edx
mov    %r14,%rdi
call   1040 <memcpy@plt>
lea    0xf5b(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <escape@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <unescape@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.c_arryStr1 = [200 x i8] c"there is a enter:\0Aend,then is a blank: end!and then, is a tab:\09end,finish\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [22 x i8] c"now, it is a string:\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [16 x i8] c"after changed:\0A\00"
@.str.3 = [23 x i8] c"and, changed back is:\0A\00"
@.str.4 = [9 x i8] c"Finish!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i8]
%7 = alloca [200 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [200 x i8]* %6 to i8*
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%15 = call i32 @escape(i8* %13, i8* %14)
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%21 = call i32 @unescape(i8* %19, i8* %20)
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.c_arryStr1 = [200 x i8] c"there is a enter:\0Aend,then is a blank: end!and then, is a tab:\09end,finish\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@str = [21 x i8] c"now, it is a string:\00"
@str.5 = [15 x i8] c"after changed:\00"
@str.6 = [22 x i8] c"and, changed back is:\00"
@str.7 = [8 x i8] c"Finish!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [200 x i8]
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = call i32 @puts(i8* %5)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @escape(i8* %6, i8* %5)
%11 = call i32 @puts(i8* %6)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
%13 = call i32 @unescape(i8* %5, i8* %6)
%14 = call i32 @puts(i8* %5)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}