#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*/ hashes;

/* Variables and functions */
int /*<<< orphan*/ crack(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ usage(char **);
int main(int argc, char **argv) {
  int nthreads;
  if (2 != argc)
    usage(argv);
  nthreads = strtol(argv[1], NULL, 0);
  if (nthreads < 0)
    usage(argv);
  char *hashes[] = {
      "2bec52c0729e136fcf418b7ee42e51c7", "4e50f5e7a29d352bc4c3267cffdd50a4",
      "75cf1d4a01dfd9703c26927574d72230", "a6f931611c69f3500ad52e84a0c96d2d",
      "60662e6279e742da121699b10c5a9f54", "78d2a8b546632b0df5f0cd12b551998a",
      "dbdd1e7fba9a2ee6dd033af77c8ee398", "38f1eebefea62e6affc37d97202df948",
      "6e4eb59d8f151da5ce10866c35f433ab", "8161c9e97e4b6cfdbc489ad763d1fad8",
  };
  unsigned i;
  for (i = 0; i < sizeof(hashes) / sizeof(char *); ++i) {
    unsigned j;
    printf("Searching for password to match %s.\n", hashes[i]);
    crack(hashes[i], nthreads);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
je     1180 <main+0x30>
mov    -0x10(%rbp),%rdi
call   1060 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    11a9 <main+0x59>
mov    -0x10(%rbp),%rdi
call   1060 <usage@plt>
lea    -0x70(%rbp),%rdi
lea    0x2c1c(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    $0xa,%rax
jae    1214 <main+0xc4>
mov    -0x74(%rbp),%eax
mov    -0x70(%rbp,%rax,8),%rsi
lea    0xf69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
mov    -0x70(%rbp,%rax,8),%rdi
mov    -0x14(%rbp),%esi
call   1070 <crack@plt>
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11c5 <main+0x75>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
cmp    $0x2,%edi
je     1165 <main+0x15>
mov    %r14,%rdi
call   1060 <usage@plt>
mov    0x8(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <strtol@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1180 <main+0x30>
mov    %r14,%rdi
call   1060 <usage@plt>
lea    0xfc3(%rip),%r14
lea    0xe72(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe6b(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe64(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe5d(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe56(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe4f(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe48(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe41(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe3a(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe33(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <crack@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [33 x i8] c"2bec52c0729e136fcf418b7ee42e51c7\00"
@.str.1 = [33 x i8] c"4e50f5e7a29d352bc4c3267cffdd50a4\00"
@.str.2 = [33 x i8] c"75cf1d4a01dfd9703c26927574d72230\00"
@.str.3 = [33 x i8] c"a6f931611c69f3500ad52e84a0c96d2d\00"
@.str.4 = [33 x i8] c"60662e6279e742da121699b10c5a9f54\00"
@.str.5 = [33 x i8] c"78d2a8b546632b0df5f0cd12b551998a\00"
@.str.6 = [33 x i8] c"dbdd1e7fba9a2ee6dd033af77c8ee398\00"
@.str.7 = [33 x i8] c"38f1eebefea62e6affc37d97202df948\00"
@.str.8 = [33 x i8] c"6e4eb59d8f151da5ce10866c35f433ab\00"
@.str.9 = [33 x i8] c"8161c9e97e4b6cfdbc489ad763d1fad8\00"
@__const.main.hashes = [10 x i8*] [i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [37 x i8] c"Searching for password to match %s.\0A\00"
@.str.11 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i8*]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 2, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = call i32 @usage(i8** %13)
br label %15
15: ; preds = %12, %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strtol(i8* %18, i32* null, i32 0)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = load i8**, i8*** %5
%24 = call i32 @usage(i8** %23)
br label %25
25: ; preds = %22, %15
%26 = bitcast [10 x i8*]* %7 to i8*
store i32 0, i32* %8
br label %27
27: ; preds = %44, %25
%28 = load i32, i32* %8
%29 = zext i32 %28 to i64
%30 = icmp ult i64 %29, 10
br i1 %30, label %31, label %47
31: ; preds = %27
%32 = load i32, i32* %8
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* %35)
%37 = load i32, i32* %8
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 %38
%40 = load i8*, i8** %39
%41 = load i32, i32* %6
%42 = call i32 @crack(i8* %40, i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %44
44: ; preds = %31
%45 = load i32, i32* %8
%46 = add i32 %45, 1
store i32 %46, i32* %8
br label %27
47: ; preds = %27
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"2bec52c0729e136fcf418b7ee42e51c7\00"
@.str.1 = [33 x i8] c"4e50f5e7a29d352bc4c3267cffdd50a4\00"
@.str.2 = [33 x i8] c"75cf1d4a01dfd9703c26927574d72230\00"
@.str.3 = [33 x i8] c"a6f931611c69f3500ad52e84a0c96d2d\00"
@.str.4 = [33 x i8] c"60662e6279e742da121699b10c5a9f54\00"
@.str.5 = [33 x i8] c"78d2a8b546632b0df5f0cd12b551998a\00"
@.str.6 = [33 x i8] c"dbdd1e7fba9a2ee6dd033af77c8ee398\00"
@.str.7 = [33 x i8] c"38f1eebefea62e6affc37d97202df948\00"
@.str.8 = [33 x i8] c"6e4eb59d8f151da5ce10866c35f433ab\00"
@.str.9 = [33 x i8] c"8161c9e97e4b6cfdbc489ad763d1fad8\00"
@.str.10 = [37 x i8] c"Searching for password to match %s.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @usage(i8** %1)
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strtol(i8* nocapture %8, i32* null, i32 0)
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @usage(i8** %1)
br label %13
13: ; preds = %11, %6
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9)
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%21 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%24 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%27 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%28 = tail call i32 @putchar(i32 10)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%30 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %9)
%31 = tail call i32 @putchar(i32 10)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%33 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %9)
%34 = tail call i32 @putchar(i32 10)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%36 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %9)
%37 = tail call i32 @putchar(i32 10)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
%39 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %9)
%40 = tail call i32 @putchar(i32 10)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%42 = tail call i32 @crack(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 %9)
%43 = tail call i32 @putchar(i32 10)
ret i32 0
}