#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*/ CreateInitFile(char *, int, char **, int, char **, char *,
                                  int /*<<< orphan*/ *);
int EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
char *strdup(char *);
int main(int argc, char *argv[]) {
  FILE *file;
  FILE *fout;
  int numConcrete = 0;
  int numCommands = 0;
  char libName[250];
  char tmpVal[250];
  char *concrete[4000];
  char *commands[4000];
  char version[4000] = {'\0'};
  if (argc < 3) {
    fprintf(stderr, "Usage: %s input_file output_file\n", argv[0]);
    return 1;
  }
  file = fopen(argv[1], "r");
  if (!file) {
    fprintf(stderr, "Input file %s could not be opened\n", argv[1]);
    return 1;
  }
  fout = fopen(argv[2], "w");
  if (!fout) {
    fprintf(stderr, "Error opening output file\n");
    fclose(file);
    return 1;
  }
  if (fscanf(file, "%s", libName) != 1) {
    fprintf(stderr, "Error getting libName\n");
    fclose(file);
    fclose(fout);
    return 1;
  }
  while (fscanf(file, "%s", tmpVal) != EOF) {
    if (!strcmp(tmpVal, "COMMAND")) {
      if (fscanf(file, "%s", tmpVal) != 1) {
        fprintf(stderr, "Error getting command\n");
        fclose(file);
        fclose(fout);
        return 1;
      }
      commands[numCommands] = strdup(tmpVal);
      numCommands++;
    } else if (!strcmp(tmpVal, "VERSION")) {
      if (fscanf(file, "%s", version) != 1) {
        fprintf(stderr, "Error getting version\n");
        fclose(file);
        fclose(fout);
        return 1;
      }
    } else {
      concrete[numConcrete] = strdup(tmpVal);
      numConcrete++;
    }
  }
  fclose(file);
  CreateInitFile(libName, numConcrete, concrete, numCommands, commands, version,
                 fout);
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10be0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0x10bd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xfa0,%edx
call   1050 <memset@plt>
cmpl   $0x3,-0x8(%rbp)
jge    11ee <main+0x6e>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1491 <main+0x311>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe25(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    123c <main+0xbc>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdfb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1491 <main+0x311>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdfc(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    128b <main+0x10b>
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1491 <main+0x311>
mov    -0x18(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    0xdc7(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     12e0 <main+0x160>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
lea    0xdac(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1491 <main+0x311>
jmp    12e5 <main+0x165>
mov    -0x18(%rbp),%rdi
lea    -0x230(%rbp),%rdx
lea    0xd6d(%rip),%rsi
call   1060 <fscanf@plt>
mov    0x2ce5(%rip),%rcx
cmp    (%rcx),%eax
je     1449 <main+0x2c9>
lea    -0x230(%rbp),%rdi
lea    0xd65(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13a5 <main+0x225>
mov    -0x18(%rbp),%rdi
lea    -0x230(%rbp),%rdx
lea    0xd2b(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     137c <main+0x1fc>
mov    0x2c8a(%rip),%rax
mov    (%rax),%edi
lea    0xd2f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1491 <main+0x311>
lea    -0x230(%rbp),%rdi
call   10a0 <strdup@plt>
mov    %rax,%rcx
movslq -0x28(%rbp),%rax
mov    %rcx,-0xfc30(%rbp,%rax,8)
ff
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1444 <main+0x2c4>
lea    -0x230(%rbp),%rdi
lea    0xcea(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    141b <main+0x29b>
mov    -0x18(%rbp),%rdi
lea    -0x10bd0(%rbp),%rdx
lea    0xc91(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     1416 <main+0x296>
mov    0x2bf0(%rip),%rax
mov    (%rax),%edi
lea    0xcb4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1491 <main+0x311>
jmp    143f <main+0x2bf>
lea    -0x230(%rbp),%rdi
call   10a0 <strdup@plt>
mov    %rax,%rcx
movslq -0x24(%rbp),%rax
mov    %rcx,-0x7f30(%rbp,%rax,8)
ff
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1444 <main+0x2c4>
jmp    12e5 <main+0x165>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x130(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x7f30(%rbp),%rdx
mov    -0x28(%rbp),%ecx
lea    -0xfc30(%rbp),%r8
lea    -0x10bd0(%rbp),%r9
mov    -0x20(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <CreateInitFile@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10be0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10bb8,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
lea    0x210(%rsp),%rdi
mov    $0xfa0,%edx
xor    %esi,%esi
call   1050 <memset@plt>
cmp    $0x2,%ebx
jg     11b8 <main+0x48>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xe4d(%rip),%rsi
jmp    129f <main+0x12f>
mov    0x8(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     128b <main+0x11b>
mov    %rax,%rbx
mov    0x10(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     12a8 <main+0x138>
mov    %rax,%rbp
lea    0xe6d(%rip),%rsi
lea    0x110(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    12c4 <main+0x154>
mov    %rbp,0x8(%rsp)
lea    0xe48(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <fscanf@plt>
mov    0x2db8(%rip),%rcx
xor    %r15d,%r15d
mov    $0x0,%ebp
mov    $0x0,%r12d
cmp    (%rcx),%eax
jne    1306 <main+0x196>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,(%rsp)
lea    0x110(%rsp),%rdi
lea    0x8eb0(%rsp),%rdx
lea    0x11b0(%rsp),%r8
lea    0x210(%rsp),%r9
mov    %ebp,%esi
mov    %r12d,%ecx
call   1030 <CreateInitFile@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
jmp    12f1 <main+0x181>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
lea    0xd85(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    12eb <main+0x17b>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
jmp    12e6 <main+0x176>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
lea    0xd93(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x10bb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r12d,%r12d
lea    0xd54(%rip),%r13
lea    0x10(%rsp),%r14
xor    %ebp,%ebp
jmp    1353 <main+0x1e3>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1090 <strdup@plt>
movslq %ebp,%rbp
mov    %rax,0x8eb0(%rsp,%rbp,8)
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1060 <fscanf@plt>
mov    0x2c9d(%rip),%rcx
cmp    (%rcx),%eax
je     1246 <main+0xd6>
mov    0x10(%rsp),%rax
movabs $0x4e4f4953524556,%rcx
cmp    %rcx,%rax
je     13b0 <main+0x240>
movabs $0x444e414d4d4f43,%rcx
cmp    %rcx,%rax
jne    1320 <main+0x1b0>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    13de <main+0x26e>
mov    %r14,%rdi
call   1090 <strdup@plt>
movslq %r12d,%r12
mov    %rax,0x11b0(%rsp,%r12,8)
add    $0x1,%r12d
jmp    1336 <main+0x1c6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x210(%rsp),%rdx
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     1336 <main+0x1c6>
mov    0x2c05(%rip),%rax
mov    (%rax),%edi
lea    0xcb9(%rip),%rsi
jmp    13ee <main+0x27e>
mov    0x2bf3(%rip),%rax
mov    (%rax),%edi
lea    0xc90(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rdi
jmp    12e6 <main+0x176>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s input_file output_file\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [35 x i8] c"Input file %s could not be opened\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [27 x i8] c"Error opening output file\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [23 x i8] c"Error getting libName\0A\00"
@EOF = global i32 0
@.str.7 = [8 x i8] c"COMMAND\00"
@.str.8 = [23 x i8] c"Error getting command\0A\00"
@.str.9 = [8 x i8] c"VERSION\00"
@.str.10 = [23 x i8] c"Error getting version\0A\00"
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 [250 x i8]
%11 = alloca [250 x i8]
%12 = alloca [4000 x i8*]
%13 = alloca [4000 x i8*]
%14 = alloca [4000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
%15 = bitcast [4000 x i8]* %14 to i8*
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 3
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 1, i32* %3
br label %132
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %28, i32** %6
%29 = load i32*, i32** %6
%30 = icmp ne i32* %29, null
br i1 %30, label %37, label %31
31: ; preds = %24
%32 = load i32, i32* @stderr
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %35)
store i32 1, i32* %3
br label %132
37: ; preds = %24
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %41, i32** %7
%42 = load i32*, i32** %7
%43 = icmp ne i32* %42, null
br i1 %43, label %49, label %44
44: ; preds = %37
%45 = load i32, i32* @stderr
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%47 = load i32*, i32** %6
%48 = call i32 @fclose(i32* %47)
store i32 1, i32* %3
br label %132
49: ; preds = %37
%50 = load i32*, i32** %6
%51 = getelementptr inbounds [250 x i8], [250 x i8]* %10, i64 0, i64 0
%52 = call i32 @fscanf(i32* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %51)
%53 = icmp ne i32 %52, 1
br i1 %53, label %54, label %61
54: ; preds = %49
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%57 = load i32*, i32** %6
%58 = call i32 @fclose(i32* %57)
%59 = load i32*, i32** %7
%60 = call i32 @fclose(i32* %59)
store i32 1, i32* %3
br label %132
61: ; preds = %49
br label %62
62: ; preds = %118, %61
%63 = load i32*, i32** %6
%64 = getelementptr inbounds [250 x i8], [250 x i8]* %11, i64 0, i64 0
%65 = call i32 @fscanf(i32* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %64)
%66 = load i32, i32* @EOF
%67 = icmp ne i32 %65, %66
br i1 %67, label %68, label %119
68: ; preds = %62
%69 = getelementptr inbounds [250 x i8], [250 x i8]* %11, i64 0, i64 0
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %92, label %72
72: ; preds = %68
%73 = load i32*, i32** %6
%74 = getelementptr inbounds [250 x i8], [250 x i8]* %11, i64 0, i64 0
%75 = call i32 @fscanf(i32* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %74)
%76 = icmp ne i32 %75, 1
br i1 %76, label %77, label %84
77: ; preds = %72
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%80 = load i32*, i32** %6
%81 = call i32 @fclose(i32* %80)
%82 = load i32*, i32** %7
%83 = call i32 @fclose(i32* %82)
store i32 1, i32* %3
br label %132
84: ; preds = %72
%85 = getelementptr inbounds [250 x i8], [250 x i8]* %11, i64 0, i64 0
%86 = call i8* @strdup(i8* %85)
%87 = load i32, i32* %9
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %13, i64 0, i64 %88
store i8* %86, i8** %89
%90 = load i32, i32* %9
%91 = add nsw i32 %90, 1
store i32 %91, i32* %9
br label %118
92: ; preds = %68
%93 = getelementptr inbounds [250 x i8], [250 x i8]* %11, i64 0, i64 0
%94 = call i32 @strcmp(i8* %93, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%95 = icmp ne i32 %94, 0
br i1 %95, label %109, label %96
96: ; preds = %92
%97 = load i32*, i32** %6
%98 = getelementptr inbounds [4000 x i8], [4000 x i8]* %14, i64 0, i64 0
%99 = call i32 @fscanf(i32* %97, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %98)
%100 = icmp ne i32 %99, 1
br i1 %100, label %101, label %108
101: ; preds = %96
%102 = load i32, i32* @stderr
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
%104 = load i32*, i32** %6
%105 = call i32 @fclose(i32* %104)
%106 = load i32*, i32** %7
%107 = call i32 @fclose(i32* %106)
store i32 1, i32* %3
br label %132
108: ; preds = %96
br label %117
109: ; preds = %92
%110 = getelementptr inbounds [250 x i8], [250 x i8]* %11, i64 0, i64 0
%111 = call i8* @strdup(i8* %110)
%112 = load i32, i32* %8
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %12, i64 0, i64 %113
store i8* %111, i8** %114
%115 = load i32, i32* %8
%116 = add nsw i32 %115, 1
store i32 %116, i32* %8
br label %117
117: ; preds = %109, %108
br label %118
118: ; preds = %117, %84
br label %62
119: ; preds = %62
%120 = load i32*, i32** %6
%121 = call i32 @fclose(i32* %120)
%122 = getelementptr inbounds [250 x i8], [250 x i8]* %10, i64 0, i64 0
%123 = load i32, i32* %8
%124 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %12, i64 0, i64 0
%125 = load i32, i32* %9
%126 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %13, i64 0, i64 0
%127 = getelementptr inbounds [4000 x i8], [4000 x i8]* %14, i64 0, i64 0
%128 = load i32*, i32** %7
%129 = call i32 @CreateInitFile(i8* %122, i32 %123, i8** %124, i32 %125, i8** %126, i8* %127, i32* %128)
%130 = load i32*, i32** %7
%131 = call i32 @fclose(i32* %130)
store i32 0, i32* %3
br label %132
132: ; preds = %119, %101, %77, %54, %44, %31, %18
%133 = load i32, i32* %3
ret i32 %133
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s input_file output_file\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [35 x i8] c"Input file %s could not be opened\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [27 x i8] c"Error opening output file\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [23 x i8] c"Error getting libName\0A\00"
@EOF = global i32 0
@.str.8 = [23 x i8] c"Error getting command\0A\00"
@.str.10 = [23 x i8] c"Error getting version\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [250 x i8]
%4 = alloca [250 x i8]
%5 = alloca [4000 x i8*]
%6 = alloca [4000 x i8*]
%7 = alloca [4000 x i8]
%8 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [250 x i8], [250 x i8]* %4, i64 0, i64 0
%10 = bitcast [4000 x i8*]* %5 to i8*
%11 = bitcast [4000 x i8*]* %6 to i8*
%12 = getelementptr inbounds [4000 x i8], [4000 x i8]* %7, i64 0, i64 0
%13 = icmp slt i32 %0, 3
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %1
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %94
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %19
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %94
27: ; preds = %18
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %36
32: ; preds = %27
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%35 = tail call i32 @fclose(i32* %21)
br label %94
36: ; preds = %27
%37 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %8)
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %45
39: ; preds = %36
%40 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%41 = load i32, i32* @EOF
%42 = icmp eq i32 %40, %41
br i1 %42, label %86, label %43
43: ; preds = %39
%44 = bitcast [250 x i8]* %4 to i64*
br label %50
45: ; preds = %36
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%48 = call i32 @fclose(i32* %21)
%49 = call i32 @fclose(i32* %30)
br label %94
50: ; preds = %43, %80
%51 = phi i32 [ 0, %43 ], [ %82, %80 ]
%52 = phi i32 [ 0, %43 ], [ %81, %80 ]
%53 = load i64, i64* %44
switch i64 %53, label %75 [
i64 19226340793077571, label %54
i64 22042224532538710, label %67
]
54: ; preds = %50
%55 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%56 = icmp eq i32 %55, 1
br i1 %56, label %62, label %57
57: ; preds = %54
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%60 = call i32 @fclose(i32* %21)
%61 = call i32 @fclose(i32* %30)
br label %94
62: ; preds = %54
%63 = call i8* @strdup(i8* %9)
%64 = sext i32 %51 to i64
%65 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %6, i64 0, i64 %64
store i8* %63, i8** %65
%66 = add nsw i32 %51, 1
br label %80
67: ; preds = %50
%68 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %12)
%69 = icmp eq i32 %68, 1
br i1 %69, label %80, label %70
70: ; preds = %67
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
%73 = call i32 @fclose(i32* %21)
%74 = call i32 @fclose(i32* %30)
br label %94
75: ; preds = %50
%76 = call i8* @strdup(i8* %9)
%77 = sext i32 %52 to i64
%78 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %5, i64 0, i64 %77
store i8* %76, i8** %78
%79 = add nsw i32 %52, 1
br label %80
80: ; preds = %75, %67, %62
%81 = phi i32 [ %79, %75 ], [ %52, %67 ], [ %52, %62 ]
%82 = phi i32 [ %51, %75 ], [ %51, %67 ], [ %66, %62 ]
%83 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%84 = load i32, i32* @EOF
%85 = icmp eq i32 %83, %84
br i1 %85, label %86, label %50
86: ; preds = %80, %39
%87 = phi i32 [ 0, %39 ], [ %81, %80 ]
%88 = phi i32 [ 0, %39 ], [ %82, %80 ]
%89 = call i32 @fclose(i32* %21)
%90 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %5, i64 0, i64 0
%91 = getelementptr inbounds [4000 x i8*], [4000 x i8*]* %6, i64 0, i64 0
%92 = call i32 @CreateInitFile(i8* %8, i32 %87, i8** %90, i32 %88, i8** %91, i8* %12, i32* %30)
%93 = call i32 @fclose(i32* %30)
br label %94
94: ; preds = %86, %70, %57, %45, %32, %23, %14
%95 = phi i32 [ 1, %14 ], [ 1, %45 ], [ 1, %70 ], [ 1, %57 ], [ 0, %86 ], [ 1, %32 ], [ 1, %23 ]
ret i32 %95
}