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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int read_32_be(unsigned char *);
int /*<<< orphan*/ stderr;
int get_block_header(FILE *infile, long offset, uint32_t *block_size_p,
                     uint32_t *block_samples_p, int *skip_p) {
  unsigned char head_buf[4];
  int rc = 0;
  int skip = 0;
  if (block_size_p) {
    *block_size_p = 0;
  }
  if (block_samples_p) {
    *block_samples_p = 0;
  }
  if (fseek(infile, offset, SEEK_SET)) {
    fprintf(stderr, "seek to 0x%lx to read block header failed\n",
            (unsigned long)offset);
    exit(EXIT_FAILURE);
  }
  if (fread(head_buf, 1, 4, infile) != 4) {
    fprintf(stderr, "read of block header at 0x%lx failed\n",
            (unsigned long)offset);
    exit(EXIT_FAILURE);
  }
  if ((head_buf[0] & 0x80) == 0x80) {
    head_buf[0] &= ~0x80;
    rc = 1;
  }
  if ((head_buf[0] & 0x40) == 0x40) {
    head_buf[0] &= ~0x40;
  }
  if ((head_buf[0] & 0x08) == 0x08) {
    head_buf[0] &= ~0x08;
    skip = 1;
  }
  if ((head_buf[0] & 0x04) == 0x04) {
    head_buf[0] &= ~0x04;
  }
  if ((head_buf[0] & 0x01) == 0x01) {
    head_buf[0] &= ~0x01;
    skip = 1;
    rc = 1;
  }
  if (0 != head_buf[0]) {
    fprintf(stderr, "unknown flags at 0x%lx\n", (unsigned long)offset);
    exit(EXIT_FAILURE);
  }
  uint32_t block_size = read_32_be(&head_buf[0]);
  if (block_size < 4) {
    fprintf(stderr, "block too small at 0x%lx\n", (unsigned long)offset);
    exit(EXIT_FAILURE);
  }
  if (block_size_p) {
    *block_size_p = block_size;
  }
  if (!skip && block_samples_p) {
    if (fread(head_buf, 1, 4, infile) != 4) {
      fprintf(stderr, "failed reading sample count at 0x%lx\n",
              (unsigned long)offset);
      exit(EXIT_FAILURE);
    }
    *block_samples_p = read_32_be(&head_buf[0]);
  }
  if (skip_p) {
    *skip_p = skip;
  }
  return rc;
}


