int main(int argc, char **argv) {
  if (argc < 2) {
    printf("USAGE: \n$ %s <password>\n", argv[0]);
    return 0;
  }
  test1();
  int i = 0;
  char **fixes = fix_passwords(argv[1]);
  for (i = 0; i < 7; i++) {
    printf("%x\t\t", fixes[i]);
    if (fixes[i])
      printf("%s\n", fixes[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1206 <main+0xd6>
mov    $0x0,%al
call   1030 <test1@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1050 <fix_passwords@plt>
cltq
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jge    11ff <main+0xcf>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11ec <main+0xbc>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f1 <main+0xc1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119b <main+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     115f <main+0x1f>
mov    (%rbx),%rsi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1252 <main+0x112>
xor    %eax,%eax
call   1040 <test1@plt>
mov    0x8(%rbx),%rdi
xor    %eax,%eax
call   1060 <fix_passwords@plt>
movslq %eax,%rbx
mov    (%rbx),%rsi
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1192 <main+0x52>
call   1030 <puts@plt>
mov    0x8(%rbx),%rsi
lea    0xe7c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     11b2 <main+0x72>
call   1030 <puts@plt>
mov    0x10(%rbx),%rsi
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rbx),%rdi
test   %rdi,%rdi
je     11d2 <main+0x92>
call   1030 <puts@plt>
mov    0x18(%rbx),%rsi
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     11f2 <main+0xb2>
call   1030 <puts@plt>
mov    0x20(%rbx),%rsi
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rbx),%rdi
test   %rdi,%rdi
je     1212 <main+0xd2>
call   1030 <puts@plt>
mov    0x28(%rbx),%rsi
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rbx),%rdi
test   %rdi,%rdi
je     1232 <main+0xf2>
call   1030 <puts@plt>
mov    0x30(%rbx),%rsi
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x30(%rbx),%rdi
test   %rdi,%rdi
je     1252 <main+0x112>
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"USAGE: \0A$ %s <password>\0A\00"
@.str.1 = [5 x i8] c"%x\09\09\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %68
7: ; preds = %2
%8 = tail call i32 (...) @test1()
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fix_passwords to i32 (i8*, ...)*)(i8* %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8**
%14 = load i8*, i8** %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %13
%17 = icmp eq i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %7
%19 = tail call i32 @puts(i8* %16)
br label %20
20: ; preds = %7, %18
%21 = getelementptr inbounds i8*, i8** %13, i64 1
%22 = load i8*, i8** %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %21
%25 = icmp eq i8* %24, null
br i1 %25, label %28, label %26
26: ; preds = %20
%27 = tail call i32 @puts(i8* %24)
br label %28
28: ; preds = %26, %20
%29 = getelementptr inbounds i8*, i8** %13, i64 2
%30 = load i8*, i8** %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %29
%33 = icmp eq i8* %32, null
br i1 %33, label %36, label %34
34: ; preds = %28
%35 = tail call i32 @puts(i8* %32)
br label %36
36: ; preds = %34, %28
%37 = getelementptr inbounds i8*, i8** %13, i64 3
%38 = load i8*, i8** %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %38)
%40 = load i8*, i8** %37
%41 = icmp eq i8* %40, null
br i1 %41, label %44, label %42
42: ; preds = %36
%43 = tail call i32 @puts(i8* %40)
br label %44
44: ; preds = %42, %36
%45 = getelementptr inbounds i8*, i8** %13, i64 4
%46 = load i8*, i8** %45
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %46)
%48 = load i8*, i8** %45
%49 = icmp eq i8* %48, null
br i1 %49, label %52, label %50
50: ; preds = %44
%51 = tail call i32 @puts(i8* %48)
br label %52
52: ; preds = %50, %44
%53 = getelementptr inbounds i8*, i8** %13, i64 5
%54 = load i8*, i8** %53
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %54)
%56 = load i8*, i8** %53
%57 = icmp eq i8* %56, null
br i1 %57, label %60, label %58
58: ; preds = %52
%59 = tail call i32 @puts(i8* %56)
br label %60
60: ; preds = %58, %52
%61 = getelementptr inbounds i8*, i8** %13, i64 6
%62 = load i8*, i8** %61
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %62)
%64 = load i8*, i8** %61
%65 = icmp eq i8* %64, null
br i1 %65, label %68, label %66
66: ; preds = %60
%67 = tail call i32 @puts(i8* %64)
br label %68
68: ; preds = %60, %66, %4
ret i32 0
}