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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ asprintf(char **, char *, char *, char *, ...);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char **argv) {
  if (argc < 3) {
    printf("%s\n%s\n", "OSMC application-parser",
           "usage: pass two or more JSON files for merging");
    return -1;
  }
  char *json_buffer;
  asprintf(&json_buffer, "%s\n\t%s\n\t%s\n", "{", "\"application\":", "[");
  int json_count = argc - 1;
  int i;
  for (i = 0; i < json_count; i++) {
    FILE *fp;
    int line_count = 0;
    int lines_processed = 1;
    fp = fopen(argv[i + 1], "r");
    if (fp) {
      asprintf(&json_buffer, "%s\t%s\n", json_buffer, "{");
      char line[512];
      while (!feof(fp))
        if (fgets(line, sizeof(line), fp) != NULL)
          line_count += 1;
      fseek(fp, 0, SEEK_SET);
      while (!feof(fp)) {
        if (fgets(line, sizeof(line), fp) != NULL) {
          if (lines_processed != 1 && lines_processed != 2 &&
              lines_processed != 3 && lines_processed != (line_count - 2) &&
              lines_processed != (line_count - 1) &&
              lines_processed != (line_count - 0))
            asprintf(&json_buffer, "%s\t\t%s", json_buffer, line);
          lines_processed++;
        }
      }
      if (i != (json_count - 1))
        asprintf(&json_buffer, "%s\t%s\n", json_buffer, "},");
      else
        asprintf(&json_buffer, "%s\t%s\n", json_buffer, "}");
      fclose(fp);
    } else {
      return -1;
    }
  }
  asprintf(&json_buffer, "%s\t\n%s\n", json_buffer, "]");
  printf("%s\n%s", json_buffer, "}");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11b9 <main+0x49>
lea    0xe66(%rip),%rdi
lea    0xe66(%rip),%rsi
lea    0xe77(%rip),%rdx
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1423 <main+0x2b3>
lea    -0x18(%rbp),%rdi
lea    0xe8a(%rip),%rsi
lea    0xe8f(%rip),%rdx
lea    0xe8a(%rip),%rcx
lea    0xe92(%rip),%r8
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13e8 <main+0x278>
movl   $0x0,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdfb(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     13c9 <main+0x259>
mov    -0x18(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xe28(%rip),%rsi
lea    0xe0e(%rip),%rcx
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    -0x28(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1271 <main+0x101>
jmp    129e <main+0x12e>
lea    -0x230(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x200,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1299 <main+0x129>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1253 <main+0xe3>
mov    -0x28(%rbp),%rdi
mov    0x2d37(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <fseek@plt>
mov    -0x28(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12d0 <main+0x160>
jmp    136b <main+0x1fb>
lea    -0x230(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x200,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1366 <main+0x1f6>
cmpl   $0x1,-0x30(%rbp)
je     135d <main+0x1ed>
cmpl   $0x2,-0x30(%rbp)
je     135d <main+0x1ed>
cmpl   $0x3,-0x30(%rbp)
je     135d <main+0x1ed>
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
je     135d <main+0x1ed>
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     135d <main+0x1ed>
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x0,%ecx
cmp    %ecx,%eax
je     135d <main+0x1ed>
mov    -0x18(%rbp),%rdx
lea    -0x230(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    0xd1e(%rip),%rsi
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12b2 <main+0x142>
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     139e <main+0x22e>
mov    -0x18(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xce2(%rip),%rsi
lea    0xce9(%rip),%rcx
mov    $0x0,%al
call   1080 <asprintf@plt>
jmp    13bb <main+0x24b>
mov    -0x18(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xcc0(%rip),%rsi
lea    0xcca(%rip),%rcx
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
jmp    13d5 <main+0x265>
movl   $0xffffffff,-0x4(%rbp)
jmp    1423 <main+0x2b3>
jmp    13da <main+0x26a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11f0 <main+0x80>
mov    -0x18(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xc89(%rip),%rsi
lea    0xc8a(%rip),%rcx
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    -0x18(%rbp),%rsi
lea    0xc7a(%rip),%rdi
lea    0xc67(%rip),%rdx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
mov    %rsi,0x18(%rsp)
cmp    $0x2,%edi
jg     11af <main+0x3f>
lea    0xe6e(%rip),%rdi
lea    0xe6e(%rip),%rsi
lea    0xe7f(%rip),%rdx
call   1040 <printf@plt>
mov    $0xffffffff,%eax
jmp    139d <main+0x22d>
mov    %edi,%ebp
lea    0xe96(%rip),%rsi
lea    0xe9b(%rip),%rdx
lea    0xe96(%rip),%rcx
lea    0xe9e(%rip),%r8
mov    %rsp,%rdi
xor    %eax,%eax
call   1080 <asprintf@plt>
mov    %ebp,%eax
add    $0xffffffff,%eax
mov    %rax,0x10(%rsp)
je     1368 <main+0x1f8>
add    $0xfffffffe,%ebp
lea    0xe7c(%rip),%rbx
lea    0x30(%rsp),%r13
xor    %r14d,%r14d
mov    %rbp,0x8(%rsp)
jmp    124f <main+0xdf>
mov    0x8(%rsp),%rbp
cmp    %rbp,0x28(%rsp)
mov    (%rsp),%rdx
lea    0xe66(%rip),%rcx
lea    0xe62(%rip),%rax
cmove  %rax,%rcx
mov    %rsp,%rdi
lea    0xe43(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <asprintf@plt>
mov    %r12,%rdi
call   1030 <fclose@plt>
mov    0x20(%rsp),%rax
mov    %rax,%r14
cmp    0x10(%rsp),%rax
je     1368 <main+0x1f8>
mov    0x18(%rsp),%rax
mov    0x8(%rax,%r14,8),%rdi
lea    0xdbd(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     11a5 <main+0x35>
mov    %rax,%r12
mov    (%rsp),%rdx
xor    %ebp,%ebp
mov    %rsp,%rdi
mov    %rbx,%rsi
lea    0xdd6(%rip),%rcx
xor    %eax,%eax
call   1080 <asprintf@plt>
mov    %r12,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    12c3 <main+0x153>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    $0x200,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
mov    %r12,%rdi
call   1060 <feof@plt>
test   %eax,%eax
je     12a0 <main+0x130>
mov    %r14,0x28(%rsp)
lea    0x1(%r14),%rax
mov    %rax,0x20(%rsp)
mov    0x2d08(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1070 <fseek@plt>
mov    %r12,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1200 <main+0x90>
lea    -0x2(%rbp),%r14d
lea    -0x1(%rbp),%r15d
mov    $0x1,%ebx
jmp    1323 <main+0x1b3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %r12,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1200 <main+0x90>
mov    %r13,%rdi
mov    $0x200,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1313 <main+0x1a3>
lea    -0x1(%rbx),%eax
cmp    $0x3,%eax
jb     1310 <main+0x1a0>
cmp    %r14d,%ebx
je     1310 <main+0x1a0>
cmp    %r15d,%ebx
je     1310 <main+0x1a0>
cmp    %ebp,%ebx
je     1310 <main+0x1a0>
mov    (%rsp),%rdx
mov    %rsp,%rdi
lea    0xd18(%rip),%rsi
mov    %r13,%rcx
xor    %eax,%eax
call   1080 <asprintf@plt>
jmp    1310 <main+0x1a0>
mov    (%rsp),%rdx
lea    0xd0d(%rip),%rsi
lea    0xd0e(%rip),%rcx
mov    %rsp,%rdi
xor    %eax,%eax
call   1080 <asprintf@plt>
mov    (%rsp),%rsi
lea    0xcfb(%rip),%rdi
lea    0xce8(%rip),%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [24 x i8] c"OSMC application-parser\00"
@.str.2 = [47 x i8] c"usage: pass two or more JSON files for merging\00"
@.str.3 = [12 x i8] c"%s\0A\09%s\0A\09%s\0A\00"
@.str.4 = [2 x i8] c"{\00"
@.str.5 = [15 x i8] c"\22application\22:\00"
@.str.6 = [2 x i8] c"[\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [7 x i8] c"%s\09%s\0A\00"
@SEEK_SET = global i32 0
@.str.9 = [7 x i8] c"%s\09\09%s\00"
@.str.10 = [3 x i8] c"},\00"
@.str.11 = [2 x i8] c"}\00"
@.str.12 = [8 x i8] c"%s\09\0A%s\0A\00"
@.str.13 = [2 x i8] c"]\00"
@.str.14 = [6 x i8] c"%s\0A%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%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 [512 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %122
17: ; preds = %2
%18 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %7
store i32 0, i32* %8
br label %21
21: ; preds = %114, %17
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %117
25: ; preds = %21
store i32 0, i32* %10
store i32 1, i32* %11
%26 = load i8**, i8*** %5
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %26, i64 %29
%31 = load i8*, i8** %30
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %32, i32** %9
%33 = load i32*, i32** %9
%34 = icmp ne i32* %33, null
br i1 %34, label %35, label %112
35: ; preds = %25
%36 = load i8*, i8** %6
%37 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %51, %35
%39 = load i32*, i32** %9
%40 = call i32 @feof(i32* %39)
%41 = icmp ne i32 %40, 0
%42 = xor i1 %41, true
br i1 %42, label %43, label %52
43: ; preds = %38
%44 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%45 = load i32*, i32** %9
%46 = call i32* @fgets(i8* %44, i32 512, i32* %45)
%47 = icmp ne i32* %46, null
br i1 %47, label %48, label %51
48: ; preds = %43
%49 = load i32, i32* %10
%50 = add nsw i32 %49, 1
store i32 %50, i32* %10
br label %51
51: ; preds = %48, %43
br label %38
52: ; preds = %38
%53 = load i32*, i32** %9
%54 = load i32, i32* @SEEK_SET
%55 = call i32 @fseek(i32* %53, i32 0, i32 %54)
br label %56
56: ; preds = %97, %52
%57 = load i32*, i32** %9
%58 = call i32 @feof(i32* %57)
%59 = icmp ne i32 %58, 0
%60 = xor i1 %59, true
br i1 %60, label %61, label %98
61: ; preds = %56
%62 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%63 = load i32*, i32** %9
%64 = call i32* @fgets(i8* %62, i32 512, i32* %63)
%65 = icmp ne i32* %64, null
br i1 %65, label %66, label %97
66: ; preds = %61
%67 = load i32, i32* %11
%68 = icmp ne i32 %67, 1
br i1 %68, label %69, label %94
69: ; preds = %66
%70 = load i32, i32* %11
%71 = icmp ne i32 %70, 2
br i1 %71, label %72, label %94
72: ; preds = %69
%73 = load i32, i32* %11
%74 = icmp ne i32 %73, 3
br i1 %74, label %75, label %94
75: ; preds = %72
%76 = load i32, i32* %11
%77 = load i32, i32* %10
%78 = sub nsw i32 %77, 2
%79 = icmp ne i32 %76, %78
br i1 %79, label %80, label %94
80: ; preds = %75
%81 = load i32, i32* %11
%82 = load i32, i32* %10
%83 = sub nsw i32 %82, 1
%84 = icmp ne i32 %81, %83
br i1 %84, label %85, label %94
85: ; preds = %80
%86 = load i32, i32* %11
%87 = load i32, i32* %10
%88 = sub nsw i32 %87, 0
%89 = icmp ne i32 %86, %88
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = load i8*, i8** %6
%92 = getelementptr inbounds [512 x i8], [512 x i8]* %12, i64 0, i64 0
%93 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %91, i8* %92)
br label %94
94: ; preds = %90, %85, %80, %75, %72, %69, %66
%95 = load i32, i32* %11
%96 = add nsw i32 %95, 1
store i32 %96, i32* %11
br label %97
97: ; preds = %94, %61
br label %56
98: ; preds = %56
%99 = load i32, i32* %8
%100 = load i32, i32* %7
%101 = sub nsw i32 %100, 1
%102 = icmp ne i32 %99, %101
br i1 %102, label %103, label %106
103: ; preds = %98
%104 = load i8*, i8** %6
%105 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %104, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %109
106: ; preds = %98
%107 = load i8*, i8** %6
%108 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %107, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %109
109: ; preds = %106, %103
%110 = load i32*, i32** %9
%111 = call i32 @fclose(i32* %110)
br label %113
112: ; preds = %25
store i32 -1, i32* %3
br label %122
113: ; preds = %109
br label %114
114: ; preds = %113
%115 = load i32, i32* %8
%116 = add nsw i32 %115, 1
store i32 %116, i32* %8
br label %21
117: ; preds = %21
%118 = load i8*, i8** %6
%119 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %118, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%120 = load i8*, i8** %6
%121 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %3
br label %122
122: ; preds = %117, %112, %15
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [24 x i8] c"OSMC application-parser\00"
@.str.2 = [47 x i8] c"usage: pass two or more JSON files for merging\00"
@.str.3 = [12 x i8] c"%s\0A\09%s\0A\09%s\0A\00"
@.str.4 = [2 x i8] c"{\00"
@.str.5 = [15 x i8] c"\22application\22:\00"
@.str.6 = [2 x i8] c"[\00"
@.str.7 = [2 x i8] c"r\00"
@.str.8 = [7 x i8] c"%s\09%s\0A\00"
@SEEK_SET = global i32 0
@.str.9 = [7 x i8] c"%s\09\09%s\00"
@.str.10 = [3 x i8] c"},\00"
@.str.11 = [2 x i8] c"}\00"
@.str.12 = [8 x i8] c"%s\09\0A%s\0A\00"
@.str.13 = [2 x i8] c"]\00"
@.str.14 = [6 x i8] c"%s\0A%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca [512 x i8]
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
br label %82
8: ; preds = %2
%9 = bitcast i8** %3 to i8*
%10 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%11 = add nsw i32 %0, -1
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%13 = add nsw i32 %0, -2
%14 = zext i32 %13 to i64
%15 = zext i32 %11 to i64
%16 = icmp eq i32 %11, 0
br i1 %16, label %75, label %17
17: ; preds = %8, %68
%18 = phi i64 [ %19, %68 ], [ 0, %8 ]
%19 = add nuw nsw i64 %18, 1
%20 = getelementptr inbounds i8*, i8** %1, i64 %19
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %80, label %24
24: ; preds = %17
%25 = load i8*, i8** %3
%26 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @feof(i32* %22)
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %37
29: ; preds = %24, %29
%30 = phi i32 [ %34, %29 ], [ 0, %24 ]
%31 = call i32* @fgets(i8* %12, i32 512, i32* %22)
%32 = icmp ne i32* %31, null
%33 = zext i1 %32 to i32
%34 = add nuw nsw i32 %30, %33
%35 = call i32 @feof(i32* %22)
%36 = icmp eq i32 %35, 0
br i1 %36, label %29, label %37
37: ; preds = %29, %24
%38 = phi i32 [ 0, %24 ], [ %34, %29 ]
%39 = load i32, i32* @SEEK_SET
%40 = call i32 @fseek(i32* %22, i32 0, i32 %39)
%41 = call i32 @feof(i32* %22)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %68
43: ; preds = %37
%44 = add nsw i32 %38, -2
%45 = add nsw i32 %38, -1
br label %46
46: ; preds = %43, %64
%47 = phi i32 [ 1, %43 ], [ %65, %64 ]
%48 = call i32* @fgets(i8* %12, i32 512, i32* %22)
%49 = icmp eq i32* %48, null
br i1 %49, label %64, label %50
50: ; preds = %46
%51 = add i32 %47, -1
%52 = icmp ult i32 %51, 3
%53 = icmp eq i32 %47, %44
%54 = select i1 %52, i1 true, i1 %53
%55 = icmp eq i32 %47, %45
%56 = select i1 %54, i1 true, i1 %55
%57 = icmp eq i32 %47, %38
%58 = select i1 %56, i1 true, i1 %57
br i1 %58, label %62, label %59
59: ; preds = %50
%60 = load i8*, i8** %3
%61 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %60, i8* %12)
br label %62
62: ; preds = %59, %50
%63 = add nsw i32 %47, 1
br label %64
64: ; preds = %62, %46
%65 = phi i32 [ %63, %62 ], [ %47, %46 ]
%66 = call i32 @feof(i32* %22)
%67 = icmp eq i32 %66, 0
br i1 %67, label %46, label %68
68: ; preds = %64, %37
%69 = icmp eq i64 %18, %14
%70 = load i8*, i8** %3
%71 = select i1 %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0)
%72 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %70, i8* %71)
%73 = call i32 @fclose(i32* %22)
%74 = icmp eq i64 %19, %15
br i1 %74, label %75, label %17
75: ; preds = %68, %8
%76 = load i8*, i8** %3
%77 = call i32 (i8**, i8*, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%78 = load i8*, i8** %3
%79 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %80
80: ; preds = %17, %75
%81 = phi i32 [ 0, %75 ], [ -1, %17 ]
br label %82
82: ; preds = %80, %6
%83 = phi i32 [ -1, %6 ], [ %81, %80 ]
ret i32 %83
}