#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 */
struct stat {
  unsigned int st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(unsigned char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, unsigned int,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fstat(int /*<<< orphan*/, struct stat *);
int /*<<< orphan*/ fwrite(unsigned char *, int, unsigned int,
                          int /*<<< orphan*/ *);
unsigned char *malloc(int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
int /*<<< orphan*/ memset(unsigned char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int vmlbuild(unsigned char *vmlimage, unsigned char *cromimage) {
  FILE *f;
  unsigned int vmlsize;
  int a;
  unsigned char *crom;
  unsigned char *vml;
  unsigned int romsize = 0;
  struct stat fileinfo;
  crom = malloc(1024 * 1024);
  vml = malloc(1024 * 1024 + 0x3000);
  printf("VML Mode\n");
  f = fopen(cromimage, "r");
  if (f == NULL) {
    fprintf(stderr, "Unable to open cromwell image file %s : %s \nAborting\n",
            cromimage, strerror(errno));
    return 1;
  }
  fstat(fileno(f), &fileinfo);
  romsize = fileinfo.st_size;
  if (romsize > 0x100000) {
    printf("Romsize too big, increase the static variables everywhere");
    return 1;
  }
  fseek(f, 0, SEEK_SET);
  fread(crom, 1, romsize, f);
  fclose(f);
  f = fopen(vmlimage, "r");
  if (f == NULL) {
    fprintf(stderr, "Unable to open vml image file %s : %s \nAborting\n",
            vmlimage, strerror(errno));
    return 1;
  }
  fstat(fileno(f), &fileinfo);
  vmlsize = fileinfo.st_size;
  fseek(f, 0, SEEK_SET);
  fread(vml, 1, vmlsize, f);
  fclose(f);
  memcpy(&vml[0x1700], crom, romsize);
  memset(&vml[0x1700 + romsize], 0x0, 100);
  vmlsize += romsize;
  vmlsize += 100;
  f = fopen(vmlimage, "w");
  if (f == NULL) {
    fprintf(stderr, "Unable to open vml image file %s : %s \nAborting\n",
            vmlimage, strerror(errno));
    return 1;
  }
  fwrite(vml, 1, vmlsize, f);
  fclose(f);
  printf("VML File Created         : %s\n", vmlimage);
  return 0;
}


x86 assembly (clang, -O0):
<vmlbuild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    $0x100000,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x103000,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x38(%rbp)
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdee(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1274 <vmlbuild+0xa4>
mov    0x2da9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%rdx
mov    %rax,%rcx
lea    0xda9(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1476 <vmlbuild+0x2a6>
mov    -0x20(%rbp),%rdi
call   1090 <fileno@plt>
mov    %eax,%edi
lea    -0x40(%rbp),%rsi
call   10f0 <fstat@plt>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x100000,-0x3c(%rbp)
jbe    12b5 <vmlbuild+0xe5>
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1476 <vmlbuild+0x2a6>
mov    -0x20(%rbp),%rdi
mov    0x2d10(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x30(%rbp),%rdi
mov    -0x3c(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
lea    0xd18(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    134a <vmlbuild+0x17a>
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2cb7(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x5c(%rbp),%edi
mov    -0x58(%rbp),%rdx
mov    %rax,%rcx
lea    0xd43(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1476 <vmlbuild+0x2a6>
mov    -0x20(%rbp),%rdi
call   1090 <fileno@plt>
mov    %eax,%edi
lea    -0x40(%rbp),%rsi
call   10f0 <fstat@plt>
mov    -0x40(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2c61(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rdi
add    $0x1700,%rdi
mov    -0x30(%rbp),%rsi
mov    -0x3c(%rbp),%edx
call   1080 <memcpy@plt>
mov    -0x38(%rbp),%rdi
mov    -0x3c(%rbp),%eax
add    $0x1700,%eax
mov    %eax,%eax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
mov    -0x3c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xcc6(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    143f <vmlbuild+0x26f>
mov    0x2bde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x2bc2(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rdx
mov    %rax,%rcx
lea    0xc4e(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1476 <vmlbuild+0x2a6>
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   10d0 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rsi
lea    0xc47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmlbuild>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbp
mov    %rdi,%r14
mov    $0x100000,%edi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    $0x103000,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
lea    0xddf(%rip),%rsi
mov    %rbp,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1268 <vmlbuild+0x88>
mov    %rax,%rbx
mov    %rax,%rdi
call   10a0 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1100 <fstat@plt>
mov    (%rsp),%r13d
cmp    $0x100001,%r13
jb     129d <vmlbuild+0xbd>
lea    0xde1(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebp
jmp    13e7 <vmlbuild+0x207>
mov    0x2d71(%rip),%rax
mov    (%rax),%ebx
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xd7c(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
call   1080 <fprintf@plt>
mov    $0x1,%ebp
jmp    13e7 <vmlbuild+0x207>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    $0x1,%ebp
mov    %r12,%rdi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xd29(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     13bc <vmlbuild+0x1dc>
mov    %rax,%rbx
mov    %rax,%rdi
call   10a0 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1100 <fstat@plt>
mov    %r14,0x10(%rsp)
mov    (%rsp),%r14d
mov    0x2cc3(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    $0x1,%ebp
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,0x8(%rsp)
mov    %r14d,%edx
mov    0x10(%rsp),%r14
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0x1700(%r15),%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1090 <memcpy@plt>
lea    (%r15,%r13,1),%rdi
add    $0x1700,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1070 <memset@plt>
lea    0xd30(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     13bc <vmlbuild+0x1dc>
mov    %rax,%rbx
mov    0x8(%rsp),%rax
lea    (%rax,%r13,1),%edx
add    $0x64,%edx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xcf7(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %ebp,%ebp
jmp    13e7 <vmlbuild+0x207>
mov    0x2c1d(%rip),%rax
mov    (%rax),%ebx
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xc98(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
call   1080 <fprintf@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [10 x i8] c"VML Mode\0A\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [54 x i8] c"Unable to open cromwell image file %s : %s \0AAborting\0A\00"
@errno = global i32 0
@.str.3 = [58 x i8] c"Romsize too big, increase the static variables everywhere\00"
@SEEK_SET = global i32 0
@.str.4 = [49 x i8] c"Unable to open vml image file %s : %s \0AAborting\0A\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [31 x i8] c"VML File Created : %s\0A\00"
define i32 @vmlbuild(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca %struct.stat
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %11
%13 = call i8* @malloc(i32 1048576)
store i8* %13, i8** %9
%14 = call i8* @malloc(i32 1060864)
store i8* %14, i8** %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %5
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %6
%18 = load i32*, i32** %6
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %26
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8*, i8** %5
%23 = load i32, i32* @errno
%24 = call i8* @strerror(i32 %23)
%25 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i8* %22, i8* %24)
store i32 1, i32* %3
br label %106
26: ; preds = %2
%27 = load i32*, i32** %6
%28 = call i32 @fileno(i32* %27)
%29 = call i32 @fstat(i32 %28, %struct.stat* %12)
%30 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%31 = load i32, i32* %30
store i32 %31, i32* %11
%32 = load i32, i32* %11
%33 = icmp ugt i32 %32, 1048576
br i1 %33, label %34, label %36
34: ; preds = %26
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %106
36: ; preds = %26
%37 = load i32*, i32** %6
%38 = load i32, i32* @SEEK_SET
%39 = call i32 @fseek(i32* %37, i32 0, i32 %38)
%40 = load i8*, i8** %9
%41 = load i32, i32* %11
%42 = load i32*, i32** %6
%43 = call i32 @fread(i8* %40, i32 1, i32 %41, i32* %42)
%44 = load i32*, i32** %6
%45 = call i32 @fclose(i32* %44)
%46 = load i8*, i8** %4
%47 = call i32* @fopen(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %47, i32** %6
%48 = load i32*, i32** %6
%49 = icmp eq i32* %48, null
br i1 %49, label %50, label %56
50: ; preds = %36
%51 = load i32, i32* @stderr
%52 = load i8*, i8** %4
%53 = load i32, i32* @errno
%54 = call i8* @strerror(i32 %53)
%55 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %52, i8* %54)
store i32 1, i32* %3
br label %106
56: ; preds = %36
%57 = load i32*, i32** %6
%58 = call i32 @fileno(i32* %57)
%59 = call i32 @fstat(i32 %58, %struct.stat* %12)
%60 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%61 = load i32, i32* %60
store i32 %61, i32* %7
%62 = load i32*, i32** %6
%63 = load i32, i32* @SEEK_SET
%64 = call i32 @fseek(i32* %62, i32 0, i32 %63)
%65 = load i8*, i8** %10
%66 = load i32, i32* %7
%67 = load i32*, i32** %6
%68 = call i32 @fread(i8* %65, i32 1, i32 %66, i32* %67)
%69 = load i32*, i32** %6
%70 = call i32 @fclose(i32* %69)
%71 = load i8*, i8** %10
%72 = getelementptr inbounds i8, i8* %71, i64 5888
%73 = load i8*, i8** %9
%74 = load i32, i32* %11
%75 = call i32 @memcpy(i8* %72, i8* %73, i32 %74)
%76 = load i8*, i8** %10
%77 = load i32, i32* %11
%78 = add i32 5888, %77
%79 = zext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %76, i64 %79
%81 = call i32 @memset(i8* %80, i32 0, i32 100)
%82 = load i32, i32* %11
%83 = load i32, i32* %7
%84 = add i32 %83, %82
store i32 %84, i32* %7
%85 = load i32, i32* %7
%86 = add i32 %85, 100
store i32 %86, i32* %7
%87 = load i8*, i8** %4
%88 = call i32* @fopen(i8* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %88, i32** %6
%89 = load i32*, i32** %6
%90 = icmp eq i32* %89, null
br i1 %90, label %91, label %97
91: ; preds = %56
%92 = load i32, i32* @stderr
%93 = load i8*, i8** %4
%94 = load i32, i32* @errno
%95 = call i8* @strerror(i32 %94)
%96 = call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %93, i8* %95)
store i32 1, i32* %3
br label %106
97: ; preds = %56
%98 = load i8*, i8** %10
%99 = load i32, i32* %7
%100 = load i32*, i32** %6
%101 = call i32 @fwrite(i8* %98, i32 1, i32 %99, i32* %100)
%102 = load i32*, i32** %6
%103 = call i32 @fclose(i32* %102)
%104 = load i8*, i8** %4
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %104)
store i32 0, i32* %3
br label %106
106: ; preds = %97, %91, %50, %34, %20
%107 = load i32, i32* %3
ret i32 %107
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [54 x i8] c"Unable to open cromwell image file %s : %s \0AAborting\0A\00"
@errno = global i32 0
@.str.3 = [58 x i8] c"Romsize too big, increase the static variables everywhere\00"
@SEEK_SET = global i32 0
@.str.4 = [49 x i8] c"Unable to open vml image file %s : %s \0AAborting\0A\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [31 x i8] c"VML File Created : %s\0A\00"
@str = [9 x i8] c"VML Mode\00"
define i32 @vmlbuild(i8* %0, i8* %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = tail call dereferenceable_or_null(1048576) i8* @malloc(i32 1048576)
%6 = tail call dereferenceable_or_null(1060864) i8* @malloc(i32 1060864)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%8 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = tail call i8* @strerror(i32 %12)
%14 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* %13)
br label %62
15: ; preds = %2
%16 = tail call i32 @fileno(i32* %8)
%17 = call i32 @fstat(i32 %16, %struct.stat* %3)
%18 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%19 = load i32, i32* %18
%20 = icmp ugt i32 %19, 1048576
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
br label %62
23: ; preds = %15
%24 = load i32, i32* @SEEK_SET
%25 = tail call i32 @fseek(i32* %8, i32 0, i32 %24)
%26 = tail call i32 @fread(i8* %5, i32 1, i32 %19, i32* %8)
%27 = tail call i32 @fclose(i32* %8)
%28 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %35
30: ; preds = %23
%31 = load i32, i32* @stderr
%32 = load i32, i32* @errno
%33 = tail call i8* @strerror(i32 %32)
%34 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %33)
br label %62
35: ; preds = %23
%36 = tail call i32 @fileno(i32* %28)
%37 = call i32 @fstat(i32 %36, %struct.stat* %3)
%38 = load i32, i32* %18
%39 = load i32, i32* @SEEK_SET
%40 = tail call i32 @fseek(i32* %28, i32 0, i32 %39)
%41 = tail call i32 @fread(i8* %6, i32 1, i32 %38, i32* %28)
%42 = tail call i32 @fclose(i32* %28)
%43 = getelementptr inbounds i8, i8* %6, i64 5888
%44 = tail call i32 @memcpy(i8* %43, i8* %5, i32 %19)
%45 = add nuw nsw i32 %19, 5888
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %6, i64 %46
%48 = tail call i32 @memset(i8* %47, i32 0, i32 100)
%49 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %56
51: ; preds = %35
%52 = load i32, i32* @stderr
%53 = load i32, i32* @errno
%54 = tail call i8* @strerror(i32 %53)
%55 = tail call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %54)
br label %62
56: ; preds = %35
%57 = add nuw nsw i32 %19, 100
%58 = add i32 %57, %38
%59 = tail call i32 @fwrite(i8* %6, i32 1, i32 %58, i32* %49)
%60 = tail call i32 @fclose(i32* %49)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %0)
br label %62
62: ; preds = %56, %51, %30, %21, %10
%63 = phi i32 [ 1, %10 ], [ 1, %21 ], [ 1, %30 ], [ 1, %51 ], [ 0, %56 ]
ret i32 %63
}