#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 /*<<< orphan*/ EXIT_FAILURE;
int IPS_apply(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
void parse_cli_patch(char **argv) {
  char *current_arg = *(argv++);
  if (!current_arg || current_arg == 0) {
    fprintf(stderr, "Argument error: %s\n\n",
            "Expected patch-type! only 'ips' is supported");
    exit(EXIT_FAILURE);
  };
  char *patch_type = current_arg;
  char *patch_method;
  if (strcmp(patch_type, "ips") != 0) {
    fprintf(stderr, "Patch-type '%s' is not supported. Please use '%s'\n\n",
            patch_type, "ips");
    exit(EXIT_FAILURE);
  }
  current_arg = *(argv++);
  if (!current_arg || current_arg == 0) {
    fprintf(stderr, "Argument error: %s\n\n",
            "Expected patch method (apply or create)!");
    exit(EXIT_FAILURE);
  };
  patch_method = current_arg;
  if (strcmp(patch_method, "apply") == 0) {
    current_arg = *(argv++);
    if (!current_arg || current_arg == 0) {
      fprintf(stderr, "Argument error: %s\n\n", "Expected patch file!");
      exit(EXIT_FAILURE);
    };
    FILE *patch = NULL;
    if (!(patch = fopen(current_arg, "r"))) {
      perror(current_arg);
      exit(EXIT_FAILURE);
    }
    while ((current_arg = *(argv++)) != NULL) {
      FILE *rom_file = NULL;
      if (!(rom_file = fopen(current_arg, "r+"))) {
        perror(current_arg);
        continue;
      }
      int err = 0;
      if ((err = IPS_apply(rom_file, patch)) <= 0) {
        fprintf(stderr,
                "An error occurred while applying the patch to %s (%d)!\n\n",
                current_arg, err);
        fclose(rom_file);
        continue;
      }
      fclose(rom_file);
    }
    fclose(patch);
  } else if (strcmp(patch_method, "create") == 0) {
    fprintf(stderr, "Creating patches is not yet implemented.\n\n");
    exit(EXIT_FAILURE);
  } else {
    fprintf(stderr,
            "Unknown patch method '%s'! Please use either '%s' or '%s'\n\n",
            patch_method, "apply", "create");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<parse_cli_patch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a8 <parse_cli_patch+0x38>
cmpq   $0x0,-0x10(%rbp)
jne    11d4 <parse_cli_patch+0x64>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    0xe48(%rip),%rsi
lea    0xe56(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1226 <parse_cli_patch+0xb6>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe3c(%rip),%rsi
lea    0xe31(%rip),%rcx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1252 <parse_cli_patch+0xe2>
cmpq   $0x0,-0x10(%rbp)
jne    127e <parse_cli_patch+0x10e>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
lea    0xd9e(%rip),%rsi
lea    0xe11(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe12(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13f6 <parse_cli_patch+0x286>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     12cc <parse_cli_patch+0x15c>
cmpq   $0x0,-0x10(%rbp)
jne    12f8 <parse_cli_patch+0x188>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
lea    0xd24(%rip),%rsi
lea    0xdc6(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2ce7(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xdb3(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1335 <parse_cli_patch+0x1c5>
mov    -0x10(%rbp),%rdi
call   1070 <perror@plt>
mov    0x2caa(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    133a <parse_cli_patch+0x1ca>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     13e8 <parse_cli_patch+0x278>
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd53(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    138e <parse_cli_patch+0x21e>
mov    -0x10(%rbp),%rdi
call   1070 <perror@plt>
jmp    133a <parse_cli_patch+0x1ca>
movl   $0x0,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <IPS_apply@plt>
mov    %eax,-0x34(%rbp)
cmp    $0x0,%eax
jg     13da <parse_cli_patch+0x26a>
mov    0x2c2b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x34(%rbp),%ecx
lea    0xcfe(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
jmp    133a <parse_cli_patch+0x1ca>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
jmp    133a <parse_cli_patch+0x1ca>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
jmp    146c <parse_cli_patch+0x2fc>
mov    -0x20(%rbp),%rdi
lea    0xcfb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1435 <parse_cli_patch+0x2c5>
mov    0x2bc9(%rip),%rax
mov    (%rax),%edi
lea    0xce3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2baa(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    0x2ba4(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xce5(%rip),%rsi
lea    0xc53(%rip),%rcx
lea    0xca5(%rip),%r8
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b73(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_cli_patch>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     1281 <parse_cli_patch+0x111>
mov    %rdi,%r13
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    129d <parse_cli_patch+0x12d>
mov    0x8(%r13),%rbx
test   %rbx,%rbx
je     12c3 <parse_cli_patch+0x153>
lea    0xeed(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    12dc <parse_cli_patch+0x16c>
mov    0x10(%r13),%rbx
test   %rbx,%rbx
je     1309 <parse_cli_patch+0x199>
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1060 <fopen@plt>
test   %rax,%rax
je     1329 <parse_cli_patch+0x1b9>
mov    %rax,%r14
mov    0x18(%r13),%rbx
test   %rbx,%rbx
je     126b <parse_cli_patch+0xfb>
add    $0x20,%r13
lea    0xebd(%rip),%r15
lea    0xeb9(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1261 <parse_cli_patch+0xf1>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r14,%rsi
call   1090 <IPS_apply@plt>
test   %eax,%eax
jg     124a <parse_cli_patch+0xda>
mov    0x2da7(%rip),%rcx
mov    (%rcx),%edi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    0x0(%r13),%rbx
add    $0x8,%r13
test   %rbx,%rbx
jne    1210 <parse_cli_patch+0xa0>
jmp    126b <parse_cli_patch+0xfb>
mov    %rbx,%rdi
call   1070 <perror@plt>
jmp    1252 <parse_cli_patch+0xe2>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    0xd6f(%rip),%rsi
lea    0xd7d(%rip),%rdx
jmp    1320 <parse_cli_patch+0x1b0>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    0xd99(%rip),%rsi
lea    0xd8e(%rip),%rcx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1352 <parse_cli_patch+0x1e2>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
lea    0xd2d(%rip),%rsi
lea    0xda0(%rip),%rdx
jmp    1320 <parse_cli_patch+0x1b0>
lea    0xe19(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    0x2cee(%rip),%rcx
mov    (%rcx),%edi
test   %rax,%rax
jne    1333 <parse_cli_patch+0x1c3>
lea    0xe03(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1352 <parse_cli_patch+0x1e2>
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
lea    0xce7(%rip),%rsi
lea    0xd89(%rip),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1352 <parse_cli_patch+0x1e2>
mov    %rbx,%rdi
call   1070 <perror@plt>
jmp    1352 <parse_cli_patch+0x1e2>
lea    0xdf4(%rip),%rsi
lea    0xd62(%rip),%rcx
lea    0xdb4(%rip),%r8
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2c7f(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Argument error: %s\0A\0A\00"
@.str.1 = [45 x i8] c"Expected patch-type! only 'ips' is supported\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [4 x i8] c"ips\00"
@.str.3 = [52 x i8] c"Patch-type '%s' is not supported. Please use '%s'\0A\0A\00"
@.str.4 = [41 x i8] c"Expected patch method (apply or create)!\00"
@.str.5 = [6 x i8] c"apply\00"
@.str.6 = [21 x i8] c"Expected patch file!\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [3 x i8] c"r+\00"
@.str.9 = [57 x i8] c"An error occurred while applying the patch to %s (%d)!\0A\0A\00"
@.str.10 = [7 x i8] c"create\00"
@.str.11 = [43 x i8] c"Creating patches is not yet implemented.\0A\0A\00"
@.str.12 = [60 x i8] c"Unknown patch method '%s'! Please use either '%s' or '%s'\0A\0A\00"
define void @parse_cli_patch(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i8** %0, i8*** %2
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %2
%11 = load i8*, i8** %9
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %14, %1
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %14
%23 = load i8*, i8** %3
store i8* %23, i8** %4
%24 = load i8*, i8** %4
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = load i32, i32* @stderr
%29 = load i8*, i8** %4
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %22
%34 = load i8**, i8*** %2
%35 = getelementptr inbounds i8*, i8** %34, i32 1
store i8** %35, i8*** %2
%36 = load i8*, i8** %34
store i8* %36, i8** %3
%37 = load i8*, i8** %3
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %42
39: ; preds = %33
%40 = load i8*, i8** %3
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %47
42: ; preds = %39, %33
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %39
%48 = load i8*, i8** %3
store i8* %48, i8** %5
%49 = load i8*, i8** %5
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %106
52: ; preds = %47
%53 = load i8**, i8*** %2
%54 = getelementptr inbounds i8*, i8** %53, i32 1
store i8** %54, i8*** %2
%55 = load i8*, i8** %53
store i8* %55, i8** %3
%56 = load i8*, i8** %3
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %61
58: ; preds = %52
%59 = load i8*, i8** %3
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %66
61: ; preds = %58, %52
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%64 = load i32, i32* @EXIT_FAILURE
%65 = call i32 @exit(i32 %64)
unreachable
66: ; preds = %58
store i32* null, i32** %6
%67 = load i8*, i8** %3
%68 = call i32* @fopen(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %68, i32** %6
%69 = icmp ne i32* %68, null
br i1 %69, label %75, label %70
70: ; preds = %66
%71 = load i8*, i8** %3
%72 = call i32 @perror(i8* %71)
%73 = load i32, i32* @EXIT_FAILURE
%74 = call i32 @exit(i32 %73)
unreachable
75: ; preds = %66
br label %76
76: ; preds = %100, %93, %85, %75
%77 = load i8**, i8*** %2
%78 = getelementptr inbounds i8*, i8** %77, i32 1
store i8** %78, i8*** %2
%79 = load i8*, i8** %77
store i8* %79, i8** %3
%80 = icmp ne i8* %79, null
br i1 %80, label %81, label %103
81: ; preds = %76
store i32* null, i32** %7
%82 = load i8*, i8** %3
%83 = call i32* @fopen(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %83, i32** %7
%84 = icmp ne i32* %83, null
br i1 %84, label %88, label %85
85: ; preds = %81
%86 = load i8*, i8** %3
%87 = call i32 @perror(i8* %86)
br label %76
88: ; preds = %81
store i32 0, i32* %8
%89 = load i32*, i32** %7
%90 = load i32*, i32** %6
%91 = call i32 @IPS_apply(i32* %89, i32* %90)
store i32 %91, i32* %8
%92 = icmp sle i32 %91, 0
br i1 %92, label %93, label %100
93: ; preds = %88
%94 = load i32, i32* @stderr
%95 = load i8*, i8** %3
%96 = load i32, i32* %8
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i8* %95, i32 %96)
%98 = load i32*, i32** %7
%99 = call i32 @fclose(i32* %98)
br label %76
100: ; preds = %88
%101 = load i32*, i32** %7
%102 = call i32 @fclose(i32* %101)
br label %76
103: ; preds = %76
%104 = load i32*, i32** %6
%105 = call i32 @fclose(i32* %104)
br label %121
106: ; preds = %47
%107 = load i8*, i8** %5
%108 = call i64 @strcmp(i8* %107, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %115
110: ; preds = %106
%111 = load i32, i32* @stderr
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
%113 = load i32, i32* @EXIT_FAILURE
%114 = call i32 @exit(i32 %113)
unreachable
115: ; preds = %106
%116 = load i32, i32* @stderr
%117 = load i8*, i8** %5
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.12, i64 0, i64 0), i8* %117, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%119 = load i32, i32* @EXIT_FAILURE
%120 = call i32 @exit(i32 %119)
unreachable
121: ; preds = %103
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Argument error: %s\0A\0A\00"
@.str.1 = [45 x i8] c"Expected patch-type! only 'ips' is supported\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [4 x i8] c"ips\00"
@.str.3 = [52 x i8] c"Patch-type '%s' is not supported. Please use '%s'\0A\0A\00"
@.str.4 = [41 x i8] c"Expected patch method (apply or create)!\00"
@.str.5 = [6 x i8] c"apply\00"
@.str.6 = [21 x i8] c"Expected patch file!\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [3 x i8] c"r+\00"
@.str.9 = [57 x i8] c"An error occurred while applying the patch to %s (%d)!\0A\0A\00"
@.str.10 = [7 x i8] c"create\00"
@.str.11 = [43 x i8] c"Creating patches is not yet implemented.\0A\0A\00"
@.str.12 = [60 x i8] c"Unknown patch method '%s'! Please use either '%s' or '%s'\0A\0A\00"
define void @parse_cli_patch(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
18: ; preds = %10
%19 = getelementptr inbounds i8*, i8** %0, i64 2
%20 = load i8*, i8** %2
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = tail call i32 @exit(i32 %25)
unreachable
27: ; preds = %18
%28 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %73
30: ; preds = %27
%31 = load i8*, i8** %19
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%36 = load i32, i32* @EXIT_FAILURE
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %30
%39 = tail call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%40 = icmp eq i32* %39, null
br i1 %40, label %47, label %41
41: ; preds = %38
%42 = getelementptr inbounds i8*, i8** %0, i64 3
%43 = load i8*, i8** %42
%44 = icmp eq i8* %43, null
br i1 %44, label %71, label %45
45: ; preds = %41
%46 = getelementptr inbounds i8*, i8** %0, i64 4
br label %51
47: ; preds = %38
%48 = tail call i32 @perror(i8* %31)
%49 = load i32, i32* @EXIT_FAILURE
%50 = tail call i32 @exit(i32 %49)
unreachable
51: ; preds = %45, %67
%52 = phi i8* [ %69, %67 ], [ %43, %45 ]
%53 = phi i8** [ %68, %67 ], [ %46, %45 ]
%54 = tail call i32* @fopen(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = tail call i32 @perror(i8* %52)
br label %67
58: ; preds = %51
%59 = tail call i32 @IPS_apply(i32* %54, i32* %39)
%60 = icmp slt i32 %59, 1
br i1 %60, label %61, label %65
61: ; preds = %58
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i8* %52, i32 %59)
%64 = tail call i32 @fclose(i32* %54)
br label %67
65: ; preds = %58
%66 = tail call i32 @fclose(i32* %54)
br label %67
67: ; preds = %61, %65, %56
%68 = getelementptr inbounds i8*, i8** %53, i64 1
%69 = load i8*, i8** %53
%70 = icmp eq i8* %69, null
br i1 %70, label %71, label %51
71: ; preds = %67, %41
%72 = tail call i32 @fclose(i32* %39)
ret void
73: ; preds = %27
%74 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
%76 = load i32, i32* @stderr
br i1 %75, label %77, label %81
77: ; preds = %73
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
%79 = load i32, i32* @EXIT_FAILURE
%80 = tail call i32 @exit(i32 %79)
unreachable
81: ; preds = %73
%82 = tail call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.12, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%83 = load i32, i32* @EXIT_FAILURE
%84 = tail call i32 @exit(i32 %83)
unreachable
}