#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*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  FILE *fp;
  char *Buf, *a;
  int BufLen;
  int nbytes, fileLen;
  unsigned int checksum, count;
  int i;
  if (argc != 3) {
    printf("Usage: mkbl1 <source file> <destination file>\n");
    return -1;
  }
  BufLen = (8 * 1024);
  Buf = (char *)malloc(BufLen);
  if (!Buf) {
    printf("Alloc buffer failed!\n");
    return -1;
  }
  memset(Buf, 0x00, BufLen);
  fp = fopen(argv[1], "rb");
  if (fp == NULL) {
    printf("source file open error\n");
    free(Buf);
    return -1;
  }
  fseek(fp, 0L, SEEK_END);
  fileLen = ftell(fp);
  fseek(fp, 0L, SEEK_SET);
  count = (fileLen < ((8 * 1024) - 16)) ? fileLen : ((8 * 1024) - 16);
  Buf[0] = 0x00;
  Buf[1] = 0x20;
  nbytes = fread(Buf + 16, 1, count, fp);
  if (nbytes != count) {
    printf("source file read error\n");
    free(Buf);
    fclose(fp);
    return -1;
  }
  fclose(fp);
  a = Buf + 16;
  for (i = 0, checksum = 0; i < (8 * 1024) - 16; i++)
    checksum += (0x000000FF) & *a++;
  a = Buf + 8;
  *((unsigned int *)a) = checksum;
  fp = fopen(argv[2], "wb");
  if (fp == NULL) {
    printf("destination file open error\n");
    free(Buf);
    return -1;
  }
  a = Buf;
  nbytes = fwrite(a, 1, BufLen, fp);
  if (nbytes != BufLen) {
    printf("destination file write error\n");
    free(Buf);
    fclose(fp);
    return -1;
  }
  free(Buf);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11d8 <main+0x38>
