#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 */
struct stat {
  long st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int abs(int);
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
int fread(char *, long, int, int /*<<< orphan*/ *);
scalar_t__ malloc(long);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int strlen(char *);
char *strtok_r(char *, char *, char **);
int usage();
int main(int argc, char *argv[]) {
  if (argc != 3)
    return usage();
  struct stat fileStat;
  if (stat(argv[1], &fileStat) < 0) {
    fprintf(stderr, "[VCF_INDEL] Open %s failed.\n", argv[1]);
    return -1;
  }
  long fileSize = fileStat.st_size;
  FILE *fpin = fopen(argv[1], "r");
  if (fpin == NULL) {
    fprintf(stderr, "[VCF_INDEL] Open %s failed.\n", argv[1]);
    return -1;
  }
  FILE *fpout = fopen(argv[2], "w");
  if (fpout == NULL) {
    fprintf(stderr, "[VCF_INDEL] Open %s failed.\n", argv[2]);
    return -1;
  }
  char *buf = (char *)malloc(fileSize);
  if (fread(buf, fileSize, 1, fpin) != 1) {
    fprintf(stderr, "[VCF_INDEL] read %s failed.\n", argv[2]);
    return -1;
  }
  char *p = buf;
  char *t, *str, *str_line, *str_tab;
  t = str = str_line = str_tab = NULL;
  int brk1, len, len1, len2;
  brk1 = len = 0;
  char *chr, *ref;
  chr = ref = NULL;
  while ((t = strtok_r(p, "\n", &str_line)) != NULL) {
    p = NULL;
    if (t[0] == '#') {
      continue;
    }
    t = strtok_r(t, "\t", &str_tab);
    chr = t;
    t = strtok_r(NULL, "\t", &str_tab);
    if (atoi(t) > brk1 && brk1 + len >= atoi(t)) {
      continue;
    }
    brk1 = atoi(t);
    t = strtok_r(NULL, "\t", &str_tab);
    ref = strtok_r(NULL, "\t", &str_tab);
    len1 = strlen(ref);
    t = strtok_r(NULL, "\t", &str_tab);
    strtok_r(t, ",", &str);
    len2 = strlen(t);
    if (len2 != 1 && len1 != 1)
      continue;
    if (ref[0] != t[0])
      continue;
    if (abs(len1 - len2) > 50)
      continue;
    len = len1 > len2 ? len1 : len2;
    fprintf(fpout, "%s\t%d\t%s\t%s\n", chr, brk1, ref, t);
  }
  fclose(fpin);
  fclose(fpout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11e2 <main+0x32>
mov    $0x0,%al
call   10b0 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1558 <main+0x3a8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1090 <stat@plt>
cmp    $0x0,%rax
jge    1229 <main+0x79>
mov    0x2ddc(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1558 <main+0x3a8>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xddd(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1280 <main+0xd0>
mov    0x2d85(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd93(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1558 <main+0x3a8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd90(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12cf <main+0x11f>
mov    0x2d36(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd44(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1558 <main+0x3a8>
mov    -0x20(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1327 <main+0x177>
mov    0x2cde(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd0d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1558 <main+0x3a8>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x64(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xcc4(%rip),%rsi
lea    -0x58(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
je     153f <main+0x38f>
movq   $0x0,-0x40(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    13ac <main+0x1fc>
jmp    136d <main+0x1bd>
mov    -0x48(%rbp),%rdi
lea    0xc87(%rip),%rsi
lea    -0x60(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x78(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc67(%rip),%rsi
lea    -0x60(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
call   10d0 <atoi@plt>
cmp    -0x64(%rbp),%eax
jle    1420 <main+0x270>
mov    -0x64(%rbp),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x48(%rbp),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
cmp    %ecx,%eax
jl     1420 <main+0x270>
jmp    136d <main+0x1bd>
mov    -0x48(%rbp),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x64(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc07(%rip),%rsi
lea    -0x60(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xbef(%rip),%rsi
lea    -0x60(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x6c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xbcb(%rip),%rsi
lea    -0x60(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xbb5(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1070 <strtok_r@plt>
mov    -0x48(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x70(%rbp)
cmpl   $0x1,-0x70(%rbp)
je     14b9 <main+0x309>
cmpl   $0x1,-0x6c(%rbp)
je     14b9 <main+0x309>
jmp    136d <main+0x1bd>
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
mov    -0x48(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     14d4 <main+0x324>
jmp    136d <main+0x1bd>
mov    -0x6c(%rbp),%edi
sub    -0x70(%rbp),%edi
call   1040 <abs@plt>
cmp    $0x32,%eax
jle    14ed <main+0x33d>
jmp    136d <main+0x1bd>
mov    -0x6c(%rbp),%eax
cmp    -0x70(%rbp),%eax
jle    1507 <main+0x357>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x88(%rbp)
jmp    1510 <main+0x360>
mov    -0x70(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x78(%rbp),%rdx
mov    -0x64(%rbp),%ecx
mov    -0x80(%rbp),%r8
mov    -0x48(%rbp),%r9
lea    0xb0f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    136d <main+0x1bd>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jne    13e1 <main+0x241>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0x40(%rsp),%rsi
call   1080 <stat@plt>
test   %rax,%rax
js     13e8 <main+0x248>
mov    0x40(%rsp),%r15
mov    0x8(%rbx),%rdi
lea    0xe3c(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13e8 <main+0x248>
mov    %rax,%rbp
mov    0x10(%rbx),%rdi
lea    0xe22(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1418 <main+0x278>
mov    %rax,%r12
mov    %r15,%rdi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1428 <main+0x288>
mov    %r12,0x20(%rsp)
mov    %rbp,0x28(%rsp)
movq   $0x0,0x30(%rsp)
movq   $0x0,(%rsp)
movq   $0x0,0x38(%rsp)
lea    0xddc(%rip),%rsi
mov    %rsp,%rdx
mov    %r14,%rdi
call   1060 <strtok_r@plt>
test   %rax,%rax
je     143f <main+0x29f>
lea    0xdc3(%rip),%rbx
lea    0x30(%rsp),%rbp
xor    %ecx,%ecx
mov    %rcx,0x18(%rsp)
xor    %r14d,%r14d
mov    %r14d,%r12d
mov    0x18(%rsp),%rcx
lea    (%rcx,%r12,1),%r13d
jmp    12ba <main+0x11a>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
lea    0xd93(%rip),%rsi
mov    %rsp,%rdx
call   1060 <strtok_r@plt>
test   %rax,%rax
je     143f <main+0x29f>
cmpb   $0x23,(%rax)
je     12a0 <main+0x100>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1060 <strtok_r@plt>
mov    %rax,%r15
xor    %edi,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1060 <strtok_r@plt>
mov    %rax,%rdi
call   10c0 <atoi@plt>
mov    %eax,%r14d
cmp    %r12d,%eax
jle    12f2 <main+0x152>
cmp    %r14d,%r13d
jge    12a0 <main+0x100>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1060 <strtok_r@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1060 <strtok_r@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
xor    %edi,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1060 <strtok_r@plt>
mov    %rax,%r13
mov    %rax,%rdi
lea    0xd0a(%rip),%rsi
lea    0x38(%rsp),%rdx
call   1060 <strtok_r@plt>
mov    %r13,0x10(%rsp)
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %eax,%r13d
cmp    $0x1,%eax
je     135b <main+0x1bb>
cmp    $0x1,%r12d
jne    137d <main+0x1dd>
mov    0x8(%rsp),%rax
mov    (%rax),%al
mov    0x10(%rsp),%rcx
cmp    (%rcx),%al
jne    137d <main+0x1dd>
mov    %r12d,%eax
sub    %r13d,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
cmp    $0x32,%ecx
jbe    139c <main+0x1fc>
xor    %edi,%edi
lea    0xcb6(%rip),%rsi
mov    %rsp,%rdx
call   1060 <strtok_r@plt>
test   %rax,%rax
jne    128a <main+0xea>
jmp    143f <main+0x29f>
cmp    %r13d,%r12d
cmovg  %r12d,%r13d
mov    0x20(%rsp),%rdi
lea    0xc93(%rip),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    0x8(%rsp),%r8
mov    0x10(%rsp),%r9
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %edi,%edi
lea    0xc6d(%rip),%rsi
mov    %rsp,%rdx
call   1060 <strtok_r@plt>
mov    %r13d,%ecx
mov    %rcx,0x18(%rsp)
jmp    138e <main+0x1ee>
xor    %eax,%eax
jmp    10a0 <usage@plt>
mov    0x2bf1(%rip),%rax
movslq (%rax),%rdi
mov    0x8(%rbx),%rdx
lea    0xc03(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bc1(%rip),%rax
movslq (%rax),%rdi
mov    0x10(%rbx),%rdx
jmp    13f6 <main+0x256>
mov    0x2bb1(%rip),%rax
movslq (%rax),%rdi
mov    0x10(%rbx),%rdx
lea    0xbe4(%rip),%rsi
jmp    13fd <main+0x25d>
mov    0x28(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
jmp    1409 <main+0x269>

LLVM IR (-O0):
%struct.stat = type { i64 }
@stderr = global i32 0
@.str = [29 x i8] c"[VCF_INDEL] Open %s failed.\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [29 x i8] c"[VCF_INDEL] read %s failed.\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [2 x i8] c"\09\00"
@.str.6 = [2 x i8] c",\00"
@.str.7 = [13 x i8] c"%s\09%d\09%s\09%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 (...) @usage()
store i32 %25, i32* %3
br label %176
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @stat(i8* %29, %struct.stat* %6)
%31 = icmp slt i64 %30, 0
br i1 %31, label %32, label %40
32: ; preds = %26
%33 = load i32, i32* @stderr
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i32*
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %38)
store i32 -1, i32* %3
br label %176
40: ; preds = %26
%41 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%42 = load i64, i64* %41
store i64 %42, i64* %7
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %46, i32** %8
%47 = load i32*, i32** %8
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %57
49: ; preds = %40
%50 = load i32, i32* @stderr
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to i32*
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %55)
store i32 -1, i32* %3
br label %176
57: ; preds = %40
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 2
%60 = load i8*, i8** %59
%61 = call i32* @fopen(i8* %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %61, i32** %9
%62 = load i32*, i32** %9
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %72
64: ; preds = %57
%65 = load i32, i32* @stderr
%66 = sext i32 %65 to i64
%67 = inttoptr i64 %66 to i32*
%68 = load i8**, i8*** %5
%69 = getelementptr inbounds i8*, i8** %68, i64 2
%70 = load i8*, i8** %69
%71 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %70)
store i32 -1, i32* %3
br label %176
72: ; preds = %57
%73 = load i64, i64* %7
%74 = call i64 @malloc(i64 %73)
%75 = inttoptr i64 %74 to i8*
store i8* %75, i8** %10
%76 = load i8*, i8** %10
%77 = load i64, i64* %7
%78 = load i32*, i32** %8
%79 = call i32 @fread(i8* %76, i64 %77, i32 1, i32* %78)
%80 = icmp ne i32 %79, 1
br i1 %80, label %81, label %89
81: ; preds = %72
%82 = load i32, i32* @stderr
%83 = sext i32 %82 to i64
%84 = inttoptr i64 %83 to i32*
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 2
%87 = load i8*, i8** %86
%88 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %87)
store i32 -1, i32* %3
br label %176
89: ; preds = %72
%90 = load i8*, i8** %10
store i8* %90, i8** %11
store i8* null, i8** %15
store i8* null, i8** %14
store i8* null, i8** %13
store i8* null, i8** %12
store i32 0, i32* %17
store i32 0, i32* %16
store i8* null, i8** %21
store i8* null, i8** %20
br label %91
91: ; preds = %163, %154, %147, %136, %118, %101, %89
%92 = load i8*, i8** %11
%93 = call i8* @strtok_r(i8* %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %14)
store i8* %93, i8** %12
%94 = icmp ne i8* %93, null
br i1 %94, label %95, label %171
95: ; preds = %91
store i8* null, i8** %11
%96 = load i8*, i8** %12
%97 = getelementptr inbounds i8, i8* %96, i64 0
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 35
br i1 %100, label %101, label %102
101: ; preds = %95
br label %91
102: ; preds = %95
%103 = load i8*, i8** %12
%104 = call i8* @strtok_r(i8* %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %15)
store i8* %104, i8** %12
%105 = load i8*, i8** %12
store i8* %105, i8** %20
%106 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %15)
store i8* %106, i8** %12
%107 = load i8*, i8** %12
%108 = call i32 @atoi(i8* %107)
%109 = load i32, i32* %16
%110 = icmp sgt i32 %108, %109
br i1 %110, label %111, label %119
111: ; preds = %102
%112 = load i32, i32* %16
%113 = load i32, i32* %17
%114 = add nsw i32 %112, %113
%115 = load i8*, i8** %12
%116 = call i32 @atoi(i8* %115)
%117 = icmp sge i32 %114, %116
br i1 %117, label %118, label %119
118: ; preds = %111
br label %91
119: ; preds = %111, %102
%120 = load i8*, i8** %12
%121 = call i32 @atoi(i8* %120)
store i32 %121, i32* %16
%122 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %15)
store i8* %122, i8** %12
%123 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %15)
store i8* %123, i8** %21
%124 = load i8*, i8** %21
%125 = call i32 @strlen(i8* %124)
store i32 %125, i32* %18
%126 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %15)
store i8* %126, i8** %12
%127 = load i8*, i8** %12
%128 = call i8* @strtok_r(i8* %127, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %13)
%129 = load i8*, i8** %12
%130 = call i32 @strlen(i8* %129)
store i32 %130, i32* %19
%131 = load i32, i32* %19
%132 = icmp ne i32 %131, 1
br i1 %132, label %133, label %137
133: ; preds = %119
%134 = load i32, i32* %18
%135 = icmp ne i32 %134, 1
br i1 %135, label %136, label %137
136: ; preds = %133
br label %91
137: ; preds = %133, %119
%138 = load i8*, i8** %21
%139 = getelementptr inbounds i8, i8* %138, i64 0
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = load i8*, i8** %12
%143 = getelementptr inbounds i8, i8* %142, i64 0
%144 = load i8, i8* %143
%145 = sext i8 %144 to i32
%146 = icmp ne i32 %141, %145
br i1 %146, label %147, label %148
147: ; preds = %137
br label %91
148: ; preds = %137
%149 = load i32, i32* %18
%150 = load i32, i32* %19
%151 = sub nsw i32 %149, %150
%152 = call i32 @abs(i32 %151)
%153 = icmp sgt i32 %152, 50
br i1 %153, label %154, label %155
154: ; preds = %148
br label %91
155: ; preds = %148
%156 = load i32, i32* %18
%157 = load i32, i32* %19
%158 = icmp sgt i32 %156, %157
br i1 %158, label %159, label %161
159: ; preds = %155
%160 = load i32, i32* %18
br label %163
161: ; preds = %155
%162 = load i32, i32* %19
br label %163
163: ; preds = %161, %159
%164 = phi i32 [ %160, %159 ], [ %162, %161 ]
store i32 %164, i32* %17
%165 = load i32*, i32** %9
%166 = load i8*, i8** %20
%167 = load i32, i32* %16
%168 = load i8*, i8** %21
%169 = load i8*, i8** %12
%170 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %165, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %166, i32 %167, i8* %168, i8* %169)
br label %91
171: ; preds = %91
%172 = load i32*, i32** %8
%173 = call i32 @fclose(i32* %172)
%174 = load i32*, i32** %9
%175 = call i32 @fclose(i32* %174)
store i32 0, i32* %3
br label %176
176: ; preds = %171, %81, %64, %49, %32, %24
%177 = load i32, i32* %3
ret i32 %177
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@stderr = global i32 0
@.str = [29 x i8] c"[VCF_INDEL] Open %s failed.\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [29 x i8] c"[VCF_INDEL] read %s failed.\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [2 x i8] c"\09\00"
@.str.6 = [2 x i8] c",\00"
@.str.7 = [13 x i8] c"%s\09%d\09%s\09%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 (...) @usage()
br label %116
10: ; preds = %2
%11 = bitcast %struct.stat* %3 to i8*
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @stat(i8* %13, %struct.stat* %3)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load i8*, i8** %12
%21 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %114
22: ; preds = %10
%23 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%24 = load i64, i64* %23
%25 = load i8*, i8** %12
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %34
28: ; preds = %22
%29 = load i32, i32* @stderr
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to i32*
%32 = load i8*, i8** %12
%33 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %32)
br label %114
34: ; preds = %22
%35 = getelementptr inbounds i8*, i8** %1, i64 2
%36 = load i8*, i8** %35
%37 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %45
39: ; preds = %34
%40 = load i32, i32* @stderr
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i32*
%43 = load i8*, i8** %35
%44 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %43)
br label %114
45: ; preds = %34
%46 = call i64 @malloc(i64 %24)
%47 = inttoptr i64 %46 to i8*
%48 = call i32 @fread(i8* %47, i64 %24, i32 1, i32* %26)
%49 = icmp eq i32 %48, 1
br i1 %49, label %56, label %50
50: ; preds = %45
%51 = load i32, i32* @stderr
%52 = sext i32 %51 to i64
%53 = inttoptr i64 %52 to i32*
%54 = load i8*, i8** %35
%55 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %54)
br label %114
56: ; preds = %45
%57 = bitcast i8** %4 to i8*
%58 = bitcast i8** %5 to i8*
%59 = bitcast i8** %6 to i8*
store i8* null, i8** %6
store i8* null, i8** %5
store i8* null, i8** %4
%60 = call i8* @strtok_r(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %5)
%61 = icmp eq i8* %60, null
br i1 %61, label %111, label %62
62: ; preds = %56, %105
%63 = phi i8* [ %109, %105 ], [ %60, %56 ]
%64 = phi i32 [ %107, %105 ], [ 0, %56 ]
%65 = phi i32 [ %80, %105 ], [ 0, %56 ]
br label %66
66: ; preds = %62, %94
%67 = phi i8* [ %63, %62 ], [ %95, %94 ]
%68 = phi i32 [ %65, %62 ], [ %80, %94 ]
%69 = add nsw i32 %64, %68
br label %70
70: ; preds = %66, %74
%71 = phi i8* [ %67, %66 ], [ %75, %74 ]
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 35
br i1 %73, label %74, label %77
74: ; preds = %70, %77
%75 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %5)
%76 = icmp eq i8* %75, null
br i1 %76, label %111, label %70
77: ; preds = %70
%78 = call i8* @strtok_r(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %6)
%79 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %6)
%80 = call i32 @atoi(i8* %79)
%81 = icmp sle i32 %80, %68
%82 = icmp slt i32 %69, %80
%83 = select i1 %81, i1 true, i1 %82
br i1 %83, label %84, label %74
84: ; preds = %77
%85 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %6)
%86 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %6)
%87 = call i32 @strlen(i8* %86)
%88 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %6)
%89 = call i8* @strtok_r(i8* %88, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %4)
%90 = call i32 @strlen(i8* %88)
%91 = icmp ne i32 %90, 1
%92 = icmp ne i32 %87, 1
%93 = select i1 %91, i1 %92, i1 false
br i1 %93, label %94, label %97
94: ; preds = %84, %97, %101
%95 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %5)
%96 = icmp eq i8* %95, null
br i1 %96, label %111, label %66
97: ; preds = %84
%98 = load i8, i8* %86
%99 = load i8, i8* %88
%100 = icmp eq i8 %98, %99
br i1 %100, label %101, label %94
101: ; preds = %97
%102 = sub nsw i32 %87, %90
%103 = call i32 @llvm.abs.i32(i32 %102, i1 true)
%104 = icmp ugt i32 %103, 50
br i1 %104, label %94, label %105
105: ; preds = %101
%106 = icmp sgt i32 %87, %90
%107 = select i1 %106, i32 %87, i32 %90
%108 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %78, i32 %80, i8* %86, i8* %88)
%109 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %5)
%110 = icmp eq i8* %109, null
br i1 %110, label %111, label %62
111: ; preds = %105, %94, %74, %56
%112 = call i32 @fclose(i32* %26)
%113 = call i32 @fclose(i32* %37)
br label %114
114: ; preds = %28, %50, %111, %39, %16
%115 = phi i32 [ -1, %16 ], [ -1, %28 ], [ -1, %39 ], [ -1, %50 ], [ 0, %111 ]
br label %116
116: ; preds = %114, %8
%117 = phi i32 [ %9, %8 ], [ %115, %114 ]
ret i32 %117
}