#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 */
char EOF;
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fread(char *, long, int, int /*<<< orphan*/ *);
long getFileSize(char *);
char getopt(int, char **, char *);
int /*<<< orphan*/ isdigit(char);
scalar_t__ malloc(long);
int /*<<< orphan*/ openFile(int /*<<< orphan*/ **, char *, char *);
char *optarg;
int optind;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
char *strstr(char *, char *);
char *strtok_r(char *, char *, char **);
int usage();
int main(int argc, char *argv[]) {
  char c;
  int filterMode = 0;
  int minL = 0;
  int outGenotype = 0;
  int onlyExist = 0;
  int simpleGenotype = 0;
  char *chromosome = NULL;
  char *indiName = NULL;
  while ((c = getopt(argc, argv, "fgi:c:n:")) != EOF) {
    switch (c) {
    case 'f':
      filterMode = 1;
      break;
    case 'g':
      outGenotype = 1;
      break;
    case 'o':
      onlyExist = 1;
      break;
    case 's':
      simpleGenotype = 1;
      break;
    case 'c':
      chromosome = optarg;
      break;
    case 'n':
      indiName = optarg;
      break;
    case 'i':
      minL = atoi(optarg);
      break;
    }
  }
  if (argc - optind != 2)
    return usage();
  FILE *fpin, *fpout;
  openFile(&fpin, argv[optind], "r");
  openFile(&fpout, argv[optind + 1], "w");
  long fileSize = getFileSize(argv[optind]);
  char *buf = (char *)malloc(fileSize + 10);
  if (fileSize == 0 || fread(buf, fileSize, 1, fpin) != 1) {
    perror(argv[optind]);
    return -1;
  }
  char *str, *s_tab, *s_line, *str_line, *str_tab;
  str = s_tab = s_line = str_line = str_tab = NULL;
  int brk1, brk2, svlen;
  svlen = brk1 = brk2 = 0;
  int indiNum, indiCnt, varCnt;
  char *chr = NULL;
  char *prechr = NULL;
  int prebrk2 = 0;
  s_line = strtok_r(buf, "\n", &str_line);
  varCnt = 0;
  indiNum = -1;
  do {
    if (s_line[0] == '#') {
      indiNum = 0;
      if (outGenotype == 1 && s_line[1] != '#') {
        s_tab = strstr(s_line, "FORMAT");
        s_tab = strtok_r(s_tab, "\t", &str_tab);
        if (indiName != NULL) {
          while ((s_tab = strtok_r(NULL, "\t", &str_tab)) != NULL) {
            if (strcmp(s_tab, indiName) == 0) {
              break;
            }
            indiNum++;
          }
          if (s_tab == NULL) {
            fprintf(stderr, "can not find %s\n", indiName);
            exit(1);
          }
        }
      }
      continue;
    }
    if (indiNum == -1) {
      fprintf(stderr, "can not find %s\n", indiName);
      exit(1);
    }
    s_tab = strtok_r(s_line, "\t", &str_tab);
    chr = s_tab;
    if (chromosome != NULL) {
      if (strcmp(chr, chromosome) != 0)
        continue;
    }
    s_tab = strtok_r(NULL, "\t", &str_tab);
    brk1 = atoi(s_tab);
    if (filterMode && !outGenotype)
      if (prechr != NULL && !strcmp(prechr, chr) && brk1 < prebrk2) {
        continue;
      }
    strtok_r(NULL, "\t", &str_tab);
    strtok_r(NULL, "\t", &str_tab);
    s_tab = strtok_r(NULL, "\t", &str_tab);
    if (filterMode)
      if (strlen(s_tab) > 1 && s_tab[0] != '<') {
        continue;
      }
    strtok_r(NULL, "\t", &str_tab);
    strtok_r(NULL, "\t", &str_tab);
    s_tab = strtok_r(NULL, "\t", &str_tab);
    str = strtok_r(s_tab, ";", &s_tab);
    do {
      if (strstr(str, "END") == str) {
        sscanf(str, "END=%d", &brk2);
        brk2 = brk2 + 1;
        break;
      }
    } while ((str = strtok_r(NULL, ";", &s_tab)) != NULL);
    svlen = brk2 - brk1 - 1;
    if (svlen < minL)
      continue;
    if (outGenotype) {
      indiCnt = 0;
      strtok_r(NULL, "\t", &str_tab);
      if (indiName == NULL) {
        fprintf(fpout, "%s\t%d\t%d", chr, brk1, brk2);
        while ((s_tab = strtok_r(NULL, "\t", &str_tab)) != NULL) {
          if (!simpleGenotype)
            fprintf(fpout, "\t%c/%c", s_tab[0], s_tab[2]);
          else {
            int temp = s_tab[0] - '0' + s_tab[1] - '0';
            if (temp == 2)
              temp = 1;
            fprintf(fpout, "\t%d", temp);
          }
          if (!isdigit(s_tab[0]) || !isdigit(s_tab[2]))
            fprintf(stderr, "[varID:%d, indiID:%d] genotype: %c/%c\n", varCnt,
                    indiCnt, s_tab[0], s_tab[2]);
          indiCnt++;
        }
        fprintf(fpout, "\n");
      } else {
        while ((s_tab = strtok_r(NULL, "\t", &str_tab)) != NULL) {
          if (indiCnt == indiNum) {
            if (onlyExist == 0 || s_tab[0] != '0' || s_tab[2] != '0') {
              if (filterMode && prechr != NULL && !strcmp(prechr, chr) &&
                  brk1 < prebrk2) {
                continue;
              }
              if (!isdigit(s_tab[0]) || !isdigit(s_tab[2])) {
                fprintf(stdout, "[varID:%d, indiID:%d] genotype: %c/%c\n",
                        varCnt, indiCnt, s_tab[0], s_tab[2]);
                varCnt--;
              } else {
                fprintf(fpout, "%s\t%d\t%d", chr, brk1, brk2);
                if (!simpleGenotype)
                  fprintf(fpout, "\t%c/%c\n", s_tab[0], s_tab[2]);
                else {
                  int temp = s_tab[0] - '0' + s_tab[1] - '0';
                  if (temp == 2)
                    temp = 1;
                  fprintf(fpout, "\t%d\n", temp);
                }
              }
              varCnt++;
              prechr = chr;
              prebrk2 = brk2;
            }
            break;
          }
          indiCnt++;
        }
      }
    } else {
      fprintf(fpout, "%s\t%d\t%d\n", chr, brk1, brk2);
      varCnt++;
      prechr = chr;
      prebrk2 = brk2;
    }
  } while ((s_line = strtok_r(NULL, "\n", &str_line)) != NULL);
  fclose(fpin);
  fclose(fpout);
  if (indiName)
    fprintf(stdout, "NAME: %s\t", indiName);
  else if (outGenotype)
    fprintf(stdout, "INDI_CNT: %d\t", indiCnt);
  if (chromosome)
    fprintf(stdout, "CHROM: %s\t", chromosome);
  fprintf(stdout, "VAR_CNT: %d\n", varCnt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdda(%rip),%rdx
call   1100 <getopt@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2d64(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1324 <main+0x114>
movsbl -0x11(%rbp),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0xc0(%rbp)
sub    $0x10,%eax
ja     131f <main+0x10f>
mov    -0xc0(%rbp),%rax
lea    0xd52(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x18(%rbp)
jmp    131f <main+0x10f>
movl   $0x1,-0x20(%rbp)
jmp    131f <main+0x10f>
movl   $0x1,-0x24(%rbp)
jmp    131f <main+0x10f>
movl   $0x1,-0x28(%rbp)
jmp    131f <main+0x10f>
mov    0x2d0a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    131f <main+0x10f>
mov    0x2cf7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    131f <main+0x10f>
mov    0x2ce4(%rip),%rax
mov    (%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    125c <main+0x4c>
mov    -0x8(%rbp),%eax
mov    0x2caa(%rip),%rcx
sub    (%rcx),%eax
cmp    $0x2,%eax
je     1348 <main+0x138>
mov    $0x0,%al
call   10e0 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1ccf <main+0xabf>
mov    -0x10(%rbp),%rax
mov    0x2c85(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rsi
lea    -0x40(%rbp),%rdi
lea    0xce8(%rip),%rdx
call   1060 <openFile@plt>
mov    -0x10(%rbp),%rax
mov    0x2c63(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    -0x48(%rbp),%rdi
lea    0xcc3(%rip),%rdx
call   1060 <openFile@plt>
mov    -0x10(%rbp),%rax
mov    0x2c3c(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <getFileSize@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
add    $0xa,%rdi
call   10c0 <malloc@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     13e7 <main+0x1d7>
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x40(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fread@plt>
cmp    $0x1,%eax
je     140a <main+0x1fa>
mov    -0x10(%rbp),%rax
mov    0x2be6(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   10f0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1ccf <main+0xabf>
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x60(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x8c(%rbp)
movq   $0x0,-0xa0(%rbp)
movq   $0x0,-0xa8(%rbp)
movl   $0x0,-0xac(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xc38(%rip),%rsi
lea    -0x78(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0xffffffff,-0x90(%rbp)
ff ff ff
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    159f <main+0x38f>
movl   $0x0,-0x90(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    159a <main+0x38a>
mov    -0x70(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x23,%eax
je     159a <main+0x38a>
mov    -0x70(%rbp),%rdi
lea    0xb75(%rip),%rsi
call   1130 <strstr@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
lea    0xbe5(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1595 <main+0x385>
jmp    150d <main+0x2fd>
xor    %eax,%eax
mov    %eax,%edi
lea    0xbbd(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
cmp    $0x0,%rax
je     155f <main+0x34f>
mov    -0x68(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    154b <main+0x33b>
jmp    155f <main+0x34f>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    150d <main+0x2fd>
cmpq   $0x0,-0x68(%rbp)
jne    1590 <main+0x380>
mov    0x2a57(%rip),%rax
movslq (%rax),%rdi
mov    -0x38(%rbp),%rdx
lea    0xad9(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
jmp    1595 <main+0x385>
jmp    159a <main+0x38a>
jmp    1bf6 <main+0x9e6>
cmpl   $0xffffffff,-0x90(%rbp)
jne    15d2 <main+0x3c2>
mov    0x2a15(%rip),%rax
movslq (%rax),%rdi
mov    -0x38(%rbp),%rdx
lea    0xa97(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    -0x70(%rbp),%rdi
lea    0xaf8(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1624 <main+0x414>
mov    -0xa0(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     161f <main+0x40f>
jmp    1bf6 <main+0x9e6>
jmp    1624 <main+0x414>
xor    %eax,%eax
mov    %eax,%edi
lea    0xaa6(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     16a6 <main+0x496>
cmpl   $0x0,-0x20(%rbp)
jne    16a6 <main+0x496>
cmpq   $0x0,-0xa8(%rbp)
je     16a1 <main+0x491>
mov    -0xa8(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    16a1 <main+0x491>
mov    -0x84(%rbp),%eax
cmp    -0xac(%rbp),%eax
jge    16a1 <main+0x491>
jmp    1bf6 <main+0x9e6>
jmp    16a6 <main+0x496>
xor    %eax,%eax
mov    %eax,%edi
lea    0xa24(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xa10(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0x9fc(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     171c <main+0x50c>
mov    -0x68(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x1,%eax
jle    1717 <main+0x507>
mov    -0x68(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
je     1717 <main+0x507>
jmp    1bf6 <main+0x9e6>
jmp    171c <main+0x50c>
xor    %eax,%eax
mov    %eax,%edi
lea    0x9ae(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0x99a(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0x986(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
lea    0x902(%rip),%rsi
lea    -0x68(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
lea    0x8ec(%rip),%rsi
call   1130 <strstr@plt>
cmp    -0x60(%rbp),%rax
jne    17b9 <main+0x5a9>
mov    -0x60(%rbp),%rdi
lea    0x8d6(%rip),%rsi
lea    -0x88(%rbp),%rdx
call   10d0 <sscanf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    17e0 <main+0x5d0>
jmp    17be <main+0x5ae>
xor    %eax,%eax
mov    %eax,%edi
lea    0x8a0(%rip),%rsi
lea    -0x68(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    1774 <main+0x564>
mov    -0x88(%rbp),%eax
sub    -0x84(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1809 <main+0x5f9>
jmp    1bf6 <main+0x9e6>
cmpl   $0x0,-0x20(%rbp)
je     1ba2 <main+0x992>
movl   $0x0,-0x94(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x8ad(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
cmpq   $0x0,-0x38(%rbp)
jne    198b <main+0x77b>
mov    -0x48(%rbp),%rdi
mov    -0xa0(%rbp),%rdx
mov    -0x84(%rbp),%ecx
mov    -0x88(%rbp),%r8d
lea    0x81b(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0x868(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
cmp    $0x0,%rax
je     1974 <main+0x764>
cmpl   $0x0,-0x28(%rbp)
jne    18b4 <main+0x6a4>
mov    -0x48(%rbp),%rdi
mov    -0x68(%rbp),%rax
movsbl (%rax),%edx
mov    -0x68(%rbp),%rax
movsbl 0x2(%rax),%ecx
lea    0x7d7(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1900 <main+0x6f0>
mov    -0x68(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    -0x68(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xb0(%rbp)
cmpl   $0x2,-0xb0(%rbp)
jne    18e8 <main+0x6d8>
movl   $0x1,-0xb0(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0xb0(%rbp),%edx
lea    0x782(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x68(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     192b <main+0x71b>
mov    -0x68(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1960 <main+0x750>
mov    0x2696(%rip),%rax
movslq (%rax),%rdi
mov    -0x98(%rbp),%edx
mov    -0x94(%rbp),%ecx
mov    -0x68(%rbp),%rax
movsbl (%rax),%r8d
mov    -0x68(%rbp),%rax
movsbl 0x2(%rax),%r9d
lea    0x72d(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1862 <main+0x652>
mov    -0x48(%rbp),%rdi
lea    0x734(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1b9d <main+0x98d>
jmp    1990 <main+0x780>
xor    %eax,%eax
mov    %eax,%edi
lea    0x73a(%rip),%rsi
lea    -0x80(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x68(%rbp)
cmp    $0x0,%rax
je     1b98 <main+0x988>
mov    -0x94(%rbp),%eax
cmp    -0x90(%rbp),%eax
jne    1b84 <main+0x974>
cmpl   $0x0,-0x24(%rbp)
je     19ef <main+0x7df>
mov    -0x68(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    19ef <main+0x7df>
mov    -0x68(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x30,%eax
je     1b7f <main+0x96f>
cmpl   $0x0,-0x18(%rbp)
je     1a3b <main+0x82b>
cmpq   $0x0,-0xa8(%rbp)
je     1a3b <main+0x82b>
mov    -0xa8(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1a3b <main+0x82b>
mov    -0x84(%rbp),%eax
cmp    -0xac(%rbp),%eax
jge    1a3b <main+0x82b>
jmp    1990 <main+0x780>
mov    -0x68(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1a66 <main+0x856>
mov    -0x68(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1aaf <main+0x89f>
mov    0x2553(%rip),%rax
mov    (%rax),%rdi
mov    -0x98(%rbp),%edx
mov    -0x94(%rbp),%ecx
mov    -0x68(%rbp),%rax
movsbl (%rax),%r8d
mov    -0x68(%rbp),%rax
movsbl 0x2(%rax),%r9d
lea    0x5f2(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x98(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x98(%rbp)
jmp    1b56 <main+0x946>
mov    -0x48(%rbp),%rdi
mov    -0xa0(%rbp),%rdx
mov    -0x84(%rbp),%ecx
mov    -0x88(%rbp),%r8d
lea    0x5a8(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
cmpl   $0x0,-0x28(%rbp)
jne    1b05 <main+0x8f5>
mov    -0x48(%rbp),%rdi
mov    -0x68(%rbp),%rax
movsbl (%rax),%edx
mov    -0x68(%rbp),%rax
movsbl 0x2(%rax),%ecx
lea    0x5b4(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1b51 <main+0x941>
mov    -0x68(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    -0x68(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xb4(%rbp)
cmpl   $0x2,-0xb4(%rbp)
jne    1b39 <main+0x929>
movl   $0x1,-0xb4(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0xb4(%rbp),%edx
lea    0x570(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1b56 <main+0x946>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0xac(%rbp)
jmp    1b98 <main+0x988>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1990 <main+0x780>
jmp    1b9d <main+0x98d>
jmp    1bf1 <main+0x9e1>
mov    -0x48(%rbp),%rdi
mov    -0xa0(%rbp),%rdx
mov    -0x84(%rbp),%ecx
mov    -0x88(%rbp),%r8d
lea    0x4f4(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0xac(%rbp)
jmp    1bf6 <main+0x9e6>
xor    %eax,%eax
mov    %eax,%edi
lea    0x4b2(%rip),%rsi
lea    -0x78(%rbp),%rdx
call   1090 <strtok_r@plt>
mov    %rax,-0x70(%rbp)
cmp    $0x0,%rax
jne    149c <main+0x28c>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x38(%rbp)
je     1c56 <main+0xa46>
mov    0x2384(%rip),%rax
mov    (%rax),%rdi
mov    -0x38(%rbp),%rdx
lea    0x475(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1c83 <main+0xa73>
cmpl   $0x0,-0x20(%rbp)
je     1c7e <main+0xa6e>
mov    0x2359(%rip),%rax
mov    (%rax),%rdi
mov    -0x94(%rbp),%edx
lea    0x452(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1c83 <main+0xa73>
cmpq   $0x0,-0x30(%rbp)
je     1caa <main+0xa9a>
mov    0x232b(%rip),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rdx
lea    0x434(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    0x230f(%rip),%rax
mov    (%rax),%rdi
mov    -0x98(%rbp),%edx
lea    0x421(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r12
mov    %edi,%ebp
lea    0xdfa(%rip),%rdx
call   1120 <getopt@plt>
mov    0x2d8a(%rip),%r15
cmp    (%r15),%al
jne    138e <main+0x15e>
xor    %eax,%eax
mov    %rax,0x60(%rsp)
movl   $0x0,0x38(%rsp)
xor    %eax,%eax
mov    %rax,0x40(%rsp)
xor    %eax,%eax
mov    %rax,0x48(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x54(%rsp)
xor    %eax,%eax
mov    %rax,0x58(%rsp)
mov    0x2d3e(%rip),%rbx
movslq (%rbx),%rax
sub    %eax,%ebp
cmp    $0x2,%ebp
jne    145c <main+0x22c>
mov    (%r12,%rax,8),%rsi
lea    0xd9a(%rip),%rdx
lea    0x70(%rsp),%rdi
call   1070 <openFile@plt>
movslq (%rbx),%rax
mov    0x8(%r12,%rax,8),%rsi
lea    0xd83(%rip),%rdx
lea    0x30(%rsp),%rdi
call   1070 <openFile@plt>
movslq (%rbx),%rax
mov    (%r12,%rax,8),%rdi
call   1090 <getFileSize@plt>
mov    %rax,%rbp
lea    0xa(%rax),%rdi
call   10e0 <malloc@plt>
test   %rbp,%rbp
je     1aec <main+0x8bc>
mov    %rax,%r14
mov    0x70(%rsp),%rcx
mov    %rax,%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
call   1050 <fread@plt>
cmp    $0x1,%eax
jne    1aec <main+0x8bc>
movq   $0x0,0x28(%rsp)
movq   $0x0,0x68(%rsp)
movq   $0x0,0x8(%rsp)
movl   $0x0,0x14(%rsp)
lea    0xd71(%rip),%rsi
lea    0x68(%rsp),%rdx
mov    %r14,%rdi
call   10b0 <strtok_r@plt>
cmpl   $0x0,0x58(%rsp)
setne  %cl
cmpl   $0x0,0x20(%rsp)
sete   %dl
and    %cl,%dl
mov    %dl,0x1b(%rsp)
mov    $0xffffffff,%r13d
lea    0xd63(%rip),%rbp
movl   $0x0,0x1c(%rsp)
xor    %ebx,%ebx
movl   $0x0,0x3c(%rsp)
mov    0x40(%rsp),%r12
jmp    14a9 <main+0x279>
xor    %ecx,%ecx
mov    %rcx,0x58(%rsp)
lea    0xca8(%rip),%r14
lea    0xc5d(%rip),%rbx
mov    0x2c4e(%rip),%r13
movl   $0x0,0x54(%rsp)
movl   $0x0,0x20(%rsp)
xor    %ecx,%ecx
mov    %rcx,0x48(%rsp)
xor    %ecx,%ecx
mov    %rcx,0x40(%rsp)
movl   $0x0,0x38(%rsp)
xor    %ecx,%ecx
mov    %rcx,0x60(%rsp)
jmp    1406 <main+0x1d6>
mov    0x0(%r13),%rdi
call   1130 <atoi@plt>
mov    %eax,0x54(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1120 <getopt@plt>
cmp    (%r15),%al
je     1293 <main+0x63>
movsbl %al,%eax
add    $0xffffff9d,%eax
cmp    $0x10,%eax
ja     13f0 <main+0x1c0>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    0x0(%r13),%rax
mov    %rax,0x40(%rsp)
jmp    13f0 <main+0x1c0>
mov    $0x1,%eax
mov    %rax,0x58(%rsp)
jmp    13f0 <main+0x1c0>
movl   $0x1,0x20(%rsp)
jmp    13f0 <main+0x1c0>
mov    0x0(%r13),%rax
mov    %rax,0x48(%rsp)
jmp    13f0 <main+0x1c0>
mov    $0x1,%eax
mov    %rax,0x60(%rsp)
jmp    13f0 <main+0x1c0>
movl   $0x1,0x38(%rsp)
jmp    13f0 <main+0x1c0>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1100 <usage@plt>
mov    0x30(%rsp),%rsi
mov    $0xa,%edi
call   10a0 <fputc@plt>
mov    %rbx,%r15
xor    %edi,%edi
lea    0xc27(%rip),%rsi
lea    0x68(%rsp),%rdx
call   10b0 <strtok_r@plt>
mov    %r15,%rbx
test   %rax,%rax
lea    0xc32(%rip),%rbp
je     1a51 <main+0x821>
cmpb   $0x23,(%rax)
jne    1560 <main+0x330>
xor    %r13d,%r13d
cmpl   $0x1,0x20(%rsp)
jne    1480 <main+0x250>
cmpb   $0x23,0x1(%rax)
je     1480 <main+0x250>
mov    %rax,%rdi
lea    0xb85(%rip),%rsi
call   1150 <strstr@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %rbp,%rsi
lea    0x28(%rsp),%r15
mov    %r15,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
cmpq   $0x0,0x48(%rsp)
je     1480 <main+0x250>
xor    %edi,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1aff <main+0x8cf>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdi
mov    0x48(%rsp),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     17dc <main+0x5ac>
add    $0x1,%r13d
xor    %edi,%edi
lea    0xb92(%rip),%rsi
mov    %r15,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    1520 <main+0x2f0>
jmp    1aff <main+0x8cf>
nopw   0x0(%rax,%rax,1)
cmp    $0xffffffff,%r13d
je     1aff <main+0x8cf>
mov    %rax,%rdi
mov    %rbp,%rsi
lea    0x28(%rsp),%rbp
mov    %rbp,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,%r15
mov    %rax,0x8(%rsp)
test   %r12,%r12
je     159e <main+0x36e>
mov    %r15,%rdi
mov    %r12,%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    1480 <main+0x250>
xor    %edi,%edi
lea    0xb2e(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1130 <atoi@plt>
mov    %eax,0x24(%rsp)
test   %rbx,%rbx
setne  %al
and    0x1b(%rsp),%al
cmp    $0x1,%al
jne    15f0 <main+0x3c0>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    15f0 <main+0x3c0>
mov    0x24(%rsp),%eax
cmp    0x3c(%rsp),%eax
jl     1480 <main+0x250>
nopl   0x0(%rax)
xor    %edi,%edi
lea    0xadc(%rip),%rbp
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
call   10b0 <strtok_r@plt>
xor    %edi,%edi
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
call   10b0 <strtok_r@plt>
xor    %edi,%edi
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
cmpl   $0x0,0x58(%rsp)
je     164b <main+0x41b>
mov    %rax,%rdi
call   1080 <strlen@plt>
cmp    $0x2,%eax
jl     164b <main+0x41b>
mov    0x8(%rsp),%rax
cmpb   $0x3c,(%rax)
jne    1480 <main+0x250>
xor    %edi,%edi
lea    0xa81(%rip),%rbp
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
call   10b0 <strtok_r@plt>
xor    %edi,%edi
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
call   10b0 <strtok_r@plt>
xor    %edi,%edi
mov    %rbp,%rsi
lea    0x28(%rsp),%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
lea    0x9db(%rip),%rsi
lea    0x8(%rsp),%rdx
call   10b0 <strtok_r@plt>
mov    %rax,%r12
nopl   0x0(%rax,%rax,1)
lea    0x9c4(%rip),%rbp
mov    %rbp,%rdi
call   1080 <strlen@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
je     16e3 <main+0x4b3>
xor    %edi,%edi
lea    0x99f(%rip),%rsi
lea    0x8(%rsp),%rdx
call   10b0 <strtok_r@plt>
mov    %rax,%r12
test   %rax,%rax
jne    16a0 <main+0x470>
mov    0x14(%rsp),%r8d
jmp    1705 <main+0x4d5>
mov    %r12,%rdi
lea    0x982(%rip),%rsi
lea    0x14(%rsp),%rdx
call   10f0 <sscanf@plt>
mov    0x14(%rsp),%r8d
add    $0x1,%r8d
mov    %r8d,0x14(%rsp)
mov    0x24(%rsp),%eax
not    %eax
add    %r8d,%eax
cmp    0x54(%rsp),%eax
mov    0x40(%rsp),%r12
jl     1480 <main+0x250>
cmpl   $0x0,0x20(%rsp)
je     17f0 <main+0x5c0>
xor    %edi,%edi
lea    0x28(%rsp),%rdx
lea    0x99f(%rip),%rbp
mov    %rbp,%rsi
call   10b0 <strtok_r@plt>
cmpq   $0x0,0x48(%rsp)
je     181c <main+0x5ec>
test   %rbx,%rbx
setne  %al
cmpl   $0x0,0x58(%rsp)
setne  %r12b
and    %al,%r12b
xor    %r14d,%r14d
lea    0x28(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
lea    0x95c(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1a23 <main+0x7f3>
cmp    %r13d,%r14d
jne    17d6 <main+0x5a6>
cmpl   $0x0,0x60(%rsp)
je     17aa <main+0x57a>
cmpb   $0x30,(%rax)
jne    17aa <main+0x57a>
cmpb   $0x30,0x2(%rax)
je     1a20 <main+0x7f0>
test   %r12b,%r12b
je     194f <main+0x71f>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    194a <main+0x71a>
mov    0x24(%rsp),%eax
cmp    0x3c(%rsp),%eax
jl     1770 <main+0x540>
jmp    194a <main+0x71a>
add    $0x1,%r14d
jmp    1770 <main+0x540>
cmpq   $0x0,0x8(%rsp)
mov    %rbx,%r15
jne    1483 <main+0x253>
jmp    1aff <main+0x8cf>
mov    0x30(%rsp),%rdi
lea    0x8b9(%rip),%rsi
mov    %r15,%rdx
mov    0x24(%rsp),%ecx
xor    %eax,%eax
call   10d0 <fprintf@plt>
addl   $0x1,0x1c(%rsp)
mov    0x14(%rsp),%eax
mov    %eax,0x3c(%rsp)
jmp    1483 <main+0x253>
mov    0x30(%rsp),%rdi
mov    0x14(%rsp),%r8d
xor    %r14d,%r14d
lea    0x846(%rip),%rsi
mov    %r15,%rdx
mov    0x24(%rsp),%ecx
xor    %eax,%eax
call   10d0 <fprintf@plt>
xor    %edi,%edi
mov    %rbp,%rsi
lea    0x28(%rsp),%rbp
mov    %rbp,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
mov    0x38(%rsp),%r15d
je     1471 <main+0x241>
xor    %r14d,%r14d
jmp    18c0 <main+0x690>
nopl   0x0(%rax,%rax,1)
mov    0x2751(%rip),%rax
movslq (%rax),%rdi
mov    0x8(%rsp),%rax
movsbl (%rax),%r8d
movsbl 0x2(%rax),%r9d
lea    0x7f7(%rip),%rsi
mov    0x1c(%rsp),%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   10d0 <fprintf@plt>
add    $0x1,%r14d
xor    %edi,%edi
lea    0x82b(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <strtok_r@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1471 <main+0x241>
test   %r15d,%r15d
je     1900 <main+0x6d0>
movsbl (%rax),%ecx
movsbl 0x1(%rax),%eax
lea    (%rcx,%rax,1),%edx
add    $0xffffffa0,%edx
cmp    $0x2,%edx
mov    $0x1,%eax
cmove  %eax,%edx
mov    0x30(%rsp),%rdi
lea    0x792(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    191a <main+0x6ea>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x30(%rsp),%rdi
movsbl (%rax),%edx
movsbl 0x2(%rax),%ecx
lea    0x76c(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    0x8(%rsp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     1870 <main+0x640>
mov    0x8(%rsp),%rax
movsbl 0x2(%rax),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
jne    189d <main+0x66d>
jmp    1870 <main+0x640>
mov    0x8(%rsp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     19d2 <main+0x7a2>
mov    0x8(%rsp),%rax
movsbl 0x2(%rax),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     19d2 <main+0x7a2>
mov    0x30(%rsp),%rdi
mov    0x14(%rsp),%r8d
lea    0x6f8(%rip),%rsi
mov    %r15,%rdx
mov    0x24(%rsp),%ecx
xor    %eax,%eax
call   10d0 <fprintf@plt>
cmpl   $0x0,0x38(%rsp)
mov    0x40(%rsp),%r12
mov    0x1c(%rsp),%ebx
je     1a30 <main+0x800>
mov    0x8(%rsp),%rax
movsbl (%rax),%ecx
movsbl 0x1(%rax),%eax
lea    (%rcx,%rax,1),%edx
add    $0xffffffa0,%edx
cmp    $0x2,%edx
mov    $0x1,%eax
cmove  %eax,%edx
mov    0x30(%rsp),%rdi
lea    0x6f1(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    1a09 <main+0x7d9>
mov    0x25e7(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%rsp),%rax
movsbl (%rax),%r8d
movsbl 0x2(%rax),%r9d
lea    0x695(%rip),%rsi
mov    0x1c(%rsp),%ebx
mov    %ebx,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   10d0 <fprintf@plt>
add    $0xffffffff,%ebx
mov    0x40(%rsp),%r12
add    $0x1,%ebx
mov    %ebx,0x1c(%rsp)
mov    0x14(%rsp),%eax
mov    %eax,0x3c(%rsp)
mov    %r13d,%r14d
jmp    1483 <main+0x253>
mov    %r13d,%r14d
mov    %rbx,%r15
mov    0x40(%rsp),%r12
jmp    1483 <main+0x253>
mov    0x30(%rsp),%rdi
mov    0x8(%rsp),%rax
movsbl (%rax),%edx
movsbl 0x2(%rax),%ecx
lea    0x665(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    1a09 <main+0x7d9>
mov    0x70(%rsp),%rdi
call   1060 <fclose@plt>
mov    0x30(%rsp),%rdi
call   1060 <fclose@plt>
mov    0x48(%rsp),%rdx
test   %rdx,%rdx
je     1a89 <main+0x859>
mov    0x254a(%rip),%rbx
mov    (%rbx),%rdi
lea    0x63f(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    1aab <main+0x87b>
cmpl   $0x0,0x20(%rsp)
mov    0x252b(%rip),%rbx
je     1aab <main+0x87b>
mov    (%rbx),%rdi
lea    0x628(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   10d0 <fprintf@plt>
test   %r12,%r12
je     1ac4 <main+0x894>
mov    (%rbx),%rdi
lea    0x61d(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    (%rbx),%rdi
lea    0x614(%rip),%rsi
xor    %ebx,%ebx
mov    0x1c(%rsp),%edx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    %ebx,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movslq (%rbx),%rax
mov    (%r12,%rax,8),%rdi
call   1110 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1adb <main+0x8ab>
mov    0x24c2(%rip),%rax
movslq (%rax),%rdi
lea    0x548(%rip),%rsi
mov    0x48(%rsp),%rdx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"fgi:c:n:\00"
@EOF = global i8 0
@optarg = global i8* null
@optind = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [7 x i8] c"FORMAT\00"
@.str.5 = [2 x i8] c"\09\00"
@stderr = global i32 0
@.str.6 = [17 x i8] c"can not find %s\0A\00"
@.str.7 = [2 x i8] c";\00"
@.str.8 = [4 x i8] c"END\00"
@.str.9 = [7 x i8] c"END=%d\00"
@.str.10 = [9 x i8] c"%s\09%d\09%d\00"
@.str.11 = [7 x i8] c"\09%c/%c\00"
@.str.12 = [4 x i8] c"\09%d\00"
@.str.13 = [39 x i8] c"[varID:%d, indiID:%d] genotype: %c/%c\0A\00"
@stdout = global i32* null
@.str.14 = [8 x i8] c"\09%c/%c\0A\00"
@.str.15 = [5 x i8] c"\09%d\0A\00"
@.str.16 = [10 x i8] c"%s\09%d\09%d\0A\00"
@.str.17 = [10 x i8] c"NAME: %s\09\00"
@.str.18 = [14 x i8] c"INDI_CNT: %d\09\00"
@.str.19 = [11 x i8] c"CHROM: %s\09\00"
@.str.20 = [13 x i8] c"VAR_CNT: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i8*
%30 = alloca i8*
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i8* null, i8** %12
store i8* null, i8** %13
br label %34
34: ; preds = %56, %2
%35 = load i32, i32* %4
%36 = load i8**, i8*** %5
%37 = call signext i8 @getopt(i32 %35, i8** %36, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8 %37, i8* %6
%38 = sext i8 %37 to i32
%39 = load i8, i8* @EOF
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %38, %40
br i1 %41, label %42, label %57
42: ; preds = %34
%43 = load i8, i8* %6
%44 = sext i8 %43 to i32
switch i32 %44, label %56 [
i32 102, label %45
i32 103, label %46
i32 111, label %47
i32 115, label %48
i32 99, label %49
i32 110, label %51
i32 105, label %53
]
45: ; preds = %42
store i32 1, i32* %7
br label %56
46: ; preds = %42
store i32 1, i32* %9
br label %56
47: ; preds = %42
store i32 1, i32* %10
br label %56
48: ; preds = %42
store i32 1, i32* %11
br label %56
49: ; preds = %42
%50 = load i8*, i8** @optarg
store i8* %50, i8** %12
br label %56
51: ; preds = %42
%52 = load i8*, i8** @optarg
store i8* %52, i8** %13
br label %56
53: ; preds = %42
%54 = load i8*, i8** @optarg
%55 = call i32 @atoi(i8* %54)
store i32 %55, i32* %8
br label %56
56: ; preds = %42, %53, %51, %49, %48, %47, %46, %45
br label %34
57: ; preds = %34
%58 = load i32, i32* %4
%59 = load i32, i32* @optind
%60 = sub nsw i32 %58, %59
%61 = icmp ne i32 %60, 2
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = call i32 (...) @usage()
store i32 %63, i32* %3
br label %489
64: ; preds = %57
%65 = load i8**, i8*** %5
%66 = load i32, i32* @optind
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %65, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 @openFile(i32** %14, i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%71 = load i8**, i8*** %5
%72 = load i32, i32* @optind
%73 = add nsw i32 %72, 1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8*, i8** %71, i64 %74
%76 = load i8*, i8** %75
%77 = call i32 @openFile(i32** %15, i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%78 = load i8**, i8*** %5
%79 = load i32, i32* @optind
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8*, i8** %78, i64 %80
%82 = load i8*, i8** %81
%83 = call i64 @getFileSize(i8* %82)
store i64 %83, i64* %16
%84 = load i64, i64* %16
%85 = add nsw i64 %84, 10
%86 = call i64 @malloc(i64 %85)
%87 = inttoptr i64 %86 to i8*
store i8* %87, i8** %17
%88 = load i64, i64* %16
%89 = icmp eq i64 %88, 0
br i1 %89, label %96, label %90
90: ; preds = %64
%91 = load i8*, i8** %17
%92 = load i64, i64* %16
%93 = load i32*, i32** %14
%94 = call i32 @fread(i8* %91, i64 %92, i32 1, i32* %93)
%95 = icmp ne i32 %94, 1
br i1 %95, label %96, label %103
96: ; preds = %90, %64
%97 = load i8**, i8*** %5
%98 = load i32, i32* @optind
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8*, i8** %97, i64 %99
%101 = load i8*, i8** %100
%102 = call i32 @perror(i8* %101)
store i32 -1, i32* %3
br label %489
103: ; preds = %90
store i8* null, i8** %22
store i8* null, i8** %21
store i8* null, i8** %20
store i8* null, i8** %19
store i8* null, i8** %18
store i32 0, i32* %24
store i32 0, i32* %23
store i32 0, i32* %25
store i8* null, i8** %29
store i8* null, i8** %30
store i32 0, i32* %31
%104 = load i8*, i8** %17
%105 = call i8* @strtok_r(i8* %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %21)
store i8* %105, i8** %20
store i32 0, i32* %28
store i32 -1, i32* %26
br label %106
106: ; preds = %456, %103
%107 = load i8*, i8** %20
%108 = getelementptr inbounds i8, i8* %107, i64 0
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 35
br i1 %111, label %112, label %154
112: ; preds = %106
store i32 0, i32* %26
%113 = load i32, i32* %9
%114 = icmp eq i32 %113, 1
br i1 %114, label %115, label %153
115: ; preds = %112
%116 = load i8*, i8** %20
%117 = getelementptr inbounds i8, i8* %116, i64 1
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp ne i32 %119, 35
br i1 %120, label %121, label %153
121: ; preds = %115
%122 = load i8*, i8** %20
%123 = call i8* @strstr(i8* %122, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
store i8* %123, i8** %19
%124 = load i8*, i8** %19
%125 = call i8* @strtok_r(i8* %124, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %125, i8** %19
%126 = load i8*, i8** %13
%127 = icmp ne i8* %126, null
br i1 %127, label %128, label %152
128: ; preds = %121
br label %129
129: ; preds = %138, %128
%130 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %130, i8** %19
%131 = icmp ne i8* %130, null
br i1 %131, label %132, label %141
132: ; preds = %129
%133 = load i8*, i8** %19
%134 = load i8*, i8** %13
%135 = call i64 @strcmp(i8* %133, i8* %134)
%136 = icmp eq i64 %135, 0
br i1 %136, label %137, label %138
137: ; preds = %132
br label %141
138: ; preds = %132
%139 = load i32, i32* %26
%140 = add nsw i32 %139, 1
store i32 %140, i32* %26
br label %129
141: ; preds = %137, %129
%142 = load i8*, i8** %19
%143 = icmp eq i8* %142, null
br i1 %143, label %144, label %151
144: ; preds = %141
%145 = load i32, i32* @stderr
%146 = sext i32 %145 to i64
%147 = inttoptr i64 %146 to i32*
%148 = load i8*, i8** %13
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %147, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %148)
%150 = call i32 @exit(i32 1)
unreachable
151: ; preds = %141
br label %152
152: ; preds = %151, %121
br label %153
153: ; preds = %152, %115, %112
br label %456
154: ; preds = %106
%155 = load i32, i32* %26
%156 = icmp eq i32 %155, -1
br i1 %156, label %157, label %164
157: ; preds = %154
%158 = load i32, i32* @stderr
%159 = sext i32 %158 to i64
%160 = inttoptr i64 %159 to i32*
%161 = load i8*, i8** %13
%162 = call i32 (i32*, i8*, ...) @fprintf(i32* %160, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %161)
%163 = call i32 @exit(i32 1)
unreachable
164: ; preds = %154
%165 = load i8*, i8** %20
%166 = call i8* @strtok_r(i8* %165, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %166, i8** %19
%167 = load i8*, i8** %19
store i8* %167, i8** %29
%168 = load i8*, i8** %12
%169 = icmp ne i8* %168, null
br i1 %169, label %170, label %177
170: ; preds = %164
%171 = load i8*, i8** %29
%172 = load i8*, i8** %12
%173 = call i64 @strcmp(i8* %171, i8* %172)
%174 = icmp ne i64 %173, 0
br i1 %174, label %175, label %176
175: ; preds = %170
br label %456
176: ; preds = %170
br label %177
177: ; preds = %176, %164
%178 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %178, i8** %19
%179 = load i8*, i8** %19
%180 = call i32 @atoi(i8* %179)
store i32 %180, i32* %23
%181 = load i32, i32* %7
%182 = icmp ne i32 %181, 0
br i1 %182, label %183, label %200
183: ; preds = %177
%184 = load i32, i32* %9
%185 = icmp ne i32 %184, 0
br i1 %185, label %200, label %186
186: ; preds = %183
%187 = load i8*, i8** %30
%188 = icmp ne i8* %187, null
br i1 %188, label %189, label %199
189: ; preds = %186
%190 = load i8*, i8** %30
%191 = load i8*, i8** %29
%192 = call i64 @strcmp(i8* %190, i8* %191)
%193 = icmp ne i64 %192, 0
br i1 %193, label %199, label %194
194: ; preds = %189
%195 = load i32, i32* %23
%196 = load i32, i32* %31
%197 = icmp slt i32 %195, %196
br i1 %197, label %198, label %199
198: ; preds = %194
br label %456
199: ; preds = %194, %189, %186
br label %200
200: ; preds = %199, %183, %177
%201 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
%202 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
%203 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %203, i8** %19
%204 = load i32, i32* %7
%205 = icmp ne i32 %204, 0
br i1 %205, label %206, label %218
206: ; preds = %200
%207 = load i8*, i8** %19
%208 = call i32 @strlen(i8* %207)
%209 = icmp sgt i32 %208, 1
br i1 %209, label %210, label %217
210: ; preds = %206
%211 = load i8*, i8** %19
%212 = getelementptr inbounds i8, i8* %211, i64 0
%213 = load i8, i8* %212
%214 = sext i8 %213 to i32
%215 = icmp ne i32 %214, 60
br i1 %215, label %216, label %217
216: ; preds = %210
br label %456
217: ; preds = %210, %206
br label %218
218: ; preds = %217, %200
%219 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
%220 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
%221 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %221, i8** %19
%222 = load i8*, i8** %19
%223 = call i8* @strtok_r(i8* %222, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %19)
store i8* %223, i8** %18
br label %224
224: ; preds = %235, %218
%225 = load i8*, i8** %18
%226 = call i8* @strstr(i8* %225, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%227 = load i8*, i8** %18
%228 = icmp eq i8* %226, %227
br i1 %228, label %229, label %234
229: ; preds = %224
%230 = load i8*, i8** %18
%231 = call i32 @sscanf(i8* %230, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32* %24)
%232 = load i32, i32* %24
%233 = add nsw i32 %232, 1
store i32 %233, i32* %24
br label %238
234: ; preds = %224
br label %235
235: ; preds = %234
%236 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %19)
store i8* %236, i8** %18
%237 = icmp ne i8* %236, null
br i1 %237, label %224, label %238
238: ; preds = %235, %229
%239 = load i32, i32* %24
%240 = load i32, i32* %23
%241 = sub nsw i32 %239, %240
%242 = sub nsw i32 %241, 1
store i32 %242, i32* %25
%243 = load i32, i32* %25
%244 = load i32, i32* %8
%245 = icmp slt i32 %243, %244
br i1 %245, label %246, label %247
246: ; preds = %238
br label %456
247: ; preds = %238
%248 = load i32, i32* %9
%249 = icmp ne i32 %248, 0
br i1 %249, label %250, label %445
250: ; preds = %247
store i32 0, i32* %27
%251 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
%252 = load i8*, i8** %13
%253 = icmp eq i8* %252, null
br i1 %253, label %254, label %329
254: ; preds = %250
%255 = load i32*, i32** %15
%256 = load i8*, i8** %29
%257 = load i32, i32* %23
%258 = load i32, i32* %24
%259 = call i32 (i32*, i8*, ...) @fprintf(i32* %255, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %256, i32 %257, i32 %258)
br label %260
260: ; preds = %323, %254
%261 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %261, i8** %19
%262 = icmp ne i8* %261, null
br i1 %262, label %263, label %326
263: ; preds = %260
%264 = load i32, i32* %11
%265 = icmp ne i32 %264, 0
br i1 %265, label %277, label %266
266: ; preds = %263
%267 = load i32*, i32** %15
%268 = load i8*, i8** %19
%269 = getelementptr inbounds i8, i8* %268, i64 0
%270 = load i8, i8* %269
%271 = sext i8 %270 to i32
%272 = load i8*, i8** %19
%273 = getelementptr inbounds i8, i8* %272, i64 2
%274 = load i8, i8* %273
%275 = sext i8 %274 to i32
%276 = call i32 (i32*, i8*, ...) @fprintf(i32* %267, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %271, i32 %275)
br label %296
277: ; preds = %263
%278 = load i8*, i8** %19
%279 = getelementptr inbounds i8, i8* %278, i64 0
%280 = load i8, i8* %279
%281 = sext i8 %280 to i32
%282 = sub nsw i32 %281, 48
%283 = load i8*, i8** %19
%284 = getelementptr inbounds i8, i8* %283, i64 1
%285 = load i8, i8* %284
%286 = sext i8 %285 to i32
%287 = add nsw i32 %282, %286
%288 = sub nsw i32 %287, 48
store i32 %288, i32* %32
%289 = load i32, i32* %32
%290 = icmp eq i32 %289, 2
br i1 %290, label %291, label %292
291: ; preds = %277
store i32 1, i32* %32
br label %292
292: ; preds = %291, %277
%293 = load i32*, i32** %15
%294 = load i32, i32* %32
%295 = call i32 (i32*, i8*, ...) @fprintf(i32* %293, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %294)
br label %296
296: ; preds = %292, %266
%297 = load i8*, i8** %19
%298 = getelementptr inbounds i8, i8* %297, i64 0
%299 = load i8, i8* %298
%300 = call i32 @isdigit(i8 signext %299)
%301 = icmp ne i32 %300, 0
br i1 %301, label %302, label %308
302: ; preds = %296
%303 = load i8*, i8** %19
%304 = getelementptr inbounds i8, i8* %303, i64 2
%305 = load i8, i8* %304
%306 = call i32 @isdigit(i8 signext %305)
%307 = icmp ne i32 %306, 0
br i1 %307, label %323, label %308
308: ; preds = %302, %296
%309 = load i32, i32* @stderr
%310 = sext i32 %309 to i64
%311 = inttoptr i64 %310 to i32*
%312 = load i32, i32* %28
%313 = load i32, i32* %27
%314 = load i8*, i8** %19
%315 = getelementptr inbounds i8, i8* %314, i64 0
%316 = load i8, i8* %315
%317 = sext i8 %316 to i32
%318 = load i8*, i8** %19
%319 = getelementptr inbounds i8, i8* %318, i64 2
%320 = load i8, i8* %319
%321 = sext i8 %320 to i32
%322 = call i32 (i32*, i8*, ...) @fprintf(i32* %311, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %312, i32 %313, i32 %317, i32 %321)
br label %323
323: ; preds = %308, %302
%324 = load i32, i32* %27
%325 = add nsw i32 %324, 1
store i32 %325, i32* %27
br label %260
326: ; preds = %260
%327 = load i32*, i32** %15
%328 = call i32 (i32*, i8*, ...) @fprintf(i32* %327, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %444
329: ; preds = %250
br label %330
330: ; preds = %440, %367, %329
%331 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %22)
store i8* %331, i8** %19
%332 = icmp ne i8* %331, null
br i1 %332, label %333, label %443
333: ; preds = %330
%334 = load i32, i32* %27
%335 = load i32, i32* %26
%336 = icmp eq i32 %334, %335
br i1 %336, label %337, label %440
337: ; preds = %333
%338 = load i32, i32* %10
%339 = icmp eq i32 %338, 0
br i1 %339, label %352, label %340
340: ; preds = %337
%341 = load i8*, i8** %19
%342 = getelementptr inbounds i8, i8* %341, i64 0
%343 = load i8, i8* %342
%344 = sext i8 %343 to i32
%345 = icmp ne i32 %344, 48
br i1 %345, label %352, label %346
346: ; preds = %340
%347 = load i8*, i8** %19
%348 = getelementptr inbounds i8, i8* %347, i64 2
%349 = load i8, i8* %348
%350 = sext i8 %349 to i32
%351 = icmp ne i32 %350, 48
br i1 %351, label %352, label %439
352: ; preds = %346, %340, %337
%353 = load i32, i32* %7
%354 = icmp ne i32 %353, 0
br i1 %354, label %355, label %368
355: ; preds = %352
%356 = load i8*, i8** %30
%357 = icmp ne i8* %356, null
br i1 %357, label %358, label %368
358: ; preds = %355
%359 = load i8*, i8** %30
%360 = load i8*, i8** %29
%361 = call i64 @strcmp(i8* %359, i8* %360)
%362 = icmp ne i64 %361, 0
br i1 %362, label %368, label %363
363: ; preds = %358
%364 = load i32, i32* %23
%365 = load i32, i32* %31
%366 = icmp slt i32 %364, %365
br i1 %366, label %367, label %368
367: ; preds = %363
br label %330
368: ; preds = %363, %358, %355, %352
%369 = load i8*, i8** %19
%370 = getelementptr inbounds i8, i8* %369, i64 0
%371 = load i8, i8* %370
%372 = call i32 @isdigit(i8 signext %371)
%373 = icmp ne i32 %372, 0
br i1 %373, label %374, label %380
374: ; preds = %368
%375 = load i8*, i8** %19
%376 = getelementptr inbounds i8, i8* %375, i64 2
%377 = load i8, i8* %376
%378 = call i32 @isdigit(i8 signext %377)
%379 = icmp ne i32 %378, 0
br i1 %379, label %395, label %380
380: ; preds = %374, %368
%381 = load i32*, i32** @stdout
%382 = load i32, i32* %28
%383 = load i32, i32* %27
%384 = load i8*, i8** %19
%385 = getelementptr inbounds i8, i8* %384, i64 0
%386 = load i8, i8* %385
%387 = sext i8 %386 to i32
%388 = load i8*, i8** %19
%389 = getelementptr inbounds i8, i8* %388, i64 2
%390 = load i8, i8* %389
%391 = sext i8 %390 to i32
%392 = call i32 (i32*, i8*, ...) @fprintf(i32* %381, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %382, i32 %383, i32 %387, i32 %391)
%393 = load i32, i32* %28
%394 = add nsw i32 %393, -1
store i32 %394, i32* %28
br label %434
395: ; preds = %374
%396 = load i32*, i32** %15
%397 = load i8*, i8** %29
%398 = load i32, i32* %23
%399 = load i32, i32* %24
%400 = call i32 (i32*, i8*, ...) @fprintf(i32* %396, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %397, i32 %398, i32 %399)
%401 = load i32, i32* %11
%402 = icmp ne i32 %401, 0
br i1 %402, label %414, label %403
403: ; preds = %395
%404 = load i32*, i32** %15
%405 = load i8*, i8** %19
%406 = getelementptr inbounds i8, i8* %405, i64 0
%407 = load i8, i8* %406
%408 = sext i8 %407 to i32
%409 = load i8*, i8** %19
%410 = getelementptr inbounds i8, i8* %409, i64 2
%411 = load i8, i8* %410
%412 = sext i8 %411 to i32
%413 = call i32 (i32*, i8*, ...) @fprintf(i32* %404, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %408, i32 %412)
br label %433
414: ; preds = %395
%415 = load i8*, i8** %19
%416 = getelementptr inbounds i8, i8* %415, i64 0
%417 = load i8, i8* %416
%418 = sext i8 %417 to i32
%419 = sub nsw i32 %418, 48
%420 = load i8*, i8** %19
%421 = getelementptr inbounds i8, i8* %420, i64 1
%422 = load i8, i8* %421
%423 = sext i8 %422 to i32
%424 = add nsw i32 %419, %423
%425 = sub nsw i32 %424, 48
store i32 %425, i32* %33
%426 = load i32, i32* %33
%427 = icmp eq i32 %426, 2
br i1 %427, label %428, label %429
428: ; preds = %414
store i32 1, i32* %33
br label %429
429: ; preds = %428, %414
%430 = load i32*, i32** %15
%431 = load i32, i32* %33
%432 = call i32 (i32*, i8*, ...) @fprintf(i32* %430, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 %431)
br label %433
433: ; preds = %429, %403
br label %434
434: ; preds = %433, %380
%435 = load i32, i32* %28
%436 = add nsw i32 %435, 1
store i32 %436, i32* %28
%437 = load i8*, i8** %29
store i8* %437, i8** %30
%438 = load i32, i32* %24
store i32 %438, i32* %31
br label %439
439: ; preds = %434, %346
br label %443
440: ; preds = %333
%441 = load i32, i32* %27
%442 = add nsw i32 %441, 1
store i32 %442, i32* %27
br label %330
443: ; preds = %439, %330
br label %444
444: ; preds = %443, %326
br label %455
445: ; preds = %247
%446 = load i32*, i32** %15
%447 = load i8*, i8** %29
%448 = load i32, i32* %23
%449 = load i32, i32* %24
%450 = call i32 (i32*, i8*, ...) @fprintf(i32* %446, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i8* %447, i32 %448, i32 %449)
%451 = load i32, i32* %28
%452 = add nsw i32 %451, 1
store i32 %452, i32* %28
%453 = load i8*, i8** %29
store i8* %453, i8** %30
%454 = load i32, i32* %24
store i32 %454, i32* %31
br label %455
455: ; preds = %445, %444
br label %456
456: ; preds = %455, %246, %216, %198, %175, %153
%457 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %21)
store i8* %457, i8** %20
%458 = icmp ne i8* %457, null
br i1 %458, label %106, label %459
459: ; preds = %456
%460 = load i32*, i32** %14
%461 = call i32 @fclose(i32* %460)
%462 = load i32*, i32** %15
%463 = call i32 @fclose(i32* %462)
%464 = load i8*, i8** %13
%465 = icmp ne i8* %464, null
br i1 %465, label %466, label %470
466: ; preds = %459
%467 = load i32*, i32** @stdout
%468 = load i8*, i8** %13
%469 = call i32 (i32*, i8*, ...) @fprintf(i32* %467, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* %468)
br label %478
470: ; preds = %459
%471 = load i32, i32* %9
%472 = icmp ne i32 %471, 0
br i1 %472, label %473, label %477
473: ; preds = %470
%474 = load i32*, i32** @stdout
%475 = load i32, i32* %27
%476 = call i32 (i32*, i8*, ...) @fprintf(i32* %474, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i32 %475)
br label %477
477: ; preds = %473, %470
br label %478
478: ; preds = %477, %466
%479 = load i8*, i8** %12
%480 = icmp ne i8* %479, null
br i1 %480, label %481, label %485
481: ; preds = %478
%482 = load i32*, i32** @stdout
%483 = load i8*, i8** %12
%484 = call i32 (i32*, i8*, ...) @fprintf(i32* %482, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i8* %483)
br label %485
485: ; preds = %481, %478
%486 = load i32*, i32** @stdout
%487 = load i32, i32* %28
%488 = call i32 (i32*, i8*, ...) @fprintf(i32* %486, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i32 %487)
store i32 0, i32* %3
br label %489
489: ; preds = %485, %96, %62
%490 = load i32, i32* %3
ret i32 %490
}

LLVM IR (-O2):
@.str = [9 x i8] c"fgi:c:n:\00"
@EOF = global i8 0
@optarg = global i8* null
@optind = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [7 x i8] c"FORMAT\00"
@.str.5 = [2 x i8] c"\09\00"
@stderr = global i32 0
@.str.6 = [17 x i8] c"can not find %s\0A\00"
@.str.7 = [2 x i8] c";\00"
@.str.8 = [4 x i8] c"END\00"
@.str.9 = [7 x i8] c"END=%d\00"
@.str.10 = [9 x i8] c"%s\09%d\09%d\00"
@.str.11 = [7 x i8] c"\09%c/%c\00"
@.str.12 = [4 x i8] c"\09%d\00"
@.str.13 = [39 x i8] c"[varID:%d, indiID:%d] genotype: %c/%c\0A\00"
@stdout = global i32* null
@.str.14 = [8 x i8] c"\09%c/%c\0A\00"
@.str.15 = [5 x i8] c"\09%d\0A\00"
@.str.16 = [10 x i8] c"%s\09%d\09%d\0A\00"
@.str.17 = [10 x i8] c"NAME: %s\09\00"
@.str.18 = [14 x i8] c"INDI_CNT: %d\09\00"
@.str.19 = [11 x i8] c"CHROM: %s\09\00"
@.str.20 = [13 x i8] c"VAR_CNT: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = load i8, i8* @EOF
%11 = icmp eq i8 %9, %10
br i1 %11, label %44, label %12
12: ; preds = %2, %33
%13 = phi i8 [ %41, %33 ], [ %9, %2 ]
%14 = phi i32 [ %40, %33 ], [ 0, %2 ]
%15 = phi i32 [ %39, %33 ], [ 0, %2 ]
%16 = phi i32 [ %38, %33 ], [ 0, %2 ]
%17 = phi i8* [ %37, %33 ], [ null, %2 ]
%18 = phi i8* [ %36, %33 ], [ null, %2 ]
%19 = phi i32 [ %35, %33 ], [ 0, %2 ]
%20 = phi i32 [ %34, %33 ], [ 0, %2 ]
%21 = sext i8 %13 to i32
switch i32 %21, label %33 [
i32 102, label %22
i32 103, label %23
i32 111, label %24
i32 115, label %25
i32 99, label %26
i32 110, label %28
i32 105, label %30
]
22: ; preds = %12
br label %33
23: ; preds = %12
br label %33
24: ; preds = %12
br label %33
25: ; preds = %12
br label %33
26: ; preds = %12
%27 = load i8*, i8** @optarg
br label %33
28: ; preds = %12
%29 = load i8*, i8** @optarg
br label %33
30: ; preds = %12
%31 = load i8*, i8** @optarg
%32 = tail call i32 @atoi(i8* %31)
br label %33
33: ; preds = %12, %30, %28, %26, %25, %24, %23, %22
%34 = phi i32 [ %20, %12 ], [ %20, %30 ], [ %20, %28 ], [ %20, %26 ], [ %20, %25 ], [ 1, %24 ], [ %20, %23 ], [ %20, %22 ]
%35 = phi i32 [ %19, %12 ], [ %19, %30 ], [ %19, %28 ], [ %19, %26 ], [ 1, %25 ], [ %19, %24 ], [ %19, %23 ], [ %19, %22 ]
%36 = phi i8* [ %18, %12 ], [ %18, %30 ], [ %18, %28 ], [ %27, %26 ], [ %18, %25 ], [ %18, %24 ], [ %18, %23 ], [ %18, %22 ]
%37 = phi i8* [ %17, %12 ], [ %17, %30 ], [ %29, %28 ], [ %17, %26 ], [ %17, %25 ], [ %17, %24 ], [ %17, %23 ], [ %17, %22 ]
%38 = phi i32 [ %16, %12 ], [ %16, %30 ], [ %16, %28 ], [ %16, %26 ], [ %16, %25 ], [ %16, %24 ], [ 1, %23 ], [ %16, %22 ]
%39 = phi i32 [ %15, %12 ], [ %32, %30 ], [ %15, %28 ], [ %15, %26 ], [ %15, %25 ], [ %15, %24 ], [ %15, %23 ], [ %15, %22 ]
%40 = phi i32 [ %14, %12 ], [ %14, %30 ], [ %14, %28 ], [ %14, %26 ], [ %14, %25 ], [ %14, %24 ], [ %14, %23 ], [ 1, %22 ]
%41 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%42 = load i8, i8* @EOF
%43 = icmp eq i8 %41, %42
br i1 %43, label %44, label %12
44: ; preds = %33, %2
%45 = phi i32 [ 0, %2 ], [ %34, %33 ]
%46 = phi i32 [ 0, %2 ], [ %35, %33 ]
%47 = phi i8* [ null, %2 ], [ %36, %33 ]
%48 = phi i8* [ null, %2 ], [ %37, %33 ]
%49 = phi i32 [ 0, %2 ], [ %38, %33 ]
%50 = phi i32 [ 0, %2 ], [ %39, %33 ]
%51 = phi i32 [ 0, %2 ], [ %40, %33 ]
%52 = load i32, i32* @optind
%53 = sub nsw i32 %0, %52
%54 = icmp eq i32 %53, 2
br i1 %54, label %57, label %55
55: ; preds = %44
%56 = tail call i32 (...) @usage()
br label %376
57: ; preds = %44
%58 = bitcast i32** %3 to i8*
%59 = bitcast i32** %4 to i8*
%60 = sext i32 %52 to i64
%61 = getelementptr inbounds i8*, i8** %1, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @openFile(i32** %3, i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%64 = load i32, i32* @optind
%65 = add nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %1, i64 %66
%68 = load i8*, i8** %67
%69 = call i32 @openFile(i32** %4, i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%70 = load i32, i32* @optind
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8*, i8** %1, i64 %71
%73 = load i8*, i8** %72
%74 = call i64 @getFileSize(i8* %73)
%75 = add nsw i64 %74, 10
%76 = call i64 @malloc(i64 %75)
%77 = inttoptr i64 %76 to i8*
%78 = icmp eq i64 %74, 0
br i1 %78, label %83, label %79
79: ; preds = %57
%80 = load i32*, i32** %3
%81 = call i32 @fread(i8* %77, i64 %74, i32 1, i32* %80)
%82 = icmp eq i32 %81, 1
br i1 %82, label %89, label %83
83: ; preds = %79, %57
%84 = load i32, i32* @optind
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8*, i8** %1, i64 %85
%87 = load i8*, i8** %86
%88 = call i32 @perror(i8* %87)
br label %374
89: ; preds = %79
%90 = bitcast i8** %5 to i8*
%91 = bitcast i8** %6 to i8*
%92 = bitcast i8** %7 to i8*
store i8* null, i8** %7
store i8* null, i8** %6
store i8* null, i8** %5
%93 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%94 = call i8* @strtok_r(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %6)
%95 = icmp eq i8* %47, null
%96 = icmp eq i32 %51, 0
%97 = icmp ne i32 %49, 0
%98 = select i1 %96, i1 true, i1 %97
%99 = xor i1 %98, true
%100 = icmp ne i32 %51, 0
%101 = icmp eq i8* %48, null
%102 = icmp eq i32 %45, 0
%103 = icmp eq i32 %46, 0
%104 = icmp eq i32 %49, 1
br label %105
105: ; preds = %346, %89
%106 = phi i8* [ %94, %89 ], [ %352, %346 ]
%107 = phi i32 [ -1, %89 ], [ %347, %346 ]
%108 = phi i32 [ undef, %89 ], [ %348, %346 ]
%109 = phi i32 [ 0, %89 ], [ %349, %346 ]
%110 = phi i8* [ null, %89 ], [ %350, %346 ]
%111 = phi i32 [ 0, %89 ], [ %351, %346 ]
%112 = load i8, i8* %106
%113 = icmp eq i8 %112, 35
br i1 %113, label %114, label %143
114: ; preds = %105
br i1 %104, label %115, label %346
115: ; preds = %114
%116 = getelementptr inbounds i8, i8* %106, i64 1
%117 = load i8, i8* %116
%118 = icmp eq i8 %117, 35
br i1 %118, label %346, label %119
119: ; preds = %115
%120 = call i8* @strstr(i8* %106, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
store i8* %120, i8** %5
%121 = call i8* @strtok_r(i8* %120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %121, i8** %5
br i1 %101, label %346, label %122
122: ; preds = %119
%123 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %123, i8** %5
%124 = icmp eq i8* %123, null
br i1 %124, label %137, label %125
125: ; preds = %122, %130
%126 = phi i8* [ %132, %130 ], [ %123, %122 ]
%127 = phi i32 [ %131, %130 ], [ 0, %122 ]
%128 = call i64 @strcmp(i8* %126, i8* %48)
%129 = icmp eq i64 %128, 0
br i1 %129, label %134, label %130
130: ; preds = %125
%131 = add nuw nsw i32 %127, 1
%132 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %132, i8** %5
%133 = icmp eq i8* %132, null
br i1 %133, label %137, label %125
134: ; preds = %125
%135 = load i8*, i8** %5
%136 = icmp eq i8* %135, null
br i1 %136, label %137, label %346
137: ; preds = %134, %122, %130
%138 = load i32, i32* @stderr
%139 = sext i32 %138 to i64
%140 = inttoptr i64 %139 to i32*
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %48)
%142 = call i32 @exit(i32 1)
unreachable
143: ; preds = %105
%144 = icmp eq i32 %107, -1
br i1 %144, label %145, label %151
145: ; preds = %143
%146 = load i32, i32* @stderr
%147 = sext i32 %146 to i64
%148 = inttoptr i64 %147 to i32*
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %148, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %48)
%150 = call i32 @exit(i32 1)
unreachable
151: ; preds = %143
%152 = call i8* @strtok_r(i8* %106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %152, i8** %5
br i1 %95, label %156, label %153
153: ; preds = %151
%154 = call i64 @strcmp(i8* %152, i8* %47)
%155 = icmp eq i64 %154, 0
br i1 %155, label %156, label %346
156: ; preds = %153, %151
%157 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %157, i8** %5
%158 = call i32 @atoi(i8* %157)
%159 = icmp ne i8* %110, null
%160 = select i1 %99, i1 %159, i1 false
br i1 %160, label %161, label %166
161: ; preds = %156
%162 = call i64 @strcmp(i8* %110, i8* %152)
%163 = icmp eq i64 %162, 0
%164 = icmp slt i32 %158, %111
%165 = select i1 %163, i1 %164, i1 false
br i1 %165, label %346, label %166
166: ; preds = %161, %156
%167 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
%168 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
%169 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %169, i8** %5
br i1 %100, label %170, label %177
170: ; preds = %166
%171 = call i32 @strlen(i8* %169)
%172 = icmp sgt i32 %171, 1
br i1 %172, label %173, label %177
173: ; preds = %170
%174 = load i8*, i8** %5
%175 = load i8, i8* %174
%176 = icmp eq i8 %175, 60
br i1 %176, label %177, label %346
177: ; preds = %170, %173, %166
%178 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
%179 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
%180 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %180, i8** %5
%181 = call i8* @strtok_r(i8* %180, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %5)
br label %182
182: ; preds = %191, %177
%183 = phi i8* [ %181, %177 ], [ %192, %191 ]
%184 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%185 = call i32 @strncmp(i8* %183, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i64 %184)
%186 = icmp eq i32 %185, 0
br i1 %186, label %187, label %191
187: ; preds = %182
%188 = call i32 @sscanf(i8* %183, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32* %8)
%189 = load i32, i32* %8
%190 = add nsw i32 %189, 1
store i32 %190, i32* %8
br label %196
191: ; preds = %182
%192 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %5)
%193 = icmp eq i8* %192, null
br i1 %193, label %194, label %182
194: ; preds = %191
%195 = load i32, i32* %8
br label %196
196: ; preds = %194, %187
%197 = phi i32 [ %195, %194 ], [ %190, %187 ]
%198 = xor i32 %158, -1
%199 = add i32 %197, %198
%200 = icmp slt i32 %199, %50
br i1 %200, label %346, label %201
201: ; preds = %196
br i1 %97, label %202, label %341
202: ; preds = %201
%203 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
br i1 %101, label %207, label %204
204: ; preds = %202
%205 = select i1 %100, i1 %159, i1 false
%206 = icmp slt i32 %158, %111
br label %338
207: ; preds = %202
%208 = load i32*, i32** %4
%209 = load i32, i32* %8
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %208, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %152, i32 %158, i32 %209)
%211 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %211, i8** %5
%212 = icmp eq i8* %211, null
br i1 %212, label %262, label %213
213: ; preds = %207, %258
%214 = phi i8* [ %260, %258 ], [ %211, %207 ]
%215 = phi i32 [ %259, %258 ], [ 0, %207 ]
br i1 %103, label %216, label %224
216: ; preds = %213
%217 = load i32*, i32** %4
%218 = load i8, i8* %214
%219 = sext i8 %218 to i32
%220 = getelementptr inbounds i8, i8* %214, i64 2
%221 = load i8, i8* %220
%222 = sext i8 %221 to i32
%223 = call i32 (i32*, i8*, ...) @fprintf(i32* %217, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 %219, i32 %222)
br label %236
224: ; preds = %213
%225 = load i8, i8* %214
%226 = sext i8 %225 to i32
%227 = getelementptr inbounds i8, i8* %214, i64 1
%228 = load i8, i8* %227
%229 = sext i8 %228 to i32
%230 = add nsw i32 %226, -96
%231 = add nsw i32 %230, %229
%232 = icmp eq i32 %231, 2
%233 = select i1 %232, i32 1, i32 %231
%234 = load i32*, i32** %4
%235 = call i32 (i32*, i8*, ...) @fprintf(i32* %234, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %233)
br label %236
236: ; preds = %224, %216
%237 = load i8*, i8** %5
%238 = load i8, i8* %237
%239 = call i32 @isdigit(i8 signext %238)
%240 = icmp eq i32 %239, 0
br i1 %240, label %247, label %241
241: ; preds = %236
%242 = load i8*, i8** %5
%243 = getelementptr inbounds i8, i8* %242, i64 2
%244 = load i8, i8* %243
%245 = call i32 @isdigit(i8 signext %244)
%246 = icmp eq i32 %245, 0
br i1 %246, label %247, label %258
247: ; preds = %241, %236
%248 = load i32, i32* @stderr
%249 = sext i32 %248 to i64
%250 = inttoptr i64 %249 to i32*
%251 = load i8*, i8** %5
%252 = load i8, i8* %251
%253 = sext i8 %252 to i32
%254 = getelementptr inbounds i8, i8* %251, i64 2
%255 = load i8, i8* %254
%256 = sext i8 %255 to i32
%257 = call i32 (i32*, i8*, ...) @fprintf(i32* %250, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %109, i32 %215, i32 %253, i32 %256)
br label %258
258: ; preds = %247, %241
%259 = add nuw nsw i32 %215, 1
%260 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %260, i8** %5
%261 = icmp eq i8* %260, null
br i1 %261, label %262, label %213
262: ; preds = %258, %207
%263 = phi i32 [ 0, %207 ], [ %259, %258 ]
%264 = load i32*, i32** %4
%265 = call i32 @fputc(i32 10, i32* %264)
br label %346
266: ; preds = %338, %279
%267 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %7)
store i8* %267, i8** %5
%268 = icmp eq i8* %267, null
br i1 %268, label %346, label %269
269: ; preds = %266
br i1 %340, label %270, label %336
270: ; preds = %269
br i1 %102, label %278, label %271
271: ; preds = %270
%272 = load i8, i8* %267
%273 = icmp eq i8 %272, 48
br i1 %273, label %274, label %278
274: ; preds = %271
%275 = getelementptr inbounds i8, i8* %267, i64 2
%276 = load i8, i8* %275
%277 = icmp eq i8 %276, 48
br i1 %277, label %346, label %278
278: ; preds = %274, %271, %270
br i1 %205, label %279, label %285
279: ; preds = %278
%280 = call i64 @strcmp(i8* %110, i8* %152)
%281 = icmp eq i64 %280, 0
%282 = select i1 %281, i1 %206, i1 false
br i1 %282, label %266, label %283
283: ; preds = %279
%284 = load i8*, i8** %5
br label %285
285: ; preds = %278, %283
%286 = phi i8* [ %284, %283 ], [ %267, %278 ]
%287 = load i8, i8* %286
%288 = call i32 @isdigit(i8 signext %287)
%289 = icmp eq i32 %288, 0
br i1 %289, label %296, label %290
290: ; preds = %285
%291 = load i8*, i8** %5
%292 = getelementptr inbounds i8, i8* %291, i64 2
%293 = load i8, i8* %292
%294 = call i32 @isdigit(i8 signext %293)
%295 = icmp eq i32 %294, 0
br i1 %295, label %296, label %306
296: ; preds = %290, %285
%297 = load i32*, i32** @stdout
%298 = load i8*, i8** %5
%299 = load i8, i8* %298
%300 = sext i8 %299 to i32
%301 = getelementptr inbounds i8, i8* %298, i64 2
%302 = load i8, i8* %301
%303 = sext i8 %302 to i32
%304 = call i32 (i32*, i8*, ...) @fprintf(i32* %297, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %109, i32 %107, i32 %300, i32 %303)
%305 = add nsw i32 %109, -1
br label %332
306: ; preds = %290
%307 = load i32*, i32** %4
%308 = load i32, i32* %8
%309 = call i32 (i32*, i8*, ...) @fprintf(i32* %307, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %152, i32 %158, i32 %308)
br i1 %103, label %310, label %319
310: ; preds = %306
%311 = load i32*, i32** %4
%312 = load i8*, i8** %5
%313 = load i8, i8* %312
%314 = sext i8 %313 to i32
%315 = getelementptr inbounds i8, i8* %312, i64 2
%316 = load i8, i8* %315
%317 = sext i8 %316 to i32
%318 = call i32 (i32*, i8*, ...) @fprintf(i32* %311, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %314, i32 %317)
br label %332
319: ; preds = %306
%320 = load i8*, i8** %5
%321 = load i8, i8* %320
%322 = sext i8 %321 to i32
%323 = getelementptr inbounds i8, i8* %320, i64 1
%324 = load i8, i8* %323
%325 = sext i8 %324 to i32
%326 = add nsw i32 %322, -96
%327 = add nsw i32 %326, %325
%328 = icmp eq i32 %327, 2
%329 = select i1 %328, i32 1, i32 %327
%330 = load i32*, i32** %4
%331 = call i32 (i32*, i8*, ...) @fprintf(i32* %330, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 %329)
br label %332
332: ; preds = %310, %319, %296
%333 = phi i32 [ %109, %319 ], [ %109, %310 ], [ %305, %296 ]
%334 = add nsw i32 %333, 1
%335 = load i32, i32* %8
br label %346
336: ; preds = %269
%337 = add nuw nsw i32 %339, 1
br label %338
338: ; preds = %204, %336
%339 = phi i32 [ 0, %204 ], [ %337, %336 ]
%340 = icmp eq i32 %339, %107
br label %266
341: ; preds = %201
%342 = load i32*, i32** %4
%343 = call i32 (i32*, i8*, ...) @fprintf(i32* %342, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i8* %152, i32 %158, i32 %197)
%344 = add nsw i32 %109, 1
%345 = load i32, i32* %8
br label %346
346: ; preds = %266, %274, %161, %341, %332, %262, %196, %173, %153, %114, %115, %134, %119
%347 = phi i32 [ %127, %134 ], [ 0, %119 ], [ 0, %115 ], [ 0, %114 ], [ %107, %153 ], [ %107, %173 ], [ %107, %196 ], [ %107, %262 ], [ %107, %332 ], [ %107, %341 ], [ %107, %161 ], [ %107, %274 ], [ %107, %266 ]
%348 = phi i32 [ %108, %134 ], [ %108, %119 ], [ %108, %115 ], [ %108, %114 ], [ %108, %153 ], [ %108, %173 ], [ %108, %196 ], [ %263, %262 ], [ %107, %332 ], [ %108, %341 ], [ %108, %161 ], [ %339, %266 ], [ %107, %274 ]
%349 = phi i32 [ %109, %134 ], [ %109, %119 ], [ %109, %115 ], [ %109, %114 ], [ %109, %153 ], [ %109, %173 ], [ %109, %196 ], [ %109, %262 ], [ %334, %332 ], [ %344, %341 ], [ %109, %161 ], [ %109, %274 ], [ %109, %266 ]
%350 = phi i8* [ %110, %134 ], [ %110, %119 ], [ %110, %115 ], [ %110, %114 ], [ %110, %153 ], [ %110, %173 ], [ %110, %196 ], [ %110, %262 ], [ %152, %332 ], [ %152, %341 ], [ %110, %161 ], [ %110, %274 ], [ %110, %266 ]
%351 = phi i32 [ %111, %134 ], [ %111, %119 ], [ %111, %115 ], [ %111, %114 ], [ %111, %153 ], [ %111, %173 ], [ %111, %196 ], [ %111, %262 ], [ %335, %332 ], [ %345, %341 ], [ %111, %161 ], [ %111, %274 ], [ %111, %266 ]
%352 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %6)
%353 = icmp eq i8* %352, null
br i1 %353, label %354, label %105
354: ; preds = %346
%355 = load i32*, i32** %3
%356 = call i32 @fclose(i32* %355)
%357 = load i32*, i32** %4
%358 = call i32 @fclose(i32* %357)
br i1 %101, label %362, label %359
359: ; preds = %354
%360 = load i32*, i32** @stdout
%361 = call i32 (i32*, i8*, ...) @fprintf(i32* %360, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* %48)
br label %367
362: ; preds = %354
%363 = icmp eq i32 %49, 0
br i1 %363, label %367, label %364
364: ; preds = %362
%365 = load i32*, i32** @stdout
%366 = call i32 (i32*, i8*, ...) @fprintf(i32* %365, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), i32 %348)
br label %367
367: ; preds = %362, %364, %359
br i1 %95, label %371, label %368
368: ; preds = %367
%369 = load i32*, i32** @stdout
%370 = call i32 (i32*, i8*, ...) @fprintf(i32* %369, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i8* %47)
br label %371
371: ; preds = %368, %367
%372 = load i32*, i32** @stdout
%373 = call i32 (i32*, i8*, ...) @fprintf(i32* %372, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i32 %349)
br label %374
374: ; preds = %371, %83
%375 = phi i32 [ -1, %83 ], [ 0, %371 ]
br label %376
376: ; preds = %374, %55
%377 = phi i32 [ %56, %55 ], [ %375, %374 ]
ret i32 %377
}