#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*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ find_blowfish(char *, size_t);
int /*<<< orphan*/ find_crc32(char *, size_t);
int /*<<< orphan*/ find_des(char *, size_t);
int /*<<< orphan*/ find_md5(char *, size_t);
int /*<<< orphan*/ find_sha256(char *, size_t);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, size_t, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
size_t fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
char *malloc(size_t);
int /*<<< orphan*/ print_usage(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  FILE *fd;
  char *start;
  size_t size;
  size_t offset;
  if (argc != 2) {
    print_usage(argv[0]);
    exit(1);
  }
  fd = fopen(argv[1], "rb");
  if (fd == NULL) {
    printf("Could not read the file '%s'\n", argv[1]);
    print_usage(argv[0]);
    exit(1);
  }
  size = fseek(fd, 0L, SEEK_END);
  size = ftell(fd);
  fseek(fd, 0L, SEEK_SET);
  start = malloc(size);
  fread(start, size, 1, fd);
  fclose(fd);
  for (offset = 0; offset < size; offset++) {
    find_blowfish(start, offset);
    find_md5(start, offset);
    find_sha256(start, offset);
    find_crc32(start, offset);
    find_des(start, offset);
  }
  free(start);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1226 <main+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <print_usage@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdcb(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1273 <main+0x83>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdab(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1100 <print_usage@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    0x2d6a(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10c0 <fseek@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d33(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10c0 <fseek@plt>
mov    -0x28(%rbp),%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fread@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1344 <main+0x154>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1090 <find_blowfish@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <find_md5@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10d0 <find_sha256@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1110 <find_crc32@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1060 <find_des@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    12e4 <main+0xf4>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1225 <main+0x35>
mov    0x8(%rbx),%rdi
lea    0xdf5(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
jne    1237 <main+0x47>
mov    0x8(%rbx),%rsi
lea    0xde3(%rip),%rdi
call   1070 <printf@plt>
mov    (%rbx),%rdi
call   1100 <print_usage@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    %rax,%r15
mov    0x2da7(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r15,%rdi
call   10a0 <ftell@plt>
mov    %rax,%r14
mov    0x2d79(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r14,%rdi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
call   1040 <fread@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
test   %r14,%r14
je     12e0 <main+0xf0>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1090 <find_blowfish@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <find_md5@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10d0 <find_sha256@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1110 <find_crc32@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <find_des@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    12a0 <main+0xb0>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [30 x i8] c"Could not read the file '%s'\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @print_usage(i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %22, i32** %6
%23 = load i32*, i32** %6
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %35
25: ; preds = %18
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i32 @print_usage(i8* %32)
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %18
%36 = load i32*, i32** %6
%37 = load i32, i32* @SEEK_END
%38 = call i64 @fseek(i32* %36, i64 0, i32 %37)
store i64 %38, i64* %8
%39 = load i32*, i32** %6
%40 = call i64 @ftell(i32* %39)
store i64 %40, i64* %8
%41 = load i32*, i32** %6
%42 = load i32, i32* @SEEK_SET
%43 = call i64 @fseek(i32* %41, i64 0, i32 %42)
%44 = load i64, i64* %8
%45 = call i8* @malloc(i64 %44)
store i8* %45, i8** %7
%46 = load i8*, i8** %7
%47 = load i64, i64* %8
%48 = load i32*, i32** %6
%49 = call i32 @fread(i8* %46, i64 %47, i32 1, i32* %48)
%50 = load i32*, i32** %6
%51 = call i32 @fclose(i32* %50)
store i64 0, i64* %9
br label %52
52: ; preds = %72, %35
%53 = load i64, i64* %9
%54 = load i64, i64* %8
%55 = icmp ult i64 %53, %54
br i1 %55, label %56, label %75
56: ; preds = %52
%57 = load i8*, i8** %7
%58 = load i64, i64* %9
%59 = call i32 @find_blowfish(i8* %57, i64 %58)
%60 = load i8*, i8** %7
%61 = load i64, i64* %9
%62 = call i32 @find_md5(i8* %60, i64 %61)
%63 = load i8*, i8** %7
%64 = load i64, i64* %9
%65 = call i32 @find_sha256(i8* %63, i64 %64)
%66 = load i8*, i8** %7
%67 = load i64, i64* %9
%68 = call i32 @find_crc32(i8* %66, i64 %67)
%69 = load i8*, i8** %7
%70 = load i64, i64* %9
%71 = call i32 @find_des(i8* %69, i64 %70)
br label %72
72: ; preds = %56
%73 = load i64, i64* %9
%74 = add i64 %73, 1
store i64 %74, i64* %9
br label %52
75: ; preds = %52
%76 = load i8*, i8** %7
%77 = call i32 @free(i8* %76)
%78 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [30 x i8] c"Could not read the file '%s'\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @print_usage(i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i8*, i8** %9
%15 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %1
%17 = tail call i32 @print_usage(i8* %16)
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %8
%20 = load i32, i32* @SEEK_END
%21 = tail call i64 @fseek(i32* %11, i64 0, i32 %20)
%22 = tail call i64 @ftell(i32* %11)
%23 = load i32, i32* @SEEK_SET
%24 = tail call i64 @fseek(i32* %11, i64 0, i32 %23)
%25 = tail call i8* @malloc(i64 %22)
%26 = tail call i32 @fread(i8* %25, i64 %22, i32 1, i32* %11)
%27 = tail call i32 @fclose(i32* %11)
%28 = icmp eq i64 %22, 0
br i1 %28, label %38, label %29
29: ; preds = %19, %29
%30 = phi i64 [ %36, %29 ], [ 0, %19 ]
%31 = tail call i32 @find_blowfish(i8* %25, i64 %30)
%32 = tail call i32 @find_md5(i8* %25, i64 %30)
%33 = tail call i32 @find_sha256(i8* %25, i64 %30)
%34 = tail call i32 @find_crc32(i8* %25, i64 %30)
%35 = tail call i32 @find_des(i8* %25, i64 %30)
%36 = add nuw i64 %30, 1
%37 = icmp eq i64 %36, %22
br i1 %37, label %38, label %29
38: ; preds = %29, %19
%39 = tail call i32 @free(i8* %25)
%40 = tail call i32 @exit(i32 0)
unreachable
}