#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_usage(FILE *out) {
  fprintf(out, "Usage: rc4hash [options]\n");
  fprintf(out, "  -p <password>    Password to be hashed\n");
  fprintf(out, "  -i               Read password from stdin\n");
  fprintf(out, "  -b               Print hash in binary\n");
  fprintf(out, "  -v <hex hash>    Validates hash against given password\n");
  fprintf(out, "  -d <difficulty>  Difficulty factor (0-255, default: 18)\n");
  fprintf(out, "  -s <hex salt>    Choose salt value (default: random)\n\n");
  fprintf(out, "Password and validation arguments can appear multiple\n"
               "times. Each will be processed separately and the program\n"
               "will only return success when all jobs are successful.\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xefd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf1a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf33(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf5d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf88(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfb1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xee6(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xef7(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf0b(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf1b(%rip),%rdi
mov    $0x39,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf3c(%rip),%rdi
mov    $0x3a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf5e(%rip),%rdi
mov    $0x38,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf7e(%rip),%rdi
mov    $0xa6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: rc4hash [options]\0A\00"
@.str.1 = [42 x i8] c" -p <password> Password to be hashed\0A\00"
@.str.2 = [45 x i8] c" -i Read password from stdin\0A\00"
@.str.3 = [41 x i8] c" -b Print hash in binary\0A\00"
@.str.4 = [58 x i8] c" -v <hex hash> Validates hash against given password\0A\00"
@.str.5 = [59 x i8] c" -d <difficulty> Difficulty factor (0-255, default: 18)\0A\00"
@.str.6 = [57 x i8] c" -s <hex salt> Choose salt value (default: random)\0A\0A\00"
@.str.7 = [167 x i8] c"Password and validation arguments can appear multiple\0Atimes. Each will be processed separately and the program\0Awill only return success when all jobs are successful.\0A\00"
define void @print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32*, i32** %2
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32*, i32** %2
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32*, i32** %2
%16 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0))
%17 = load i32*, i32** %2
%18 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: rc4hash [options]\0A\00"
@.str.1 = [42 x i8] c" -p <password> Password to be hashed\0A\00"
@.str.2 = [45 x i8] c" -i Read password from stdin\0A\00"
@.str.3 = [41 x i8] c" -b Print hash in binary\0A\00"
@.str.4 = [58 x i8] c" -v <hex hash> Validates hash against given password\0A\00"
@.str.5 = [59 x i8] c" -d <difficulty> Difficulty factor (0-255, default: 18)\0A\00"
@.str.6 = [57 x i8] c" -s <hex salt> Choose salt value (default: random)\0A\0A\00"
@.str.7 = [167 x i8] c"Password and validation arguments can appear multiple\0Atimes. Each will be processed separately and the program\0Awill only return success when all jobs are successful.\0A\00"
define void @print_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 25, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i64 41, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i64 44, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i64 40, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i64 57, i64 1, i32* %0)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), i64 58, i64 1, i32* %0)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i64 56, i64 1, i32* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.7, i64 0, i64 0), i64 166, i64 1, i32* %0)
ret void
}