#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*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, unsigned long, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  unsigned int line = 0;
  unsigned short int pixel;
  unsigned long int ng_color;
  char rd[8];
  FILE *file_ptr;
  char *in_buffer;
  unsigned long int in_size;
  if (argc != 2) {
    puts("usage: sta2verilog input.sta\n");
    return 1;
  }
  file_ptr = fopen(argv[1], "rb");
  if (file_ptr == NULL)
    return 1;
  fseek(file_ptr, 0, SEEK_END);
  in_size = ftell(file_ptr);
  rewind(file_ptr);
  in_buffer = (char *)malloc(in_size);
  fread(in_buffer, 1, in_size, file_ptr);
  fclose(file_ptr);
  printf("In: %lu\nOut: %lu\n", in_size, in_size - 32);
  file_ptr = fopen("sta_raw.bin", "wb");
  fwrite(in_buffer + 32, 1, in_size - 32, file_ptr);
  fclose(file_ptr);
  remove("sta_raw_unpack.bin");
  system("offzip sta_raw.bin");
  file_ptr = fopen("sta_raw_unpack.bin", "rb");
  fseek(file_ptr, 0, SEEK_END);
  in_size = ftell(file_ptr);
  rewind(file_ptr);
  free(in_buffer);
  in_buffer = (char *)malloc(in_size);
  fread(in_buffer, in_size, 1, file_ptr);
  fclose(file_ptr);
  file_ptr = fopen("slow_vram.bin", "wb");
  fwrite(in_buffer + 0x4BB8, 0x10000, 1, file_ptr);
  fclose(file_ptr);
  file_ptr = fopen("fast_vram.bin", "wb");
  fwrite(in_buffer + 0x14BB8, 0x1000, 1, file_ptr);
  fclose(file_ptr);
  file_ptr = fopen("palettes.bin", "wb");
  fwrite(in_buffer + 0x2351, 0x4000, 1, file_ptr);
  fclose(file_ptr);
  free(in_buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     120f <main+0x3f>
lea    0xe02(%rip),%rdi
call   1050 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1446 <main+0x276>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe00(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    123e <main+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1446 <main+0x276>
mov    -0x30(%rbp),%rdi
mov    0x2d9f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x30(%rbp),%rdi
call   10b0 <ftell@plt>
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
call   10a0 <rewind@plt>
mov    -0x40(%rbp),%rdi
call   10c0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fread@plt>
mov    -0x30(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x40(%rbp),%rsi
mov    -0x40(%rbp),%rdx
sub    $0x20,%rdx
lea    0xd78(%rip),%rdi
call   1090 <printf@plt>
lea    0xd9b(%rip),%rdi
lea    0xd77(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x20,%rdi
mov    -0x40(%rbp),%rax
sub    $0x20,%rax
mov    %eax,%edx
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   10f0 <fwrite@plt>
mov    -0x30(%rbp),%rdi
call   1070 <fclose@plt>
lea    0xd41(%rip),%rdi
call   1040 <remove@plt>
lea    0xd48(%rip),%rdi
call   1080 <system@plt>
lea    0xd29(%rip),%rdi
lea    0xd0a(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    0x2cc0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x30(%rbp),%rdi
call   10b0 <ftell@plt>
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
call   10a0 <rewind@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   10c0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x30(%rbp),%rcx
mov    $0x1,%edx
call   1060 <fread@plt>
mov    -0x30(%rbp),%rdi
call   1070 <fclose@plt>
lea    0xcd9(%rip),%rdi
lea    0xca9(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x4bb8,%rdi
mov    -0x30(%rbp),%rcx
mov    $0x10000,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
mov    -0x30(%rbp),%rdi
call   1070 <fclose@plt>
lea    0xca9(%rip),%rdi
lea    0xc6b(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x14bb8,%rdi
mov    -0x30(%rbp),%rcx
mov    $0x1000,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
mov    -0x30(%rbp),%rdi
call   1070 <fclose@plt>
lea    0xc79(%rip),%rdi
lea    0xc2d(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x2351,%rdi
mov    -0x30(%rbp),%rcx
mov    $0x4000,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
mov    -0x30(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    13bd <main+0x1ed>
mov    0x8(%rsi),%rdi
lea    0xe2f(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     13c9 <main+0x1f9>
mov    %rax,%rbp
mov    0x2de1(%rip),%r13
mov    0x0(%r13),%edx
xor    %r15d,%r15d
mov    %rax,%rdi
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    %rbp,%rdi
call   10b0 <ftell@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   10a0 <rewind@plt>
mov    %rbx,%rdi
call   10c0 <malloc@plt>
mov    %rax,%r12
mov    $0x1,%esi
mov    %rax,%rdi
mov    %ebx,%edx
mov    %rbp,%rcx
call   1060 <fread@plt>
mov    %rbp,%rdi
call   1070 <fclose@plt>
lea    -0x20(%rbx),%rbp
lea    0xdc6(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1090 <printf@plt>
lea    0xde3(%rip),%rdi
lea    0xdbf(%rip),%r14
mov    %r14,%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbx
lea    0x20(%r12),%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
lea    0xd94(%rip),%rbx
mov    %rbx,%rdi
call   1040 <remove@plt>
lea    0xd98(%rip),%rdi
call   1080 <system@plt>
lea    0xd61(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <fopen@plt>
mov    %rax,%rbp
mov    0x0(%r13),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    %rbp,%rdi
call   10b0 <ftell@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   10a0 <rewind@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   10c0 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1060 <fread@plt>
mov    %rbp,%rdi
call   1070 <fclose@plt>
lea    0xd3e(%rip),%rdi
mov    %r14,%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbx
lea    0x4bb8(%r12),%rdi
mov    $0x10000,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
lea    0xd18(%rip),%rdi
mov    %r14,%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbx
lea    0x14bb8(%r12),%rdi
mov    $0x1000,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
lea    0xcf2(%rip),%rdi
mov    %r14,%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbx
lea    0x2351(%r12),%rdi
mov    $0x4000,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
mov    %r12,%rdi
call   1030 <free@plt>
jmp    13cf <main+0x1ff>
lea    0xc3c(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"usage: sta2verilog input.sta\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@.str.2 = [18 x i8] c"In: %lu\0AOut: %lu\0A\00"
@.str.3 = [12 x i8] c"sta_raw.bin\00"
@.str.4 = [3 x i8] c"wb\00"
@.str.5 = [19 x i8] c"sta_raw_unpack.bin\00"
@.str.6 = [19 x i8] c"offzip sta_raw.bin\00"
@.str.7 = [14 x i8] c"slow_vram.bin\00"
@.str.8 = [14 x i8] c"fast_vram.bin\00"
@.str.9 = [13 x i8] c"palettes.bin\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i16
%8 = alloca i64
%9 = alloca [8 x i8]
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %101
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %10
%22 = load i32*, i32** %10
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %25
24: ; preds = %17
store i32 1, i32* %3
br label %101
25: ; preds = %17
%26 = load i32*, i32** %10
%27 = load i32, i32* @SEEK_END
%28 = call i32 @fseek(i32* %26, i32 0, i32 %27)
%29 = load i32*, i32** %10
%30 = call i64 @ftell(i32* %29)
store i64 %30, i64* %12
%31 = load i32*, i32** %10
%32 = call i32 @rewind(i32* %31)
%33 = load i64, i64* %12
%34 = call i64 @malloc(i64 %33)
%35 = inttoptr i64 %34 to i8*
store i8* %35, i8** %11
%36 = load i8*, i8** %11
%37 = load i64, i64* %12
%38 = trunc i64 %37 to i32
%39 = load i32*, i32** %10
%40 = call i32 @fread(i8* %36, i64 1, i32 %38, i32* %39)
%41 = load i32*, i32** %10
%42 = call i32 @fclose(i32* %41)
%43 = load i64, i64* %12
%44 = load i64, i64* %12
%45 = sub i64 %44, 32
%46 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i64 %43, i64 %45)
%47 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %47, i32** %10
%48 = load i8*, i8** %11
%49 = getelementptr inbounds i8, i8* %48, i64 32
%50 = load i64, i64* %12
%51 = sub i64 %50, 32
%52 = trunc i64 %51 to i32
%53 = load i32*, i32** %10
%54 = call i32 @fwrite(i8* %49, i32 1, i32 %52, i32* %53)
%55 = load i32*, i32** %10
%56 = call i32 @fclose(i32* %55)
%57 = call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%58 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%59 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %59, i32** %10
%60 = load i32*, i32** %10
%61 = load i32, i32* @SEEK_END
%62 = call i32 @fseek(i32* %60, i32 0, i32 %61)
%63 = load i32*, i32** %10
%64 = call i64 @ftell(i32* %63)
store i64 %64, i64* %12
%65 = load i32*, i32** %10
%66 = call i32 @rewind(i32* %65)
%67 = load i8*, i8** %11
%68 = call i32 @free(i8* %67)
%69 = load i64, i64* %12
%70 = call i64 @malloc(i64 %69)
%71 = inttoptr i64 %70 to i8*
store i8* %71, i8** %11
%72 = load i8*, i8** %11
%73 = load i64, i64* %12
%74 = load i32*, i32** %10
%75 = call i32 @fread(i8* %72, i64 %73, i32 1, i32* %74)
%76 = load i32*, i32** %10
%77 = call i32 @fclose(i32* %76)
%78 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %78, i32** %10
%79 = load i8*, i8** %11
%80 = getelementptr inbounds i8, i8* %79, i64 19384
%81 = load i32*, i32** %10
%82 = call i32 @fwrite(i8* %80, i32 65536, i32 1, i32* %81)
%83 = load i32*, i32** %10
%84 = call i32 @fclose(i32* %83)
%85 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %85, i32** %10
%86 = load i8*, i8** %11
%87 = getelementptr inbounds i8, i8* %86, i64 84920
%88 = load i32*, i32** %10
%89 = call i32 @fwrite(i8* %87, i32 4096, i32 1, i32* %88)
%90 = load i32*, i32** %10
%91 = call i32 @fclose(i32* %90)
%92 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %92, i32** %10
%93 = load i8*, i8** %11
%94 = getelementptr inbounds i8, i8* %93, i64 9041
%95 = load i32*, i32** %10
%96 = call i32 @fwrite(i8* %94, i32 16384, i32 1, i32* %95)
%97 = load i32*, i32** %10
%98 = call i32 @fclose(i32* %97)
%99 = load i8*, i8** %11
%100 = call i32 @free(i8* %99)
store i32 0, i32* %3
br label %101
101: ; preds = %25, %24, %15
%102 = load i32, i32* %3
ret i32 %102
}

LLVM IR (-O2):
@.str = [30 x i8] c"usage: sta2verilog input.sta\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@.str.2 = [18 x i8] c"In: %lu\0AOut: %lu\0A\00"
@.str.3 = [12 x i8] c"sta_raw.bin\00"
@.str.4 = [3 x i8] c"wb\00"
@.str.5 = [19 x i8] c"sta_raw_unpack.bin\00"
@.str.6 = [19 x i8] c"offzip sta_raw.bin\00"
@.str.7 = [14 x i8] c"slow_vram.bin\00"
@.str.8 = [14 x i8] c"fast_vram.bin\00"
@.str.9 = [13 x i8] c"palettes.bin\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %53
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %53, label %11
11: ; preds = %6
%12 = load i32, i32* @SEEK_END
%13 = tail call i32 @fseek(i32* %9, i32 0, i32 %12)
%14 = tail call i64 @ftell(i32* %9)
%15 = tail call i32 @rewind(i32* %9)
%16 = tail call i64 @malloc(i64 %14)
%17 = inttoptr i64 %16 to i8*
%18 = trunc i64 %14 to i32
%19 = tail call i32 @fread(i8* %17, i64 1, i32 %18, i32* %9)
%20 = tail call i32 @fclose(i32* %9)
%21 = add i64 %14, -32
%22 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i64 %14, i64 %21)
%23 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = getelementptr inbounds i8, i8* %17, i64 32
%25 = trunc i64 %21 to i32
%26 = tail call i32 @fwrite(i8* %24, i32 1, i32 %25, i32* %23)
%27 = tail call i32 @fclose(i32* %23)
%28 = tail call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%29 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%30 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%31 = load i32, i32* @SEEK_END
%32 = tail call i32 @fseek(i32* %30, i32 0, i32 %31)
%33 = tail call i64 @ftell(i32* %30)
%34 = tail call i32 @rewind(i32* %30)
%35 = tail call i32 @free(i8* %17)
%36 = tail call i64 @malloc(i64 %33)
%37 = inttoptr i64 %36 to i8*
%38 = tail call i32 @fread(i8* %37, i64 %33, i32 1, i32* %30)
%39 = tail call i32 @fclose(i32* %30)
%40 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%41 = getelementptr inbounds i8, i8* %37, i64 19384
%42 = tail call i32 @fwrite(i8* %41, i32 65536, i32 1, i32* %40)
%43 = tail call i32 @fclose(i32* %40)
%44 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%45 = getelementptr inbounds i8, i8* %37, i64 84920
%46 = tail call i32 @fwrite(i8* %45, i32 4096, i32 1, i32* %44)
%47 = tail call i32 @fclose(i32* %44)
%48 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%49 = getelementptr inbounds i8, i8* %37, i64 9041
%50 = tail call i32 @fwrite(i8* %49, i32 16384, i32 1, i32* %48)
%51 = tail call i32 @fclose(i32* %48)
%52 = tail call i32 @free(i8* %37)
br label %53
53: ; preds = %6, %11, %4
%54 = phi i32 [ 1, %4 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %54
}