#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 classify_graph_function(int *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ getchar();
scalar_t__ malloc(int);
int *otoog(int *, int);
int /*<<< orphan*/ printf(char *);
void main(int argc, char *argv[]) {
  struct peak {
    char chr[50];
    int start;
    int end;
    int *ord;
  } peak;
  FILE *p1;
  FILE *p2;
  FILE *class1;
  FILE *class2;
  FILE *class3;
  FILE *class4;
  FILE *class5;
  int filenum;
  char c[50];
  int *orda;
  int num = 1;
  int i;
  int ord_classify;
  if ((p1 = fopen(argv[1], "r")) == NULL) {
    printf("\nerror occurred when opening the input file to combine peaks!");
    getchar();
    exit(1);
  }
  if ((p2 = fopen(argv[2], "wb")) == NULL) {
    printf("\ncreate output file error\n");
    getchar();
    exit(1);
  }
  if ((class1 = fopen("class1.bed", "wb")) == NULL) {
    printf("\ncreate output file error\n");
    getchar();
    exit(1);
  }
  if ((class2 = fopen("class2.bed", "wb")) == NULL) {
    printf("\ncreate output file error\n");
    getchar();
    exit(1);
  }
  if ((class3 = fopen("class3.bed", "wb")) == NULL) {
    printf("\ncreate output file error\n");
    getchar();
    exit(1);
  }
  if ((class4 = fopen("class4.bed", "wb")) == NULL) {
    printf("\ncreate output file error\n");
    getchar();
    exit(1);
  }
  if ((class5 = fopen("class5.bed", "wb")) == NULL) {
    printf("\ncreate output file error\n");
    getchar();
    exit(1);
  }
  filenum = atoi(argv[3]);
  while (!feof(p1)) {
    fscanf(p1, "%s\t%d\t%d\t%s\t", &peak.chr, &peak.start, &peak.end, &c);
    if ((peak.ord = (int *)malloc(sizeof(int) * filenum * filenum)) == NULL) {
      printf("Memory is not sufficent.Creating order graph file fails.");
      exit(0);
      getchar();
    }
    for (i = 0; i <= (filenum * filenum - 1); i++)
      peak.ord[i] = fgetc(p1) - 48;
    fscanf(p1, "\n");
    if ((orda = (int *)malloc(sizeof(int) * filenum)) == NULL) {
      printf("Memory is not sufficent.Creating order array file fails.");
      exit(0);
      getchar();
    }
    orda = otoog(peak.ord, filenum);
    if (orda != NULL)
      ord_classify = classify_graph_function(orda, filenum);
    else
      ord_classify = 0;
    switch (ord_classify) {
    case 1: {
      fprintf(class1, "%s\t%d\t%d\tMACS_peak_ordergraph_%d\t", peak.chr,
              peak.start, peak.end, num);
      if (orda == NULL)
        fprintf(class1, "NA\t0");
      else {
        for (i = 0; i <= (filenum - 1); i++) {
          fprintf(class1, "%d", orda[i]);
          if (i != (filenum - 1))
            fprintf(class1, ",");
        }
        fprintf(class1, "\t%d", ord_classify);
      }
      fprintf(class1, "\n");
    } break;
    case 2: {
      fprintf(class2, "%s\t%d\t%d\tMACS_peak_ordergraph_%d\t", peak.chr,
              peak.start, peak.end, num);
      if (orda == NULL)
        fprintf(class2, "NA\t0");
      else {
        for (i = 0; i <= (filenum - 1); i++) {
          fprintf(class2, "%d", orda[i]);
          if (i != (filenum - 1))
            fprintf(class2, ",");
        }
        fprintf(class2, "\t%d", ord_classify);
      }
      fprintf(class2, "\n");
    } break;
    case 3: {
      fprintf(class3, "%s\t%d\t%d\tMACS_peak_ordergraph_%d\t", peak.chr,
              peak.start, peak.end, num);
      if (orda == NULL)
        fprintf(class3, "NA\t0");
      else {
        for (i = 0; i <= (filenum - 1); i++) {
          fprintf(class3, "%d", orda[i]);
          if (i != (filenum - 1))
            fprintf(class3, ",");
        }
        fprintf(class3, "\t%d", ord_classify);
      }
      fprintf(class3, "\n");
    } break;
    case 4: {
      fprintf(class4, "%s\t%d\t%d\tMACS_peak_ordergraph_%d\t", peak.chr,
              peak.start, peak.end, num);
      if (orda == NULL)
        fprintf(class4, "NA\t0");
      else {
        for (i = 0; i <= (filenum - 1); i++) {
          fprintf(class4, "%d", orda[i]);
          if (i != (filenum - 1))
            fprintf(class4, ",");
        }
        fprintf(class4, "\t%d", ord_classify);
      }
      fprintf(class4, "\n");
    } break;
    case 5: {
      fprintf(class5, "%s\t%d\t%d\tMACS_peak_ordergraph_%d\t", peak.chr,
              peak.start, peak.end, num);
      if (orda == NULL)
        fprintf(class5, "NA\t0");
      else {
        for (i = 0; i <= (filenum - 1); i++) {
          fprintf(class5, "%d", orda[i]);
          if (i != (filenum - 1))
            fprintf(class5, ",");
        }
        fprintf(class5, "\t%d", ord_classify);
      }
      fprintf(class5, "\n");
    } break;
    default:
      break;
    }
    fprintf(p2, "%s\t%d\t%d\tMACS_peak_ordergraph_%d\t", peak.chr, peak.start,
            peak.end, num);
    if (orda == NULL)
      fprintf(p2, "NA\t0");
    else {
      for (i = 0; i <= (filenum - 1); i++) {
        fprintf(p2, "%d", orda[i]);
        if (i != (filenum - 1))
          fprintf(p2, ",");
      }
      fprintf(p2, "\t%d", ord_classify);
    }
    fprintf(p2, "\n");
    free(orda);
    free(peak.ord);
    num++;
  }
  fclose(p1);
  fclose(p2);
  fclose(class1);
  fclose(class2);
  fclose(class3);
  fclose(class4);
  fclose(class5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0xdc(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe09(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    123b <main+0x5b>
lea    0xdf1(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe0a(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x68(%rbp)
cmp    $0x0,%rax
jne    127a <main+0x9a>
lea    0xdf3(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xdf1(%rip),%rdi
lea    0xdcc(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x70(%rbp)
cmp    $0x0,%rax
jne    12b8 <main+0xd8>
lea    0xdb5(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xdbe(%rip),%rdi
lea    0xd8e(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x78(%rbp)
cmp    $0x0,%rax
jne    12f6 <main+0x116>
lea    0xd77(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xd8b(%rip),%rdi
lea    0xd50(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x80(%rbp)
cmp    $0x0,%rax
jne    1334 <main+0x154>
lea    0xd39(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xd58(%rip),%rdi
lea    0xd12(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
jne    1375 <main+0x195>
lea    0xcf8(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xd22(%rip),%rdi
lea    0xcd1(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x90(%rbp)
cmp    $0x0,%rax
jne    13b6 <main+0x1d6>
lea    0xcb7(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x94(%rbp)
mov    -0x60(%rbp),%rdi
call   10b0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13e7 <main+0x207>
jmp    1bb0 <main+0x9d0>
mov    -0x60(%rbp),%rdi
lea    -0x58(%rbp),%rdx
lea    -0x58(%rbp),%rcx
add    $0x34,%rcx
lea    -0x58(%rbp),%r8
add    $0x38,%r8
lea    0xca3(%rip),%rsi
lea    -0xd0(%rbp),%r9
mov    $0x0,%al
call   1070 <fscanf@plt>
movslq -0x94(%rbp),%rax
shl    $0x2,%rax
movslq -0x94(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1452 <main+0x272>
lea    0xc70(%rip),%rdi
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
imul   -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     14aa <main+0x2ca>
mov    -0x60(%rbp),%rdi
call   1080 <fgetc@plt>
mov    %eax,%edx
sub    $0x30,%edx
mov    -0x18(%rbp),%rax
movslq -0xe0(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    145c <main+0x27c>
mov    -0x60(%rbp),%rdi
lea    0xbbb(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
movslq -0x94(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10d0 <malloc@plt>
mov    %rax,-0xd8(%rbp)
cmp    $0x0,%rax
jne    14f2 <main+0x312>
lea    0xc09(%rip),%rdi
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x94(%rbp),%esi
call   1050 <otoog@plt>
mov    %rax,-0xd8(%rbp)
cmpq   $0x0,-0xd8(%rbp)
je     1533 <main+0x353>
mov    -0xd8(%rbp),%rdi
mov    -0x94(%rbp),%esi
call   10c0 <classify_graph_function@plt>
mov    %eax,-0xe4(%rbp)
jmp    153d <main+0x35d>
movl   $0x0,-0xe4(%rbp)
mov    -0xe4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xf0(%rbp)
sub    $0x4,%eax
ja     1a89 <main+0x8a9>
mov    -0xf0(%rbp),%rax
lea    0xa9a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x70(%rbp),%rdi
lea    -0x58(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0xdc(%rbp),%r9d
lea    0xb9c(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpq   $0x0,-0xd8(%rbp)
jne    15b8 <main+0x3d8>
mov    -0x70(%rbp),%rdi
lea    0xb9e(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1656 <main+0x476>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     163e <main+0x45e>
mov    -0x70(%rbp),%rdi
mov    -0xd8(%rbp),%rax
movslq -0xe0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xb5d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1625 <main+0x445>
mov    -0x70(%rbp),%rdi
lea    0xb31(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    162a <main+0x44a>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    15c2 <main+0x3e2>
mov    -0x70(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0xb02(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x70(%rbp),%rdi
lea    0xa0f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1a8e <main+0x8ae>
mov    -0x78(%rbp),%rdi
lea    -0x58(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0xdc(%rbp),%r9d
lea    0xa9e(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpq   $0x0,-0xd8(%rbp)
jne    16b6 <main+0x4d6>
mov    -0x78(%rbp),%rdi
lea    0xaa0(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1754 <main+0x574>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     173c <main+0x55c>
mov    -0x78(%rbp),%rdi
mov    -0xd8(%rbp),%rax
movslq -0xe0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xa5f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1723 <main+0x543>
mov    -0x78(%rbp),%rdi
lea    0xa33(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1728 <main+0x548>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    16c0 <main+0x4e0>
mov    -0x78(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0xa04(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x78(%rbp),%rdi
lea    0x911(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1a8e <main+0x8ae>
mov    -0x80(%rbp),%rdi
lea    -0x58(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0xdc(%rbp),%r9d
lea    0x9a0(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpq   $0x0,-0xd8(%rbp)
jne    17b4 <main+0x5d4>
mov    -0x80(%rbp),%rdi
lea    0x9a2(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1852 <main+0x672>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     183a <main+0x65a>
mov    -0x80(%rbp),%rdi
mov    -0xd8(%rbp),%rax
movslq -0xe0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0x961(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1821 <main+0x641>
mov    -0x80(%rbp),%rdi
lea    0x935(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1826 <main+0x646>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    17be <main+0x5de>
mov    -0x80(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0x906(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x80(%rbp),%rdi
lea    0x813(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1a8e <main+0x8ae>
mov    -0x88(%rbp),%rdi
lea    -0x58(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0xdc(%rbp),%r9d
lea    0x89f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpq   $0x0,-0xd8(%rbp)
jne    18b8 <main+0x6d8>
mov    -0x88(%rbp),%rdi
lea    0x89e(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    195f <main+0x77f>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1944 <main+0x764>
mov    -0x88(%rbp),%rdi
mov    -0xd8(%rbp),%rax
movslq -0xe0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0x85a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     192b <main+0x74b>
mov    -0x88(%rbp),%rdi
lea    0x82b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1930 <main+0x750>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    18c2 <main+0x6e2>
mov    -0x88(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0x7f9(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x88(%rbp),%rdi
lea    0x703(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1a8e <main+0x8ae>
mov    -0x90(%rbp),%rdi
lea    -0x58(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0xdc(%rbp),%r9d
lea    0x78f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpq   $0x0,-0xd8(%rbp)
jne    19c8 <main+0x7e8>
mov    -0x90(%rbp),%rdi
lea    0x78e(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1a6f <main+0x88f>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1a54 <main+0x874>
mov    -0x90(%rbp),%rdi
mov    -0xd8(%rbp),%rax
movslq -0xe0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0x74a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1a3b <main+0x85b>
mov    -0x90(%rbp),%rdi
lea    0x71b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1a40 <main+0x860>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    19d2 <main+0x7f2>
mov    -0x90(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0x6e9(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x90(%rbp),%rdi
lea    0x5f3(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1a8e <main+0x8ae>
jmp    1a8e <main+0x8ae>
mov    -0x68(%rbp),%rdi
lea    -0x58(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0xdc(%rbp),%r9d
lea    0x67d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpq   $0x0,-0xd8(%rbp)
jne    1ad7 <main+0x8f7>
mov    -0x68(%rbp),%rdi
lea    0x67f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1b75 <main+0x995>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1b5d <main+0x97d>
mov    -0x68(%rbp),%rdi
mov    -0xd8(%rbp),%rax
movslq -0xe0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0x63e(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0xe0(%rbp),%eax
mov    -0x94(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1b44 <main+0x964>
mov    -0x68(%rbp),%rdi
lea    0x612(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1b49 <main+0x969>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    1ae1 <main+0x901>
mov    -0x68(%rbp),%rdi
mov    -0xe4(%rbp),%edx
lea    0x5e3(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x68(%rbp),%rdi
lea    0x4f0(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0xd8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    13c9 <main+0x1e9>
mov    -0x60(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x68(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x70(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x78(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x80(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x88(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x90(%rbp),%rdi
call   1040 <fclose@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xf21(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     18cf <main+0x6bf>
mov    %rax,%rbp
mov    0x10(%rbx),%rdi
lea    0xe07(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,0x30(%rsp)
test   %rax,%rax
je     18b2 <main+0x6a2>
lea    0xdf0(%rip),%rdi
lea    0xde6(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     18b2 <main+0x6a2>
mov    %rax,%r14
lea    0xddc(%rip),%rdi
lea    0xdc7(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
je     18b2 <main+0x6a2>
lea    0xdc6(%rip),%rdi
lea    0xda6(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     18b2 <main+0x6a2>
lea    0xdb0(%rip),%rdi
lea    0xd85(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     18b2 <main+0x6a2>
lea    0xd9a(%rip),%rdi
lea    0xd64(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     18b2 <main+0x6a2>
mov    0x18(%rbx),%rdi
call   1110 <atoi@plt>
mov    %eax,%r15d
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %eax,%eax
mov    0x30(%rsp),%rbx
je     1370 <main+0x160>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    0x28(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x0(,%r15,4),%eax
mov    %eax,0x38(%rsp)
imul   %r15d,%eax
mov    %eax,0x3c(%rsp)
mov    %r15d,%eax
imul   %eax,%eax
mov    %rax,0x98(%rsp)
lea    -0x1(%r15),%r12d
mov    %r15d,%r13d
movl   $0x1,0x4(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x88(%rsp)
mov    %rbp,0x90(%rsp)
jmp    1428 <main+0x218>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xd6a(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    0x90(%rsp),%rbp
mov    0x4(%rsp),%r14d
mov    $0xa,%edi
mov    %rbx,%rsi
call   10a0 <fputc@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x80(%rsp),%rdi
call   1030 <free@plt>
add    $0x1,%r14d
mov    %r14d,0x4(%rsp)
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %eax,%eax
mov    0x8(%rsp),%r15
mov    0x88(%rsp),%r14
jne    131e <main+0x10e>
mov    %rbp,%rdi
lea    0xc5a(%rip),%rsi
lea    0x40(%rsp),%rdx
lea    0x74(%rsp),%rcx
lea    0x78(%rsp),%r8
lea    0xa0(%rsp),%r9
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x3c(%rsp),%edi
call   10f0 <malloc@plt>
mov    %rax,0x80(%rsp)
test   %rax,%rax
je     1896 <main+0x686>
mov    0x98(%rsp),%r14
test   %r14,%r14
je     149f <main+0x28f>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1090 <fgetc@plt>
add    $0xffffffd0,%eax
mov    0x80(%rsp),%rcx
mov    %eax,(%rcx,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1480 <main+0x270>
mov    %rbp,%rdi
lea    0xc29(%rip),%rsi
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x38(%rsp),%edi
call   10f0 <malloc@plt>
test   %rax,%rax
je     189f <main+0x68f>
mov    0x80(%rsp),%rdi
mov    %r15d,%esi
call   1060 <otoog@plt>
mov    %r15,%rsi
mov    %rax,%r15
test   %rax,%rax
mov    0x30(%rsp),%rbx
mov    0x88(%rsp),%r14
je     1590 <main+0x380>
mov    %r15,%rdi
call   10e0 <classify_graph_function@plt>
mov    %rax,%rbp
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1824 <main+0x614>
lea    0xaf4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
mov    0x4(%rsp),%r9d
jmp    *%rax
mov    0x74(%rsp),%ecx
mov    0x78(%rsp),%r8d
mov    %r14,%rdi
lea    0xbe0(%rip),%rsi
lea    0x40(%rsp),%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmpl   $0x0,0x8(%rsp)
jle    179a <main+0x58a>
xor    %ebx,%ebx
jmp    155d <main+0x34d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r13
je     179a <main+0x58a>
mov    (%r15,%rbx,4),%edx
mov    %r14,%rdi
lea    0xbca(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmp    %rbx,%r12
je     1550 <main+0x340>
mov    $0x2c,%edi
mov    %r14,%rsi
call   10a0 <fputc@plt>
jmp    1550 <main+0x340>
cs nopw 0x0(%rax,%rax,1)
mov    0x74(%rsp),%ecx
mov    0x78(%rsp),%r8d
mov    %rbx,%rdi
lea    0xb6a(%rip),%rsi
lea    0x40(%rsp),%rdx
mov    0x4(%rsp),%r14d
mov    %r14d,%r9d
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xb67(%rip),%rdi
mov    %rbx,%rcx
call   1130 <fwrite@plt>
jmp    13e0 <main+0x1d0>
mov    0x74(%rsp),%ecx
mov    0x78(%rsp),%r8d
mov    0x28(%rsp),%rdi
lea    0xb23(%rip),%rsi
lea    0x40(%rsp),%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmpl   $0x0,0x8(%rsp)
jle    17b5 <main+0x5a5>
xor    %ebx,%ebx
jmp    161d <main+0x40d>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    %rbx,%r13
je     17b5 <main+0x5a5>
mov    (%r15,%rbx,4),%edx
mov    0x28(%rsp),%rdi
lea    0xb08(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmp    %rbx,%r12
je     1610 <main+0x400>
mov    $0x2c,%edi
mov    0x28(%rsp),%rsi
call   10a0 <fputc@plt>
jmp    1610 <main+0x400>
mov    0x74(%rsp),%ecx
mov    0x78(%rsp),%r8d
mov    0x20(%rsp),%rdi
lea    0xaae(%rip),%rsi
lea    0x40(%rsp),%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmpl   $0x0,0x8(%rsp)
jle    17cb <main+0x5bb>
xor    %ebx,%ebx
jmp    168d <main+0x47d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r13
je     17cb <main+0x5bb>
mov    (%r15,%rbx,4),%edx
mov    0x20(%rsp),%rdi
lea    0xa98(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmp    %rbx,%r12
je     1680 <main+0x470>
mov    $0x2c,%edi
mov    0x20(%rsp),%rsi
call   10a0 <fputc@plt>
jmp    1680 <main+0x470>
mov    0x74(%rsp),%ecx
mov    0x78(%rsp),%r8d
mov    0x18(%rsp),%rdi
lea    0xa3e(%rip),%rsi
lea    0x40(%rsp),%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmpl   $0x0,0x8(%rsp)
jle    17e1 <main+0x5d1>
xor    %ebx,%ebx
jmp    16fd <main+0x4ed>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r13
je     17e1 <main+0x5d1>
mov    (%r15,%rbx,4),%edx
mov    0x18(%rsp),%rdi
lea    0xa28(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmp    %rbx,%r12
je     16f0 <main+0x4e0>
mov    $0x2c,%edi
mov    0x18(%rsp),%rsi
call   10a0 <fputc@plt>
jmp    16f0 <main+0x4e0>
mov    0x74(%rsp),%ecx
mov    0x78(%rsp),%r8d
mov    0x10(%rsp),%rdi
lea    0x9ce(%rip),%rsi
lea    0x40(%rsp),%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmpl   $0x0,0x8(%rsp)
jle    17f7 <main+0x5e7>
xor    %ebx,%ebx
jmp    176d <main+0x55d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r13
je     17f7 <main+0x5e7>
mov    (%r15,%rbx,4),%edx
mov    0x10(%rsp),%rdi
lea    0x9b8(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmp    %rbx,%r12
je     1760 <main+0x550>
mov    $0x2c,%edi
mov    0x10(%rsp),%rsi
call   10a0 <fputc@plt>
jmp    1760 <main+0x550>
mov    %r14,%rdi
lea    0x990(%rip),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    %r14,%rsi
jmp    1815 <main+0x605>
mov    0x28(%rsp),%rbx
mov    %rbx,%rdi
lea    0x970(%rip),%rsi
mov    $0x2,%edx
jmp    180b <main+0x5fb>
mov    0x20(%rsp),%rbx
mov    %rbx,%rdi
lea    0x95a(%rip),%rsi
mov    $0x3,%edx
jmp    180b <main+0x5fb>
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
lea    0x944(%rip),%rsi
mov    $0x4,%edx
jmp    180b <main+0x5fb>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
lea    0x92e(%rip),%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    %rbx,%rsi
mov    $0xa,%edi
call   10a0 <fputc@plt>
mov    0x30(%rsp),%rbx
mov    0x74(%rsp),%ecx
mov    0x78(%rsp),%r8d
mov    %rbx,%rdi
lea    0x8d6(%rip),%rsi
lea    0x40(%rsp),%rdx
mov    0x4(%rsp),%r9d
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmpl   $0x0,0x8(%rsp)
jle    13c0 <main+0x1b0>
xor    %r14d,%r14d
jmp    186d <main+0x65d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14
cmp    %r14,%r13
je     13c0 <main+0x1b0>
mov    (%r15,%r14,4),%edx
mov    %rbx,%rdi
lea    0x8ba(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
cmp    %r14,%r12
je     1860 <main+0x650>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   10a0 <fputc@plt>
jmp    1860 <main+0x650>
lea    0x7fc(%rip),%rdi
jmp    18a6 <main+0x696>
lea    0x82e(%rip),%rdi
call   1070 <printf@plt>
xor    %edi,%edi
call   1120 <exit@plt>
lea    0x87f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <getchar@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    0x73e(%rip),%rdi
call   1070 <printf@plt>
jmp    18be <main+0x6ae>

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

LLVM IR (-O2):
%struct.peak = type { [50 x i8], i32, i32, i32* }
@.str = [2 x i8] c"r\00"
@.str.1 = [62 x i8] c"\0Aerror occurred when opening the input file to combine peaks!\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.4 = [11 x i8] c"class1.bed\00"
@.str.5 = [11 x i8] c"class2.bed\00"
@.str.6 = [11 x i8] c"class3.bed\00"
@.str.7 = [11 x i8] c"class4.bed\00"
@.str.8 = [11 x i8] c"class5.bed\00"
@.str.9 = [13 x i8] c"%s\09%d\09%d\09%s\09\00"
@.str.10 = [57 x i8] c"Memory is not sufficent.Creating order graph file fails.\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [57 x i8] c"Memory is not sufficent.Creating order array file fails.\00"
@.str.13 = [34 x i8] c"%s\09%d\09%d\09MACS_peak_ordergraph_%d\09\00"
@.str.14 = [5 x i8] c"NA\090\00"
@.str.15 = [3 x i8] c"%d\00"
@.str.17 = [4 x i8] c"\09%d\00"
@str.22 = [26 x i8] c"\0Acreate output file error\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.peak
%4 = alloca [50 x i8]
%5 = getelementptr inbounds %struct.peak, %struct.peak* %3, i64 0, i32 0, i64 0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 (...) @getchar()
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%22 = tail call i32 (...) @getchar()
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %15
%25 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%29 = tail call i32 (...) @getchar()
%30 = tail call i32 @exit(i32 1)
unreachable
31: ; preds = %24
%32 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%36 = tail call i32 (...) @getchar()
%37 = tail call i32 @exit(i32 1)
unreachable
38: ; preds = %31
%39 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %45
41: ; preds = %38
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%43 = tail call i32 (...) @getchar()
%44 = tail call i32 @exit(i32 1)
unreachable
45: ; preds = %38
%46 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %52
48: ; preds = %45
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%50 = tail call i32 (...) @getchar()
%51 = tail call i32 @exit(i32 1)
unreachable
52: ; preds = %45
%53 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %59
55: ; preds = %52
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%57 = tail call i32 (...) @getchar()
%58 = tail call i32 @exit(i32 1)
unreachable
59: ; preds = %52
%60 = getelementptr inbounds i8*, i8** %1, i64 3
%61 = load i8*, i8** %60
%62 = tail call i32 @atoi(i8* %61)
%63 = call i32 @feof(i32* %9)
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %233
65: ; preds = %59
%66 = getelementptr inbounds %struct.peak, %struct.peak* %3, i64 0, i32 0
%67 = getelementptr inbounds %struct.peak, %struct.peak* %3, i64 0, i32 1
%68 = getelementptr inbounds %struct.peak, %struct.peak* %3, i64 0, i32 2
%69 = shl i32 %62, 2
%70 = mul i32 %69, %62
%71 = getelementptr inbounds %struct.peak, %struct.peak* %3, i64 0, i32 3
%72 = mul i32 %62, %62
%73 = icmp eq i32 %72, 0
%74 = icmp sgt i32 %62, 0
%75 = add nsw i32 %62, -1
%76 = zext i32 %75 to i64
%77 = zext i32 %72 to i64
%78 = zext i32 %62 to i64
%79 = zext i32 %62 to i64
%80 = zext i32 %62 to i64
%81 = zext i32 %62 to i64
%82 = zext i32 %62 to i64
%83 = zext i32 %62 to i64
br label %84
84: ; preds = %65, %225
%85 = phi i32 [ 1, %65 ], [ %230, %225 ]
%86 = call i32 (i32*, i8*, ...) @fscanf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), [50 x i8]* %66, i32* %67, i32* %68, [50 x i8]* %4)
%87 = call i64 @malloc(i32 %70)
%88 = inttoptr i64 %87 to i32*
store i32* %88, i32** %71
%89 = icmp eq i64 %87, 0
br i1 %89, label %91, label %90
90: ; preds = %84
br i1 %73, label %102, label %94
91: ; preds = %84
%92 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0))
%93 = call i32 @exit(i32 0)
unreachable
94: ; preds = %90, %94
%95 = phi i64 [ %100, %94 ], [ 0, %90 ]
%96 = call i32 @fgetc(i32* %9)
%97 = add nsw i32 %96, -48
%98 = load i32*, i32** %71
%99 = getelementptr inbounds i32, i32* %98, i64 %95
store i32 %97, i32* %99
%100 = add nuw nsw i64 %95, 1
%101 = icmp eq i64 %100, %77
br i1 %101, label %102, label %94
102: ; preds = %94, %90
%103 = call i32 (i32*, i8*, ...) @fscanf(i32* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%104 = call i64 @malloc(i32 %69)
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %102
%107 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0))
%108 = call i32 @exit(i32 0)
unreachable
109: ; preds = %102
%110 = load i32*, i32** %71
%111 = call i32* @otoog(i32* %110, i32 %62)
%112 = icmp eq i32* %111, null
br i1 %112, label %207, label %113
113: ; preds = %109
%114 = call i32 @classify_graph_function(i32* %111, i32 %62)
switch i32 %114, label %203 [
i32 1, label %115
i32 2, label %132
i32 3, label %149
i32 4, label %166
i32 5, label %183
]
115: ; preds = %113
%116 = load i32, i32* %67
%117 = load i32, i32* %68
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %116, i32 %117, i32 %85)
br i1 %74, label %119, label %130
119: ; preds = %115, %127
%120 = phi i64 [ %128, %127 ], [ 0, %115 ]
%121 = getelementptr inbounds i32, i32* %111, i64 %120
%122 = load i32, i32* %121
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 %122)
%124 = icmp eq i64 %120, %76
br i1 %124, label %127, label %125
125: ; preds = %119
%126 = call i32 @fputc(i32 44, i32* %25)
br label %127
127: ; preds = %119, %125
%128 = add nuw nsw i64 %120, 1
%129 = icmp eq i64 %128, %82
br i1 %129, label %130, label %119
130: ; preds = %127, %115
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 1)
br label %200
132: ; preds = %113
%133 = load i32, i32* %67
%134 = load i32, i32* %68
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %133, i32 %134, i32 %85)
br i1 %74, label %136, label %147
136: ; preds = %132, %144
%137 = phi i64 [ %145, %144 ], [ 0, %132 ]
%138 = getelementptr inbounds i32, i32* %111, i64 %137
%139 = load i32, i32* %138
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 %139)
%141 = icmp eq i64 %137, %76
br i1 %141, label %144, label %142
142: ; preds = %136
%143 = call i32 @fputc(i32 44, i32* %32)
br label %144
144: ; preds = %136, %142
%145 = add nuw nsw i64 %137, 1
%146 = icmp eq i64 %145, %81
br i1 %146, label %147, label %136
147: ; preds = %144, %132
%148 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 2)
br label %200
149: ; preds = %113
%150 = load i32, i32* %67
%151 = load i32, i32* %68
%152 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %150, i32 %151, i32 %85)
br i1 %74, label %153, label %164
153: ; preds = %149, %161
%154 = phi i64 [ %162, %161 ], [ 0, %149 ]
%155 = getelementptr inbounds i32, i32* %111, i64 %154
%156 = load i32, i32* %155
%157 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 %156)
%158 = icmp eq i64 %154, %76
br i1 %158, label %161, label %159
159: ; preds = %153
%160 = call i32 @fputc(i32 44, i32* %39)
br label %161
161: ; preds = %153, %159
%162 = add nuw nsw i64 %154, 1
%163 = icmp eq i64 %162, %80
br i1 %163, label %164, label %153
164: ; preds = %161, %149
%165 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 3)
br label %200
166: ; preds = %113
%167 = load i32, i32* %67
%168 = load i32, i32* %68
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %167, i32 %168, i32 %85)
br i1 %74, label %170, label %181
170: ; preds = %166, %178
%171 = phi i64 [ %179, %178 ], [ 0, %166 ]
%172 = getelementptr inbounds i32, i32* %111, i64 %171
%173 = load i32, i32* %172
%174 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 %173)
%175 = icmp eq i64 %171, %76
br i1 %175, label %178, label %176
176: ; preds = %170
%177 = call i32 @fputc(i32 44, i32* %46)
br label %178
178: ; preds = %170, %176
%179 = add nuw nsw i64 %171, 1
%180 = icmp eq i64 %179, %79
br i1 %180, label %181, label %170
181: ; preds = %178, %166
%182 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 4)
br label %200
183: ; preds = %113
%184 = load i32, i32* %67
%185 = load i32, i32* %68
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %184, i32 %185, i32 %85)
br i1 %74, label %187, label %198
187: ; preds = %183, %195
%188 = phi i64 [ %196, %195 ], [ 0, %183 ]
%189 = getelementptr inbounds i32, i32* %111, i64 %188
%190 = load i32, i32* %189
%191 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 %190)
%192 = icmp eq i64 %188, %76
br i1 %192, label %195, label %193
193: ; preds = %187
%194 = call i32 @fputc(i32 44, i32* %53)
br label %195
195: ; preds = %187, %193
%196 = add nuw nsw i64 %188, 1
%197 = icmp eq i64 %196, %78
br i1 %197, label %198, label %187
198: ; preds = %195, %183
%199 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 5)
br label %200
200: ; preds = %130, %147, %164, %181, %198
%201 = phi i32* [ %53, %198 ], [ %46, %181 ], [ %39, %164 ], [ %32, %147 ], [ %25, %130 ]
%202 = call i32 @fputc(i32 10, i32* %201)
br label %203
203: ; preds = %200, %113
%204 = load i32, i32* %67
%205 = load i32, i32* %68
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %204, i32 %205, i32 %85)
br i1 %74, label %212, label %223
207: ; preds = %109
%208 = load i32, i32* %67
%209 = load i32, i32* %68
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i8* %5, i32 %208, i32 %209, i32 %85)
%211 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 4, i64 1, i32* %18)
br label %225
212: ; preds = %203, %220
%213 = phi i64 [ %221, %220 ], [ 0, %203 ]
%214 = getelementptr inbounds i32, i32* %111, i64 %213
%215 = load i32, i32* %214
%216 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 %215)
%217 = icmp eq i64 %213, %76
br i1 %217, label %220, label %218
218: ; preds = %212
%219 = call i32 @fputc(i32 44, i32* %18)
br label %220
220: ; preds = %212, %218
%221 = add nuw nsw i64 %213, 1
%222 = icmp eq i64 %221, %83
br i1 %222, label %223, label %212
223: ; preds = %220, %203
%224 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 %114)
br label %225
225: ; preds = %223, %207
%226 = call i32 @fputc(i32 10, i32* %18)
%227 = call i32 @free(i32* %111)
%228 = load i32*, i32** %71
%229 = call i32 @free(i32* %228)
%230 = add nuw nsw i32 %85, 1
%231 = call i32 @feof(i32* %9)
%232 = icmp eq i32 %231, 0
br i1 %232, label %84, label %233
233: ; preds = %225, %59
%234 = call i32 @fclose(i32* %9)
%235 = call i32 @fclose(i32* %18)
%236 = call i32 @fclose(i32* %25)
%237 = call i32 @fclose(i32* %32)
%238 = call i32 @fclose(i32* %39)
%239 = call i32 @fclose(i32* %46)
%240 = call i32 @fclose(i32* %53)
ret void
}