int main(int argc, char *argv[]) {
  banner();
  if (argc < 2) {
    int i = 0;
    char *func[] = {"VirtualAlloc", "LoadLibraryA", "DnsQuery_A", 0x0};
    printf("HASH\t\t\tFUNCTION\n----\t\t\t--------\n");
    while (*func) {
      printf("0x%X\t\t%s\n", calculate_hash(*func), *func);
      i++;
      *func = func[i];
    }
  } else {
    char *manfunc[] = {argv[1]};
    printf("HASH\t\t\tFUNCTION\n----\t\t\t--------\n");
    printf("0x%X\t\t%s\n", calculate_hash(*manfunc), *manfunc);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <banner@plt>
cmpl   $0x2,-0x8(%rbp)
jge    11e2 <main+0xb2>
movl   $0x0,-0x14(%rbp)
mov    0x2c9b(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2c98(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0x2c95(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2c92(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
je     11dd <main+0xad>
mov    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <calculate_hash@plt>
mov    %eax,%esi
mov    -0x40(%rbp),%rdx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rax
mov    %rax,-0x40(%rbp)
jmp    1198 <main+0x68>
jmp    121b <main+0xeb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x48(%rbp)
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    $0x0,%al
call   1050 <calculate_hash@plt>
mov    %eax,%esi
mov    -0x48(%rbp),%rdx
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <banner@plt>
cmp    $0x1,%ebp
jg     11bd <main+0x7d>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <calculate_hash@plt>
lea    0xead(%rip),%rbp
mov    %rbp,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7f(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <calculate_hash@plt>
mov    %rbp,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6c(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <calculate_hash@plt>
mov    %rbp,%rdi
jmp    11de <main+0x9e>
mov    0x8(%rbx),%rbx
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <calculate_hash@plt>
lea    0xe47(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"VirtualAlloc\00"
@.str.1 = [13 x i8] c"LoadLibraryA\00"
@.str.2 = [11 x i8] c"DnsQuery_A\00"
@__const.main.func = [4 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [33 x i8] c"HASH\09\09\09FUNCTION\0A----\09\09\09--------\0A\00"
@.str.4 = [10 x i8] c"0x%X\09\09%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [4 x i8*]
%8 = alloca [1 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @banner()
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %34
12: ; preds = %2
store i32 0, i32* %6
%13 = bitcast [4 x i8*]* %7 to i8*
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %19, %12
%16 = getelementptr inbounds [4 x i8*], [4 x i8*]* %7, i64 0, i64 0
%17 = load i8*, i8** %16
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %33
19: ; preds = %15
%20 = getelementptr inbounds [4 x i8*], [4 x i8*]* %7, i64 0, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @calculate_hash to i32 (i8*, ...)*)(i8* %21)
%23 = getelementptr inbounds [4 x i8*], [4 x i8*]* %7, i64 0, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %22, i8* %24)
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [4 x i8*], [4 x i8*]* %7, i64 0, i64 %29
%31 = load i8*, i8** %30
%32 = getelementptr inbounds [4 x i8*], [4 x i8*]* %7, i64 0, i64 0
store i8* %31, i8** %32
br label %15
33: ; preds = %15
br label %46
34: ; preds = %2
%35 = getelementptr inbounds [1 x i8*], [1 x i8*]* %8, i64 0, i64 0
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
store i8* %38, i8** %35
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%40 = getelementptr inbounds [1 x i8*], [1 x i8*]* %8, i64 0, i64 0
%41 = load i8*, i8** %40
%42 = call i32 (i8*, ...) bitcast (i32 (...)* @calculate_hash to i32 (i8*, ...)*)(i8* %41)
%43 = getelementptr inbounds [1 x i8*], [1 x i8*]* %8, i64 0, i64 0
%44 = load i8*, i8** %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %42, i8* %44)
br label %46
46: ; preds = %34, %33
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"VirtualAlloc\00"
@.str.1 = [13 x i8] c"LoadLibraryA\00"
@.str.2 = [11 x i8] c"DnsQuery_A\00"
@.str.4 = [10 x i8] c"0x%X\09\09%s\0A\00"
@str.5 = [32 x i8] c"HASH\09\09\09FUNCTION\0A----\09\09\09--------\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @banner()
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @calculate_hash to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @calculate_hash to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @calculate_hash to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %19
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) bitcast (i32 (...)* @calculate_hash to i32 (i8*, ...)*)(i8* %15)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %17, i8* %15)
br label %19
19: ; preds = %5, %13
ret i32 0
}