#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 uint8_t;
typedef int uint64_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseeko(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftello(int /*<<< orphan*/ *);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned char *malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *infile;
  FILE *outfile;
  unsigned char atom_bytes[8];
  uint32_t atom_type = 0;
  uint64_t atom_size = 0;
  uint64_t last_offset;
  unsigned char *moov_atom;
  unsigned char *ftyp_atom = 0;
  uint64_t moov_atom_size;
  uint64_t ftyp_atom_size = 0;
  uint64_t i, j;
  uint32_t offset_count;
  uint64_t current_offset;
  uint64_t start_offset = 0;
  unsigned char copy_buffer[1024];
  int bytes_to_copy;
  if (argc != 3) {
    printf("Usage: qt-faststart <infile.mov> <outfile.mov>\n");
    return 0;
  }
  infile = fopen(argv[1], "rb");
  if (!infile) {
    perror(argv[1]);
    return 1;
  }
  while (!feof(infile)) {
    if (fread(atom_bytes, 8, 1, infile) != 1) {
      break;
    }
    atom_size = (uint32_t)((((uint8_t *)(&atom_bytes[0]))[0] << 24) |
                           (((uint8_t *)(&atom_bytes[0]))[1] << 16) |
                           (((uint8_t *)(&atom_bytes[0]))[2] << 8) |
                           ((uint8_t *)(&atom_bytes[0]))[3]);
    atom_type = ((((uint8_t *)(&atom_bytes[4]))[0] << 24) |
                 (((uint8_t *)(&atom_bytes[4]))[1] << 16) |
                 (((uint8_t *)(&atom_bytes[4]))[2] << 8) |
                 ((uint8_t *)(&atom_bytes[4]))[3]);
    if ((atom_type != ((uint32_t)(unsigned char)('e') |
                       ((uint32_t)(unsigned char)('e') << 8) |
                       ((uint32_t)(unsigned char)('r') << 16) |
                       ((uint32_t)(unsigned char)('f') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('k') |
                       ((uint32_t)(unsigned char)('n') << 8) |
                       ((uint32_t)(unsigned char)('u') << 16) |
                       ((uint32_t)(unsigned char)('j') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('t') |
                       ((uint32_t)(unsigned char)('a') << 8) |
                       ((uint32_t)(unsigned char)('d') << 16) |
                       ((uint32_t)(unsigned char)('m') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('v') |
                       ((uint32_t)(unsigned char)('o') << 8) |
                       ((uint32_t)(unsigned char)('o') << 16) |
                       ((uint32_t)(unsigned char)('m') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('t') |
                       ((uint32_t)(unsigned char)('o') << 8) |
                       ((uint32_t)(unsigned char)('n') << 16) |
                       ((uint32_t)(unsigned char)('p') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('p') |
                       ((uint32_t)(unsigned char)('i') << 8) |
                       ((uint32_t)(unsigned char)('k') << 16) |
                       ((uint32_t)(unsigned char)('s') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('e') |
                       ((uint32_t)(unsigned char)('d') << 8) |
                       ((uint32_t)(unsigned char)('i') << 16) |
                       ((uint32_t)(unsigned char)('w') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('T') |
                       ((uint32_t)(unsigned char)('C') << 8) |
                       ((uint32_t)(unsigned char)('I') << 16) |
                       ((uint32_t)(unsigned char)('P') << 24))) &&
        (atom_type != ((uint32_t)(unsigned char)('p') |
                       ((uint32_t)(unsigned char)('y') << 8) |
                       ((uint32_t)(unsigned char)('t') << 16) |
                       ((uint32_t)(unsigned char)('f') << 24)))) {
      printf("encountered non-QT top-level atom (is this a Quicktime file?)\n");
      break;
    }
    if (atom_type == ((uint32_t)(unsigned char)('p') |
                      ((uint32_t)(unsigned char)('y') << 8) |
                      ((uint32_t)(unsigned char)('t') << 16) |
                      ((uint32_t)(unsigned char)('f') << 24))) {
      ftyp_atom_size = atom_size;
      ftyp_atom = malloc(ftyp_atom_size);
      if (!ftyp_atom) {
        printf("could not allocate 0x%llX byte for ftyp atom\n", atom_size);
        fclose(infile);
        return 1;
      }
      fseeko(infile, -8, SEEK_CUR);
      if (fread(ftyp_atom, atom_size, 1, infile) != 1) {
        perror(argv[1]);
        free(ftyp_atom);
        fclose(infile);
        return 1;
      }
      start_offset = ftello(infile);
      continue;
    }
    if (atom_size == 1) {
      if (fread(atom_bytes, 8, 1, infile) != 1) {
        break;
      }
      atom_size = (((uint64_t)(((uint8_t *)(&atom_bytes[0]))[0]) << 56) |
                   ((uint64_t)(((uint8_t *)(&atom_bytes[0]))[1]) << 48) |
                   ((uint64_t)(((uint8_t *)(&atom_bytes[0]))[2]) << 40) |
                   ((uint64_t)(((uint8_t *)(&atom_bytes[0]))[3]) << 32) |
                   ((uint64_t)(((uint8_t *)(&atom_bytes[0]))[4]) << 24) |
                   ((uint64_t)(((uint8_t *)(&atom_bytes[0]))[5]) << 16) |
                   ((uint64_t)(((uint8_t *)(&atom_bytes[0]))[6]) << 8) |
                   ((uint64_t)((uint8_t *)(&atom_bytes[0]))[7]));
      fseeko(infile, atom_size - 8 * 2, SEEK_CUR);
    } else {
      fseeko(infile, atom_size - 8, SEEK_CUR);
    }
  }
  if (atom_type !=
      ((uint32_t)(unsigned char)('v') | ((uint32_t)(unsigned char)('o') << 8) |
       ((uint32_t)(unsigned char)('o') << 16) |
       ((uint32_t)(unsigned char)('m') << 24))) {
    printf("last atom in file was not a moov atom\n");
    fclose(infile);
    return 0;
  }
  fseeko(infile, -atom_size, SEEK_END);
  last_offset = ftello(infile);
  moov_atom_size = atom_size;
  moov_atom = malloc(moov_atom_size);
  if (!moov_atom) {
    printf("could not allocate 0x%llX byte for moov atom\n", atom_size);
    fclose(infile);
    return 1;
  }
  if (fread(moov_atom, atom_size, 1, infile) != 1) {
    perror(argv[1]);
    free(moov_atom);
    fclose(infile);
    return 1;
  }
  if (((((uint8_t *)(&moov_atom[12]))[0] << 24) |
       (((uint8_t *)(&moov_atom[12]))[1] << 16) |
       (((uint8_t *)(&moov_atom[12]))[2] << 8) |
       ((uint8_t *)(&moov_atom[12]))[3]) ==
      ((uint32_t)(unsigned char)('v') | ((uint32_t)(unsigned char)('o') << 8) |
       ((uint32_t)(unsigned char)('m') << 16) |
       ((uint32_t)(unsigned char)('c') << 24))) {
    printf("this utility does not support compressed moov atoms yet\n");
    free(moov_atom);
    fclose(infile);
    return 1;
  }
  fclose(infile);
  for (i = 4; i < moov_atom_size - 4; i++) {
    atom_type = ((((uint8_t *)(&moov_atom[i]))[0] << 24) |
                 (((uint8_t *)(&moov_atom[i]))[1] << 16) |
                 (((uint8_t *)(&moov_atom[i]))[2] << 8) |
                 ((uint8_t *)(&moov_atom[i]))[3]);
    if (atom_type == ((uint32_t)(unsigned char)('o') |
                      ((uint32_t)(unsigned char)('c') << 8) |
                      ((uint32_t)(unsigned char)('t') << 16) |
                      ((uint32_t)(unsigned char)('s') << 24))) {
      printf(" patching stco atom...\n");
      atom_size = ((((uint8_t *)(&moov_atom[i - 4]))[0] << 24) |
                   (((uint8_t *)(&moov_atom[i - 4]))[1] << 16) |
                   (((uint8_t *)(&moov_atom[i - 4]))[2] << 8) |
                   ((uint8_t *)(&moov_atom[i - 4]))[3]);
      if (i + atom_size - 4 > moov_atom_size) {
        printf(" bad atom size\n");
        free(moov_atom);
        return 1;
      }
      offset_count = ((((uint8_t *)(&moov_atom[i + 8]))[0] << 24) |
                      (((uint8_t *)(&moov_atom[i + 8]))[1] << 16) |
                      (((uint8_t *)(&moov_atom[i + 8]))[2] << 8) |
                      ((uint8_t *)(&moov_atom[i + 8]))[3]);
      for (j = 0; j < offset_count; j++) {
        current_offset = ((((uint8_t *)(&moov_atom[i + 12 + j * 4]))[0] << 24) |
                          (((uint8_t *)(&moov_atom[i + 12 + j * 4]))[1] << 16) |
                          (((uint8_t *)(&moov_atom[i + 12 + j * 4]))[2] << 8) |
                          ((uint8_t *)(&moov_atom[i + 12 + j * 4]))[3]);
        current_offset += moov_atom_size;
        moov_atom[i + 12 + j * 4 + 0] = (current_offset >> 24) & 0xFF;
        moov_atom[i + 12 + j * 4 + 1] = (current_offset >> 16) & 0xFF;
        moov_atom[i + 12 + j * 4 + 2] = (current_offset >> 8) & 0xFF;
        moov_atom[i + 12 + j * 4 + 3] = (current_offset >> 0) & 0xFF;
      }
      i += atom_size - 4;
    } else if (atom_type == ((uint32_t)(unsigned char)('4') |
                             ((uint32_t)(unsigned char)('6') << 8) |
                             ((uint32_t)(unsigned char)('o') << 16) |
                             ((uint32_t)(unsigned char)('c') << 24))) {
      printf(" patching co64 atom...\n");
      atom_size = ((((uint8_t *)(&moov_atom[i - 4]))[0] << 24) |
                   (((uint8_t *)(&moov_atom[i - 4]))[1] << 16) |
                   (((uint8_t *)(&moov_atom[i - 4]))[2] << 8) |
                   ((uint8_t *)(&moov_atom[i - 4]))[3]);
      if (i + atom_size - 4 > moov_atom_size) {
        printf(" bad atom size\n");
        free(moov_atom);
        return 1;
      }
      offset_count = ((((uint8_t *)(&moov_atom[i + 8]))[0] << 24) |
                      (((uint8_t *)(&moov_atom[i + 8]))[1] << 16) |
                      (((uint8_t *)(&moov_atom[i + 8]))[2] << 8) |
                      ((uint8_t *)(&moov_atom[i + 8]))[3]);
      for (j = 0; j < offset_count; j++) {
        current_offset =
            (((uint64_t)(((uint8_t *)(&moov_atom[i + 12 + j * 8]))[0]) << 56) |
             ((uint64_t)(((uint8_t *)(&moov_atom[i + 12 + j * 8]))[1]) << 48) |
             ((uint64_t)(((uint8_t *)(&moov_atom[i + 12 + j * 8]))[2]) << 40) |
             ((uint64_t)(((uint8_t *)(&moov_atom[i + 12 + j * 8]))[3]) << 32) |
             ((uint64_t)(((uint8_t *)(&moov_atom[i + 12 + j * 8]))[4]) << 24) |
             ((uint64_t)(((uint8_t *)(&moov_atom[i + 12 + j * 8]))[5]) << 16) |
             ((uint64_t)(((uint8_t *)(&moov_atom[i + 12 + j * 8]))[6]) << 8) |
             ((uint64_t)((uint8_t *)(&moov_atom[i + 12 + j * 8]))[7]));
        current_offset += moov_atom_size;
        moov_atom[i + 12 + j * 8 + 0] = (current_offset >> 56) & 0xFF;
        moov_atom[i + 12 + j * 8 + 1] = (current_offset >> 48) & 0xFF;
        moov_atom[i + 12 + j * 8 + 2] = (current_offset >> 40) & 0xFF;
        moov_atom[i + 12 + j * 8 + 3] = (current_offset >> 32) & 0xFF;
        moov_atom[i + 12 + j * 8 + 4] = (current_offset >> 24) & 0xFF;
        moov_atom[i + 12 + j * 8 + 5] = (current_offset >> 16) & 0xFF;
        moov_atom[i + 12 + j * 8 + 6] = (current_offset >> 8) & 0xFF;
        moov_atom[i + 12 + j * 8 + 7] = (current_offset >> 0) & 0xFF;
      }
      i += atom_size - 4;
    }
  }
  infile = fopen(argv[1], "rb");
  if (!infile) {
    perror(argv[1]);
    free(moov_atom);
    return 1;
  }
  if (start_offset > 0) {
    fseeko(infile, start_offset, SEEK_SET);
    last_offset -= start_offset;
  }
  outfile = fopen(argv[2], "wb");
  if (!outfile) {
    perror(argv[2]);
    fclose(outfile);
    free(moov_atom);
    return 1;
  }
  if (ftyp_atom_size > 0) {
    printf(" writing ftyp atom...\n");
    if (fwrite(ftyp_atom, ftyp_atom_size, 1, outfile) != 1) {
      perror(argv[2]);
      goto error_out;
    }
  }
  printf(" writing moov atom...\n");
  if (fwrite(moov_atom, moov_atom_size, 1, outfile) != 1) {
    perror(argv[2]);
    goto error_out;
  }
  printf(" copying rest of file...\n");
  while (last_offset) {
    if (last_offset > 1024)
      bytes_to_copy = 1024;
    else
      bytes_to_copy = last_offset;
    if (fread(copy_buffer, bytes_to_copy, 1, infile) != 1) {
      perror(argv[1]);
      goto error_out;
    }
    if (fwrite(copy_buffer, bytes_to_copy, 1, outfile) != 1) {
      perror(argv[2]);
      goto error_out;
    }
    last_offset -= bytes_to_copy;
  }
  fclose(infile);
  fclose(outfile);
  free(moov_atom);
  if (ftyp_atom_size > 0)
    free(ftyp_atom);
  return 0;
error_out:
  fclose(infile);
  fclose(outfile);
  free(moov_atom);
  if (ftyp_atom_size > 0)
    free(ftyp_atom);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1211 <main+0x61>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe10(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    124d <main+0x9d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
jmp    1252 <main+0xa2>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1270 <main+0xc0>
jmp    14d1 <main+0x321>
lea    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x1,%eax
je     1295 <main+0xe5>
jmp    14d1 <main+0x321>
mov    -0x28(%rbp),%eax
shl    $0x18,%eax
mov    -0x24(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x18,%eax
mov    -0x20(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x66726565,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x6a756e6b,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x6d646174,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x6d6f6f76,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x706e6f74,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x736b6970,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x77696465,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x50494354,-0x2c(%rbp)
je     1355 <main+0x1a5>
cmpl   $0x66747970,-0x2c(%rbp)
je     1355 <main+0x1a5>
lea    0xcea(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    14d1 <main+0x321>
cmpl   $0x66747970,-0x2c(%rbp)
jne    1416 <main+0x266>
mov    -0x30(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    13a5 <main+0x1f5>
mov    -0x30(%rbp),%esi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x18(%rbp),%rdi
mov    0x2c30(%rip),%rax
mov    (%rax),%edx
mov    $0xfffffff8,%esi
call   10a0 <fseeko@plt>
mov    -0x48(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x1,%eax
je     1405 <main+0x255>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x18(%rbp),%rdi
call   1040 <ftello@plt>
mov    %eax,-0x64(%rbp)
jmp    1252 <main+0xa2>
cmpl   $0x1,-0x30(%rbp)
jne    14b4 <main+0x304>
lea    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x1,%eax
je     1445 <main+0x295>
jmp    14d1 <main+0x321>
mov    -0x28(%rbp),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x24(%rbp),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%esi
sub    $0x10,%esi
mov    0x2b38(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseeko@plt>
jmp    14cc <main+0x31c>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%esi
sub    $0x8,%esi
mov    0x2b1b(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseeko@plt>
jmp    1252 <main+0xa2>
cmpl   $0x6d6f6f76,-0x2c(%rbp)
je     1501 <main+0x351>
lea    0xbbb(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
sub    -0x30(%rbp),%esi
mov    0x2ad7(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseeko@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ftello@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1567 <main+0x3b7>
mov    -0x30(%rbp),%esi
lea    0xb7c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x1,%eax
je     15b0 <main+0x400>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x40(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x40(%rbp),%rcx
mov    0x10(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    0x14(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
or     0x18(%rcx),%eax
cmp    $0x636d6f76,%eax
jne    1610 <main+0x460>
lea    0xb0a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x4,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x4c(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jge    1c49 <main+0xa99>
mov    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x40(%rbp),%rcx
movslq -0x54(%rbp),%rdx
mov    0x4(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
movslq -0x54(%rbp),%rdx
mov    0x8(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
movslq -0x54(%rbp),%rdx
or     0xc(%rcx,%rdx,1),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x7374636f,-0x2c(%rbp)
jne    18b4 <main+0x704>
lea    0xaaa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x4,%edx
movslq %edx,%rdx
mov    0x4(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x4,%edx
movslq %edx,%rdx
mov    0x8(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x4,%edx
movslq %edx,%rdx
or     0xc(%rcx,%rdx,1),%eax
mov    %eax,-0x30(%rbp)
mov    -0x54(%rbp),%eax
add    -0x30(%rbp),%eax
sub    $0x4,%eax
cmp    -0x4c(%rbp),%eax
jle    1713 <main+0x563>
lea    0xa4f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0x8,%edx
movslq %edx,%rdx
mov    0x4(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0x8,%edx
movslq %edx,%rdx
mov    0x8(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0x8,%edx
movslq %edx,%rdx
or     0xc(%rcx,%rdx,1),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    18a3 <main+0x6f3>
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%edx
shl    $0x2,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x2,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0x4(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x2,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0x8(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x2,%esi
add    %esi,%edx
movslq %edx,%rdx
or     0xc(%rcx,%rdx,1),%eax
mov    %eax,-0x60(%rbp)
mov    -0x4c(%rbp),%eax
add    -0x60(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x2,%esi
add    %esi,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x2,%esi
add    %esi,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x2,%esi
add    %esi,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x2,%esi
add    %esi,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    176d <main+0x5bd>
mov    -0x30(%rbp),%eax
sub    $0x4,%eax
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    1c36 <main+0xa86>
cmpl   $0x636f3634,-0x2c(%rbp)
jne    1c31 <main+0xa81>
lea    0x88e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x4,%edx
movslq %edx,%rdx
mov    0x4(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x4,%edx
movslq %edx,%rdx
mov    0x8(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
sub    $0x4,%edx
movslq %edx,%rdx
or     0xc(%rcx,%rdx,1),%eax
mov    %eax,-0x30(%rbp)
mov    -0x54(%rbp),%eax
add    -0x30(%rbp),%eax
sub    $0x4,%eax
cmp    -0x4c(%rbp),%eax
jle    1957 <main+0x7a7>
lea    0x80b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0x8,%edx
movslq %edx,%rdx
mov    0x4(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0x8,%edx
movslq %edx,%rdx
mov    0x8(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0x8,%edx
movslq %edx,%rdx
or     0xc(%rcx,%rdx,1),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    1c25 <main+0xa75>
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%edx
shl    $0x3,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0x4(%rcx,%rdx,1),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0x8(%rcx,%rdx,1),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0xc(%rcx,%rdx,1),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0x10(%rcx,%rdx,1),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0x14(%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%edx
movslq %edx,%rdx
mov    0x18(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%rcx
mov    -0x54(%rbp),%edx
add    $0xc,%edx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%edx
movslq %edx,%rdx
or     0x1c(%rcx,%rdx,1),%eax
mov    %eax,-0x60(%rbp)
mov    -0x4c(%rbp),%eax
add    -0x60(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
mov    $0x28,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x60(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0xc,%ecx
mov    -0x58(%rbp),%esi
shl    $0x3,%esi
add    %esi,%ecx
add    $0x7,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    19b1 <main+0x801>
mov    -0x30(%rbp),%eax
sub    $0x4,%eax
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    1c36 <main+0xa86>
jmp    1c3b <main+0xa8b>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x3d8(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1c8e <main+0xade>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
cmpl   $0x0,-0x64(%rbp)
jle    1cb8 <main+0xb08>
mov    -0x18(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    0x232a(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseeko@plt>
mov    -0x64(%rbp),%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0x4a7(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1d06 <main+0xb56>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <perror@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
cmpl   $0x0,-0x50(%rbp)
jle    1d53 <main+0xba3>
lea    0x45a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
cmp    $0x1,%eax
je     1d4e <main+0xb9e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <perror@plt>
jmp    1e87 <main+0xcd7>
jmp    1d53 <main+0xba3>
lea    0x42e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
cmp    $0x1,%eax
je     1d91 <main+0xbe1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <perror@plt>
jmp    1e87 <main+0xcd7>
lea    0x407(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x0,-0x34(%rbp)
je     1e4d <main+0xc9d>
cmpl   $0x400,-0x34(%rbp)
jle    1dc5 <main+0xc15>
movl   $0x400,-0x474(%rbp)
jmp    1dce <main+0xc1e>
mov    -0x34(%rbp),%eax
mov    %eax,-0x474(%rbp)
lea    -0x470(%rbp),%rdi
mov    -0x474(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x1,%eax
je     1e04 <main+0xc54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
jmp    1e87 <main+0xcd7>
lea    -0x470(%rbp),%rdi
mov    -0x474(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
cmp    $0x1,%eax
je     1e3a <main+0xc8a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <perror@plt>
jmp    1e87 <main+0xcd7>
mov    -0x474(%rbp),%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
jmp    1d9f <main+0xbef>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x50(%rbp)
jle    1e7b <main+0xccb>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1ebc <main+0xd0c>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x50(%rbp)
jle    1eb5 <main+0xd05>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x448,%rsp
cmp    $0x3,%edi
jne    1402 <main+0x242>
mov    %rsi,%rbx
lea    0x8(%rsi),%rbp
mov    0x8(%rsi),%rdi
lea    0xe14(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     145c <main+0x29c>
mov    %rax,%r15
mov    %rbp,0x30(%rsp)
mov    %rax,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    1432 <main+0x272>
mov    %rbx,0x28(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1060 <fread@plt>
cmp    $0x1,%eax
jne    1410 <main+0x250>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    0x2d9b(%rip),%r13
lea    0x10(%rsp),%r14
xor    %ebp,%ebp
xor    %eax,%eax
mov    %rax,0x38(%rsp)
mov    %ebp,%eax
mov    %ebp,0xc(%rsp)
nopl   0x0(%rax)
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%ecx
shl    $0x18,%eax
mov    %ecx,%edx
shl    $0x10,%edx
or     %eax,%edx
mov    0x18(%rsp),%eax
mov    %eax,%ebp
shl    $0x8,%ebp
mov    0x1c(%rsp),%ebx
or     %ebx,%ebp
or     %edx,%ebp
shl    $0x18,%ecx
shl    $0x10,%eax
or     %ecx,%eax
shl    $0x8,%ebx
or     %eax,%ebx
or     0x20(%rsp),%ebx
cmp    $0x6d6f6f75,%ebx
jg     12c0 <main+0x100>
cmp    $0x6674796f,%ebx
jle    12e0 <main+0x120>
cmp    $0x6a756e6b,%ebx
je     1320 <main+0x160>
cmp    $0x6d646174,%ebx
je     1320 <main+0x160>
jmp    136b <main+0x1ab>
nopl   0x0(%rax)
cmp    $0x736b696f,%ebx
jg     1300 <main+0x140>
cmp    $0x6d6f6f76,%ebx
je     1320 <main+0x160>
cmp    $0x706e6f74,%ebx
je     1320 <main+0x160>
jmp    1817 <main+0x657>
nopl   (%rax)
cmp    $0x50494354,%ebx
je     1320 <main+0x160>
cmp    $0x66726565,%ebx
je     1320 <main+0x160>
jmp    1817 <main+0x657>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x736b6970,%ebx
je     1320 <main+0x160>
cmp    $0x77696465,%ebx
jne    1817 <main+0x657>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x1,%ebp
je     146c <main+0x2ac>
lea    -0x8(%rbp),%esi
mov    0x0(%r13),%edx
mov    %r15,%rdi
call   10b0 <fseeko@plt>
mov    %r15,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    1488 <main+0x2c8>
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1060 <fread@plt>
cmp    $0x1,%eax
je     1260 <main+0xa0>
jmp    1488 <main+0x2c8>
cmp    $0x66747970,%ebx
jne    1817 <main+0x657>
mov    %ebp,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     18ba <main+0x6fa>
mov    %rax,%rbx
mov    0x0(%r13),%edx
mov    %r15,%rdi
mov    $0xfffffff8,%esi
call   10b0 <fseeko@plt>
mov    %rbx,0x18(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1060 <fread@plt>
cmp    $0x1,%eax
jne    18c6 <main+0x706>
mov    %r15,%rdi
call   1040 <ftello@plt>
mov    %rax,0x38(%rsp)
mov    %r15,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    1432 <main+0x272>
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1060 <fread@plt>
mov    $0x66747970,%ebx
mov    %ebp,%ecx
mov    %ebp,0xc(%rsp)
cmp    $0x1,%eax
je     1253 <main+0x93>
jmp    1488 <main+0x2c8>
lea    0xd77(%rip),%rdi
call   1050 <puts@plt>
jmp    1446 <main+0x286>
xor    %eax,%eax
mov    %rax,0x38(%rsp)
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %ebx,%ebx
xor    %ebp,%ebp
cmp    $0x6d6f6f76,%ebx
je     1490 <main+0x2d0>
lea    0xce3(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
call   1070 <fclose@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x448,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%rbp),%rdi
call   10d0 <perror@plt>
mov    $0x1,%ebx
jmp    1448 <main+0x288>
lea    0x10(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1060 <fread@plt>
cmp    $0x6d6f6f76,%ebx
jne    1432 <main+0x272>
mov    %ebp,%esi
neg    %esi
mov    0x2b4d(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
call   10b0 <fseeko@plt>
mov    %r15,%rdi
call   1040 <ftello@plt>
mov    %eax,%r13d
mov    %ebp,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     1524 <main+0x364>
mov    %rax,%r14
mov    $0x1,%ebx
mov    %rax,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1060 <fread@plt>
cmp    $0x1,%eax
jne    1834 <main+0x674>
mov    0xc(%r14),%eax
mov    0x10(%r14),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x14(%r14),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%r14),%eax
cmp    $0x636d6f76,%eax
jne    1546 <main+0x386>
lea    0xbda(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1070 <fclose@plt>
jmp    1448 <main+0x288>
lea    0xb06(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
call   1070 <fclose@plt>
mov    $0x1,%ebx
jmp    1448 <main+0x288>
mov    %r15,%rdi
call   1070 <fclose@plt>
cmp    $0x9,%ebp
jl     1691 <main+0x4d1>
lea    -0x4(%rbp),%eax
mov    %eax,0x20(%rsp)
mov    $0x4,%r15d
jmp    15b7 <main+0x3f7>
lea    0xb3a(%rip),%rdi
call   1050 <puts@plt>
lea    -0x4(%r15),%eax
cltq
mov    (%r14,%rax,1),%ecx
mov    0x4(%r14,%rax,1),%edx
shl    $0x18,%ecx
shl    $0x10,%edx
or     %ecx,%edx
mov    0x8(%r14,%rax,1),%ecx
shl    $0x8,%ecx
or     %edx,%ecx
or     0xc(%r14,%rax,1),%ecx
add    %ecx,%r15d
add    $0xfffffffc,%r15d
cmp    %ebp,%r15d
jg     17fe <main+0x63e>
add    $0x1,%r15d
cmp    0x20(%rsp),%r15d
jge    1691 <main+0x4d1>
movslq %r15d,%r12
mov    (%r14,%r12,1),%eax
mov    0x4(%r14,%r12,1),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%r14,%r12,1),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%r14,%r12,1),%eax
cmp    $0x636f3634,%eax
je     1566 <main+0x3a6>
cmp    $0x7374636f,%eax
jne    15a8 <main+0x3e8>
lea    0xacf(%rip),%rdi
call   1050 <puts@plt>
lea    -0x4(%r15),%eax
cltq
mov    (%r14,%rax,1),%ecx
mov    0x4(%r14,%rax,1),%edx
shl    $0x18,%ecx
shl    $0x10,%edx
or     %ecx,%edx
mov    0x8(%r14,%rax,1),%ecx
shl    $0x8,%ecx
or     %edx,%ecx
or     0xc(%r14,%rax,1),%ecx
add    %ecx,%r15d
add    $0xfffffffc,%r15d
cmp    %ebp,%r15d
jg     17fe <main+0x63e>
mov    0x8(%r12,%r14,1),%eax
mov    0xc(%r12,%r14,1),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%r12,%r14,1),%edx
shl    $0x8,%edx
or     %ecx,%edx
mov    0x14(%r12,%r14,1),%eax
or     %rdx,%rax
test   %eax,%eax
jle    15a8 <main+0x3e8>
lea    (%r12,%r14,1),%rcx
add    $0xc,%rcx
xor    %edx,%edx
mov    (%rcx,%rdx,4),%esi
mov    0x4(%rcx,%rdx,4),%edi
shl    $0x18,%esi
shl    $0x10,%edi
or     %esi,%edi
mov    0x8(%rcx,%rdx,4),%esi
shl    $0x8,%esi
or     %edi,%esi
or     0xc(%rcx,%rdx,4),%esi
add    %ebp,%esi
bswap  %esi
mov    %esi,(%rcx,%rdx,4)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1660 <main+0x4a0>
jmp    15a8 <main+0x3e8>
mov    0x30(%rsp),%rax
mov    (%rax),%rdi
lea    0x960(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     1846 <main+0x686>
mov    0x38(%rsp),%r15
test   %r15d,%r15d
jle    16d6 <main+0x516>
mov    0x290c(%rip),%rax
mov    (%rax),%edx
mov    0x20(%rsp),%rdi
mov    %r15d,%esi
call   10b0 <fseeko@plt>
sub    %r15d,%r13d
mov    0xc(%rsp),%r15d
mov    0x28(%rsp),%rax
mov    0x10(%rax),%rdi
add    $0x10,%rax
mov    %rax,0x28(%rsp)
lea    0x96b(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1855 <main+0x695>
mov    %rax,%r12
test   %r15d,%r15d
mov    %r15d,%ecx
mov    %rax,%r15
mov    %ecx,0xc(%rsp)
jle    1743 <main+0x583>
lea    0x976(%rip),%rdi
call   1050 <puts@plt>
mov    0x18(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    0xc(%rsp),%ecx
cmp    $0x1,%eax
jne    1871 <main+0x6b1>
lea    0x918(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10e0 <fwrite@plt>
cmp    $0x1,%eax
jne    186b <main+0x6ab>
lea    0x907(%rip),%rdi
call   1050 <puts@plt>
test   %r13d,%r13d
je     17d0 <main+0x610>
lea    0x40(%rsp),%rbp
cmp    $0x400,%r13d
mov    $0x400,%r15d
cmovl  %r13d,%r15d
mov    %rbp,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    0x20(%rsp),%rcx
call   1060 <fread@plt>
cmp    $0x1,%eax
jne    1875 <main+0x6b5>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   10e0 <fwrite@plt>
cmp    $0x1,%eax
jne    187f <main+0x6bf>
sub    %r15d,%r13d
jne    1780 <main+0x5c0>
mov    0x20(%rsp),%rdi
call   1070 <fclose@plt>
mov    %r12,%rdi
call   1070 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
cmpl   $0x0,0xc(%rsp)
jle    1448 <main+0x288>
mov    0x18(%rsp),%rdi
jmp    180d <main+0x64d>
lea    0x8d0(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    1448 <main+0x288>
lea    0x924(%rip),%rdi
call   1050 <puts@plt>
cmp    $0x6d6f6f76,%ebx
je     1490 <main+0x2d0>
jmp    1432 <main+0x272>
mov    0x30(%rsp),%rax
mov    (%rax),%rdi
call   10d0 <perror@plt>
jmp    150f <main+0x34f>
mov    0x30(%rsp),%rax
mov    (%rax),%rdi
call   10d0 <perror@plt>
jmp    180a <main+0x64a>
mov    0x28(%rsp),%rax
mov    (%rax),%rdi
call   10d0 <perror@plt>
xor    %edi,%edi
call   1070 <fclose@plt>
jmp    180a <main+0x64a>
mov    0xc(%rsp),%ebp
jmp    1886 <main+0x6c6>
mov    %ecx,%ebp
jmp    1886 <main+0x6c6>
mov    0x30(%rsp),%rax
mov    %rax,0x28(%rsp)
mov    0xc(%rsp),%ebp
mov    %r12,%r15
mov    0x28(%rsp),%rax
mov    (%rax),%rdi
call   10d0 <perror@plt>
mov    0x20(%rsp),%rdi
call   1070 <fclose@plt>
mov    %r15,%rdi
call   1070 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
test   %ebp,%ebp
jg     17f7 <main+0x637>
jmp    1448 <main+0x288>
lea    0x742(%rip),%rdi
jmp    152b <main+0x36b>
mov    0x30(%rsp),%rax
mov    (%rax),%rdi
call   10d0 <perror@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
jmp    1534 <main+0x374>

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: qt-faststart <infile.mov> <outfile.mov>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [63 x i8] c"encountered non-QT top-level atom (is this a Quicktime file?)\0A\00"
@.str.3 = [46 x i8] c"could not allocate 0x%llX byte for ftyp atom\0A\00"
@SEEK_CUR = global i32 0
@.str.4 = [39 x i8] c"last atom in file was not a moov atom\0A\00"
@SEEK_END = global i32 0
@.str.5 = [46 x i8] c"could not allocate 0x%llX byte for moov atom\0A\00"
@.str.6 = [57 x i8] c"this utility does not support compressed moov atoms yet\0A\00"
@.str.7 = [24 x i8] c" patching stco atom...\0A\00"
@.str.8 = [16 x i8] c" bad atom size\0A\00"
@.str.9 = [24 x i8] c" patching co64 atom...\0A\00"
@SEEK_SET = global i32 0
@.str.10 = [3 x i8] c"wb\00"
@.str.11 = [23 x i8] c" writing ftyp atom...\0A\00"
@.str.12 = [23 x i8] c" writing moov atom...\0A\00"
@.str.13 = [26 x i8] c" copying rest of 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 [8 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [1024 x i8]
%22 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %10
store i8* null, i8** %13
store i32 0, i32* %15
store i32 0, i32* %20
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 3
br i1 %24, label %25, label %27
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %1004
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %31, i32** %6
%32 = load i32*, i32** %6
%33 = icmp ne i32* %32, null
br i1 %33, label %39, label %34
34: ; preds = %27
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 @perror(i8* %37)
store i32 1, i32* %3
br label %1004
39: ; preds = %27
br label %40
40: ; preds = %226, %156, %39
%41 = load i32*, i32** %6
%42 = call i32 @feof(i32* %41)
%43 = icmp ne i32 %42, 0
%44 = xor i1 %43, true
br i1 %44, label %45, label %227
45: ; preds = %40
%46 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%47 = load i32*, i32** %6
%48 = call i32 @fread(i8* %46, i32 8, i32 1, i32* %47)
%49 = icmp ne i32 %48, 1
br i1 %49, label %50, label %51
50: ; preds = %45
br label %227
51: ; preds = %45
%52 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%53 = bitcast i8* %52 to i32*
%54 = getelementptr inbounds i32, i32* %53, i64 0
%55 = load i32, i32* %54
%56 = shl i32 %55, 24
%57 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%58 = bitcast i8* %57 to i32*
%59 = getelementptr inbounds i32, i32* %58, i64 1
%60 = load i32, i32* %59
%61 = shl i32 %60, 16
%62 = or i32 %56, %61
%63 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%64 = bitcast i8* %63 to i32*
%65 = getelementptr inbounds i32, i32* %64, i64 2
%66 = load i32, i32* %65
%67 = shl i32 %66, 8
%68 = or i32 %62, %67
%69 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%70 = bitcast i8* %69 to i32*
%71 = getelementptr inbounds i32, i32* %70, i64 3
%72 = load i32, i32* %71
%73 = or i32 %68, %72
store i32 %73, i32* %10
%74 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 4
%75 = bitcast i8* %74 to i32*
%76 = getelementptr inbounds i32, i32* %75, i64 0
%77 = load i32, i32* %76
%78 = shl i32 %77, 24
%79 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 4
%80 = bitcast i8* %79 to i32*
%81 = getelementptr inbounds i32, i32* %80, i64 1
%82 = load i32, i32* %81
%83 = shl i32 %82, 16
%84 = or i32 %78, %83
%85 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 4
%86 = bitcast i8* %85 to i32*
%87 = getelementptr inbounds i32, i32* %86, i64 2
%88 = load i32, i32* %87
%89 = shl i32 %88, 8
%90 = or i32 %84, %89
%91 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 4
%92 = bitcast i8* %91 to i32*
%93 = getelementptr inbounds i32, i32* %92, i64 3
%94 = load i32, i32* %93
%95 = or i32 %90, %94
store i32 %95, i32* %9
%96 = load i32, i32* %9
%97 = icmp ne i32 %96, 1718773093
br i1 %97, label %98, label %124
98: ; preds = %51
%99 = load i32, i32* %9
%100 = icmp ne i32 %99, 1786080875
br i1 %100, label %101, label %124
101: ; preds = %98
%102 = load i32, i32* %9
%103 = icmp ne i32 %102, 1835295092
br i1 %103, label %104, label %124
104: ; preds = %101
%105 = load i32, i32* %9
%106 = icmp ne i32 %105, 1836019574
br i1 %106, label %107, label %124
107: ; preds = %104
%108 = load i32, i32* %9
%109 = icmp ne i32 %108, 1886285684
br i1 %109, label %110, label %124
110: ; preds = %107
%111 = load i32, i32* %9
%112 = icmp ne i32 %111, 1936419184
br i1 %112, label %113, label %124
113: ; preds = %110
%114 = load i32, i32* %9
%115 = icmp ne i32 %114, 2003395685
br i1 %115, label %116, label %124
116: ; preds = %113
%117 = load i32, i32* %9
%118 = icmp ne i32 %117, 1346978644
br i1 %118, label %119, label %124
119: ; preds = %116
%120 = load i32, i32* %9
%121 = icmp ne i32 %120, 1718909296
br i1 %121, label %122, label %124
122: ; preds = %119
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
br label %227
124: ; preds = %119, %116, %113, %110, %107, %104, %101, %98, %51
%125 = load i32, i32* %9
%126 = icmp eq i32 %125, 1718909296
br i1 %126, label %127, label %159
127: ; preds = %124
%128 = load i32, i32* %10
store i32 %128, i32* %15
%129 = load i32, i32* %15
%130 = call i8* @malloc(i32 %129)
store i8* %130, i8** %13
%131 = load i8*, i8** %13
%132 = icmp ne i8* %131, null
br i1 %132, label %138, label %133
133: ; preds = %127
%134 = load i32, i32* %10
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i32 %134)
%136 = load i32*, i32** %6
%137 = call i32 @fclose(i32* %136)
store i32 1, i32* %3
br label %1004
138: ; preds = %127
%139 = load i32*, i32** %6
%140 = load i32, i32* @SEEK_CUR
%141 = call i32 @fseeko(i32* %139, i32 -8, i32 %140)
%142 = load i8*, i8** %13
%143 = load i32, i32* %10
%144 = load i32*, i32** %6
%145 = call i32 @fread(i8* %142, i32 %143, i32 1, i32* %144)
%146 = icmp ne i32 %145, 1
br i1 %146, label %147, label %156
147: ; preds = %138
%148 = load i8**, i8*** %5
%149 = getelementptr inbounds i8*, i8** %148, i64 1
%150 = load i8*, i8** %149
%151 = call i32 @perror(i8* %150)
%152 = load i8*, i8** %13
%153 = call i32 @free(i8* %152)
%154 = load i32*, i32** %6
%155 = call i32 @fclose(i32* %154)
store i32 1, i32* %3
br label %1004
156: ; preds = %138
%157 = load i32*, i32** %6
%158 = call i32 @ftello(i32* %157)
store i32 %158, i32* %20
br label %40
159: ; preds = %124
%160 = load i32, i32* %10
%161 = icmp eq i32 %160, 1
br i1 %161, label %162, label %220
162: ; preds = %159
%163 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%164 = load i32*, i32** %6
%165 = call i32 @fread(i8* %163, i32 8, i32 1, i32* %164)
%166 = icmp ne i32 %165, 1
br i1 %166, label %167, label %168
167: ; preds = %162
br label %227
168: ; preds = %162
%169 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%170 = bitcast i8* %169 to i32*
%171 = getelementptr inbounds i32, i32* %170, i64 0
%172 = load i32, i32* %171
%173 = shl i32 %172, 56
%174 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%175 = bitcast i8* %174 to i32*
%176 = getelementptr inbounds i32, i32* %175, i64 1
%177 = load i32, i32* %176
%178 = shl i32 %177, 48
%179 = or i32 %173, %178
%180 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%181 = bitcast i8* %180 to i32*
%182 = getelementptr inbounds i32, i32* %181, i64 2
%183 = load i32, i32* %182
%184 = shl i32 %183, 40
%185 = or i32 %179, %184
%186 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%187 = bitcast i8* %186 to i32*
%188 = getelementptr inbounds i32, i32* %187, i64 3
%189 = load i32, i32* %188
%190 = shl i32 %189, 32
%191 = or i32 %185, %190
%192 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%193 = bitcast i8* %192 to i32*
%194 = getelementptr inbounds i32, i32* %193, i64 4
%195 = load i32, i32* %194
%196 = shl i32 %195, 24
%197 = or i32 %191, %196
%198 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%199 = bitcast i8* %198 to i32*
%200 = getelementptr inbounds i32, i32* %199, i64 5
%201 = load i32, i32* %200
%202 = shl i32 %201, 16
%203 = or i32 %197, %202
%204 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%205 = bitcast i8* %204 to i32*
%206 = getelementptr inbounds i32, i32* %205, i64 6
%207 = load i32, i32* %206
%208 = shl i32 %207, 8
%209 = or i32 %203, %208
%210 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%211 = bitcast i8* %210 to i32*
%212 = getelementptr inbounds i32, i32* %211, i64 7
%213 = load i32, i32* %212
%214 = or i32 %209, %213
store i32 %214, i32* %10
%215 = load i32*, i32** %6
%216 = load i32, i32* %10
%217 = sub nsw i32 %216, 16
%218 = load i32, i32* @SEEK_CUR
%219 = call i32 @fseeko(i32* %215, i32 %217, i32 %218)
br label %226
220: ; preds = %159
%221 = load i32*, i32** %6
%222 = load i32, i32* %10
%223 = sub nsw i32 %222, 8
%224 = load i32, i32* @SEEK_CUR
%225 = call i32 @fseeko(i32* %221, i32 %223, i32 %224)
br label %226
226: ; preds = %220, %168
br label %40
227: ; preds = %167, %122, %50, %40
%228 = load i32, i32* %9
%229 = icmp ne i32 %228, 1836019574
br i1 %229, label %230, label %234
230: ; preds = %227
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%232 = load i32*, i32** %6
%233 = call i32 @fclose(i32* %232)
store i32 0, i32* %3
br label %1004
234: ; preds = %227
%235 = load i32*, i32** %6
%236 = load i32, i32* %10
%237 = sub nsw i32 0, %236
%238 = load i32, i32* @SEEK_END
%239 = call i32 @fseeko(i32* %235, i32 %237, i32 %238)
%240 = load i32*, i32** %6
%241 = call i32 @ftello(i32* %240)
store i32 %241, i32* %11
%242 = load i32, i32* %10
store i32 %242, i32* %14
%243 = load i32, i32* %14
%244 = call i8* @malloc(i32 %243)
store i8* %244, i8** %12
%245 = load i8*, i8** %12
%246 = icmp ne i8* %245, null
br i1 %246, label %252, label %247
247: ; preds = %234
%248 = load i32, i32* %10
%249 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %248)
%250 = load i32*, i32** %6
%251 = call i32 @fclose(i32* %250)
store i32 1, i32* %3
br label %1004
252: ; preds = %234
%253 = load i8*, i8** %12
%254 = load i32, i32* %10
%255 = load i32*, i32** %6
%256 = call i32 @fread(i8* %253, i32 %254, i32 1, i32* %255)
%257 = icmp ne i32 %256, 1
br i1 %257, label %258, label %267
258: ; preds = %252
%259 = load i8**, i8*** %5
%260 = getelementptr inbounds i8*, i8** %259, i64 1
%261 = load i8*, i8** %260
%262 = call i32 @perror(i8* %261)
%263 = load i8*, i8** %12
%264 = call i32 @free(i8* %263)
%265 = load i32*, i32** %6
%266 = call i32 @fclose(i32* %265)
store i32 1, i32* %3
br label %1004
267: ; preds = %252
%268 = load i8*, i8** %12
%269 = getelementptr inbounds i8, i8* %268, i64 12
%270 = bitcast i8* %269 to i32*
%271 = getelementptr inbounds i32, i32* %270, i64 0
%272 = load i32, i32* %271
%273 = shl i32 %272, 24
%274 = load i8*, i8** %12
%275 = getelementptr inbounds i8, i8* %274, i64 12
%276 = bitcast i8* %275 to i32*
%277 = getelementptr inbounds i32, i32* %276, i64 1
%278 = load i32, i32* %277
%279 = shl i32 %278, 16
%280 = or i32 %273, %279
%281 = load i8*, i8** %12
%282 = getelementptr inbounds i8, i8* %281, i64 12
%283 = bitcast i8* %282 to i32*
%284 = getelementptr inbounds i32, i32* %283, i64 2
%285 = load i32, i32* %284
%286 = shl i32 %285, 8
%287 = or i32 %280, %286
%288 = load i8*, i8** %12
%289 = getelementptr inbounds i8, i8* %288, i64 12
%290 = bitcast i8* %289 to i32*
%291 = getelementptr inbounds i32, i32* %290, i64 3
%292 = load i32, i32* %291
%293 = or i32 %287, %292
%294 = icmp eq i32 %293, 1668116342
br i1 %294, label %295, label %301
295: ; preds = %267
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0))
%297 = load i8*, i8** %12
%298 = call i32 @free(i8* %297)
%299 = load i32*, i32** %6
%300 = call i32 @fclose(i32* %299)
store i32 1, i32* %3
br label %1004
301: ; preds = %267
%302 = load i32*, i32** %6
%303 = call i32 @fclose(i32* %302)
store i32 4, i32* %16
br label %304
304: ; preds = %869, %301
%305 = load i32, i32* %16
%306 = load i32, i32* %14
%307 = sub nsw i32 %306, 4
%308 = icmp slt i32 %305, %307
br i1 %308, label %309, label %872
309: ; preds = %304
%310 = load i8*, i8** %12
%311 = load i32, i32* %16
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds i8, i8* %310, i64 %312
%314 = bitcast i8* %313 to i32*
%315 = getelementptr inbounds i32, i32* %314, i64 0
%316 = load i32, i32* %315
%317 = shl i32 %316, 24
%318 = load i8*, i8** %12
%319 = load i32, i32* %16
%320 = sext i32 %319 to i64
%321 = getelementptr inbounds i8, i8* %318, i64 %320
%322 = bitcast i8* %321 to i32*
%323 = getelementptr inbounds i32, i32* %322, i64 1
%324 = load i32, i32* %323
%325 = shl i32 %324, 16
%326 = or i32 %317, %325
%327 = load i8*, i8** %12
%328 = load i32, i32* %16
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds i8, i8* %327, i64 %329
%331 = bitcast i8* %330 to i32*
%332 = getelementptr inbounds i32, i32* %331, i64 2
%333 = load i32, i32* %332
%334 = shl i32 %333, 8
%335 = or i32 %326, %334
%336 = load i8*, i8** %12
%337 = load i32, i32* %16
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds i8, i8* %336, i64 %338
%340 = bitcast i8* %339 to i32*
%341 = getelementptr inbounds i32, i32* %340, i64 3
%342 = load i32, i32* %341
%343 = or i32 %335, %342
store i32 %343, i32* %9
%344 = load i32, i32* %9
%345 = icmp eq i32 %344, 1937007471
br i1 %345, label %346, label %553
346: ; preds = %309
%347 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%348 = load i8*, i8** %12
%349 = load i32, i32* %16
%350 = sub nsw i32 %349, 4
%351 = sext i32 %350 to i64
%352 = getelementptr inbounds i8, i8* %348, i64 %351
%353 = bitcast i8* %352 to i32*
%354 = getelementptr inbounds i32, i32* %353, i64 0
%355 = load i32, i32* %354
%356 = shl i32 %355, 24
%357 = load i8*, i8** %12
%358 = load i32, i32* %16
%359 = sub nsw i32 %358, 4
%360 = sext i32 %359 to i64
%361 = getelementptr inbounds i8, i8* %357, i64 %360
%362 = bitcast i8* %361 to i32*
%363 = getelementptr inbounds i32, i32* %362, i64 1
%364 = load i32, i32* %363
%365 = shl i32 %364, 16
%366 = or i32 %356, %365
%367 = load i8*, i8** %12
%368 = load i32, i32* %16
%369 = sub nsw i32 %368, 4
%370 = sext i32 %369 to i64
%371 = getelementptr inbounds i8, i8* %367, i64 %370
%372 = bitcast i8* %371 to i32*
%373 = getelementptr inbounds i32, i32* %372, i64 2
%374 = load i32, i32* %373
%375 = shl i32 %374, 8
%376 = or i32 %366, %375
%377 = load i8*, i8** %12
%378 = load i32, i32* %16
%379 = sub nsw i32 %378, 4
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds i8, i8* %377, i64 %380
%382 = bitcast i8* %381 to i32*
%383 = getelementptr inbounds i32, i32* %382, i64 3
%384 = load i32, i32* %383
%385 = or i32 %376, %384
store i32 %385, i32* %10
%386 = load i32, i32* %16
%387 = load i32, i32* %10
%388 = add nsw i32 %386, %387
%389 = sub nsw i32 %388, 4
%390 = load i32, i32* %14
%391 = icmp sgt i32 %389, %390
br i1 %391, label %392, label %396
392: ; preds = %346
%393 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%394 = load i8*, i8** %12
%395 = call i32 @free(i8* %394)
store i32 1, i32* %3
br label %1004
396: ; preds = %346
%397 = load i8*, i8** %12
%398 = load i32, i32* %16
%399 = add nsw i32 %398, 8
%400 = sext i32 %399 to i64
%401 = getelementptr inbounds i8, i8* %397, i64 %400
%402 = bitcast i8* %401 to i32*
%403 = getelementptr inbounds i32, i32* %402, i64 0
%404 = load i32, i32* %403
%405 = shl i32 %404, 24
%406 = load i8*, i8** %12
%407 = load i32, i32* %16
%408 = add nsw i32 %407, 8
%409 = sext i32 %408 to i64
%410 = getelementptr inbounds i8, i8* %406, i64 %409
%411 = bitcast i8* %410 to i32*
%412 = getelementptr inbounds i32, i32* %411, i64 1
%413 = load i32, i32* %412
%414 = shl i32 %413, 16
%415 = or i32 %405, %414
%416 = load i8*, i8** %12
%417 = load i32, i32* %16
%418 = add nsw i32 %417, 8
%419 = sext i32 %418 to i64
%420 = getelementptr inbounds i8, i8* %416, i64 %419
%421 = bitcast i8* %420 to i32*
%422 = getelementptr inbounds i32, i32* %421, i64 2
%423 = load i32, i32* %422
%424 = shl i32 %423, 8
%425 = or i32 %415, %424
%426 = load i8*, i8** %12
%427 = load i32, i32* %16
%428 = add nsw i32 %427, 8
%429 = sext i32 %428 to i64
%430 = getelementptr inbounds i8, i8* %426, i64 %429
%431 = bitcast i8* %430 to i32*
%432 = getelementptr inbounds i32, i32* %431, i64 3
%433 = load i32, i32* %432
%434 = or i32 %425, %433
store i32 %434, i32* %18
store i32 0, i32* %17
br label %435
435: ; preds = %545, %396
%436 = load i32, i32* %17
%437 = load i32, i32* %18
%438 = icmp slt i32 %436, %437
br i1 %438, label %439, label %548
439: ; preds = %435
%440 = load i8*, i8** %12
%441 = load i32, i32* %16
%442 = add nsw i32 %441, 12
%443 = load i32, i32* %17
%444 = mul nsw i32 %443, 4
%445 = add nsw i32 %442, %444
%446 = sext i32 %445 to i64
%447 = getelementptr inbounds i8, i8* %440, i64 %446
%448 = bitcast i8* %447 to i32*
%449 = getelementptr inbounds i32, i32* %448, i64 0
%450 = load i32, i32* %449
%451 = shl i32 %450, 24
%452 = load i8*, i8** %12
%453 = load i32, i32* %16
%454 = add nsw i32 %453, 12
%455 = load i32, i32* %17
%456 = mul nsw i32 %455, 4
%457 = add nsw i32 %454, %456
%458 = sext i32 %457 to i64
%459 = getelementptr inbounds i8, i8* %452, i64 %458
%460 = bitcast i8* %459 to i32*
%461 = getelementptr inbounds i32, i32* %460, i64 1
%462 = load i32, i32* %461
%463 = shl i32 %462, 16
%464 = or i32 %451, %463
%465 = load i8*, i8** %12
%466 = load i32, i32* %16
%467 = add nsw i32 %466, 12
%468 = load i32, i32* %17
%469 = mul nsw i32 %468, 4
%470 = add nsw i32 %467, %469
%471 = sext i32 %470 to i64
%472 = getelementptr inbounds i8, i8* %465, i64 %471
%473 = bitcast i8* %472 to i32*
%474 = getelementptr inbounds i32, i32* %473, i64 2
%475 = load i32, i32* %474
%476 = shl i32 %475, 8
%477 = or i32 %464, %476
%478 = load i8*, i8** %12
%479 = load i32, i32* %16
%480 = add nsw i32 %479, 12
%481 = load i32, i32* %17
%482 = mul nsw i32 %481, 4
%483 = add nsw i32 %480, %482
%484 = sext i32 %483 to i64
%485 = getelementptr inbounds i8, i8* %478, i64 %484
%486 = bitcast i8* %485 to i32*
%487 = getelementptr inbounds i32, i32* %486, i64 3
%488 = load i32, i32* %487
%489 = or i32 %477, %488
store i32 %489, i32* %19
%490 = load i32, i32* %14
%491 = load i32, i32* %19
%492 = add nsw i32 %491, %490
store i32 %492, i32* %19
%493 = load i32, i32* %19
%494 = ashr i32 %493, 24
%495 = and i32 %494, 255
%496 = trunc i32 %495 to i8
%497 = load i8*, i8** %12
%498 = load i32, i32* %16
%499 = add nsw i32 %498, 12
%500 = load i32, i32* %17
%501 = mul nsw i32 %500, 4
%502 = add nsw i32 %499, %501
%503 = add nsw i32 %502, 0
%504 = sext i32 %503 to i64
%505 = getelementptr inbounds i8, i8* %497, i64 %504
store i8 %496, i8* %505
%506 = load i32, i32* %19
%507 = ashr i32 %506, 16
%508 = and i32 %507, 255
%509 = trunc i32 %508 to i8
%510 = load i8*, i8** %12
%511 = load i32, i32* %16
%512 = add nsw i32 %511, 12
%513 = load i32, i32* %17
%514 = mul nsw i32 %513, 4
%515 = add nsw i32 %512, %514
%516 = add nsw i32 %515, 1
%517 = sext i32 %516 to i64
%518 = getelementptr inbounds i8, i8* %510, i64 %517
store i8 %509, i8* %518
%519 = load i32, i32* %19
%520 = ashr i32 %519, 8
%521 = and i32 %520, 255
%522 = trunc i32 %521 to i8
%523 = load i8*, i8** %12
%524 = load i32, i32* %16
%525 = add nsw i32 %524, 12
%526 = load i32, i32* %17
%527 = mul nsw i32 %526, 4
%528 = add nsw i32 %525, %527
%529 = add nsw i32 %528, 2
%530 = sext i32 %529 to i64
%531 = getelementptr inbounds i8, i8* %523, i64 %530
store i8 %522, i8* %531
%532 = load i32, i32* %19
%533 = ashr i32 %532, 0
%534 = and i32 %533, 255
%535 = trunc i32 %534 to i8
%536 = load i8*, i8** %12
%537 = load i32, i32* %16
%538 = add nsw i32 %537, 12
%539 = load i32, i32* %17
%540 = mul nsw i32 %539, 4
%541 = add nsw i32 %538, %540
%542 = add nsw i32 %541, 3
%543 = sext i32 %542 to i64
%544 = getelementptr inbounds i8, i8* %536, i64 %543
store i8 %535, i8* %544
br label %545
545: ; preds = %439
%546 = load i32, i32* %17
%547 = add nsw i32 %546, 1
store i32 %547, i32* %17
br label %435
548: ; preds = %435
%549 = load i32, i32* %10
%550 = sub nsw i32 %549, 4
%551 = load i32, i32* %16
%552 = add nsw i32 %551, %550
store i32 %552, i32* %16
br label %868
553: ; preds = %309
%554 = load i32, i32* %9
%555 = icmp eq i32 %554, 1668232756
br i1 %555, label %556, label %867
556: ; preds = %553
%557 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%558 = load i8*, i8** %12
%559 = load i32, i32* %16
%560 = sub nsw i32 %559, 4
%561 = sext i32 %560 to i64
%562 = getelementptr inbounds i8, i8* %558, i64 %561
%563 = bitcast i8* %562 to i32*
%564 = getelementptr inbounds i32, i32* %563, i64 0
%565 = load i32, i32* %564
%566 = shl i32 %565, 24
%567 = load i8*, i8** %12
%568 = load i32, i32* %16
%569 = sub nsw i32 %568, 4
%570 = sext i32 %569 to i64
%571 = getelementptr inbounds i8, i8* %567, i64 %570
%572 = bitcast i8* %571 to i32*
%573 = getelementptr inbounds i32, i32* %572, i64 1
%574 = load i32, i32* %573
%575 = shl i32 %574, 16
%576 = or i32 %566, %575
%577 = load i8*, i8** %12
%578 = load i32, i32* %16
%579 = sub nsw i32 %578, 4
%580 = sext i32 %579 to i64
%581 = getelementptr inbounds i8, i8* %577, i64 %580
%582 = bitcast i8* %581 to i32*
%583 = getelementptr inbounds i32, i32* %582, i64 2
%584 = load i32, i32* %583
%585 = shl i32 %584, 8
%586 = or i32 %576, %585
%587 = load i8*, i8** %12
%588 = load i32, i32* %16
%589 = sub nsw i32 %588, 4
%590 = sext i32 %589 to i64
%591 = getelementptr inbounds i8, i8* %587, i64 %590
%592 = bitcast i8* %591 to i32*
%593 = getelementptr inbounds i32, i32* %592, i64 3
%594 = load i32, i32* %593
%595 = or i32 %586, %594
store i32 %595, i32* %10
%596 = load i32, i32* %16
%597 = load i32, i32* %10
%598 = add nsw i32 %596, %597
%599 = sub nsw i32 %598, 4
%600 = load i32, i32* %14
%601 = icmp sgt i32 %599, %600
br i1 %601, label %602, label %606
602: ; preds = %556
%603 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%604 = load i8*, i8** %12
%605 = call i32 @free(i8* %604)
store i32 1, i32* %3
br label %1004
606: ; preds = %556
%607 = load i8*, i8** %12
%608 = load i32, i32* %16
%609 = add nsw i32 %608, 8
%610 = sext i32 %609 to i64
%611 = getelementptr inbounds i8, i8* %607, i64 %610
%612 = bitcast i8* %611 to i32*
%613 = getelementptr inbounds i32, i32* %612, i64 0
%614 = load i32, i32* %613
%615 = shl i32 %614, 24
%616 = load i8*, i8** %12
%617 = load i32, i32* %16
%618 = add nsw i32 %617, 8
%619 = sext i32 %618 to i64
%620 = getelementptr inbounds i8, i8* %616, i64 %619
%621 = bitcast i8* %620 to i32*
%622 = getelementptr inbounds i32, i32* %621, i64 1
%623 = load i32, i32* %622
%624 = shl i32 %623, 16
%625 = or i32 %615, %624
%626 = load i8*, i8** %12
%627 = load i32, i32* %16
%628 = add nsw i32 %627, 8
%629 = sext i32 %628 to i64
%630 = getelementptr inbounds i8, i8* %626, i64 %629
%631 = bitcast i8* %630 to i32*
%632 = getelementptr inbounds i32, i32* %631, i64 2
%633 = load i32, i32* %632
%634 = shl i32 %633, 8
%635 = or i32 %625, %634
%636 = load i8*, i8** %12
%637 = load i32, i32* %16
%638 = add nsw i32 %637, 8
%639 = sext i32 %638 to i64
%640 = getelementptr inbounds i8, i8* %636, i64 %639
%641 = bitcast i8* %640 to i32*
%642 = getelementptr inbounds i32, i32* %641, i64 3
%643 = load i32, i32* %642
%644 = or i32 %635, %643
store i32 %644, i32* %18
store i32 0, i32* %17
br label %645
645: ; preds = %859, %606
%646 = load i32, i32* %17
%647 = load i32, i32* %18
%648 = icmp slt i32 %646, %647
br i1 %648, label %649, label %862
649: ; preds = %645
%650 = load i8*, i8** %12
%651 = load i32, i32* %16
%652 = add nsw i32 %651, 12
%653 = load i32, i32* %17
%654 = mul nsw i32 %653, 8
%655 = add nsw i32 %652, %654
%656 = sext i32 %655 to i64
%657 = getelementptr inbounds i8, i8* %650, i64 %656
%658 = bitcast i8* %657 to i32*
%659 = getelementptr inbounds i32, i32* %658, i64 0
%660 = load i32, i32* %659
%661 = shl i32 %660, 56
%662 = load i8*, i8** %12
%663 = load i32, i32* %16
%664 = add nsw i32 %663, 12
%665 = load i32, i32* %17
%666 = mul nsw i32 %665, 8
%667 = add nsw i32 %664, %666
%668 = sext i32 %667 to i64
%669 = getelementptr inbounds i8, i8* %662, i64 %668
%670 = bitcast i8* %669 to i32*
%671 = getelementptr inbounds i32, i32* %670, i64 1
%672 = load i32, i32* %671
%673 = shl i32 %672, 48
%674 = or i32 %661, %673
%675 = load i8*, i8** %12
%676 = load i32, i32* %16
%677 = add nsw i32 %676, 12
%678 = load i32, i32* %17
%679 = mul nsw i32 %678, 8
%680 = add nsw i32 %677, %679
%681 = sext i32 %680 to i64
%682 = getelementptr inbounds i8, i8* %675, i64 %681
%683 = bitcast i8* %682 to i32*
%684 = getelementptr inbounds i32, i32* %683, i64 2
%685 = load i32, i32* %684
%686 = shl i32 %685, 40
%687 = or i32 %674, %686
%688 = load i8*, i8** %12
%689 = load i32, i32* %16
%690 = add nsw i32 %689, 12
%691 = load i32, i32* %17
%692 = mul nsw i32 %691, 8
%693 = add nsw i32 %690, %692
%694 = sext i32 %693 to i64
%695 = getelementptr inbounds i8, i8* %688, i64 %694
%696 = bitcast i8* %695 to i32*
%697 = getelementptr inbounds i32, i32* %696, i64 3
%698 = load i32, i32* %697
%699 = shl i32 %698, 32
%700 = or i32 %687, %699
%701 = load i8*, i8** %12
%702 = load i32, i32* %16
%703 = add nsw i32 %702, 12
%704 = load i32, i32* %17
%705 = mul nsw i32 %704, 8
%706 = add nsw i32 %703, %705
%707 = sext i32 %706 to i64
%708 = getelementptr inbounds i8, i8* %701, i64 %707
%709 = bitcast i8* %708 to i32*
%710 = getelementptr inbounds i32, i32* %709, i64 4
%711 = load i32, i32* %710
%712 = shl i32 %711, 24
%713 = or i32 %700, %712
%714 = load i8*, i8** %12
%715 = load i32, i32* %16
%716 = add nsw i32 %715, 12
%717 = load i32, i32* %17
%718 = mul nsw i32 %717, 8
%719 = add nsw i32 %716, %718
%720 = sext i32 %719 to i64
%721 = getelementptr inbounds i8, i8* %714, i64 %720
%722 = bitcast i8* %721 to i32*
%723 = getelementptr inbounds i32, i32* %722, i64 5
%724 = load i32, i32* %723
%725 = shl i32 %724, 16
%726 = or i32 %713, %725
%727 = load i8*, i8** %12
%728 = load i32, i32* %16
%729 = add nsw i32 %728, 12
%730 = load i32, i32* %17
%731 = mul nsw i32 %730, 8
%732 = add nsw i32 %729, %731
%733 = sext i32 %732 to i64
%734 = getelementptr inbounds i8, i8* %727, i64 %733
%735 = bitcast i8* %734 to i32*
%736 = getelementptr inbounds i32, i32* %735, i64 6
%737 = load i32, i32* %736
%738 = shl i32 %737, 8
%739 = or i32 %726, %738
%740 = load i8*, i8** %12
%741 = load i32, i32* %16
%742 = add nsw i32 %741, 12
%743 = load i32, i32* %17
%744 = mul nsw i32 %743, 8
%745 = add nsw i32 %742, %744
%746 = sext i32 %745 to i64
%747 = getelementptr inbounds i8, i8* %740, i64 %746
%748 = bitcast i8* %747 to i32*
%749 = getelementptr inbounds i32, i32* %748, i64 7
%750 = load i32, i32* %749
%751 = or i32 %739, %750
store i32 %751, i32* %19
%752 = load i32, i32* %14
%753 = load i32, i32* %19
%754 = add nsw i32 %753, %752
store i32 %754, i32* %19
%755 = load i32, i32* %19
%756 = ashr i32 %755, 56
%757 = and i32 %756, 255
%758 = trunc i32 %757 to i8
%759 = load i8*, i8** %12
%760 = load i32, i32* %16
%761 = add nsw i32 %760, 12
%762 = load i32, i32* %17
%763 = mul nsw i32 %762, 8
%764 = add nsw i32 %761, %763
%765 = add nsw i32 %764, 0
%766 = sext i32 %765 to i64
%767 = getelementptr inbounds i8, i8* %759, i64 %766
store i8 %758, i8* %767
%768 = load i32, i32* %19
%769 = ashr i32 %768, 48
%770 = and i32 %769, 255
%771 = trunc i32 %770 to i8
%772 = load i8*, i8** %12
%773 = load i32, i32* %16
%774 = add nsw i32 %773, 12
%775 = load i32, i32* %17
%776 = mul nsw i32 %775, 8
%777 = add nsw i32 %774, %776
%778 = add nsw i32 %777, 1
%779 = sext i32 %778 to i64
%780 = getelementptr inbounds i8, i8* %772, i64 %779
store i8 %771, i8* %780
%781 = load i32, i32* %19
%782 = ashr i32 %781, 40
%783 = and i32 %782, 255
%784 = trunc i32 %783 to i8
%785 = load i8*, i8** %12
%786 = load i32, i32* %16
%787 = add nsw i32 %786, 12
%788 = load i32, i32* %17
%789 = mul nsw i32 %788, 8
%790 = add nsw i32 %787, %789
%791 = add nsw i32 %790, 2
%792 = sext i32 %791 to i64
%793 = getelementptr inbounds i8, i8* %785, i64 %792
store i8 %784, i8* %793
%794 = load i32, i32* %19
%795 = ashr i32 %794, 32
%796 = and i32 %795, 255
%797 = trunc i32 %796 to i8
%798 = load i8*, i8** %12
%799 = load i32, i32* %16
%800 = add nsw i32 %799, 12
%801 = load i32, i32* %17
%802 = mul nsw i32 %801, 8
%803 = add nsw i32 %800, %802
%804 = add nsw i32 %803, 3
%805 = sext i32 %804 to i64
%806 = getelementptr inbounds i8, i8* %798, i64 %805
store i8 %797, i8* %806
%807 = load i32, i32* %19
%808 = ashr i32 %807, 24
%809 = and i32 %808, 255
%810 = trunc i32 %809 to i8
%811 = load i8*, i8** %12
%812 = load i32, i32* %16
%813 = add nsw i32 %812, 12
%814 = load i32, i32* %17
%815 = mul nsw i32 %814, 8
%816 = add nsw i32 %813, %815
%817 = add nsw i32 %816, 4
%818 = sext i32 %817 to i64
%819 = getelementptr inbounds i8, i8* %811, i64 %818
store i8 %810, i8* %819
%820 = load i32, i32* %19
%821 = ashr i32 %820, 16
%822 = and i32 %821, 255
%823 = trunc i32 %822 to i8
%824 = load i8*, i8** %12
%825 = load i32, i32* %16
%826 = add nsw i32 %825, 12
%827 = load i32, i32* %17
%828 = mul nsw i32 %827, 8
%829 = add nsw i32 %826, %828
%830 = add nsw i32 %829, 5
%831 = sext i32 %830 to i64
%832 = getelementptr inbounds i8, i8* %824, i64 %831
store i8 %823, i8* %832
%833 = load i32, i32* %19
%834 = ashr i32 %833, 8
%835 = and i32 %834, 255
%836 = trunc i32 %835 to i8
%837 = load i8*, i8** %12
%838 = load i32, i32* %16
%839 = add nsw i32 %838, 12
%840 = load i32, i32* %17
%841 = mul nsw i32 %840, 8
%842 = add nsw i32 %839, %841
%843 = add nsw i32 %842, 6
%844 = sext i32 %843 to i64
%845 = getelementptr inbounds i8, i8* %837, i64 %844
store i8 %836, i8* %845
%846 = load i32, i32* %19
%847 = ashr i32 %846, 0
%848 = and i32 %847, 255
%849 = trunc i32 %848 to i8
%850 = load i8*, i8** %12
%851 = load i32, i32* %16
%852 = add nsw i32 %851, 12
%853 = load i32, i32* %17
%854 = mul nsw i32 %853, 8
%855 = add nsw i32 %852, %854
%856 = add nsw i32 %855, 7
%857 = sext i32 %856 to i64
%858 = getelementptr inbounds i8, i8* %850, i64 %857
store i8 %849, i8* %858
br label %859
859: ; preds = %649
%860 = load i32, i32* %17
%861 = add nsw i32 %860, 1
store i32 %861, i32* %17
br label %645
862: ; preds = %645
%863 = load i32, i32* %10
%864 = sub nsw i32 %863, 4
%865 = load i32, i32* %16
%866 = add nsw i32 %865, %864
store i32 %866, i32* %16
br label %867
867: ; preds = %862, %553
br label %868
868: ; preds = %867, %548
br label %869
869: ; preds = %868
%870 = load i32, i32* %16
%871 = add nsw i32 %870, 1
store i32 %871, i32* %16
br label %304
872: ; preds = %304
%873 = load i8**, i8*** %5
%874 = getelementptr inbounds i8*, i8** %873, i64 1
%875 = load i8*, i8** %874
%876 = call i32* @fopen(i8* %875, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %876, i32** %6
%877 = load i32*, i32** %6
%878 = icmp ne i32* %877, null
br i1 %878, label %886, label %879
879: ; preds = %872
%880 = load i8**, i8*** %5
%881 = getelementptr inbounds i8*, i8** %880, i64 1
%882 = load i8*, i8** %881
%883 = call i32 @perror(i8* %882)
%884 = load i8*, i8** %12
%885 = call i32 @free(i8* %884)
store i32 1, i32* %3
br label %1004
886: ; preds = %872
%887 = load i32, i32* %20
%888 = icmp sgt i32 %887, 0
br i1 %888, label %889, label %897
889: ; preds = %886
%890 = load i32*, i32** %6
%891 = load i32, i32* %20
%892 = load i32, i32* @SEEK_SET
%893 = call i32 @fseeko(i32* %890, i32 %891, i32 %892)
%894 = load i32, i32* %20
%895 = load i32, i32* %11
%896 = sub nsw i32 %895, %894
store i32 %896, i32* %11
br label %897
897: ; preds = %889, %886
%898 = load i8**, i8*** %5
%899 = getelementptr inbounds i8*, i8** %898, i64 2
%900 = load i8*, i8** %899
%901 = call i32* @fopen(i8* %900, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i32* %901, i32** %7
%902 = load i32*, i32** %7
%903 = icmp ne i32* %902, null
br i1 %903, label %913, label %904
904: ; preds = %897
%905 = load i8**, i8*** %5
%906 = getelementptr inbounds i8*, i8** %905, i64 2
%907 = load i8*, i8** %906
%908 = call i32 @perror(i8* %907)
%909 = load i32*, i32** %7
%910 = call i32 @fclose(i32* %909)
%911 = load i8*, i8** %12
%912 = call i32 @free(i8* %911)
store i32 1, i32* %3
br label %1004
913: ; preds = %897
%914 = load i32, i32* %15
%915 = icmp sgt i32 %914, 0
br i1 %915, label %916, label %929
916: ; preds = %913
%917 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0))
%918 = load i8*, i8** %13
%919 = load i32, i32* %15
%920 = load i32*, i32** %7
%921 = call i32 @fwrite(i8* %918, i32 %919, i32 1, i32* %920)
%922 = icmp ne i32 %921, 1
br i1 %922, label %923, label %928
923: ; preds = %916
%924 = load i8**, i8*** %5
%925 = getelementptr inbounds i8*, i8** %924, i64 2
%926 = load i8*, i8** %925
%927 = call i32 @perror(i8* %926)
br label %991
928: ; preds = %916
br label %929
929: ; preds = %928, %913
%930 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%931 = load i8*, i8** %12
%932 = load i32, i32* %14
%933 = load i32*, i32** %7
%934 = call i32 @fwrite(i8* %931, i32 %932, i32 1, i32* %933)
%935 = icmp ne i32 %934, 1
br i1 %935, label %936, label %941
936: ; preds = %929
%937 = load i8**, i8*** %5
%938 = getelementptr inbounds i8*, i8** %937, i64 2
%939 = load i8*, i8** %938
%940 = call i32 @perror(i8* %939)
br label %991
941: ; preds = %929
%942 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0))
br label %943
943: ; preds = %974, %941
%944 = load i32, i32* %11
%945 = icmp ne i32 %944, 0
br i1 %945, label %946, label %978
946: ; preds = %943
%947 = load i32, i32* %11
%948 = icmp sgt i32 %947, 1024
br i1 %948, label %949, label %950
949: ; preds = %946
store i32 1024, i32* %22
br label %952
950: ; preds = %946
%951 = load i32, i32* %11
store i32 %951, i32* %22
br label %952
952: ; preds = %950, %949
%953 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%954 = load i32, i32* %22
%955 = load i32*, i32** %6
%956 = call i32 @fread(i8* %953, i32 %954, i32 1, i32* %955)
%957 = icmp ne i32 %956, 1
br i1 %957, label %958, label %963
958: ; preds = %952
%959 = load i8**, i8*** %5
%960 = getelementptr inbounds i8*, i8** %959, i64 1
%961 = load i8*, i8** %960
%962 = call i32 @perror(i8* %961)
br label %991
963: ; preds = %952
%964 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%965 = load i32, i32* %22
%966 = load i32*, i32** %7
%967 = call i32 @fwrite(i8* %964, i32 %965, i32 1, i32* %966)
%968 = icmp ne i32 %967, 1
br i1 %968, label %969, label %974
969: ; preds = %963
%970 = load i8**, i8*** %5
%971 = getelementptr inbounds i8*, i8** %970, i64 2
%972 = load i8*, i8** %971
%973 = call i32 @perror(i8* %972)
br label %991
974: ; preds = %963
%975 = load i32, i32* %22
%976 = load i32, i32* %11
%977 = sub nsw i32 %976, %975
store i32 %977, i32* %11
br label %943
978: ; preds = %943
%979 = load i32*, i32** %6
%980 = call i32 @fclose(i32* %979)
%981 = load i32*, i32** %7
%982 = call i32 @fclose(i32* %981)
%983 = load i8*, i8** %12
%984 = call i32 @free(i8* %983)
%985 = load i32, i32* %15
%986 = icmp sgt i32 %985, 0
br i1 %986, label %987, label %990
987: ; preds = %978
%988 = load i8*, i8** %13
%989 = call i32 @free(i8* %988)
br label %990
990: ; preds = %987, %978
store i32 0, i32* %3
br label %1004
991: ; preds = %969, %958, %936, %923
%992 = load i32*, i32** %6
%993 = call i32 @fclose(i32* %992)
%994 = load i32*, i32** %7
%995 = call i32 @fclose(i32* %994)
%996 = load i8*, i8** %12
%997 = call i32 @free(i8* %996)
%998 = load i32, i32* %15
%999 = icmp sgt i32 %998, 0
br i1 %999, label %1000, label %1003
1000: ; preds = %991
%1001 = load i8*, i8** %13
%1002 = call i32 @free(i8* %1001)
br label %1003
1003: ; preds = %1000, %991
store i32 1, i32* %3
br label %1004
1004: ; preds = %1003, %990, %904, %879, %602, %392, %295, %258, %247, %230, %147, %133, %34, %25
%1005 = load i32, i32* %3
ret i32 %1005
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@.str.3 = [46 x i8] c"could not allocate 0x%llX byte for ftyp atom\0A\00"
@SEEK_CUR = global i32 0
@SEEK_END = global i32 0
@.str.5 = [46 x i8] c"could not allocate 0x%llX byte for moov atom\0A\00"
@SEEK_SET = global i32 0
@.str.10 = [3 x i8] c"wb\00"
@str = [22 x i8] c" writing moov atom...\00"
@str.14 = [25 x i8] c" copying rest of file...\00"
@str.15 = [22 x i8] c" writing ftyp atom...\00"
@str.16 = [23 x i8] c" patching co64 atom...\00"
@str.18 = [23 x i8] c" patching stco atom...\00"
@str.19 = [15 x i8] c" bad atom size\00"
@str.20 = [56 x i8] c"this utility does not support compressed moov atoms yet\00"
@str.21 = [38 x i8] c"last atom in file was not a moov atom\00"
@str.22 = [62 x i8] c"encountered non-QT top-level atom (is this a Quicktime file?)\00"
@str.23 = [47 x i8] c"Usage: qt-faststart <infile.mov> <outfile.mov>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.23, i64 0, i64 0))
br label %358
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %30, label %15
15: ; preds = %10
%16 = tail call i32 @feof(i32* %13)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %101
18: ; preds = %15
%19 = bitcast [8 x i8]* %3 to i32*
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 4
%21 = bitcast i8* %20 to i32*
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 1
%23 = bitcast [8 x i8]* %22 to i32*
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 1, i64 4
%25 = bitcast i8* %24 to i32*
%26 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 16
%27 = bitcast i8* %26 to i32*
%28 = call i32 @fread(i8* %5, i32 8, i32 1, i32* %13)
%29 = icmp eq i32 %28, 1
br i1 %29, label %79, label %94
30: ; preds = %10
%31 = load i8*, i8** %11
%32 = tail call i32 @perror(i8* %31)
br label %358
33: ; preds = %88
%34 = call i32 @fread(i8* %5, i32 8, i32 1, i32* %13)
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %94
36: ; preds = %79, %33
%37 = load i32, i32* %19
%38 = shl i32 %37, 24
%39 = load i32, i32* %21
%40 = shl i32 %39, 16
%41 = or i32 %40, %38
%42 = load i32, i32* %23
%43 = shl i32 %42, 8
%44 = or i32 %41, %43
%45 = load i32, i32* %25
%46 = or i32 %44, %45
%47 = shl i32 %39, 24
%48 = shl i32 %42, 16
%49 = or i32 %48, %47
%50 = shl i32 %45, 8
%51 = or i32 %49, %50
%52 = load i32, i32* %27
%53 = or i32 %51, %52
switch i32 %53, label %54 [
i32 1718909296, label %56
i32 1346978644, label %83
i32 1718773093, label %83
i32 1786080875, label %83
i32 1835295092, label %83
i32 1836019574, label %83
i32 1886285684, label %83
i32 1936419184, label %83
i32 2003395685, label %83
]
54: ; preds = %36
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.22, i64 0, i64 0))
br label %94
56: ; preds = %36
%57 = tail call i8* @malloc(i32 %46)
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%61 = tail call i32 @fclose(i32* %13)
br label %358
62: ; preds = %56
%63 = load i32, i32* @SEEK_CUR
%64 = tail call i32 @fseeko(i32* %13, i32 -8, i32 %63)
%65 = tail call i32 @fread(i8* %57, i32 %46, i32 1, i32* %13)
%66 = icmp eq i32 %65, 1
br i1 %66, label %72, label %67
67: ; preds = %62
%68 = load i8*, i8** %11
%69 = tail call i32 @perror(i8* %68)
%70 = tail call i32 @free(i8* %57)
%71 = tail call i32 @fclose(i32* %13)
br label %358
72: ; preds = %62
%73 = tail call i32 @ftello(i32* %13)
%74 = tail call i32 @feof(i32* %13)
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %101
76: ; preds = %72
%77 = call i32 @fread(i8* %5, i32 8, i32 1, i32* %13)
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %94
79: ; preds = %18, %76
%80 = phi i8* [ %57, %76 ], [ null, %18 ]
%81 = phi i32 [ %46, %76 ], [ 0, %18 ]
%82 = phi i32 [ %73, %76 ], [ 0, %18 ]
br label %36
83: ; preds = %36, %36, %36, %36, %36, %36, %36, %36
%84 = icmp eq i32 %46, 1
br i1 %84, label %85, label %88
85: ; preds = %83
%86 = call i32 @fread(i8* %5, i32 8, i32 1, i32* %13)
%87 = icmp ne i32 %86, 1
br label %94
88: ; preds = %83
%89 = add nsw i32 %46, -8
%90 = load i32, i32* @SEEK_CUR
%91 = tail call i32 @fseeko(i32* %13, i32 %89, i32 %90)
%92 = tail call i32 @feof(i32* %13)
%93 = icmp eq i32 %92, 0
br i1 %93, label %33, label %94
94: ; preds = %76, %33, %88, %18, %85, %54
%95 = phi i32 [ %82, %54 ], [ %82, %85 ], [ 0, %18 ], [ %82, %88 ], [ %82, %33 ], [ %73, %76 ]
%96 = phi i32 [ %81, %54 ], [ %81, %85 ], [ 0, %18 ], [ %81, %88 ], [ %81, %33 ], [ %46, %76 ]
%97 = phi i8* [ %80, %54 ], [ %80, %85 ], [ null, %18 ], [ %80, %88 ], [ %80, %33 ], [ %57, %76 ]
%98 = phi i32 [ %53, %54 ], [ %53, %85 ], [ 0, %18 ], [ %53, %88 ], [ %53, %33 ], [ 1718909296, %76 ]
%99 = phi i32 [ %46, %54 ], [ 1, %85 ], [ 0, %18 ], [ %46, %88 ], [ %46, %33 ], [ %46, %76 ]
%100 = icmp eq i32 %98, 1836019574
br i1 %100, label %104, label %101
101: ; preds = %72, %15, %94
%102 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.21, i64 0, i64 0))
%103 = tail call i32 @fclose(i32* %13)
br label %358
104: ; preds = %94
%105 = sub nsw i32 0, %99
%106 = load i32, i32* @SEEK_END
%107 = tail call i32 @fseeko(i32* %13, i32 %105, i32 %106)
%108 = tail call i32 @ftello(i32* %13)
%109 = tail call i8* @malloc(i32 %99)
%110 = icmp eq i8* %109, null
br i1 %110, label %111, label %114
111: ; preds = %104
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %99)
%113 = tail call i32 @fclose(i32* %13)
br label %358
114: ; preds = %104
%115 = tail call i32 @fread(i8* %109, i32 %99, i32 1, i32* %13)
%116 = icmp eq i32 %115, 1
br i1 %116, label %122, label %117
117: ; preds = %114
%118 = load i8*, i8** %11
%119 = tail call i32 @perror(i8* %118)
%120 = tail call i32 @free(i8* %109)
%121 = tail call i32 @fclose(i32* %13)
br label %358
122: ; preds = %114
%123 = getelementptr inbounds i8, i8* %109, i64 12
%124 = bitcast i8* %123 to i32*
%125 = load i32, i32* %124
%126 = shl i32 %125, 24
%127 = getelementptr inbounds i8, i8* %109, i64 16
%128 = bitcast i8* %127 to i32*
%129 = load i32, i32* %128
%130 = shl i32 %129, 16
%131 = or i32 %130, %126
%132 = getelementptr inbounds i8, i8* %109, i64 20
%133 = bitcast i8* %132 to i32*
%134 = load i32, i32* %133
%135 = shl i32 %134, 8
%136 = or i32 %131, %135
%137 = getelementptr inbounds i8, i8* %109, i64 24
%138 = bitcast i8* %137 to i32*
%139 = load i32, i32* %138
%140 = or i32 %136, %139
%141 = icmp eq i32 %140, 1668116342
br i1 %141, label %142, label %146
142: ; preds = %122
%143 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.20, i64 0, i64 0))
%144 = tail call i32 @free(i8* %109)
%145 = tail call i32 @fclose(i32* %13)
br label %358
146: ; preds = %122
%147 = tail call i32 @fclose(i32* %13)
%148 = add nsw i32 %99, -4
%149 = icmp sgt i32 %99, 8
br i1 %149, label %150, label %293
150: ; preds = %146, %289
%151 = phi i32 [ %291, %289 ], [ 4, %146 ]
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i8, i8* %109, i64 %152
%154 = bitcast i8* %153 to i32*
%155 = load i32, i32* %154
%156 = shl i32 %155, 24
%157 = getelementptr inbounds i8, i8* %153, i64 4
%158 = bitcast i8* %157 to i32*
%159 = load i32, i32* %158
%160 = shl i32 %159, 16
%161 = or i32 %160, %156
%162 = getelementptr inbounds i8, i8* %153, i64 8
%163 = bitcast i8* %162 to i32*
%164 = load i32, i32* %163
%165 = shl i32 %164, 8
%166 = or i32 %161, %165
%167 = getelementptr inbounds i8, i8* %153, i64 12
%168 = bitcast i8* %167 to i32*
%169 = load i32, i32* %168
%170 = or i32 %166, %169
switch i32 %170, label %289 [
i32 1937007471, label %171
i32 1668232756, label %262
]
171: ; preds = %150
%172 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.18, i64 0, i64 0))
%173 = add i32 %151, -4
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i8, i8* %109, i64 %174
%176 = bitcast i8* %175 to i32*
%177 = load i32, i32* %176
%178 = shl i32 %177, 24
%179 = getelementptr inbounds i8, i8* %175, i64 4
%180 = bitcast i8* %179 to i32*
%181 = load i32, i32* %180
%182 = shl i32 %181, 16
%183 = or i32 %182, %178
%184 = getelementptr inbounds i8, i8* %175, i64 8
%185 = bitcast i8* %184 to i32*
%186 = load i32, i32* %185
%187 = shl i32 %186, 8
%188 = or i32 %183, %187
%189 = getelementptr inbounds i8, i8* %175, i64 12
%190 = bitcast i8* %189 to i32*
%191 = load i32, i32* %190
%192 = or i32 %188, %191
%193 = add i32 %173, %192
%194 = icmp sgt i32 %193, %99
br i1 %194, label %195, label %198
195: ; preds = %171
%196 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.19, i64 0, i64 0))
%197 = tail call i32 @free(i8* %109)
br label %358
198: ; preds = %171
%199 = add nsw i32 %151, 8
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i8, i8* %109, i64 %200
%202 = bitcast i8* %201 to i32*
%203 = load i32, i32* %202
%204 = shl i32 %203, 24
%205 = getelementptr inbounds i8, i8* %201, i64 4
%206 = bitcast i8* %205 to i32*
%207 = load i32, i32* %206
%208 = shl i32 %207, 16
%209 = or i32 %208, %204
%210 = getelementptr inbounds i8, i8* %201, i64 8
%211 = bitcast i8* %210 to i32*
%212 = load i32, i32* %211
%213 = shl i32 %212, 8
%214 = or i32 %209, %213
%215 = getelementptr inbounds i8, i8* %201, i64 12
%216 = bitcast i8* %215 to i32*
%217 = load i32, i32* %216
%218 = or i32 %214, %217
%219 = icmp sgt i32 %218, 0
br i1 %219, label %220, label %289
220: ; preds = %198
%221 = add nsw i32 %151, 12
%222 = sext i32 %221 to i64
%223 = zext i32 %218 to i64
br label %224
224: ; preds = %220, %224
%225 = phi i64 [ 0, %220 ], [ %260, %224 ]
%226 = shl nsw i64 %225, 2
%227 = add nsw i64 %226, %222
%228 = getelementptr inbounds i8, i8* %109, i64 %227
%229 = bitcast i8* %228 to i32*
%230 = load i32, i32* %229
%231 = shl i32 %230, 24
%232 = getelementptr inbounds i8, i8* %228, i64 4
%233 = bitcast i8* %232 to i32*
%234 = load i32, i32* %233
%235 = shl i32 %234, 16
%236 = or i32 %235, %231
%237 = getelementptr inbounds i8, i8* %228, i64 8
%238 = bitcast i8* %237 to i32*
%239 = load i32, i32* %238
%240 = shl i32 %239, 8
%241 = or i32 %236, %240
%242 = getelementptr inbounds i8, i8* %228, i64 12
%243 = bitcast i8* %242 to i32*
%244 = load i32, i32* %243
%245 = or i32 %241, %244
%246 = add nsw i32 %245, %99
%247 = lshr i32 %246, 24
%248 = trunc i32 %247 to i8
store i8 %248, i8* %228
%249 = lshr i32 %246, 16
%250 = trunc i32 %249 to i8
%251 = add nsw i64 %227, 1
%252 = getelementptr inbounds i8, i8* %109, i64 %251
store i8 %250, i8* %252
%253 = lshr i32 %246, 8
%254 = trunc i32 %253 to i8
%255 = add nsw i64 %227, 2
%256 = getelementptr inbounds i8, i8* %109, i64 %255
store i8 %254, i8* %256
%257 = trunc i32 %246 to i8
%258 = add nsw i64 %227, 3
%259 = getelementptr inbounds i8, i8* %109, i64 %258
store i8 %257, i8* %259
%260 = add nuw nsw i64 %225, 1
%261 = icmp eq i64 %260, %223
br i1 %261, label %289, label %224
262: ; preds = %150
%263 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.16, i64 0, i64 0))
%264 = add i32 %151, -4
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds i8, i8* %109, i64 %265
%267 = bitcast i8* %266 to i32*
%268 = load i32, i32* %267
%269 = shl i32 %268, 24
%270 = getelementptr inbounds i8, i8* %266, i64 4
%271 = bitcast i8* %270 to i32*
%272 = load i32, i32* %271
%273 = shl i32 %272, 16
%274 = or i32 %273, %269
%275 = getelementptr inbounds i8, i8* %266, i64 8
%276 = bitcast i8* %275 to i32*
%277 = load i32, i32* %276
%278 = shl i32 %277, 8
%279 = or i32 %274, %278
%280 = getelementptr inbounds i8, i8* %266, i64 12
%281 = bitcast i8* %280 to i32*
%282 = load i32, i32* %281
%283 = or i32 %279, %282
%284 = add i32 %264, %283
%285 = icmp sgt i32 %284, %99
br i1 %285, label %286, label %289
286: ; preds = %262
%287 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.19, i64 0, i64 0))
%288 = tail call i32 @free(i8* %109)
br label %358
289: ; preds = %224, %262, %198, %150
%290 = phi i32 [ %151, %150 ], [ %193, %198 ], [ %284, %262 ], [ %193, %224 ]
%291 = add nsw i32 %290, 1
%292 = icmp slt i32 %291, %148
br i1 %292, label %150, label %293
293: ; preds = %289, %146
%294 = load i8*, i8** %11
%295 = tail call i32* @fopen(i8* %294, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%296 = icmp eq i32* %295, null
br i1 %296, label %297, label %301
297: ; preds = %293
%298 = load i8*, i8** %11
%299 = tail call i32 @perror(i8* %298)
%300 = tail call i32 @free(i8* %109)
br label %358
301: ; preds = %293
%302 = icmp sgt i32 %95, 0
br i1 %302, label %303, label %307
303: ; preds = %301
%304 = load i32, i32* @SEEK_SET
%305 = tail call i32 @fseeko(i32* %295, i32 %95, i32 %304)
%306 = sub nsw i32 %108, %95
br label %307
307: ; preds = %303, %301
%308 = phi i32 [ %306, %303 ], [ %108, %301 ]
%309 = getelementptr inbounds i8*, i8** %1, i64 2
%310 = load i8*, i8** %309
%311 = tail call i32* @fopen(i8* %310, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%312 = icmp eq i32* %311, null
br i1 %312, label %313, label %318
313: ; preds = %307
%314 = load i8*, i8** %309
%315 = tail call i32 @perror(i8* %314)
%316 = tail call i32 @fclose(i32* null)
%317 = tail call i32 @free(i8* %109)
br label %358
318: ; preds = %307
%319 = icmp sgt i32 %96, 0
br i1 %319, label %320, label %324
320: ; preds = %318
%321 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.15, i64 0, i64 0))
%322 = tail call i32 @fwrite(i8* %97, i32 %96, i32 1, i32* %311)
%323 = icmp eq i32 %322, 1
br i1 %323, label %324, label %349
324: ; preds = %320, %318
%325 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%326 = tail call i32 @fwrite(i8* %109, i32 %99, i32 1, i32* %311)
%327 = icmp eq i32 %326, 1
br i1 %327, label %328, label %349
328: ; preds = %324
%329 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.14, i64 0, i64 0))
%330 = icmp eq i32 %308, 0
br i1 %330, label %343, label %333
331: ; preds = %339
%332 = icmp eq i32 %342, 0
br i1 %332, label %343, label %333
333: ; preds = %328, %331
%334 = phi i32 [ %342, %331 ], [ %308, %328 ]
%335 = icmp slt i32 %334, 1024
%336 = select i1 %335, i32 %334, i32 1024
%337 = call i32 @fread(i8* %6, i32 %336, i32 1, i32* %295)
%338 = icmp eq i32 %337, 1
br i1 %338, label %339, label %349
339: ; preds = %333
%340 = call i32 @fwrite(i8* %6, i32 %336, i32 1, i32* %311)
%341 = icmp eq i32 %340, 1
%342 = sub nsw i32 %334, %336
br i1 %341, label %331, label %349
343: ; preds = %331, %328
%344 = tail call i32 @fclose(i32* %295)
%345 = tail call i32 @fclose(i32* %311)
%346 = tail call i32 @free(i8* %109)
br i1 %319, label %347, label %358
347: ; preds = %343
%348 = tail call i32 @free(i8* %97)
br label %358
349: ; preds = %339, %333, %324, %320
%350 = phi i8** [ %309, %320 ], [ %309, %324 ], [ %11, %333 ], [ %309, %339 ]
%351 = load i8*, i8** %350
%352 = tail call i32 @perror(i8* %351)
%353 = tail call i32 @fclose(i32* %295)
%354 = tail call i32 @fclose(i32* %311)
%355 = tail call i32 @free(i8* %109)
br i1 %319, label %356, label %358
356: ; preds = %349
%357 = tail call i32 @free(i8* %97)
br label %358
358: ; preds = %349, %356, %343, %347, %313, %297, %286, %195, %142, %117, %111, %101, %67, %59, %30, %8
%359 = phi i32 [ 0, %8 ], [ 0, %101 ], [ 1, %117 ], [ 1, %142 ], [ 1, %195 ], [ 1, %286 ], [ 1, %313 ], [ 1, %297 ], [ 1, %111 ], [ 1, %67 ], [ 1, %59 ], [ 1, %30 ], [ 0, %347 ], [ 0, %343 ], [ 1, %356 ], [ 1, %349 ]
ret i32 %359
}