#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*/ printf(char *, ...);
void print_usage(char **argv) {
  printf("Usage:\n");
  printf(" To encrypt a file:\n");
  printf("  %s -c -i <in file> -o <out file> -p <password> [-a]\n", argv[0]);
  printf("     -a flag writes zero in <in file> and deletes it.\n");
  printf(" To decrypt a file:\n");
  printf("  %s -d -i <in file> -o <out file> -p <password>\n", argv[0]);
  printf(" To calculate randomness using method 1 as described in pdf:\n");
  printf("  %s -1 -i <in file> -p <password> | not working yet.\n", argv[0]);
  printf(" To calculate randomness using method 2 as described in pdf:\n");
  printf("  %s -2 -i <in file> -p <password> | not workgin yet.\n", argv[0]);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xf29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xf76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xfc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xfac(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa7(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc8(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfbf(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfdf(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xef7(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [21 x i8] c" To encrypt a file:\0A\00"
@.str.2 = [55 x i8] c" %s -c -i <in file> -o <out file> -p <password> [-a]\0A\00"
@.str.3 = [55 x i8] c" -a flag writes zero in <in file> and deletes it.\0A\00"
@.str.4 = [21 x i8] c" To decrypt a file:\0A\00"
@.str.5 = [50 x i8] c" %s -d -i <in file> -o <out file> -p <password>\0A\00"
@.str.6 = [62 x i8] c" To calculate randomness using method 1 as described in pdf:\0A\00"
@.str.7 = [55 x i8] c" %s -1 -i <in file> -p <password> | not working yet.\0A\00"
@.str.8 = [62 x i8] c" To calculate randomness using method 2 as described in pdf:\0A\00"
@.str.9 = [55 x i8] c" %s -2 -i <in file> -p <password> | not workgin yet.\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%11 = load i8**, i8*** %2
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0))
%16 = load i8**, i8*** %2
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.8, i64 0, i64 0))
%21 = load i8**, i8*** %2
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i8* %23)
ret void
}

LLVM IR (-O2):
@.str.2 = [55 x i8] c" %s -c -i <in file> -o <out file> -p <password> [-a]\0A\00"
@.str.5 = [50 x i8] c" %s -d -i <in file> -o <out file> -p <password>\0A\00"
@.str.7 = [55 x i8] c" %s -1 -i <in file> -p <password> | not working yet.\0A\00"
@.str.9 = [55 x i8] c" %s -2 -i <in file> -p <password> | not workgin yet.\0A\00"
@str = [7 x i8] c"Usage:\00"
@str.10 = [20 x i8] c" To encrypt a file:\00"
@str.11 = [54 x i8] c" -a flag writes zero in <in file> and deletes it.\00"
@str.12 = [20 x i8] c" To decrypt a file:\00"
@str.13 = [61 x i8] c" To calculate randomness using method 1 as described in pdf:\00"
@str.14 = [61 x i8] c" To calculate randomness using method 2 as described in pdf:\00"
define void @print_usage(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
%4 = load i8*, i8** %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.11, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.12, i64 0, i64 0))
%8 = load i8*, i8** %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i8* %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.13, i64 0, i64 0))
%11 = load i8*, i8** %0
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i8* %11)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.14, i64 0, i64 0))
%14 = load i8*, i8** %0
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i8* %14)
ret void
}