#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_CUR;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  const char *fname;
  FILE *f;
  unsigned char buf[9];
  unsigned char magic[] = {137, 80, 78, 71, 13, 10, 26, 10};
  int total, i;
  if (argc != 2) {
    printf("Usage: pngchunks image.png\n\n");
    return -1;
  }
  fname = argv[1];
  f = fopen(fname, "rb");
  if (!f) {
    printf("Error: can't open file %s!\n", fname);
    return -1;
  }
  fread(buf, 1, 8, f);
  for (i = 0; i < 8; ++i) {
    if (buf[i] != magic[i]) {
      printf("Not a PNG file!\n");
      fclose(f);
      return -1;
    }
  }
  fseek(f, 0, SEEK_END);
  total = ftell(f);
  printf("File size: %d byte(s)\n", total);
  rewind(f);
  fseek(f, 8, SEEK_SET);
  printf("\n");
  printf("Offset    Chunk    Size\n");
  while (1) {
    int ofs, length;
    ofs = ftell(f);
    if (ofs >= total)
      break;
    fread(buf, 1, 8, f);
    buf[8] = '\0';
    length = buf[3] + (buf[2] << 8) + (buf[1] << 16) + (buf[0] << 24);
    printf("%7d    %s   %5d\n", ofs, buf + 4, length);
    if (length < 0)
      printf("%d %d %d %d\n", buf[0], buf[1], buf[2], buf[3]);
    fseek(f, length, SEEK_CUR);
    fread(buf, 1, 4, f);
  }
  fclose(f);
  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)
