#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*/ create_numbers_file(int /*<<< orphan*/ *, char *);
scalar_t__ encode_rle(unsigned char *, unsigned int, unsigned int,
                      unsigned char);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
unsigned char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fread(void *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int next;
  char *file = NULL, *ptr, *out = NULL, *numsfile = NULL, *numsout = NULL;
  FILE *stream, *out_stream;
  int *data;
  short width = 0, height = 0, depth = 0;
  char word[2];
  char byte;
  unsigned int i, pixels, filePos;
  int err;
  unsigned char *fileArr;
  unsigned char nextP;
  unsigned int count;
  int currP;
  int fd;
  int pairs_this_line;
  for (next = 1; next < argc; next++) {
    if (strcmp(argv[next], "-i") == 0)
      file = argv[++next];
    else if (strcmp(argv[next], "-n") == 0)
      numsfile = argv[++next];
    else if (strcmp(argv[next], "-oi") == 0)
      out = argv[++next];
    else if (strcmp(argv[next], "-on") == 0)
      numsout = argv[++next];
  }
  if (!(numsfile || file)) {
    usage();
    exit(1);
  }
  if (!numsfile) {
    printf("\nNo numbers file to process\n");
  } else {
    stream = fopen(numsfile, "r");
    if (!stream) {
      printf("bad nums infile.. bailing.\n");
      exit(1);
    }
    create_numbers_file(stream, numsout);
    fclose(stream);
  }
  if (file == NULL) {
    printf("\nNo image file to process\n");
    exit(1);
  }
  stream = fopen(file, "r");
  if (!stream) {
    printf("bad infile.. bailing.\n");
    exit(1);
  }
  printf("\nReading image file...\n");
  fread((void *)&width, sizeof(short), 1, stream);
  printf("got width: %d\n", width);
  fread((void *)&height, sizeof(short), 1, stream);
  printf("got height: %d\n", height);
  fread((void *)&depth, sizeof(short), 1, stream);
  printf("got depth: %d\n", depth);
  if (!(width && height && depth)) {
    printf("Invalid image file header (width, height, or depth is 0)\n");
    exit(1);
  }
  pixels = width * height;
  if (!(fileArr = (unsigned char *)malloc(pixels))) {
    printf("couldn't malloc fileArr (%d pixels)... bailing.\n", pixels);
    exit(1);
  }
  currP = -1;
  count = 0;
  filePos = 0;
  for (i = 0; i < pixels; i++) {
    nextP = fgetc(stream);
    count++;
    if (nextP == currP) {
      if (count >= 32767) {
        filePos += encode_rle(fileArr, filePos, count, (unsigned char)currP);
        count = 0;
        currP = -1;
      }
    } else {
      if (currP != -1) {
        filePos +=
            encode_rle(fileArr, filePos, count - 1, (unsigned char)currP);
      }
      currP = nextP;
      count = 1;
    }
  }
  if (count > 0) {
    filePos += encode_rle(fileArr, filePos, count, (unsigned char)currP);
  }
  fclose(stream);
  if (out == NULL)
    out = "panic_image.c";
  out_stream = fopen(out, "w");
  if (out_stream == NULL) {
    printf("couldn't open out file.. bailing\n");
    exit(1);
  }
  pairs_this_line = 0;
  fprintf(out_stream, "/* generated c file */\n\n");
  fprintf(out_stream, "static const struct {\n");
  fprintf(out_stream, "  unsigned int 	 pd_width;\n");
  fprintf(out_stream, "  unsigned int 	 pd_height;\n");
  fprintf(
      out_stream,
      "  unsigned int 	 bytes_per_pixel; /* 1: CLUT, 3:RGB, 4:RGBA */\n");
  fprintf(out_stream, "  unsigned char	 image_pixel_data[%#4.2x];\n",
          (filePos));
  fprintf(out_stream, "} panic_dialog = {\n");
  fprintf(out_stream, "\t%d, ", width);
  fprintf(out_stream, "%d, ", height);
  fprintf(out_stream, "1,\n");
  for (i = 0; i < filePos;) {
    fprintf(out_stream, "0x%.2x,0x%.2x", fileArr[i], fileArr[i + 1]);
    i += 2;
    pairs_this_line++;
    if ((fileArr[i - 2] >> 7) == 1) {
      fprintf(out_stream, ",0x%.2x", fileArr[i++]);
      pairs_this_line++;
    }
    if (i >= filePos)
      fprintf(out_stream, "\n};");
    else
      fprintf(out_stream, ", ");
    if (pairs_this_line > 8) {
      fprintf(out_stream, "\n");
      pairs_this_line = 0;
    }
  }
  fclose(out_stream);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movw   $0x0,-0x5a(%rbp)
movw   $0x0,-0x5c(%rbp)
movw   $0x0,-0x5e(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1337 <main+0x177>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdcf(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    125d <main+0x9d>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    1324 <main+0x164>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd93(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    129c <main+0xdc>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
jmp    131f <main+0x15f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd57(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12db <main+0x11b>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
jmp    131a <main+0x15a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd1c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1315 <main+0x155>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
jmp    131a <main+0x15a>
jmp    131f <main+0x15f>
jmp    1324 <main+0x164>
jmp    1329 <main+0x169>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1212 <main+0x52>
cmpq   $0x0,-0x38(%rbp)
jne    135e <main+0x19e>
cmpq   $0x0,-0x20(%rbp)
jne    135e <main+0x19e>
mov    $0x0,%al
call   10c0 <usage@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
cmpq   $0x0,-0x38(%rbp)
jne    137c <main+0x1bc>
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13c9 <main+0x209>
mov    -0x38(%rbp),%rdi
lea    0xca4(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    13b3 <main+0x1f3>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1060 <create_numbers_file@plt>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
cmpq   $0x0,-0x20(%rbp)
jne    13ec <main+0x22c>
lea    0xc6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xc34(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1423 <main+0x263>
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xc51(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5a(%rbp),%rdi
mov    -0x48(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movswl -0x5a(%rbp),%esi
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5c(%rbp),%rdi
mov    -0x48(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movswl -0x5c(%rbp),%esi
lea    0xc26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5e(%rbp),%rdi
mov    -0x48(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movswl -0x5e(%rbp),%esi
lea    0xc0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movswl -0x5a(%rbp),%eax
cmp    $0x0,%eax
je     14d3 <main+0x313>
movswl -0x5c(%rbp),%eax
cmp    $0x0,%eax
je     14d3 <main+0x313>
movswl -0x5e(%rbp),%eax
cmp    $0x0,%eax
jne    14eb <main+0x32b>
lea    0xbe7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movswl -0x5a(%rbp),%eax
movswl -0x5c(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%edi
call   10b0 <malloc@plt>
mov    %rax,-0x80(%rbp)
cmp    $0x0,%rax
jne    152a <main+0x36a>
mov    -0x6c(%rbp),%esi
lea    0xbe2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0xffffffff,-0x8c(%rbp)
ff ff ff
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jae    163a <main+0x47a>
mov    -0x48(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %al,-0x81(%rbp)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
movzbl -0x81(%rbp),%eax
cmp    -0x8c(%rbp),%eax
jne    15d9 <main+0x419>
cmpl   $0x7fff,-0x88(%rbp)
jb     15d4 <main+0x414>
mov    -0x80(%rbp),%rdi
mov    -0x70(%rbp),%esi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%eax
movzbl %al,%ecx
call   1090 <encode_rle@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x70(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0xffffffff,-0x8c(%rbp)
ff ff ff
jmp    1627 <main+0x467>
cmpl   $0xffffffff,-0x8c(%rbp)
je     1610 <main+0x450>
mov    -0x80(%rbp),%rdi
mov    -0x70(%rbp),%esi
mov    -0x88(%rbp),%edx
sub    $0x1,%edx
mov    -0x8c(%rbp),%eax
movzbl %al,%ecx
call   1090 <encode_rle@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x70(%rbp)
movzbl -0x81(%rbp),%eax
mov    %eax,-0x8c(%rbp)
movl   $0x1,-0x88(%rbp)
jmp    162c <main+0x46c>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    154c <main+0x38c>
cmpl   $0x0,-0x88(%rbp)
jbe    166e <main+0x4ae>
mov    -0x80(%rbp),%rdi
mov    -0x70(%rbp),%esi
mov    -0x88(%rbp),%edx
mov    -0x8c(%rbp),%eax
movzbl %al,%ecx
call   1090 <encode_rle@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x70(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
cmpq   $0x0,-0x30(%rbp)
jne    168d <main+0x4cd>
lea    0xaa3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xaa2(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    16c4 <main+0x504>
lea    0xa89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x0,-0x94(%rbp)
mov    -0x50(%rbp),%rdi
lea    0xa85(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
lea    0xa8c(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
lea    0xa91(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
lea    0xa9b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
lea    0xaa6(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x70(%rbp),%edx
lea    0xad1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
lea    0xaeb(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
movswl -0x5a(%rbp),%edx
lea    0xae9(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
movswl -0x5c(%rbp),%edx
lea    0xad4(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
lea    0xac7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x70(%rbp),%eax
jae    189a <main+0x6da>
mov    -0x50(%rbp),%rdi
mov    -0x80(%rbp),%rax
mov    -0x68(%rbp),%ecx
movzbl (%rax,%rcx,1),%edx
mov    -0x80(%rbp),%rax
mov    -0x68(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%ecx
lea    0xa8b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x68(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x68(%rbp)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x68(%rbp),%ecx
sub    $0x2,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
sar    $0x7,%eax
cmp    $0x1,%eax
jne    1837 <main+0x677>
mov    -0x50(%rbp),%rdi
mov    -0x80(%rbp),%rax
mov    -0x68(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x68(%rbp)
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
lea    0xa36(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x70(%rbp),%eax
jb     185a <main+0x69a>
mov    -0x50(%rbp),%rdi
lea    0xa11(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    186c <main+0x6ac>
mov    -0x50(%rbp),%rdi
lea    0x9e5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpl   $0x8,-0x94(%rbp)
jle    1895 <main+0x6d5>
mov    -0x50(%rbp),%rdi
lea    0x8f1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x0,-0x94(%rbp)
jmp    1794 <main+0x5d4>
mov    -0x50(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movw   $0x0,0x6(%rsp)
movw   $0x0,0x4(%rsp)
movw   $0x0,0x2(%rsp)
cmp    $0x2,%edi
jl     12f8 <main+0x108>
mov    %rsi,%rbp
mov    %edi,%ebx
mov    $0x1,%r14d
xor    %r15d,%r15d
lea    0xdcf(%rip),%r13
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    1267 <main+0x77>
nopl   0x0(%rax,%rax,1)
lea    0x1(%r12),%r14d
mov    0x8(%rbp,%r12,8),%r15
add    $0x1,%r14d
cmp    %ebx,%r14d
jge    1310 <main+0x120>
movslq %r14d,%r12
mov    0x0(%rbp,%r12,8),%rdi
mov    %r13,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1250 <main+0x60>
mov    0x0(%rbp,%r12,8),%rdi
lea    0xd7b(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12d0 <main+0xe0>
mov    0x0(%rbp,%r12,8),%rdi
lea    0xd68(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12e4 <main+0xf4>
mov    0x0(%rbp,%r12,8),%rdi
lea    0xd56(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    125a <main+0x6a>
lea    0x1(%r12),%r14d
mov    0x8(%rbp,%r12,8),%rax
mov    %rax,0x10(%rsp)
jmp    125a <main+0x6a>
nop
lea    0x1(%r12),%r14d
mov    0x8(%rbp,%r12,8),%rax
mov    %rax,0x8(%rsp)
jmp    125a <main+0x6a>
lea    0x1(%r12),%r14d
mov    0x8(%rbp,%r12,8),%rax
mov    %rax,0x18(%rsp)
jmp    125a <main+0x6a>
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %r15d,%r15d
mov    0x8(%rsp),%rdi
mov    %rdi,%rax
or     %r15,%rax
je     1754 <main+0x564>
test   %rdi,%rdi
je     1736 <main+0x546>
lea    0xcdd(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     179a <main+0x5aa>
mov    %rax,%rbx
mov    %rax,%rdi
mov    0x10(%rsp),%rsi
call   1070 <create_numbers_file@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
test   %r15,%r15
je     174b <main+0x55b>
lea    0xca7(%rip),%rsi
mov    %r15,%rdi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1765 <main+0x575>
mov    %rax,%r12
lea    0xe34(%rip),%rdi
call   1030 <puts@plt>
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1040 <fread@plt>
movswl 0x6(%rsp),%r14d
lea    0xc65(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1040 <fread@plt>
movzwl 0x4(%rsp),%r15d
movswl %r15w,%ebx
lea    0xc42(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x2(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1040 <fread@plt>
movzwl 0x2(%rsp),%ebp
movswl %bp,%esi
lea    0xc23(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r14d,%r14d
je     176e <main+0x57e>
test   %r15w,%r15w
je     176e <main+0x57e>
test   %bp,%bp
je     176e <main+0x57e>
mov    %r12,0x10(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r14d,0x24(%rsp)
imul   %r14d,%ebx
mov    %ebx,%edi
call   10d0 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1777 <main+0x587>
cmp    $0x2,%ebx
mov    $0x1,%r15d
cmovae %ebx,%r15d
xor    %r14d,%r14d
mov    $0xffffffff,%r13d
xor    %ebx,%ebx
xor    %r12d,%r12d
jmp    1492 <main+0x2a2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%r14d
mov    %ebp,%r13d
add    $0x1,%r12d
cmp    %r15d,%r12d
je     150d <main+0x31d>
mov    0x10(%rsp),%rdi
call   1080 <fgetc@plt>
movzbl %al,%ebp
cmp    %ebp,%r13d
jne    14c0 <main+0x2d0>
lea    0x1(%r14),%edx
cmp    $0x7ffd,%r14d
ja     14df <main+0x2ef>
mov    %edx,%r14d
jmp    1489 <main+0x299>
cs nopw 0x0(%rax,%rax,1)
cmp    $0xffffffff,%r13d
je     1480 <main+0x290>
movzbl %r13b,%ecx
mov    0x8(%rsp),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   10b0 <encode_rle@plt>
add    %ebx,%eax
mov    %eax,%ebx
jmp    1480 <main+0x290>
movzbl %r13b,%ecx
mov    0x8(%rsp),%rdi
mov    %ebx,%esi
call   10b0 <encode_rle@plt>
mov    %rax,%rbp
add    %ebx,%ebp
add    $0x1,%r12d
mov    $0xffffffff,%r13d
mov    $0x0,%r14d
mov    %ebp,%ebx
cmp    %r15d,%r12d
jne    1492 <main+0x2a2>
jmp    1525 <main+0x335>
movzbl %r13b,%ecx
mov    0x8(%rsp),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   10b0 <encode_rle@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x18(%rsp),%rax
test   %rax,%rax
lea    0xb31(%rip),%rdi
cmovne %rax,%rdi
lea    0xb34(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1791 <main+0x5a1>
mov    %rax,%r13
lea    0xb1e(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1110 <fwrite@plt>
lea    0xb1e(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
lea    0xb1c(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
lea    0xb1f(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
lea    0xb23(%rip),%rdi
mov    $0x3f,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
lea    0xb4a(%rip),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
lea    0xb63(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
lea    0xb5e(%rip),%rsi
mov    %r13,%rdi
mov    0x24(%rsp),%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
lea    0xb4a(%rip),%rsi
mov    %r13,%rdi
mov    0x20(%rsp),%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
lea    0xb3a(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
test   %ebp,%ebp
je     171d <main+0x52d>
xor    %r15d,%r15d
xor    %r12d,%r12d
mov    0x8(%rsp),%r14
jmp    1669 <main+0x479>
nopl   0x0(%rax,%rax,1)
cmp    %ebp,%r12d
jae    171d <main+0x52d>
mov    %r12d,%ebx
movzbl (%r14,%rbx,1),%edx
movzbl 0x1(%r14,%rbx,1),%ecx
mov    %r13,%rdi
lea    0xaf1(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
lea    0x2(%r12),%eax
cmpb   $0x0,(%r14,%rbx,1)
js     16c0 <main+0x4d0>
add    $0x1,%r15d
mov    %eax,%r12d
cmp    %ebp,%r12d
jae    16e5 <main+0x4f5>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xaba(%rip),%rdi
jmp    16f6 <main+0x506>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x3,%r12d
mov    %eax,%eax
movzbl (%r14,%rax,1),%edx
mov    %r13,%rdi
lea    0xaa3(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
add    $0x2,%r15d
cmp    %ebp,%r12d
jb     16a0 <main+0x4b0>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xa8a(%rip),%rdi
mov    %r13,%rcx
call   1110 <fwrite@plt>
cmp    $0x9,%r15d
jl     1660 <main+0x470>
mov    $0xa,%edi
mov    %r13,%rsi
call   1090 <fputc@plt>
xor    %r15d,%r15d
jmp    1660 <main+0x470>
mov    %r13,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa47(%rip),%rdi
call   1030 <puts@plt>
test   %r15,%r15
jne    1360 <main+0x170>
lea    0xad5(%rip),%rdi
jmp    17a1 <main+0x5b1>
xor    %eax,%eax
call   10e0 <usage@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xa34(%rip),%rdi
jmp    17a1 <main+0x5b1>
lea    0xa58(%rip),%rdi
jmp    17a1 <main+0x5b1>
lea    0x8c0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xa6e(%rip),%rdi
jmp    17a1 <main+0x5b1>
lea    0xaa0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-i\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [4 x i8] c"-oi\00"
@.str.3 = [4 x i8] c"-on\00"
@.str.4 = [29 x i8] c"\0ANo numbers file to process\0A\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [28 x i8] c"bad nums infile.. bailing.\0A\00"
@.str.7 = [27 x i8] c"\0ANo image file to process\0A\00"
@.str.8 = [23 x i8] c"bad infile.. bailing.\0A\00"
@.str.9 = [24 x i8] c"\0AReading image file...\0A\00"
@.str.10 = [15 x i8] c"got width: %d\0A\00"
@.str.11 = [16 x i8] c"got height: %d\0A\00"
@.str.12 = [15 x i8] c"got depth: %d\0A\00"
@.str.13 = [58 x i8] c"Invalid image file header (width, height, or depth is 0)\0A\00"
@.str.14 = [49 x i8] c"couldn't malloc fileArr (%d pixels)... bailing.\0A\00"
@.str.15 = [14 x i8] c"panic_image.c\00"
@.str.16 = [2 x i8] c"w\00"
@.str.17 = [34 x i8] c"couldn't open out file.. bailing\0A\00"
@.str.18 = [25 x i8] c"/* generated c file */\0A\0A\00"
@.str.19 = [23 x i8] c"static const struct {\0A\00"
@.str.20 = [28 x i8] c" unsigned int \09 pd_width;\0A\00"
@.str.21 = [29 x i8] c" unsigned int \09 pd_height;\0A\00"
@.str.22 = [64 x i8] c" unsigned int \09 bytes_per_pixel; /* 1: CLUT, 3:RGB, 4:RGBA */\0A\00"
@.str.23 = [44 x i8] c" unsigned char\09 image_pixel_data[%.2x];\0A\00"
@.str.24 = [20 x i8] c"} panic_dialog = {\0A\00"
@.str.25 = [6 x i8] c"\09%d, \00"
@.str.26 = [5 x i8] c"%d, \00"
@.str.27 = [4 x i8] c"1,\0A\00"
@.str.28 = [14 x i8] c"0x%.2x,0x%.2x\00"
@.str.29 = [8 x i8] c",0x%.2x\00"
@.str.30 = [4 x i8] c"\0A};\00"
@.str.31 = [3 x i8] c", \00"
@.str.32 = [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 i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i16
%16 = alloca i16
%17 = alloca i16
%18 = alloca [2 x i8]
%19 = alloca i8
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i8*
%25 = alloca i8
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
store i8* null, i8** %9
store i8* null, i8** %10
store i8* null, i8** %11
store i16 0, i16* %15
store i16 0, i16* %16
store i16 0, i16* %17
store i32 1, i32* %6
br label %30
30: ; preds = %98, %2
%31 = load i32, i32* %6
%32 = load i32, i32* %4
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %101
34: ; preds = %30
%35 = load i8**, i8*** %5
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %34
%43 = load i8**, i8*** %5
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %43, i64 %46
%48 = load i8*, i8** %47
store i8* %48, i8** %7
br label %97
49: ; preds = %34
%50 = load i8**, i8*** %5
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %64
57: ; preds = %49
%58 = load i8**, i8*** %5
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %58, i64 %61
%63 = load i8*, i8** %62
store i8* %63, i8** %10
br label %96
64: ; preds = %49
%65 = load i8**, i8*** %5
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %65, i64 %67
%69 = load i8*, i8** %68
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %79
72: ; preds = %64
%73 = load i8**, i8*** %5
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 1
store i32 %75, i32* %6
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %73, i64 %76
%78 = load i8*, i8** %77
store i8* %78, i8** %9
br label %95
79: ; preds = %64
%80 = load i8**, i8*** %5
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = call i64 @strcmp(i8* %84, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %94
87: ; preds = %79
%88 = load i8**, i8*** %5
%89 = load i32, i32* %6
%90 = add nsw i32 %89, 1
store i32 %90, i32* %6
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8*, i8** %88, i64 %91
%93 = load i8*, i8** %92
store i8* %93, i8** %11
br label %94
94: ; preds = %87, %79
br label %95
95: ; preds = %94, %72
br label %96
96: ; preds = %95, %57
br label %97
97: ; preds = %96, %42
br label %98
98: ; preds = %97
%99 = load i32, i32* %6
%100 = add nsw i32 %99, 1
store i32 %100, i32* %6
br label %30
101: ; preds = %30
%102 = load i8*, i8** %10
%103 = icmp ne i8* %102, null
br i1 %103, label %110, label %104
104: ; preds = %101
%105 = load i8*, i8** %7
%106 = icmp ne i8* %105, null
br i1 %106, label %110, label %107
107: ; preds = %104
%108 = call i32 (...) @usage()
%109 = call i32 @exit(i32 1)
unreachable
110: ; preds = %104, %101
%111 = load i8*, i8** %10
%112 = icmp ne i8* %111, null
br i1 %112, label %115, label %113
113: ; preds = %110
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %129
115: ; preds = %110
%116 = load i8*, i8** %10
%117 = call i32* @fopen(i8* %116, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %117, i32** %12
%118 = load i32*, i32** %12
%119 = icmp ne i32* %118, null
br i1 %119, label %123, label %120
120: ; preds = %115
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%122 = call i32 @exit(i32 1)
unreachable
123: ; preds = %115
%124 = load i32*, i32** %12
%125 = load i8*, i8** %11
%126 = call i32 @create_numbers_file(i32* %124, i8* %125)
%127 = load i32*, i32** %12
%128 = call i32 @fclose(i32* %127)
br label %129
129: ; preds = %123, %113
%130 = load i8*, i8** %7
%131 = icmp eq i8* %130, null
br i1 %131, label %132, label %135
132: ; preds = %129
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%134 = call i32 @exit(i32 1)
unreachable
135: ; preds = %129
%136 = load i8*, i8** %7
%137 = call i32* @fopen(i8* %136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %137, i32** %12
%138 = load i32*, i32** %12
%139 = icmp ne i32* %138, null
br i1 %139, label %143, label %140
140: ; preds = %135
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%142 = call i32 @exit(i32 1)
unreachable
143: ; preds = %135
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%145 = bitcast i16* %15 to i8*
%146 = load i32*, i32** %12
%147 = call i32 @fread(i8* %145, i32 2, i32 1, i32* %146)
%148 = load i16, i16* %15
%149 = sext i16 %148 to i32
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %149)
%151 = bitcast i16* %16 to i8*
%152 = load i32*, i32** %12
%153 = call i32 @fread(i8* %151, i32 2, i32 1, i32* %152)
%154 = load i16, i16* %16
%155 = sext i16 %154 to i32
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 %155)
%157 = bitcast i16* %17 to i8*
%158 = load i32*, i32** %12
%159 = call i32 @fread(i8* %157, i32 2, i32 1, i32* %158)
%160 = load i16, i16* %17
%161 = sext i16 %160 to i32
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 %161)
%163 = load i16, i16* %15
%164 = sext i16 %163 to i32
%165 = icmp ne i32 %164, 0
br i1 %165, label %166, label %174
166: ; preds = %143
%167 = load i16, i16* %16
%168 = sext i16 %167 to i32
%169 = icmp ne i32 %168, 0
br i1 %169, label %170, label %174
170: ; preds = %166
%171 = load i16, i16* %17
%172 = sext i16 %171 to i32
%173 = icmp ne i32 %172, 0
br i1 %173, label %177, label %174
174: ; preds = %170, %166, %143
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.13, i64 0, i64 0))
%176 = call i32 @exit(i32 1)
unreachable
177: ; preds = %170
%178 = load i16, i16* %15
%179 = sext i16 %178 to i32
%180 = load i16, i16* %16
%181 = sext i16 %180 to i32
%182 = mul nsw i32 %179, %181
store i32 %182, i32* %21
%183 = load i32, i32* %21
%184 = call i64 @malloc(i32 %183)
%185 = inttoptr i64 %184 to i8*
store i8* %185, i8** %24
%186 = icmp ne i8* %185, null
br i1 %186, label %191, label %187
187: ; preds = %177
%188 = load i32, i32* %21
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0), i32 %188)
%190 = call i32 @exit(i32 1)
unreachable
191: ; preds = %177
store i32 -1, i32* %27
store i32 0, i32* %26
store i32 0, i32* %22
store i32 0, i32* %20
br label %192
192: ; preds = %239, %191
%193 = load i32, i32* %20
%194 = load i32, i32* %21
%195 = icmp ult i32 %193, %194
br i1 %195, label %196, label %242
196: ; preds = %192
%197 = load i32*, i32** %12
%198 = call zeroext i8 @fgetc(i32* %197)
store i8 %198, i8* %25
%199 = load i32, i32* %26
%200 = add i32 %199, 1
store i32 %200, i32* %26
%201 = load i8, i8* %25
%202 = zext i8 %201 to i32
%203 = load i32, i32* %27
%204 = icmp eq i32 %202, %203
br i1 %204, label %205, label %220
205: ; preds = %196
%206 = load i32, i32* %26
%207 = icmp uge i32 %206, 32767
br i1 %207, label %208, label %219
208: ; preds = %205
%209 = load i8*, i8** %24
%210 = load i32, i32* %22
%211 = load i32, i32* %26
%212 = load i32, i32* %27
%213 = trunc i32 %212 to i8
%214 = call i64 @encode_rle(i8* %209, i32 %210, i32 %211, i8 zeroext %213)
%215 = load i32, i32* %22
%216 = zext i32 %215 to i64
%217 = add nsw i64 %216, %214
%218 = trunc i64 %217 to i32
store i32 %218, i32* %22
store i32 0, i32* %26
store i32 -1, i32* %27
br label %219
219: ; preds = %208, %205
br label %238
220: ; preds = %196
%221 = load i32, i32* %27
%222 = icmp ne i32 %221, -1
br i1 %222, label %223, label %235
223: ; preds = %220
%224 = load i8*, i8** %24
%225 = load i32, i32* %22
%226 = load i32, i32* %26
%227 = sub i32 %226, 1
%228 = load i32, i32* %27
%229 = trunc i32 %228 to i8
%230 = call i64 @encode_rle(i8* %224, i32 %225, i32 %227, i8 zeroext %229)
%231 = load i32, i32* %22
%232 = zext i32 %231 to i64
%233 = add nsw i64 %232, %230
%234 = trunc i64 %233 to i32
store i32 %234, i32* %22
br label %235
235: ; preds = %223, %220
%236 = load i8, i8* %25
%237 = zext i8 %236 to i32
store i32 %237, i32* %27
store i32 1, i32* %26
br label %238
238: ; preds = %235, %219
br label %239
239: ; preds = %238
%240 = load i32, i32* %20
%241 = add i32 %240, 1
store i32 %241, i32* %20
br label %192
242: ; preds = %192
%243 = load i32, i32* %26
%244 = icmp ugt i32 %243, 0
br i1 %244, label %245, label %256
245: ; preds = %242
%246 = load i8*, i8** %24
%247 = load i32, i32* %22
%248 = load i32, i32* %26
%249 = load i32, i32* %27
%250 = trunc i32 %249 to i8
%251 = call i64 @encode_rle(i8* %246, i32 %247, i32 %248, i8 zeroext %250)
%252 = load i32, i32* %22
%253 = zext i32 %252 to i64
%254 = add nsw i64 %253, %251
%255 = trunc i64 %254 to i32
store i32 %255, i32* %22
br label %256
256: ; preds = %245, %242
%257 = load i32*, i32** %12
%258 = call i32 @fclose(i32* %257)
%259 = load i8*, i8** %9
%260 = icmp eq i8* %259, null
br i1 %260, label %261, label %262
261: ; preds = %256
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i8** %9
br label %262
262: ; preds = %261, %256
%263 = load i8*, i8** %9
%264 = call i32* @fopen(i8* %263, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32* %264, i32** %13
%265 = load i32*, i32** %13
%266 = icmp eq i32* %265, null
br i1 %266, label %267, label %270
267: ; preds = %262
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0))
%269 = call i32 @exit(i32 1)
unreachable
270: ; preds = %262
store i32 0, i32* %29
%271 = load i32*, i32** %13
%272 = call i32 (i32*, i8*, ...) @fprintf(i32* %271, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%273 = load i32*, i32** %13
%274 = call i32 (i32*, i8*, ...) @fprintf(i32* %273, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
%275 = load i32*, i32** %13
%276 = call i32 (i32*, i8*, ...) @fprintf(i32* %275, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0))
%277 = load i32*, i32** %13
%278 = call i32 (i32*, i8*, ...) @fprintf(i32* %277, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.21, i64 0, i64 0))
%279 = load i32*, i32** %13
%280 = call i32 (i32*, i8*, ...) @fprintf(i32* %279, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.22, i64 0, i64 0))
%281 = load i32*, i32** %13
%282 = load i32, i32* %22
%283 = call i32 (i32*, i8*, ...) @fprintf(i32* %281, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.23, i64 0, i64 0), i32 %282)
%284 = load i32*, i32** %13
%285 = call i32 (i32*, i8*, ...) @fprintf(i32* %284, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.24, i64 0, i64 0))
%286 = load i32*, i32** %13
%287 = load i16, i16* %15
%288 = sext i16 %287 to i32
%289 = call i32 (i32*, i8*, ...) @fprintf(i32* %286, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), i32 %288)
%290 = load i32*, i32** %13
%291 = load i16, i16* %16
%292 = sext i16 %291 to i32
%293 = call i32 (i32*, i8*, ...) @fprintf(i32* %290, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0), i32 %292)
%294 = load i32*, i32** %13
%295 = call i32 (i32*, i8*, ...) @fprintf(i32* %294, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0))
store i32 0, i32* %20
br label %296
296: ; preds = %357, %270
%297 = load i32, i32* %20
%298 = load i32, i32* %22
%299 = icmp ult i32 %297, %298
br i1 %299, label %300, label %358
300: ; preds = %296
%301 = load i32*, i32** %13
%302 = load i8*, i8** %24
%303 = load i32, i32* %20
%304 = zext i32 %303 to i64
%305 = getelementptr inbounds i8, i8* %302, i64 %304
%306 = load i8, i8* %305
%307 = zext i8 %306 to i32
%308 = load i8*, i8** %24
%309 = load i32, i32* %20
%310 = add i32 %309, 1
%311 = zext i32 %310 to i64
%312 = getelementptr inbounds i8, i8* %308, i64 %311
%313 = load i8, i8* %312
%314 = zext i8 %313 to i32
%315 = call i32 (i32*, i8*, ...) @fprintf(i32* %301, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), i32 %307, i32 %314)
%316 = load i32, i32* %20
%317 = add i32 %316, 2
store i32 %317, i32* %20
%318 = load i32, i32* %29
%319 = add nsw i32 %318, 1
store i32 %319, i32* %29
%320 = load i8*, i8** %24
%321 = load i32, i32* %20
%322 = sub i32 %321, 2
%323 = zext i32 %322 to i64
%324 = getelementptr inbounds i8, i8* %320, i64 %323
%325 = load i8, i8* %324
%326 = zext i8 %325 to i32
%327 = ashr i32 %326, 7
%328 = icmp eq i32 %327, 1
br i1 %328, label %329, label %341
329: ; preds = %300
%330 = load i32*, i32** %13
%331 = load i8*, i8** %24
%332 = load i32, i32* %20
%333 = add i32 %332, 1
store i32 %333, i32* %20
%334 = zext i32 %332 to i64
%335 = getelementptr inbounds i8, i8* %331, i64 %334
%336 = load i8, i8* %335
%337 = zext i8 %336 to i32
%338 = call i32 (i32*, i8*, ...) @fprintf(i32* %330, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.29, i64 0, i64 0), i32 %337)
%339 = load i32, i32* %29
%340 = add nsw i32 %339, 1
store i32 %340, i32* %29
br label %341
341: ; preds = %329, %300
%342 = load i32, i32* %20
%343 = load i32, i32* %22
%344 = icmp uge i32 %342, %343
br i1 %344, label %345, label %348
345: ; preds = %341
%346 = load i32*, i32** %13
%347 = call i32 (i32*, i8*, ...) @fprintf(i32* %346, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0))
br label %351
348: ; preds = %341
%349 = load i32*, i32** %13
%350 = call i32 (i32*, i8*, ...) @fprintf(i32* %349, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.31, i64 0, i64 0))
br label %351
351: ; preds = %348, %345
%352 = load i32, i32* %29
%353 = icmp sgt i32 %352, 8
br i1 %353, label %354, label %357
354: ; preds = %351
%355 = load i32*, i32** %13
%356 = call i32 (i32*, i8*, ...) @fprintf(i32* %355, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.32, i64 0, i64 0))
store i32 0, i32* %29
br label %357
357: ; preds = %354, %351
br label %296
358: ; preds = %296
%359 = load i32*, i32** %13
%360 = call i32 @fclose(i32* %359)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-i\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [4 x i8] c"-oi\00"
@.str.3 = [4 x i8] c"-on\00"
@.str.5 = [2 x i8] c"r\00"
@.str.10 = [15 x i8] c"got width: %d\0A\00"
@.str.11 = [16 x i8] c"got height: %d\0A\00"
@.str.12 = [15 x i8] c"got depth: %d\0A\00"
@.str.14 = [49 x i8] c"couldn't malloc fileArr (%d pixels)... bailing.\0A\00"
@.str.15 = [14 x i8] c"panic_image.c\00"
@.str.16 = [2 x i8] c"w\00"
@.str.18 = [25 x i8] c"/* generated c file */\0A\0A\00"
@.str.19 = [23 x i8] c"static const struct {\0A\00"
@.str.20 = [28 x i8] c" unsigned int \09 pd_width;\0A\00"
@.str.21 = [29 x i8] c" unsigned int \09 pd_height;\0A\00"
@.str.22 = [64 x i8] c" unsigned int \09 bytes_per_pixel; /* 1: CLUT, 3:RGB, 4:RGBA */\0A\00"
@.str.23 = [44 x i8] c" unsigned char\09 image_pixel_data[%.2x];\0A\00"
@.str.24 = [20 x i8] c"} panic_dialog = {\0A\00"
@.str.25 = [6 x i8] c"\09%d, \00"
@.str.26 = [5 x i8] c"%d, \00"
@.str.27 = [4 x i8] c"1,\0A\00"
@.str.28 = [14 x i8] c"0x%.2x,0x%.2x\00"
@.str.29 = [8 x i8] c",0x%.2x\00"
@.str.30 = [4 x i8] c"\0A};\00"
@.str.31 = [3 x i8] c", \00"
@str = [28 x i8] c"\0ANo numbers file to process\00"
@str.33 = [22 x i8] c"bad infile.. bailing.\00"
@str.34 = [23 x i8] c"\0AReading image file...\00"
@str.35 = [57 x i8] c"Invalid image file header (width, height, or depth is 0)\00"
@str.36 = [33 x i8] c"couldn't open out file.. bailing\00"
@str.37 = [26 x i8] c"\0ANo image file to process\00"
@str.38 = [27 x i8] c"bad nums infile.. bailing.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = bitcast i16* %3 to i8*
store i16 0, i16* %3
%7 = bitcast i16* %4 to i8*
store i16 0, i16* %4
%8 = bitcast i16* %5 to i8*
store i16 0, i16* %5
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %61
10: ; preds = %2, %53
%11 = phi i32 [ %59, %53 ], [ 1, %2 ]
%12 = phi i8* [ %57, %53 ], [ null, %2 ]
%13 = phi i8* [ %56, %53 ], [ null, %2 ]
%14 = phi i8* [ %55, %53 ], [ null, %2 ]
%15 = phi i8* [ %54, %53 ], [ null, %2 ]
%16 = sext i32 %11 to i64
%17 = getelementptr inbounds i8*, i8** %1, i64 %16
%18 = load i8*, i8** %17
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %10
%22 = add nsw i32 %11, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %1, i64 %23
%25 = load i8*, i8** %24
br label %53
26: ; preds = %10
%27 = load i8*, i8** %17
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %26
%31 = add nsw i32 %11, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
br label %53
35: ; preds = %26
%36 = load i8*, i8** %17
%37 = tail call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %35
%40 = add nsw i32 %11, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %1, i64 %41
%43 = load i8*, i8** %42
br label %53
44: ; preds = %35
%45 = load i8*, i8** %17
%46 = tail call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %44
%49 = add nsw i32 %11, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %1, i64 %50
%52 = load i8*, i8** %51
br label %53
53: ; preds = %21, %39, %48, %44, %30
%54 = phi i8* [ %15, %21 ], [ %15, %30 ], [ %15, %39 ], [ %52, %48 ], [ %15, %44 ]
%55 = phi i8* [ %14, %21 ], [ %34, %30 ], [ %14, %39 ], [ %14, %48 ], [ %14, %44 ]
%56 = phi i8* [ %13, %21 ], [ %13, %30 ], [ %43, %39 ], [ %13, %48 ], [ %13, %44 ]
%57 = phi i8* [ %25, %21 ], [ %12, %30 ], [ %12, %39 ], [ %12, %48 ], [ %12, %44 ]
%58 = phi i32 [ %22, %21 ], [ %31, %30 ], [ %40, %39 ], [ %49, %48 ], [ %11, %44 ]
%59 = add nsw i32 %58, 1
%60 = icmp slt i32 %59, %0
br i1 %60, label %10, label %61
61: ; preds = %53, %2
%62 = phi i8* [ null, %2 ], [ %54, %53 ]
%63 = phi i8* [ null, %2 ], [ %55, %53 ]
%64 = phi i8* [ null, %2 ], [ %56, %53 ]
%65 = phi i8* [ null, %2 ], [ %57, %53 ]
%66 = icmp ne i8* %63, null
%67 = icmp ne i8* %65, null
%68 = select i1 %66, i1 true, i1 %67
br i1 %68, label %72, label %69
69: ; preds = %61
%70 = tail call i32 (...) @usage()
%71 = tail call i32 @exit(i32 1)
unreachable
72: ; preds = %61
br i1 %66, label %75, label %73
73: ; preds = %72
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %84
75: ; preds = %72
%76 = tail call i32* @fopen(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%77 = icmp eq i32* %76, null
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.38, i64 0, i64 0))
%80 = tail call i32 @exit(i32 1)
unreachable
81: ; preds = %75
%82 = tail call i32 @create_numbers_file(i32* %76, i8* %62)
%83 = tail call i32 @fclose(i32* %76)
br label %84
84: ; preds = %81, %73
%85 = icmp eq i8* %65, null
br i1 %85, label %86, label %89
86: ; preds = %84
%87 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.37, i64 0, i64 0))
%88 = tail call i32 @exit(i32 1)
unreachable
89: ; preds = %84
%90 = tail call i32* @fopen(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%91 = icmp eq i32* %90, null
br i1 %91, label %92, label %95
92: ; preds = %89
%93 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.33, i64 0, i64 0))
%94 = tail call i32 @exit(i32 1)
unreachable
95: ; preds = %89
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.34, i64 0, i64 0))
%97 = call i32 @fread(i8* %6, i32 2, i32 1, i32* %90)
%98 = load i16, i16* %3
%99 = sext i16 %98 to i32
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %99)
%101 = call i32 @fread(i8* %7, i32 2, i32 1, i32* %90)
%102 = load i16, i16* %4
%103 = sext i16 %102 to i32
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 %103)
%105 = call i32 @fread(i8* %8, i32 2, i32 1, i32* %90)
%106 = load i16, i16* %5
%107 = sext i16 %106 to i32
%108 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 %107)
%109 = icmp ne i16 %98, 0
%110 = icmp ne i16 %102, 0
%111 = select i1 %109, i1 %110, i1 false
%112 = icmp ne i16 %106, 0
%113 = select i1 %111, i1 %112, i1 false
br i1 %113, label %117, label %114
114: ; preds = %95
%115 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.35, i64 0, i64 0))
%116 = tail call i32 @exit(i32 1)
unreachable
117: ; preds = %95
%118 = mul nsw i32 %103, %99
%119 = tail call i64 @malloc(i32 %118)
%120 = inttoptr i64 %119 to i8*
%121 = icmp eq i64 %119, 0
br i1 %121, label %124, label %122
122: ; preds = %117
%123 = call i32 @llvm.umax.i32(i32 %118, i32 1)
br label %127
124: ; preds = %117
%125 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0), i32 %118)
%126 = tail call i32 @exit(i32 1)
unreachable
127: ; preds = %151, %122
%128 = phi i32 [ -1, %122 ], [ %152, %151 ]
%129 = phi i32 [ 0, %122 ], [ %153, %151 ]
%130 = phi i32 [ 0, %122 ], [ %154, %151 ]
%131 = phi i32 [ 0, %122 ], [ %155, %151 ]
%132 = tail call zeroext i8 @fgetc(i32* %90)
%133 = add nuw nsw i32 %129, 1
%134 = zext i8 %132 to i32
%135 = icmp eq i32 %128, %134
br i1 %135, label %136, label %138
136: ; preds = %127
%137 = icmp ugt i32 %129, 32765
br i1 %137, label %156, label %145
138: ; preds = %127
%139 = icmp eq i32 %128, -1
br i1 %139, label %145, label %140
140: ; preds = %138
%141 = trunc i32 %128 to i8
%142 = tail call i64 @encode_rle(i8* %120, i32 %130, i32 %129, i8 zeroext %141)
%143 = trunc i64 %142 to i32
%144 = add i32 %130, %143
br label %145
145: ; preds = %138, %140, %136
%146 = phi i32 [ %130, %136 ], [ %144, %140 ], [ %130, %138 ]
%147 = phi i32 [ %133, %136 ], [ 1, %140 ], [ 1, %138 ]
%148 = phi i32 [ %128, %136 ], [ %134, %140 ], [ %134, %138 ]
%149 = add nuw i32 %131, 1
%150 = icmp eq i32 %149, %123
br i1 %150, label %163, label %151
151: ; preds = %145, %156
%152 = phi i32 [ %148, %145 ], [ -1, %156 ]
%153 = phi i32 [ %147, %145 ], [ 0, %156 ]
%154 = phi i32 [ %146, %145 ], [ %160, %156 ]
%155 = phi i32 [ %149, %145 ], [ %161, %156 ]
br label %127
156: ; preds = %136
%157 = trunc i32 %128 to i8
%158 = tail call i64 @encode_rle(i8* %120, i32 %130, i32 %133, i8 zeroext %157)
%159 = trunc i64 %158 to i32
%160 = add i32 %130, %159
%161 = add nuw i32 %131, 1
%162 = icmp eq i32 %161, %123
br i1 %162, label %168, label %151
163: ; preds = %145
%164 = trunc i32 %148 to i8
%165 = tail call i64 @encode_rle(i8* %120, i32 %146, i32 %147, i8 zeroext %164)
%166 = trunc i64 %165 to i32
%167 = add i32 %146, %166
br label %168
168: ; preds = %156, %163
%169 = phi i32 [ %167, %163 ], [ %160, %156 ]
%170 = tail call i32 @fclose(i32* %90)
%171 = icmp eq i8* %64, null
%172 = select i1 %171, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i8* %64
%173 = tail call i32* @fopen(i8* %172, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%174 = icmp eq i32* %173, null
br i1 %174, label %175, label %178
175: ; preds = %168
%176 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.36, i64 0, i64 0))
%177 = tail call i32 @exit(i32 1)
unreachable
178: ; preds = %168
%179 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i64 24, i64 1, i32* %173)
%180 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0), i64 22, i64 1, i32* %173)
%181 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i64 0, i64 0), i64 27, i64 1, i32* %173)
%182 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.21, i64 0, i64 0), i64 28, i64 1, i32* %173)
%183 = tail call i64 @fwrite(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.22, i64 0, i64 0), i64 63, i64 1, i32* %173)
%184 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.23, i64 0, i64 0), i32 %169)
%185 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.24, i64 0, i64 0), i64 19, i64 1, i32* %173)
%186 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0), i32 %99)
%187 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0), i32 %103)
%188 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0), i64 3, i64 1, i32* %173)
%189 = icmp eq i32 %169, 0
br i1 %189, label %229, label %190
190: ; preds = %178, %227
%191 = phi i32 [ %228, %227 ], [ 0, %178 ]
%192 = phi i32 [ %216, %227 ], [ 0, %178 ]
%193 = zext i32 %192 to i64
%194 = getelementptr inbounds i8, i8* %120, i64 %193
%195 = load i8, i8* %194
%196 = zext i8 %195 to i32
%197 = add nuw i32 %192, 1
%198 = zext i32 %197 to i64
%199 = getelementptr inbounds i8, i8* %120, i64 %198
%200 = load i8, i8* %199
%201 = zext i8 %200 to i32
%202 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0), i32 %196, i32 %201)
%203 = add i32 %192, 2
%204 = add nsw i32 %191, 1
%205 = load i8, i8* %194
%206 = icmp slt i8 %205, 0
br i1 %206, label %207, label %215
207: ; preds = %190
%208 = add i32 %192, 3
%209 = zext i32 %203 to i64
%210 = getelementptr inbounds i8, i8* %120, i64 %209
%211 = load i8, i8* %210
%212 = zext i8 %211 to i32
%213 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.29, i64 0, i64 0), i32 %212)
%214 = add nsw i32 %191, 2
br label %215
215: ; preds = %207, %190
%216 = phi i32 [ %208, %207 ], [ %203, %190 ]
%217 = phi i32 [ %214, %207 ], [ %204, %190 ]
%218 = icmp ult i32 %216, %169
br i1 %218, label %221, label %219
219: ; preds = %215
%220 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i64 3, i64 1, i32* %173)
br label %223
221: ; preds = %215
%222 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.31, i64 0, i64 0), i64 2, i64 1, i32* %173)
br label %223
223: ; preds = %221, %219
%224 = icmp sgt i32 %217, 8
br i1 %224, label %225, label %227
225: ; preds = %223
%226 = tail call i32 @fputc(i32 10, i32* %173)
br label %227
227: ; preds = %225, %223
%228 = phi i32 [ 0, %225 ], [ %217, %223 ]
br i1 %218, label %190, label %229
229: ; preds = %227, %178
%230 = tail call i32 @fclose(i32* %173)
ret i32 0
}