#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;
typedef int uint64_t;

/* Variables and functions */
int ENOENT;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ close(int);
int errno;
int get64bit(int const **);
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
scalar_t__ memcmp(int *, ...);
int /*<<< orphan*/ memcpy(int *, char *, int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int open(char const *, int /*<<< orphan*/);
int read(int, int *, int);
uint8_t meta_check_metadatafile(const char *name, uint64_t *ver, uint64_t *id) {
  int fd;
  int err;
  uint8_t chkbuff[16];
  uint8_t eofmark[16];
  uint8_t fver;
  const uint8_t *ptr;
  *ver = 0;
  *id = 0;
  fd = open(name, O_RDONLY);
  if (fd < 0) {
    if (errno == ENOENT) {
      return 1;
    } else {
      return 2;
    }
  }
  if (read(fd, chkbuff, 8) != 8) {
    err = errno;
    close(fd);
    errno = err;
    return 2;
  }
  if (memcmp(chkbuff, "MFSM NEW", 8) == 0) {
    close(fd);
    *ver = 1;
    return 0;
  }
  if (memcmp(chkbuff,
             "MFS"
             "M ",
             5) == 0 &&
      chkbuff[5] >= '1' && chkbuff[5] <= '9' && chkbuff[6] == '.' &&
      chkbuff[7] >= '0' && chkbuff[7] <= '9') {
    fver = ((chkbuff[5] - '0') << 4) + (chkbuff[7] - '0');
  } else {
    close(fd);
    return 3;
  }
  if (fver < 0x16) {
    memset(eofmark, 0, 16);
  } else {
    memcpy(eofmark, "[MFS EOF MARKER]", 16);
  }
  if (read(fd, chkbuff, 16) != 16) {
    err = errno;
    close(fd);
    errno = err;
    return 2;
  }
  if (fver < 0x20) {
    ptr = chkbuff + 4;
    *ver = get64bit(&ptr);
  } else {
    ptr = chkbuff;
    *ver = get64bit(&ptr);
    *id = get64bit(&ptr);
  }
  lseek(fd, -16, SEEK_END);
  if (read(fd, chkbuff, 16) != 16) {
    err = errno;
    close(fd);
    errno = err;
    return 2;
  }
  close(fd);
  if (memcmp(chkbuff, eofmark, 16) != 0) {
    return 4;
  }
  return 0;
}


x86 assembly (clang, -O0):
<meta_check_metadatafile>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    11fa <meta_check_metadatafile+0x7a>
mov    0x2dff(%rip),%rax
mov    (%rax),%eax
mov    0x2de6(%rip),%rcx
cmp    (%rcx),%eax
jne    11ee <meta_check_metadatafile+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
movl   $0x2,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
mov    -0x24(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x8,%edx
call   1060 <read@plt>
cmp    $0x8,%eax
je     1240 <meta_check_metadatafile+0xc0>
mov    0x2db5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x28(%rbp),%ecx
mov    0x2d9e(%rip),%rax
mov    %ecx,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
lea    -0x70(%rbp),%rdi
lea    0xdb5(%rip),%rsi
xor    %eax,%eax
mov    $0x8,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
jne    127f <meta_check_metadatafile+0xff>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
lea    -0x70(%rbp),%rdi
lea    0xd7f(%rip),%rsi
xor    %eax,%eax
mov    $0x5,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
jne    12ee <meta_check_metadatafile+0x16e>
cmpl   $0x31,-0x5c(%rbp)
jl     12ee <meta_check_metadatafile+0x16e>
cmpl   $0x39,-0x5c(%rbp)
jg     12ee <meta_check_metadatafile+0x16e>
cmpl   $0x2e,-0x58(%rbp)
jne    12ee <meta_check_metadatafile+0x16e>
cmpl   $0x30,-0x54(%rbp)
jl     12ee <meta_check_metadatafile+0x16e>
cmpl   $0x39,-0x54(%rbp)
jg     12ee <meta_check_metadatafile+0x16e>
mov    -0x5c(%rbp),%eax
sub    $0x30,%eax
shl    $0x4,%eax
mov    -0x54(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xb4(%rbp)
jmp    1302 <meta_check_metadatafile+0x182>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
movl   $0x3,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
cmpl   $0x16,-0xb4(%rbp)
jge    1327 <meta_check_metadatafile+0x1a7>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
jmp    133f <meta_check_metadatafile+0x1bf>
lea    -0xb0(%rbp),%rdi
lea    0xcda(%rip),%rsi
mov    $0x10,%edx
call   1080 <memcpy@plt>
mov    -0x24(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x10,%edx
call   1060 <read@plt>
cmp    $0x10,%eax
je     1385 <meta_check_metadatafile+0x205>
mov    0x2c70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x28(%rbp),%ecx
mov    0x2c59(%rip),%rax
mov    %ecx,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
cmpl   $0x20,-0xb4(%rbp)
jge    13ba <meta_check_metadatafile+0x23a>
lea    -0x70(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0xc0(%rbp)
lea    -0xc0(%rbp),%rdi
call   1090 <get64bit@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    13ed <meta_check_metadatafile+0x26d>
lea    -0x70(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    -0xc0(%rbp),%rdi
call   1090 <get64bit@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
lea    -0xc0(%rbp),%rdi
call   1090 <get64bit@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%edi
mov    0x2bf1(%rip),%rax
mov    (%rax),%edx
mov    $0xfffffff0,%esi
call   1030 <lseek@plt>
mov    -0x24(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x10,%edx
call   1060 <read@plt>
cmp    $0x10,%eax
je     1449 <meta_check_metadatafile+0x2c9>
mov    0x2bac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x28(%rbp),%ecx
mov    0x2b95(%rip),%rax
mov    %ecx,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
lea    -0x70(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
xor    %eax,%eax
mov    $0x10,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
je     147e <meta_check_metadatafile+0x2fe>
movl   $0x4,-0x4(%rbp)
jmp    1485 <meta_check_metadatafile+0x305>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meta_check_metadatafile>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x90,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
movl   $0x0,(%rsi)
movl   $0x0,(%rdx)
mov    0x2e38(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
test   %eax,%eax
js     125a <meta_check_metadatafile+0xda>
mov    %eax,%ebx
lea    0x10(%rsp),%rsi
mov    %eax,%edi
mov    $0x8,%edx
call   1060 <read@plt>
cmp    $0x8,%eax
jne    135d <meta_check_metadatafile+0x1dd>
lea    0xe26(%rip),%rsi
xor    %ebp,%ebp
lea    0x10(%rsp),%rdi
mov    $0x8,%edx
xor    %eax,%eax
call   1070 <memcmp@plt>
test   %rax,%rax
je     127d <meta_check_metadatafile+0xfd>
lea    0xe0c(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x5,%edx
xor    %eax,%eax
call   1070 <memcmp@plt>
test   %rax,%rax
jne    1290 <meta_check_metadatafile+0x110>
mov    0x24(%rsp),%eax
cmp    $0x31,%eax
jl     1290 <meta_check_metadatafile+0x110>
cmp    $0x39,%eax
jg     1290 <meta_check_metadatafile+0x110>
cmpl   $0x2e,0x28(%rsp)
jne    1290 <meta_check_metadatafile+0x110>
mov    0x2c(%rsp),%ecx
cmp    $0x30,%ecx
jl     1290 <meta_check_metadatafile+0x110>
cmp    $0x39,%ecx
jg     1290 <meta_check_metadatafile+0x110>
shl    $0x4,%eax
lea    (%rax,%rcx,1),%ebp
add    $0xfffffcd0,%ebp
cmp    $0x16,%ebp
jae    12a1 <meta_check_metadatafile+0x121>
lea    0x50(%rsp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
jmp    12b7 <meta_check_metadatafile+0x137>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
mov    0x2d56(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
sete   %dl
mov    $0x2,%ebp
sub    %edx,%ebp
jmp    1376 <meta_check_metadatafile+0x1f6>
mov    %ebx,%edi
call   1050 <close@plt>
movl   $0x1,(%r14)
jmp    1376 <meta_check_metadatafile+0x1f6>
mov    %ebx,%edi
call   1050 <close@plt>
mov    $0x3,%ebp
jmp    1376 <meta_check_metadatafile+0x1f6>
lea    0xd67(%rip),%rsi
lea    0x50(%rsp),%rdi
mov    $0x10,%edx
call   1080 <memcpy@plt>
lea    0x10(%rsp),%r12
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x10,%edx
call   1060 <read@plt>
cmp    $0x10,%eax
jne    135d <meta_check_metadatafile+0x1dd>
cmp    $0x1f,%ebp
ja     12e5 <meta_check_metadatafile+0x165>
lea    0x20(%rsp),%rax
mov    %rax,0x8(%rsp)
jmp    12fa <meta_check_metadatafile+0x17a>
mov    %r12,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1090 <get64bit@plt>
mov    %eax,(%r14)
mov    %r15,%r14
lea    0x8(%rsp),%rdi
call   1090 <get64bit@plt>
mov    %eax,(%r14)
mov    0x2cda(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    $0xfffffff0,%esi
call   1030 <lseek@plt>
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0x10,%edx
call   1060 <read@plt>
cmp    $0x10,%eax
jne    135d <meta_check_metadatafile+0x1dd>
mov    %ebx,%edi
call   1050 <close@plt>
lea    0x10(%rsp),%rdi
lea    0x50(%rsp),%rsi
mov    $0x10,%edx
xor    %eax,%eax
call   1070 <memcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
shl    $0x2,%ebp
jmp    1376 <meta_check_metadatafile+0x1f6>
mov    0x2c6c(%rip),%r14
mov    (%r14),%ebp
mov    %ebx,%edi
call   1050 <close@plt>
mov    %ebp,(%r14)
mov    $0x2,%ebp
mov    %ebp,%eax
add    $0x90,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@errno = global i32 0
@ENOENT = global i32 0
@.str = [9 x i8] c"MFSM NEW\00"
@.str.1 = [6 x i8] c"MFSM \00"
@.str.2 = [17 x i8] c"[MFS EOF MARKER]\00"
@SEEK_END = global i32 0
define i32 @meta_check_metadatafile(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [16 x i32]
%11 = alloca [16 x i32]
%12 = alloca i32
%13 = alloca i32*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%14 = load i32*, i32** %6
store i32 0, i32* %14
%15 = load i32*, i32** %7
store i32 0, i32* %15
%16 = load i8*, i8** %5
%17 = load i32, i32* @O_RDONLY
%18 = call i32 @open(i8* %16, i32 %17)
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %3
%22 = load i32, i32* @errno
%23 = load i32, i32* @ENOENT
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %4
br label %136
26: ; preds = %21
store i32 2, i32* %4
br label %136
27: ; preds = %3
%28 = load i32, i32* %8
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%30 = call i32 @read(i32 %28, i32* %29, i32 8)
%31 = icmp ne i32 %30, 8
br i1 %31, label %32, label %37
32: ; preds = %27
%33 = load i32, i32* @errno
store i32 %33, i32* %9
%34 = load i32, i32* %8
%35 = call i32 @close(i32 %34)
%36 = load i32, i32* %9
store i32 %36, i32* @errno
store i32 2, i32* %4
br label %136
37: ; preds = %27
%38 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%39 = call i64 (i32*, ...) @memcmp(i32* %38, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = load i32, i32* %8
%43 = call i32 @close(i32 %42)
%44 = load i32*, i32** %6
store i32 1, i32* %44
store i32 0, i32* %4
br label %136
45: ; preds = %37
%46 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%47 = call i64 (i32*, ...) @memcmp(i32* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %78
49: ; preds = %45
%50 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 5
%51 = load i32, i32* %50
%52 = icmp sge i32 %51, 49
br i1 %52, label %53, label %78
53: ; preds = %49
%54 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 5
%55 = load i32, i32* %54
%56 = icmp sle i32 %55, 57
br i1 %56, label %57, label %78
57: ; preds = %53
%58 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 6
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 46
br i1 %60, label %61, label %78
61: ; preds = %57
%62 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 7
%63 = load i32, i32* %62
%64 = icmp sge i32 %63, 48
br i1 %64, label %65, label %78
65: ; preds = %61
%66 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 7
%67 = load i32, i32* %66
%68 = icmp sle i32 %67, 57
br i1 %68, label %69, label %78
69: ; preds = %65
%70 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 5
%71 = load i32, i32* %70
%72 = sub nsw i32 %71, 48
%73 = shl i32 %72, 4
%74 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 7
%75 = load i32, i32* %74
%76 = sub nsw i32 %75, 48
%77 = add nsw i32 %73, %76
store i32 %77, i32* %12
br label %81
78: ; preds = %65, %61, %57, %53, %49, %45
%79 = load i32, i32* %8
%80 = call i32 @close(i32 %79)
store i32 3, i32* %4
br label %136
81: ; preds = %69
%82 = load i32, i32* %12
%83 = icmp slt i32 %82, 22
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%86 = call i32 @memset(i32* %85, i32 0, i32 16)
br label %90
87: ; preds = %81
%88 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%89 = call i32 @memcpy(i32* %88, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 16)
br label %90
90: ; preds = %87, %84
%91 = load i32, i32* %8
%92 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%93 = call i32 @read(i32 %91, i32* %92, i32 16)
%94 = icmp ne i32 %93, 16
br i1 %94, label %95, label %100
95: ; preds = %90
%96 = load i32, i32* @errno
store i32 %96, i32* %9
%97 = load i32, i32* %8
%98 = call i32 @close(i32 %97)
%99 = load i32, i32* %9
store i32 %99, i32* @errno
store i32 2, i32* %4
br label %136
100: ; preds = %90
%101 = load i32, i32* %12
%102 = icmp slt i32 %101, 32
br i1 %102, label %103, label %108
103: ; preds = %100
%104 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%105 = getelementptr inbounds i32, i32* %104, i64 4
store i32* %105, i32** %13
%106 = call i32 @get64bit(i32** %13)
%107 = load i32*, i32** %6
store i32 %106, i32* %107
br label %114
108: ; preds = %100
%109 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
store i32* %109, i32** %13
%110 = call i32 @get64bit(i32** %13)
%111 = load i32*, i32** %6
store i32 %110, i32* %111
%112 = call i32 @get64bit(i32** %13)
%113 = load i32*, i32** %7
store i32 %112, i32* %113
br label %114
114: ; preds = %108, %103
%115 = load i32, i32* %8
%116 = load i32, i32* @SEEK_END
%117 = call i32 @lseek(i32 %115, i32 -16, i32 %116)
%118 = load i32, i32* %8
%119 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%120 = call i32 @read(i32 %118, i32* %119, i32 16)
%121 = icmp ne i32 %120, 16
br i1 %121, label %122, label %127
122: ; preds = %114
%123 = load i32, i32* @errno
store i32 %123, i32* %9
%124 = load i32, i32* %8
%125 = call i32 @close(i32 %124)
%126 = load i32, i32* %9
store i32 %126, i32* @errno
store i32 2, i32* %4
br label %136
127: ; preds = %114
%128 = load i32, i32* %8
%129 = call i32 @close(i32 %128)
%130 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%131 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%132 = call i64 (i32*, ...) @memcmp(i32* %130, i32* %131, i32 16)
%133 = icmp ne i64 %132, 0
br i1 %133, label %134, label %135
134: ; preds = %127
store i32 4, i32* %4
br label %136
135: ; preds = %127
store i32 0, i32* %4
br label %136
136: ; preds = %135, %134, %122, %95, %78, %41, %32, %26, %25
%137 = load i32, i32* %4
ret i32 %137
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@errno = global i32 0
@ENOENT = global i32 0
@.str = [9 x i8] c"MFSM NEW\00"
@.str.1 = [6 x i8] c"MFSM \00"
@.str.2 = [17 x i8] c"[MFS EOF MARKER]\00"
@SEEK_END = global i32 0
define i32 @meta_check_metadatafile(i8* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca [16 x i32]
%5 = alloca [16 x i32]
%6 = alloca i32*
%7 = bitcast [16 x i32]* %4 to i8*
%8 = bitcast [16 x i32]* %5 to i8*
%9 = bitcast i32** %6 to i8*
store i32 0, i32* %1
store i32 0, i32* %2
%10 = load i32, i32* @O_RDONLY
%11 = tail call i32 @open(i8* %0, i32 %10)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* @errno
%15 = load i32, i32* @ENOENT
%16 = icmp eq i32 %14, %15
%17 = select i1 %16, i32 1, i32 2
br label %89
18: ; preds = %3
%19 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%20 = call i32 @read(i32 %11, i32* %19, i32 8)
%21 = icmp eq i32 %20, 8
br i1 %21, label %25, label %22
22: ; preds = %18
%23 = load i32, i32* @errno
%24 = tail call i32 @close(i32 %11)
store i32 %23, i32* @errno
br label %89
25: ; preds = %18
%26 = call i64 (i32*, ...) @memcmp(i32* %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @close(i32 %11)
store i32 1, i32* %1
br label %89
30: ; preds = %25
%31 = call i64 (i32*, ...) @memcmp(i32* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%32 = icmp eq i64 %31, 0
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 5
%34 = load i32, i32* %33
%35 = icmp sgt i32 %34, 48
%36 = select i1 %32, i1 %35, i1 false
%37 = icmp slt i32 %34, 58
%38 = select i1 %36, i1 %37, i1 false
%39 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 6
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 46
%42 = select i1 %38, i1 %41, i1 false
%43 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 7
%44 = load i32, i32* %43
%45 = icmp sgt i32 %44, 47
%46 = select i1 %42, i1 %45, i1 false
%47 = icmp slt i32 %44, 58
%48 = select i1 %46, i1 %47, i1 false
br i1 %48, label %49, label %55
49: ; preds = %30
%50 = shl nuw nsw i32 %34, 4
%51 = add nsw i32 %50, -816
%52 = add nsw i32 %51, %44
%53 = icmp ult i32 %52, 22
%54 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
br i1 %53, label %57, label %59
55: ; preds = %30
%56 = call i32 @close(i32 %11)
br label %89
57: ; preds = %49
%58 = call i32 @memset(i32* %54, i32 0, i32 16)
br label %61
59: ; preds = %49
%60 = call i32 @memcpy(i32* %54, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 16)
br label %61
61: ; preds = %59, %57
%62 = call i32 @read(i32 %11, i32* %19, i32 16)
%63 = icmp eq i32 %62, 16
br i1 %63, label %67, label %64
64: ; preds = %61
%65 = load i32, i32* @errno
%66 = call i32 @close(i32 %11)
store i32 %65, i32* @errno
br label %89
67: ; preds = %61
%68 = icmp ult i32 %52, 32
br i1 %68, label %69, label %71
69: ; preds = %67
%70 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 4
store i32* %70, i32** %6
br label %73
71: ; preds = %67
store i32* %19, i32** %6
%72 = call i32 @get64bit(i32** %6)
store i32 %72, i32* %1
br label %73
73: ; preds = %71, %69
%74 = phi i32* [ %2, %71 ], [ %1, %69 ]
%75 = call i32 @get64bit(i32** %6)
store i32 %75, i32* %74
%76 = load i32, i32* @SEEK_END
%77 = call i32 @lseek(i32 %11, i32 -16, i32 %76)
%78 = call i32 @read(i32 %11, i32* %19, i32 16)
%79 = icmp eq i32 %78, 16
br i1 %79, label %83, label %80
80: ; preds = %73
%81 = load i32, i32* @errno
%82 = call i32 @close(i32 %11)
store i32 %81, i32* @errno
br label %89
83: ; preds = %73
%84 = call i32 @close(i32 %11)
%85 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%86 = call i64 (i32*, ...) @memcmp(i32* %19, i32* %85, i32 16)
%87 = icmp eq i64 %86, 0
%88 = select i1 %87, i32 0, i32 4
br label %89
89: ; preds = %83, %13, %80, %64, %55, %28, %22
%90 = phi i32 [ 2, %22 ], [ 0, %28 ], [ 2, %64 ], [ 2, %80 ], [ 3, %55 ], [ %17, %13 ], [ %88, %83 ]
ret i32 %90
}