#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ *stderr;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ *strstr(char *, char *);
int main(int _argc, char *_argv[]) {
  FILE *in_y;
  FILE *in_u;
  FILE *in_v;
  FILE *in_a;
  FILE *in_f;
  FILE *out_y4m;
  int y_w;
  int y_h;
  int c_w;
  int c_h;
  char ip;
  int fps_n;
  int fps_d;
  int par_n;
  int par_d;
  char *chroma;
  int have_chroma;
  int have_alpha;
  int frame_digits;
  int separate_planes;
  unsigned char *buf;
  char fname[8192];
  int frame_num;
  int argi;
  if (_argc < 2) {
    fprintf(
        stderr,
        "Usage: yuv2yuv4mpeg <sequence_qcif> [-p | -d<digits>] [<options>]\n"
        "Converts one or more raw data files in a sequence into a single\n"
        " YUV4MPEG file with appropriate headers to describe the video "
        "format.\n"
        "\n"
        "The type of input read is controlled by one or more of:\n"
        " -p              Input is split by component.\n"
        "                 Opens up three files, <sequence>.y, <sequence>.u,\n"
        "                  and <sequence>.v containing raw, unpadded image\n"
        "                  data for each component, respectively.\n"
        "                 If only a Y' component is present, <sequence>.y is\n"
        "                  used.\n"
        "                 If an alpha component is present, <sequence>.a is\n"
        "                  used.\n"
        "                 Which components are present is determined from the\n"
        "                  -c flag described below.\n"
        " -d<digits>      Input is split by frame.\n"
        "                 Opens up <sequence><ddd>.yuv for frame <ddd>\n"
        "                  containing raw, unpadded image data for all three\n"
        "                  components.\n"
        "                 <digits> specifies the number of decimal digits in\n"
        "                  the frame number <ddd>.\n"
        " If both of these options are be specified, the three files\n"
        "  <sequence><ddd>.y, <sequence><ddd>.u, and <sequence><ddd>.v are\n"
        "  opened for each frame.\n"
        " If neither of these options are specified, a single <sequence>.yuv\n"
        "  file is opened, containing, the raw, unpadded image data for all\n"
        "  components of all frames.\n"
        " This must be organized in a planar fashion, with each complete "
        "frame\n"
        "  in one block, in the order Y, U (Cb), V (Cr), alpha.\n"
        " Which components are present is determined from the -c flag "
        "described\n"
        "  below.\n"
        "\n"
        "The default input video format is 29.97 fps progressive QCIF.\n"
        "Options:\n"
        " -w<width>\n"
        " -h<height>\n"
        " -fn<frame rate numerator>\n"
        " -fd<frame rate denominator>\n"
        " -i<p|t|b>       Progressive or Top-field first or Bottom-field "
        "first.\n"
        " -c<chroma>      Chroma subsampling format. One of:\n"
        "                   420jpeg\n"
        "                   420mpeg2\n"
        "                   420paldv\n"
        "                   411\n"
        "                   422\n"
        "                   444\n"
        "                   444alpha\n"
        "                   mono\n"
        " -an<pixel aspect numerator>\n"
        " -ad<pixel aspect denominator>\n"
        " Note: Most common frame sizes do not use square pixels:\n"
        "  Name  Width  Height  -an   -ad\n"
        "        720    576     128   117\n"
        "  CIF   352    288     128   117\n"
        "  QCIF  176    144     128   117\n"
        "        720    480     4320  4739\n"
        "  SIF   352    240     4320  4739\n"
        " The HD TV sizes (1920x1080, 1280x720) really do use square pixels.\n"
        " -o<offset>      The first frame number to use in -d mode.\n"
        "                 If unspecified, 0 is used.\n");
    return -1;
  }
  frame_digits = frame_num = separate_planes = 0;
  in_y = in_u = in_v = in_a = in_f = NULL;
  y_w = 176;
  y_h = 144;
  fps_n = 30000;
  fps_d = 1001;
  ip = 'p';
  par_n = 128;
  par_d = 117;
  chroma = "420jpeg";
  for (argi = 2; argi < _argc; argi++) {
    if (_argv[argi][0] != '-') {
      fprintf(stderr, "Error parsing arguments: must start with '-'.\n");
      return -1;
    }
    switch (_argv[argi][1]) {
    case 'p':
      separate_planes = 1;
      break;
    case 'd':
      frame_digits = atoi(_argv[argi] + 2);
      break;
    case 'w':
      y_w = atoi(_argv[argi] + 2);
      break;
    case 'h':
      y_h = atoi(_argv[argi] + 2);
      break;
    case 'i':
      ip = _argv[argi][2];
      break;
    case 'c':
      chroma = _argv[argi] + 2;
      break;
    case 'f': {
      if (_argv[argi][2] == 'n') {
        fps_n = atoi(_argv[argi] + 3);
        break;
      } else if (_argv[argi][2] == 'd') {
        fps_d = atoi(_argv[argi] + 3);
        break;
      }
    }
    case 'a': {
      if (_argv[argi][2] == 'n') {
        par_n = atoi(_argv[argi] + 3);
        break;
      } else if (_argv[argi][2] == 'd') {
        par_d = atoi(_argv[argi] + 3);
        break;
      }
    }
    case 'o':
      frame_num = atoi(_argv[argi] + 2);
      break;
    default: {
      fprintf(stderr, "Error parsing arguments: unknown switch '%c'.\n",
              _argv[argi][1]);
      return -1;
    }
    }
  }
  if (strncmp(chroma, "420", 3) == 0) {
    c_w = y_w + 1 >> 1;
    c_h = y_h + 1 >> 1;
    have_chroma = 1;
  } else if (strncmp(chroma, "411", 3) == 0) {
    c_w = y_w + 3 >> 2;
    c_h = y_h;
    have_chroma = 1;
  } else if (strcmp(chroma, "422") == 0) {
    c_w = y_w + 1 >> 1;
    c_h = y_h;
    have_chroma = 1;
  } else if (strncmp(chroma, "444", 3) == 0) {
    c_w = y_w;
    c_h = y_h;
    have_chroma = 1;
  } else if (strncmp(chroma, "mono", 4) == 0) {
    c_w = c_h = 0;
    have_chroma = 0;
  } else {
    fprintf(stderr, "Error parsing arguments: Unsupported chroma mode: %s.\n",
            chroma);
    return -1;
  }
  have_alpha = strstr(chroma, "alpha") != NULL;
  if (frame_digits < 0)
    frame_digits = 0;
  if (strlen(_argv[1]) > 8178 - frame_digits) {
    fprintf(stderr, "File name too long.\n");
    return -1;
  }
  if (separate_planes) {
    if (frame_digits > 0) {
      sprintf(fname, "%s%0*d.y", _argv[1], frame_digits, frame_num);
      in_y = fopen(fname, "rb");
      if (have_chroma) {
        sprintf(fname, "%s%0*d.u", _argv[1], frame_digits, frame_num);
        in_u = fopen(fname, "rb");
        sprintf(fname, "%s%0*d.v", _argv[1], frame_digits, frame_num);
        in_v = fopen(fname, "rb");
      }
      if (have_alpha) {
        sprintf(fname, "%s%0*d.a", _argv[1], frame_digits, frame_num);
        in_a = fopen(fname, "rb");
      }
    } else {
      sprintf(fname, "%s.y", _argv[1]);
      in_y = fopen(fname, "rb");
      if (have_chroma) {
        sprintf(fname, "%s.u", _argv[1]);
        in_u = fopen(fname, "rb");
        sprintf(fname, "%s.v", _argv[1]);
        in_v = fopen(fname, "rb");
      }
      if (have_alpha) {
        sprintf(fname, "%s.a", _argv[1]);
        in_a = fopen(fname, "rb");
      }
    }
  } else {
    if (frame_digits > 0) {
      sprintf(fname, "%s%0*d.yuv", _argv[1], frame_digits, frame_num);
      in_f = fopen(fname, "rb");
    } else {
      sprintf(fname, "%s.yuv", _argv[1]);
      in_f = fopen(fname, "rb");
    }
    in_y = in_f;
    if (have_chroma)
      in_u = in_v = in_f;
    if (have_alpha)
      in_a = in_f;
  }
  if (in_y == NULL || have_chroma && (in_u == NULL || in_v == NULL) ||
      have_alpha && in_a == NULL) {
    fprintf(stderr, "Error opening input file(s).\n");
    return -1;
  }
  sprintf(fname, "%s.y4m", _argv[1]);
  out_y4m = fopen(fname, "wb");
  if (out_y4m == NULL) {
    fprintf(stderr, "Error opening output file.\n");
    return -1;
  }
  fprintf(out_y4m, "YUV4MPEG2 W%i H%i F%i:%i I%c A%i:%i", y_w, y_h, fps_n,
          fps_d, ip, par_n, par_d);
  if (strcmp(chroma, "420jpeg") != 0)
    fprintf(out_y4m, " C%s", chroma);
  fprintf(out_y4m, "\n");
  buf = (unsigned char *)malloc((size_t)(y_w * y_h));
  for (;;) {
    if (fread(buf, y_w, y_h, in_y) < y_h)
      break;
    fprintf(out_y4m, "FRAME\n");
    fwrite(buf, y_w, y_h, out_y4m);
    if (have_chroma) {
      fread(buf, c_w, c_h, in_u);
      fwrite(buf, c_w, c_h, out_y4m);
      fread(buf, c_w, c_h, in_v);
      fwrite(buf, c_w, c_h, out_y4m);
    }
    if (have_alpha) {
      fread(buf, y_w, y_h, in_a);
      fwrite(buf, y_w, y_h, out_y4m);
    }
    if (frame_digits > 0) {
      frame_num++;
      if (separate_planes) {
        sprintf(fname, "%s%0*d.y", _argv[1], frame_digits, frame_num);
        fclose(in_y);
        in_y = fopen(fname, "rb");
        if (have_chroma) {
          sprintf(fname, "%s%0*d.u", _argv[1], frame_digits, frame_num);
          fclose(in_u);
          in_u = fopen(fname, "rb");
          sprintf(fname, "%s%0*d.v", _argv[1], frame_digits, frame_num);
          fclose(in_v);
          in_v = fopen(fname, "rb");
        }
        if (have_alpha) {
          sprintf(fname, "%s%0*d.a", _argv[1], frame_digits, frame_num);
          fclose(in_a);
          in_a = fopen(fname, "rb");
        }
      } else {
        sprintf(fname, "%s%0*d.yuv", _argv[1], frame_digits, frame_num);
        fclose(in_f);
        in_f = fopen(fname, "rb");
        in_y = in_f;
        if (have_chroma)
          in_u = in_v = in_f;
        if (have_alpha)
          in_a = in_f;
      }
      if (in_y == NULL || have_chroma && (in_u == NULL || in_v == NULL) ||
          have_alpha && in_a == NULL) {
        break;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1207 <main+0x47>
mov    0x2df6(%rip),%rax
mov    (%rax),%rdi
lea    0xe68(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1e34 <main+0xc74>
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x2094(%rbp)
movl   $0x0,-0x7c(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0xb0,-0x44(%rbp)
movl   $0x90,-0x48(%rbp)
movl   $0x7530,-0x58(%rbp)
movl   $0x3e9,-0x5c(%rbp)
movb   $0x70,-0x51(%rbp)
movl   $0x80,-0x60(%rbp)
movl   $0x75,-0x64(%rbp)
lea    0x17fa(%rip),%rax
mov    %rax,-0x70(%rbp)
movl   $0x2,-0x2098(%rbp)
mov    -0x2098(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1530 <main+0x370>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     12d8 <main+0x118>
mov    0x2d25(%rip),%rax
mov    (%rax),%rdi
lea    0x17b9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1e34 <main+0xc74>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x20a0(%rbp)
sub    $0x16,%eax
ja     14e0 <main+0x320>
mov    -0x20a0(%rbp),%rax
lea    0xcf2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x80(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x7c(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x44(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x48(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x2(%rax),%al
mov    %al,-0x51(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    $0x2,%rax
mov    %rax,-0x70(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x6e,%eax
jne    13f5 <main+0x235>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x58(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x64,%eax
jne    1431 <main+0x271>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x5c(%rbp)
jmp    1517 <main+0x357>
jmp    1436 <main+0x276>
jmp    143b <main+0x27b>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x6e,%eax
jne    1477 <main+0x2b7>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x60(%rbp)
jmp    1517 <main+0x357>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x64,%eax
jne    14b3 <main+0x2f3>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x64(%rbp)
jmp    1517 <main+0x357>
jmp    14b8 <main+0x2f8>
jmp    14bd <main+0x2fd>
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x2094(%rbp)
jmp    1517 <main+0x357>
mov    0x2af9(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2098(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%edx
lea    0x15a9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1e34 <main+0xc74>
jmp    151c <main+0x35c>
mov    -0x2098(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2098(%rbp)
jmp    128a <main+0xca>
mov    -0x70(%rbp),%rdi
lea    0x15a1(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1573 <main+0x3b3>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x50(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    1694 <main+0x4d4>
mov    -0x70(%rbp),%rdi
lea    0x1562(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    15b0 <main+0x3f0>
mov    -0x44(%rbp),%eax
add    $0x3,%eax
sar    $0x2,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x50(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    168f <main+0x4cf>
mov    -0x70(%rbp),%rdi
lea    0x1529(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    15e8 <main+0x428>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x50(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    168a <main+0x4ca>
mov    -0x70(%rbp),%rdi
lea    0x14f5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    161f <main+0x45f>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x50(%rbp)
movl   $0x1,-0x74(%rbp)
jmp    1685 <main+0x4c5>
mov    -0x70(%rbp),%rdi
lea    0x14c2(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1658 <main+0x498>
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x74(%rbp)
jmp    1680 <main+0x4c0>
mov    0x2981(%rip),%rax
mov    (%rax),%rdi
mov    -0x70(%rbp),%rdx
lea    0x1484(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1e34 <main+0xc74>
jmp    1685 <main+0x4c5>
jmp    168a <main+0x4ca>
jmp    168f <main+0x4cf>
jmp    1694 <main+0x4d4>
mov    -0x70(%rbp),%rdi
lea    0x1489(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x7c(%rbp)
jge    16c4 <main+0x504>
movl   $0x0,-0x7c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <strlen@plt>
mov    $0x1ff2,%ecx
sub    -0x7c(%rbp),%ecx
cmp    %ecx,%eax
jle    1705 <main+0x545>
mov    0x28f8(%rip),%rax
mov    (%rax),%rdi
lea    0x143c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1e34 <main+0xc74>
cmpl   $0x0,-0x80(%rbp)
je     1918 <main+0x758>
cmpl   $0x0,-0x7c(%rbp)
jle    182a <main+0x66a>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0x140a(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x13fe(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x74(%rbp)
je     17dd <main+0x61d>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0x13ce(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x13b6(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0x1399(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x1378(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x78(%rbp)
je     1825 <main+0x665>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0x135a(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x1330(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
jmp    1913 <main+0x753>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x132a(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x12f7(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x74(%rbp)
je     18d0 <main+0x710>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x12f1(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x12b9(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x12c2(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x1285(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x78(%rbp)
je     190e <main+0x74e>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x1289(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x1247(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
jmp    1913 <main+0x753>
jmp    19ce <main+0x80e>
cmpl   $0x0,-0x7c(%rbp)
jle    1965 <main+0x7a5>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0x123c(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x11f5(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
jmp    1999 <main+0x7d9>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x120e(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x11bc(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x74(%rbp)
je     19b7 <main+0x7f7>
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x78(%rbp)
je     19c9 <main+0x809>
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    19ce <main+0x80e>
cmpq   $0x0,-0x18(%rbp)
je     1a0e <main+0x84e>
cmpl   $0x0,-0x74(%rbp)
je     19f9 <main+0x839>
cmpq   $0x0,-0x20(%rbp)
je     1a0e <main+0x84e>
cmpq   $0x0,-0x28(%rbp)
je     1a0e <main+0x84e>
cmpl   $0x0,-0x78(%rbp)
je     1a32 <main+0x872>
cmpq   $0x0,-0x30(%rbp)
jne    1a32 <main+0x872>
mov    0x25cb(%rip),%rax
mov    (%rax),%rdi
lea    0x1171(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1e34 <main+0xc74>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0x1166(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x2090(%rbp),%rdi
lea    0x1158(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1a95 <main+0x8d5>
mov    0x2568(%rip),%rax
mov    (%rax),%rdi
lea    0x1136(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1e34 <main+0xc74>
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    -0x48(%rbp),%ecx
mov    -0x58(%rbp),%r8d
mov    -0x5c(%rbp),%r9d
movsbl -0x51(%rbp),%r11d
mov    -0x60(%rbp),%r10d
mov    -0x64(%rbp),%eax
lea    0x111a(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x70(%rbp),%rdi
lea    0xf9d(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1afe <main+0x93e>
mov    -0x40(%rbp),%rdi
mov    -0x70(%rbp),%rdx
lea    0x1101(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x40(%rbp),%rdi
lea    0xfa2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x44(%rbp),%eax
imul   -0x48(%rbp),%eax
movslq %eax,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <fread@plt>
cmp    -0x48(%rbp),%eax
jge    1b4a <main+0x98a>
jmp    1e2d <main+0xc6d>
mov    -0x40(%rbp),%rdi
lea    0x10a8(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x40(%rbp),%rcx
call   10d0 <fwrite@plt>
cmpl   $0x0,-0x74(%rbp)
je     1bd4 <main+0xa14>
mov    -0x88(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <fread@plt>
mov    -0x88(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x40(%rbp),%rcx
call   10d0 <fwrite@plt>
mov    -0x88(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1040 <fread@plt>
mov    -0x88(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x40(%rbp),%rcx
call   10d0 <fwrite@plt>
cmpl   $0x0,-0x78(%rbp)
je     1c0a <main+0xa4a>
mov    -0x88(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x30(%rbp),%rcx
call   1040 <fread@plt>
mov    -0x88(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x40(%rbp),%rcx
call   10d0 <fwrite@plt>
cmpl   $0x0,-0x7c(%rbp)
jle    1e28 <main+0xc68>
mov    -0x2094(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2094(%rbp)
cmpl   $0x0,-0x80(%rbp)
je     1d62 <main+0xba2>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0xef6(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x2090(%rbp),%rdi
lea    0xee1(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x74(%rbp)
je     1d0c <main+0xb4c>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x2090(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0xe73(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x2090(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x78(%rbp)
je     1d5d <main+0xb9d>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0xe2b(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x2090(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
jmp    1dde <main+0xc1e>
lea    -0x2090(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x2094(%rbp),%r8d
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x2090(%rbp),%rdi
lea    0xdac(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x74(%rbp)
je     1dc7 <main+0xc07>
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x78(%rbp)
je     1dd9 <main+0xc19>
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1dde <main+0xc1e>
cmpq   $0x0,-0x18(%rbp)
je     1e1e <main+0xc5e>
cmpl   $0x0,-0x74(%rbp)
je     1e09 <main+0xc49>
cmpq   $0x0,-0x20(%rbp)
je     1e1e <main+0xc5e>
cmpq   $0x0,-0x28(%rbp)
je     1e1e <main+0xc5e>
cmpl   $0x0,-0x78(%rbp)
je     1e23 <main+0xc63>
cmpq   $0x0,-0x30(%rbp)
jne    1e23 <main+0xc63>
jmp    1e2d <main+0xc6d>
jmp    1e28 <main+0xc68>
jmp    1b26 <main+0x966>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2098,%rsp
cmp    $0x2,%edi
jge    11f1 <main+0x31>
mov    0x2e03(%rip),%rax
mov    (%rax),%rcx
lea    0xe75(%rip),%rdi
mov    $0xa19,%esi
jmp    1982 <main+0x7c2>
mov    %rsi,%r13
jne    125a <main+0x9a>
movl   $0x0,0x14(%rsp)
lea    0x1871(%rip),%rax
mov    %rax,0x18(%rsp)
mov    $0x75,%eax
mov    %rax,0x78(%rsp)
mov    $0x80,%eax
mov    %rax,0x80(%rsp)
movl   $0x3e9,0x5c(%rsp)
movl   $0x7530,0x58(%rsp)
movb   $0x70,0x48(%rsp)
mov    $0x90,%eax
mov    %rax,0x40(%rsp)
mov    $0xb0,%eax
mov    %rax,0x38(%rsp)
xor    %r14d,%r14d
movl   $0x0,0x8(%rsp)
jmp    13d3 <main+0x213>
mov    %edi,%ebp
mov    $0xb0,%eax
mov    %rax,0x38(%rsp)
mov    $0x90,%eax
mov    %rax,0x40(%rsp)
movb   $0x70,0x48(%rsp)
movl   $0x7530,0x58(%rsp)
movl   $0x3e9,0x5c(%rsp)
mov    $0x80,%eax
mov    %rax,0x80(%rsp)
mov    $0x75,%eax
mov    %rax,0x78(%rsp)
lea    0x17d3(%rip),%rax
mov    %rax,0x18(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x2,%ebx
lea    0xd44(%rip),%r12
xor    %r15d,%r15d
movl   $0x0,0x14(%rsp)
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,8),%rdi
cmpb   $0x2d,(%rdi)
jne    14b8 <main+0x2f8>
movsbl 0x1(%rdi),%edx
lea    -0x61(%rdx),%eax
cmp    $0x16,%eax
ja     1cce <main+0xb0e>
mov    $0x1,%r14d
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
movzbl 0x2(%rdi),%eax
jmp    1341 <main+0x181>
add    $0x2,%rdi
mov    %rdi,0x18(%rsp)
jmp    13c0 <main+0x200>
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %eax,0x14(%rsp)
jmp    13c0 <main+0x200>
movzbl 0x2(%rdi),%eax
cmp    $0x64,%al
je     13a5 <main+0x1e5>
cmp    $0x6e,%al
jne    1341 <main+0x181>
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %eax,0x58(%rsp)
jmp    13c0 <main+0x200>
cmp    $0x64,%al
je     1395 <main+0x1d5>
cmp    $0x6e,%al
jne    135c <main+0x19c>
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %rax,0x80(%rsp)
jmp    13c0 <main+0x200>
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %eax,0x8(%rsp)
jmp    13c0 <main+0x200>
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %rax,0x40(%rsp)
jmp    13c0 <main+0x200>
movzbl 0x2(%rdi),%eax
mov    %al,0x48(%rsp)
jmp    13c0 <main+0x200>
add    $0x2,%rdi
call   10b0 <atoi@plt>
mov    %rax,0x38(%rsp)
jmp    13c0 <main+0x200>
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %rax,0x78(%rsp)
jmp    13c0 <main+0x200>
add    $0x3,%rdi
call   10b0 <atoi@plt>
mov    %eax,0x5c(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15d,%r14d
add    $0x1,%rbx
mov    %r14d,%r15d
cmp    %rbx,%rbp
jne    12d0 <main+0x110>
lea    0x1702(%rip),%rsi
mov    0x18(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1496 <main+0x2d6>
lea    0x16e4(%rip),%rsi
mov    %rbp,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
mov    0x40(%rsp),%rbx
mov    0x38(%rsp),%r15
je     14d3 <main+0x313>
lea    0x16c1(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14dc <main+0x31c>
lea    0x16ad(%rip),%rsi
mov    %rbp,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
movl   $0x0,0x2c(%rsp)
test   %rax,%rax
je     1636 <main+0x476>
lea    0x168c(%rip),%rsi
mov    %rbp,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1751 <main+0x591>
mov    0x2b63(%rip),%rax
mov    (%rax),%rdi
lea    0x166a(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    198c <main+0x7cc>
mov    0x38(%rsp),%r15
lea    0x1(%r15),%eax
sar    %eax
mov    %eax,0x2c(%rsp)
mov    0x40(%rsp),%rbx
lea    0x1(%rbx),%eax
sar    %eax
mov    %eax,0x28(%rsp)
xor    %r12d,%r12d
jmp    14ef <main+0x32f>
mov    0x2b21(%rip),%rax
mov    (%rax),%rcx
lea    0x15b5(%rip),%rdi
mov    $0x2e,%esi
jmp    1982 <main+0x7c2>
lea    0x3(%r15),%eax
sar    $0x2,%eax
jmp    14e2 <main+0x322>
lea    0x1(%r15),%eax
sar    %eax
mov    %eax,0x2c(%rsp)
xor    %r12d,%r12d
mov    %ebx,%eax
mov    %ebx,0x28(%rsp)
lea    0x1632(%rip),%rsi
mov    %rbp,0x18(%rsp)
mov    %rbp,%rdi
call   10e0 <strstr@plt>
mov    %rax,0x30(%rsp)
xor    %ebp,%ebp
mov    0x14(%rsp),%eax
test   %eax,%eax
cmovns %eax,%ebp
mov    0x8(%r13),%rdi
call   1060 <strlen@plt>
mov    $0x1ff2,%ecx
mov    %ebp,0xc(%rsp)
sub    %ebp,%ecx
cmp    %ecx,%eax
jle    1546 <main+0x386>
mov    0x2aae(%rip),%rax
mov    (%rax),%rcx
lea    0x15f2(%rip),%rdi
mov    $0x14,%esi
jmp    1982 <main+0x7c2>
mov    0x8(%r13),%rdx
test   %r14d,%r14d
mov    %r12d,%ebp
mov    %r12d,0x10(%rsp)
mov    %rbx,0x40(%rsp)
mov    %r15,0x38(%rsp)
je     15c4 <main+0x404>
cmpl   $0x0,0x14(%rsp)
jle    15f3 <main+0x433>
lea    0x15d0(%rip),%rsi
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
mov    0xc(%rsp),%r15d
mov    %r15d,%ecx
mov    0x8(%rsp),%ebx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0x15b1(%rip),%rsi
mov    %rbp,%rdi
mov    0x10(%rsp),%ebp
call   10a0 <fopen@plt>
mov    %rax,0x50(%rsp)
test   %bpl,%bpl
je     1646 <main+0x486>
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %r12d,%r12d
jmp    16ad <main+0x4ed>
cmpl   $0x0,0x14(%rsp)
jle    16f0 <main+0x530>
lea    0x15a8(%rip),%rsi
lea    0x90(%rsp),%rdi
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
jmp    1706 <main+0x546>
lea    0x1570(%rip),%rsi
xor    %r12d,%r12d
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0x1536(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
mov    %rax,%r15
test   %bpl,%bpl
je     1761 <main+0x5a1>
xor    %eax,%eax
mov    %rax,0x20(%rsp)
jmp    17b8 <main+0x5f8>
xor    %r12d,%r12d
mov    %r15d,%eax
mov    %r15d,0x2c(%rsp)
jmp    14e9 <main+0x329>
mov    0x8(%r13),%rdx
lea    0x14fe(%rip),%rsi
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0x14dc(%rip),%r12
mov    %rbp,%rdi
mov    %r12,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x20(%rsp)
mov    0x8(%r13),%rdx
lea    0x14cd(%rip),%rsi
mov    %rbp,%rdi
mov    %r15d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbp,%rdi
mov    0x10(%rsp),%ebp
mov    %r12,%rsi
call   10a0 <fopen@plt>
mov    %rax,%r12
mov    0x50(%rsp),%r15
cmpq   $0x0,0x30(%rsp)
je     1800 <main+0x640>
mov    0x8(%r13),%rdx
lea    0x1498(%rip),%rsi
xor    %eax,%eax
mov    %rax,0x60(%rsp)
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
jmp    17e4 <main+0x624>
lea    0x1492(%rip),%rsi
lea    0x90(%rsp),%rdi
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0x143f(%rip),%rsi
lea    0x90(%rsp),%rdi
call   10a0 <fopen@plt>
mov    %rax,%r15
xor    %r12d,%r12d
test   %bpl,%bpl
cmove  %rax,%r12
mov    0x30(%rsp),%rax
test   %rax,%rax
mov    %r15,%rdx
cmove  %rax,%rdx
mov    %r12,0x20(%rsp)
mov    %r15,%rax
mov    %r15,0x60(%rsp)
test   %r15,%r15
jne    1812 <main+0x652>
jmp    196c <main+0x7ac>
mov    $0x1,%r12b
movl   $0x0,0x28(%rsp)
jmp    14ef <main+0x32f>
mov    0x8(%r13),%rdx
lea    0x1403(%rip),%rsi
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0x13c7(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x20(%rsp)
mov    0x8(%r13),%rdx
lea    0x13d4(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <fopen@plt>
mov    %rax,%r12
cmpq   $0x0,0x30(%rsp)
je     1800 <main+0x640>
mov    0x8(%r13),%rdx
lea    0x13ae(%rip),%rsi
xor    %eax,%eax
mov    %rax,0x60(%rsp)
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0x1361(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
mov    %rax,%rdx
test   %r15,%r15
jne    1812 <main+0x652>
jmp    196c <main+0x7ac>
xor    %edx,%edx
xor    %eax,%eax
mov    %rax,0x60(%rsp)
test   %r15,%r15
je     196c <main+0x7ac>
test   %bpl,%bpl
je     182a <main+0x66a>
cmpq   $0x0,0x30(%rsp)
je     1856 <main+0x696>
test   %rdx,%rdx
je     196c <main+0x7ac>
jmp    1856 <main+0x696>
cmpq   $0x0,0x30(%rsp)
setne  %al
test   %rdx,%rdx
sete   %cl
test   %r12,%r12
je     196c <main+0x7ac>
cmpq   $0x0,0x20(%rsp)
je     196c <main+0x7ac>
and    %cl,%al
jne    196c <main+0x7ac>
mov    %rdx,0x70(%rsp)
mov    0x8(%r13),%rdx
lea    0x1348(%rip),%rsi
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10c0 <sprintf@plt>
lea    0x1336(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1cb3 <main+0xaf3>
mov    %rax,%rbp
mov    %r13,0x88(%rsp)
mov    %r15,0x50(%rsp)
mov    %r12,0x68(%rsp)
movsbl 0x48(%rsp),%ebx
sub    $0x8,%rsp
lea    0x131f(%rip),%rsi
mov    0x20(%rsp),%r15
xor    %r12d,%r12d
mov    %rax,%rdi
mov    0x40(%rsp),%rdx
mov    0x48(%rsp),%rcx
mov    0x60(%rsp),%r8d
mov    0x64(%rsp),%r9d
xor    %eax,%eax
push   0x80(%rsp)
push   0x90(%rsp)
push   %rbx
call   1080 <fprintf@plt>
add    $0x20,%rsp
lea    0x1181(%rip),%rsi
mov    %r15,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1916 <main+0x756>
lea    0x12ef(%rip),%rsi
mov    %rbp,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x118e(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   10d0 <fwrite@plt>
mov    0x40(%rsp),%rbx
mov    %ebx,%eax
mov    0x38(%rsp),%r15
imul   %r15d,%eax
movslq %eax,%rdi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    0x50(%rsp),%rcx
call   1040 <fread@plt>
cmp    %ebx,%eax
jl     1992 <main+0x7d2>
mov    %rbp,0x48(%rsp)
mov    %r13,0x18(%rsp)
jmp    19d4 <main+0x814>
mov    0x266d(%rip),%rax
mov    (%rax),%rcx
lea    0x1213(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    $0xffffffff,%r12d
mov    %r12d,%eax
add    $0x2098,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x38(%rsp),%r15
mov    0x40(%rsp),%rbx
mov    0x48(%rsp),%rbp
mov    0x18(%rsp),%r13
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    0x50(%rsp),%rcx
call   1040 <fread@plt>
xor    %r12d,%r12d
cmp    %ebx,%eax
jl     1992 <main+0x7d2>
mov    $0x6,%esi
mov    $0x1,%edx
lea    0x1218(%rip),%rdi
mov    %rbp,%rcx
call   10d0 <fwrite@plt>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %rbp,%rcx
call   10d0 <fwrite@plt>
cmpb   $0x0,0x10(%rsp)
jne    1a63 <main+0x8a3>
mov    %r13,%rdi
mov    0x2c(%rsp),%ebp
mov    %ebp,%esi
mov    0x28(%rsp),%r12d
mov    %r12d,%edx
mov    0x20(%rsp),%rcx
call   1040 <fread@plt>
mov    0x18(%rsp),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    0x48(%rsp),%rcx
call   10d0 <fwrite@plt>
mov    0x18(%rsp),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    0x68(%rsp),%rcx
call   1040 <fread@plt>
mov    0x18(%rsp),%rdi
mov    %ebp,%esi
mov    0x48(%rsp),%rbp
mov    %r12d,%edx
mov    0x18(%rsp),%r13
mov    %rbp,%rcx
call   10d0 <fwrite@plt>
cmpq   $0x0,0x30(%rsp)
je     1a8d <main+0x8cd>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    0x70(%rsp),%rcx
call   1040 <fread@plt>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %rbp,%rcx
call   10d0 <fwrite@plt>
cmpl   $0x0,0x14(%rsp)
jle    19bb <main+0x7fb>
mov    0x8(%rsp),%ebx
add    $0x1,%ebx
mov    0x88(%rsp),%r12
mov    0x8(%r12),%rdx
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
test   %r14d,%r14d
je     1b1f <main+0x95f>
lea    0x1080(%rip),%rsi
mov    0xc(%rsp),%r13d
mov    %r13d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    0x50(%rsp),%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
lea    0x1063(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r15
cmpb   $0x0,0x10(%rsp)
je     1b88 <main+0x9c8>
mov    0x68(%rsp),%rbp
lea    0x90(%rsp),%r13
cmpq   $0x0,0x30(%rsp)
jne    1c11 <main+0xa51>
mov    0x70(%rsp),%rcx
jmp    1c4a <main+0xa8a>
lea    0x1058(%rip),%rsi
mov    0xc(%rsp),%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    0x60(%rsp),%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
lea    0x1004(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r15
cmpb   $0x0,0x10(%rsp)
mov    0x68(%rsp),%rbp
cmove  %rax,%rbp
mov    0x20(%rsp),%rax
cmove  %r15,%rax
mov    %rax,0x20(%rsp)
cmpq   $0x0,0x30(%rsp)
mov    0x70(%rsp),%rcx
cmovne %r15,%rcx
mov    %r15,%rax
mov    %r15,0x60(%rsp)
jmp    1c4a <main+0xa8a>
mov    0x8(%r12),%rdx
lea    0x90(%rsp),%rbp
mov    %rbp,%rdi
lea    0xfb0(%rip),%rsi
mov    %r13d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    0x20(%rsp),%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
lea    0xf8c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,0x20(%rsp)
mov    0x8(%r12),%rdx
mov    %rbp,%rdi
lea    0xf7f(%rip),%rsi
mov    %r13d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    0x68(%rsp),%rdi
call   1050 <fclose@plt>
mov    %rbp,%r13
mov    %rbp,%rdi
lea    0xf4f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
cmpq   $0x0,0x30(%rsp)
je     1b15 <main+0x955>
mov    0x8(%r12),%rdx
mov    %r13,%rdi
lea    0xf41(%rip),%rsi
mov    0xc(%rsp),%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    0x70(%rsp),%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
lea    0xf0a(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rcx
xor    %r12d,%r12d
test   %r15,%r15
je     1992 <main+0x7d2>
cmpb   $0x0,0x10(%rsp)
jne    1c72 <main+0xab2>
cmpq   $0x0,0x20(%rsp)
je     1992 <main+0x7d2>
test   %rbp,%rbp
je     1992 <main+0x7d2>
cmpq   $0x0,0x30(%rsp)
mov    %ebx,0x8(%rsp)
mov    %rbp,0x68(%rsp)
mov    %r15,0x50(%rsp)
mov    %rcx,0x70(%rsp)
je     19a7 <main+0x7e7>
test   %rcx,%rcx
mov    0x38(%rsp),%r15
mov    0x40(%rsp),%rbx
mov    0x48(%rsp),%rbp
mov    0x18(%rsp),%r13
jne    19bb <main+0x7fb>
jmp    1992 <main+0x7d2>
mov    0x2326(%rip),%rax
mov    (%rax),%rcx
lea    0xef4(%rip),%rdi
mov    $0x1b,%esi
jmp    1982 <main+0x7c2>
mov    0x230b(%rip),%rax
mov    (%rax),%rdi
lea    0xdce(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    198c <main+0x7cc>

LLVM IR (-O0):
@stderr = global i32* null
@.str = [2586 x i8] c"Usage: yuv2yuv4mpeg <sequence_qcif> [-p | -d<digits>] [<options>]\0AConverts one or more raw data files in a sequence into a single\0A YUV4MPEG file with appropriate headers to describe the video format.\0A\0AThe type of input read is controlled by one or more of:\0A -p Input is split by component.\0A Opens up three files, <sequence>.y, <sequence>.u,\0A and <sequence>.v containing raw, unpadded image\0A data for each component, respectively.\0A If only a Y' component is present, <sequence>.y is\0A used.\0A If an alpha component is present, <sequence>.a is\0A used.\0A Which components are present is determined from the\0A -c flag described below.\0A -d<digits> Input is split by frame.\0A Opens up <sequence><ddd>.yuv for frame <ddd>\0A containing raw, unpadded image data for all three\0A components.\0A <digits> specifies the number of decimal digits in\0A the frame number <ddd>.\0A If both of these options are be specified, the three files\0A <sequence><ddd>.y, <sequence><ddd>.u, and <sequence><ddd>.v are\0A opened for each frame.\0A If neither of these options are specified, a single <sequence>.yuv\0A file is opened, containing, the raw, unpadded image data for all\0A components of all frames.\0A This must be organized in a planar fashion, with each complete frame\0A in one block, in the order Y, U (Cb), V (Cr), alpha.\0A Which components are present is determined from the -c flag described\0A below.\0A\0AThe default input video format is 29.97 fps progressive QCIF.\0AOptions:\0A -w<width>\0A -h<height>\0A -fn<frame rate numerator>\0A -fd<frame rate denominator>\0A -i<p|t|b> Progressive or Top-field first or Bottom-field first.\0A -c<chroma> Chroma subsampling format. One of:\0A 420jpeg\0A 420mpeg2\0A 420paldv\0A 411\0A 422\0A 444\0A 444alpha\0A mono\0A -an<pixel aspect numerator>\0A -ad<pixel aspect denominator>\0A Note: Most common frame sizes do not use square pixels:\0A Name Width Height -an -ad\0A 720 576 128 117\0A CIF 352 288 128 117\0A QCIF 176 144 128 117\0A 720 480 4320 4739\0A SIF 352 240 4320 4739\0A The HD TV sizes (1920x1080, 1280x720) really do use square pixels.\0A -o<offset> The first frame number to use in -d mode.\0A If unspecified, 0 is used.\0A\00"
@.str.1 = [8 x i8] c"420jpeg\00"
@.str.2 = [47 x i8] c"Error parsing arguments: must start with '-'.\0A\00"
@.str.3 = [47 x i8] c"Error parsing arguments: unknown switch '%c'.\0A\00"
@.str.4 = [4 x i8] c"420\00"
@.str.5 = [4 x i8] c"411\00"
@.str.6 = [4 x i8] c"422\00"
@.str.7 = [4 x i8] c"444\00"
@.str.8 = [5 x i8] c"mono\00"
@.str.9 = [55 x i8] c"Error parsing arguments: Unsupported chroma mode: %s.\0A\00"
@.str.10 = [6 x i8] c"alpha\00"
@.str.11 = [21 x i8] c"File name too long.\0A\00"
@.str.12 = [9 x i8] c"%s%0*d.y\00"
@.str.13 = [3 x i8] c"rb\00"
@.str.14 = [9 x i8] c"%s%0*d.u\00"
@.str.15 = [9 x i8] c"%s%0*d.v\00"
@.str.16 = [9 x i8] c"%s%0*d.a\00"
@.str.17 = [5 x i8] c"%s.y\00"
@.str.18 = [5 x i8] c"%s.u\00"
@.str.19 = [5 x i8] c"%s.v\00"
@.str.20 = [5 x i8] c"%s.a\00"
@.str.21 = [11 x i8] c"%s%0*d.yuv\00"
@.str.22 = [7 x i8] c"%s.yuv\00"
@.str.23 = [30 x i8] c"Error opening input file(s).\0A\00"
@.str.24 = [7 x i8] c"%s.y4m\00"
@.str.25 = [3 x i8] c"wb\00"
@.str.26 = [28 x i8] c"Error opening output file.\0A\00"
@.str.27 = [36 x i8] c"YUV4MPEG2 W%i H%i F%i:%i I%c A%i:%i\00"
@.str.28 = [5 x i8] c" C%s\00"
@.str.29 = [2 x i8] c"\0A\00"
@.str.30 = [7 x i8] c"FRAME\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 i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i8*
%27 = alloca [8192 x i8]
%28 = alloca i32
%29 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 2
br i1 %31, label %32, label %35
32: ; preds = %2
%33 = load i32*, i32** @stderr
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([2586 x i8], [2586 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %612
35: ; preds = %2
store i32 0, i32* %25
store i32 0, i32* %28
store i32 0, i32* %24
store i32* null, i32** %10
store i32* null, i32** %9
store i32* null, i32** %8
store i32* null, i32** %7
store i32* null, i32** %6
store i32 176, i32* %12
store i32 144, i32* %13
store i32 30000, i32* %17
store i32 1001, i32* %18
store i8 112, i8* %16
store i32 128, i32* %19
store i32 117, i32* %20
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %21
store i32 2, i32* %29
br label %36
36: ; preds = %198, %35
%37 = load i32, i32* %29
%38 = load i32, i32* %4
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %201
40: ; preds = %36
%41 = load i8**, i8*** %5
%42 = load i32, i32* %29
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
%46 = getelementptr inbounds i8, i8* %45, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 45
br i1 %49, label %50, label %53
50: ; preds = %40
%51 = load i32*, i32** @stderr
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %612
53: ; preds = %40
%54 = load i8**, i8*** %5
%55 = load i32, i32* %29
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8*, i8** %54, i64 %56
%58 = load i8*, i8** %57
%59 = getelementptr inbounds i8, i8* %58, i64 1
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
switch i32 %61, label %186 [
i32 112, label %62
i32 100, label %63
i32 119, label %71
i32 104, label %79
i32 105, label %87
i32 99, label %95
i32 102, label %102
i32 97, label %140
i32 111, label %178
]
62: ; preds = %53
store i32 1, i32* %25
br label %197
63: ; preds = %53
%64 = load i8**, i8*** %5
%65 = load i32, i32* %29
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %64, i64 %66
%68 = load i8*, i8** %67
%69 = getelementptr inbounds i8, i8* %68, i64 2
%70 = call i32 @atoi(i8* %69)
store i32 %70, i32* %24
br label %197
71: ; preds = %53
%72 = load i8**, i8*** %5
%73 = load i32, i32* %29
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8*, i8** %72, i64 %74
%76 = load i8*, i8** %75
%77 = getelementptr inbounds i8, i8* %76, i64 2
%78 = call i32 @atoi(i8* %77)
store i32 %78, i32* %12
br label %197
79: ; preds = %53
%80 = load i8**, i8*** %5
%81 = load i32, i32* %29
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = getelementptr inbounds i8, i8* %84, i64 2
%86 = call i32 @atoi(i8* %85)
store i32 %86, i32* %13
br label %197
87: ; preds = %53
%88 = load i8**, i8*** %5
%89 = load i32, i32* %29
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %88, i64 %90
%92 = load i8*, i8** %91
%93 = getelementptr inbounds i8, i8* %92, i64 2
%94 = load i8, i8* %93
store i8 %94, i8* %16
br label %197
95: ; preds = %53
%96 = load i8**, i8*** %5
%97 = load i32, i32* %29
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %96, i64 %98
%100 = load i8*, i8** %99
%101 = getelementptr inbounds i8, i8* %100, i64 2
store i8* %101, i8** %21
br label %197
102: ; preds = %53
%103 = load i8**, i8*** %5
%104 = load i32, i32* %29
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = getelementptr inbounds i8, i8* %107, i64 2
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 110
br i1 %111, label %112, label %120
112: ; preds = %102
%113 = load i8**, i8*** %5
%114 = load i32, i32* %29
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8*, i8** %113, i64 %115
%117 = load i8*, i8** %116
%118 = getelementptr inbounds i8, i8* %117, i64 3
%119 = call i32 @atoi(i8* %118)
store i32 %119, i32* %17
br label %197
120: ; preds = %102
%121 = load i8**, i8*** %5
%122 = load i32, i32* %29
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8*, i8** %121, i64 %123
%125 = load i8*, i8** %124
%126 = getelementptr inbounds i8, i8* %125, i64 2
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp eq i32 %128, 100
br i1 %129, label %130, label %138
130: ; preds = %120
%131 = load i8**, i8*** %5
%132 = load i32, i32* %29
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8*, i8** %131, i64 %133
%135 = load i8*, i8** %134
%136 = getelementptr inbounds i8, i8* %135, i64 3
%137 = call i32 @atoi(i8* %136)
store i32 %137, i32* %18
br label %197
138: ; preds = %120
br label %139
139: ; preds = %138
br label %140
140: ; preds = %53, %139
%141 = load i8**, i8*** %5
%142 = load i32, i32* %29
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds i8*, i8** %141, i64 %143
%145 = load i8*, i8** %144
%146 = getelementptr inbounds i8, i8* %145, i64 2
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = icmp eq i32 %148, 110
br i1 %149, label %150, label %158
150: ; preds = %140
%151 = load i8**, i8*** %5
%152 = load i32, i32* %29
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i8*, i8** %151, i64 %153
%155 = load i8*, i8** %154
%156 = getelementptr inbounds i8, i8* %155, i64 3
%157 = call i32 @atoi(i8* %156)
store i32 %157, i32* %19
br label %197
158: ; preds = %140
%159 = load i8**, i8*** %5
%160 = load i32, i32* %29
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i8*, i8** %159, i64 %161
%163 = load i8*, i8** %162
%164 = getelementptr inbounds i8, i8* %163, i64 2
%165 = load i8, i8* %164
%166 = sext i8 %165 to i32
%167 = icmp eq i32 %166, 100
br i1 %167, label %168, label %176
168: ; preds = %158
%169 = load i8**, i8*** %5
%170 = load i32, i32* %29
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds i8*, i8** %169, i64 %171
%173 = load i8*, i8** %172
%174 = getelementptr inbounds i8, i8* %173, i64 3
%175 = call i32 @atoi(i8* %174)
store i32 %175, i32* %20
br label %197
176: ; preds = %158
br label %177
177: ; preds = %176
br label %178
178: ; preds = %53, %177
%179 = load i8**, i8*** %5
%180 = load i32, i32* %29
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8*, i8** %179, i64 %181
%183 = load i8*, i8** %182
%184 = getelementptr inbounds i8, i8* %183, i64 2
%185 = call i32 @atoi(i8* %184)
store i32 %185, i32* %28
br label %197
186: ; preds = %53
%187 = load i32*, i32** @stderr
%188 = load i8**, i8*** %5
%189 = load i32, i32* %29
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8*, i8** %188, i64 %190
%192 = load i8*, i8** %191
%193 = getelementptr inbounds i8, i8* %192, i64 1
%194 = load i8, i8* %193
%195 = sext i8 %194 to i32
%196 = call i32 (i32*, i8*, ...) @fprintf(i32* %187, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i32 %195)
store i32 -1, i32* %3
br label %612
197: ; preds = %178, %168, %150, %130, %112, %95, %87, %79, %71, %63, %62
br label %198
198: ; preds = %197
%199 = load i32, i32* %29
%200 = add nsw i32 %199, 1
store i32 %200, i32* %29
br label %36
201: ; preds = %36
%202 = load i8*, i8** %21
%203 = call i64 @strncmp(i8* %202, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%204 = icmp eq i64 %203, 0
br i1 %204, label %205, label %212
205: ; preds = %201
%206 = load i32, i32* %12
%207 = add nsw i32 %206, 1
%208 = ashr i32 %207, 1
store i32 %208, i32* %14
%209 = load i32, i32* %13
%210 = add nsw i32 %209, 1
%211 = ashr i32 %210, 1
store i32 %211, i32* %15
store i32 1, i32* %22
br label %250
212: ; preds = %201
%213 = load i8*, i8** %21
%214 = call i64 @strncmp(i8* %213, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%215 = icmp eq i64 %214, 0
br i1 %215, label %216, label %221
216: ; preds = %212
%217 = load i32, i32* %12
%218 = add nsw i32 %217, 3
%219 = ashr i32 %218, 2
store i32 %219, i32* %14
%220 = load i32, i32* %13
store i32 %220, i32* %15
store i32 1, i32* %22
br label %249
221: ; preds = %212
%222 = load i8*, i8** %21
%223 = call i64 @strcmp(i8* %222, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%224 = icmp eq i64 %223, 0
br i1 %224, label %225, label %230
225: ; preds = %221
%226 = load i32, i32* %12
%227 = add nsw i32 %226, 1
%228 = ashr i32 %227, 1
store i32 %228, i32* %14
%229 = load i32, i32* %13
store i32 %229, i32* %15
store i32 1, i32* %22
br label %248
230: ; preds = %221
%231 = load i8*, i8** %21
%232 = call i64 @strncmp(i8* %231, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%233 = icmp eq i64 %232, 0
br i1 %233, label %234, label %237
234: ; preds = %230
%235 = load i32, i32* %12
store i32 %235, i32* %14
%236 = load i32, i32* %13
store i32 %236, i32* %15
store i32 1, i32* %22
br label %247
237: ; preds = %230
%238 = load i8*, i8** %21
%239 = call i64 @strncmp(i8* %238, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 4)
%240 = icmp eq i64 %239, 0
br i1 %240, label %241, label %242
241: ; preds = %237
store i32 0, i32* %15
store i32 0, i32* %14
store i32 0, i32* %22
br label %246
242: ; preds = %237
%243 = load i32*, i32** @stderr
%244 = load i8*, i8** %21
%245 = call i32 (i32*, i8*, ...) @fprintf(i32* %243, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i8* %244)
store i32 -1, i32* %3
br label %612
246: ; preds = %241
br label %247
247: ; preds = %246, %234
br label %248
248: ; preds = %247, %225
br label %249
249: ; preds = %248, %216
br label %250
250: ; preds = %249, %205
%251 = load i8*, i8** %21
%252 = call i32* @strstr(i8* %251, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%253 = icmp ne i32* %252, null
%254 = zext i1 %253 to i32
store i32 %254, i32* %23
%255 = load i32, i32* %24
%256 = icmp slt i32 %255, 0
br i1 %256, label %257, label %258
257: ; preds = %250
store i32 0, i32* %24
br label %258
258: ; preds = %257, %250
%259 = load i8**, i8*** %5
%260 = getelementptr inbounds i8*, i8** %259, i64 1
%261 = load i8*, i8** %260
%262 = call i32 @strlen(i8* %261)
%263 = load i32, i32* %24
%264 = sub nsw i32 8178, %263
%265 = icmp sgt i32 %262, %264
br i1 %265, label %266, label %269
266: ; preds = %258
%267 = load i32*, i32** @stderr
%268 = call i32 (i32*, i8*, ...) @fprintf(i32* %267, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
store i32 -1, i32* %3
br label %612
269: ; preds = %258
%270 = load i32, i32* %25
%271 = icmp ne i32 %270, 0
br i1 %271, label %272, label %358
272: ; preds = %269
%273 = load i32, i32* %24
%274 = icmp sgt i32 %273, 0
br i1 %274, label %275, label %320
275: ; preds = %272
%276 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%277 = load i8**, i8*** %5
%278 = getelementptr inbounds i8*, i8** %277, i64 1
%279 = load i8*, i8** %278
%280 = load i32, i32* %24
%281 = load i32, i32* %28
%282 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %276, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %279, i32 %280, i32 %281)
%283 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%284 = call i32* @fopen(i8* %283, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %284, i32** %6
%285 = load i32, i32* %22
%286 = icmp ne i32 %285, 0
br i1 %286, label %287, label %306
287: ; preds = %275
%288 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%289 = load i8**, i8*** %5
%290 = getelementptr inbounds i8*, i8** %289, i64 1
%291 = load i8*, i8** %290
%292 = load i32, i32* %24
%293 = load i32, i32* %28
%294 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %288, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %291, i32 %292, i32 %293)
%295 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%296 = call i32* @fopen(i8* %295, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %296, i32** %7
%297 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%298 = load i8**, i8*** %5
%299 = getelementptr inbounds i8*, i8** %298, i64 1
%300 = load i8*, i8** %299
%301 = load i32, i32* %24
%302 = load i32, i32* %28
%303 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %297, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* %300, i32 %301, i32 %302)
%304 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%305 = call i32* @fopen(i8* %304, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %305, i32** %8
br label %306
306: ; preds = %287, %275
%307 = load i32, i32* %23
%308 = icmp ne i32 %307, 0
br i1 %308, label %309, label %319
309: ; preds = %306
%310 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%311 = load i8**, i8*** %5
%312 = getelementptr inbounds i8*, i8** %311, i64 1
%313 = load i8*, i8** %312
%314 = load i32, i32* %24
%315 = load i32, i32* %28
%316 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %310, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %313, i32 %314, i32 %315)
%317 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%318 = call i32* @fopen(i8* %317, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %318, i32** %9
br label %319
319: ; preds = %309, %306
br label %357
320: ; preds = %272
%321 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%322 = load i8**, i8*** %5
%323 = getelementptr inbounds i8*, i8** %322, i64 1
%324 = load i8*, i8** %323
%325 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %321, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* %324)
%326 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%327 = call i32* @fopen(i8* %326, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %327, i32** %6
%328 = load i32, i32* %22
%329 = icmp ne i32 %328, 0
br i1 %329, label %330, label %345
330: ; preds = %320
%331 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%332 = load i8**, i8*** %5
%333 = getelementptr inbounds i8*, i8** %332, i64 1
%334 = load i8*, i8** %333
%335 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %331, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* %334)
%336 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%337 = call i32* @fopen(i8* %336, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %337, i32** %7
%338 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%339 = load i8**, i8*** %5
%340 = getelementptr inbounds i8*, i8** %339, i64 1
%341 = load i8*, i8** %340
%342 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %338, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %341)
%343 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%344 = call i32* @fopen(i8* %343, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %344, i32** %8
br label %345
345: ; preds = %330, %320
%346 = load i32, i32* %23
%347 = icmp ne i32 %346, 0
br i1 %347, label %348, label %356
348: ; preds = %345
%349 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%350 = load i8**, i8*** %5
%351 = getelementptr inbounds i8*, i8** %350, i64 1
%352 = load i8*, i8** %351
%353 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %349, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %352)
%354 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%355 = call i32* @fopen(i8* %354, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %355, i32** %9
br label %356
356: ; preds = %348, %345
br label %357
357: ; preds = %356, %319
br label %391
358: ; preds = %269
%359 = load i32, i32* %24
%360 = icmp sgt i32 %359, 0
br i1 %360, label %361, label %371
361: ; preds = %358
%362 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%363 = load i8**, i8*** %5
%364 = getelementptr inbounds i8*, i8** %363, i64 1
%365 = load i8*, i8** %364
%366 = load i32, i32* %24
%367 = load i32, i32* %28
%368 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %362, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %365, i32 %366, i32 %367)
%369 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%370 = call i32* @fopen(i8* %369, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %370, i32** %10
br label %379
371: ; preds = %358
%372 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%373 = load i8**, i8*** %5
%374 = getelementptr inbounds i8*, i8** %373, i64 1
%375 = load i8*, i8** %374
%376 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %372, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i8* %375)
%377 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%378 = call i32* @fopen(i8* %377, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %378, i32** %10
br label %379
379: ; preds = %371, %361
%380 = load i32*, i32** %10
store i32* %380, i32** %6
%381 = load i32, i32* %22
%382 = icmp ne i32 %381, 0
br i1 %382, label %383, label %385
383: ; preds = %379
%384 = load i32*, i32** %10
store i32* %384, i32** %8
store i32* %384, i32** %7
br label %385
385: ; preds = %383, %379
%386 = load i32, i32* %23
%387 = icmp ne i32 %386, 0
br i1 %387, label %388, label %390
388: ; preds = %385
%389 = load i32*, i32** %10
store i32* %389, i32** %9
br label %390
390: ; preds = %388, %385
br label %391
391: ; preds = %390, %357
%392 = load i32*, i32** %6
%393 = icmp eq i32* %392, null
br i1 %393, label %409, label %394
394: ; preds = %391
%395 = load i32, i32* %22
%396 = icmp ne i32 %395, 0
br i1 %396, label %397, label %403
397: ; preds = %394
%398 = load i32*, i32** %7
%399 = icmp eq i32* %398, null
br i1 %399, label %409, label %400
400: ; preds = %397
%401 = load i32*, i32** %8
%402 = icmp eq i32* %401, null
br i1 %402, label %409, label %403
403: ; preds = %400, %394
%404 = load i32, i32* %23
%405 = icmp ne i32 %404, 0
br i1 %405, label %406, label %412
406: ; preds = %403
%407 = load i32*, i32** %9
%408 = icmp eq i32* %407, null
br i1 %408, label %409, label %412
409: ; preds = %406, %400, %397, %391
%410 = load i32*, i32** @stderr
%411 = call i32 (i32*, i8*, ...) @fprintf(i32* %410, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.23, i64 0, i64 0))
store i32 -1, i32* %3
br label %612
412: ; preds = %406, %403
%413 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%414 = load i8**, i8*** %5
%415 = getelementptr inbounds i8*, i8** %414, i64 1
%416 = load i8*, i8** %415
%417 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %413, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i64 0, i64 0), i8* %416)
%418 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%419 = call i32* @fopen(i8* %418, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
store i32* %419, i32** %11
%420 = load i32*, i32** %11
%421 = icmp eq i32* %420, null
br i1 %421, label %422, label %425
422: ; preds = %412
%423 = load i32*, i32** @stderr
%424 = call i32 (i32*, i8*, ...) @fprintf(i32* %423, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.26, i64 0, i64 0))
store i32 -1, i32* %3
br label %612
425: ; preds = %412
%426 = load i32*, i32** %11
%427 = load i32, i32* %12
%428 = load i32, i32* %13
%429 = load i32, i32* %17
%430 = load i32, i32* %18
%431 = load i8, i8* %16
%432 = sext i8 %431 to i32
%433 = load i32, i32* %19
%434 = load i32, i32* %20
%435 = call i32 (i32*, i8*, ...) @fprintf(i32* %426, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.27, i64 0, i64 0), i32 %427, i32 %428, i32 %429, i32 %430, i32 %432, i32 %433, i32 %434)
%436 = load i8*, i8** %21
%437 = call i64 @strcmp(i8* %436, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%438 = icmp ne i64 %437, 0
br i1 %438, label %439, label %443
439: ; preds = %425
%440 = load i32*, i32** %11
%441 = load i8*, i8** %21
%442 = call i32 (i32*, i8*, ...) @fprintf(i32* %440, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), i8* %441)
br label %443
443: ; preds = %439, %425
%444 = load i32*, i32** %11
%445 = call i32 (i32*, i8*, ...) @fprintf(i32* %444, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.29, i64 0, i64 0))
%446 = load i32, i32* %12
%447 = load i32, i32* %13
%448 = mul nsw i32 %446, %447
%449 = sext i32 %448 to i64
%450 = call i64 @malloc(i64 %449)
%451 = inttoptr i64 %450 to i8*
store i8* %451, i8** %26
br label %452
452: ; preds = %610, %443
%453 = load i8*, i8** %26
%454 = load i32, i32* %12
%455 = load i32, i32* %13
%456 = load i32*, i32** %6
%457 = call i32 @fread(i8* %453, i32 %454, i32 %455, i32* %456)
%458 = load i32, i32* %13
%459 = icmp slt i32 %457, %458
br i1 %459, label %460, label %461
460: ; preds = %452
br label %611
461: ; preds = %452
%462 = load i32*, i32** %11
%463 = call i32 (i32*, i8*, ...) @fprintf(i32* %462, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.30, i64 0, i64 0))
%464 = load i8*, i8** %26
%465 = load i32, i32* %12
%466 = load i32, i32* %13
%467 = load i32*, i32** %11
%468 = call i32 @fwrite(i8* %464, i32 %465, i32 %466, i32* %467)
%469 = load i32, i32* %22
%470 = icmp ne i32 %469, 0
br i1 %470, label %471, label %492
471: ; preds = %461
%472 = load i8*, i8** %26
%473 = load i32, i32* %14
%474 = load i32, i32* %15
%475 = load i32*, i32** %7
%476 = call i32 @fread(i8* %472, i32 %473, i32 %474, i32* %475)
%477 = load i8*, i8** %26
%478 = load i32, i32* %14
%479 = load i32, i32* %15
%480 = load i32*, i32** %11
%481 = call i32 @fwrite(i8* %477, i32 %478, i32 %479, i32* %480)
%482 = load i8*, i8** %26
%483 = load i32, i32* %14
%484 = load i32, i32* %15
%485 = load i32*, i32** %8
%486 = call i32 @fread(i8* %482, i32 %483, i32 %484, i32* %485)
%487 = load i8*, i8** %26
%488 = load i32, i32* %14
%489 = load i32, i32* %15
%490 = load i32*, i32** %11
%491 = call i32 @fwrite(i8* %487, i32 %488, i32 %489, i32* %490)
br label %492
492: ; preds = %471, %461
%493 = load i32, i32* %23
%494 = icmp ne i32 %493, 0
br i1 %494, label %495, label %506
495: ; preds = %492
%496 = load i8*, i8** %26
%497 = load i32, i32* %12
%498 = load i32, i32* %13
%499 = load i32*, i32** %9
%500 = call i32 @fread(i8* %496, i32 %497, i32 %498, i32* %499)
%501 = load i8*, i8** %26
%502 = load i32, i32* %12
%503 = load i32, i32* %13
%504 = load i32*, i32** %11
%505 = call i32 @fwrite(i8* %501, i32 %502, i32 %503, i32* %504)
br label %506
506: ; preds = %495, %492
%507 = load i32, i32* %24
%508 = icmp sgt i32 %507, 0
br i1 %508, label %509, label %610
509: ; preds = %506
%510 = load i32, i32* %28
%511 = add nsw i32 %510, 1
store i32 %511, i32* %28
%512 = load i32, i32* %25
%513 = icmp ne i32 %512, 0
br i1 %513, label %514, label %567
514: ; preds = %509
%515 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%516 = load i8**, i8*** %5
%517 = getelementptr inbounds i8*, i8** %516, i64 1
%518 = load i8*, i8** %517
%519 = load i32, i32* %24
%520 = load i32, i32* %28
%521 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %515, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %518, i32 %519, i32 %520)
%522 = load i32*, i32** %6
%523 = call i32 @fclose(i32* %522)
%524 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%525 = call i32* @fopen(i8* %524, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %525, i32** %6
%526 = load i32, i32* %22
%527 = icmp ne i32 %526, 0
br i1 %527, label %528, label %551
528: ; preds = %514
%529 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%530 = load i8**, i8*** %5
%531 = getelementptr inbounds i8*, i8** %530, i64 1
%532 = load i8*, i8** %531
%533 = load i32, i32* %24
%534 = load i32, i32* %28
%535 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %529, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %532, i32 %533, i32 %534)
%536 = load i32*, i32** %7
%537 = call i32 @fclose(i32* %536)
%538 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%539 = call i32* @fopen(i8* %538, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %539, i32** %7
%540 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%541 = load i8**, i8*** %5
%542 = getelementptr inbounds i8*, i8** %541, i64 1
%543 = load i8*, i8** %542
%544 = load i32, i32* %24
%545 = load i32, i32* %28
%546 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %540, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* %543, i32 %544, i32 %545)
%547 = load i32*, i32** %8
%548 = call i32 @fclose(i32* %547)
%549 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%550 = call i32* @fopen(i8* %549, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %550, i32** %8
br label %551
551: ; preds = %528, %514
%552 = load i32, i32* %23
%553 = icmp ne i32 %552, 0
br i1 %553, label %554, label %566
554: ; preds = %551
%555 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%556 = load i8**, i8*** %5
%557 = getelementptr inbounds i8*, i8** %556, i64 1
%558 = load i8*, i8** %557
%559 = load i32, i32* %24
%560 = load i32, i32* %28
%561 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %555, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %558, i32 %559, i32 %560)
%562 = load i32*, i32** %9
%563 = call i32 @fclose(i32* %562)
%564 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%565 = call i32* @fopen(i8* %564, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %565, i32** %9
br label %566
566: ; preds = %554, %551
br label %590
567: ; preds = %509
%568 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%569 = load i8**, i8*** %5
%570 = getelementptr inbounds i8*, i8** %569, i64 1
%571 = load i8*, i8** %570
%572 = load i32, i32* %24
%573 = load i32, i32* %28
%574 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %568, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %571, i32 %572, i32 %573)
%575 = load i32*, i32** %10
%576 = call i32 @fclose(i32* %575)
%577 = getelementptr inbounds [8192 x i8], [8192 x i8]* %27, i64 0, i64 0
%578 = call i32* @fopen(i8* %577, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
store i32* %578, i32** %10
%579 = load i32*, i32** %10
store i32* %579, i32** %6
%580 = load i32, i32* %22
%581 = icmp ne i32 %580, 0
br i1 %581, label %582, label %584
582: ; preds = %567
%583 = load i32*, i32** %10
store i32* %583, i32** %8
store i32* %583, i32** %7
br label %584
584: ; preds = %582, %567
%585 = load i32, i32* %23
%586 = icmp ne i32 %585, 0
br i1 %586, label %587, label %589
587: ; preds = %584
%588 = load i32*, i32** %10
store i32* %588, i32** %9
br label %589
589: ; preds = %587, %584
br label %590
590: ; preds = %589, %566
%591 = load i32*, i32** %6
%592 = icmp eq i32* %591, null
br i1 %592, label %608, label %593
593: ; preds = %590
%594 = load i32, i32* %22
%595 = icmp ne i32 %594, 0
br i1 %595, label %596, label %602
596: ; preds = %593
%597 = load i32*, i32** %7
%598 = icmp eq i32* %597, null
br i1 %598, label %608, label %599
599: ; preds = %596
%600 = load i32*, i32** %8
%601 = icmp eq i32* %600, null
br i1 %601, label %608, label %602
602: ; preds = %599, %593
%603 = load i32, i32* %23
%604 = icmp ne i32 %603, 0
br i1 %604, label %605, label %609
605: ; preds = %602
%606 = load i32*, i32** %9
%607 = icmp eq i32* %606, null
br i1 %607, label %608, label %609
608: ; preds = %605, %599, %596, %590
br label %611
609: ; preds = %605, %602
br label %610
610: ; preds = %609, %506
br label %452
611: ; preds = %608, %460
store i32 0, i32* %3
br label %612
612: ; preds = %611, %422, %409, %266, %242, %186, %50, %32
%613 = load i32, i32* %3
ret i32 %613
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [2586 x i8] c"Usage: yuv2yuv4mpeg <sequence_qcif> [-p | -d<digits>] [<options>]\0AConverts one or more raw data files in a sequence into a single\0A YUV4MPEG file with appropriate headers to describe the video format.\0A\0AThe type of input read is controlled by one or more of:\0A -p Input is split by component.\0A Opens up three files, <sequence>.y, <sequence>.u,\0A and <sequence>.v containing raw, unpadded image\0A data for each component, respectively.\0A If only a Y' component is present, <sequence>.y is\0A used.\0A If an alpha component is present, <sequence>.a is\0A used.\0A Which components are present is determined from the\0A -c flag described below.\0A -d<digits> Input is split by frame.\0A Opens up <sequence><ddd>.yuv for frame <ddd>\0A containing raw, unpadded image data for all three\0A components.\0A <digits> specifies the number of decimal digits in\0A the frame number <ddd>.\0A If both of these options are be specified, the three files\0A <sequence><ddd>.y, <sequence><ddd>.u, and <sequence><ddd>.v are\0A opened for each frame.\0A If neither of these options are specified, a single <sequence>.yuv\0A file is opened, containing, the raw, unpadded image data for all\0A components of all frames.\0A This must be organized in a planar fashion, with each complete frame\0A in one block, in the order Y, U (Cb), V (Cr), alpha.\0A Which components are present is determined from the -c flag described\0A below.\0A\0AThe default input video format is 29.97 fps progressive QCIF.\0AOptions:\0A -w<width>\0A -h<height>\0A -fn<frame rate numerator>\0A -fd<frame rate denominator>\0A -i<p|t|b> Progressive or Top-field first or Bottom-field first.\0A -c<chroma> Chroma subsampling format. One of:\0A 420jpeg\0A 420mpeg2\0A 420paldv\0A 411\0A 422\0A 444\0A 444alpha\0A mono\0A -an<pixel aspect numerator>\0A -ad<pixel aspect denominator>\0A Note: Most common frame sizes do not use square pixels:\0A Name Width Height -an -ad\0A 720 576 128 117\0A CIF 352 288 128 117\0A QCIF 176 144 128 117\0A 720 480 4320 4739\0A SIF 352 240 4320 4739\0A The HD TV sizes (1920x1080, 1280x720) really do use square pixels.\0A -o<offset> The first frame number to use in -d mode.\0A If unspecified, 0 is used.\0A\00"
@.str.1 = [8 x i8] c"420jpeg\00"
@.str.2 = [47 x i8] c"Error parsing arguments: must start with '-'.\0A\00"
@.str.3 = [47 x i8] c"Error parsing arguments: unknown switch '%c'.\0A\00"
@.str.4 = [4 x i8] c"420\00"
@.str.5 = [4 x i8] c"411\00"
@.str.6 = [4 x i8] c"422\00"
@.str.7 = [4 x i8] c"444\00"
@.str.8 = [5 x i8] c"mono\00"
@.str.9 = [55 x i8] c"Error parsing arguments: Unsupported chroma mode: %s.\0A\00"
@.str.10 = [6 x i8] c"alpha\00"
@.str.11 = [21 x i8] c"File name too long.\0A\00"
@.str.12 = [9 x i8] c"%s%0*d.y\00"
@.str.13 = [3 x i8] c"rb\00"
@.str.14 = [9 x i8] c"%s%0*d.u\00"
@.str.15 = [9 x i8] c"%s%0*d.v\00"
@.str.16 = [9 x i8] c"%s%0*d.a\00"
@.str.17 = [5 x i8] c"%s.y\00"
@.str.18 = [5 x i8] c"%s.u\00"
@.str.19 = [5 x i8] c"%s.v\00"
@.str.20 = [5 x i8] c"%s.a\00"
@.str.21 = [11 x i8] c"%s%0*d.yuv\00"
@.str.22 = [7 x i8] c"%s.yuv\00"
@.str.23 = [30 x i8] c"Error opening input file(s).\0A\00"
@.str.24 = [7 x i8] c"%s.y4m\00"
@.str.25 = [3 x i8] c"wb\00"
@.str.26 = [28 x i8] c"Error opening output file.\0A\00"
@.str.27 = [36 x i8] c"YUV4MPEG2 W%i H%i F%i:%i I%c A%i:%i\00"
@.str.28 = [5 x i8] c" C%s\00"
@.str.29 = [2 x i8] c"\0A\00"
@.str.30 = [7 x i8] c"FRAME\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8192 x i8]
%4 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = icmp eq i32 %0, 2
br i1 %7, label %92, label %8
8: ; preds = %6
%9 = zext i32 %0 to i64
br label %13
10: ; preds = %2
%11 = load i32*, i32** @stderr
%12 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([2586 x i8], [2586 x i8]* @.str, i64 0, i64 0), i64 2585, i64 1, i32* %11)
br label %313
13: ; preds = %8, %78
%14 = phi i64 [ 2, %8 ], [ %90, %78 ]
%15 = phi i32 [ 0, %8 ], [ %89, %78 ]
%16 = phi i32 [ 0, %8 ], [ %88, %78 ]
%17 = phi i32 [ 0, %8 ], [ %87, %78 ]
%18 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %8 ], [ %86, %78 ]
%19 = phi i32 [ 117, %8 ], [ %85, %78 ]
%20 = phi i32 [ 128, %8 ], [ %84, %78 ]
%21 = phi i32 [ 1001, %8 ], [ %83, %78 ]
%22 = phi i32 [ 30000, %8 ], [ %82, %78 ]
%23 = phi i8 [ 112, %8 ], [ %81, %78 ]
%24 = phi i32 [ 144, %8 ], [ %80, %78 ]
%25 = phi i32 [ 176, %8 ], [ %79, %78 ]
%26 = getelementptr inbounds i8*, i8** %1, i64 %14
%27 = load i8*, i8** %26
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 45
br i1 %29, label %33, label %30
30: ; preds = %13
%31 = load i32*, i32** @stderr
%32 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i64 46, i64 1, i32* %31)
br label %313
33: ; preds = %13
%34 = getelementptr inbounds i8, i8* %27, i64 1
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
switch i32 %36, label %74 [
i32 112, label %78
i32 100, label %40
i32 119, label %43
i32 104, label %46
i32 105, label %49
i32 99, label %52
i32 102, label %54
i32 97, label %37
i32 111, label %71
]
37: ; preds = %33
%38 = getelementptr inbounds i8, i8* %27, i64 2
%39 = load i8, i8* %38
br label %63
40: ; preds = %33
%41 = getelementptr inbounds i8, i8* %27, i64 2
%42 = tail call i32 @atoi(i8* %41)
br label %78
43: ; preds = %33
%44 = getelementptr inbounds i8, i8* %27, i64 2
%45 = tail call i32 @atoi(i8* %44)
br label %78
46: ; preds = %33
%47 = getelementptr inbounds i8, i8* %27, i64 2
%48 = tail call i32 @atoi(i8* %47)
br label %78
49: ; preds = %33
%50 = getelementptr inbounds i8, i8* %27, i64 2
%51 = load i8, i8* %50
br label %78
52: ; preds = %33
%53 = getelementptr inbounds i8, i8* %27, i64 2
br label %78
54: ; preds = %33
%55 = getelementptr inbounds i8, i8* %27, i64 2
%56 = load i8, i8* %55
switch i8 %56, label %63 [
i8 110, label %57
i8 100, label %60
]
57: ; preds = %54
%58 = getelementptr inbounds i8, i8* %27, i64 3
%59 = tail call i32 @atoi(i8* %58)
br label %78
60: ; preds = %54
%61 = getelementptr inbounds i8, i8* %27, i64 3
%62 = tail call i32 @atoi(i8* %61)
br label %78
63: ; preds = %37, %54
%64 = phi i8 [ %39, %37 ], [ %56, %54 ]
switch i8 %64, label %71 [
i8 110, label %65
i8 100, label %68
]
65: ; preds = %63
%66 = getelementptr inbounds i8, i8* %27, i64 3
%67 = tail call i32 @atoi(i8* %66)
br label %78
68: ; preds = %63
%69 = getelementptr inbounds i8, i8* %27, i64 3
%70 = tail call i32 @atoi(i8* %69)
br label %78
71: ; preds = %63, %33
%72 = getelementptr inbounds i8, i8* %27, i64 2
%73 = tail call i32 @atoi(i8* %72)
br label %78
74: ; preds = %33
%75 = sext i8 %35 to i32
%76 = load i32*, i32** @stderr
%77 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i32 %75)
br label %313
78: ; preds = %33, %40, %43, %46, %49, %52, %57, %60, %65, %68, %71
%79 = phi i32 [ %25, %71 ], [ %25, %65 ], [ %25, %68 ], [ %25, %57 ], [ %25, %60 ], [ %25, %52 ], [ %25, %49 ], [ %25, %46 ], [ %45, %43 ], [ %25, %40 ], [ %25, %33 ]
%80 = phi i32 [ %24, %71 ], [ %24, %65 ], [ %24, %68 ], [ %24, %57 ], [ %24, %60 ], [ %24, %52 ], [ %24, %49 ], [ %48, %46 ], [ %24, %43 ], [ %24, %40 ], [ %24, %33 ]
%81 = phi i8 [ %23, %71 ], [ %23, %65 ], [ %23, %68 ], [ %23, %57 ], [ %23, %60 ], [ %23, %52 ], [ %51, %49 ], [ %23, %46 ], [ %23, %43 ], [ %23, %40 ], [ %23, %33 ]
%82 = phi i32 [ %22, %71 ], [ %22, %65 ], [ %22, %68 ], [ %59, %57 ], [ %22, %60 ], [ %22, %52 ], [ %22, %49 ], [ %22, %46 ], [ %22, %43 ], [ %22, %40 ], [ %22, %33 ]
%83 = phi i32 [ %21, %71 ], [ %21, %65 ], [ %21, %68 ], [ %21, %57 ], [ %62, %60 ], [ %21, %52 ], [ %21, %49 ], [ %21, %46 ], [ %21, %43 ], [ %21, %40 ], [ %21, %33 ]
%84 = phi i32 [ %20, %71 ], [ %67, %65 ], [ %20, %68 ], [ %20, %57 ], [ %20, %60 ], [ %20, %52 ], [ %20, %49 ], [ %20, %46 ], [ %20, %43 ], [ %20, %40 ], [ %20, %33 ]
%85 = phi i32 [ %19, %71 ], [ %19, %65 ], [ %70, %68 ], [ %19, %57 ], [ %19, %60 ], [ %19, %52 ], [ %19, %49 ], [ %19, %46 ], [ %19, %43 ], [ %19, %40 ], [ %19, %33 ]
%86 = phi i8* [ %18, %71 ], [ %18, %65 ], [ %18, %68 ], [ %18, %57 ], [ %18, %60 ], [ %53, %52 ], [ %18, %49 ], [ %18, %46 ], [ %18, %43 ], [ %18, %40 ], [ %18, %33 ]
%87 = phi i32 [ %17, %71 ], [ %17, %65 ], [ %17, %68 ], [ %17, %57 ], [ %17, %60 ], [ %17, %52 ], [ %17, %49 ], [ %17, %46 ], [ %17, %43 ], [ %42, %40 ], [ %17, %33 ]
%88 = phi i32 [ %16, %71 ], [ %16, %65 ], [ %16, %68 ], [ %16, %57 ], [ %16, %60 ], [ %16, %52 ], [ %16, %49 ], [ %16, %46 ], [ %16, %43 ], [ %16, %40 ], [ 1, %33 ]
%89 = phi i32 [ %73, %71 ], [ %15, %65 ], [ %15, %68 ], [ %15, %57 ], [ %15, %60 ], [ %15, %52 ], [ %15, %49 ], [ %15, %46 ], [ %15, %43 ], [ %15, %40 ], [ %15, %33 ]
%90 = add nuw nsw i64 %14, 1
%91 = icmp eq i64 %90, %9
br i1 %91, label %92, label %13
92: ; preds = %78, %6
%93 = phi i32 [ 176, %6 ], [ %79, %78 ]
%94 = phi i32 [ 144, %6 ], [ %80, %78 ]
%95 = phi i8 [ 112, %6 ], [ %81, %78 ]
%96 = phi i32 [ 30000, %6 ], [ %82, %78 ]
%97 = phi i32 [ 1001, %6 ], [ %83, %78 ]
%98 = phi i32 [ 128, %6 ], [ %84, %78 ]
%99 = phi i32 [ 117, %6 ], [ %85, %78 ]
%100 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %6 ], [ %86, %78 ]
%101 = phi i32 [ 0, %6 ], [ %87, %78 ]
%102 = phi i32 [ 0, %6 ], [ %88, %78 ]
%103 = phi i32 [ 0, %6 ], [ %89, %78 ]
%104 = tail call i64 @strncmp(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %111
106: ; preds = %92
%107 = add nsw i32 %93, 1
%108 = ashr i32 %107, 1
%109 = add nsw i32 %94, 1
%110 = ashr i32 %109, 1
br label %132
111: ; preds = %92
%112 = tail call i64 @strncmp(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %117
114: ; preds = %111
%115 = add nsw i32 %93, 3
%116 = ashr i32 %115, 2
br label %132
117: ; preds = %111
%118 = tail call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%119 = icmp eq i64 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %117
%121 = add nsw i32 %93, 1
%122 = ashr i32 %121, 1
br label %132
123: ; preds = %117
%124 = tail call i64 @strncmp(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%125 = icmp eq i64 %124, 0
br i1 %125, label %132, label %126
126: ; preds = %123
%127 = tail call i64 @strncmp(i8* %100, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 4)
%128 = icmp eq i64 %127, 0
br i1 %128, label %132, label %129
129: ; preds = %126
%130 = load i32*, i32** @stderr
%131 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %130, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i8* %100)
br label %313
132: ; preds = %126, %123, %114, %120, %106
%133 = phi i32 [ %108, %106 ], [ %116, %114 ], [ %122, %120 ], [ %93, %123 ], [ 0, %126 ]
%134 = phi i32 [ %110, %106 ], [ %94, %114 ], [ %94, %120 ], [ %94, %123 ], [ 0, %126 ]
%135 = phi i1 [ false, %106 ], [ false, %114 ], [ false, %120 ], [ false, %123 ], [ true, %126 ]
%136 = tail call i32* @strstr(i8* dereferenceable(1) %100, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%137 = icmp ne i32* %136, null
%138 = icmp sgt i32 %101, 0
%139 = select i1 %138, i32 %101, i32 0
%140 = getelementptr inbounds i8*, i8** %1, i64 1
%141 = load i8*, i8** %140
%142 = tail call i32 @strlen(i8* %141)
%143 = sub nsw i32 8178, %139
%144 = icmp sgt i32 %142, %143
br i1 %144, label %145, label %148
145: ; preds = %132
%146 = load i32*, i32** @stderr
%147 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i64 20, i64 1, i32* %146)
br label %313
148: ; preds = %132
%149 = icmp eq i32 %102, 0
%150 = load i8*, i8** %140
br i1 %149, label %186, label %151
151: ; preds = %148
br i1 %138, label %152, label %169
152: ; preds = %151
%153 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %150, i32 %139, i32 %103)
%154 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br i1 %135, label %162, label %155
155: ; preds = %152
%156 = load i8*, i8** %140
%157 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %156, i32 %139, i32 %103)
%158 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%159 = load i8*, i8** %140
%160 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* %159, i32 %139, i32 %103)
%161 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %162
162: ; preds = %155, %152
%163 = phi i32* [ %161, %155 ], [ null, %152 ]
%164 = phi i32* [ %158, %155 ], [ null, %152 ]
br i1 %137, label %165, label %195
165: ; preds = %162
%166 = load i8*, i8** %140
%167 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %166, i32 %139, i32 %103)
%168 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %195
169: ; preds = %151
%170 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* %150)
%171 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br i1 %135, label %179, label %172
172: ; preds = %169
%173 = load i8*, i8** %140
%174 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* %173)
%175 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%176 = load i8*, i8** %140
%177 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8* %176)
%178 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %179
179: ; preds = %172, %169
%180 = phi i32* [ %178, %172 ], [ null, %169 ]
%181 = phi i32* [ %175, %172 ], [ null, %169 ]
br i1 %137, label %182, label %195
182: ; preds = %179
%183 = load i8*, i8** %140
%184 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8* %183)
%185 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %195
186: ; preds = %148
br i1 %138, label %187, label %189
187: ; preds = %186
%188 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %150, i32 %139, i32 %103)
br label %191
189: ; preds = %186
%190 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i8* %150)
br label %191
191: ; preds = %189, %187
%192 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%193 = select i1 %135, i32* null, i32* %192
%194 = select i1 %137, i32* %192, i32* null
br label %195
195: ; preds = %191, %165, %162, %182, %179
%196 = phi i32* [ %163, %165 ], [ %163, %162 ], [ %180, %182 ], [ %180, %179 ], [ %193, %191 ]
%197 = phi i32* [ %168, %165 ], [ null, %162 ], [ %185, %182 ], [ null, %179 ], [ %194, %191 ]
%198 = phi i32* [ null, %165 ], [ null, %162 ], [ null, %182 ], [ null, %179 ], [ %192, %191 ]
%199 = phi i32* [ %164, %165 ], [ %164, %162 ], [ %181, %182 ], [ %181, %179 ], [ %193, %191 ]
%200 = phi i32* [ %154, %165 ], [ %154, %162 ], [ %171, %182 ], [ %171, %179 ], [ %192, %191 ]
%201 = icmp eq i32* %200, null
br i1 %201, label %213, label %202
202: ; preds = %195
br i1 %135, label %210, label %203
203: ; preds = %202
%204 = icmp eq i32* %199, null
%205 = icmp eq i32* %196, null
%206 = or i1 %205, %204
%207 = icmp eq i32* %197, null
%208 = and i1 %137, %207
%209 = select i1 %206, i1 true, i1 %208
br i1 %209, label %213, label %216
210: ; preds = %202
%211 = icmp eq i32* %197, null
%212 = and i1 %137, %211
br i1 %212, label %213, label %216
213: ; preds = %210, %203, %195
%214 = load i32*, i32** @stderr
%215 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.23, i64 0, i64 0), i64 29, i64 1, i32* %214)
br label %313
216: ; preds = %203, %210
%217 = load i8*, i8** %140
%218 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i64 0, i64 0), i8* %217)
%219 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i64 0, i64 0))
%220 = icmp eq i32* %219, null
br i1 %220, label %221, label %224
221: ; preds = %216
%222 = load i32*, i32** @stderr
%223 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.26, i64 0, i64 0), i64 27, i64 1, i32* %222)
br label %313
224: ; preds = %216
%225 = sext i8 %95 to i32
%226 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %219, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.27, i64 0, i64 0), i32 %93, i32 %94, i32 %96, i32 %97, i32 %225, i32 %98, i32 %99)
%227 = tail call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%228 = icmp eq i64 %227, 0
br i1 %228, label %231, label %229
229: ; preds = %224
%230 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %219, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), i8* %100)
br label %231
231: ; preds = %229, %224
%232 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.29, i64 0, i64 0), i64 1, i64 1, i32* %219)
%233 = mul nsw i32 %94, %93
%234 = sext i32 %233 to i64
%235 = tail call i64 @malloc(i64 %234)
%236 = inttoptr i64 %235 to i8*
%237 = tail call i32 @fread(i8* %236, i32 %93, i32 %94, i32* %200)
%238 = icmp slt i32 %237, %94
br i1 %238, label %313, label %239
239: ; preds = %231, %304
%240 = phi i32 [ %310, %304 ], [ %103, %231 ]
%241 = phi i32* [ %309, %304 ], [ %200, %231 ]
%242 = phi i32* [ %308, %304 ], [ %199, %231 ]
%243 = phi i32* [ %307, %304 ], [ %198, %231 ]
%244 = phi i32* [ %306, %304 ], [ %197, %231 ]
%245 = phi i32* [ %305, %304 ], [ %196, %231 ]
%246 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.30, i64 0, i64 0), i64 6, i64 1, i32* %219)
%247 = tail call i32 @fwrite(i8* %236, i32 %93, i32 %94, i32* %219)
br i1 %135, label %253, label %248
248: ; preds = %239
%249 = tail call i32 @fread(i8* %236, i32 %133, i32 %134, i32* %242)
%250 = tail call i32 @fwrite(i8* %236, i32 %133, i32 %134, i32* %219)
%251 = tail call i32 @fread(i8* %236, i32 %133, i32 %134, i32* %245)
%252 = tail call i32 @fwrite(i8* %236, i32 %133, i32 %134, i32* %219)
br label %253
253: ; preds = %248, %239
br i1 %137, label %254, label %257
254: ; preds = %253
%255 = tail call i32 @fread(i8* %236, i32 %93, i32 %94, i32* %244)
%256 = tail call i32 @fwrite(i8* %236, i32 %93, i32 %94, i32* %219)
br label %257
257: ; preds = %254, %253
br i1 %138, label %258, label %304
258: ; preds = %257
%259 = add nsw i32 %240, 1
%260 = load i8*, i8** %140
br i1 %149, label %282, label %261
261: ; preds = %258
%262 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %260, i32 %139, i32 %259)
%263 = tail call i32 @fclose(i32* %241)
%264 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br i1 %135, label %274, label %265
265: ; preds = %261
%266 = load i8*, i8** %140
%267 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %266, i32 %139, i32 %259)
%268 = tail call i32 @fclose(i32* %242)
%269 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%270 = load i8*, i8** %140
%271 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* %270, i32 %139, i32 %259)
%272 = tail call i32 @fclose(i32* %245)
%273 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %274
274: ; preds = %265, %261
%275 = phi i32* [ %273, %265 ], [ %245, %261 ]
%276 = phi i32* [ %269, %265 ], [ %242, %261 ]
br i1 %137, label %277, label %289
277: ; preds = %274
%278 = load i8*, i8** %140
%279 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %278, i32 %139, i32 %259)
%280 = tail call i32 @fclose(i32* %244)
%281 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %289
282: ; preds = %258
%283 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i8* %260, i32 %139, i32 %259)
%284 = tail call i32 @fclose(i32* %243)
%285 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%286 = select i1 %135, i32* %245, i32* %285
%287 = select i1 %135, i32* %242, i32* %285
%288 = select i1 %137, i32* %285, i32* %244
br label %289
289: ; preds = %282, %274, %277
%290 = phi i32* [ %275, %277 ], [ %275, %274 ], [ %286, %282 ]
%291 = phi i32* [ %281, %277 ], [ %244, %274 ], [ %288, %282 ]
%292 = phi i32* [ %243, %277 ], [ %243, %274 ], [ %285, %282 ]
%293 = phi i32* [ %276, %277 ], [ %276, %274 ], [ %287, %282 ]
%294 = phi i32* [ %264, %277 ], [ %264, %274 ], [ %285, %282 ]
%295 = icmp eq i32* %294, null
br i1 %295, label %313, label %296
296: ; preds = %289
br i1 %135, label %301, label %297
297: ; preds = %296
%298 = icmp eq i32* %293, null
%299 = icmp eq i32* %290, null
%300 = select i1 %298, i1 true, i1 %299
br i1 %300, label %313, label %301
301: ; preds = %297, %296
%302 = icmp eq i32* %291, null
%303 = select i1 %137, i1 %302, i1 false
br i1 %303, label %313, label %304
304: ; preds = %301, %257
%305 = phi i32* [ %290, %301 ], [ %245, %257 ]
%306 = phi i32* [ %291, %301 ], [ %244, %257 ]
%307 = phi i32* [ %292, %301 ], [ %243, %257 ]
%308 = phi i32* [ %293, %301 ], [ %242, %257 ]
%309 = phi i32* [ %294, %301 ], [ %241, %257 ]
%310 = phi i32 [ %259, %301 ], [ %240, %257 ]
%311 = tail call i32 @fread(i8* %236, i32 %93, i32 %94, i32* %309)
%312 = icmp slt i32 %311, %94
br i1 %312, label %313, label %239
313: ; preds = %289, %297, %301, %304, %231, %221, %213, %145, %129, %74, %30, %10
%314 = phi i32 [ -1, %10 ], [ -1, %30 ], [ -1, %74 ], [ -1, %145 ], [ -1, %213 ], [ -1, %221 ], [ -1, %129 ], [ 0, %231 ], [ 0, %304 ], [ 0, %301 ], [ 0, %297 ], [ 0, %289 ]
ret i32 %314
}