#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;
char *get_plain_text();
char *get_safe_text();
int get_second_value(int *);
int input_prime_number(int *, int);
int /*<<< orphan*/ print_plain_text(char *);
int /*<<< orphan*/ print_safe_text(char *);
int /*<<< orphan*/ safe_text(int, int, char *, char *);
int second_value;
int /*<<< orphan*/ unsafe_text(int, int, char *, char *);
int main(int argc, const char *argv[]) {
  int prime_number, range = 256;
  int value = input_prime_number(&prime_number, range);
  int second_value = get_second_value(&second_value);
  char *plain_text = get_plain_text();
  char text_to_save[256];
  safe_text(value, second_value, plain_text, text_to_save);
  print_safe_text(text_to_save);
  value = input_prime_number(&prime_number, range);
  second_value = get_second_value(&second_value);
  char *safe_text_from_user = get_safe_text();
  char text_to_unsafe[256];
  unsafe_text(value, second_value, safe_text_from_user, text_to_unsafe);
  print_plain_text(text_to_unsafe);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1090 <input_prime_number@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <get_second_value@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1080 <get_plain_text@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%rdx
lea    -0x130(%rbp),%rcx
call   1050 <safe_text@plt>
lea    -0x130(%rbp),%rdi
call   1070 <print_safe_text@plt>
mov    -0x18(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1090 <input_prime_number@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <get_second_value@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   10a0 <get_safe_text@plt>
mov    %rax,-0x138(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x138(%rbp),%rdx
lea    -0x240(%rbp),%rcx
call   1060 <unsafe_text@plt>
lea    -0x240(%rbp),%rdi
call   1040 <print_plain_text@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x218,%rsp
lea    0xc(%rsp),%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1090 <input_prime_number@plt>
mov    %eax,%ebp
lea    0x8(%rsp),%r15
mov    %r15,%rdi
call   1030 <get_second_value@plt>
mov    %eax,0x8(%rsp)
xor    %eax,%eax
call   1080 <get_plain_text@plt>
mov    0x8(%rsp),%esi
lea    0x110(%rsp),%rbx
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1050 <safe_text@plt>
mov    %rbx,%rdi
call   1070 <print_safe_text@plt>
mov    %r14,%rdi
mov    $0x100,%esi
call   1090 <input_prime_number@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <get_second_value@plt>
mov    %eax,0x8(%rsp)
xor    %eax,%eax
call   10a0 <get_safe_text@plt>
mov    0x8(%rsp),%esi
lea    0x10(%rsp),%rbp
mov    %ebx,%edi
mov    %rax,%rdx
mov    %rbp,%rcx
call   1060 <unsafe_text@plt>
mov    %rbp,%rdi
call   1040 <print_plain_text@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%eax
add    $0x218,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@second_value = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca [256 x i8]
%12 = alloca i8*
%13 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @input_prime_number(i32* %6, i32 %14)
store i32 %15, i32* %8
%16 = call i32 @get_second_value(i32* %9)
store i32 %16, i32* %9
%17 = call i8* (...) @get_plain_text()
store i8* %17, i8** %10
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = load i8*, i8** %10
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%22 = call i32 @safe_text(i32 %18, i32 %19, i8* %20, i8* %21)
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%24 = call i32 @print_safe_text(i8* %23)
%25 = load i32, i32* %7
%26 = call i32 @input_prime_number(i32* %6, i32 %25)
store i32 %26, i32* %8
%27 = call i32 @get_second_value(i32* %9)
store i32 %27, i32* %9
%28 = call i8* (...) @get_safe_text()
store i8* %28, i8** %12
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = load i8*, i8** %12
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%33 = call i32 @unsafe_text(i32 %29, i32 %30, i8* %31, i8* %32)
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%35 = call i32 @print_plain_text(i8* %34)
%36 = load i32, i32* @EXIT_SUCCESS
ret i32 %36
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@second_value = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
%7 = bitcast i32* %3 to i8*
%8 = call i32 @input_prime_number(i32* %3, i32 256)
%9 = bitcast i32* %4 to i8*
%10 = call i32 @get_second_value(i32* %4)
store i32 %10, i32* %4
%11 = call i8* (...) @get_plain_text()
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = load i32, i32* %4
%14 = call i32 @safe_text(i32 %8, i32 %13, i8* %11, i8* %12)
%15 = call i32 @print_safe_text(i8* %12)
%16 = call i32 @input_prime_number(i32* %3, i32 256)
%17 = call i32 @get_second_value(i32* %4)
store i32 %17, i32* %4
%18 = call i8* (...) @get_safe_text()
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%20 = load i32, i32* %4
%21 = call i32 @unsafe_text(i32 %16, i32 %20, i8* %18, i8* %19)
%22 = call i32 @print_plain_text(i8* %19)
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}