#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 combineMIDIFiles(char *, unsigned char **, char);
int /*<<< orphan*/ correctCallForm(int, char **);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileReadable(char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ loadFile(char *, unsigned char **);
int /*<<< orphan*/ pathValid(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (!correctCallForm(argc, argv)) {
    fprintf(stderr, "Usage: catmidi [-o output_path] [path ...]\n");
    return 1;
  }
  bool outputPathGiven = !strcmp(argv[1], "-o");
  char startOfInputs = (outputPathGiven) ? 3 : 1;
  char numberOfInputs = argc - startOfInputs;
  for (int i = startOfInputs; i < argc; i++) {
    if ((!pathValid(argv[i])) || (!fileReadable(argv[i]))) {
      return 1;
    }
  }
  char outputBuffer[65536];
  unsigned char *inputBuffer[numberOfInputs];
  for (int i = 0; i < numberOfInputs; i++) {
    loadFile(argv[i + startOfInputs], &inputBuffer[i]);
  }
  int outputBufferLength =
      combineMIDIFiles(outputBuffer, inputBuffer, numberOfInputs);
  for (int i = 0; i < numberOfInputs; i++) {
    free(inputBuffer[i]);
  }
  if (outputBufferLength == 0) {
    return 1;
  }
  FILE *outputFile = fopen((outputPathGiven) ? argv[2] : "./output.midi", "wb");
  if (outputFile == NULL) {
    fprintf(stderr, "Output file could not be created\n");
    return 1;
  }
  fwrite(outputBuffer, 1, outputBufferLength, outputFile);
  fflush(outputFile);
  fclose(outputFile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10060,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10e0 <correctCallForm@plt>
cmp    $0x0,%eax
jne    120f <main+0x4f>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
lea    0xe02(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14af <main+0x2ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
mov    $0x3,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x15(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x16(%rbp)
movsbl -0x15(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12bb <main+0xfb>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <pathValid@plt>
cmp    $0x0,%eax
je     129c <main+0xdc>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   10d0 <fileReadable@plt>
cmp    $0x0,%eax
jne    12a8 <main+0xe8>
movl   $0x1,-0x4(%rbp)
jmp    14af <main+0x2ef>
jmp    12ad <main+0xed>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    125c <main+0x9c>
movzbl -0x16(%rbp),%edx
mov    %edx,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10028(%rbp)
mov    %edx,%ecx
lea    0xf(,%rcx,8),%edx
mov    %edx,%ecx
and    $0xfffffff0,%ecx
mov    %ecx,%edx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x10050(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x10030(%rbp)
movl   $0x0,-0x10034(%rbp)
mov    -0x10034(%rbp),%eax
movsbl -0x16(%rbp),%ecx
cmp    %ecx,%eax
jge    1353 <main+0x193>
mov    -0x10050(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x10034(%rbp),%ecx
movsbl -0x15(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x10034(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   10c0 <loadFile@plt>
mov    -0x10034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10034(%rbp)
jmp    12fc <main+0x13c>
mov    -0x10050(%rbp),%rsi
lea    -0x10020(%rbp),%rdi
movsbl -0x16(%rbp),%edx
call   1050 <combineMIDIFiles@plt>
mov    %eax,-0x10038(%rbp)
movl   $0x0,-0x1003c(%rbp)
mov    -0x1003c(%rbp),%eax
movsbl -0x16(%rbp),%ecx
cmp    %ecx,%eax
jge    13b7 <main+0x1f7>
mov    -0x10050(%rbp),%rax
movslq -0x1003c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x1003c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1003c(%rbp)
jmp    137a <main+0x1ba>
cmpl   $0x0,-0x10038(%rbp)
jne    13da <main+0x21a>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x10040(%rbp)
jmp    14a5 <main+0x2e5>
cmpl   $0x0,-0x14(%rbp)
je     13f8 <main+0x238>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x10058(%rbp)
jmp    140b <main+0x24b>
lea    0xc30(%rip),%rax
mov    %rax,-0x10058(%rbp)
jmp    140b <main+0x24b>
mov    -0x10058(%rbp),%rdi
lea    0xc24(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10048(%rbp)
cmpq   $0x0,-0x10048(%rbp)
jne    145e <main+0x29e>
mov    0x2ba6(%rip),%rax
mov    (%rax),%edi
lea    0xbfd(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x10040(%rbp)
jmp    14a5 <main+0x2e5>
lea    -0x10020(%rbp),%rdi
mov    -0x10038(%rbp),%edx
mov    -0x10048(%rbp),%rcx
mov    $0x1,%esi
call   10b0 <fwrite@plt>
mov    -0x10048(%rbp),%rdi
call   1080 <fflush@plt>
mov    -0x10048(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10040(%rbp)
mov    -0x10028(%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    $0x10028,%rsp
mov    %rsi,%r15
mov    %edi,%r14d
call   10e0 <correctCallForm@plt>
test   %eax,%eax
je     1319 <main+0x159>
mov    0x8(%r15),%rdi
lea    0xe3a(%rip),%rsi
call   1060 <strcmp@plt>
mov    %eax,%r12d
xor    %eax,%eax
test   %r12d,%r12d
sete   %al
lea    (%rax,%rax,1),%ecx
add    $0x1,%ecx
mov    %r14d,%eax
mov    %ecx,-0x2c(%rbp)
sub    %ecx,%eax
mov    %eax,-0x30(%rbp)
jle    125b <main+0x9b>
mov    -0x2c(%rbp),%ebx
mov    %r14d,%r14d
mov    $0x1,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1090 <pathValid@plt>
test   %eax,%eax
je     13c4 <main+0x204>
mov    (%r15,%rbx,8),%rdi
call   10d0 <fileReadable@plt>
test   %eax,%eax
je     13c4 <main+0x204>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1230 <main+0x70>
mov    %rsp,%rbx
mov    -0x30(%rbp),%ecx
movzbl %cl,%eax
lea    0xf(,%rax,8),%eax
and    $0xfffffff0,%eax
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
mov    %ecx,%eax
shl    $0x18,%eax
test   %eax,%eax
mov    %r12d,-0x3c(%rbp)
jle    1339 <main+0x179>
mov    %eax,-0x38(%rbp)
mov    %rbx,-0x48(%rbp)
movsbl %cl,%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
mov    %eax,-0x34(%rbp)
cmovge %eax,%ebx
mov    -0x2c(%rbp),%eax
lea    (%r15,%rax,8),%r14
shl    $0x3,%rbx
xor    %r12d,%r12d
xchg   %ax,%ax
mov    (%r14,%r12,1),%rdi
lea    (%r12,%r13,1),%rsi
call   10c0 <loadFile@plt>
add    $0x8,%r12
cmp    %r12,%rbx
jne    12b0 <main+0xf0>
movsbl -0x30(%rbp),%edx
lea    -0x10050(%rbp),%rdi
mov    %r13,%rsi
call   1050 <combineMIDIFiles@plt>
mov    %eax,%r12d
cmpl   $0x0,-0x38(%rbp)
jle    1313 <main+0x153>
mov    -0x34(%rbp),%eax
cmp    $0x2,%eax
mov    $0x1,%r14d
cmovge %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%r13,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1300 <main+0x140>
mov    -0x48(%rbp),%rbx
jmp    134e <main+0x18e>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
lea    0xcd7(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%r13d
jmp    13c4 <main+0x204>
movsbl %cl,%edx
lea    -0x10050(%rbp),%rdi
mov    %r13,%rsi
call   1050 <combineMIDIFiles@plt>
mov    %eax,%r12d
mov    $0x1,%r13d
test   %r12d,%r12d
je     13c1 <main+0x201>
cmpl   $0x0,-0x3c(%rbp)
je     1368 <main+0x1a8>
lea    0xcc9(%rip),%rdi
jmp    136c <main+0x1ac>
mov    0x10(%r15),%rdi
lea    0xcca(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13ac <main+0x1ec>
mov    %rax,%r14
lea    -0x10050(%rbp),%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %rax,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
call   1080 <fflush@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %r13d,%r13d
jmp    13c1 <main+0x201>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
lea    0xc84(%rip),%rsi
call   1070 <fprintf@plt>
mov    %rbx,%rsp
mov    %r13d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: catmidi [-o output_path] [path ...]\0A\00"
@.str.1 = [3 x i8] c"-o\00"
@.str.2 = [14 x i8] c"./output.midi\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [34 x i8] c"Output file could not be created\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca [65536 x i8]
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @correctCallForm(i32 %18, i8** %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %145
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
%32 = zext i1 %31 to i32
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 3, i32 1
%37 = trunc i32 %36 to i8
store i8 %37, i8* %7
%38 = load i32, i32* %4
%39 = load i8, i8* %7
%40 = sext i8 %39 to i32
%41 = sub nsw i32 %38, %40
%42 = trunc i32 %41 to i8
store i8 %42, i8* %8
%43 = load i8, i8* %7
%44 = sext i8 %43 to i32
store i32 %44, i32* %9
br label %45
45: ; preds = %67, %25
%46 = load i32, i32* %9
%47 = load i32, i32* %4
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %70
49: ; preds = %45
%50 = load i8**, i8*** %5
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = call i32 @pathValid(i8* %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %65
57: ; preds = %49
%58 = load i8**, i8*** %5
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @fileReadable(i8* %62)
%64 = icmp ne i32 %63, 0
br i1 %64, label %66, label %65
65: ; preds = %57, %49
store i32 1, i32* %3
br label %145
66: ; preds = %57
br label %67
67: ; preds = %66
%68 = load i32, i32* %9
%69 = add nsw i32 %68, 1
store i32 %69, i32* %9
br label %45
70: ; preds = %45
%71 = load i8, i8* %8
%72 = zext i8 %71 to i64
%73 = call i8* @llvm.stacksave()
store i8* %73, i8** %11
%74 = alloca i8*, i64 %72
store i64 %72, i64* %12
store i32 0, i32* %13
br label %75
75: ; preds = %93, %70
%76 = load i32, i32* %13
%77 = load i8, i8* %8
%78 = sext i8 %77 to i32
%79 = icmp slt i32 %76, %78
br i1 %79, label %80, label %96
80: ; preds = %75
%81 = load i8**, i8*** %5
%82 = load i32, i32* %13
%83 = load i8, i8* %7
%84 = sext i8 %83 to i32
%85 = add nsw i32 %82, %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8*, i8** %81, i64 %86
%88 = load i8*, i8** %87
%89 = load i32, i32* %13
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %74, i64 %90
%92 = call i32 @loadFile(i8* %88, i8** %91)
br label %93
93: ; preds = %80
%94 = load i32, i32* %13
%95 = add nsw i32 %94, 1
store i32 %95, i32* %13
br label %75
96: ; preds = %75
%97 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 0
%98 = load i8, i8* %8
%99 = call i32 @combineMIDIFiles(i8* %97, i8** %74, i8 signext %98)
store i32 %99, i32* %14
store i32 0, i32* %15
br label %100
100: ; preds = %111, %96
%101 = load i32, i32* %15
%102 = load i8, i8* %8
%103 = sext i8 %102 to i32
%104 = icmp slt i32 %101, %103
br i1 %104, label %105, label %114
105: ; preds = %100
%106 = load i32, i32* %15
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8*, i8** %74, i64 %107
%109 = load i8*, i8** %108
%110 = call i32 @free(i8* %109)
br label %111
111: ; preds = %105
%112 = load i32, i32* %15
%113 = add nsw i32 %112, 1
store i32 %113, i32* %15
br label %100
114: ; preds = %100
%115 = load i32, i32* %14
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %114
store i32 1, i32* %3
store i32 1, i32* %16
br label %143
118: ; preds = %114
%119 = load i32, i32* %6
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %125
121: ; preds = %118
%122 = load i8**, i8*** %5
%123 = getelementptr inbounds i8*, i8** %122, i64 2
%124 = load i8*, i8** %123
br label %126
125: ; preds = %118
br label %126
126: ; preds = %125, %121
%127 = phi i8* [ %124, %121 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %125 ]
%128 = call i32* @fopen(i8* %127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %128, i32** %17
%129 = load i32*, i32** %17
%130 = icmp eq i32* %129, null
br i1 %130, label %131, label %134
131: ; preds = %126
%132 = load i32, i32* @stderr
%133 = call i32 @fprintf(i32 %132, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %16
br label %143
134: ; preds = %126
%135 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 0
%136 = load i32, i32* %14
%137 = load i32*, i32** %17
%138 = call i32 @fwrite(i8* %135, i32 1, i32 %136, i32* %137)
%139 = load i32*, i32** %17
%140 = call i32 @fflush(i32* %139)
%141 = load i32*, i32** %17
%142 = call i32 @fclose(i32* %141)
store i32 0, i32* %3
store i32 1, i32* %16
br label %143
143: ; preds = %134, %131, %117
%144 = load i8*, i8** %11
br label %145
145: ; preds = %143, %65, %22
%146 = load i32, i32* %3
ret i32 %146
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: catmidi [-o output_path] [path ...]\0A\00"
@.str.1 = [3 x i8] c"-o\00"
@.str.2 = [14 x i8] c"./output.midi\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [34 x i8] c"Output file could not be created\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [65536 x i8]
%4 = tail call i32 @correctCallForm(i32 %0, i8** %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %90
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 3, i32 1
%15 = sub nsw i32 %0, %14
%16 = trunc i32 %15 to i8
%17 = icmp slt i32 %14, %0
br i1 %17, label %18, label %34
18: ; preds = %9
%19 = zext i32 %14 to i64
%20 = zext i32 %0 to i64
br label %23
21: ; preds = %29
%22 = icmp eq i64 %33, %20
br i1 %22, label %34, label %23
23: ; preds = %18, %21
%24 = phi i64 [ %19, %18 ], [ %33, %21 ]
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = tail call i32 @pathValid(i8* %26)
%28 = icmp eq i32 %27, 0
br i1 %28, label %90, label %29
29: ; preds = %23
%30 = load i8*, i8** %25
%31 = tail call i32 @fileReadable(i8* %30)
%32 = icmp eq i32 %31, 0
%33 = add nuw nsw i64 %24, 1
br i1 %32, label %90, label %21
34: ; preds = %21, %9
%35 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%36 = and i32 %15, 255
%37 = zext i32 %36 to i64
%38 = tail call i8* @llvm.stacksave()
%39 = alloca i8*, i64 %37
%40 = shl i32 %15, 24
%41 = ashr exact i32 %40, 24
%42 = icmp sgt i32 %40, 0
br i1 %42, label %45, label %43
43: ; preds = %34
%44 = call i32 @combineMIDIFiles(i8* %35, i8** %39, i8 signext %16)
br label %63
45: ; preds = %34
%46 = zext i32 %14 to i64
%47 = call i32 @llvm.smax.i32(i32 %41, i32 1)
%48 = zext i32 %47 to i64
br label %54
49: ; preds = %54
%50 = call i32 @combineMIDIFiles(i8* %35, i8** %39, i8 signext %16)
br i1 %42, label %51, label %63
51: ; preds = %49
%52 = call i32 @llvm.smax.i32(i32 %41, i32 1)
%53 = zext i32 %52 to i64
br label %66
54: ; preds = %45, %54
%55 = phi i64 [ 0, %45 ], [ %61, %54 ]
%56 = add nuw nsw i64 %55, %46
%57 = getelementptr inbounds i8*, i8** %1, i64 %56
%58 = load i8*, i8** %57
%59 = getelementptr inbounds i8*, i8** %39, i64 %55
%60 = call i32 @loadFile(i8* %58, i8** %59)
%61 = add nuw nsw i64 %55, 1
%62 = icmp eq i64 %61, %48
br i1 %62, label %49, label %54
63: ; preds = %66, %43, %49
%64 = phi i32 [ %44, %43 ], [ %50, %49 ], [ %50, %66 ]
%65 = icmp eq i32 %64, 0
br i1 %65, label %88, label %73
66: ; preds = %51, %66
%67 = phi i64 [ 0, %51 ], [ %71, %66 ]
%68 = getelementptr inbounds i8*, i8** %39, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 @free(i8* %69)
%71 = add nuw nsw i64 %67, 1
%72 = icmp eq i64 %71, %53
br i1 %72, label %63, label %66
73: ; preds = %63
br i1 %13, label %74, label %77
74: ; preds = %73
%75 = getelementptr inbounds i8*, i8** %1, i64 2
%76 = load i8*, i8** %75
br label %77
77: ; preds = %73, %74
%78 = phi i8* [ %76, %74 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %73 ]
%79 = call i32* @fopen(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %84
81: ; preds = %77
%82 = load i32, i32* @stderr
%83 = call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %88
84: ; preds = %77
%85 = call i32 @fwrite(i8* %35, i32 1, i32 %64, i32* %79)
%86 = call i32 @fflush(i32* %79)
%87 = call i32 @fclose(i32* %79)
br label %88
88: ; preds = %81, %84, %63
%89 = phi i32 [ 1, %63 ], [ 1, %81 ], [ 0, %84 ]
br label %90
90: ; preds = %29, %23, %88, %6
%91 = phi i32 [ 1, %6 ], [ %89, %88 ], [ 1, %23 ], [ 1, %29 ]
ret i32 %91
}