#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 char uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  FILE *fin, *fout;
  char buffer[512], oldbuffer[512];
  int i, size, lag = 0;
  uint8_t sum = 0;
  if (argc != 3) {
    printf("Usage: %s ROM OUTPUT\n", argv[0]);
    return 1;
  }
  fin = fopen(argv[1], "rb");
  fout = fopen(argv[2], "wb");
  if (fin == NULL || fout == NULL) {
    fprintf(stderr, "Could not open input/output files\n");
    return 1;
  }
  do {
    size = fread(buffer, 512, 1, fin);
    if (size == 1) {
      for (i = 0; i < 512; i++)
        sum += buffer[i];
      if (lag) {
        if (fwrite(oldbuffer, 512, 1, fout) != 1) {
          fprintf(stderr, "Write failed\n");
          return 1;
        }
      }
      lag = 1;
      memcpy(oldbuffer, buffer, 512);
    }
  } while (size == 1);
  if (size != 0) {
    fprintf(stderr, "Failed to read from input file\n");
    return 1;
  }
  oldbuffer[511] = -sum;
  if (fwrite(oldbuffer, 512, 1, fout) != 1) {
    fprintf(stderr, "Failed to write to output file\n");
    return 1;
  }
  fclose(fin);
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x42c(%rbp)
movb   $0x0,-0x42d(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11c3 <main+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe4e(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ce <main+0x25e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe44(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe2f(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1209 <main+0x99>
cmpq   $0x0,-0x20(%rbp)
jne    122a <main+0xba>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
lea    0xe03(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ce <main+0x25e>
jmp    122f <main+0xbf>
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x200,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x428(%rbp)
cmpl   $0x1,-0x428(%rbp)
jne    1320 <main+0x1b0>
movl   $0x0,-0x424(%rbp)
cmpl   $0x200,-0x424(%rbp)
jge    12a8 <main+0x138>
movslq -0x424(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%ecx
ff
movsbl -0x42d(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x42d(%rbp)
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    1266 <main+0xf6>
cmpl   $0x0,-0x42c(%rbp)
je     12fe <main+0x18e>
lea    -0x420(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x200,%esi
mov    $0x1,%edx
call   1090 <fwrite@plt>
cmp    $0x1,%eax
je     12f9 <main+0x189>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
lea    0xd57(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ce <main+0x25e>
jmp    12fe <main+0x18e>
movl   $0x1,-0x42c(%rbp)
lea    -0x420(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    $0x200,%edx
call   1070 <memcpy@plt>
jmp    1325 <main+0x1b5>
cmpl   $0x1,-0x428(%rbp)
je     122f <main+0xbf>
cmpl   $0x0,-0x428(%rbp)
je     1360 <main+0x1f0>
mov    0x2c9a(%rip),%rax
mov    (%rax),%edi
lea    0xcfe(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ce <main+0x25e>
movsbl -0x42d(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %al,-0x221(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x200,%esi
mov    $0x1,%edx
call   1090 <fwrite@plt>
cmp    $0x1,%eax
je     13b5 <main+0x245>
mov    0x2c45(%rip),%rax
mov    (%rax),%edi
lea    0xcc9(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ce <main+0x25e>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x420,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    13ae <main+0x23e>
mov    0x8(%rbx),%rdi
lea    0xe90(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r12
mov    0x10(%rbx),%rdi
lea    0xe80(%rip),%rsi
call   1080 <fopen@plt>
test   %r12,%r12
je     13bf <main+0x24f>
mov    %rax,%r14
test   %rax,%rax
je     13bf <main+0x24f>
lea    0x20(%rsp),%rdi
mov    $0x200,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    13d1 <main+0x261>
mov    $0x1,%cl
xor    %ebp,%ebp
lea    0x220(%rsp),%r15
lea    0x20(%rsp),%rbx
jmp    1249 <main+0xd9>
cs nopw 0x0(%rax,%rax,1)
paddb  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddb  %xmm1,%xmm0
psadbw 0xdeb(%rip),%xmm0
movd   %xmm0,%ebp
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1070 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x200,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
jne    13d3 <main+0x263>
movzbl %bpl,%eax
movd   %eax,%xmm0
paddb  0x20(%rsp),%xmm0
movdqa 0x50(%rsp),%xmm1
paddb  0x40(%rsp),%xmm0
paddb  0x30(%rsp),%xmm1
paddb  0x60(%rsp),%xmm0
paddb  0x70(%rsp),%xmm1
paddb  0x80(%rsp),%xmm0
paddb  0x90(%rsp),%xmm1
paddb  0xa0(%rsp),%xmm0
paddb  0xb0(%rsp),%xmm1
paddb  0xc0(%rsp),%xmm0
paddb  0xd0(%rsp),%xmm1
paddb  0xe0(%rsp),%xmm0
paddb  0xf0(%rsp),%xmm1
paddb  0x100(%rsp),%xmm0
paddb  0x110(%rsp),%xmm1
paddb  0x120(%rsp),%xmm0
paddb  0x130(%rsp),%xmm1
paddb  0x140(%rsp),%xmm0
paddb  0x150(%rsp),%xmm1
paddb  0x160(%rsp),%xmm0
paddb  0x170(%rsp),%xmm1
paddb  0x180(%rsp),%xmm0
paddb  0x190(%rsp),%xmm1
paddb  0x1a0(%rsp),%xmm0
paddb  0x1b0(%rsp),%xmm1
paddb  0x1c0(%rsp),%xmm0
paddb  0x1d0(%rsp),%xmm1
paddb  0x1e0(%rsp),%xmm0
paddb  0x1f0(%rsp),%xmm1
paddb  0x200(%rsp),%xmm0
paddb  0x210(%rsp),%xmm1
test   $0x1,%cl
jne    1200 <main+0x90>
mov    %r15,%rdi
mov    $0x200,%esi
mov    $0x1,%edx
mov    %r14,%rcx
movdqa %xmm0,0x10(%rsp)
movdqa %xmm1,(%rsp)
call   1090 <fwrite@plt>
movdqa (%rsp),%xmm1
movdqa 0x10(%rsp),%xmm0
cmp    $0x1,%eax
je     1200 <main+0x90>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
lea    0xca3(%rip),%rsi
jmp    13e7 <main+0x277>
mov    (%rbx),%rsi
lea    0xc58(%rip),%rdi
call   1050 <printf@plt>
jmp    13ec <main+0x27c>
mov    0x2c1a(%rip),%rax
mov    (%rax),%edi
lea    0xc5d(%rip),%rsi
jmp    13e7 <main+0x277>
xor    %ebp,%ebp
test   %eax,%eax
je     1403 <main+0x293>
mov    0x2c02(%rip),%rax
mov    (%rax),%edi
lea    0xc76(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x420,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
neg    %bpl
mov    %bpl,0x41f(%rsp)
lea    0x220(%rsp),%rdi
mov    $0x1,%ebx
mov    $0x200,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1090 <fwrite@plt>
cmp    $0x1,%eax
jne    1446 <main+0x2d6>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %ebx,%ebx
jmp    13f1 <main+0x281>
mov    0x2b93(%rip),%rax
mov    (%rax),%edi
lea    0xc27(%rip),%rsi
call   1060 <fprintf@plt>
jmp    13f1 <main+0x281>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s ROM OUTPUT\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.3 = [35 x i8] c"Could not open input/output files\0A\00"
@.str.4 = [14 x i8] c"Write failed\0A\00"
@.str.5 = [32 x i8] c"Failed to read from input file\0A\00"
@.str.6 = [32 x i8] c"Failed to write to output file\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 [512 x i8]
%9 = alloca [512 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %12
store i8 0, i8* %13
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 1, i32* %3
br label %106
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %25, i32** %6
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %29, i32** %7
%30 = load i32*, i32** %6
%31 = icmp eq i32* %30, null
br i1 %31, label %35, label %32
32: ; preds = %21
%33 = load i32*, i32** %7
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %38
35: ; preds = %32, %21
%36 = load i32, i32* @stderr
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %106
38: ; preds = %32
br label %39
39: ; preds = %79, %38
%40 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%41 = load i32*, i32** %6
%42 = call i32 @fread(i8* %40, i32 512, i32 1, i32* %41)
store i32 %42, i32* %11
%43 = load i32, i32* %11
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %78
45: ; preds = %39
store i32 0, i32* %10
br label %46
46: ; preds = %59, %45
%47 = load i32, i32* %10
%48 = icmp slt i32 %47, 512
br i1 %48, label %49, label %62
49: ; preds = %46
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = load i8, i8* %13
%56 = sext i8 %55 to i32
%57 = add nsw i32 %56, %54
%58 = trunc i32 %57 to i8
store i8 %58, i8* %13
br label %59
59: ; preds = %49
%60 = load i32, i32* %10
%61 = add nsw i32 %60, 1
store i32 %61, i32* %10
br label %46
62: ; preds = %46
%63 = load i32, i32* %12
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %74
65: ; preds = %62
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%67 = load i32*, i32** %7
%68 = call i32 @fwrite(i8* %66, i32 512, i32 1, i32* %67)
%69 = icmp ne i32 %68, 1
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = load i32, i32* @stderr
%72 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %106
73: ; preds = %65
br label %74
74: ; preds = %73, %62
store i32 1, i32* %12
%75 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%76 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%77 = call i32 @memcpy(i8* %75, i8* %76, i32 512)
br label %78
78: ; preds = %74, %39
br label %79
79: ; preds = %78
%80 = load i32, i32* %11
%81 = icmp eq i32 %80, 1
br i1 %81, label %39, label %82
82: ; preds = %79
%83 = load i32, i32* %11
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = load i32, i32* @stderr
%87 = call i32 @fprintf(i32 %86, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %106
88: ; preds = %82
%89 = load i8, i8* %13
%90 = sext i8 %89 to i32
%91 = sub nsw i32 0, %90
%92 = trunc i32 %91 to i8
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 511
store i8 %92, i8* %93
%94 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%95 = load i32*, i32** %7
%96 = call i32 @fwrite(i8* %94, i32 512, i32 1, i32* %95)
%97 = icmp ne i32 %96, 1
br i1 %97, label %98, label %101
98: ; preds = %88
%99 = load i32, i32* @stderr
%100 = call i32 @fprintf(i32 %99, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %106
101: ; preds = %88
%102 = load i32*, i32** %6
%103 = call i32 @fclose(i32* %102)
%104 = load i32*, i32** %7
%105 = call i32 @fclose(i32* %104)
store i32 0, i32* %3
br label %106
106: ; preds = %101, %98, %85, %70, %35, %16
%107 = load i32, i32* %3
ret i32 %107
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s ROM OUTPUT\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"wb\00"
@stderr = global i32 0
@.str.3 = [35 x i8] c"Could not open input/output files\0A\00"
@.str.4 = [14 x i8] c"Write failed\0A\00"
@.str.5 = [32 x i8] c"Failed to read from input file\0A\00"
@.str.6 = [32 x i8] c"Failed to write to output file\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %188
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32* %14, null
%19 = icmp eq i32* %17, null
%20 = or i1 %18, %19
br i1 %20, label %88, label %21
21: ; preds = %11
%22 = call i32 @fread(i8* %5, i32 512, i32 1, i32* %14)
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %170
24: ; preds = %21
%25 = bitcast [512 x i8]* %3 to <16 x i8>*
%26 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 16
%27 = bitcast i8* %26 to <16 x i8>*
%28 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 32
%29 = bitcast i8* %28 to <16 x i8>*
%30 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 48
%31 = bitcast i8* %30 to <16 x i8>*
%32 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 64
%33 = bitcast i8* %32 to <16 x i8>*
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 80
%35 = bitcast i8* %34 to <16 x i8>*
%36 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 96
%37 = bitcast i8* %36 to <16 x i8>*
%38 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 112
%39 = bitcast i8* %38 to <16 x i8>*
%40 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 128
%41 = bitcast i8* %40 to <16 x i8>*
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 144
%43 = bitcast i8* %42 to <16 x i8>*
%44 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 160
%45 = bitcast i8* %44 to <16 x i8>*
%46 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 176
%47 = bitcast i8* %46 to <16 x i8>*
%48 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 192
%49 = bitcast i8* %48 to <16 x i8>*
%50 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 208
%51 = bitcast i8* %50 to <16 x i8>*
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 224
%53 = bitcast i8* %52 to <16 x i8>*
%54 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 240
%55 = bitcast i8* %54 to <16 x i8>*
%56 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 256
%57 = bitcast i8* %56 to <16 x i8>*
%58 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 272
%59 = bitcast i8* %58 to <16 x i8>*
%60 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 288
%61 = bitcast i8* %60 to <16 x i8>*
%62 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 304
%63 = bitcast i8* %62 to <16 x i8>*
%64 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 320
%65 = bitcast i8* %64 to <16 x i8>*
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 336
%67 = bitcast i8* %66 to <16 x i8>*
%68 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 352
%69 = bitcast i8* %68 to <16 x i8>*
%70 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 368
%71 = bitcast i8* %70 to <16 x i8>*
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 384
%73 = bitcast i8* %72 to <16 x i8>*
%74 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 400
%75 = bitcast i8* %74 to <16 x i8>*
%76 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 416
%77 = bitcast i8* %76 to <16 x i8>*
%78 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 432
%79 = bitcast i8* %78 to <16 x i8>*
%80 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 448
%81 = bitcast i8* %80 to <16 x i8>*
%82 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 464
%83 = bitcast i8* %82 to <16 x i8>*
%84 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 480
%85 = bitcast i8* %84 to <16 x i8>*
%86 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 496
%87 = bitcast i8* %86 to <16 x i8>*
br label %91
88: ; preds = %11
%89 = load i32, i32* @stderr
%90 = tail call i32 @fprintf(i32 %89, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %188
91: ; preds = %24, %166
%92 = phi i8 [ %159, %166 ], [ 0, %24 ]
%93 = phi i1 [ false, %166 ], [ true, %24 ]
%94 = insertelement <16 x i8> <i8 poison, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, i8 %92, i64 0
%95 = load <16 x i8>, <16 x i8>* %25
%96 = load <16 x i8>, <16 x i8>* %27
%97 = add <16 x i8> %95, %94
%98 = load <16 x i8>, <16 x i8>* %29
%99 = load <16 x i8>, <16 x i8>* %31
%100 = add <16 x i8> %98, %97
%101 = add <16 x i8> %99, %96
%102 = load <16 x i8>, <16 x i8>* %33
%103 = load <16 x i8>, <16 x i8>* %35
%104 = add <16 x i8> %102, %100
%105 = add <16 x i8> %103, %101
%106 = load <16 x i8>, <16 x i8>* %37
%107 = load <16 x i8>, <16 x i8>* %39
%108 = add <16 x i8> %106, %104
%109 = add <16 x i8> %107, %105
%110 = load <16 x i8>, <16 x i8>* %41
%111 = load <16 x i8>, <16 x i8>* %43
%112 = add <16 x i8> %110, %108
%113 = add <16 x i8> %111, %109
%114 = load <16 x i8>, <16 x i8>* %45
%115 = load <16 x i8>, <16 x i8>* %47
%116 = add <16 x i8> %114, %112
%117 = add <16 x i8> %115, %113
%118 = load <16 x i8>, <16 x i8>* %49
%119 = load <16 x i8>, <16 x i8>* %51
%120 = add <16 x i8> %118, %116
%121 = add <16 x i8> %119, %117
%122 = load <16 x i8>, <16 x i8>* %53
%123 = load <16 x i8>, <16 x i8>* %55
%124 = add <16 x i8> %122, %120
%125 = add <16 x i8> %123, %121
%126 = load <16 x i8>, <16 x i8>* %57
%127 = load <16 x i8>, <16 x i8>* %59
%128 = add <16 x i8> %126, %124
%129 = add <16 x i8> %127, %125
%130 = load <16 x i8>, <16 x i8>* %61
%131 = load <16 x i8>, <16 x i8>* %63
%132 = add <16 x i8> %130, %128
%133 = add <16 x i8> %131, %129
%134 = load <16 x i8>, <16 x i8>* %65
%135 = load <16 x i8>, <16 x i8>* %67
%136 = add <16 x i8> %134, %132
%137 = add <16 x i8> %135, %133
%138 = load <16 x i8>, <16 x i8>* %69
%139 = load <16 x i8>, <16 x i8>* %71
%140 = add <16 x i8> %138, %136
%141 = add <16 x i8> %139, %137
%142 = load <16 x i8>, <16 x i8>* %73
%143 = load <16 x i8>, <16 x i8>* %75
%144 = add <16 x i8> %142, %140
%145 = add <16 x i8> %143, %141
%146 = load <16 x i8>, <16 x i8>* %77
%147 = load <16 x i8>, <16 x i8>* %79
%148 = add <16 x i8> %146, %144
%149 = add <16 x i8> %147, %145
%150 = load <16 x i8>, <16 x i8>* %81
%151 = load <16 x i8>, <16 x i8>* %83
%152 = add <16 x i8> %150, %148
%153 = add <16 x i8> %151, %149
%154 = load <16 x i8>, <16 x i8>* %85
%155 = load <16 x i8>, <16 x i8>* %87
%156 = add <16 x i8> %154, %152
%157 = add <16 x i8> %155, %153
%158 = add <16 x i8> %157, %156
%159 = call i8 @llvm.vector.reduce.add.v16i8(<16 x i8> %158)
br i1 %93, label %166, label %160
160: ; preds = %91
%161 = call i32 @fwrite(i8* %6, i32 512, i32 1, i32* %17)
%162 = icmp eq i32 %161, 1
br i1 %162, label %166, label %163
163: ; preds = %160
%164 = load i32, i32* @stderr
%165 = call i32 @fprintf(i32 %164, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %188
166: ; preds = %91, %160
%167 = call i32 @memcpy(i8* %6, i8* %5, i32 512)
%168 = call i32 @fread(i8* %5, i32 512, i32 1, i32* %14)
%169 = icmp eq i32 %168, 1
br i1 %169, label %91, label %170
170: ; preds = %166, %21
%171 = phi i8 [ 0, %21 ], [ %159, %166 ]
%172 = phi i32 [ %22, %21 ], [ %168, %166 ]
%173 = icmp eq i32 %172, 0
br i1 %173, label %177, label %174
174: ; preds = %170
%175 = load i32, i32* @stderr
%176 = call i32 @fprintf(i32 %175, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
br label %188
177: ; preds = %170
%178 = sub i8 0, %171
%179 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 511
store i8 %178, i8* %179
%180 = call i32 @fwrite(i8* %6, i32 512, i32 1, i32* %17)
%181 = icmp eq i32 %180, 1
br i1 %181, label %185, label %182
182: ; preds = %177
%183 = load i32, i32* @stderr
%184 = call i32 @fprintf(i32 %183, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %188
185: ; preds = %177
%186 = call i32 @fclose(i32* %14)
%187 = call i32 @fclose(i32* %17)
br label %188
188: ; preds = %185, %182, %174, %163, %88, %8
%189 = phi i32 [ 1, %8 ], [ 1, %88 ], [ 1, %163 ], [ 1, %174 ], [ 1, %182 ], [ 0, %185 ]
ret i32 %189
}