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

/* Variables and functions */
int FILENAME_MAX;
long atol(int /*<<< orphan*/);
int /*<<< orphan*/ chop_newline(char *);
int /*<<< orphan*/ err(int, char *, char *, ...);
int /*<<< orphan*/ errx(int, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
scalar_t__ optind;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ process_file(long *, long *, char *, char *,
                                int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
char *strdup(int /*<<< orphan*/);
int /*<<< orphan*/ strtol(int /*<<< orphan*/, char **, int);
int /*<<< orphan*/ usage(char *, char *);
int main(int argc, char *argv[]) {
  char infile_name[FILENAME_MAX];
  FILE *filelist = NULL;
  char *filelist_name = NULL;
  char *gsmtap_target = NULL;
  uint32_t appid = 0;
  int ch;
  long sid = 0;
  long cid = 0;
  int line = 0;
  while ((ch = getopt(argc, argv, "s:c:g:f:a:")) != -1) {
    switch (ch) {
    case 's':
      sid = atol(optarg);
      break;
    case 'c':
      cid = atol(optarg);
      break;
    case 'g':
      gsmtap_target = strdup(optarg);
      break;
    case 'f':
      filelist_name = strdup(optarg);
      break;
    case 'a':
      appid = strtol(optarg, (char **)NULL, 16);
      break;
    case '?':
    default:
      usage(argv[0], "Invalid arguments");
    }
  }
  argc -= optind;
  argv += optind;
  if (filelist_name == NULL && argc == 0) {
    errx(1, "Invalid arguments");
  }
  printf("PARSER_OK\n");
  fflush(stdout);
  while (argc > 0) {
    process_file(&sid, &cid, gsmtap_target, argv[0], appid);
    argc--;
    argv++;
  };
  if (filelist_name) {
    filelist = fopen(filelist_name, "rb");
    if (!filelist) {
      err(1, "Cannot open file list: %s", filelist_name);
    }
    while (!feof(filelist)) {
      fgets(infile_name, sizeof(infile_name), filelist);
      ++line;
      if (ferror(filelist)) {
        err(1, "Cannot open file in %s:%d", filelist_name, line);
      }
      chop_newline(infile_name);
      process_file(&sid, &cid, gsmtap_target, infile_name, appid);
    }
    fclose(filelist);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dbb(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x68(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe4a(%rip),%rdx
call   1110 <getopt@plt>
mov    %eax,-0x40(%rbp)
cmp    $0xffffffff,%eax
je     135c <main+0x15c>
mov    -0x40(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x70(%rbp)
sub    $0x34,%eax
ja     1344 <main+0x144>
mov    -0x70(%rbp),%rax
lea    0xd45(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
call   10f0 <atol@plt>
mov    %rax,-0x48(%rbp)
jmp    1357 <main+0x157>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   10f0 <atol@plt>
mov    %rax,-0x50(%rbp)
jmp    1357 <main+0x157>
mov    0x2cff(%rip),%rax
mov    (%rax),%edi
call   1120 <strdup@plt>
mov    %rax,-0x38(%rbp)
jmp    1357 <main+0x157>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
call   1120 <strdup@plt>
mov    %rax,-0x30(%rbp)
jmp    1357 <main+0x157>
mov    0x2cd1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   10a0 <strtol@plt>
mov    %eax,-0x3c(%rbp)
jmp    1357 <main+0x157>
jmp    1344 <main+0x144>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd8d(%rip),%rsi
call   10e0 <usage@plt>
jmp    127c <main+0x7c>
mov    0x2c7d(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2c69(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    13ac <main+0x1ac>
cmpl   $0x0,-0x8(%rbp)
jne    13ac <main+0x1ac>
mov    $0x1,%edi
lea    0xd38(%rip),%rsi
call   1060 <errx@plt>
lea    0xd3e(%rip),%rdi
call   1070 <printf@plt>
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1406 <main+0x206>
mov    -0x38(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x3c(%rbp),%r8d
lea    -0x48(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <process_file@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    13c6 <main+0x1c6>
cmpq   $0x0,-0x30(%rbp)
je     14e3 <main+0x2e3>
mov    -0x30(%rbp),%rdi
lea    0xce0(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1447 <main+0x247>
mov    -0x30(%rbp),%rdx
mov    $0x1,%edi
lea    0xcbf(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
jmp    144c <main+0x24c>
mov    -0x28(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    146a <main+0x26a>
jmp    14da <main+0x2da>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rax
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
call   1080 <fgets@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     14b3 <main+0x2b3>
mov    -0x30(%rbp),%rdx
mov    -0x54(%rbp),%ecx
mov    $0x1,%edi
lea    0xc6d(%rip),%rsi
mov    $0x0,%al
call   10b0 <err@plt>
mov    -0x60(%rbp),%rdi
call   10d0 <chop_newline@plt>
mov    -0x60(%rbp),%rcx
mov    -0x38(%rbp),%rdx
mov    -0x3c(%rbp),%r8d
lea    -0x48(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <process_file@plt>
jmp    144c <main+0x24c>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r15
mov    %edi,%r14d
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rax,-0x70(%rbp)
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
xor    %eax,%eax
mov    %rax,-0x50(%rbp)
lea    0xe06(%rip),%r12
lea    0xe0a(%rip),%r13
lea    0xdac(%rip),%rbx
xor    %eax,%eax
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x2c(%rbp)
jmp    1284 <main+0x84>
nop
cmp    $0xffffffff,%eax
je     1310 <main+0x110>
mov    (%r15),%rdi
mov    %r13,%rsi
call   10e0 <usage@plt>
mov    %r14d,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1110 <getopt@plt>
lea    -0x61(%rax),%ecx
cmp    $0x12,%ecx
ja     1270 <main+0x70>
movslq (%rbx,%rcx,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <strtol@plt>
mov    %eax,-0x2c(%rbp)
jmp    1284 <main+0x84>
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
call   10f0 <atol@plt>
mov    %rax,-0x48(%rbp)
jmp    1284 <main+0x84>
mov    0x2d20(%rip),%rax
mov    (%rax),%edi
call   1120 <strdup@plt>
mov    %rax,-0x38(%rbp)
jmp    1284 <main+0x84>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
call   1120 <strdup@plt>
mov    %rax,-0x40(%rbp)
jmp    1284 <main+0x84>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
call   10f0 <atol@plt>
mov    %rax,-0x50(%rbp)
jmp    1284 <main+0x84>
mov    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x2cb9(%rip),%rax
mov    (%rax),%rbx
sub    %ebx,%r14d
mov    -0x38(%rbp),%r13
test   %r13,%r13
jne    134c <main+0x14c>
test   %r14d,%r14d
jne    134c <main+0x14c>
lea    0xd15(%rip),%rsi
mov    $0x1,%edi
call   1070 <errx@plt>
lea    0xd4d(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c69(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
test   %r14d,%r14d
mov    -0x40(%rbp),%r13
mov    -0x2c(%rbp),%r12d
jle    13a3 <main+0x1a3>
lea    (%r15,%rbx,8),%rbx
add    $0x1,%r14d
lea    -0x60(%rbp),%r15
nop
mov    (%rbx),%rcx
lea    -0x68(%rbp),%rdi
mov    %r15,%rsi
mov    %r13,%rdx
mov    %r12d,%r8d
call   1060 <process_file@plt>
add    $0x8,%rbx
add    $0xffffffff,%r14d
cmp    $0x1,%r14d
ja     1380 <main+0x180>
mov    -0x38(%rbp),%rbx
test   %rbx,%rbx
je     13f1 <main+0x1f1>
lea    0xcb6(%rip),%rsi
mov    %rbx,%rdi
call   1100 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
jne    13d9 <main+0x1d9>
lea    0xca2(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   10b0 <err@plt>
mov    %r14,%rdi
call   1090 <feof@plt>
test   %eax,%eax
mov    -0x58(%rbp),%r13
je     1402 <main+0x202>
mov    %r14,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
lea    -0x68(%rbp),%r15
lea    -0x60(%rbp),%r12
jmp    1451 <main+0x251>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x58(%rbp),%r13
mov    %r13,%rdi
call   10d0 <chop_newline@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    -0x40(%rbp),%rdx
mov    %r13,%rcx
mov    -0x2c(%rbp),%r8d
call   1060 <process_file@plt>
mov    %r14,%rdi
call   1090 <feof@plt>
add    $0x1,%ebx
test   %eax,%eax
jne    13e9 <main+0x1e9>
mov    %r13,%rdi
mov    -0x70(%rbp),%rsi
mov    %r14,%rdx
call   1080 <fgets@plt>
mov    %r14,%rdi
call   1040 <ferror@plt>
test   %rax,%rax
je     1420 <main+0x220>
mov    $0x1,%edi
lea    0xc0d(%rip),%rsi
mov    -0x38(%rbp),%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   10b0 <err@plt>
jmp    1420 <main+0x220>

LLVM IR (-O0):
@FILENAME_MAX = global i32 0
@.str = [11 x i8] c"s:c:g:f:a:\00"
@optarg = global i32 0
@.str.1 = [18 x i8] c"Invalid arguments\00"
@optind = global i64 0
@.str.2 = [11 x i8] c"PARSER_OK\0A\00"
@stdout = global i32 0
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [26 x i8] c"Cannot open file list: %s\00"
@.str.5 = [26 x i8] c"Cannot open file in %s:%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i64
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* @FILENAME_MAX
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %6
%19 = alloca i8, i64 %17
store i64 %17, i64* %7
store i32* null, i32** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i32 0, i32* %11
store i64 0, i64* %13
store i64 0, i64* %14
store i32 0, i32* %15
br label %20
20: ; preds = %48, %2
%21 = load i32, i32* %4
%22 = load i8**, i8*** %5
%23 = call i32 @getopt(i32 %21, i8** %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %23, i32* %12
%24 = icmp ne i32 %23, -1
br i1 %24, label %25, label %49
25: ; preds = %20
%26 = load i32, i32* %12
switch i32 %26, label %43 [
i32 115, label %27
i32 99, label %30
i32 103, label %33
i32 102, label %36
i32 97, label %39
i32 63, label %42
]
27: ; preds = %25
%28 = load i32, i32* @optarg
%29 = call i64 @atol(i32 %28)
store i64 %29, i64* %13
br label %48
30: ; preds = %25
%31 = load i32, i32* @optarg
%32 = call i64 @atol(i32 %31)
store i64 %32, i64* %14
br label %48
33: ; preds = %25
%34 = load i32, i32* @optarg
%35 = call i8* @strdup(i32 %34)
store i8* %35, i8** %10
br label %48
36: ; preds = %25
%37 = load i32, i32* @optarg
%38 = call i8* @strdup(i32 %37)
store i8* %38, i8** %9
br label %48
39: ; preds = %25
%40 = load i32, i32* @optarg
%41 = call i32 @strtol(i32 %40, i8** null, i32 16)
store i32 %41, i32* %11
br label %48
42: ; preds = %25
br label %43
43: ; preds = %25, %42
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 0
%46 = load i8*, i8** %45
%47 = call i32 @usage(i8* %46, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %48
48: ; preds = %43, %39, %36, %33, %30, %27
br label %20
49: ; preds = %20
%50 = load i64, i64* @optind
%51 = load i32, i32* %4
%52 = sext i32 %51 to i64
%53 = sub nsw i64 %52, %50
%54 = trunc i64 %53 to i32
store i32 %54, i32* %4
%55 = load i64, i64* @optind
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 %55
store i8** %57, i8*** %5
%58 = load i8*, i8** %9
%59 = icmp eq i8* %58, null
br i1 %59, label %60, label %65
60: ; preds = %49
%61 = load i32, i32* %4
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %65
65: ; preds = %63, %60, %49
%66 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%67 = load i32, i32* @stdout
%68 = call i32 @fflush(i32 %67)
br label %69
69: ; preds = %72, %65
%70 = load i32, i32* %4
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %83
72: ; preds = %69
%73 = load i8*, i8** %10
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 0
%76 = load i8*, i8** %75
%77 = load i32, i32* %11
%78 = call i32 @process_file(i64* %13, i64* %14, i8* %73, i8* %76, i32 %77)
%79 = load i32, i32* %4
%80 = add nsw i32 %79, -1
store i32 %80, i32* %4
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i32 1
store i8** %82, i8*** %5
br label %69
83: ; preds = %69
%84 = load i8*, i8** %9
%85 = icmp ne i8* %84, null
br i1 %85, label %86, label %121
86: ; preds = %83
%87 = load i8*, i8** %9
%88 = call i32* @fopen(i8* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %88, i32** %8
%89 = load i32*, i32** %8
%90 = icmp ne i32* %89, null
br i1 %90, label %94, label %91
91: ; preds = %86
%92 = load i8*, i8** %9
%93 = call i32 (i32, i8*, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %92)
br label %94
94: ; preds = %91, %86
br label %95
95: ; preds = %113, %94
%96 = load i32*, i32** %8
%97 = call i32 @feof(i32* %96)
%98 = icmp ne i32 %97, 0
%99 = xor i1 %98, true
br i1 %99, label %100, label %118
100: ; preds = %95
%101 = trunc i64 %17 to i32
%102 = load i32*, i32** %8
%103 = call i32 @fgets(i8* %19, i32 %101, i32* %102)
%104 = load i32, i32* %15
%105 = add nsw i32 %104, 1
store i32 %105, i32* %15
%106 = load i32*, i32** %8
%107 = call i64 @ferror(i32* %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %113
109: ; preds = %100
%110 = load i8*, i8** %9
%111 = load i32, i32* %15
%112 = call i32 (i32, i8*, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %110, i32 %111)
br label %113
113: ; preds = %109, %100
%114 = call i32 @chop_newline(i8* %19)
%115 = load i8*, i8** %10
%116 = load i32, i32* %11
%117 = call i32 @process_file(i64* %13, i64* %14, i8* %115, i8* %19, i32 %116)
br label %95
118: ; preds = %95
%119 = load i32*, i32** %8
%120 = call i32 @fclose(i32* %119)
br label %121
121: ; preds = %118, %83
store i32 0, i32* %3
%122 = load i8*, i8** %6
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
@FILENAME_MAX = global i32 0
@.str = [11 x i8] c"s:c:g:f:a:\00"
@optarg = global i32 0
@.str.1 = [18 x i8] c"Invalid arguments\00"
@optind = global i64 0
@stdout = global i32 0
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [26 x i8] c"Cannot open file list: %s\00"
@.str.5 = [26 x i8] c"Cannot open file in %s:%d\00"
@str = [10 x i8] c"PARSER_OK\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i64
%4 = alloca i64
%5 = load i32, i32* @FILENAME_MAX
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = bitcast i64* %3 to i8*
%9 = bitcast i64* %4 to i8*
br label %10
10: ; preds = %32, %2
%11 = phi i64 [ %34, %32 ], [ 0, %2 ]
%12 = phi i64 [ %17, %32 ], [ 0, %2 ]
%13 = phi i8* [ %22, %32 ], [ null, %2 ]
%14 = phi i8* [ %26, %32 ], [ null, %2 ]
%15 = phi i32 [ %29, %32 ], [ 0, %2 ]
br label %16
16: ; preds = %10, %35
%17 = phi i64 [ %12, %10 ], [ %37, %35 ]
%18 = phi i8* [ %13, %10 ], [ %22, %35 ]
%19 = phi i8* [ %14, %10 ], [ %26, %35 ]
%20 = phi i32 [ %15, %10 ], [ %29, %35 ]
br label %21
21: ; preds = %16, %41
%22 = phi i8* [ %18, %16 ], [ %43, %41 ]
%23 = phi i8* [ %19, %16 ], [ %26, %41 ]
%24 = phi i32 [ %20, %16 ], [ %29, %41 ]
br label %25
25: ; preds = %21, %38
%26 = phi i8* [ %23, %21 ], [ %40, %38 ]
%27 = phi i32 [ %24, %21 ], [ %29, %38 ]
br label %28
28: ; preds = %25, %44
%29 = phi i32 [ %27, %25 ], [ %46, %44 ]
br label %30
30: ; preds = %28, %47
%31 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
switch i32 %31, label %47 [
i32 -1, label %50
i32 115, label %32
i32 99, label %35
i32 103, label %38
i32 102, label %41
i32 97, label %44
]
32: ; preds = %30
%33 = load i32, i32* @optarg
%34 = tail call i64 @atol(i32 %33)
br label %10
35: ; preds = %30
%36 = load i32, i32* @optarg
%37 = tail call i64 @atol(i32 %36)
br label %16
38: ; preds = %30
%39 = load i32, i32* @optarg
%40 = tail call i8* @strdup(i32 %39)
br label %25
41: ; preds = %30
%42 = load i32, i32* @optarg
%43 = tail call i8* @strdup(i32 %42)
br label %21
44: ; preds = %30
%45 = load i32, i32* @optarg
%46 = tail call i32 @strtol(i32 %45, i8** null, i32 16)
br label %28
47: ; preds = %30
%48 = load i8*, i8** %1
%49 = tail call i32 @usage(i8* %48, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %30
50: ; preds = %30
store i64 %17, i64* %4
store i64 %11, i64* %3
%51 = load i64, i64* @optind
%52 = trunc i64 %51 to i32
%53 = sub i32 %0, %52
%54 = getelementptr inbounds i8*, i8** %1, i64 %51
%55 = icmp eq i8* %22, null
%56 = icmp eq i32 %53, 0
%57 = select i1 %55, i1 %56, i1 false
br i1 %57, label %58, label %60
58: ; preds = %50
%59 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %60
60: ; preds = %58, %50
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%62 = load i32, i32* @stdout
%63 = tail call i32 @fflush(i32 %62)
%64 = icmp sgt i32 %53, 0
br i1 %64, label %65, label %73
65: ; preds = %60, %65
%66 = phi i32 [ %70, %65 ], [ %53, %60 ]
%67 = phi i8** [ %71, %65 ], [ %54, %60 ]
%68 = load i8*, i8** %67
%69 = call i32 @process_file(i64* %3, i64* %4, i8* %26, i8* %68, i32 %29)
%70 = add nsw i32 %66, -1
%71 = getelementptr inbounds i8*, i8** %67, i64 1
%72 = icmp ugt i32 %66, 1
br i1 %72, label %65, label %73
73: ; preds = %65, %60
br i1 %55, label %97, label %74
74: ; preds = %73
%75 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%76 = icmp eq i32* %75, null
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 (i32, i8*, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %22)
br label %79
79: ; preds = %77, %74
%80 = call i32 @feof(i32* %75)
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %95
82: ; preds = %79, %90
%83 = phi i32 [ %85, %90 ], [ 0, %79 ]
%84 = call i32 @fgets(i8* %7, i32 %5, i32* %75)
%85 = add nuw nsw i32 %83, 1
%86 = call i64 @ferror(i32* %75)
%87 = icmp eq i64 %86, 0
br i1 %87, label %90, label %88
88: ; preds = %82
%89 = call i32 (i32, i8*, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %22, i32 %85)
br label %90
90: ; preds = %88, %82
%91 = call i32 @chop_newline(i8* %7)
%92 = call i32 @process_file(i64* %3, i64* %4, i8* %26, i8* %7, i32 %29)
%93 = call i32 @feof(i32* %75)
%94 = icmp eq i32 %93, 0
br i1 %94, label %82, label %95
95: ; preds = %90, %79
%96 = call i32 @fclose(i32* %75)
br label %97
97: ; preds = %95, %73
ret i32 0
}