#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 void FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
int find_load_filename(char *const, char *);
int find_option(char *const);
int find_parameter_count(int, char *const *, int);
void *fopen(char *, char *);
int /*<<< orphan*/ read_options(void *, char **, int *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *const);
char *strdup(char *const);
int /*<<< orphan*/ throw_error(char *, char *);
int load_command_line(int argc, char *const argv[], char *command_line[]) {
  int i, j, argc_new, option_index, parameter_count;
  char filename[200], alternative_filename[500];
  FILE *fp;
  argc_new = 0;
  command_line[argc_new++] = strdup(argv[0]);
  if ((fp = fopen(".xbattle", "r")) == ((void *)0)) {
  }
  if (fp) {
    read_options(fp, command_line, &argc_new);
    fclose(fp);
  }
  for (i = 1; i < argc; i++) {
    option_index = find_option(argv[i]);
    if (option_index < 0)
      option_index = find_load_filename(argv[i], filename);
    else
      filename[0] = '\0';
    parameter_count = find_parameter_count(argc, argv, i);
    if (option_index == 58) {
      if (parameter_count == 0) {
        if (filename[0] == '\0')
          strcpy(filename, "default.xbo");
      } else
        strcpy(filename, argv[i + 1]);
      if ((fp = fopen(filename, "r")) == ((void *)0)) {
        sprintf(alternative_filename, "%s/%s", "./xbos", filename);
        if ((fp = fopen(alternative_filename, "r")) == ((void *)0))
          throw_error("Cannot open option file %s", filename);
      }
      read_options(fp, command_line, &argc_new);
      fclose(fp);
    } else {
      command_line[argc_new++] = strdup(argv[i]);
      for (j = 0; j < parameter_count; j++)
        command_line[argc_new++] = strdup(argv[i + j + 1]);
    }
    i += parameter_count;
  }
  return (argc_new);
}


