#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*/ clean_text(char *);
int /*<<< orphan*/ escape(char *, char *);
int /*<<< orphan*/ escape_rev(char *, char *);
int /*<<< orphan*/ gettext_my(char *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char text[100];
  char text_copy[200];
  char text_rev[200];
  int i = 0;
  clean_text(text);
  clean_text(text_copy);
  printf("Input please text for configure:\n");
  gettext_my(text);
  printf("Getted text :\n%s\n\n", text);
  escape(text_copy, text);
  printf("Formated text seems so:%s;\n", text_copy);
  printf("Input please text, that needs to be reversly formated:\n");
  gettext_my(text_rev);
  clean_text(text_copy);
  escape_rev(text_copy, text_rev);
  printf("Reverse formatted text seems so:\n%s", text_copy);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x214(%rbp)
lea    -0x70(%rbp),%rdi
call   1060 <clean_text@plt>
lea    -0x140(%rbp),%rdi
call   1060 <clean_text@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <gettext_my@plt>
lea    -0x70(%rbp),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x140(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1070 <escape@plt>
lea    -0x140(%rbp),%rsi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <gettext_my@plt>
lea    -0x140(%rbp),%rdi
call   1060 <clean_text@plt>
lea    -0x140(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1050 <escape_rev@plt>
lea    -0x140(%rbp),%rsi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <clean_text@plt>
lea    0x140(%rsp),%r14
mov    %r14,%rdi
call   1070 <clean_text@plt>
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <gettext_my@plt>
lea    0xe60(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <escape@plt>
lea    0xe57(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <gettext_my@plt>
mov    %r14,%rdi
call   1070 <clean_text@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <escape_rev@plt>
lea    0xe36(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Input please text for configure:\0A\00"
@.str.1 = [19 x i8] c"Getted text :\0A%s\0A\0A\00"
@.str.2 = [28 x i8] c"Formated text seems so:%s;\0A\00"
@.str.3 = [56 x i8] c"Input please text, that needs to be reversly formated:\0A\00"
@.str.4 = [36 x i8] c"Reverse formatted text seems so:\0A%s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [200 x i8]
%3 = alloca [200 x i8]
%4 = alloca i32
store i32 0, i32* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @clean_text(i8* %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%8 = call i32 @clean_text(i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%11 = call i32 @gettext_my(i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%16 = call i32 @escape(i8* %14, i8* %15)
%17 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%20 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%21 = call i32 @gettext_my(i8* %20)
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%23 = call i32 @clean_text(i8* %22)
%24 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%25 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%26 = call i32 @escape_rev(i8* %24, i8* %25)
%27 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %27)
ret void
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"Getted text :\0A%s\0A\0A\00"
@.str.2 = [28 x i8] c"Formated text seems so:%s;\0A\00"
@.str.4 = [36 x i8] c"Reverse formatted text seems so:\0A%s\00"
@str = [33 x i8] c"Input please text for configure:\00"
@str.5 = [55 x i8] c"Input please text, that needs to be reversly formated:\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [200 x i8]
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%7 = call i32 @clean_text(i8* %4)
%8 = call i32 @clean_text(i8* %5)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%10 = call i32 @gettext_my(i8* %4)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%12 = call i32 @escape(i8* %5, i8* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.5, i64 0, i64 0))
%15 = call i32 @gettext_my(i8* %6)
%16 = call i32 @clean_text(i8* %5)
%17 = call i32 @escape_rev(i8* %5, i8* %6)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %5)
ret void
}