#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int fuzzy_compare(char *, char *);
int fuzzy_hash_buf(unsigned char *, int, char *);
int fuzzy_hash_file(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ generate_random(unsigned char *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ stderr;
scalar_t__ write_data(unsigned char *, int, char *);
int main(int argc, char **argv) {
  unsigned char *buf;
  char *result, *result2;
  FILE *handle;
  srand(1);
  buf = (unsigned char *)malloc(0x50000);
  result = (char *)malloc((2 * 64 + 20));
  result2 = (char *)malloc((2 * 64 + 20));
  if (NULL == result || NULL == buf || NULL == result2) {
    fprintf(stderr, "%s: Out of memory\n", argv[0]);
    return EXIT_FAILURE;
  }
  generate_random(buf, 0x50000);
  if (write_data(buf, 0x50000, "foo.dat"))
    return EXIT_FAILURE;
  printf("Hashing buffer\n");
  int status = fuzzy_hash_buf(buf, 0x50000, result);
  if (status)
    printf("Error during buf hash\n");
  else
    printf("%s\n", result);
  handle = fopen("foo.dat", "rb");
  if (NULL == handle) {
    perror("foo.dat");
    return EXIT_FAILURE;
  }
  printf("Hashing file\n");
  status = fuzzy_hash_file(handle, result);
  if (status)
    printf("Error during file hash\n");
  else
    printf("%s\n", result);
  fclose(handle);
  printf("Modifying buffer and comparing to file\n");
  int i;
  for (i = 0x100; i < 0x110; ++i)
    buf[i] = 37;
  status = fuzzy_hash_buf(buf, 0x50000, result2);
  if (status)
    printf("Error during buffer hash\n");
  else
    printf("%s\n", result2);
  i = fuzzy_compare(result, result2);
  if (-1 == i)
    printf("An error occured during matching\n");
  else {
    if (i != 0)
      printf("MATCH: score = %d\n", i);
    else
      printf("did not match\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1050 <srand@plt>
mov    $0x50000,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x94,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x94,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
je     122e <main+0x6e>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     122e <main+0x6e>
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    125b <main+0x9b>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdbb(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1471 <main+0x2b1>
mov    -0x18(%rbp),%rdi
mov    $0x50000,%esi
call   10e0 <generate_random@plt>
mov    -0x18(%rbp),%rdi
mov    $0x50000,%esi
lea    0xd9a(%rip),%rdx
call   1060 <write_data@plt>
cmp    $0x0,%rax
je     1299 <main+0xd9>
mov    0x2d49(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1471 <main+0x2b1>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x50000,%esi
call   10d0 <fuzzy_hash_buf@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     12d9 <main+0x119>
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12eb <main+0x12b>
mov    -0x20(%rbp),%rsi
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd21(%rip),%rdi
lea    0xd4d(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
jne    132b <main+0x16b>
lea    0xcfe(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2cb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1471 <main+0x2b1>
lea    0xd17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <fuzzy_hash_file@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1366 <main+0x1a6>
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1378 <main+0x1b8>
mov    -0x20(%rbp),%rsi
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x100,-0x38(%rbp)
cmpl   $0x110,-0x38(%rbp)
jge    13bd <main+0x1fd>
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movb   $0x25,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1396 <main+0x1d6>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x50000,%esi
call   10d0 <fuzzy_hash_buf@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     13ef <main+0x22f>
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1401 <main+0x241>
mov    -0x28(%rbp),%rsi
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <fuzzy_compare@plt>
mov    %eax,-0x38(%rbp)
mov    $0xffffffff,%eax
cmp    -0x38(%rbp),%eax
jne    1432 <main+0x272>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1465 <main+0x2a5>
cmpl   $0x0,-0x38(%rbp)
je     1452 <main+0x292>
mov    -0x38(%rbp),%esi
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1460 <main+0x2a0>
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1465 <main+0x2a5>
mov    0x2b64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r12
mov    $0x1,%edi
call   1060 <srand@plt>
mov    $0x50000,%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
mov    $0x94,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
mov    $0x94,%edi
call   10b0 <malloc@plt>
test   %r15,%r15
je     1331 <main+0x161>
test   %r13,%r13
je     1331 <main+0x161>
mov    %rax,%r14
test   %rax,%rax
je     1331 <main+0x161>
mov    %r13,%rdi
mov    $0x50000,%esi
call   10f0 <generate_random@plt>
lea    0xde7(%rip),%rdx
mov    %r13,%rdi
mov    $0x50000,%esi
call   1070 <write_data@plt>
mov    0x2d88(%rip),%rbx
test   %rax,%rax
jne    1378 <main+0x1a8>
lea    0xde1(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    $0x50000,%esi
mov    %r15,%rdx
call   10e0 <fuzzy_hash_buf@plt>
test   %eax,%eax
lea    0xe65(%rip),%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
lea    0xd95(%rip),%rdi
lea    0xd96(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1384 <main+0x1b4>
mov    %rax,%r12
lea    0xda3(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   10a0 <fuzzy_hash_file@plt>
test   %eax,%eax
lea    0xe06(%rip),%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
lea    0xd7f(%rip),%rdi
call   1030 <puts@plt>
movaps 0xd16(%rip),%xmm0
movups %xmm0,0x100(%r13)
mov    %r13,%rdi
mov    $0x50000,%esi
mov    %r14,%rdx
call   10e0 <fuzzy_hash_buf@plt>
test   %eax,%eax
lea    0xda8(%rip),%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <fuzzy_compare@plt>
test   %eax,%eax
je     1353 <main+0x183>
cmp    $0xffffffff,%eax
jne    1361 <main+0x191>
lea    0xd63(%rip),%rdi
jmp    135a <main+0x18a>
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rdx
lea    0xccb(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2c87(%rip),%rbx
jmp    1378 <main+0x1a8>
lea    0xd2a(%rip),%rdi
call   1030 <puts@plt>
jmp    1371 <main+0x1a1>
lea    0xcc6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c58(%rip),%rbx
mov    (%rbx),%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xc98(%rip),%rdi
call   10d0 <perror@plt>
jmp    1378 <main+0x1a8>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"%s: Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [8 x i8] c"foo.dat\00"
@.str.2 = [16 x i8] c"Hashing buffer\0A\00"
@.str.3 = [23 x i8] c"Error during buf hash\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [3 x i8] c"rb\00"
@.str.6 = [14 x i8] c"Hashing file\0A\00"
@.str.7 = [24 x i8] c"Error during file hash\0A\00"
@.str.8 = [40 x i8] c"Modifying buffer and comparing to file\0A\00"
@.str.9 = [26 x i8] c"Error during buffer hash\0A\00"
@.str.10 = [34 x i8] c"An error occured during matching\0A\00"
@.str.11 = [19 x i8] c"MATCH: score = %d\0A\00"
@.str.12 = [15 x i8] c"did not match\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 @srand(i32 1)
%13 = call i64 @malloc(i32 327680)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %6
%15 = call i64 @malloc(i32 148)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %7
%17 = call i64 @malloc(i32 148)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %8
%19 = load i8*, i8** %7
%20 = icmp eq i8* null, %19
br i1 %20, label %27, label %21
21: ; preds = %2
%22 = load i8*, i8** %6
%23 = icmp eq i8* null, %22
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i8*, i8** %8
%26 = icmp eq i8* null, %25
br i1 %26, label %27, label %34
27: ; preds = %24, %21, %2
%28 = load i32, i32* @stderr
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = load i32, i32* @EXIT_FAILURE
store i32 %33, i32* %3
br label %118
34: ; preds = %24
%35 = load i8*, i8** %6
%36 = call i32 @generate_random(i8* %35, i32 327680)
%37 = load i8*, i8** %6
%38 = call i64 @write_data(i8* %37, i32 327680, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %34
%41 = load i32, i32* @EXIT_FAILURE
store i32 %41, i32* %3
br label %118
42: ; preds = %34
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%44 = load i8*, i8** %6
%45 = load i8*, i8** %7
%46 = call i32 @fuzzy_hash_buf(i8* %44, i32 327680, i8* %45)
store i32 %46, i32* %10
%47 = load i32, i32* %10
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %42
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %54
51: ; preds = %42
%52 = load i8*, i8** %7
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %51, %49
%55 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %55, i32** %9
%56 = load i32*, i32** %9
%57 = icmp eq i32* null, %56
br i1 %57, label %58, label %61
58: ; preds = %54
%59 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%60 = load i32, i32* @EXIT_FAILURE
store i32 %60, i32* %3
br label %118
61: ; preds = %54
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%63 = load i32*, i32** %9
%64 = load i8*, i8** %7
%65 = call i32 @fuzzy_hash_file(i32* %63, i8* %64)
store i32 %65, i32* %10
%66 = load i32, i32* %10
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %61
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %73
70: ; preds = %61
%71 = load i8*, i8** %7
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %70, %68
%74 = load i32*, i32** %9
%75 = call i32 @fclose(i32* %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
store i32 256, i32* %11
br label %77
77: ; preds = %85, %73
%78 = load i32, i32* %11
%79 = icmp slt i32 %78, 272
br i1 %79, label %80, label %88
80: ; preds = %77
%81 = load i8*, i8** %6
%82 = load i32, i32* %11
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
store i8 37, i8* %84
br label %85
85: ; preds = %80
%86 = load i32, i32* %11
%87 = add nsw i32 %86, 1
store i32 %87, i32* %11
br label %77
88: ; preds = %77
%89 = load i8*, i8** %6
%90 = load i8*, i8** %8
%91 = call i32 @fuzzy_hash_buf(i8* %89, i32 327680, i8* %90)
store i32 %91, i32* %10
%92 = load i32, i32* %10
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %88
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
br label %99
96: ; preds = %88
%97 = load i8*, i8** %8
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %97)
br label %99
99: ; preds = %96, %94
%100 = load i8*, i8** %7
%101 = load i8*, i8** %8
%102 = call i32 @fuzzy_compare(i8* %100, i8* %101)
store i32 %102, i32* %11
%103 = load i32, i32* %11
%104 = icmp eq i32 -1, %103
br i1 %104, label %105, label %107
105: ; preds = %99
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0))
br label %116
107: ; preds = %99
%108 = load i32, i32* %11
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %107
%111 = load i32, i32* %11
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i32 %111)
br label %115
113: ; preds = %107
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
br label %115
115: ; preds = %113, %110
br label %116
116: ; preds = %115, %105
%117 = load i32, i32* @EXIT_SUCCESS
store i32 %117, i32* %3
br label %118
118: ; preds = %116, %58, %40, %27
%119 = load i32, i32* %3
ret i32 %119
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"%s: Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [8 x i8] c"foo.dat\00"
@.str.5 = [3 x i8] c"rb\00"
@.str.11 = [19 x i8] c"MATCH: score = %d\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [15 x i8] c"Hashing buffer\00"
@str.13 = [13 x i8] c"Hashing file\00"
@str.14 = [39 x i8] c"Modifying buffer and comparing to file\00"
@str.15 = [14 x i8] c"did not match\00"
@str.16 = [33 x i8] c"An error occured during matching\00"
@str.17 = [25 x i8] c"Error during buffer hash\00"
@str.18 = [23 x i8] c"Error during file hash\00"
@str.19 = [22 x i8] c"Error during buf hash\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @srand(i32 1)
%4 = tail call i64 @malloc(i32 327680)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @malloc(i32 148)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i64 @malloc(i32 148)
%9 = inttoptr i64 %8 to i8*
%10 = icmp eq i64 %6, 0
%11 = icmp eq i64 %4, 0
%12 = select i1 %10, i1 true, i1 %11
%13 = icmp eq i64 %8, 0
%14 = select i1 %12, i1 true, i1 %13
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %1
%18 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %53
19: ; preds = %2
%20 = tail call i32 @generate_random(i8* %5, i32 327680)
%21 = tail call i64 @write_data(i8* %5, i32 327680, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %53
23: ; preds = %19
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%25 = tail call i32 @fuzzy_hash_buf(i8* %5, i32 327680, i8* %7)
%26 = icmp eq i32 %25, 0
%27 = select i1 %26, i8* %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.19, i64 0, i64 0)
%28 = tail call i32 @puts(i8* dereferenceable(1) %27)
%29 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %33
31: ; preds = %23
%32 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %53
33: ; preds = %23
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.13, i64 0, i64 0))
%35 = tail call i32 @fuzzy_hash_file(i32* %29, i8* %7)
%36 = icmp eq i32 %35, 0
%37 = select i1 %36, i8* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.18, i64 0, i64 0)
%38 = tail call i32 @puts(i8* dereferenceable(1) %37)
%39 = tail call i32 @fclose(i32* %29)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.14, i64 0, i64 0))
%41 = getelementptr i8, i8* %5, i64 256
%42 = tail call i32 @fuzzy_hash_buf(i8* %5, i32 327680, i8* %9)
%43 = icmp eq i32 %42, 0
%44 = select i1 %43, i8* %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.17, i64 0, i64 0)
%45 = tail call i32 @puts(i8* dereferenceable(1) %44)
%46 = tail call i32 @fuzzy_compare(i8* %7, i8* %9)
switch i32 %46, label %49 [
i32 -1, label %47
i32 0, label %51
]
47: ; preds = %33
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.16, i64 0, i64 0))
br label %53
49: ; preds = %33
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i32 %46)
br label %53
51: ; preds = %33
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.15, i64 0, i64 0))
br label %53
53: ; preds = %31, %49, %51, %47, %19, %15
%54 = phi i32* [ @EXIT_FAILURE, %15 ], [ @EXIT_FAILURE, %19 ], [ @EXIT_FAILURE, %31 ], [ @EXIT_SUCCESS, %49 ], [ @EXIT_SUCCESS, %51 ], [ @EXIT_SUCCESS, %47 ]
%55 = load i32, i32* %54
ret i32 %55
}