#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 */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  scalar_t__ avail_in;
  unsigned char *next_in;
  int avail_out;
  unsigned char *next_out;
  void *opaque;
  void *zfree;
  void *zalloc;
};
typedef TYPE_1__ z_stream;
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
#define Z_DATA_ERROR 130
#define Z_MEM_ERROR 129
#define Z_NEED_DICT 128
int /*<<< orphan*/ Z_NO_FLUSH;
void *Z_NULL;
int Z_OK;
int Z_STREAM_END;
int Z_STREAM_ERROR;
int inflate(TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ inflateEnd(TYPE_1__ *);
int inflateInit2(TYPE_1__ *, int);
scalar_t__ lseek(int, scalar_t__, int /*<<< orphan*/);
scalar_t__ read(int, unsigned char *, int);
unsigned int write(int, unsigned char *, unsigned int);
int xerror(char *);
int xdecompress(int fdIn, int fdOut, off_t offsetIn, off_t offsetOut,
                size_t bytes) {
  if ((offsetIn != (off_t)-1) && (lseek(fdIn, offsetIn, SEEK_SET) == (off_t)-1))
    return xerror("Seek failed");
  if ((offsetOut != (off_t)-1) &&
      (lseek(fdOut, offsetOut, SEEK_SET) == (off_t)-1))
    return xerror("Seek failed");
  int CHUNK = 256 * 1024;
  int ret;
  unsigned have;
  z_stream strm;
  unsigned char in[CHUNK];
  unsigned char out[CHUNK];
  strm.zalloc = Z_NULL;
  strm.zfree = Z_NULL;
  strm.opaque = Z_NULL;
  strm.avail_in = 0;
  strm.next_in = Z_NULL;
  ret = inflateInit2(&strm, -15);
  if (ret != Z_OK)
    return xerror("ret != Z_OK");
  do {
    strm.avail_in = read(fdIn, in, CHUNK);
    if (strm.avail_in == 0)
      break;
    strm.next_in = in;
    do {
      strm.avail_out = CHUNK;
      strm.next_out = out;
      ret = inflate(&strm, Z_NO_FLUSH);
      if (ret == Z_STREAM_ERROR)
        return xerror("Stream error");
      switch (ret) {
      case Z_NEED_DICT:
        ret = Z_DATA_ERROR;
      case Z_DATA_ERROR:
      case Z_MEM_ERROR:
        (void)inflateEnd(&strm);
        return xerror("DICT/DATA/MEM error");
      }
      have = CHUNK - strm.avail_out;
      if (write(fdOut, out, have) != have) {
        (void)inflateEnd(&strm);
        return xerror("Write failed");
      }
    } while (strm.avail_out == 0);
  } while (ret != Z_STREAM_END);
  (void)inflateEnd(&strm);
  return ret == Z_STREAM_END ? 1 : 0;
}


x86 assembly (clang, -O0):
<xdecompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
je     11cb <xdecompress+0x5b>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    0x2e22(%rip),%rax
mov    (%rax),%edx
call   1060 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
jne    11cb <xdecompress+0x5b>
lea    0xe42(%rip),%rdi
call   1070 <xerror@plt>
mov    %eax,-0x4(%rbp)
jmp    1471 <xdecompress+0x301>
cmpq   $0xffffffffffffffff,-0x20(%rbp)
je     1209 <xdecompress+0x99>
mov    -0xc(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    0x2de4(%rip),%rax
mov    (%rax),%edx
call   1060 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
jne    1209 <xdecompress+0x99>
lea    0xe04(%rip),%rdi
call   1070 <xerror@plt>
mov    %eax,-0x4(%rbp)
jmp    1471 <xdecompress+0x301>
movl   $0x40000,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x80(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x88(%rbp)
mov    0x2d53(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    0x2d45(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    0x2d37(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x70(%rbp)
mov    0x2d21(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0xfffffff1,%esi
call   1050 <inflateInit2@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    0x2d37(%rip),%rcx
cmp    (%rcx),%eax
je     12df <xdecompress+0x16f>
lea    0xd44(%rip),%rdi
call   1070 <xerror@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
jmp    146a <xdecompress+0x2fa>
jmp    12e4 <xdecompress+0x174>
mov    -0xa0(%rbp),%rsi
mov    -0x8(%rbp),%edi
mov    -0x2c(%rbp),%edx
call   1080 <read@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    130a <xdecompress+0x19a>
jmp    143c <xdecompress+0x2cc>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x98(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,-0x60(%rbp)
mov    %rax,-0x58(%rbp)
mov    0x2c93(%rip),%rax
mov    (%rax),%esi
lea    -0x70(%rbp),%rdi
call   1030 <inflate@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    0x2c8b(%rip),%rcx
cmp    (%rcx),%eax
jne    136b <xdecompress+0x1fb>
lea    0xcc4(%rip),%rdi
call   1070 <xerror@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
jmp    146a <xdecompress+0x2fa>
mov    -0x30(%rbp),%eax
mov    %eax,-0xa4(%rbp)
sub    $0x80,%eax
je     139d <xdecompress+0x22d>
jmp    1384 <xdecompress+0x214>
mov    -0xa4(%rbp),%eax
add    $0xffffff7f,%eax
sub    $0x2,%eax
jb     13a4 <xdecompress+0x234>
jmp    13cb <xdecompress+0x25b>
movl   $0x82,-0x30(%rbp)
lea    -0x70(%rbp),%rdi
call   1090 <inflateEnd@plt>
lea    0xc71(%rip),%rdi
call   1070 <xerror@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
jmp    146a <xdecompress+0x2fa>
mov    -0x98(%rbp),%rsi
mov    -0x2c(%rbp),%eax
sub    -0x60(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x34(%rbp),%edx
call   1040 <write@plt>
cmp    -0x34(%rbp),%eax
je     1416 <xdecompress+0x2a6>
lea    -0x70(%rbp),%rdi
call   1090 <inflateEnd@plt>
lea    0xc3a(%rip),%rdi
call   1070 <xerror@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
jmp    146a <xdecompress+0x2fa>
jmp    141b <xdecompress+0x2ab>
cmpl   $0x0,-0x60(%rbp)
je     1315 <xdecompress+0x1a5>
jmp    142a <xdecompress+0x2ba>
mov    -0x30(%rbp),%eax
mov    0x2bac(%rip),%rcx
cmp    (%rcx),%eax
jne    12e4 <xdecompress+0x174>
lea    -0x70(%rbp),%rdi
call   1090 <inflateEnd@plt>
mov    -0x30(%rbp),%edx
mov    0x2b91(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdecompress>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rcx,%rbx
mov    %esi,%r15d
mov    %edi,%r14d
cmp    $0xffffffffffffffff,%rdx
je     11b0 <xdecompress+0x40>
mov    0x2e31(%rip),%rax
mov    (%rax),%eax
mov    %r14d,%edi
mov    %rdx,%rsi
mov    %eax,%edx
call   1060 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
je     12e9 <xdecompress+0x179>
cmp    $0xffffffffffffffff,%rbx
je     11d4 <xdecompress+0x64>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
mov    %rbx,%rsi
call   1060 <lseek@plt>
cmp    $0xffffffffffffffff,%rax
je     12e9 <xdecompress+0x179>
mov    %r14d,-0x34(%rbp)
mov    %rsp,-0x30(%rbp)
mov    %rsp,%r12
add    $0xfffffffffffc0000,%r12
mov    %r12,%rsp
mov    %rsp,%r13
add    $0xfffffffffffc0000,%r13
mov    %r13,%rsp
mov    0x2dbb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    %rax,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x70(%rbp)
mov    %rax,-0x68(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0xfffffff1,%esi
call   1050 <inflateInit2@plt>
mov    %eax,%ebx
mov    0x2dc1(%rip),%rax
cmp    (%rax),%ebx
jne    1303 <xdecompress+0x193>
mov    -0x34(%rbp),%edi
mov    %r12,%rsi
mov    $0x40000,%edx
call   1080 <read@plt>
mov    %rax,-0x70(%rbp)
test   %rax,%rax
je     12d0 <xdecompress+0x160>
mov    %r12,-0x68(%rbp)
nopl   0x0(%rax,%rax,1)
movl   $0x40000,-0x60(%rbp)
mov    %r13,-0x58(%rbp)
mov    0x2d4e(%rip),%rax
mov    (%rax),%esi
lea    -0x70(%rbp),%rdi
call   1030 <inflate@plt>
mov    %eax,%ebx
mov    0x2d4a(%rip),%rax
cmp    (%rax),%ebx
je     1325 <xdecompress+0x1b5>
lea    -0x80(%rbx),%eax
cmp    $0x2,%eax
jbe    132e <xdecompress+0x1be>
mov    $0x40000,%r14d
sub    -0x60(%rbp),%r14d
mov    %r15d,%edi
mov    %r13,%rsi
mov    %r14d,%edx
call   1040 <write@plt>
cmp    %r14d,%eax
jne    1340 <xdecompress+0x1d0>
cmpl   $0x0,-0x60(%rbp)
je     1260 <xdecompress+0xf0>
mov    0x2d18(%rip),%rax
cmp    (%rax),%ebx
jne    1237 <xdecompress+0xc7>
lea    -0x70(%rbp),%rdi
call   1090 <inflateEnd@plt>
mov    0x2d00(%rip),%rcx
xor    %eax,%eax
cmp    (%rcx),%ebx
sete   %al
jmp    130f <xdecompress+0x19f>
lea    0xd10(%rip),%rdi
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <xerror@plt>
lea    0xd02(%rip),%rdi
call   1070 <xerror@plt>
mov    -0x30(%rbp),%rcx
mov    %rcx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcec(%rip),%rdi
jmp    130a <xdecompress+0x19a>
lea    -0x70(%rbp),%rdi
call   1090 <inflateEnd@plt>
lea    0xce7(%rip),%rdi
jmp    130a <xdecompress+0x19a>
lea    -0x70(%rbp),%rdi
call   1090 <inflateEnd@plt>
lea    0xce9(%rip),%rdi
jmp    130a <xdecompress+0x19a>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64, i8*, i32, i8*, i8*, i8*, i8* }
@SEEK_SET = global i32 0
@.str = [12 x i8] c"Seek failed\00"
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str.1 = [12 x i8] c"ret != Z_OK\00"
@Z_NO_FLUSH = global i32 0
@Z_STREAM_ERROR = global i32 0
@.str.2 = [13 x i8] c"Stream error\00"
@.str.3 = [20 x i8] c"DICT/DATA/MEM error\00"
@.str.4 = [13 x i8] c"Write failed\00"
@Z_STREAM_END = global i32 0
define i32 @xdecompress(i32 %0, i32 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca %struct.TYPE_5__
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i64
%19 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
%20 = load i64, i64* %9
%21 = icmp ne i64 %20, -1
br i1 %21, label %22, label %30
22: ; preds = %5
%23 = load i32, i32* %7
%24 = load i64, i64* %9
%25 = load i32, i32* @SEEK_SET
%26 = call i64 @lseek(i32 %23, i64 %24, i32 %25)
%27 = icmp eq i64 %26, -1
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 @xerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %29, i32* %6
br label %125
30: ; preds = %22, %5
%31 = load i64, i64* %10
%32 = icmp ne i64 %31, -1
br i1 %32, label %33, label %41
33: ; preds = %30
%34 = load i32, i32* %8
%35 = load i64, i64* %10
%36 = load i32, i32* @SEEK_SET
%37 = call i64 @lseek(i32 %34, i64 %35, i32 %36)
%38 = icmp eq i64 %37, -1
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = call i32 @xerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %40, i32* %6
br label %125
41: ; preds = %33, %30
store i32 262144, i32* %12
%42 = load i32, i32* %12
%43 = zext i32 %42 to i64
%44 = call i8* @llvm.stacksave()
store i8* %44, i8** %16
%45 = alloca i8, i64 %43
store i64 %43, i64* %17
%46 = load i32, i32* %12
%47 = zext i32 %46 to i64
%48 = alloca i8, i64 %47
store i64 %47, i64* %18
%49 = load i8*, i8** @Z_NULL
%50 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 6
store i8* %49, i8** %50
%51 = load i8*, i8** @Z_NULL
%52 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 5
store i8* %51, i8** %52
%53 = load i8*, i8** @Z_NULL
%54 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 4
store i8* %53, i8** %54
%55 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 0
store i64 0, i64* %55
%56 = load i8*, i8** @Z_NULL
%57 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 1
store i8* %56, i8** %57
%58 = call i32 @inflateInit2(%struct.TYPE_5__* %15, i32 -15)
store i32 %58, i32* %13
%59 = load i32, i32* %13
%60 = load i32, i32* @Z_OK
%61 = icmp ne i32 %59, %60
br i1 %61, label %62, label %64
62: ; preds = %41
%63 = call i32 @xerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 %63, i32* %6
store i32 1, i32* %19
br label %123
64: ; preds = %41
br label %65
65: ; preds = %112, %64
%66 = load i32, i32* %7
%67 = load i32, i32* %12
%68 = call i64 @read(i32 %66, i8* %45, i32 %67)
%69 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 0
store i64 %68, i64* %69
%70 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 0
%71 = load i64, i64* %70
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %65
br label %116
74: ; preds = %65
%75 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 1
store i8* %45, i8** %75
br label %76
76: ; preds = %107, %74
%77 = load i32, i32* %12
%78 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 2
store i32 %77, i32* %78
%79 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 3
store i8* %48, i8** %79
%80 = load i32, i32* @Z_NO_FLUSH
%81 = call i32 @inflate(%struct.TYPE_5__* %15, i32 %80)
store i32 %81, i32* %13
%82 = load i32, i32* %13
%83 = load i32, i32* @Z_STREAM_ERROR
%84 = icmp eq i32 %82, %83
br i1 %84, label %85, label %87
85: ; preds = %76
%86 = call i32 @xerror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 %86, i32* %6
store i32 1, i32* %19
br label %123
87: ; preds = %76
%88 = load i32, i32* %13
switch i32 %88, label %93 [
i32 128, label %89
i32 130, label %90
i32 129, label %90
]
89: ; preds = %87
store i32 130, i32* %13
br label %90
90: ; preds = %87, %87, %89
%91 = call i32 @inflateEnd(%struct.TYPE_5__* %15)
%92 = call i32 @xerror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
store i32 %92, i32* %6
store i32 1, i32* %19
br label %123
93: ; preds = %87
%94 = load i32, i32* %12
%95 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 2
%96 = load i32, i32* %95
%97 = sub nsw i32 %94, %96
store i32 %97, i32* %14
%98 = load i32, i32* %8
%99 = load i32, i32* %14
%100 = call i32 @write(i32 %98, i8* %48, i32 %99)
%101 = load i32, i32* %14
%102 = icmp ne i32 %100, %101
br i1 %102, label %103, label %106
103: ; preds = %93
%104 = call i32 @inflateEnd(%struct.TYPE_5__* %15)
%105 = call i32 @xerror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
store i32 %105, i32* %6
store i32 1, i32* %19
br label %123
106: ; preds = %93
br label %107
107: ; preds = %106
%108 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 2
%109 = load i32, i32* %108
%110 = icmp eq i32 %109, 0
br i1 %110, label %76, label %111
111: ; preds = %107
br label %112
112: ; preds = %111
%113 = load i32, i32* %13
%114 = load i32, i32* @Z_STREAM_END
%115 = icmp ne i32 %113, %114
br i1 %115, label %65, label %116
116: ; preds = %112, %73
%117 = call i32 @inflateEnd(%struct.TYPE_5__* %15)
%118 = load i32, i32* %13
%119 = load i32, i32* @Z_STREAM_END
%120 = icmp eq i32 %118, %119
%121 = zext i1 %120 to i64
%122 = select i1 %120, i32 1, i32 0
store i32 %122, i32* %6
store i32 1, i32* %19
br label %123
123: ; preds = %116, %103, %90, %85, %62
%124 = load i8*, i8** %16
br label %125
125: ; preds = %123, %39, %28
%126 = load i32, i32* %6
ret i32 %126
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64, i8*, i32, i8*, i8*, i8*, i8* }
@SEEK_SET = global i32 0
@.str = [12 x i8] c"Seek failed\00"
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str.1 = [12 x i8] c"ret != Z_OK\00"
@Z_NO_FLUSH = global i32 0
@Z_STREAM_ERROR = global i32 0
@.str.2 = [13 x i8] c"Stream error\00"
@.str.3 = [20 x i8] c"DICT/DATA/MEM error\00"
@.str.4 = [13 x i8] c"Write failed\00"
@Z_STREAM_END = global i32 0
define i32 @xdecompress(i32 %0, i32 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca %struct.TYPE_5__
%7 = icmp eq i64 %2, -1
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* @SEEK_SET
%10 = tail call i64 @lseek(i32 %0, i64 %2, i32 %9)
%11 = icmp eq i64 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 @xerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %85
14: ; preds = %8, %5
%15 = icmp eq i64 %3, -1
br i1 %15, label %22, label %16
16: ; preds = %14
%17 = load i32, i32* @SEEK_SET
%18 = tail call i64 @lseek(i32 %1, i64 %3, i32 %17)
%19 = icmp eq i64 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = tail call i32 @xerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %85
22: ; preds = %16, %14
%23 = bitcast %struct.TYPE_5__* %6 to i8*
%24 = tail call i8* @llvm.stacksave()
%25 = alloca [262144 x i8]
%26 = alloca [262144 x i8]
%27 = getelementptr inbounds [262144 x i8], [262144 x i8]* %26, i64 0, i64 0
%28 = getelementptr inbounds [262144 x i8], [262144 x i8]* %25, i64 0, i64 0
%29 = load i8*, i8** @Z_NULL
%30 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i64 0, i32 6
store i8* %29, i8** %30
%31 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i64 0, i32 5
store i8* %29, i8** %31
%32 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i64 0, i32 4
store i8* %29, i8** %32
%33 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i64 0, i32 0
store i64 0, i64* %33
%34 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i64 0, i32 1
store i8* %29, i8** %34
%35 = call i32 @inflateInit2(%struct.TYPE_5__* %6, i32 -15)
%36 = load i32, i32* @Z_OK
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %44
38: ; preds = %22
%39 = call i64 @read(i32 %0, i8* %28, i32 262144)
store i64 %39, i64* %33
%40 = icmp eq i64 %39, 0
br i1 %40, label %77, label %41
41: ; preds = %38
%42 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i64 0, i32 2
%43 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i64 0, i32 3
br label %49
44: ; preds = %22
%45 = call i32 @xerror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %83
46: ; preds = %74
%47 = call i64 @read(i32 %0, i8* %28, i32 262144)
store i64 %47, i64* %33
%48 = icmp eq i64 %47, 0
br i1 %48, label %77, label %49
49: ; preds = %41, %46
store i8* %28, i8** %34
br label %50
50: ; preds = %71, %49
store i32 262144, i32* %42
store i8* %27, i8** %43
%51 = load i32, i32* @Z_NO_FLUSH
%52 = call i32 @inflate(%struct.TYPE_5__* %6, i32 %51)
%53 = load i32, i32* @Z_STREAM_ERROR
%54 = icmp eq i32 %52, %53
br i1 %54, label %55, label %57
55: ; preds = %50
%56 = call i32 @xerror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %83
57: ; preds = %50
%58 = add i32 %52, -128
%59 = icmp ult i32 %58, 3
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = call i32 @inflateEnd(%struct.TYPE_5__* %6)
%62 = call i32 @xerror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %83
63: ; preds = %57
%64 = load i32, i32* %42
%65 = sub nsw i32 262144, %64
%66 = call i32 @write(i32 %1, i8* %27, i32 %65)
%67 = icmp eq i32 %66, %65
br i1 %67, label %71, label %68
68: ; preds = %63
%69 = call i32 @inflateEnd(%struct.TYPE_5__* %6)
%70 = call i32 @xerror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %83
71: ; preds = %63
%72 = load i32, i32* %42
%73 = icmp eq i32 %72, 0
br i1 %73, label %50, label %74
74: ; preds = %71
%75 = load i32, i32* @Z_STREAM_END
%76 = icmp eq i32 %52, %75
br i1 %76, label %77, label %46
77: ; preds = %74, %46, %38
%78 = phi i32 [ %35, %38 ], [ %52, %46 ], [ %52, %74 ]
%79 = call i32 @inflateEnd(%struct.TYPE_5__* %6)
%80 = load i32, i32* @Z_STREAM_END
%81 = icmp eq i32 %78, %80
%82 = zext i1 %81 to i32
br label %83
83: ; preds = %77, %68, %60, %55, %44
%84 = phi i32 [ %45, %44 ], [ %82, %77 ], [ %56, %55 ], [ %70, %68 ], [ %62, %60 ]
br label %85
85: ; preds = %83, %20, %12
%86 = phi i32 [ %13, %12 ], [ %21, %20 ], [ %84, %83 ]
ret i32 %86
}