x86 assembly (clang, -O0):
<load_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x310,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
lea    0xe17(%rip),%rdi
lea    0xe19(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x308(%rbp)
cmp    $0x0,%rax
jne    120b <load_command_line+0x6b>
jmp    120b <load_command_line+0x6b>
cmpq   $0x0,-0x308(%rbp)
je     1239 <load_command_line+0x99>
mov    -0x308(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1030 <read_options@plt>
mov    -0x308(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    143b <load_command_line+0x29b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <find_option@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jge    128a <load_command_line+0xea>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x100(%rbp),%rsi
call   1080 <find_load_filename@plt>
mov    %eax,-0x28(%rbp)
jmp    1291 <load_command_line+0xf1>
movb   $0x0,-0x100(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1070 <find_parameter_count@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x3a,-0x28(%rbp)
jne    13a2 <load_command_line+0x202>
cmpl   $0x0,-0x2c(%rbp)
jne    12df <load_command_line+0x13f>
movsbl -0x100(%rbp),%eax
cmp    $0x0,%eax
jne    12da <load_command_line+0x13a>
lea    -0x100(%rbp),%rdi
lea    0xd36(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12fc <load_command_line+0x15c>
lea    -0x100(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
lea    -0x100(%rbp),%rdi
lea    0xcff(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x308(%rbp)
cmp    $0x0,%rax
jne    137d <load_command_line+0x1dd>
lea    -0x300(%rbp),%rdi
lea    -0x100(%rbp),%rcx
lea    0xce2(%rip),%rsi
lea    0xce1(%rip),%rdx
call   10b0 <sprintf@plt>
lea    -0x300(%rbp),%rdi
lea    0xcba(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x308(%rbp)
cmp    $0x0,%rax
jne    1378 <load_command_line+0x1d8>
lea    -0x100(%rbp),%rsi
lea    0xcb1(%rip),%rdi
call   10a0 <throw_error@plt>
jmp    137d <load_command_line+0x1dd>
mov    -0x308(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1030 <read_options@plt>
mov    -0x308(%rbp),%rdi
call   1060 <fclose@plt>
jmp    1424 <load_command_line+0x284>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    141f <load_command_line+0x27f>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13d3 <load_command_line+0x233>
jmp    1424 <load_command_line+0x284>
mov    -0x2c(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1240 <load_command_line+0xa0>
mov    -0x24(%rbp),%eax
add    $0x310,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_command_line>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2f8,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebx
mov    (%rsi),%rdi
call   10c0 <strdup@plt>
movl   $0x1,0xc(%rsp)
mov    %rax,(%r14)
lea    0xe2d(%rip),%rdi
lea    0xe2f(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     11ff <load_command_line+0x5f>
mov    %rax,%rbp
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <read_options@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    %r14,0x10(%rsp)
cmp    $0x2,%ebx
jl     13d3 <load_command_line+0x233>
mov    $0x1,%ebp
mov    %ebx,0x1c(%rsp)
jmp    1253 <load_command_line+0xb3>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
lea    0xc(%rsp),%rdx
call   1030 <read_options@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    0x28(%rsp),%rbp
mov    0x20(%rsp),%rax
add    %eax,%ebp
add    $0x1,%ebp
mov    0x1c(%rsp),%ebx
cmp    %ebx,%ebp
jge    13d3 <load_command_line+0x233>
movslq %ebp,%r14
mov    (%r15,%r14,8),%rdi
call   1050 <find_option@plt>
test   %eax,%eax
js     1270 <load_command_line+0xd0>
mov    %eax,%r12d
movb   $0x0,0x30(%rsp)
jmp    1281 <load_command_line+0xe1>
nopl   (%rax)
mov    (%r15,%r14,8),%rdi
lea    0x30(%rsp),%rsi
call   1080 <find_load_filename@plt>
mov    %eax,%r12d
mov    %ebx,%edi
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <find_parameter_count@plt>
mov    %eax,%ebx
cmp    $0x3a,%r12d
mov    %rbp,0x28(%rsp)
mov    %rbx,0x20(%rsp)
jne    12d0 <load_command_line+0x130>
test   %ebx,%ebx
je     134a <load_command_line+0x1aa>
mov    0x8(%r15,%r14,8),%rsi
mov    0x10(%rsp),%r14
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
jmp    1366 <load_command_line+0x1c6>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%r14,8),%rdi
call   10c0 <strdup@plt>
movslq 0xc(%rsp),%rcx
lea    0x1(%rcx),%edx
mov    %edx,0xc(%rsp)
mov    0x10(%rsp),%rsi
mov    %rax,(%rsi,%rcx,8)
test   %ebx,%ebx
jle    1238 <load_command_line+0x98>
mov    0x20(%rsp),%r12d
lea    0x2(%rcx),%ebx
movslq %edx,%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%rbp
mov    0x28(%rsp),%rax
lea    0x1(%rax),%r13d
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
lea    (%r14,%r13,1),%eax
cltq
mov    (%r15,%rax,8),%rdi
call   10c0 <strdup@plt>
lea    (%rbx,%r14,1),%ecx
mov    %ecx,0xc(%rsp)
mov    %rax,0x0(%rbp,%r14,8)
add    $0x1,%r14
cmp    %r14,%r12
jne    1320 <load_command_line+0x180>
jmp    1238 <load_command_line+0x98>
cmpb   $0x0,0x30(%rsp)
lea    0xcb5(%rip),%rsi
mov    0x10(%rsp),%r14
lea    0x30(%rsp),%rbx
je     12b6 <load_command_line+0x116>
mov    %rbx,%rdi
lea    0xc99(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1220 <load_command_line+0x80>
lea    0x100(%rsp),%rbp
mov    %rbp,%rdi
lea    0xc84(%rip),%rsi
lea    0xc83(%rip),%rdx
mov    %rbx,%rcx
call   10b0 <sprintf@plt>
mov    %rbp,%rdi
lea    0xc5d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1220 <load_command_line+0x80>
lea    0xc60(%rip),%rdi
mov    %rbx,%rsi
call   10a0 <throw_error@plt>
xor    %ebp,%ebp
jmp    1220 <load_command_line+0x80>
mov    0xc(%rsp),%eax
add    $0x2f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c".xbattle\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"default.xbo\00"
@.str.3 = [6 x i8] c"%s/%s\00"
@.str.4 = [7 x i8] c"./xbos\00"
@.str.5 = [27 x i8] c"Cannot open option file %s\00"
define i32 @load_command_line(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [200 x i8]
%13 = alloca [500 x i8]
%14 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
store i32 0, i32* %9
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i8* @strdup(i8* %17)
%19 = load i8**, i8*** %6
%20 = load i32, i32* %9
%21 = add nsw i32 %20, 1
store i32 %21, i32* %9
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds i8*, i8** %19, i64 %22
store i8* %18, i8** %23
%24 = call i8* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %24, i8** %14
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %27
26: ; preds = %3
br label %27
27: ; preds = %26, %3
%28 = load i8*, i8** %14
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i8*, i8** %14
%32 = load i8**, i8*** %6
%33 = call i32 @read_options(i8* %31, i8** %32, i32* %9)
%34 = load i8*, i8** %14
%35 = call i32 @fclose(i8* %34)
br label %36
36: ; preds = %30, %27
store i32 1, i32* %7
br label %37
37: ; preds = %148, %36
%38 = load i32, i32* %7
%39 = load i32, i32* %4
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %151
41: ; preds = %37
%42 = load i8**, i8*** %5
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @find_option(i8* %46)
store i32 %47, i32* %10
%48 = load i32, i32* %10
%49 = icmp slt i32 %48, 0
br i1 %49, label %50, label %58
50: ; preds = %41
%51 = load i8**, i8*** %5
%52 = load i32, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %51, i64 %53
%55 = load i8*, i8** %54
%56 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%57 = call i32 @find_load_filename(i8* %55, i8* %56)
store i32 %57, i32* %10
br label %60
58: ; preds = %41
%59 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
store i8 0, i8* %59
br label %60
60: ; preds = %58, %50
%61 = load i32, i32* %4
%62 = load i8**, i8*** %5
%63 = load i32, i32* %7
%64 = call i32 @find_parameter_count(i32 %61, i8** %62, i32 %63)
store i32 %64, i32* %11
%65 = load i32, i32* %10
%66 = icmp eq i32 %65, 58
br i1 %66, label %67, label %109
67: ; preds = %60
%68 = load i32, i32* %11
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %79
70: ; preds = %67
%71 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %70
%76 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%77 = call i32 @strcpy(i8* %76, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %78
78: ; preds = %75, %70
br label %88
79: ; preds = %67
%80 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%81 = load i8**, i8*** %5
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8*, i8** %81, i64 %84
%86 = load i8*, i8** %85
%87 = call i32 @strcpy(i8* %80, i8* %86)
br label %88
88: ; preds = %79, %78
%89 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%90 = call i8* @fopen(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %90, i8** %14
%91 = icmp eq i8* %90, null
br i1 %91, label %92, label %103
92: ; preds = %88
%93 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 0
%94 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%95 = call i32 @sprintf(i8* %93, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %94)
%96 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 0
%97 = call i8* @fopen(i8* %96, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %97, i8** %14
%98 = icmp eq i8* %97, null
br i1 %98, label %99, label %102
99: ; preds = %92
%100 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%101 = call i32 @throw_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %99, %92
br label %103
103: ; preds = %102, %88
%104 = load i8*, i8** %14
%105 = load i8**, i8*** %6
%106 = call i32 @read_options(i8* %104, i8** %105, i32* %9)
%107 = load i8*, i8** %14
%108 = call i32 @fclose(i8* %107)
br label %144
109: ; preds = %60
%110 = load i8**, i8*** %5
%111 = load i32, i32* %7
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %110, i64 %112
%114 = load i8*, i8** %113
%115 = call i8* @strdup(i8* %114)
%116 = load i8**, i8*** %6
%117 = load i32, i32* %9
%118 = add nsw i32 %117, 1
store i32 %118, i32* %9
%119 = sext i32 %117 to i64
%120 = getelementptr inbounds i8*, i8** %116, i64 %119
store i8* %115, i8** %120
store i32 0, i32* %8
br label %121
121: ; preds = %140, %109
%122 = load i32, i32* %8
%123 = load i32, i32* %11
%124 = icmp slt i32 %122, %123
br i1 %124, label %125, label %143
125: ; preds = %121
%126 = load i8**, i8*** %5
%127 = load i32, i32* %7
%128 = load i32, i32* %8
%129 = add nsw i32 %127, %128
%130 = add nsw i32 %129, 1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8*, i8** %126, i64 %131
%133 = load i8*, i8** %132
%134 = call i8* @strdup(i8* %133)
%135 = load i8**, i8*** %6
%136 = load i32, i32* %9
%137 = add nsw i32 %136, 1
store i32 %137, i32* %9
%138 = sext i32 %136 to i64
%139 = getelementptr inbounds i8*, i8** %135, i64 %138
store i8* %134, i8** %139
br label %140
140: ; preds = %125
%141 = load i32, i32* %8
%142 = add nsw i32 %141, 1
store i32 %142, i32* %8
br label %121
143: ; preds = %121
br label %144
144: ; preds = %143, %103
%145 = load i32, i32* %11
%146 = load i32, i32* %7
%147 = add nsw i32 %146, %145
store i32 %147, i32* %7
br label %148
148: ; preds = %144
%149 = load i32, i32* %7
%150 = add nsw i32 %149, 1
store i32 %150, i32* %7
br label %37
151: ; preds = %37
%152 = load i32, i32* %9
ret i32 %152
}

LLVM IR (-O2):
@.str = [9 x i8] c".xbattle\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"default.xbo\00"
@.str.3 = [6 x i8] c"%s/%s\00"
@.str.4 = [7 x i8] c"./xbos\00"
@.str.5 = [27 x i8] c"Cannot open option file %s\00"
define i32 @load_command_line(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca [200 x i8]
%6 = alloca [500 x i8]
%7 = bitcast i32* %4 to i8*
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%10 = load i8*, i8** %1
%11 = tail call i8* @strdup(i8* %10)
store i32 1, i32* %4
store i8* %11, i8** %2
%12 = tail call i8* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %3
%15 = call i32 @read_options(i8* %12, i8** %2, i32* %4)
%16 = call i32 @fclose(i8* %12)
br label %17
17: ; preds = %14, %3
%18 = icmp sgt i32 %0, 1
br i1 %18, label %19, label %89
19: ; preds = %17, %85
%20 = phi i32 [ %87, %85 ], [ 1, %17 ]
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %1, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @find_option(i8* %23)
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load i8*, i8** %22
%28 = call i32 @find_load_filename(i8* %27, i8* %8)
br label %30
29: ; preds = %19
store i8 0, i8* %8
br label %30
30: ; preds = %29, %26
%31 = phi i32 [ %28, %26 ], [ %24, %29 ]
%32 = call i32 @find_parameter_count(i32 %0, i8** %1, i32 %20)
%33 = icmp eq i32 %31, 58
br i1 %33, label %34, label %60
34: ; preds = %30
%35 = icmp eq i32 %32, 0
br i1 %35, label %36, label %39
36: ; preds = %34
%37 = load i8, i8* %8
%38 = icmp eq i8 %37, 0
br i1 %38, label %44, label %47
39: ; preds = %34
%40 = add nsw i32 %20, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %1, i64 %41
%43 = load i8*, i8** %42
br label %44
44: ; preds = %36, %39
%45 = phi i8* [ %43, %39 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %36 ]
%46 = call i32 @strcpy(i8* %8, i8* %45)
br label %47
47: ; preds = %44, %36
%48 = call i8* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %56
50: ; preds = %47
%51 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%52 = call i8* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%53 = icmp eq i8* %52, null
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = call i32 @throw_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %8)
br label %56
56: ; preds = %50, %54, %47
%57 = phi i8* [ null, %54 ], [ %52, %50 ], [ %48, %47 ]
%58 = call i32 @read_options(i8* %57, i8** %2, i32* %4)
%59 = call i32 @fclose(i8* %57)
br label %85
60: ; preds = %30
%61 = load i8*, i8** %22
%62 = call i8* @strdup(i8* %61)
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
store i32 %64, i32* %4
%65 = sext i32 %63 to i64
%66 = getelementptr inbounds i8*, i8** %2, i64 %65
store i8* %62, i8** %66
%67 = icmp sgt i32 %32, 0
br i1 %67, label %68, label %85
68: ; preds = %60
%69 = add nsw i32 %20, 1
%70 = zext i32 %32 to i64
br label %71
71: ; preds = %68, %71
%72 = phi i32 [ %64, %68 ], [ %80, %71 ]
%73 = phi i64 [ 0, %68 ], [ %83, %71 ]
%74 = trunc i64 %73 to i32
%75 = add i32 %69, %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %1, i64 %76
%78 = load i8*, i8** %77
%79 = call i8* @strdup(i8* %78)
%80 = add nsw i32 %72, 1
store i32 %80, i32* %4
%81 = sext i32 %72 to i64
%82 = getelementptr inbounds i8*, i8** %2, i64 %81
store i8* %79, i8** %82
%83 = add nuw nsw i64 %73, 1
%84 = icmp eq i64 %83, %70
br i1 %84, label %85, label %71
85: ; preds = %71, %60, %56
%86 = add i32 %20, 1
%87 = add i32 %86, %32
%88 = icmp slt i32 %87, %0
br i1 %88, label %19, label %89
89: ; preds = %85, %17
%90 = load i32, i32* %4
ret i32 %90
}