x86 assembly (clang, -O0):
<get_block_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118f <get_block_header+0x3f>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     11a4 <get_block_header+0x54>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e25(%rip),%rax
mov    (%rax),%edx
call   1060 <fseek@plt>
cmp    $0x0,%rax
je     11eb <get_block_header+0x9b>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe28(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
lea    -0x2c(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
cmp    $0x4,%eax
je     1232 <get_block_header+0xe2>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe0c(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
movzbl -0x2c(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    1259 <get_block_header+0x109>
movzbl -0x2c(%rbp),%eax
and    $0xffffff7f,%eax
mov    %al,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
movzbl -0x2c(%rbp),%eax
and    $0x40,%eax
cmp    $0x40,%eax
jne    1273 <get_block_header+0x123>
movzbl -0x2c(%rbp),%eax
and    $0xffffffbf,%eax
mov    %al,-0x2c(%rbp)
movzbl -0x2c(%rbp),%eax
and    $0x8,%eax
cmp    $0x8,%eax
jne    1294 <get_block_header+0x144>
movzbl -0x2c(%rbp),%eax
and    $0xfffffff7,%eax
mov    %al,-0x2c(%rbp)
movl   $0x1,-0x34(%rbp)
movzbl -0x2c(%rbp),%eax
and    $0x4,%eax
cmp    $0x4,%eax
jne    12ae <get_block_header+0x15e>
movzbl -0x2c(%rbp),%eax
and    $0xfffffffb,%eax
mov    %al,-0x2c(%rbp)
movzbl -0x2c(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    12d6 <get_block_header+0x186>
movzbl -0x2c(%rbp),%eax
and    $0xfffffffe,%eax
mov    %al,-0x2c(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x1,-0x30(%rbp)
movzbl -0x2c(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     130b <get_block_header+0x1bb>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd59(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
lea    -0x2c(%rbp),%rdi
call   1040 <read_32_be@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x4,-0x38(%rbp)
jge    1348 <get_block_header+0x1f8>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd34(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
cmpq   $0x0,-0x18(%rbp)
je     135c <get_block_header+0x20c>
mov    -0x38(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x34(%rbp)
jne    13c9 <get_block_header+0x279>
cmpq   $0x0,-0x20(%rbp)
je     13c9 <get_block_header+0x279>
lea    -0x2c(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
cmp    $0x4,%eax
je     13b8 <get_block_header+0x268>
mov    0x2c48(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xcde(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
lea    -0x2c(%rbp),%rdi
call   1040 <read_32_be@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     13dd <get_block_header+0x28d>
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_block_header>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%rbp
test   %rdx,%rdx
je     1176 <get_block_header+0x26>
movl   $0x0,(%r15)
test   %rcx,%rcx
je     1181 <get_block_header+0x31>
movl   $0x0,(%rcx)
mov    %rcx,0x10(%rsp)
mov    0x2e4b(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <fseek@plt>
test   %rax,%rax
jne    12db <get_block_header+0x18b>
mov    %r14,0x20(%rsp)
mov    %rbx,0x8(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbp,0x18(%rsp)
mov    %rbp,%rcx
call   1030 <fread@plt>
cmp    $0x4,%eax
jne    12f0 <get_block_header+0x1a0>
mov    0x4(%rsp),%r13b
mov    %r13d,%ecx
and    $0x40,%cl
xor    $0x7f,%cl
and    %r13b,%cl
mov    %r13d,%esi
and    $0x8,%sil
movzbl %cl,%edx
and    $0x77,%cl
test   %sil,%sil
movzbl %cl,%ecx
cmove  %edx,%ecx
mov    %r13d,%edx
and    $0xc8,%dl
mov    %ecx,%ebx
and    $0x4,%bl
mov    %ecx,%eax
and    $0x7b,%al
test   %bl,%bl
movzbl %al,%eax
cmove  %ecx,%eax
or     %dl,%bl
mov    %eax,%r14d
and    $0x1,%r14b
mov    %eax,%ecx
and    $0x7e,%cl
test   %r14b,%r14b
movzbl %cl,%ecx
cmove  %eax,%ecx
xor    %ebp,%ebp
or     %r14b,%sil
sete   %r12b
setne  0x3(%rsp)
or     %r14b,%bl
je     123e <get_block_header+0xee>
mov    %cl,0x4(%rsp)
test   %cl,%cl
jne    1302 <get_block_header+0x1b2>
lea    0x4(%rsp),%rdi
call   1040 <read_32_be@plt>
cmp    $0x3,%eax
jle    1314 <get_block_header+0x1c4>
test   %r15,%r15
mov    0x10(%rsp),%rcx
je     1266 <get_block_header+0x116>
mov    %eax,(%r15)
test   %rcx,%rcx
sete   %al
xor    $0x1,%r12b
or     %al,%r12b
mov    0x20(%rsp),%rbx
jne    12ad <get_block_header+0x15d>
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    0x18(%rsp),%rcx
call   1030 <fread@plt>
cmp    $0x4,%eax
jne    1326 <get_block_header+0x1d6>
lea    0x4(%rsp),%rdi
call   1040 <read_32_be@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
test   %rbx,%rbx
je     12bb <get_block_header+0x16b>
mov    0x3(%rsp),%al
mov    %al,%bpl
mov    %ebp,(%rbx)
test   %r14b,%r14b
setne  %al
test   %r13b,%r13b
sets   %cl
or     %al,%cl
movzbl %cl,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
lea    0xd15(%rip),%rsi
mov    %rbx,%rdx
jmp    133b <get_block_header+0x1eb>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
lea    0xd2b(%rip),%rsi
jmp    1336 <get_block_header+0x1e6>
mov    0x2cd7(%rip),%rax
mov    (%rax),%edi
lea    0xd3f(%rip),%rsi
jmp    1336 <get_block_header+0x1e6>
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
lea    0xd45(%rip),%rsi
jmp    1336 <get_block_header+0x1e6>
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
lea    0xd4d(%rip),%rsi
mov    0x8(%rsp),%rdx
call   1050 <fprintf@plt>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@stderr = global i32 0
@.str = [43 x i8] c"seek to 0x%lx to read block header failed\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [38 x i8] c"read of block header at 0x%lx failed\0A\00"
@.str.2 = [24 x i8] c"unknown flags at 0x%lx\0A\00"
@.str.3 = [26 x i8] c"block too small at 0x%lx\0A\00"
@.str.4 = [38 x i8] c"failed reading sample count at 0x%lx\0A\00"
define i32 @get_block_header(i32* %0, i64 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [4 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
store i32 0, i32* %12
store i32 0, i32* %13
%15 = load i32*, i32** %8
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %19
17: ; preds = %5
%18 = load i32*, i32** %8
store i32 0, i32* %18
br label %19
19: ; preds = %17, %5
%20 = load i32*, i32** %9
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i32*, i32** %9
store i32 0, i32* %23
br label %24
24: ; preds = %22, %19
%25 = load i32*, i32** %6
%26 = load i64, i64* %7
%27 = load i32, i32* @SEEK_SET
%28 = call i64 @fseek(i32* %25, i64 %26, i32 %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %36
30: ; preds = %24
%31 = load i32, i32* @stderr
%32 = load i64, i64* %7
%33 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %32)
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %24
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%38 = load i32*, i32** %6
%39 = call i32 @fread(i8* %37, i32 1, i32 4, i32* %38)
%40 = icmp ne i32 %39, 4
br i1 %40, label %41, label %47
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = load i64, i64* %7
%44 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i64 %43)
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %36
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %50, 128
%52 = icmp eq i32 %51, 128
br i1 %52, label %53, label %59
53: ; preds = %47
%54 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = and i32 %56, -129
%58 = trunc i32 %57 to i8
store i8 %58, i8* %54
store i32 1, i32* %12
br label %59
59: ; preds = %53, %47
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%61 = load i8, i8* %60
%62 = zext i8 %61 to i32
%63 = and i32 %62, 64
%64 = icmp eq i32 %63, 64
br i1 %64, label %65, label %71
65: ; preds = %59
%66 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = and i32 %68, -65
%70 = trunc i32 %69 to i8
store i8 %70, i8* %66
br label %71
71: ; preds = %65, %59
%72 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%73 = load i8, i8* %72
%74 = zext i8 %73 to i32
%75 = and i32 %74, 8
%76 = icmp eq i32 %75, 8
br i1 %76, label %77, label %83
77: ; preds = %71
%78 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%79 = load i8, i8* %78
%80 = zext i8 %79 to i32
%81 = and i32 %80, -9
%82 = trunc i32 %81 to i8
store i8 %82, i8* %78
store i32 1, i32* %13
br label %83
83: ; preds = %77, %71
%84 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = and i32 %86, 4
%88 = icmp eq i32 %87, 4
br i1 %88, label %89, label %95
89: ; preds = %83
%90 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%91 = load i8, i8* %90
%92 = zext i8 %91 to i32
%93 = and i32 %92, -5
%94 = trunc i32 %93 to i8
store i8 %94, i8* %90
br label %95
95: ; preds = %89, %83
%96 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = and i32 %98, 1
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %107
101: ; preds = %95
%102 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = and i32 %104, -2
%106 = trunc i32 %105 to i8
store i8 %106, i8* %102
store i32 1, i32* %13
store i32 1, i32* %12
br label %107
107: ; preds = %101, %95
%108 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = icmp ne i32 0, %110
br i1 %111, label %112, label %118
112: ; preds = %107
%113 = load i32, i32* @stderr
%114 = load i64, i64* %7
%115 = call i32 @fprintf(i32 %113, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %114)
%116 = load i32, i32* @EXIT_FAILURE
%117 = call i32 @exit(i32 %116)
unreachable
118: ; preds = %107
%119 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%120 = call i32 @read_32_be(i8* %119)
store i32 %120, i32* %14
%121 = load i32, i32* %14
%122 = icmp slt i32 %121, 4
br i1 %122, label %123, label %129
123: ; preds = %118
%124 = load i32, i32* @stderr
%125 = load i64, i64* %7
%126 = call i32 @fprintf(i32 %124, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i64 %125)
%127 = load i32, i32* @EXIT_FAILURE
%128 = call i32 @exit(i32 %127)
unreachable
129: ; preds = %118
%130 = load i32*, i32** %8
%131 = icmp ne i32* %130, null
br i1 %131, label %132, label %135
132: ; preds = %129
%133 = load i32, i32* %14
%134 = load i32*, i32** %8
store i32 %133, i32* %134
br label %135
135: ; preds = %132, %129
%136 = load i32, i32* %13
%137 = icmp ne i32 %136, 0
br i1 %137, label %156, label %138
138: ; preds = %135
%139 = load i32*, i32** %9
%140 = icmp ne i32* %139, null
br i1 %140, label %141, label %156
141: ; preds = %138
%142 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%143 = load i32*, i32** %6
%144 = call i32 @fread(i8* %142, i32 1, i32 4, i32* %143)
%145 = icmp ne i32 %144, 4
br i1 %145, label %146, label %152
146: ; preds = %141
%147 = load i32, i32* @stderr
%148 = load i64, i64* %7
%149 = call i32 @fprintf(i32 %147, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 %148)
%150 = load i32, i32* @EXIT_FAILURE
%151 = call i32 @exit(i32 %150)
unreachable
152: ; preds = %141
%153 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%154 = call i32 @read_32_be(i8* %153)
%155 = load i32*, i32** %9
store i32 %154, i32* %155
br label %156
156: ; preds = %152, %138, %135
%157 = load i32*, i32** %10
%158 = icmp ne i32* %157, null
br i1 %158, label %159, label %162
159: ; preds = %156
%160 = load i32, i32* %13
%161 = load i32*, i32** %10
store i32 %160, i32* %161
br label %162
162: ; preds = %159, %156
%163 = load i32, i32* %12
ret i32 %163
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@stderr = global i32 0
@.str = [43 x i8] c"seek to 0x%lx to read block header failed\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [38 x i8] c"read of block header at 0x%lx failed\0A\00"
@.str.2 = [24 x i8] c"unknown flags at 0x%lx\0A\00"
@.str.3 = [26 x i8] c"block too small at 0x%lx\0A\00"
@.str.4 = [38 x i8] c"failed reading sample count at 0x%lx\0A\00"
define i32 @get_block_header(i32* nocapture %0, i64 %1, i32* writeonly %2, i32* writeonly %3, i32* writeonly %4) {
%6 = alloca [4 x i8]
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%8 = icmp eq i32* %2, null
br i1 %8, label %10, label %9
9: ; preds = %5
store i32 0, i32* %2
br label %10
10: ; preds = %9, %5
%11 = icmp ne i32* %3, null
br i1 %11, label %12, label %13
12: ; preds = %10
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* @SEEK_SET
%15 = tail call i64 @fseek(i32* %0, i64 %1, i32 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %13
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %1)
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @exit(i32 %20)
unreachable
22: ; preds = %13
%23 = call i32 @fread(i8* %7, i32 1, i32 4, i32* %0)
%24 = icmp eq i32 %23, 4
br i1 %24, label %30, label %25
25: ; preds = %22
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i64 %1)
%28 = load i32, i32* @EXIT_FAILURE
%29 = tail call i32 @exit(i32 %28)
unreachable
30: ; preds = %22
%31 = load i8, i8* %7
%32 = and i8 %31, 64
%33 = xor i8 %32, 127
%34 = and i8 %31, %33
%35 = and i8 %31, 8
%36 = icmp eq i8 %35, 0
%37 = and i8 %34, 119
%38 = select i1 %36, i8 %34, i8 %37
%39 = and i8 %31, -56
%40 = and i8 %38, 4
%41 = icmp eq i8 %40, 0
%42 = and i8 %38, 123
%43 = select i1 %41, i8 %38, i8 %42
%44 = or i8 %40, %39
%45 = and i8 %43, 1
%46 = icmp eq i8 %45, 0
%47 = and i8 %43, 126
%48 = select i1 %46, i8 %43, i8 %47
%49 = select i1 %46, i1 %36, i1 false
%50 = xor i1 %49, true
%51 = zext i1 %50 to i32
%52 = or i8 %45, %44
%53 = icmp eq i8 %52, 0
br i1 %53, label %55, label %54
54: ; preds = %30
store i8 %48, i8* %7
br label %55
55: ; preds = %30, %54
%56 = icmp eq i8 %48, 0
br i1 %56, label %62, label %57
57: ; preds = %55
%58 = load i32, i32* @stderr
%59 = tail call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %1)
%60 = load i32, i32* @EXIT_FAILURE
%61 = tail call i32 @exit(i32 %60)
unreachable
62: ; preds = %55
%63 = call i32 @read_32_be(i8* %7)
%64 = icmp slt i32 %63, 4
br i1 %64, label %65, label %70
65: ; preds = %62
%66 = load i32, i32* @stderr
%67 = call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i64 %1)
%68 = load i32, i32* @EXIT_FAILURE
%69 = call i32 @exit(i32 %68)
unreachable
70: ; preds = %62
br i1 %8, label %72, label %71
71: ; preds = %70
store i32 %63, i32* %2
br label %72
72: ; preds = %71, %70
%73 = and i1 %11, %49
br i1 %73, label %74, label %84
74: ; preds = %72
%75 = call i32 @fread(i8* %7, i32 1, i32 4, i32* %0)
%76 = icmp eq i32 %75, 4
br i1 %76, label %82, label %77
77: ; preds = %74
%78 = load i32, i32* @stderr
%79 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 %1)
%80 = load i32, i32* @EXIT_FAILURE
%81 = call i32 @exit(i32 %80)
unreachable
82: ; preds = %74
%83 = call i32 @read_32_be(i8* %7)
store i32 %83, i32* %3
br label %84
84: ; preds = %82, %72
%85 = icmp eq i32* %4, null
br i1 %85, label %87, label %86
86: ; preds = %84
store i32 %51, i32* %4
br label %87
87: ; preds = %86, %84
%88 = icmp slt i8 %31, 0
%89 = xor i1 %46, true
%90 = select i1 %89, i1 true, i1 %88
%91 = zext i1 %90 to i32
ret i32 %91
}