#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 load_list();
int /*<<< orphan*/ printf(char *);
int process_args(int, char **);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    printf("MD5 Brute Force - Usage:\n");
    printf("./md5_brute -h <hash> -w <wordlist>\n");
    goto exit;
  }
  if (process_args(argc, argv) == -1)
    goto halt;
  if (load_list() == -1)
    goto halt;
  return 0;
halt:
  printf("An error occured.\n");
  return -1;
exit:
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    116d <main+0x3d>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0x90>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <process_args@plt>
cmp    $0xffffffff,%eax
jne    1187 <main+0x57>
jmp    11a8 <main+0x78>
mov    $0x0,%al
call   1040 <load_list@plt>
cmp    $0xffffffff,%eax
jne    119c <main+0x6c>
jmp    11a8 <main+0x78>
movl   $0x0,-0x4(%rbp)
jmp    11c7 <main+0x97>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c7 <main+0x97>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    114d <main+0x1d>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rbx
jmp    116c <main+0x3c>
call   1050 <process_args@plt>
lea    0xea7(%rip),%rbx
cmp    $0xffffffff,%eax
je     116c <main+0x3c>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <load_list@plt>
cmp    $0xffffffff,%eax
jne    1179 <main+0x49>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"MD5 Brute Force - Usage:\0A\00"
@.str.1 = [37 x i8] c"./md5_brute -h <hash> -w <wordlist>\0A\00"
@.str.2 = [19 x i8] c"An error occured.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %24
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @process_args(i32 %12, i8** %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %11
br label %22
17: ; preds = %11
%18 = call i32 (...) @load_list()
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %17
br label %22
21: ; preds = %17
store i32 0, i32* %3
br label %25
22: ; preds = %20, %16
%23 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %25
24: ; preds = %8
store i32 -1, i32* %3
br label %25
25: ; preds = %24, %22, %21
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@str = [18 x i8] c"An error occured.\00"
@str.3 = [25 x i8] c"MD5 Brute Force - Usage:\00"
@str.4 = [36 x i8] c"./md5_brute -h <hash> -w <wordlist>\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.3, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = tail call i32 @process_args(i32 %0, i8** %1)
%8 = icmp eq i32 %7, -1
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 (...) @load_list()
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %6, %9, %4
%13 = phi i8* [ getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0), %4 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), %6 ]
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
br label %15
15: ; preds = %12, %9
%16 = phi i32 [ 0, %9 ], [ -1, %12 ]
ret i32 %16
}