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

/* Variables and functions */
scalar_t__ EIO;
int /*<<< orphan*/ asprintf(char **, char *, char const *, char const *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ err(scalar_t__, char *, char *);
scalar_t__ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
size_t fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
scalar_t__ ftell(int /*<<< orphan*/ *);
long lrand48();
scalar_t__ offset_from_filename(char const *);
int /*<<< orphan*/ srand48(scalar_t__);
void validate_file(const char *path, const char *filename, uint64_t *ptr_ok,
                   uint64_t *ptr_corrupted, uint64_t *ptr_changed,
                   uint64_t *ptr_overwritten, uint64_t *ptr_size,
                   int *read_all) {
  uint8_t sector[512], *p, *ptr_end;
  FILE *f;
  int offset_match, error_count;
  size_t sectors_read;
  uint64_t offset, expected_offset;
  long int rand_int;
  char *full_fn;
  asprintf(&full_fn, "%s/%s", path, filename);
  f = fopen(full_fn, "rb");
  if (!f)
    err(errno, "Can't open file %s", full_fn);
  free(full_fn);
  ptr_end = sector + 512;
  sectors_read = fread(sector, 512, 1, f);
  expected_offset = offset_from_filename(filename);
  while (sectors_read > 0) {
    assert(sectors_read == 1);
    offset = *((uint64_t *)sector);
    offset_match = offset == expected_offset;
    srand48(offset);
    p = sector + sizeof(offset);
    error_count = 0;
    for (; error_count <= 2 && p < ptr_end; p += sizeof(long int)) {
      rand_int = lrand48();
      if (rand_int != *((long int *)p))
        error_count++;
    }
    sectors_read = fread(sector, 512, 1, f);
    expected_offset += 512;
    if (offset_match) {
      if (error_count == 0)
        (*ptr_ok)++;
      else if (error_count <= 2)
        (*ptr_changed)++;
      else
        (*ptr_corrupted)++;
    } else if (error_count <= 2)
      (*ptr_overwritten)++;
    else
      (*ptr_corrupted)++;
  }
  *read_all = feof(f);
  assert(*read_all || errno == EIO);
  *ptr_size += ftell(f);
  fclose(f);
}


x86 assembly (clang, -O0):
<validate_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x880,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x878(%rbp),%rdi
lea    0xdff(%rip),%rsi
call   10c0 <asprintf@plt>
mov    -0x878(%rbp),%rdi
lea    0xdf2(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x848(%rbp)
cmpq   $0x0,-0x848(%rbp)
jne    124b <validate_file+0x8b>
mov    0x2da3(%rip),%rax
mov    (%rax),%rdi
mov    -0x878(%rbp),%rdx
lea    0xdc3(%rip),%rsi
call   1090 <err@plt>
mov    -0x878(%rbp),%rdi
call   1030 <free@plt>
lea    -0x830(%rbp),%rax
add    $0x800,%rax
mov    %rax,-0x840(%rbp)
lea    -0x830(%rbp),%rdi
mov    -0x848(%rbp),%rcx
mov    $0x200,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %rax,-0x858(%rbp)
mov    -0x10(%rbp),%rdi
call   10e0 <offset_from_filename@plt>
mov    %rax,-0x868(%rbp)
cmpq   $0x0,-0x858(%rbp)
jbe    1478 <validate_file+0x2b8>
cmpq   $0x1,-0x858(%rbp)
01
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x830(%rbp),%rax
mov    %rax,-0x860(%rbp)
mov    -0x860(%rbp),%rax
cmp    -0x868(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x84c(%rbp)
mov    -0x860(%rbp),%rdi
call   10b0 <srand48@plt>
lea    -0x830(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x838(%rbp)
movl   $0x0,-0x850(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x850(%rbp)
mov    %al,-0x879(%rbp)
jg     1340 <validate_file+0x180>
mov    -0x838(%rbp),%rax
cmp    -0x840(%rbp),%rax
setb   %al
mov    %al,-0x879(%rbp)
mov    -0x879(%rbp),%al
test   $0x1,%al
jne    1353 <validate_file+0x193>
jmp    13a3 <validate_file+0x1e3>
mov    $0x0,%al
call   10a0 <lrand48@plt>
mov    %rax,-0x870(%rbp)
mov    -0x870(%rbp),%rax
mov    -0x838(%rbp),%rcx
cmp    (%rcx),%rax
je     1387 <validate_file+0x1c7>
mov    -0x850(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x850(%rbp)
jmp    138c <validate_file+0x1cc>
mov    -0x838(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x838(%rbp)
jmp    1314 <validate_file+0x154>
lea    -0x830(%rbp),%rdi
mov    -0x848(%rbp),%rcx
mov    $0x200,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %rax,-0x858(%rbp)
mov    -0x868(%rbp),%rax
add    $0x200,%rax
mov    %rax,-0x868(%rbp)
cmpl   $0x0,-0x84c(%rbp)
je     1440 <validate_file+0x280>
cmpl   $0x0,-0x850(%rbp)
jne    1408 <validate_file+0x248>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    143b <validate_file+0x27b>
cmpl   $0x2,-0x850(%rbp)
jg     1428 <validate_file+0x268>
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1436 <validate_file+0x276>
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    143b <validate_file+0x27b>
jmp    1473 <validate_file+0x2b3>
cmpl   $0x2,-0x850(%rbp)
jg     1460 <validate_file+0x2a0>
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    146e <validate_file+0x2ae>
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1473 <validate_file+0x2b3>
jmp    129f <validate_file+0xdf>
mov    -0x848(%rbp),%rdi
call   1080 <feof@plt>
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x18(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x0,(%rcx)
mov    %al,-0x87a(%rbp)
jne    14be <validate_file+0x2fe>
mov    0x2b30(%rip),%rax
mov    (%rax),%rax
mov    0x2b2e(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x87a(%rbp)
mov    -0x87a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x848(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x848(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x880,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x848,%rsp
mov    %r9,0x30(%rsp)
mov    %r8,0x28(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,0x18(%rsp)
mov    %rsi,%rbp
mov    %rdi,%rdx
lea    0xe0e(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %rbp,%rcx
call   10c0 <asprintf@plt>
mov    0x8(%rsp),%rdi
lea    0xdfb(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1233 <validate_file+0x73>
mov    0x2db9(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%rsp),%rdx
lea    0xddb(%rip),%rsi
call   1090 <err@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
lea    0x40(%rsp),%rdi
mov    $0x200,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rax,%r15
mov    %rbp,%rdi
call   10e0 <offset_from_filename@plt>
test   %r15,%r15
je     1343 <validate_file+0x183>
mov    %rax,%r14
lea    0x840(%rsp),%r13
mov    %rbx,0x10(%rsp)
jmp    12d9 <validate_file+0x119>
nopw   0x0(%rax,%rax,1)
lea    0x40(%rsp),%rdi
mov    $0x200,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%rbx
mov    %rbx,%rcx
call   1040 <fread@plt>
cmp    $0x3,%r12d
mov    0x20(%rsp),%rdx
mov    %rdx,%rcx
cmovb  0x30(%rsp),%rcx
cmovb  0x28(%rsp),%rdx
mov    %rax,%r15
test   %r12d,%r12d
cmove  0x18(%rsp),%rdx
cmp    %r14,0x38(%rsp)
lea    0x200(%r14),%r14
cmovne %rcx,%rdx
addq   $0x1,(%rdx)
test   %rax,%rax
je     1343 <validate_file+0x183>
xor    %edi,%edi
cmp    $0x1,%r15
sete   %dil
call   1060 <assert@plt>
mov    0x40(%rsp),%rdi
mov    %rdi,0x38(%rsp)
call   10b0 <srand48@plt>
lea    0x80(%rsp),%rbx
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12d,%ebp
xor    %eax,%eax
call   10a0 <lrand48@plt>
xor    %r12d,%r12d
cmp    -0x20(%rbx),%rax
setne  %r12b
add    %ebp,%r12d
cmp    $0x2,%r12d
ja     1280 <validate_file+0xc0>
lea    0x20(%rbx),%rax
cmp    %r13,%rbx
mov    %rax,%rbx
jb     1310 <validate_file+0x150>
jmp    1280 <validate_file+0xc0>
mov    %rbx,%rdi
call   1080 <feof@plt>
mov    0x888(%rsp),%rcx
mov    %eax,(%rcx)
test   %eax,%eax
setne  %al
mov    0x2c77(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2c75(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1060 <assert@plt>
mov    %rbx,%rdi
call   1070 <ftell@plt>
mov    0x880(%rsp),%rcx
add    %rax,(%rcx)
mov    %rbx,%rdi
call   1050 <fclose@plt>
add    $0x848,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [3 x i8] c"rb\00"
@errno = global i64 0
@.str.2 = [19 x i8] c"Can't open file %s\00"
@EIO = global i64 0
define void @validate_file(i8* %0, i8* %1, i64* %2, i64* %3, i64* %4, i64* %5, i64* %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64*
%12 = alloca i64*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca i64*
%16 = alloca i32*
%17 = alloca [512 x i32]
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i64
%24 = alloca i64
%25 = alloca i64
%26 = alloca i64
%27 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i64* %2, i64** %11
store i64* %3, i64** %12
store i64* %4, i64** %13
store i64* %5, i64** %14
store i64* %6, i64** %15
store i32* %7, i32** %16
%28 = load i8*, i8** %9
%29 = load i8*, i8** %10
%30 = call i32 @asprintf(i8** %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %28, i8* %29)
%31 = load i8*, i8** %27
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %32, i32** %20
%33 = load i32*, i32** %20
%34 = icmp ne i32* %33, null
br i1 %34, label %39, label %35
35: ; preds = %8
%36 = load i64, i64* @errno
%37 = load i8*, i8** %27
%38 = call i32 @err(i64 %36, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %35, %8
%40 = load i8*, i8** %27
%41 = call i32 @free(i8* %40)
%42 = getelementptr inbounds [512 x i32], [512 x i32]* %17, i64 0, i64 0
%43 = getelementptr inbounds i32, i32* %42, i64 512
store i32* %43, i32** %19
%44 = getelementptr inbounds [512 x i32], [512 x i32]* %17, i64 0, i64 0
%45 = load i32*, i32** %20
%46 = call i64 @fread(i32* %44, i32 512, i32 1, i32* %45)
store i64 %46, i64* %23
%47 = load i8*, i8** %10
%48 = call i64 @offset_from_filename(i8* %47)
store i64 %48, i64* %25
br label %49
49: ; preds = %131, %39
%50 = load i64, i64* %23
%51 = icmp ugt i64 %50, 0
br i1 %51, label %52, label %132
52: ; preds = %49
%53 = load i64, i64* %23
%54 = icmp eq i64 %53, 1
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = getelementptr inbounds [512 x i32], [512 x i32]* %17, i64 0, i64 0
%58 = bitcast i32* %57 to i64*
%59 = load i64, i64* %58
store i64 %59, i64* %24
%60 = load i64, i64* %24
%61 = load i64, i64* %25
%62 = icmp eq i64 %60, %61
%63 = zext i1 %62 to i32
store i32 %63, i32* %21
%64 = load i64, i64* %24
%65 = call i32 @srand48(i64 %64)
%66 = getelementptr inbounds [512 x i32], [512 x i32]* %17, i64 0, i64 0
%67 = getelementptr inbounds i32, i32* %66, i64 8
store i32* %67, i32** %18
store i32 0, i32* %22
br label %68
68: ; preds = %88, %52
%69 = load i32, i32* %22
%70 = icmp sle i32 %69, 2
br i1 %70, label %71, label %75
71: ; preds = %68
%72 = load i32*, i32** %18
%73 = load i32*, i32** %19
%74 = icmp ult i32* %72, %73
br label %75
75: ; preds = %71, %68
%76 = phi i1 [ false, %68 ], [ %74, %71 ]
br i1 %76, label %77, label %91
77: ; preds = %75
%78 = call i64 (...) @lrand48()
store i64 %78, i64* %26
%79 = load i64, i64* %26
%80 = load i32*, i32** %18
%81 = bitcast i32* %80 to i64*
%82 = load i64, i64* %81
%83 = icmp ne i64 %79, %82
br i1 %83, label %84, label %87
84: ; preds = %77
%85 = load i32, i32* %22
%86 = add nsw i32 %85, 1
store i32 %86, i32* %22
br label %87
87: ; preds = %84, %77
br label %88
88: ; preds = %87
%89 = load i32*, i32** %18
%90 = getelementptr inbounds i32, i32* %89, i64 8
store i32* %90, i32** %18
br label %68
91: ; preds = %75
%92 = getelementptr inbounds [512 x i32], [512 x i32]* %17, i64 0, i64 0
%93 = load i32*, i32** %20
%94 = call i64 @fread(i32* %92, i32 512, i32 1, i32* %93)
store i64 %94, i64* %23
%95 = load i64, i64* %25
%96 = add nsw i64 %95, 512
store i64 %96, i64* %25
%97 = load i32, i32* %21
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %119
99: ; preds = %91
%100 = load i32, i32* %22
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %106
102: ; preds = %99
%103 = load i64*, i64** %11
%104 = load i64, i64* %103
%105 = add nsw i64 %104, 1
store i64 %105, i64* %103
br label %118
106: ; preds = %99
%107 = load i32, i32* %22
%108 = icmp sle i32 %107, 2
br i1 %108, label %109, label %113
109: ; preds = %106
%110 = load i64*, i64** %13
%111 = load i64, i64* %110
%112 = add nsw i64 %111, 1
store i64 %112, i64* %110
br label %117
113: ; preds = %106
%114 = load i64*, i64** %12
%115 = load i64, i64* %114
%116 = add nsw i64 %115, 1
store i64 %116, i64* %114
br label %117
117: ; preds = %113, %109
br label %118
118: ; preds = %117, %102
br label %131
119: ; preds = %91
%120 = load i32, i32* %22
%121 = icmp sle i32 %120, 2
br i1 %121, label %122, label %126
122: ; preds = %119
%123 = load i64*, i64** %14
%124 = load i64, i64* %123
%125 = add nsw i64 %124, 1
store i64 %125, i64* %123
br label %130
126: ; preds = %119
%127 = load i64*, i64** %12
%128 = load i64, i64* %127
%129 = add nsw i64 %128, 1
store i64 %129, i64* %127
br label %130
130: ; preds = %126, %122
br label %131
131: ; preds = %130, %118
br label %49
132: ; preds = %49
%133 = load i32*, i32** %20
%134 = call i32 @feof(i32* %133)
%135 = load i32*, i32** %16
store i32 %134, i32* %135
%136 = load i32*, i32** %16
%137 = load i32, i32* %136
%138 = icmp ne i32 %137, 0
br i1 %138, label %143, label %139
139: ; preds = %132
%140 = load i64, i64* @errno
%141 = load i64, i64* @EIO
%142 = icmp eq i64 %140, %141
br label %143
143: ; preds = %139, %132
%144 = phi i1 [ true, %132 ], [ %142, %139 ]
%145 = zext i1 %144 to i32
%146 = call i32 @assert(i32 %145)
%147 = load i32*, i32** %20
%148 = call i64 @ftell(i32* %147)
%149 = load i64*, i64** %15
%150 = load i64, i64* %149
%151 = add nsw i64 %150, %148
store i64 %151, i64* %149
%152 = load i32*, i32** %20
%153 = call i32 @fclose(i32* %152)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [3 x i8] c"rb\00"
@errno = global i64 0
@.str.2 = [19 x i8] c"Can't open file %s\00"
@EIO = global i64 0
define void @validate_file(i8* %0, i8* %1, i64* nocapture %2, i64* nocapture %3, i64* nocapture %4, i64* nocapture %5, i64* nocapture %6, i32* nocapture writeonly %7) {
%9 = alloca [512 x i32]
%10 = alloca i8*
%11 = bitcast [512 x i32]* %9 to i8*
%12 = bitcast i8** %10 to i8*
%13 = call i32 @asprintf(i8** %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%14 = load i8*, i8** %10
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %21
17: ; preds = %8
%18 = load i64, i64* @errno
%19 = load i8*, i8** %10
%20 = call i32 @err(i64 %18, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %17, %8
%22 = load i8*, i8** %10
%23 = call i32 @free(i8* %22)
%24 = getelementptr inbounds [512 x i32], [512 x i32]* %9, i64 0, i64 0
%25 = getelementptr inbounds [512 x i32], [512 x i32]* %9, i64 0, i64 512
%26 = call i64 @fread(i32* %24, i32 512, i32 1, i32* %15)
%27 = call i64 @offset_from_filename(i8* %1)
%28 = icmp eq i64 %26, 0
br i1 %28, label %65, label %29
29: ; preds = %21
%30 = bitcast [512 x i32]* %9 to i64*
%31 = getelementptr inbounds [512 x i32], [512 x i32]* %9, i64 0, i64 8
br label %32
32: ; preds = %29, %53
%33 = phi i64 [ %27, %29 ], [ %56, %53 ]
%34 = phi i64 [ %26, %29 ], [ %55, %53 ]
%35 = icmp eq i64 %34, 1
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = load i64, i64* %30
%39 = call i32 @srand48(i64 %38)
br label %40
40: ; preds = %32, %40
%41 = phi i32* [ %31, %32 ], [ %49, %40 ]
%42 = phi i32 [ 0, %32 ], [ %48, %40 ]
%43 = call i64 (...) @lrand48()
%44 = bitcast i32* %41 to i64*
%45 = load i64, i64* %44
%46 = icmp ne i64 %43, %45
%47 = zext i1 %46 to i32
%48 = add nuw nsw i32 %42, %47
%49 = getelementptr inbounds i32, i32* %41, i64 8
%50 = icmp ult i32 %48, 3
%51 = icmp ult i32* %49, %25
%52 = select i1 %50, i1 %51, i1 false
br i1 %52, label %40, label %53
53: ; preds = %40
%54 = icmp eq i64 %38, %33
%55 = call i64 @fread(i32* %24, i32 512, i32 1, i32* %15)
%56 = add nsw i64 %33, 512
%57 = select i1 %50, i64* %5, i64* %3
%58 = icmp eq i32 %48, 0
%59 = select i1 %50, i64* %4, i64* %3
%60 = select i1 %58, i64* %2, i64* %59
%61 = select i1 %54, i64* %60, i64* %57
%62 = load i64, i64* %61
%63 = add nsw i64 %62, 1
store i64 %63, i64* %61
%64 = icmp eq i64 %55, 0
br i1 %64, label %65, label %32
65: ; preds = %53, %21
%66 = call i32 @feof(i32* %15)
store i32 %66, i32* %7
%67 = icmp ne i32 %66, 0
%68 = load i64, i64* @errno
%69 = load i64, i64* @EIO
%70 = icmp eq i64 %68, %69
%71 = select i1 %67, i1 true, i1 %70
%72 = zext i1 %71 to i32
%73 = call i32 @assert(i32 %72)
%74 = call i64 @ftell(i32* %15)
%75 = load i64, i64* %6
%76 = add nsw i64 %75, %74
store i64 %76, i64* %6
%77 = call i32 @fclose(i32* %15)
ret void
}