lea    0xe39(%rip),%rdi
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1447 <main+0x2a7>
movl   $0x2000,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    120e <main+0x6e>
lea    0xe32(%rip),%rdi
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1447 <main+0x2a7>
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1260 <main+0xc0>
lea    0xe02(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1447 <main+0x2a7>
mov    -0x18(%rbp),%rdi
mov    0x2d7d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d4b(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <fseek@plt>
cmpl   $0x1ff0,-0x34(%rbp)
jge    12b0 <main+0x110>
mov    -0x34(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    12bd <main+0x11d>
mov    $0x1ff0,%eax
mov    %eax,-0x44(%rbp)
jmp    12bd <main+0x11d>
mov    -0x44(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x20,0x1(%rax)
mov    -0x20(%rbp),%rdi
add    $0x10,%rdi
mov    -0x3c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x3c(%rbp),%eax
je     1324 <main+0x184>
lea    0xd5f(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1447 <main+0x2a7>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x1ff0,-0x40(%rbp)
jge    137f <main+0x1df>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%eax
and    $0xff,%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1347 <main+0x1a7>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcd5(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13d8 <main+0x238>
lea    0xcbd(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1447 <main+0x2a7>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   10c0 <fwrite@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
je     142e <main+0x28e>
lea    0xc8d(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1447 <main+0x2a7>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x3,%edi
jne    1336 <main+0x196>
mov    %rsi,%r14
mov    $0x2000,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     133f <main+0x19f>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1070 <memset@plt>
mov    0x8(%r14),%rdi
lea    0xe1c(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1359 <main+0x1b9>
mov    %rax,%r15
mov    0x2dec(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %r15,%rdi
call   1080 <ftell@plt>
mov    %eax,%r12d
mov    0x2dbe(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
cmp    $0x1ff0,%r12d
mov    $0x1ff0,%ebp
cmovl  %r12d,%ebp
movw   $0x2000,(%rbx)
mov    %rbx,%rdi
add    $0x10,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %r15,%rcx
call   1050 <fread@plt>
cmp    %ebp,%eax
jne    1362 <main+0x1c2>
mov    %r15,%rdi
call   1060 <fclose@plt>
pxor   %xmm0,%xmm0
mov    $0x1c,%eax
pxor   %xmm2,%xmm2
pxor   %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movd   -0xc(%rbx,%rax,1),%xmm3
movd   -0x8(%rbx,%rax,1),%xmm4
punpcklbw %xmm0,%xmm3
punpcklwd %xmm0,%xmm3
paddd  %xmm2,%xmm3
punpcklbw %xmm0,%xmm4
punpcklwd %xmm0,%xmm4
paddd  %xmm1,%xmm4
movd   -0x4(%rbx,%rax,1),%xmm2
movd   (%rbx,%rax,1),%xmm1
punpcklbw %xmm0,%xmm2
punpcklwd %xmm0,%xmm2
paddd  %xmm3,%xmm2
punpcklbw %xmm0,%xmm1
punpcklwd %xmm0,%xmm1
paddd  %xmm4,%xmm1
add    $0x10,%rax
cmp    $0x200c,%rax
jne    1280 <main+0xe0>
paddd  %xmm2,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,0x8(%rbx)
mov    0x10(%r14),%rdi
lea    0xd0a(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     137b <main+0x1db>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2000,%edx
mov    %rax,%rcx
call   10c0 <fwrite@plt>
cmp    $0x2000,%eax
jne    1391 <main+0x1f1>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
jmp    1350 <main+0x1b0>
lea    0xd45(%rip),%rdi
jmp    1346 <main+0x1a6>
lea    0xcc0(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd0b(%rip),%rdi
jmp    1382 <main+0x1e2>
lea    0xceb(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
jmp    13a8 <main+0x208>
lea    0xcb6(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    134b <main+0x1ab>
lea    0xc83(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
jmp    134b <main+0x1ab>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: mkbl1 <source file> <destination file>\0A\00"
@.str.1 = [22 x i8] c"Alloc buffer failed!\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [24 x i8] c"source file open error\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.4 = [24 x i8] c"source file read error\0A\00"
@.str.5 = [3 x i8] c"wb\00"
@.str.6 = [29 x i8] c"destination file open error\0A\00"
@.str.7 = [30 x i8] c"destination file write error\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 i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %130
19: ; preds = %2
store i32 8192, i32* %9
%20 = load i32, i32* %9
%21 = call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %7
%23 = load i8*, i8** %7
%24 = icmp ne i8* %23, null
br i1 %24, label %27, label %25
25: ; preds = %19
%26 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %130
27: ; preds = %19
%28 = load i8*, i8** %7
%29 = load i32, i32* %9
%30 = call i32 @memset(i8* %28, i32 0, i32 %29)
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %34, i32** %6
%35 = load i32*, i32** %6
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %41
37: ; preds = %27
%38 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%39 = load i8*, i8** %7
%40 = call i32 @free(i8* %39)
store i32 -1, i32* %3
br label %130
41: ; preds = %27
%42 = load i32*, i32** %6
%43 = load i32, i32* @SEEK_END
%44 = call i32 @fseek(i32* %42, i64 0, i32 %43)
%45 = load i32*, i32** %6
%46 = call i32 @ftell(i32* %45)
store i32 %46, i32* %11
%47 = load i32*, i32** %6
%48 = load i32, i32* @SEEK_SET
%49 = call i32 @fseek(i32* %47, i64 0, i32 %48)
%50 = load i32, i32* %11
%51 = icmp slt i32 %50, 8176
br i1 %51, label %52, label %54
52: ; preds = %41
%53 = load i32, i32* %11
br label %55
54: ; preds = %41
br label %55
55: ; preds = %54, %52
%56 = phi i32 [ %53, %52 ], [ 8176, %54 ]
store i32 %56, i32* %13
%57 = load i8*, i8** %7
%58 = getelementptr inbounds i8, i8* %57, i64 0
store i8 0, i8* %58
%59 = load i8*, i8** %7
%60 = getelementptr inbounds i8, i8* %59, i64 1
store i8 32, i8* %60
%61 = load i8*, i8** %7
%62 = getelementptr inbounds i8, i8* %61, i64 16
%63 = load i32, i32* %13
%64 = load i32*, i32** %6
%65 = call i32 @fread(i8* %62, i32 1, i32 %63, i32* %64)
store i32 %65, i32* %10
%66 = load i32, i32* %10
%67 = load i32, i32* %13
%68 = icmp ne i32 %66, %67
br i1 %68, label %69, label %75
69: ; preds = %55
%70 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%71 = load i8*, i8** %7
%72 = call i32 @free(i8* %71)
%73 = load i32*, i32** %6
%74 = call i32 @fclose(i32* %73)
store i32 -1, i32* %3
br label %130
75: ; preds = %55
%76 = load i32*, i32** %6
%77 = call i32 @fclose(i32* %76)
%78 = load i8*, i8** %7
%79 = getelementptr inbounds i8, i8* %78, i64 16
store i8* %79, i8** %8
store i32 0, i32* %14
store i32 0, i32* %12
br label %80
80: ; preds = %91, %75
%81 = load i32, i32* %14
%82 = icmp slt i32 %81, 8176
br i1 %82, label %83, label %94
83: ; preds = %80
%84 = load i8*, i8** %8
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %8
%86 = load i8, i8* %84
%87 = sext i8 %86 to i32
%88 = and i32 255, %87
%89 = load i32, i32* %12
%90 = add i32 %89, %88
store i32 %90, i32* %12
br label %91
91: ; preds = %83
%92 = load i32, i32* %14
%93 = add nsw i32 %92, 1
store i32 %93, i32* %14
br label %80
94: ; preds = %80
%95 = load i8*, i8** %7
%96 = getelementptr inbounds i8, i8* %95, i64 8
store i8* %96, i8** %8
%97 = load i32, i32* %12
%98 = load i8*, i8** %8
%99 = bitcast i8* %98 to i32*
store i32 %97, i32* %99
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 2
%102 = load i8*, i8** %101
%103 = call i32* @fopen(i8* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %103, i32** %6
%104 = load i32*, i32** %6
%105 = icmp eq i32* %104, null
br i1 %105, label %106, label %110
106: ; preds = %94
%107 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%108 = load i8*, i8** %7
%109 = call i32 @free(i8* %108)
store i32 -1, i32* %3
br label %130
110: ; preds = %94
%111 = load i8*, i8** %7
store i8* %111, i8** %8
%112 = load i8*, i8** %8
%113 = load i32, i32* %9
%114 = load i32*, i32** %6
%115 = call i32 @fwrite(i8* %112, i32 1, i32 %113, i32* %114)
store i32 %115, i32* %10
%116 = load i32, i32* %10
%117 = load i32, i32* %9
%118 = icmp ne i32 %116, %117
br i1 %118, label %119, label %125
119: ; preds = %110
%120 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%121 = load i8*, i8** %7
%122 = call i32 @free(i8* %121)
%123 = load i32*, i32** %6
%124 = call i32 @fclose(i32* %123)
store i32 -1, i32* %3
br label %130
125: ; preds = %110
%126 = load i8*, i8** %7
%127 = call i32 @free(i8* %126)
%128 = load i32*, i32** %6
%129 = call i32 @fclose(i32* %128)
store i32 0, i32* %3
br label %130
130: ; preds = %125, %119, %106, %69, %37, %25, %17
%131 = load i32, i32* %3
ret i32 %131
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.5 = [3 x i8] c"wb\00"
@str = [21 x i8] c"Alloc buffer failed!\00"
@str.8 = [29 x i8] c"destination file write error\00"
@str.9 = [28 x i8] c"destination file open error\00"
@str.10 = [23 x i8] c"source file read error\00"
@str.11 = [23 x i8] c"source file open error\00"
@str.12 = [46 x i8] c"Usage: mkbl1 <source file> <destination file>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.12, i64 0, i64 0))
br label %88
6: ; preds = %2
%7 = tail call i64 @malloc(i32 8192)
%8 = inttoptr i64 %7 to i8*
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %88
12: ; preds = %6
%13 = tail call i32 @memset(i8* %8, i32 0, i32 8192)
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32* @fopen(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.11, i64 0, i64 0))
%20 = tail call i32 @free(i8* %8)
br label %88
21: ; preds = %12
%22 = load i32, i32* @SEEK_END
%23 = tail call i32 @fseek(i32* %16, i64 0, i32 %22)
%24 = tail call i32 @ftell(i32* %16)
%25 = load i32, i32* @SEEK_SET
%26 = tail call i32 @fseek(i32* %16, i64 0, i32 %25)
%27 = icmp slt i32 %24, 8176
%28 = select i1 %27, i32 %24, i32 8176
store i8 0, i8* %8
%29 = getelementptr inbounds i8, i8* %8, i64 1
store i8 32, i8* %29
%30 = getelementptr inbounds i8, i8* %8, i64 16
%31 = tail call i32 @fread(i8* %30, i32 1, i32 %28, i32* %16)
%32 = icmp eq i32 %31, %28
br i1 %32, label %37, label %33
33: ; preds = %21
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.10, i64 0, i64 0))
%35 = tail call i32 @free(i8* %8)
%36 = tail call i32 @fclose(i32* %16)
br label %88
37: ; preds = %21
%38 = tail call i32 @fclose(i32* %16)
br label %39
39: ; preds = %39, %37
%40 = phi i64 [ 0, %37 ], [ %64, %39 ]
%41 = phi <4 x i32> [ zeroinitializer, %37 ], [ %62, %39 ]
%42 = phi <4 x i32> [ zeroinitializer, %37 ], [ %63, %39 ]
%43 = getelementptr i8, i8* %30, i64 %40
%44 = bitcast i8* %43 to <4 x i8>*
%45 = load <4 x i8>, <4 x i8>* %44
%46 = getelementptr i8, i8* %43, i64 4
%47 = bitcast i8* %46 to <4 x i8>*
%48 = load <4 x i8>, <4 x i8>* %47
%49 = zext <4 x i8> %45 to <4 x i32>
%50 = zext <4 x i8> %48 to <4 x i32>
%51 = add <4 x i32> %41, %49
%52 = add <4 x i32> %42, %50
%53 = or i64 %40, 8
%54 = getelementptr i8, i8* %30, i64 %53
%55 = bitcast i8* %54 to <4 x i8>*
%56 = load <4 x i8>, <4 x i8>* %55
%57 = getelementptr i8, i8* %54, i64 4
%58 = bitcast i8* %57 to <4 x i8>*
%59 = load <4 x i8>, <4 x i8>* %58
%60 = zext <4 x i8> %56 to <4 x i32>
%61 = zext <4 x i8> %59 to <4 x i32>
%62 = add <4 x i32> %51, %60
%63 = add <4 x i32> %52, %61
%64 = add nuw nsw i64 %40, 16
%65 = icmp eq i64 %64, 8176
br i1 %65, label %66, label %39
66: ; preds = %39
%67 = add <4 x i32> %63, %62
%68 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %67)
%69 = getelementptr inbounds i8, i8* %8, i64 8
%70 = bitcast i8* %69 to i32*
store i32 %68, i32* %70
%71 = getelementptr inbounds i8*, i8** %1, i64 2
%72 = load i8*, i8** %71
%73 = tail call i32* @fopen(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%74 = icmp eq i32* %73, null
br i1 %74, label %75, label %78
75: ; preds = %66
%76 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.9, i64 0, i64 0))
%77 = tail call i32 @free(i8* %8)
br label %88
78: ; preds = %66
%79 = tail call i32 @fwrite(i8* %8, i32 1, i32 8192, i32* %73)
%80 = icmp eq i32 %79, 8192
br i1 %80, label %85, label %81
81: ; preds = %78
%82 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.8, i64 0, i64 0))
%83 = tail call i32 @free(i8* %8)
%84 = tail call i32 @fclose(i32* %73)
br label %88
85: ; preds = %78
%86 = tail call i32 @free(i8* %8)
%87 = tail call i32 @fclose(i32* %73)
br label %88
88: ; preds = %85, %81, %75, %33, %18, %10, %4
%89 = phi i32 [ -1, %4 ], [ -1, %18 ], [ -1, %33 ], [ -1, %75 ], [ -1, %81 ], [ 0, %85 ], [ -1, %10 ]
ret i32 %89
}