#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 show_usage(char *name, int more) {
  printf("Usage: %s path [-r -e -d -p -g -k <keyfile> -m <mode>]\n", name);
  if (more) {
    printf("  Encrypts a file or directory using AES. Applies a given key or "
           "generates one randomly into a file.\n\n");
    printf("  path               Path to the file/directory to work on\n");
    printf("  -r, --recursive    Recursively work on files in directory\n");
    printf("  -e, --encrypt      Sets mode to encrypt given file/directory\n");
    printf("  -d, --decrypt      Sets mode to decrypt given file/directory\n");
    printf("  -p, --password     Prompt for password to use for key\n");
    printf("  -g, --gen-key      Generate a keyfile (use with -p to seed "
           "keyfile from pass)\n");
    printf("  -k, --keyfile      Load a key from file\n");
    printf("  -m, --mode         Sets cipher mode (128/192/256) default:128\n");
    printf("  -v(vv), --verbose  Run in verbose mode\n");
    printf("\n");
  } else {
    printf("Use %s --help to show help page.\n", name);
  }
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     11da <show_usage+0xca>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1010(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x103b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x107e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x109b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10ce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <show_usage+0xdc>
mov    -0x8(%rbp),%rsi
lea    0x10d3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
je     11d9 <show_usage+0xa9>
lea    0xf02(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf8b(%rip),%rdi
call   1040 <puts@plt>
lea    0xfbb(%rip),%rdi
call   1040 <puts@plt>
lea    0xfee(%rip),%rdi
call   1040 <puts@plt>
lea    0x1021(%rip),%rdi
call   1040 <puts@plt>
lea    0x104d(%rip),%rdi
call   1040 <puts@plt>
lea    0x1091(%rip),%rdi
call   1040 <puts@plt>
lea    0x10af(%rip),%rdi
call   1040 <puts@plt>
lea    0x10e3(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>
lea    0xe58(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"Usage: %s path [-r -e -d -p -g -k <keyfile> -m <mode>]\0A\00"
@.str.1 = [103 x i8] c" Encrypts a file or directory using AES. Applies a given key or generates one randomly into a file.\0A\0A\00"
@.str.2 = [60 x i8] c" path Path to the file/directory to work on\0A\00"
@.str.3 = [61 x i8] c" -r, --recursive Recursively work on files in directory\0A\00"
@.str.4 = [64 x i8] c" -e, --encrypt Sets mode to encrypt given file/directory\0A\00"
@.str.5 = [64 x i8] c" -d, --decrypt Sets mode to decrypt given file/directory\0A\00"
@.str.6 = [57 x i8] c" -p, --password Prompt for password to use for key\0A\00"
@.str.7 = [81 x i8] c" -g, --gen-key Generate a keyfile (use with -p to seed keyfile from pass)\0A\00"
@.str.8 = [43 x i8] c" -k, --keyfile Load a key from file\0A\00"
@.str.9 = [65 x i8] c" -m, --mode Sets cipher mode (128/192/256) default:128\0A\00"
@.str.10 = [42 x i8] c" -v(vv), --verbose Run in verbose mode\0A\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [34 x i8] c"Use %s --help to show help page.\0A\00"
define void @show_usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %24
21: ; preds = %2
%22 = load i8*, i8** %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %21, %9
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Usage: %s path [-r -e -d -p -g -k <keyfile> -m <mode>]\0A\00"
@.str.12 = [34 x i8] c"Use %s --help to show help page.\0A\00"
@str = [102 x i8] c" Encrypts a file or directory using AES. Applies a given key or generates one randomly into a file.\0A\00"
@str.13 = [59 x i8] c" path Path to the file/directory to work on\00"
@str.14 = [60 x i8] c" -r, --recursive Recursively work on files in directory\00"
@str.15 = [63 x i8] c" -e, --encrypt Sets mode to encrypt given file/directory\00"
@str.16 = [63 x i8] c" -d, --decrypt Sets mode to decrypt given file/directory\00"
@str.17 = [56 x i8] c" -p, --password Prompt for password to use for key\00"
@str.18 = [80 x i8] c" -g, --gen-key Generate a keyfile (use with -p to seed keyfile from pass)\00"
@str.19 = [42 x i8] c" -k, --keyfile Load a key from file\00"
@str.20 = [64 x i8] c" -m, --mode Sets cipher mode (128/192/256) default:128\00"
@str.21 = [41 x i8] c" -v(vv), --verbose Run in verbose mode\00"
define void @show_usage(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp eq i32 %1, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.15, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.16, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.17, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.18, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.19, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.20, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.21, i64 0, i64 0))
%16 = tail call i32 @putchar(i32 10)
br label %19
17: ; preds = %2
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i8* %0)
br label %19
19: ; preds = %17, %5
ret void
}