#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*/ *fopen(char *, char *);
unsigned int fread(void *, int, unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ ftell(int /*<<< orphan*/ *);
unsigned int fwrite(void *, int, unsigned int, int /*<<< orphan*/ *);
int getopt(int, char **, char *);
void *malloc(unsigned int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
char *optarg;
int optind;
int optopt;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_hash(void *, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
unsigned int rle_compress(void *, void *, unsigned int);
unsigned int rle_decompress(void *, void *, unsigned int);
unsigned int rle_get_compressed_size(void *, unsigned int);
unsigned int rle_get_decompressed_size(void *, unsigned int);
int /*<<< orphan*/ unlink(char *);
int main(int argc, char **argv) {
  int compress = 1, option;
  char *inpfile = NULL, *outfile = NULL;
  void *output_buffer = NULL, *file_buffer = NULL;
  unsigned output_size, file_size, real_output_size;
  FILE *ifd = NULL, *ofd = NULL;
  int retval = 0;
  while ((option = getopt(argc, argv, ":cdi:o:")) != -1) {
    switch (option) {
    case 'c':
      compress = 1;
      break;
    case 'd':
      compress = 0;
      break;
    case 'i':
      inpfile = optarg;
      break;
    case 'o':
      outfile = optarg;
      break;
    default:
      printf("Lol what is -%c?\n", optopt);
      return 1;
    }
  }
  if (!inpfile) {
    if (optind >= argc) {
      printf("No input file specified.\n");
      retval = 1;
      goto __cleanup__;
    } else
      inpfile = argv[optind++];
  }
  if (!outfile) {
    if (optind >= argc) {
      printf("No output file specified.\n");
      retval = 1;
      goto __cleanup__;
    } else
      outfile = argv[optind++];
  }
  ifd = fopen(inpfile, "rb");
  if (!ifd) {
    perror("Failed to open input file");
    retval = 2;
    goto __cleanup__;
  }
  fseek(ifd, 0, SEEK_END);
  file_size = (unsigned)ftell(ifd);
  printf("Input file size: %u\n", file_size);
  fseek(ifd, 0, SEEK_SET);
  file_buffer = malloc(file_size);
  if (!file_buffer) {
    perror("Failed to load input file");
    retval = 2;
    goto __cleanup__;
  } else
    memset(file_buffer, 0, file_size);
  if (fread(file_buffer, 1, file_size, ifd) != file_size) {
    perror("Failed to load input file");
    retval = 2;
    goto __cleanup__;
  }
  if (compress) {
    output_size = rle_get_compressed_size(file_buffer, file_size);
    printf("Expected output size: %u (%.02f%% of original)\n", output_size,
           (float)output_size / file_size * 100.0);
  } else {
    output_size = rle_get_decompressed_size(file_buffer, file_size);
    printf("Expected output size: %u\n", output_size);
  }
  output_buffer = malloc(output_size);
  if (!output_buffer) {
    perror("Couldn't begin compression/decompression");
    retval = 3;
    goto __cleanup__;
  } else
    memset(output_buffer, 0, output_size);
  if (compress) {
    printf("Input MD5: ");
    if (!print_hash(file_buffer, file_size)) {
      printf("Failed to get hash for input file.\n");
      retval = 6;
      goto __cleanup__;
    }
    real_output_size = rle_compress(file_buffer, output_buffer, file_size);
  } else
    real_output_size = rle_decompress(file_buffer, output_buffer, file_size);
  if (real_output_size != output_size) {
    printf("FATAL ERROR: Expected output size %u, got %u.\n", output_size,
           real_output_size);
    exit(3);
  }
  ofd = fopen(outfile, "wb");
  if (!ofd) {
    perror("Couldn't open output file");
    retval = 4;
    goto __cleanup__;
  }
  if (fwrite(output_buffer, 1, real_output_size, ofd) != real_output_size) {
    unlink(outfile);
    perror("Failed to write to output file");
    retval = 5;
    goto __cleanup__;
  }
  printf("Output MD5: ");
  if (!print_hash(output_buffer, real_output_size)) {
    printf("Failed to get hash for output file.\n");
    retval = 6;
    goto __cleanup__;
  }
__cleanup__:
  if (ifd)
    fclose(ifd);
  if (ofd)
    fclose(ofd);
  if (file_buffer)
    free(file_buffer);
  if (output_buffer)
    free(output_buffer);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdaa(%rip),%rdx
call   1130 <getopt@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
je     1332 <main+0x102>
mov    -0x18(%rbp),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0x68(%rbp)
sub    $0xc,%eax
ja     130a <main+0xda>
mov    -0x68(%rbp),%rax
lea    0xd45(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x14(%rbp)
jmp    132d <main+0xfd>
movl   $0x0,-0x14(%rbp)
jmp    132d <main+0xfd>
mov    0x2d0d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    132d <main+0xfd>
mov    0x2cfa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    132d <main+0xfd>
mov    0x2cc7(%rip),%rax
mov    (%rax),%esi
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173e <main+0x50e>
jmp    1284 <main+0x54>
cmpq   $0x0,-0x20(%rbp)
jne    1394 <main+0x164>
mov    0x2c8c(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jl     1369 <main+0x139>
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
mov    -0x10(%rbp),%rax
mov    0x2c5c(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2c4e(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    1394 <main+0x164>
cmpq   $0x0,-0x28(%rbp)
jne    13f6 <main+0x1c6>
mov    0x2c2a(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jl     13cb <main+0x19b>
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
mov    -0x10(%rbp),%rax
mov    0x2bfa(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2bec(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
jmp    13f6 <main+0x1c6>
mov    -0x20(%rbp),%rdi
lea    0xc8a(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    142d <main+0x1fd>
lea    0xc72(%rip),%rdi
call   1120 <perror@plt>
movl   $0x2,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
mov    -0x50(%rbp),%rdi
mov    0x2ba8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x50(%rbp),%rdi
call   10b0 <ftell@plt>
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%esi
lea    0xc51(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    0x2b57(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x40(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    14a1 <main+0x271>
lea    0xc2d(%rip),%rdi
call   1120 <perror@plt>
movl   $0x2,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%edx
xor    %esi,%esi
call   1090 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%edx
mov    -0x50(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fread@plt>
cmp    -0x40(%rbp),%eax
je     14e5 <main+0x2b5>
lea    0xbe9(%rip),%rdi
call   1120 <perror@plt>
movl   $0x2,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
cmpl   $0x0,-0x14(%rbp)
je     1537 <main+0x307>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%esi
call   1050 <rle_get_compressed_size@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,%esi
cvtsi2ss %rax,%xmm0
mov    -0x40(%rbp),%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xae0(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xbac(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
jmp    1557 <main+0x327>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%esi
call   1100 <rle_get_decompressed_size@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xbb7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x3c(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1586 <main+0x356>
lea    0xbac(%rip),%rdi
call   1120 <perror@plt>
movl   $0x3,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
mov    -0x30(%rbp),%rdi
mov    -0x3c(%rbp),%edx
xor    %esi,%esi
call   1090 <memset@plt>
cmpl   $0x0,-0x14(%rbp)
je     15f3 <main+0x3c3>
lea    0xba5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%esi
call   10a0 <print_hash@plt>
cmp    $0x0,%eax
jne    15db <main+0x3ab>
lea    0xb8e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x6,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x40(%rbp),%edx
call   10e0 <rle_compress@plt>
mov    %eax,-0x44(%rbp)
jmp    1606 <main+0x3d6>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x40(%rbp),%edx
call   10f0 <rle_decompress@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x3c(%rbp),%eax
je     1630 <main+0x400>
mov    -0x3c(%rbp),%esi
mov    -0x44(%rbp),%edx
lea    0xb5b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x3,%edi
call   1140 <exit@plt>
mov    -0x28(%rbp),%rdi
lea    0xb6e(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1667 <main+0x437>
lea    0xb56(%rip),%rdi
call   1120 <perror@plt>
movl   $0x4,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    -0x58(%rbp),%rcx
mov    $0x1,%esi
call   1150 <fwrite@plt>
cmp    -0x44(%rbp),%eax
je     16a6 <main+0x476>
mov    -0x28(%rbp),%rdi
call   1040 <unlink@plt>
lea    0xb31(%rip),%rdi
call   1120 <perror@plt>
movl   $0x5,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
lea    0xb38(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   10a0 <print_hash@plt>
cmp    $0x0,%eax
jne    16e3 <main+0x4b3>
lea    0xb22(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x6,-0x5c(%rbp)
jmp    16e8 <main+0x4b8>
jmp    16e8 <main+0x4b8>
cmpq   $0x0,-0x50(%rbp)
je     16fc <main+0x4cc>
mov    -0x50(%rbp),%rdi
call   1070 <fclose@plt>
cmpq   $0x0,-0x58(%rbp)
je     1710 <main+0x4e0>
mov    -0x58(%rbp),%rdi
call   1070 <fclose@plt>
cmpq   $0x0,-0x38(%rbp)
je     1724 <main+0x4f4>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x30(%rbp)
je     1738 <main+0x508>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
movl   $0x1,0xc(%rsp)
xor    %r15d,%r15d
lea    0xda3(%rip),%r12
mov    0x2d8c(%rip),%r13
xor    %r14d,%r14d
jmp    1284 <main+0x44>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13),%r14
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r12,%rdx
call   1140 <getopt@plt>
cmp    $0x6f,%eax
je     1280 <main+0x40>
cmp    $0x63,%eax
jg     12af <main+0x6f>
cmp    $0xffffffff,%eax
je     12c9 <main+0x89>
cmp    $0x63,%eax
jne    12f1 <main+0xb1>
movl   $0x1,0xc(%rsp)
jmp    1284 <main+0x44>
cmp    $0x69,%eax
je     12c3 <main+0x83>
cmp    $0x64,%eax
jne    12f1 <main+0xb1>
movl   $0x0,0xc(%rsp)
jmp    1284 <main+0x44>
mov    0x0(%r13),%r15
jmp    1284 <main+0x44>
test   %r15,%r15
je     1312 <main+0xd2>
test   %r14,%r14
jne    1333 <main+0xf3>
mov    0x2cf6(%rip),%rax
movslq (%rax),%rcx
cmp    %ebx,%ecx
jge    1525 <main+0x2e5>
lea    0x1(%rcx),%edx
mov    %edx,(%rax)
mov    0x0(%rbp,%rcx,8),%r14
jmp    1333 <main+0xf3>
mov    0x2ce0(%rip),%rax
mov    (%rax),%esi
lea    0xd0f(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x1,%ebx
jmp    15d6 <main+0x396>
mov    0x2cb7(%rip),%rax
movslq (%rax),%rcx
cmp    %ebx,%ecx
jge    151c <main+0x2dc>
lea    0x1(%rcx),%edx
mov    %edx,(%rax)
mov    0x0(%rbp,%rcx,8),%r15
test   %r14,%r14
je     12d3 <main+0x93>
lea    0xce8(%rip),%rsi
mov    %r15,%rdi
call   1120 <fopen@plt>
test   %rax,%rax
je     154e <main+0x30e>
mov    %rax,%rbp
mov    0x2c8b(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10e0 <fseek@plt>
mov    %rbp,%rdi
call   10c0 <ftell@plt>
mov    %rax,%r13
lea    0xccc(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2c3c(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10e0 <fseek@plt>
mov    %r13d,%edi
call   10d0 <malloc@plt>
test   %rax,%rax
je     155c <main+0x31c>
mov    %rax,%r15
mov    %rax,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   10a0 <memset@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %rbp,%rcx
call   1070 <fread@plt>
cmp    %r13d,%eax
jne    1577 <main+0x337>
mov    %rbp,0x10(%rsp)
mov    0xc(%rsp),%ebx
mov    %r15,%rdi
mov    %r13d,%esi
test   %ebx,%ebx
je     1418 <main+0x1d8>
call   1060 <rle_get_compressed_size@plt>
mov    %eax,%ebp
mov    %eax,%eax
cvtsi2ss %rax,%xmm0
mov    %r13d,%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xbfa(%rip),%xmm0
lea    0xc61(%rip),%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   1090 <printf@plt>
jmp    142f <main+0x1ef>
call   1110 <rle_get_decompressed_size@plt>
mov    %eax,%ebp
lea    0xc78(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %ebp,%edi
call   10d0 <malloc@plt>
test   %rax,%rax
je     158d <main+0x34d>
mov    %rax,%r12
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   10a0 <memset@plt>
test   %ebx,%ebx
je     1483 <main+0x243>
lea    0xc88(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
call   10b0 <print_hash@plt>
test   %eax,%eax
je     153b <main+0x2fb>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   10f0 <rle_compress@plt>
jmp    1491 <main+0x251>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1100 <rle_decompress@plt>
cmp    %ebp,%eax
jne    1605 <main+0x3c5>
lea    0xc7c(%rip),%rsi
mov    %r14,%rdi
call   1120 <fopen@plt>
test   %rax,%rax
je     15a3 <main+0x363>
mov    %rax,%r13
mov    %r12,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rax,%rcx
call   1160 <fwrite@plt>
cmp    %ebp,%eax
jne    15e7 <main+0x3a7>
lea    0xc83(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
call   10b0 <print_hash@plt>
test   %eax,%eax
jne    14fd <main+0x2bd>
lea    0xc72(%rip),%rdi
call   1050 <puts@plt>
mov    $0x6,%ebx
mov    0x10(%rsp),%rdi
call   1080 <fclose@plt>
mov    %r13,%rdi
call   1080 <fclose@plt>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    15ce <main+0x38e>
lea    0xca3(%rip),%rdi
jmp    152c <main+0x2ec>
lea    0xc80(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebx
jmp    15d6 <main+0x396>
lea    0xc47(%rip),%rdi
call   1050 <puts@plt>
mov    $0x6,%ebx
jmp    15b4 <main+0x374>
lea    0xad0(%rip),%rdi
call   1130 <perror@plt>
jmp    1570 <main+0x330>
lea    0xaf1(%rip),%rdi
call   1130 <perror@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    $0x2,%ebx
jmp    15d6 <main+0x396>
lea    0xad6(%rip),%rdi
call   1130 <perror@plt>
mov    $0x2,%ebx
xor    %r12d,%r12d
jmp    15b9 <main+0x379>
lea    0xb24(%rip),%rdi
call   1130 <perror@plt>
mov    $0x3,%ebx
xor    %r12d,%r12d
jmp    15b4 <main+0x374>
lea    0xb75(%rip),%rdi
call   1130 <perror@plt>
mov    $0x4,%ebx
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    %r15,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     15d6 <main+0x396>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
call   1040 <unlink@plt>
lea    0xb43(%rip),%rdi
call   1130 <perror@plt>
mov    $0x5,%ebx
jmp    14fd <main+0x2bd>
lea    0xae1(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x3,%edi
call   1150 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c":cdi:o:\00"
@optarg = global i8* null
@.str.1 = [18 x i8] c"Lol what is -%c?\0A\00"
@optopt = global i32 0
@optind = global i32 0
@.str.2 = [26 x i8] c"No input file specified.\0A\00"
@.str.3 = [27 x i8] c"No output file specified.\0A\00"
@.str.4 = [3 x i8] c"rb\00"
@.str.5 = [26 x i8] c"Failed to open input file\00"
@SEEK_END = global i32 0
@.str.6 = [21 x i8] c"Input file size: %u\0A\00"
@SEEK_SET = global i32 0
@.str.7 = [26 x i8] c"Failed to load input file\00"
@.str.8 = [48 x i8] c"Expected output size: %u (%.02f%% of original)\0A\00"
@.str.9 = [26 x i8] c"Expected output size: %u\0A\00"
@.str.10 = [41 x i8] c"Couldn't begin compression/decompression\00"
@.str.11 = [12 x i8] c"Input MD5: \00"
@.str.12 = [36 x i8] c"Failed to get hash for input file.\0A\00"
@.str.13 = [47 x i8] c"FATAL ERROR: Expected output size %u, got %u.\0A\00"
@.str.14 = [3 x i8] c"wb\00"
@.str.15 = [26 x i8] c"Couldn't open output file\00"
@.str.16 = [31 x i8] c"Failed to write to output file\00"
@.str.17 = [13 x i8] c"Output MD5: \00"
@.str.18 = [37 x i8] c"Failed to get hash for output file.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i8* null, i8** %11
store i32* null, i32** %15
store i32* null, i32** %16
store i32 0, i32* %17
br label %18
18: ; preds = %34, %2
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @getopt(i32 %19, i8** %20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %21, i32* %7
%22 = icmp ne i32 %21, -1
br i1 %22, label %23, label %35
23: ; preds = %18
%24 = load i32, i32* %7
switch i32 %24, label %31 [
i32 99, label %25
i32 100, label %26
i32 105, label %27
i32 111, label %29
]
25: ; preds = %23
store i32 1, i32* %6
br label %34
26: ; preds = %23
store i32 0, i32* %6
br label %34
27: ; preds = %23
%28 = load i8*, i8** @optarg
store i8* %28, i8** %8
br label %34
29: ; preds = %23
%30 = load i8*, i8** @optarg
store i8* %30, i8** %9
br label %34
31: ; preds = %23
%32 = load i32, i32* @optopt
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %32)
store i32 1, i32* %3
br label %223
34: ; preds = %29, %27, %26, %25
br label %18
35: ; preds = %18
%36 = load i8*, i8** %8
%37 = icmp ne i8* %36, null
br i1 %37, label %52, label %38
38: ; preds = %35
%39 = load i32, i32* @optind
%40 = load i32, i32* %4
%41 = icmp sge i32 %39, %40
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %17
br label %197
44: ; preds = %38
%45 = load i8**, i8*** %5
%46 = load i32, i32* @optind
%47 = add nsw i32 %46, 1
store i32 %47, i32* @optind
%48 = sext i32 %46 to i64
%49 = getelementptr inbounds i8*, i8** %45, i64 %48
%50 = load i8*, i8** %49
store i8* %50, i8** %8
br label %51
51: ; preds = %44
br label %52
52: ; preds = %51, %35
%53 = load i8*, i8** %9
%54 = icmp ne i8* %53, null
br i1 %54, label %69, label %55
55: ; preds = %52
%56 = load i32, i32* @optind
%57 = load i32, i32* %4
%58 = icmp sge i32 %56, %57
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %17
br label %197
61: ; preds = %55
%62 = load i8**, i8*** %5
%63 = load i32, i32* @optind
%64 = add nsw i32 %63, 1
store i32 %64, i32* @optind
%65 = sext i32 %63 to i64
%66 = getelementptr inbounds i8*, i8** %62, i64 %65
%67 = load i8*, i8** %66
store i8* %67, i8** %9
br label %68
68: ; preds = %61
br label %69
69: ; preds = %68, %52
%70 = load i8*, i8** %8
%71 = call i32* @fopen(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %71, i32** %15
%72 = load i32*, i32** %15
%73 = icmp ne i32* %72, null
br i1 %73, label %76, label %74
74: ; preds = %69
%75 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
store i32 2, i32* %17
br label %197
76: ; preds = %69
%77 = load i32*, i32** %15
%78 = load i32, i32* @SEEK_END
%79 = call i32 @fseek(i32* %77, i32 0, i32 %78)
%80 = load i32*, i32** %15
%81 = call i64 @ftell(i32* %80)
%82 = trunc i64 %81 to i32
store i32 %82, i32* %13
%83 = load i32, i32* %13
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %83)
%85 = load i32*, i32** %15
%86 = load i32, i32* @SEEK_SET
%87 = call i32 @fseek(i32* %85, i32 0, i32 %86)
%88 = load i32, i32* %13
%89 = call i8* @malloc(i32 %88)
store i8* %89, i8** %11
%90 = load i8*, i8** %11
%91 = icmp ne i8* %90, null
br i1 %91, label %94, label %92
92: ; preds = %76
%93 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
store i32 2, i32* %17
br label %197
94: ; preds = %76
%95 = load i8*, i8** %11
%96 = load i32, i32* %13
%97 = call i32 @memset(i8* %95, i32 0, i32 %96)
br label %98
98: ; preds = %94
%99 = load i8*, i8** %11
%100 = load i32, i32* %13
%101 = load i32*, i32** %15
%102 = call i32 @fread(i8* %99, i32 1, i32 %100, i32* %101)
%103 = load i32, i32* %13
%104 = icmp ne i32 %102, %103
br i1 %104, label %105, label %107
105: ; preds = %98
%106 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
store i32 2, i32* %17
br label %197
107: ; preds = %98
%108 = load i32, i32* %6
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %123
110: ; preds = %107
%111 = load i8*, i8** %11
%112 = load i32, i32* %13
%113 = call i32 @rle_get_compressed_size(i8* %111, i32 %112)
store i32 %113, i32* %12
%114 = load i32, i32* %12
%115 = load i32, i32* %12
%116 = uitofp i32 %115 to float
%117 = load i32, i32* %13
%118 = uitofp i32 %117 to float
%119 = fdiv float %116, %118
%120 = fpext float %119 to double
%121 = fmul double %120, 1.000000e+02
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0), i32 %114, double %121)
br label %129
123: ; preds = %107
%124 = load i8*, i8** %11
%125 = load i32, i32* %13
%126 = call i32 @rle_get_decompressed_size(i8* %124, i32 %125)
store i32 %126, i32* %12
%127 = load i32, i32* %12
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %127)
br label %129
129: ; preds = %123, %110
%130 = load i32, i32* %12
%131 = call i8* @malloc(i32 %130)
store i8* %131, i8** %10
%132 = load i8*, i8** %10
%133 = icmp ne i8* %132, null
br i1 %133, label %136, label %134
134: ; preds = %129
%135 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
store i32 3, i32* %17
br label %197
136: ; preds = %129
%137 = load i8*, i8** %10
%138 = load i32, i32* %12
%139 = call i32 @memset(i8* %137, i32 0, i32 %138)
br label %140
140: ; preds = %136
%141 = load i32, i32* %6
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %156
143: ; preds = %140
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%145 = load i8*, i8** %11
%146 = load i32, i32* %13
%147 = call i32 @print_hash(i8* %145, i32 %146)
%148 = icmp ne i32 %147, 0
br i1 %148, label %151, label %149
149: ; preds = %143
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
store i32 6, i32* %17
br label %197
151: ; preds = %143
%152 = load i8*, i8** %11
%153 = load i8*, i8** %10
%154 = load i32, i32* %13
%155 = call i32 @rle_compress(i8* %152, i8* %153, i32 %154)
store i32 %155, i32* %14
br label %161
156: ; preds = %140
%157 = load i8*, i8** %11
%158 = load i8*, i8** %10
%159 = load i32, i32* %13
%160 = call i32 @rle_decompress(i8* %157, i8* %158, i32 %159)
store i32 %160, i32* %14
br label %161
161: ; preds = %156, %151
%162 = load i32, i32* %14
%163 = load i32, i32* %12
%164 = icmp ne i32 %162, %163
br i1 %164, label %165, label %170
165: ; preds = %161
%166 = load i32, i32* %12
%167 = load i32, i32* %14
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0), i32 %166, i32 %167)
%169 = call i32 @exit(i32 3)
unreachable
170: ; preds = %161
%171 = load i8*, i8** %9
%172 = call i32* @fopen(i8* %171, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
store i32* %172, i32** %16
%173 = load i32*, i32** %16
%174 = icmp ne i32* %173, null
br i1 %174, label %177, label %175
175: ; preds = %170
%176 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
store i32 4, i32* %17
br label %197
177: ; preds = %170
%178 = load i8*, i8** %10
%179 = load i32, i32* %14
%180 = load i32*, i32** %16
%181 = call i32 @fwrite(i8* %178, i32 1, i32 %179, i32* %180)
%182 = load i32, i32* %14
%183 = icmp ne i32 %181, %182
br i1 %183, label %184, label %188
184: ; preds = %177
%185 = load i8*, i8** %9
%186 = call i32 @unlink(i8* %185)
%187 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0))
store i32 5, i32* %17
br label %197
188: ; preds = %177
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0))
%190 = load i8*, i8** %10
%191 = load i32, i32* %14
%192 = call i32 @print_hash(i8* %190, i32 %191)
%193 = icmp ne i32 %192, 0
br i1 %193, label %196, label %194
194: ; preds = %188
%195 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.18, i64 0, i64 0))
store i32 6, i32* %17
br label %197
196: ; preds = %188
br label %197
197: ; preds = %196, %194, %184, %175, %149, %134, %105, %92, %74, %59, %42
%198 = load i32*, i32** %15
%199 = icmp ne i32* %198, null
br i1 %199, label %200, label %203
200: ; preds = %197
%201 = load i32*, i32** %15
%202 = call i32 @fclose(i32* %201)
br label %203
203: ; preds = %200, %197
%204 = load i32*, i32** %16
%205 = icmp ne i32* %204, null
br i1 %205, label %206, label %209
206: ; preds = %203
%207 = load i32*, i32** %16
%208 = call i32 @fclose(i32* %207)
br label %209
209: ; preds = %206, %203
%210 = load i8*, i8** %11
%211 = icmp ne i8* %210, null
br i1 %211, label %212, label %215
212: ; preds = %209
%213 = load i8*, i8** %11
%214 = call i32 @free(i8* %213)
br label %215
215: ; preds = %212, %209
%216 = load i8*, i8** %10
%217 = icmp ne i8* %216, null
br i1 %217, label %218, label %221
218: ; preds = %215
%219 = load i8*, i8** %10
%220 = call i32 @free(i8* %219)
br label %221
221: ; preds = %218, %215
%222 = load i32, i32* %17
store i32 %222, i32* %3
br label %223
223: ; preds = %221, %31
%224 = load i32, i32* %3
ret i32 %224
}

LLVM IR (-O2):
@.str = [8 x i8] c":cdi:o:\00"
@optarg = global i8* null
@.str.1 = [18 x i8] c"Lol what is -%c?\0A\00"
@optopt = global i32 0
@optind = global i32 0
@.str.4 = [3 x i8] c"rb\00"
@.str.5 = [26 x i8] c"Failed to open input file\00"
@SEEK_END = global i32 0
@.str.6 = [21 x i8] c"Input file size: %u\0A\00"
@SEEK_SET = global i32 0
@.str.7 = [26 x i8] c"Failed to load input file\00"
@.str.8 = [48 x i8] c"Expected output size: %u (%.02f%% of original)\0A\00"
@.str.9 = [26 x i8] c"Expected output size: %u\0A\00"
@.str.10 = [41 x i8] c"Couldn't begin compression/decompression\00"
@.str.11 = [12 x i8] c"Input MD5: \00"
@.str.13 = [47 x i8] c"FATAL ERROR: Expected output size %u, got %u.\0A\00"
@.str.14 = [3 x i8] c"wb\00"
@.str.15 = [26 x i8] c"Couldn't open output file\00"
@.str.16 = [31 x i8] c"Failed to write to output file\00"
@.str.17 = [13 x i8] c"Output MD5: \00"
@str = [36 x i8] c"Failed to get hash for output file.\00"
@str.19 = [35 x i8] c"Failed to get hash for input file.\00"
@str.20 = [26 x i8] c"No output file specified.\00"
@str.21 = [25 x i8] c"No input file specified.\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %14, %2
%4 = phi i32 [ 1, %2 ], [ %15, %14 ]
%5 = phi i8* [ null, %2 ], [ %8, %14 ]
%6 = phi i8* [ null, %2 ], [ %11, %14 ]
br label %7
7: ; preds = %3, %16
%8 = phi i8* [ %5, %3 ], [ %17, %16 ]
%9 = phi i8* [ %6, %3 ], [ %11, %16 ]
br label %10
10: ; preds = %7, %18
%11 = phi i8* [ %19, %18 ], [ %9, %7 ]
%12 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
switch i32 %12, label %20 [
i32 -1, label %23
i32 99, label %14
i32 100, label %13
i32 105, label %16
i32 111, label %18
]
13: ; preds = %10
br label %14
14: ; preds = %10, %13
%15 = phi i32 [ 0, %13 ], [ 1, %10 ]
br label %3
16: ; preds = %10
%17 = load i8*, i8** @optarg
br label %7
18: ; preds = %10
%19 = load i8*, i8** @optarg
br label %10
20: ; preds = %10
%21 = load i32, i32* @optopt
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %142
23: ; preds = %10
%24 = icmp eq i8* %8, null
br i1 %24, label %25, label %35
25: ; preds = %23
%26 = load i32, i32* @optind
%27 = icmp slt i32 %26, %0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.21, i64 0, i64 0))
br label %142
30: ; preds = %25
%31 = add nsw i32 %26, 1
store i32 %31, i32* @optind
%32 = sext i32 %26 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
br label %35
35: ; preds = %30, %23
%36 = phi i8* [ %8, %23 ], [ %34, %30 ]
%37 = icmp eq i8* %11, null
br i1 %37, label %38, label %48
38: ; preds = %35
%39 = load i32, i32* @optind
%40 = icmp slt i32 %39, %0
br i1 %40, label %43, label %41
41: ; preds = %38
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.20, i64 0, i64 0))
br label %142
43: ; preds = %38
%44 = add nsw i32 %39, 1
store i32 %44, i32* @optind
%45 = sext i32 %39 to i64
%46 = getelementptr inbounds i8*, i8** %1, i64 %45
%47 = load i8*, i8** %46
br label %48
48: ; preds = %43, %35
%49 = phi i8* [ %11, %35 ], [ %47, %43 ]
%50 = tail call i32* @fopen(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %142
54: ; preds = %48
%55 = load i32, i32* @SEEK_END
%56 = tail call i32 @fseek(i32* %50, i32 0, i32 %55)
%57 = tail call i64 @ftell(i32* %50)
%58 = trunc i64 %57 to i32
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %58)
%60 = load i32, i32* @SEEK_SET
%61 = tail call i32 @fseek(i32* %50, i32 0, i32 %60)
%62 = tail call i8* @malloc(i32 %58)
%63 = icmp eq i8* %62, null
br i1 %63, label %129, label %64
64: ; preds = %54
%65 = tail call i32 @memset(i8* %62, i32 0, i32 %58)
%66 = tail call i32 @fread(i8* %62, i32 1, i32 %58, i32* %50)
%67 = icmp eq i32 %66, %58
br i1 %67, label %70, label %68
68: ; preds = %64
%69 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
br label %132
70: ; preds = %64
%71 = icmp eq i32 %4, 0
br i1 %71, label %80, label %72
72: ; preds = %70
%73 = tail call i32 @rle_get_compressed_size(i8* %62, i32 %58)
%74 = uitofp i32 %73 to float
%75 = uitofp i32 %58 to float
%76 = fdiv float %74, %75
%77 = fpext float %76 to double
%78 = fmul double %77, 1.000000e+02
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0), i32 %73, double %78)
br label %83
80: ; preds = %70
%81 = tail call i32 @rle_get_decompressed_size(i8* %62, i32 %58)
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %81)
br label %83
83: ; preds = %80, %72
%84 = phi i32 [ %73, %72 ], [ %81, %80 ]
%85 = tail call i8* @malloc(i32 %84)
%86 = icmp eq i8* %85, null
br i1 %86, label %87, label %89
87: ; preds = %83
%88 = tail call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
br label %132
89: ; preds = %83
%90 = tail call i32 @memset(i8* %85, i32 0, i32 %84)
br i1 %71, label %99, label %91
91: ; preds = %89
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%93 = tail call i32 @print_hash(i8* %62, i32 %58)
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %91
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.19, i64 0, i64 0))
br label %132
97: ; preds = %91
%98 = tail call i32 @rle_compress(i8* %62, i8* %85, i32 %58)
br label %101
99: ; preds = %89
%100 = tail call i32 @rle_decompress(i8* %62, i8* %85, i32 %58)
br label %101
101: ; preds = %99, %97
%102 = phi i32 [ %98, %97 ], [ %100, %99 ]
%103 = icmp eq i32 %102, %84
br i1 %103, label %107, label %104
104: ; preds = %101
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0), i32 %84, i32 %102)
%106 = tail call i32 @exit(i32 3)
unreachable
107: ; preds = %101
%108 = tail call i32* @fopen(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%109 = icmp eq i32* %108, null
br i1 %109, label %110, label %112
110: ; preds = %107
%111 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
br label %132
112: ; preds = %107
%113 = tail call i32 @fwrite(i8* %85, i32 1, i32 %84, i32* %108)
%114 = icmp eq i32 %113, %84
br i1 %114, label %118, label %115
115: ; preds = %112
%116 = tail call i32 @unlink(i8* %49)
%117 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0))
br label %124
118: ; preds = %112
%119 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0))
%120 = tail call i32 @print_hash(i8* %85, i32 %84)
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %118
%123 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %124
124: ; preds = %115, %118, %122
%125 = phi i32 [ 6, %122 ], [ 0, %118 ], [ 5, %115 ]
%126 = tail call i32 @fclose(i32* %50)
%127 = tail call i32 @fclose(i32* %108)
%128 = tail call i32 @free(i8* %62)
br label %138
129: ; preds = %54
%130 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%131 = tail call i32 @fclose(i32* %50)
br label %142
132: ; preds = %68, %110, %95, %87
%133 = phi i8* [ null, %87 ], [ %85, %95 ], [ %85, %110 ], [ null, %68 ]
%134 = phi i32 [ 3, %87 ], [ 6, %95 ], [ 4, %110 ], [ 2, %68 ]
%135 = tail call i32 @fclose(i32* %50)
%136 = tail call i32 @free(i8* %62)
%137 = icmp eq i8* %133, null
br i1 %137, label %142, label %138
138: ; preds = %124, %132
%139 = phi i8* [ %85, %124 ], [ %133, %132 ]
%140 = phi i32 [ %125, %124 ], [ %134, %132 ]
%141 = tail call i32 @free(i8* %139)
br label %142
142: ; preds = %52, %41, %28, %129, %132, %138, %20
%143 = phi i32 [ 1, %20 ], [ %140, %138 ], [ %134, %132 ], [ 2, %129 ], [ 1, %28 ], [ 1, %41 ], [ 2, %52 ]
ret i32 %143
}