#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(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, int *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  FILE *ifile = fopen("BIFF8Records.txt", "r");
  if (!ifile) {
    printf("ERROR: cannot open/read file, %s.\n", "BIFF8Records.txt");
    exit(1);
  }
  FILE *ofile_h = fopen("biff8_records.h", "w");
  if (!ofile_h) {
    fclose(ifile);
    printf("ERROR: cannot open/write file, %s.\n", "biff8_records.h");
    exit(1);
  }
  FILE *ofile_c = fopen("biff8_records.c", "w");
  if (!ofile_c) {
    fclose(ifile);
    fclose(ofile_h);
    printf("ERROR: cannot open/write file, %s.\n", "biff8_records.c");
    exit(1);
  }
  char record[50];
  int number;
  fprintf(ofile_h, "// generated by BIFF8 Record List Parser\n\n");
  fprintf(ofile_h, "#ifndef "
                   "BIFF8_RECORDS_H_"
                   "\n");
  fprintf(ofile_h, "#define "
                   "BIFF8_RECORDS_H_"
                   "\n\n");
  fprintf(ofile_h, "typedef enum {\n");
  fprintf(ofile_c, "// generated by BIFF8 Record List Parser\n\n");
  fprintf(ofile_c, "#include \"%s\"\n", "biff8_records.h");
  fprintf(ofile_c, "#include <stdio.h>\n\n");
  fprintf(ofile_c, "void biff8RecordNamePrint(int "
                   "record"
                   ")"
                   "\n{\n");
  fprintf(ofile_c, "\tswitch("
                   "record"
                   ")\n");
  fprintf(ofile_c, "\t{\n");
  while (fscanf(ifile, "%x%*c%s%*c", &number, record) == 2) {
    fprintf(ofile_h,
            "\t"
            "BIFF8_RECORD"
            "_%s = 0x%.4x,\n",
            record, number);
    fprintf(ofile_c,
            "\tcase "
            "BIFF8_RECORD"
            "_%s:\n",
            record);
    fprintf(ofile_c, "\t\tprintf(\"%s (0x%.4x)\\n\");\n", record, number);
    fprintf(ofile_c, "\t\tbreak;\n");
  }
  fprintf(ofile_h, "} "
                   "BIFF8_RECORD_LIST"
                   ";\n\n");
  fprintf(ofile_h, "void biff8RecordNamePrint(int "
                   "record"
                   ")"
                   ";\n\n");
  fprintf(ofile_h, "#endif // "
                   "BIFF8_RECORDS_H_"
                   "\n");
  fprintf(ofile_c, "\tdefault:\n");
  fprintf(ofile_c, "\t\tprintf(\"(0x%%.4x): unknown record!\\n\", "
                   "record"
                   ");\n");
  fprintf(ofile_c, "\t\tbreak;\n");
  fprintf(ofile_c, "\t}\n");
  fprintf(ofile_c, "}\n");
  fclose(ofile_c);
  fclose(ofile_h);
  fclose(ifile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    0xe94(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11ae <main+0x4e>
lea    0xe7b(%rip),%rdi
lea    0xe61(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe81(%rip),%rdi
lea    0xe8a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11f6 <main+0x96>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xe68(%rip),%rdi
lea    0xe4f(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe6f(%rip),%rdi
lea    0xe42(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1247 <main+0xe7>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xe17(%rip),%rdi
lea    0xe34(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x18(%rbp),%rdi
lea    0xe2a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe43(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xde2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe40(%rip),%rsi
lea    0xd83(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe39(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe50(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rcx
lea    0xe3d(%rip),%rsi
lea    -0x64(%rbp),%rdx
call   1050 <fscanf@plt>
cmp    $0x2,%eax
jne    1382 <main+0x222>
mov    -0x18(%rbp),%rdi
lea    -0x60(%rbp),%rdx
mov    -0x64(%rbp),%ecx
lea    0xe24(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xe2a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rdx
mov    -0x64(%rbp),%ecx
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe33(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1302 <main+0x1a2>
mov    -0x18(%rbp),%rdi
lea    0xe26(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe2b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe42(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe45(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe43(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xe7b(%rip),%rdi
lea    0xe85(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     147c <main+0x30c>
mov    %rax,%rbp
lea    0xe92(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     148c <main+0x31c>
mov    %rax,%r14
lea    0xea9(%rip),%rdi
lea    0xe7c(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     14a4 <main+0x334>
mov    %rax,%r13
lea    0xe9a(%rip),%rbx
mov    $0x2a,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r14,%rcx
call   1090 <fwrite@plt>
lea    0xea9(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
lea    0xeaa(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
lea    0xeac(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
mov    $0x2a,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe8e(%rip),%rsi
lea    0xdd1(%rip),%rdx
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe85(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe81(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe91(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe89(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe74(%rip),%rsi
lea    0x4(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbp,%rdi
call   1050 <fscanf@plt>
cmp    $0x2,%eax
mov    %rbp,0x8(%rsp)
jne    1391 <main+0x221>
lea    0x10(%rsp),%rbx
lea    0xea3(%rip),%r15
lea    0xe41(%rip),%r12
lea    0x4(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%ecx
mov    %r14,%rdi
lea    0xe2b(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r13,%rdi
lea    0xe33(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x4(%rsp),%ecx
mov    %r13,%rdi
lea    0xe33(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r13,%rcx
call   1090 <fwrite@plt>
mov    0x8(%rsp),%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1050 <fscanf@plt>
cmp    $0x2,%eax
je     1320 <main+0x1b0>
lea    0xe1b(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
lea    0xe19(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
lea    0xe29(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
lea    0xe2c(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe1e(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd9c(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe27(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
lea    0xe0f(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
mov    %r13,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb90(%rip),%rdi
lea    0xb76(%rip),%rsi
jmp    14c2 <main+0x352>
mov    %rbp,%rdi
call   1030 <fclose@plt>
lea    0xbad(%rip),%rdi
lea    0xb94(%rip),%rsi
jmp    14c2 <main+0x352>
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
lea    0xb8d(%rip),%rdi
lea    0xbaa(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"BIFF8Records.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [35 x i8] c"ERROR: cannot open/read file, %s.\0A\00"
@.str.3 = [16 x i8] c"biff8_records.h\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [36 x i8] c"ERROR: cannot open/write file, %s.\0A\00"
@.str.6 = [16 x i8] c"biff8_records.c\00"
@.str.7 = [43 x i8] c"// generated by BIFF8 Record List Parser\0A\0A\00"
@.str.8 = [26 x i8] c"#ifndef BIFF8_RECORDS_H_\0A\00"
@.str.9 = [27 x i8] c"#define BIFF8_RECORDS_H_\0A\0A\00"
@.str.10 = [16 x i8] c"typedef enum {\0A\00"
@.str.11 = [15 x i8] c"#include \22%s\22\0A\00"
@.str.12 = [21 x i8] c"#include <stdio.h>\0A\0A\00"
@.str.13 = [41 x i8] c"void biff8RecordNamePrint(int record)\0A{\0A\00"
@.str.14 = [17 x i8] c"\09switch(record)\0A\00"
@.str.15 = [4 x i8] c"\09{\0A\00"
@.str.16 = [11 x i8] c"%x%*c%s%*c\00"
@.str.17 = [28 x i8] c"\09BIFF8_RECORD_%s = 0x%.4x,\0A\00"
@.str.18 = [24 x i8] c"\09case BIFF8_RECORD_%s:\0A\00"
@.str.19 = [28 x i8] c"\09\09printf(\22%s (0x%.4x)\\n\22);\0A\00"
@.str.20 = [10 x i8] c"\09\09break;\0A\00"
@.str.21 = [23 x i8] c"} BIFF8_RECORD_LIST;\0A\0A\00"
@.str.22 = [41 x i8] c"void biff8RecordNamePrint(int record);\0A\0A\00"
@.str.23 = [28 x i8] c"#endif // BIFF8_RECORDS_H_\0A\00"
@.str.24 = [11 x i8] c"\09default:\0A\00"
@.str.25 = [51 x i8] c"\09\09printf(\22(0x%%.4x): unknown record!\\n\22, record);\0A\00"
@.str.26 = [4 x i8] c"\09}\0A\00"
@.str.27 = [3 x i8] c"}\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [50 x i8]
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = icmp ne i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %0
%14 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = icmp ne i32* %15, null
br i1 %16, label %22, label %17
17: ; preds = %13
%18 = load i32*, i32** %2
%19 = call i32 @fclose(i32* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %13
%23 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %23, i32** %4
%24 = load i32*, i32** %4
%25 = icmp ne i32* %24, null
br i1 %25, label %33, label %26
26: ; preds = %22
%27 = load i32*, i32** %2
%28 = call i32 @fclose(i32* %27)
%29 = load i32*, i32** %3
%30 = call i32 @fclose(i32* %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %22
%34 = load i32*, i32** %3
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%36 = load i32*, i32** %3
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%38 = load i32*, i32** %3
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%40 = load i32*, i32** %3
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
%42 = load i32*, i32** %4
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%44 = load i32*, i32** %4
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%46 = load i32*, i32** %4
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
%48 = load i32*, i32** %4
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0))
%50 = load i32*, i32** %4
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
%52 = load i32*, i32** %4
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
br label %54
54: ; preds = %59, %33
%55 = load i32*, i32** %2
%56 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%57 = call i32 @fscanf(i32* %55, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32* %6, i8* %56)
%58 = icmp eq i32 %57, 2
br i1 %58, label %59, label %73
59: ; preds = %54
%60 = load i32*, i32** %3
%61 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%62 = load i32, i32* %6
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i8* %61, i32 %62)
%64 = load i32*, i32** %4
%65 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i8* %65)
%67 = load i32*, i32** %4
%68 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%69 = load i32, i32* %6
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i8* %68, i32 %69)
%71 = load i32*, i32** %4
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %71, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
br label %54
73: ; preds = %54
%74 = load i32*, i32** %3
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %74, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.21, i64 0, i64 0))
%76 = load i32*, i32** %3
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.22, i64 0, i64 0))
%78 = load i32*, i32** %3
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i64 0, i64 0))
%80 = load i32*, i32** %4
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0))
%82 = load i32*, i32** %4
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.25, i64 0, i64 0))
%84 = load i32*, i32** %4
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%86 = load i32*, i32** %4
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0))
%88 = load i32*, i32** %4
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0))
%90 = load i32*, i32** %4
%91 = call i32 @fclose(i32* %90)
%92 = load i32*, i32** %3
%93 = call i32 @fclose(i32* %92)
%94 = load i32*, i32** %2
%95 = call i32 @fclose(i32* %94)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"BIFF8Records.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [35 x i8] c"ERROR: cannot open/read file, %s.\0A\00"
@.str.3 = [16 x i8] c"biff8_records.h\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [36 x i8] c"ERROR: cannot open/write file, %s.\0A\00"
@.str.6 = [16 x i8] c"biff8_records.c\00"
@.str.7 = [43 x i8] c"// generated by BIFF8 Record List Parser\0A\0A\00"
@.str.8 = [26 x i8] c"#ifndef BIFF8_RECORDS_H_\0A\00"
@.str.9 = [27 x i8] c"#define BIFF8_RECORDS_H_\0A\0A\00"
@.str.10 = [16 x i8] c"typedef enum {\0A\00"
@.str.11 = [15 x i8] c"#include \22%s\22\0A\00"
@.str.12 = [21 x i8] c"#include <stdio.h>\0A\0A\00"
@.str.13 = [41 x i8] c"void biff8RecordNamePrint(int record)\0A{\0A\00"
@.str.14 = [17 x i8] c"\09switch(record)\0A\00"
@.str.15 = [4 x i8] c"\09{\0A\00"
@.str.16 = [11 x i8] c"%x%*c%s%*c\00"
@.str.17 = [28 x i8] c"\09BIFF8_RECORD_%s = 0x%.4x,\0A\00"
@.str.18 = [24 x i8] c"\09case BIFF8_RECORD_%s:\0A\00"
@.str.19 = [28 x i8] c"\09\09printf(\22%s (0x%.4x)\\n\22);\0A\00"
@.str.20 = [10 x i8] c"\09\09break;\0A\00"
@.str.21 = [23 x i8] c"} BIFF8_RECORD_LIST;\0A\0A\00"
@.str.22 = [41 x i8] c"void biff8RecordNamePrint(int record);\0A\0A\00"
@.str.23 = [28 x i8] c"#endif // BIFF8_RECORDS_H_\0A\00"
@.str.24 = [11 x i8] c"\09default:\0A\00"
@.str.25 = [51 x i8] c"\09\09printf(\22(0x%%.4x): unknown record!\\n\22, record);\0A\00"
@.str.26 = [4 x i8] c"\09}\0A\00"
@.str.27 = [3 x i8] c"}\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca i32
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = tail call i32 @fclose(i32* %3)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %8
%16 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = tail call i32 @fclose(i32* %3)
%20 = tail call i32 @fclose(i32* %9)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %15
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%25 = bitcast i32* %2 to i8*
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i64 42, i64 1, i32* %9)
%27 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i64 25, i64 1, i32* %9)
%28 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i64 26, i64 1, i32* %9)
%29 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i64 15, i64 1, i32* %9)
%30 = tail call i64 @fwrite(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i64 42, i64 1, i32* %16)
%31 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%32 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i64 20, i64 1, i32* %16)
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.13, i64 0, i64 0), i64 40, i64 1, i32* %16)
%34 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i64 16, i64 1, i32* %16)
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i64 3, i64 1, i32* %16)
%36 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32* %2, i8* %24)
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %47
38: ; preds = %23, %38
%39 = load i32, i32* %2
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i8* %24, i32 %39)
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i8* %24)
%42 = load i32, i32* %2
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i8* %24, i32 %42)
%44 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i64 9, i64 1, i32* %16)
%45 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32* %2, i8* %24)
%46 = icmp eq i32 %45, 2
br i1 %46, label %38, label %47
47: ; preds = %38, %23
%48 = call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.21, i64 0, i64 0), i64 22, i64 1, i32* %9)
%49 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.22, i64 0, i64 0), i64 40, i64 1, i32* %9)
%50 = call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i64 0, i64 0), i64 27, i64 1, i32* %9)
%51 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0), i64 10, i64 1, i32* %16)
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.25, i64 0, i64 0))
%53 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i64 9, i64 1, i32* %16)
%54 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0), i64 3, i64 1, i32* %16)
%55 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i64 0, i64 0), i64 2, i64 1, i32* %16)
%56 = call i32 @fclose(i32* %16)
%57 = call i32 @fclose(i32* %9)
%58 = call i32 @fclose(i32* %3)
ret i32 0
}