#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 option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ const member_1;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ check_missed();
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ free_specs();
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ ltr_int_check_root();
char *ltr_int_get_data_path(char *);
char *ltr_int_my_strdup(char *);
#define no_argument 129
int /*<<< orphan*/ open_file_to_search(char *);
char *optarg;
int optind;
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ print_spec_list();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ process_file(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ read_spec(char *);
#define required_argument 128
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ update_gamedata();
int main(int argc, char *argv[]) {
  bool extract = false;
  bool update = false;
  bool create = false;
  bool custom_spec = false;
  char *spec_path = NULL;
  int c;
  int index;
  static struct option long_opts[] = {{"spec", required_argument, NULL, 's'},
                                      {"create-spec", no_argument, NULL, 'c'},
                                      {"extract", no_argument, NULL, 'e'},
                                      {"update", no_argument, NULL, 'u'},
                                      {"help", no_argument, NULL, 'h'},
                                      {0, 0, 0, 0}};
  ltr_int_check_root();
  while (1) {
    c = getopt_long(argc, argv, "s:ceuh", long_opts, &index);
    if (c < 0) {
      break;
    }
    printf("Have %c (%d)\n", c, c);
    switch (c) {
    case 'c':
      create = true;
      break;
    case 'e':
      extract = true;
      break;
    case 'u':
      update = true;
      break;
    case 's':
      if (optarg != NULL) {
        custom_spec = true;
        spec_path = optarg;
      }
    case 'h':
      print_help();
      break;
    default:
      break;
    }
  }
  if (extract) {
    char *spec;
    if (custom_spec) {
      spec = ltr_int_my_strdup(spec_path);
    } else {
      spec = ltr_int_get_data_path("spec.txt");
    }
    read_spec(spec);
    free(spec);
    spec = NULL;
    print_spec_list();
    int i = 2;
    while (i < argc) {
      open_file_to_search(argv[i++]);
    }
    check_missed();
    free_specs();
  } else if (update) {
    update_gamedata();
  } else if (create) {
    FILE *f = NULL;
    if (custom_spec) {
      f = fopen(spec_path, "w");
      if (f == NULL) {
        printf("Can't open file '%s'.\n", spec_path);
      }
    } else {
      f = stdout;
    }
    while (optind < argc) {
      process_file(f, argv[optind++]);
    }
    if (custom_spec) {
      fclose(f);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    $0x0,%al
call   10c0 <ltr_int_check_root@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe1d(%rip),%rdx
lea    0x2e5a(%rip),%rcx
lea    -0x30(%rbp),%r8
call   1080 <getopt_long@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1271 <main+0x71>
jmp    1312 <main+0x112>
mov    -0x2c(%rbp),%edx
lea    0xdf8(%rip),%rdi
xor    %eax,%eax
mov    %edx,%esi
call   1090 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0x12,%eax
ja     1308 <main+0x108>
mov    -0x50(%rbp),%rax
lea    0xd5c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x1c(%rbp)
jmp    130d <main+0x10d>
movl   $0x1,-0x14(%rbp)
jmp    130d <main+0x10d>
movl   $0x1,-0x18(%rbp)
jmp    130d <main+0x10d>
mov    0x2d20(%rip),%rax
cmpq   $0x0,(%rax)
je     12f7 <main+0xf7>
movl   $0x1,-0x20(%rbp)
mov    0x2d08(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    12fc <main+0xfc>
mov    $0x0,%al
call   1110 <print_help@plt>
jmp    130d <main+0x10d>
jmp    130d <main+0x10d>
jmp    1241 <main+0x41>
cmpl   $0x0,-0x14(%rbp)
je     13af <main+0x1af>
cmpl   $0x0,-0x20(%rbp)
je     1338 <main+0x138>
mov    -0x28(%rbp),%rdi
call   1120 <ltr_int_my_strdup@plt>
mov    %rax,-0x38(%rbp)
jmp    1348 <main+0x148>
lea    0xd42(%rip),%rdi
call   10b0 <ltr_int_get_data_path@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   10a0 <read_spec@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x38(%rbp)
mov    $0x0,%al
call   10e0 <print_spec_list@plt>
movl   $0x2,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    139c <main+0x19c>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x3c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <open_file_to_search@plt>
jmp    1370 <main+0x170>
mov    $0x0,%al
call   10d0 <check_missed@plt>
mov    $0x0,%al
call   1100 <free_specs@plt>
jmp    148e <main+0x28e>
cmpl   $0x0,-0x18(%rbp)
je     13c5 <main+0x1c5>
mov    $0x0,%al
call   1040 <update_gamedata@plt>
jmp    1489 <main+0x289>
cmpl   $0x0,-0x1c(%rbp)
je     1484 <main+0x284>
movq   $0x0,-0x48(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1417 <main+0x217>
mov    -0x28(%rbp),%rdi
lea    0xc9e(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1412 <main+0x212>
mov    -0x28(%rbp),%rsi
lea    0xc81(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1425 <main+0x225>
mov    0x2bb2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    142a <main+0x22a>
mov    0x2baf(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    146c <main+0x26c>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x2b95(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2b87(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1070 <process_file@plt>
jmp    142a <main+0x22a>
cmpl   $0x0,-0x20(%rbp)
je     147f <main+0x27f>
mov    -0x48(%rbp),%rdi
call   1050 <fclose@plt>
jmp    1484 <main+0x284>
jmp    1489 <main+0x289>
jmp    148e <main+0x28e>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r13
mov    %edi,%ebp
xor    %eax,%eax
call   10c0 <ltr_int_check_root@plt>
lea    0xe4b(%rip),%rdx
lea    0x2e88(%rip),%rcx
lea    0x24(%rsp),%r8
mov    %ebp,%edi
mov    %r13,%rsi
call   1080 <getopt_long@plt>
test   %eax,%eax
js     1391 <main+0x191>
mov    %eax,%r15d
lea    0x2e67(%rip),%rbx
lea    0x24(%rsp),%r14
lea    0xdab(%rip),%r12
movl   $0x0,0x14(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
jmp    12ce <main+0xce>
mov    0x2d73(%rip),%rax
mov    (%rax),%rax
test   %rax,%rax
mov    0x8(%rsp),%ecx
mov    $0x1,%edx
cmovne %edx,%ecx
mov    %ecx,0x8(%rsp)
mov    0x18(%rsp),%rcx
cmovne %rax,%rcx
mov    %rcx,0x18(%rsp)
xor    %eax,%eax
call   1110 <print_help@plt>
mov    %ebp,%edi
mov    %r13,%rsi
lea    0xdb0(%rip),%rdx
mov    %rbx,%rcx
mov    %r14,%r8
call   1080 <getopt_long@plt>
mov    %eax,%r15d
test   %eax,%eax
js     1313 <main+0x113>
lea    0xd9e(%rip),%rdi
mov    %r15d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1090 <printf@plt>
add    $0xffffff9d,%r15d
cmp    $0x12,%r15d
ja     12b0 <main+0xb0>
movslq (%r12,%r15,4),%rax
add    %r12,%rax
jmp    *%rax
movl   $0x1,0xc(%rsp)
jmp    12b0 <main+0xb0>
movl   $0x1,0x14(%rsp)
jmp    12b0 <main+0xb0>
movl   $0x1,0x10(%rsp)
jmp    12b0 <main+0xb0>
cmpl   $0x0,0x14(%rsp)
je     132d <main+0x12d>
cmpl   $0x0,0x8(%rsp)
je     133d <main+0x13d>
mov    0x18(%rsp),%rdi
call   1120 <ltr_int_my_strdup@plt>
jmp    1349 <main+0x149>
cmpl   $0x0,0x10(%rsp)
je     13a2 <main+0x1a2>
xor    %eax,%eax
call   1040 <update_gamedata@plt>
jmp    1391 <main+0x191>
lea    0xd3d(%rip),%rdi
call   10b0 <ltr_int_get_data_path@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   10a0 <read_spec@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   10e0 <print_spec_list@plt>
cmp    $0x3,%ebp
jl     1383 <main+0x183>
mov    %ebp,%ebp
mov    $0x2,%ebx
nop
mov    0x0(%r13,%rbx,8),%rdi
add    $0x1,%rbx
call   1060 <open_file_to_search@plt>
cmp    %rbx,%rbp
jne    1370 <main+0x170>
xor    %eax,%eax
call   10d0 <check_missed@plt>
xor    %eax,%eax
call   1100 <free_specs@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmpl   $0x0,0xc(%rsp)
mov    0x18(%rsp),%rbx
je     1391 <main+0x191>
mov    0x8(%rsp),%r12d
test   %r12d,%r12d
je     13ec <main+0x1ec>
lea    0xccb(%rip),%rsi
mov    %rbx,%rdi
call   10f0 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
jne    13f6 <main+0x1f6>
lea    0xcb6(%rip),%rdi
xor    %r14d,%r14d
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2bf6(%rip),%r15
jmp    1415 <main+0x215>
mov    0x2bdd(%rip),%rax
mov    (%rax),%r14
mov    0x2be3(%rip),%r15
jmp    1415 <main+0x215>
nop
lea    0x1(%rax),%ecx
mov    %ecx,(%r15)
cltq
mov    0x0(%r13,%rax,8),%rsi
mov    %r14,%rdi
call   1070 <process_file@plt>
mov    (%r15),%eax
cmp    %ebp,%eax
jl     1400 <main+0x200>
test   %r12d,%r12d
je     1391 <main+0x191>
mov    %r14,%rdi
call   1050 <fclose@plt>
jmp    1391 <main+0x191>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
@main.long_opts = internal global [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 115 }, %struct.option { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0), i8 -127, i32* null, i32 99 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8 -127, i32* null, i32 101 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8 -127, i32* null, i32 117 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 -127, i32* null, i32 104 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"spec\00"
@.str.1 = [12 x i8] c"create-spec\00"
@.str.2 = [8 x i8] c"extract\00"
@.str.3 = [7 x i8] c"update\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [7 x i8] c"s:ceuh\00"
@.str.6 = [14 x i8] c"Have %c (%d)\0A\00"
@optarg = global i8* null
@.str.7 = [9 x i8] c"spec.txt\00"
@.str.8 = [2 x i8] c"w\00"
@.str.9 = [23 x i8] c"Can't open file '%s'.\0A\00"
@stdout = global i32* null
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i8* null, i8** %10
%16 = call i32 (...) @ltr_int_check_root()
br label %17
17: ; preds = %2, %41
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @getopt_long(i32 %18, i8** %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %struct.option* getelementptr inbounds ([6 x %struct.option], [6 x %struct.option]* @main.long_opts, i64 0, i64 0), i32* %12)
store i32 %20, i32* %11
%21 = load i32, i32* %11
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %17
br label %42
24: ; preds = %17
%25 = load i32, i32* %11
%26 = load i32, i32* %11
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %25, i32 %26)
%28 = load i32, i32* %11
switch i32 %28, label %40 [
i32 99, label %29
i32 101, label %30
i32 117, label %31
i32 115, label %32
i32 104, label %38
]
29: ; preds = %24
store i32 1, i32* %8
br label %41
30: ; preds = %24
store i32 1, i32* %6
br label %41
31: ; preds = %24
store i32 1, i32* %7
br label %41
32: ; preds = %24
%33 = load i8*, i8** @optarg
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %37
35: ; preds = %32
store i32 1, i32* %9
%36 = load i8*, i8** @optarg
store i8* %36, i8** %10
br label %37
37: ; preds = %35, %32
br label %38
38: ; preds = %24, %37
%39 = call i32 (...) @print_help()
br label %41
40: ; preds = %24
br label %41
41: ; preds = %40, %38, %31, %30, %29
br label %17
42: ; preds = %23
%43 = load i32, i32* %6
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %74
45: ; preds = %42
%46 = load i32, i32* %9
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i8*, i8** %10
%50 = call i8* @ltr_int_my_strdup(i8* %49)
store i8* %50, i8** %13
br label %53
51: ; preds = %45
%52 = call i8* @ltr_int_get_data_path(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i8* %52, i8** %13
br label %53
53: ; preds = %51, %48
%54 = load i8*, i8** %13
%55 = call i32 @read_spec(i8* %54)
%56 = load i8*, i8** %13
%57 = call i32 @free(i8* %56)
store i8* null, i8** %13
%58 = call i32 (...) @print_spec_list()
store i32 2, i32* %14
br label %59
59: ; preds = %63, %53
%60 = load i32, i32* %14
%61 = load i32, i32* %4
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %71
63: ; preds = %59
%64 = load i8**, i8*** %5
%65 = load i32, i32* %14
%66 = add nsw i32 %65, 1
store i32 %66, i32* %14
%67 = sext i32 %65 to i64
%68 = getelementptr inbounds i8*, i8** %64, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 @open_file_to_search(i8* %69)
br label %59
71: ; preds = %59
%72 = call i32 (...) @check_missed()
%73 = call i32 (...) @free_specs()
br label %119
74: ; preds = %42
%75 = load i32, i32* %7
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 (...) @update_gamedata()
br label %118
79: ; preds = %74
%80 = load i32, i32* %8
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %117
82: ; preds = %79
store i32* null, i32** %15
%83 = load i32, i32* %9
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %94
85: ; preds = %82
%86 = load i8*, i8** %10
%87 = call i32* @fopen(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %87, i32** %15
%88 = load i32*, i32** %15
%89 = icmp eq i32* %88, null
br i1 %89, label %90, label %93
90: ; preds = %85
%91 = load i8*, i8** %10
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %91)
br label %93
93: ; preds = %90, %85
br label %96
94: ; preds = %82
%95 = load i32*, i32** @stdout
store i32* %95, i32** %15
br label %96
96: ; preds = %94, %93
br label %97
97: ; preds = %101, %96
%98 = load i32, i32* @optind
%99 = load i32, i32* %4
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %110
101: ; preds = %97
%102 = load i32*, i32** %15
%103 = load i8**, i8*** %5
%104 = load i32, i32* @optind
%105 = add nsw i32 %104, 1
store i32 %105, i32* @optind
%106 = sext i32 %104 to i64
%107 = getelementptr inbounds i8*, i8** %103, i64 %106
%108 = load i8*, i8** %107
%109 = call i32 @process_file(i32* %102, i8* %108)
br label %97
110: ; preds = %97
%111 = load i32, i32* %9
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %116
113: ; preds = %110
%114 = load i32*, i32** %15
%115 = call i32 @fclose(i32* %114)
br label %116
116: ; preds = %113, %110
br label %117
117: ; preds = %116, %79
br label %118
118: ; preds = %117, %77
br label %119
119: ; preds = %118, %71
ret i32 0
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
@main.long_opts = internal global [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 115 }, %struct.option { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0), i8 -127, i32* null, i32 99 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8 -127, i32* null, i32 101 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0), i8 -127, i32* null, i32 117 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 -127, i32* null, i32 104 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"spec\00"
@.str.1 = [12 x i8] c"create-spec\00"
@.str.2 = [8 x i8] c"extract\00"
@.str.3 = [7 x i8] c"update\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [7 x i8] c"s:ceuh\00"
@.str.6 = [14 x i8] c"Have %c (%d)\0A\00"
@optarg = global i8* null
@.str.7 = [9 x i8] c"spec.txt\00"
@.str.8 = [2 x i8] c"w\00"
@.str.9 = [23 x i8] c"Can't open file '%s'.\0A\00"
@stdout = global i32* null
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @ltr_int_check_root()
%6 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %struct.option* getelementptr inbounds ([6 x %struct.option], [6 x %struct.option]* @main.long_opts, i64 0, i64 0), i32* %3)
%7 = icmp slt i32 %6, 0
br i1 %7, label %93, label %8
8: ; preds = %2, %28
%9 = phi i32 [ %34, %28 ], [ %6, %2 ]
%10 = phi i32 [ %33, %28 ], [ 0, %2 ]
%11 = phi i8* [ %32, %28 ], [ null, %2 ]
%12 = phi i32 [ %31, %28 ], [ 0, %2 ]
%13 = phi i32 [ %30, %28 ], [ 0, %2 ]
%14 = phi i32 [ %29, %28 ], [ 0, %2 ]
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %9, i32 %9)
switch i32 %9, label %28 [
i32 99, label %16
i32 101, label %17
i32 117, label %18
i32 115, label %19
i32 104, label %24
]
16: ; preds = %8
br label %28
17: ; preds = %8
br label %28
18: ; preds = %8
br label %28
19: ; preds = %8
%20 = load i8*, i8** @optarg
%21 = icmp eq i8* %20, null
%22 = select i1 %21, i32 %12, i32 1
%23 = select i1 %21, i8* %11, i8* %20
br label %24
24: ; preds = %19, %8
%25 = phi i32 [ %12, %8 ], [ %22, %19 ]
%26 = phi i8* [ %11, %8 ], [ %23, %19 ]
%27 = call i32 (...) @print_help()
br label %28
28: ; preds = %8, %24, %18, %17, %16
%29 = phi i32 [ %14, %8 ], [ %14, %24 ], [ 1, %18 ], [ %14, %17 ], [ %14, %16 ]
%30 = phi i32 [ %13, %8 ], [ %13, %24 ], [ %13, %18 ], [ %13, %17 ], [ 1, %16 ]
%31 = phi i32 [ %12, %8 ], [ %25, %24 ], [ %12, %18 ], [ %12, %17 ], [ %12, %16 ]
%32 = phi i8* [ %11, %8 ], [ %26, %24 ], [ %11, %18 ], [ %11, %17 ], [ %11, %16 ]
%33 = phi i32 [ %10, %8 ], [ %10, %24 ], [ %10, %18 ], [ 1, %17 ], [ %10, %16 ]
%34 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %struct.option* getelementptr inbounds ([6 x %struct.option], [6 x %struct.option]* @main.long_opts, i64 0, i64 0), i32* %3)
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %8
36: ; preds = %28
%37 = icmp eq i32 %33, 0
br i1 %37, label %62, label %38
38: ; preds = %36
%39 = icmp eq i32 %31, 0
br i1 %39, label %42, label %40
40: ; preds = %38
%41 = call i8* @ltr_int_my_strdup(i8* %32)
br label %44
42: ; preds = %38
%43 = call i8* @ltr_int_get_data_path(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
%45 = phi i8* [ %41, %40 ], [ %43, %42 ]
%46 = call i32 @read_spec(i8* %45)
%47 = call i32 @free(i8* %45)
%48 = call i32 (...) @print_spec_list()
%49 = icmp sgt i32 %0, 2
br i1 %49, label %50, label %59
50: ; preds = %44
%51 = zext i32 %0 to i64
br label %52
52: ; preds = %50, %52
%53 = phi i64 [ 2, %50 ], [ %54, %52 ]
%54 = add nuw nsw i64 %53, 1
%55 = getelementptr inbounds i8*, i8** %1, i64 %53
%56 = load i8*, i8** %55
%57 = call i32 @open_file_to_search(i8* %56)
%58 = icmp eq i64 %54, %51
br i1 %58, label %59, label %52
59: ; preds = %52, %44
%60 = call i32 (...) @check_missed()
%61 = call i32 (...) @free_specs()
br label %93
62: ; preds = %36
%63 = icmp eq i32 %29, 0
br i1 %63, label %66, label %64
64: ; preds = %62
%65 = call i32 (...) @update_gamedata()
br label %93
66: ; preds = %62
%67 = icmp eq i32 %30, 0
br i1 %67, label %93, label %68
68: ; preds = %66
%69 = icmp eq i32 %31, 0
br i1 %69, label %75, label %70
70: ; preds = %68
%71 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %32)
br label %77
75: ; preds = %68
%76 = load i32*, i32** @stdout
br label %77
77: ; preds = %70, %73, %75
%78 = phi i32* [ null, %73 ], [ %71, %70 ], [ %76, %75 ]
%79 = load i32, i32* @optind
%80 = icmp slt i32 %79, %0
br i1 %80, label %81, label %90
81: ; preds = %77, %81
%82 = phi i32 [ %88, %81 ], [ %79, %77 ]
%83 = add nsw i32 %82, 1
store i32 %83, i32* @optind
%84 = sext i32 %82 to i64
%85 = getelementptr inbounds i8*, i8** %1, i64 %84
%86 = load i8*, i8** %85
%87 = call i32 @process_file(i32* %78, i8* %86)
%88 = load i32, i32* @optind
%89 = icmp slt i32 %88, %0
br i1 %89, label %81, label %90
90: ; preds = %81, %77
br i1 %69, label %93, label %91
91: ; preds = %90
%92 = call i32 @fclose(i32* %78)
br label %93
93: ; preds = %2, %90, %91, %64, %66, %59
ret i32 0
}