mov    0xe73(%rip),%rax
mov    %rax,-0x31(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11b5 <main+0x45>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13c3 <main+0x253>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11fe <main+0x8e>
mov    -0x18(%rbp),%rsi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13c3 <main+0x253>
lea    -0x29(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x8,-0x3c(%rbp)
jge    1276 <main+0x106>
movslq -0x3c(%rbp),%rax
movzbl -0x29(%rbp,%rax,1),%eax
movslq -0x3c(%rbp),%rcx
movzbl -0x31(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     1263 <main+0xf3>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13c3 <main+0x253>
jmp    1268 <main+0xf8>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    121c <main+0xac>
mov    -0x20(%rbp),%rdi
mov    0x2d67(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1080 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1070 <ftell@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <rewind@plt>
mov    -0x20(%rbp),%rdi
mov    0x2d15(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1080 <fseek@plt>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1070 <ftell@plt>
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x38(%rbp),%eax
jl     1300 <main+0x190>
jmp    13b3 <main+0x243>
lea    -0x29(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fread@plt>
movb   $0x0,-0x21(%rbp)
movzbl -0x26(%rbp),%eax
movzbl -0x27(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzbl -0x28(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
movzbl -0x29(%rbp),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%esi
lea    -0x29(%rbp),%rdx
add    $0x4,%rdx
mov    -0x44(%rbp),%ecx
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x44(%rbp)
jge    1382 <main+0x212>
movzbl -0x29(%rbp),%esi
movzbl -0x28(%rbp),%edx
movzbl -0x27(%rbp),%ecx
movzbl -0x26(%rbp),%r8d
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    0x2c50(%rip),%rax
mov    (%rax),%edx
call   1080 <fseek@plt>
lea    -0x29(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
jmp    12e3 <main+0x173>
mov    -0x20(%rbp),%rdi
call   1040 <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   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jne    12a0 <main+0x110>
mov    0x8(%rsi),%rbp
lea    0xe4e(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     12c4 <main+0x134>
mov    %rax,%rbx
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rax,%rcx
call   1050 <fread@plt>
cmpb   $0x89,0xf(%rsp)
jne    12ae <main+0x11e>
cmpb   $0x50,0x10(%rsp)
jne    12ae <main+0x11e>
cmpb   $0x4e,0x11(%rsp)
jne    12ae <main+0x11e>
cmpb   $0x47,0x12(%rsp)
jne    12ae <main+0x11e>
movd   0x13(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0xa1a0a0d,%eax
jne    12ae <main+0x11e>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edx
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %rbx,%rdi
call   1090 <ftell@plt>
mov    %eax,%r14d
lea    0xdda(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1080 <rewind@plt>
mov    0x2d73(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   10a0 <fseek@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdd7(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1090 <ftell@plt>
cmp    %r14d,%eax
jge    138c <main+0x1fc>
mov    %eax,%r15d
lea    0xf(%rsp),%r12
jmp    1324 <main+0x194>
lea    0xdd5(%rip),%rdi
call   1040 <puts@plt>
jmp    12d5 <main+0x145>
lea    0xdb7(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
jmp    12d5 <main+0x145>
lea    0xd38(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2cee(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r13d,%esi
call   10a0 <fseek@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
mov    %rbx,%rdi
call   1090 <ftell@plt>
mov    %eax,%r15d
cmp    %r14d,%eax
jge    138c <main+0x1fc>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
movb   $0x0,0x17(%rsp)
mov    0xf(%rsp),%r13d
bswap  %r13d
lea    0xce9(%rip),%rdi
mov    %r15d,%esi
lea    0x13(%rsp),%rdx
mov    %r13d,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
test   %r13d,%r13d
jns    12eb <main+0x15b>
movzbl 0xf(%rsp),%esi
movzbl 0x10(%rsp),%edx
movzbl 0x11(%rsp),%ecx
movzbl 0x12(%rsp),%r8d
lea    0xcc7(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    12eb <main+0x15b>
mov    %rbx,%rdi
call   1060 <fclose@plt>
jmp    12da <main+0x14a>

LLVM IR (-O0):
@__const.main.magic = [8 x i8] c"\89PNG\0D\0A\1A\0A"
@.str = [29 x i8] c"Usage: pngchunks image.png\0A\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [28 x i8] c"Error: can't open file %s!\0A\00"
@.str.3 = [17 x i8] c"Not a PNG file!\0A\00"
@SEEK_END = global i32 0
@.str.4 = [23 x i8] c"File size: %d byte(s)\0A\00"
@SEEK_SET = global i32 0
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [25 x i8] c"Offset Chunk Size\0A\00"
@.str.7 = [17 x i8] c"%7d %s %5d\0A\00"
@.str.8 = [13 x i8] c"%d %d %d %d\0A\00"
@SEEK_CUR = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca [9 x i8]
%9 = alloca [8 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = bitcast [8 x i8]* %9 to i8*
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %134
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
store i8* %22, i8** %6
%23 = load i8*, i8** %6
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %24, i32** %7
%25 = load i32*, i32** %7
%26 = icmp ne i32* %25, null
br i1 %26, label %30, label %27
27: ; preds = %19
%28 = load i8*, i8** %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %28)
store i32 -1, i32* %3
br label %134
30: ; preds = %19
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%32 = load i32*, i32** %7
%33 = call i32 @fread(i8* %31, i32 1, i32 8, i32* %32)
store i32 0, i32* %11
br label %34
34: ; preds = %54, %30
%35 = load i32, i32* %11
%36 = icmp slt i32 %35, 8
br i1 %36, label %37, label %57
37: ; preds = %34
%38 = load i32, i32* %11
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i32, i32* %11
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = icmp ne i32 %42, %47
br i1 %48, label %49, label %53
49: ; preds = %37
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%51 = load i32*, i32** %7
%52 = call i32 @fclose(i32* %51)
store i32 -1, i32* %3
br label %134
53: ; preds = %37
br label %54
54: ; preds = %53
%55 = load i32, i32* %11
%56 = add nsw i32 %55, 1
store i32 %56, i32* %11
br label %34
57: ; preds = %34
%58 = load i32*, i32** %7
%59 = load i32, i32* @SEEK_END
%60 = call i32 @fseek(i32* %58, i32 0, i32 %59)
%61 = load i32*, i32** %7
%62 = call i32 @ftell(i32* %61)
store i32 %62, i32* %10
%63 = load i32, i32* %10
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %63)
%65 = load i32*, i32** %7
%66 = call i32 @rewind(i32* %65)
%67 = load i32*, i32** %7
%68 = load i32, i32* @SEEK_SET
%69 = call i32 @fseek(i32* %67, i32 8, i32 %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %72
72: ; preds = %57, %123
%73 = load i32*, i32** %7
%74 = call i32 @ftell(i32* %73)
store i32 %74, i32* %12
%75 = load i32, i32* %12
%76 = load i32, i32* %10
%77 = icmp sge i32 %75, %76
br i1 %77, label %78, label %79
78: ; preds = %72
br label %131
79: ; preds = %72
%80 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%81 = load i32*, i32** %7
%82 = call i32 @fread(i8* %80, i32 1, i32 8, i32* %81)
%83 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 8
store i8 0, i8* %83
%84 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 3
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 2
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = shl i32 %89, 8
%91 = add nsw i32 %86, %90
%92 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 1
%93 = load i8, i8* %92
%94 = zext i8 %93 to i32
%95 = shl i32 %94, 16
%96 = add nsw i32 %91, %95
%97 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = shl i32 %99, 24
%101 = add nsw i32 %96, %100
store i32 %101, i32* %13
%102 = load i32, i32* %12
%103 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%104 = getelementptr inbounds i8, i8* %103, i64 4
%105 = load i32, i32* %13
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %102, i8* %104, i32 %105)
%107 = load i32, i32* %13
%108 = icmp slt i32 %107, 0
br i1 %108, label %109, label %123
109: ; preds = %79
%110 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%111 = load i8, i8* %110
%112 = zext i8 %111 to i32
%113 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 1
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 2
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 3
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %112, i32 %115, i32 %118, i32 %121)
br label %123
123: ; preds = %109, %79
%124 = load i32*, i32** %7
%125 = load i32, i32* %13
%126 = load i32, i32* @SEEK_CUR
%127 = call i32 @fseek(i32* %124, i32 %125, i32 %126)
%128 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%129 = load i32*, i32** %7
%130 = call i32 @fread(i8* %128, i32 1, i32 4, i32* %129)
br label %72
131: ; preds = %78
%132 = load i32*, i32** %7
%133 = call i32 @fclose(i32* %132)
store i32 0, i32* %3
br label %134
134: ; preds = %131, %49, %27, %17
%135 = load i32, i32* %3
ret i32 %135
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [28 x i8] c"Error: can't open file %s!\0A\00"
@SEEK_END = global i32 0
@.str.4 = [23 x i8] c"File size: %d byte(s)\0A\00"
@SEEK_SET = global i32 0
@.str.7 = [17 x i8] c"%7d %s %5d\0A\00"
@.str.8 = [13 x i8] c"%d %d %d %d\0A\00"
@SEEK_CUR = global i32 0
@str = [24 x i8] c"Offset Chunk Size\00"
@str.9 = [16 x i8] c"Not a PNG file!\00"
@str.10 = [28 x i8] c"Usage: pngchunks image.png\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.10, i64 0, i64 0))
br label %92
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %10)
br label %92
15: ; preds = %8
%16 = call i32 @fread(i8* %4, i32 1, i32 8, i32* %11)
%17 = load i8, i8* %4
%18 = icmp eq i8 %17, -119
br i1 %18, label %19, label %50
19: ; preds = %15
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 1
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 80
br i1 %22, label %23, label %50
23: ; preds = %19
%24 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 2
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 78
br i1 %26, label %27, label %50
27: ; preds = %23
%28 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 3
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 71
br i1 %30, label %31, label %50
31: ; preds = %27
%32 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 4
%33 = bitcast i8* %32 to <4 x i8>*
%34 = load <4 x i8>, <4 x i8>* %33
%35 = freeze <4 x i8> %34
%36 = bitcast <4 x i8> %35 to i32
%37 = icmp eq i32 %36, 169478669
br i1 %37, label %38, label %50
38: ; preds = %31
%39 = load i32, i32* @SEEK_END
%40 = tail call i32 @fseek(i32* %11, i32 0, i32 %39)
%41 = tail call i32 @ftell(i32* %11)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %41)
%43 = tail call i32 @rewind(i32* %11)
%44 = load i32, i32* @SEEK_SET
%45 = tail call i32 @fseek(i32* %11, i32 8, i32 %44)
%46 = tail call i32 @putchar(i32 10)
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%48 = call i32 @ftell(i32* %11)
%49 = icmp slt i32 %48, %41
br i1 %49, label %53, label %90
50: ; preds = %31, %27, %23, %19, %15
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.9, i64 0, i64 0))
%52 = tail call i32 @fclose(i32* %11)
br label %92
53: ; preds = %38
%54 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 8
br label %55
55: ; preds = %53, %84
%56 = phi i32 [ %48, %53 ], [ %88, %84 ]
%57 = call i32 @fread(i8* %4, i32 1, i32 8, i32* %11)
store i8 0, i8* %54
%58 = load i8, i8* %28
%59 = zext i8 %58 to i32
%60 = load i8, i8* %24
%61 = zext i8 %60 to i32
%62 = shl nuw nsw i32 %61, 8
%63 = or i32 %62, %59
%64 = load i8, i8* %20
%65 = zext i8 %64 to i32
%66 = shl nuw nsw i32 %65, 16
%67 = or i32 %63, %66
%68 = load i8, i8* %4
%69 = zext i8 %68 to i32
%70 = shl nuw i32 %69, 24
%71 = or i32 %67, %70
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %56, i8* %32, i32 %71)
%73 = icmp slt i32 %71, 0
br i1 %73, label %74, label %84
74: ; preds = %55
%75 = load i8, i8* %4
%76 = zext i8 %75 to i32
%77 = load i8, i8* %20
%78 = zext i8 %77 to i32
%79 = load i8, i8* %24
%80 = zext i8 %79 to i32
%81 = load i8, i8* %28
%82 = zext i8 %81 to i32
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %76, i32 %78, i32 %80, i32 %82)
br label %84
84: ; preds = %55, %74
%85 = load i32, i32* @SEEK_CUR
%86 = call i32 @fseek(i32* %11, i32 %71, i32 %85)
%87 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %11)
%88 = call i32 @ftell(i32* %11)
%89 = icmp slt i32 %88, %41
br i1 %89, label %55, label %90
90: ; preds = %84, %38
%91 = call i32 @fclose(i32* %11)
br label %92
92: ; preds = %90, %50, %13, %6
%93 = phi i32 [ -1, %6 ], [ -1, %50 ], [ 0, %90 ], [ -1, %13 ]
ret i32 %93
}