#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ SEEK_SET;
scalar_t__ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ lseek(int, long, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int read(int, int *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int write(int, int *, int);
int main(int argc, char *argv[]) {
  uint8_t buf[512];
  uint8_t n = 0;
  uint8_t base;
  int c;
  int fd;
  if (argc != 3) {
    fprintf(stderr, "%s: file <dotmatrix|daisy>.\n", argv[0]);
    exit(1);
  }
  if (strcmp(argv[2], "daisy") == 0)
    base = 0x01;
  else if (strcmp(argv[2], "dotmatrix") == 0)
    base = 0xFF;
  else {
    fprintf(stderr, "%s: unknown machine class '%s'.\n", argv[0], argv[2]);
    exit(1);
  }
  fd = open(argv[1], O_RDWR);
  if (fd == -1) {
    perror(argv[1]);
    exit(1);
  }
  if (read(fd, buf, 512) != 512) {
    fprintf(stderr, "Wrong size\n");
    exit(1);
  }
  if (lseek(fd, 0L, SEEK_SET) < 0) {
    perror(argv[1]);
    exit(1);
  }
  for (c = 0x0; c < 0x1ff; c++)
    n += buf[c];
  buf[0x1ff] = base - n;
  printf("Checksum set to %02x\n", buf[0x1ff]);
  if (write(fd, buf, 512) != 512 || close(fd)) {
    fprintf(stderr, "%s: write failed.\n", argv[1]);
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x814(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11f5 <main+0x55>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe19(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1222 <main+0x82>
movl   $0x1,-0x818(%rbp)
jmp    1284 <main+0xe4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdf2(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    124f <main+0xaf>
movl   $0xff,-0x818(%rbp)
jmp    127f <main+0xdf>
mov    0x2d82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    1284 <main+0xe4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d55(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x820(%rbp)
cmpl   $0xffffffff,-0x820(%rbp)
jne    12c4 <main+0x124>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x820(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    $0x200,%edx
call   1070 <read@plt>
cmp    $0x200,%eax
je     1307 <main+0x167>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
lea    0xd58(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x820(%rbp),%edi
mov    0x2cbc(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <lseek@plt>
cmp    $0x0,%rax
jge    1340 <main+0x1a0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
movl   $0x0,-0x81c(%rbp)
cmpl   $0x1ff,-0x81c(%rbp)
jge    1388 <main+0x1e8>
movslq -0x81c(%rbp),%rax
mov    -0x810(%rbp,%rax,4),%eax
add    -0x814(%rbp),%eax
mov    %eax,-0x814(%rbp)
mov    -0x81c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x81c(%rbp)
jmp    134a <main+0x1aa>
mov    -0x818(%rbp),%eax
sub    -0x814(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xcb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x820(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    $0x200,%edx
call   1030 <write@plt>
cmp    $0x200,%eax
jne    13dd <main+0x23d>
mov    -0x820(%rbp),%edi
call   1060 <close@plt>
cmp    $0x0,%rax
je     1406 <main+0x266>
mov    0x2bf4(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xc7b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
xor    %eax,%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%r14
cmp    $0x3,%edi
jne    135a <main+0x1ba>
mov    0x10(%r14),%rdi
lea    0xe5b(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     120e <main+0x6e>
mov    0x10(%r14),%rdi
lea    0xe4c(%rip),%rsi
call   1080 <strcmp@plt>
mov    $0xff,%ebp
test   %rax,%rax
je     1213 <main+0x73>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
mov    0x10(%r14),%rcx
lea    0xe30(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    $0x1,%ebp
mov    0x8(%r14),%rdi
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
cmp    $0xffffffff,%eax
je     1331 <main+0x191>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x200,%edx
call   1070 <read@plt>
cmp    $0x200,%eax
jne    137e <main+0x1de>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
test   %rax,%rax
js     1331 <main+0x191>
pxor   %xmm0,%xmm0
xor    %eax,%eax
pxor   %xmm1,%xmm1
nop
paddd  (%rsp,%rax,4),%xmm0
paddd  0x10(%rsp,%rax,4),%xmm1
paddd  0x20(%rsp,%rax,4),%xmm0
paddd  0x30(%rsp,%rax,4),%xmm1
paddd  0x40(%rsp,%rax,4),%xmm0
paddd  0x50(%rsp,%rax,4),%xmm1
add    $0x18,%rax
cmp    $0x1f8,%rax
jne    1270 <main+0xd0>
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    0x7e0(%rsp),%eax
add    0x7e4(%rsp),%eax
add    0x7e8(%rsp),%eax
add    0x7ec(%rsp),%eax
add    0x7f0(%rsp),%eax
add    0x7f4(%rsp),%eax
add    0x7f8(%rsp),%eax
sub    %eax,%ebp
mov    %ebp,0x7fc(%rsp)
lea    0xd60(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0x200,%edx
call   1030 <write@plt>
cmp    $0x200,%eax
jne    1344 <main+0x1a4>
mov    %ebx,%edi
call   1060 <close@plt>
test   %rax,%rax
jne    1344 <main+0x1a4>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x8(%r14),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2c8d(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
lea    0xd18(%rip),%rsi
jmp    136d <main+0x1cd>
mov    0x2c77(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xc93(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2c53(%rip),%rax
mov    (%rax),%edi
lea    0xcc0(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"%s: file <dotmatrix|daisy>.\0A\00"
@.str.1 = [6 x i8] c"daisy\00"
@.str.2 = [10 x i8] c"dotmatrix\00"
@.str.3 = [33 x i8] c"%s: unknown machine class '%s'.\0A\00"
@O_RDWR = global i32 0
@.str.4 = [12 x i8] c"Wrong size\0A\00"
@SEEK_SET = global i32 0
@.str.5 = [22 x i8] c"Checksum set to %02x\0A\00"
@.str.6 = [19 x i8] c"%s: write failed.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [512 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 1, i32* %8
br label %45
27: ; preds = %20
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %27
store i32 255, i32* %8
br label %44
34: ; preds = %27
%35 = load i32, i32* @stderr
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %38, i8* %41)
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %33
br label %45
45: ; preds = %44, %26
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = load i32, i32* @O_RDWR
%50 = call i32 @open(i8* %48, i32 %49)
store i32 %50, i32* %10
%51 = load i32, i32* %10
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %59
53: ; preds = %45
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i32 @perror(i8* %56)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %45
%60 = load i32, i32* %10
%61 = getelementptr inbounds [512 x i32], [512 x i32]* %6, i64 0, i64 0
%62 = call i32 @read(i32 %60, i32* %61, i32 512)
%63 = icmp ne i32 %62, 512
br i1 %63, label %64, label %68
64: ; preds = %59
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %59
%69 = load i32, i32* %10
%70 = load i32, i32* @SEEK_SET
%71 = call i64 @lseek(i32 %69, i64 0, i32 %70)
%72 = icmp slt i64 %71, 0
br i1 %72, label %73, label %79
73: ; preds = %68
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 1
%76 = load i8*, i8** %75
%77 = call i32 @perror(i8* %76)
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %68
store i32 0, i32* %9
br label %80
80: ; preds = %90, %79
%81 = load i32, i32* %9
%82 = icmp slt i32 %81, 511
br i1 %82, label %83, label %93
83: ; preds = %80
%84 = load i32, i32* %9
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [512 x i32], [512 x i32]* %6, i64 0, i64 %85
%87 = load i32, i32* %86
%88 = load i32, i32* %7
%89 = add nsw i32 %88, %87
store i32 %89, i32* %7
br label %90
90: ; preds = %83
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
br label %80
93: ; preds = %80
%94 = load i32, i32* %8
%95 = load i32, i32* %7
%96 = sub nsw i32 %94, %95
%97 = getelementptr inbounds [512 x i32], [512 x i32]* %6, i64 0, i64 511
store i32 %96, i32* %97
%98 = getelementptr inbounds [512 x i32], [512 x i32]* %6, i64 0, i64 511
%99 = load i32, i32* %98
%100 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %10
%102 = getelementptr inbounds [512 x i32], [512 x i32]* %6, i64 0, i64 0
%103 = call i32 @write(i32 %101, i32* %102, i32 512)
%104 = icmp ne i32 %103, 512
br i1 %104, label %109, label %105
105: ; preds = %93
%106 = load i32, i32* %10
%107 = call i64 @close(i32 %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %116
109: ; preds = %105, %93
%110 = load i32, i32* @stderr
%111 = load i8**, i8*** %5
%112 = getelementptr inbounds i8*, i8** %111, i64 1
%113 = load i8*, i8** %112
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %113)
%115 = call i32 @exit(i32 1)
unreachable
116: ; preds = %105
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"%s: file <dotmatrix|daisy>.\0A\00"
@.str.1 = [6 x i8] c"daisy\00"
@.str.2 = [10 x i8] c"dotmatrix\00"
@.str.3 = [33 x i8] c"%s: unknown machine class '%s'.\0A\00"
@O_RDWR = global i32 0
@.str.4 = [12 x i8] c"Wrong size\0A\00"
@SEEK_SET = global i32 0
@.str.5 = [22 x i8] c"Checksum set to %02x\0A\00"
@.str.6 = [19 x i8] c"%s: write failed.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i32]
%4 = bitcast [512 x i32]* %3 to i8*
%5 = icmp eq i32 %0, 3
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %11
%17 = load i8*, i8** %12
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %26, label %20
20: ; preds = %16
%21 = load i32, i32* @stderr
%22 = load i8*, i8** %1
%23 = load i8*, i8** %12
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %22, i8* %23)
%25 = tail call i32 @exit(i32 1)
unreachable
26: ; preds = %16, %11
%27 = phi i32 [ 1, %11 ], [ 255, %16 ]
%28 = getelementptr inbounds i8*, i8** %1, i64 1
%29 = load i8*, i8** %28
%30 = load i32, i32* @O_RDWR
%31 = tail call i32 @open(i8* %29, i32 %30)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %37
33: ; preds = %26
%34 = load i8*, i8** %28
%35 = tail call i32 @perror(i8* %34)
%36 = tail call i32 @exit(i32 1)
unreachable
37: ; preds = %26
%38 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 0
%39 = call i32 @read(i32 %31, i32* %38, i32 512)
%40 = icmp eq i32 %39, 512
br i1 %40, label %45, label %41
41: ; preds = %37
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%44 = tail call i32 @exit(i32 1)
unreachable
45: ; preds = %37
%46 = load i32, i32* @SEEK_SET
%47 = tail call i64 @lseek(i32 %31, i64 0, i32 %46)
%48 = icmp slt i64 %47, 0
br i1 %48, label %81, label %49
49: ; preds = %45, %49
%50 = phi i64 [ %79, %49 ], [ 0, %45 ]
%51 = phi <4 x i32> [ %77, %49 ], [ zeroinitializer, %45 ]
%52 = phi <4 x i32> [ %78, %49 ], [ zeroinitializer, %45 ]
%53 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 %50
%54 = bitcast i32* %53 to <4 x i32>*
%55 = load <4 x i32>, <4 x i32>* %54
%56 = getelementptr inbounds i32, i32* %53, i64 4
%57 = bitcast i32* %56 to <4 x i32>*
%58 = load <4 x i32>, <4 x i32>* %57
%59 = add <4 x i32> %55, %51
%60 = add <4 x i32> %58, %52
%61 = add nuw nsw i64 %50, 8
%62 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 %61
%63 = bitcast i32* %62 to <4 x i32>*
%64 = load <4 x i32>, <4 x i32>* %63
%65 = getelementptr inbounds i32, i32* %62, i64 4
%66 = bitcast i32* %65 to <4 x i32>*
%67 = load <4 x i32>, <4 x i32>* %66
%68 = add <4 x i32> %64, %59
%69 = add <4 x i32> %67, %60
%70 = add nuw nsw i64 %50, 16
%71 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 %70
%72 = bitcast i32* %71 to <4 x i32>*
%73 = load <4 x i32>, <4 x i32>* %72
%74 = getelementptr inbounds i32, i32* %71, i64 4
%75 = bitcast i32* %74 to <4 x i32>*
%76 = load <4 x i32>, <4 x i32>* %75
%77 = add <4 x i32> %73, %68
%78 = add <4 x i32> %76, %69
%79 = add nuw nsw i64 %50, 24
%80 = icmp eq i64 %79, 504
br i1 %80, label %85, label %49
81: ; preds = %45
%82 = load i8*, i8** %28
%83 = tail call i32 @perror(i8* %82)
%84 = tail call i32 @exit(i32 1)
unreachable
85: ; preds = %49
%86 = add <4 x i32> %78, %77
%87 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %86)
%88 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 504
%89 = load i32, i32* %88
%90 = add nsw i32 %89, %87
%91 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 505
%92 = load i32, i32* %91
%93 = add nsw i32 %92, %90
%94 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 506
%95 = load i32, i32* %94
%96 = add nsw i32 %95, %93
%97 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 507
%98 = load i32, i32* %97
%99 = add nsw i32 %98, %96
%100 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 508
%101 = load i32, i32* %100
%102 = add nsw i32 %101, %99
%103 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 509
%104 = load i32, i32* %103
%105 = add nsw i32 %104, %102
%106 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 510
%107 = load i32, i32* %106
%108 = add nsw i32 %107, %105
%109 = sub nsw i32 %27, %108
%110 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 511
store i32 %109, i32* %110
%111 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %109)
%112 = call i32 @write(i32 %31, i32* %38, i32 512)
%113 = icmp eq i32 %112, 512
br i1 %113, label %114, label %117
114: ; preds = %85
%115 = tail call i64 @close(i32 %31)
%116 = icmp eq i64 %115, 0
br i1 %116, label %122, label %117
117: ; preds = %114, %85
%118 = load i32, i32* @stderr
%119 = load i8*, i8** %28
%120 = tail call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %119)
%121 = tail call i32 @exit(i32 1)
unreachable
122: ; preds = %114
ret i32 0
}