#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__ {
  unsigned char const *zalloc;
  unsigned char const *zfree;
  unsigned char const *opaque;
  unsigned int avail_in;
  unsigned char const *next_in;
  unsigned int avail_out;
  unsigned char *next_out;
};
typedef TYPE_1__ z_stream;

/* Variables and functions */
size_t UINT_MAX;
int Z_DATA_ERROR;
int Z_MEM_ERROR;
int Z_NEED_DICT;
int /*<<< orphan*/ Z_NO_FLUSH;
unsigned char const *Z_NULL;
int Z_OK;
int Z_STREAM_END;
int /*<<< orphan*/ bgen_error(char *, ...);
int inflate(TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ inflateEnd(TYPE_1__ *);
int inflateInit(TYPE_1__ *);
scalar_t__ realloc(char *, size_t);
int /*<<< orphan*/ zError(int);
int bgen_unzlib_chunked(char const *src, size_t src_size, char **dst,
                        size_t *dst_size) {
  if (*dst_size > UINT_MAX) {
    bgen_error("zlib *dst_size overflow");
    return 1;
  }
  unsigned unused = (unsigned)*dst_size;
  unsigned char *cdst = (unsigned char *)*dst;
  z_stream strm = {.zalloc = Z_NULL,
                   .zfree = Z_NULL,
                   .opaque = Z_NULL,
                   .avail_in = 0,
                   .next_in = Z_NULL};
  int ret = inflateInit(&strm);
  if (ret != Z_OK) {
    bgen_error("zlib failed to uncompress (%s)", zError(ret));
    goto err;
  }
  strm.avail_in = (unsigned)src_size;
  strm.next_in = (unsigned char const *)src;
  while (1) {
    strm.avail_out = unused;
    strm.next_out = cdst;
    ret = inflate(&strm, Z_NO_FLUSH);
    if (ret == Z_NEED_DICT) {
      ret = Z_DATA_ERROR;
      goto err;
    }
    if (ret == Z_DATA_ERROR || ret == Z_MEM_ERROR)
      goto err;
    unsigned just_wrote = unused - strm.avail_out;
    cdst += just_wrote;
    unused -= just_wrote;
    if (ret == Z_STREAM_END) {
      *dst_size -= unused;
      *dst = (char *)realloc(*dst, *dst_size);
      break;
    }
    if (strm.avail_out == 0) {
      if (unused > 0) {
        bgen_error("zlib failed to uncompress (unknown error)");
        goto err;
      }
      unused = (unsigned)*dst_size;
      *dst_size += unused;
      *dst = (char *)realloc(*dst, *dst_size);
      cdst = (unsigned char *)*dst + unused;
    }
  }
  inflateEnd(&strm);
  return 0;
err:
  inflateEnd(&strm);
  return 1;
}


x86 assembly (clang, -O0):
<bgen_unzlib_chunked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x2e37(%rip),%rcx
cmp    (%rcx),%rax
jbe    11ac <bgen_unzlib_chunked+0x4c>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <bgen_error@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ca <bgen_unzlib_chunked+0x26a>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x2de0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
mov    0x2dd2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    0x2dc4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x58(%rbp)
mov    0x2daf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
lea    -0x70(%rbp),%rdi
call   1060 <inflateInit@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    0x2dc3(%rip),%rcx
cmp    (%rcx),%eax
je     124a <bgen_unzlib_chunked+0xea>
mov    -0x74(%rbp),%edi
call   1050 <zError@plt>
mov    %eax,%esi
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <bgen_error@plt>
jmp    13ba <bgen_unzlib_chunked+0x25a>
mov    -0x18(%rbp),%rax
mov    %eax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    0x2d42(%rip),%rax
mov    (%rax),%esi
lea    -0x70(%rbp),%rdi
call   1040 <inflate@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    0x2d4a(%rip),%rcx
cmp    (%rcx),%eax
jne    129f <bgen_unzlib_chunked+0x13f>
mov    0x2d5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
jmp    13ba <bgen_unzlib_chunked+0x25a>
mov    -0x74(%rbp),%eax
mov    0x2d47(%rip),%rcx
cmp    (%rcx),%eax
je     12c3 <bgen_unzlib_chunked+0x163>
mov    -0x74(%rbp),%eax
mov    0x2d1d(%rip),%rcx
cmp    (%rcx),%eax
jne    12c8 <bgen_unzlib_chunked+0x168>
jmp    13ba <bgen_unzlib_chunked+0x25a>
mov    -0x2c(%rbp),%eax
sub    -0x48(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%ecx
mov    -0x2c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x74(%rbp),%eax
mov    0x2cd2(%rip),%rcx
cmp    (%rcx),%eax
jne    1332 <bgen_unzlib_chunked+0x1d2>
mov    -0x2c(%rbp),%eax
mov    %eax,%edx
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
sub    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
call   1080 <realloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    13a5 <bgen_unzlib_chunked+0x245>
cmpl   $0x0,-0x48(%rbp)
jne    13a0 <bgen_unzlib_chunked+0x240>
cmpl   $0x0,-0x2c(%rbp)
jbe    1359 <bgen_unzlib_chunked+0x1f9>
lea    0xcea(%rip),%rdi
mov    $0x0,%al
call   1030 <bgen_error@plt>
jmp    13ba <bgen_unzlib_chunked+0x25a>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
call   1080 <realloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x2c(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
jmp    1259 <bgen_unzlib_chunked+0xf9>
lea    -0x70(%rbp),%rdi
call   1070 <inflateEnd@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ca <bgen_unzlib_chunked+0x26a>
lea    -0x70(%rbp),%rdi
call   1070 <inflateEnd@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgen_unzlib_chunked>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    (%rcx),%rbx
mov    0x2e48(%rip),%rax
cmp    (%rax),%rbx
jbe    1195 <bgen_unzlib_chunked+0x35>
lea    0xe7c(%rip),%rdi
xor    %eax,%eax
call   1030 <bgen_error@plt>
mov    $0x1,%ebx
jmp    130b <bgen_unzlib_chunked+0x1ab>
mov    %rcx,%r13
mov    %rsi,%r12
mov    %rdi,%r15
mov    %rdx,0x8(%rsp)
mov    (%rdx),%rbp
mov    0x2dfb(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %rax,0x20(%rsp)
movl   $0x0,0x28(%rsp)
mov    %rax,0x30(%rsp)
movl   $0x0,0x38(%rsp)
movq   $0x0,0x40(%rsp)
lea    0x10(%rsp),%rdi
call   1060 <inflateInit@plt>
mov    0x2dfa(%rip),%rcx
cmp    (%rcx),%eax
jne    12e5 <bgen_unzlib_chunked+0x185>
mov    %r12d,0x28(%rsp)
mov    %r15,0x30(%rsp)
mov    %ebx,0x38(%rsp)
mov    %rbp,0x40(%rsp)
mov    0x2da0(%rip),%r12
mov    (%r12),%esi
lea    0x10(%rsp),%rdi
call   1040 <inflate@plt>
mov    0x2dab(%rip),%r14
cmp    (%r14),%eax
je     12fc <bgen_unzlib_chunked+0x19c>
mov    0x2dbb(%rip),%r15
cmp    (%r15),%eax
je     12fc <bgen_unzlib_chunked+0x19c>
mov    0x2d93(%rip),%rcx
cmp    (%rcx),%eax
je     12fc <bgen_unzlib_chunked+0x19c>
nopl   (%rax)
mov    0x38(%rsp),%ecx
mov    0x2d6d(%rip),%rdx
cmp    (%rdx),%eax
je     131c <bgen_unzlib_chunked+0x1bc>
test   %ecx,%ecx
je     1270 <bgen_unzlib_chunked+0x110>
sub    %ecx,%ebx
add    %rbx,%rbp
mov    %ecx,%ebx
jmp    12b3 <bgen_unzlib_chunked+0x153>
mov    0x0(%r13),%rbx
mov    %r12,%r15
mov    %ebx,%r12d
mov    %rbx,%rsi
add    %r12,%rsi
mov    %rsi,0x0(%r13)
mov    %r13,%r14
mov    0x8(%rsp),%r13
mov    0x0(%r13),%rdi
call   1080 <realloc@plt>
mov    %rax,%rbp
mov    %rax,0x0(%r13)
mov    %r14,%r13
add    %r12,%rbp
mov    %r15,%r12
mov    0x2d44(%rip),%r15
mov    0x2d1d(%rip),%r14
mov    %ebx,0x38(%rsp)
mov    %rbp,0x40(%rsp)
mov    (%r12),%esi
lea    0x10(%rsp),%rdi
call   1040 <inflate@plt>
cmp    (%r14),%eax
je     12fc <bgen_unzlib_chunked+0x19c>
cmp    (%r15),%eax
je     12fc <bgen_unzlib_chunked+0x19c>
mov    0x2cfd(%rip),%rcx
cmp    (%rcx),%eax
jne    1250 <bgen_unzlib_chunked+0xf0>
jmp    12fc <bgen_unzlib_chunked+0x19c>
mov    %eax,%edi
call   1050 <zError@plt>
lea    0xd25(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <bgen_error@plt>
mov    $0x1,%ebx
lea    0x10(%rsp),%rdi
call   1070 <inflateEnd@plt>
mov    %ebx,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%r13),%rsi
sub    %rcx,%rsi
mov    %rsi,0x0(%r13)
mov    0x8(%rsp),%rbx
mov    (%rbx),%rdi
call   1080 <realloc@plt>
mov    %rax,(%rbx)
xor    %ebx,%ebx
jmp    1301 <bgen_unzlib_chunked+0x1a1>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i8*, i8*, i8*, i32, i8*, i32, i8* }
@UINT_MAX = global i64 0
@.str = [24 x i8] c"zlib *dst_size overflow\00"
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str.1 = [31 x i8] c"zlib failed to uncompress (%s)\00"
@Z_NO_FLUSH = global i32 0
@Z_NEED_DICT = global i32 0
@Z_DATA_ERROR = global i32 0
@Z_MEM_ERROR = global i32 0
@Z_STREAM_END = global i32 0
@.str.2 = [42 x i8] c"zlib failed to uncompress (unknown error)\00"
define i32 @bgen_unzlib_chunked(i8* %0, i64 %1, i8** %2, i64* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8**
%9 = alloca i64*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca %struct.TYPE_5__
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8** %2, i8*** %8
store i64* %3, i64** %9
%15 = load i64*, i64** %9
%16 = load i64, i64* %15
%17 = load i64, i64* @UINT_MAX
%18 = icmp ugt i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = call i32 (i8*, ...) @bgen_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %5
br label %136
21: ; preds = %4
%22 = load i64*, i64** %9
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
store i32 %24, i32* %10
%25 = load i8**, i8*** %8
%26 = load i8*, i8** %25
store i8* %26, i8** %11
%27 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 0
%28 = load i8*, i8** @Z_NULL
store i8* %28, i8** %27
%29 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 1
%30 = load i8*, i8** @Z_NULL
store i8* %30, i8** %29
%31 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 2
%32 = load i8*, i8** @Z_NULL
store i8* %32, i8** %31
%33 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 3
store i32 0, i32* %33
%34 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 4
%35 = load i8*, i8** @Z_NULL
store i8* %35, i8** %34
%36 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 5
store i32 0, i32* %36
%37 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 6
store i8* null, i8** %37
%38 = call i32 @inflateInit(%struct.TYPE_5__* %12)
store i32 %38, i32* %13
%39 = load i32, i32* %13
%40 = load i32, i32* @Z_OK
%41 = icmp ne i32 %39, %40
br i1 %41, label %42, label %46
42: ; preds = %21
%43 = load i32, i32* %13
%44 = call i32 @zError(i32 %43)
%45 = call i32 (i8*, ...) @bgen_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %44)
br label %134
46: ; preds = %21
%47 = load i64, i64* %7
%48 = trunc i64 %47 to i32
%49 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 3
store i32 %48, i32* %49
%50 = load i8*, i8** %6
%51 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 4
store i8* %50, i8** %51
br label %52
52: ; preds = %46, %131
%53 = load i32, i32* %10
%54 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 5
store i32 %53, i32* %54
%55 = load i8*, i8** %11
%56 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 6
store i8* %55, i8** %56
%57 = load i32, i32* @Z_NO_FLUSH
%58 = call i32 @inflate(%struct.TYPE_5__* %12, i32 %57)
store i32 %58, i32* %13
%59 = load i32, i32* %13
%60 = load i32, i32* @Z_NEED_DICT
%61 = icmp eq i32 %59, %60
br i1 %61, label %62, label %64
62: ; preds = %52
%63 = load i32, i32* @Z_DATA_ERROR
store i32 %63, i32* %13
br label %134
64: ; preds = %52
%65 = load i32, i32* %13
%66 = load i32, i32* @Z_DATA_ERROR
%67 = icmp eq i32 %65, %66
br i1 %67, label %72, label %68
68: ; preds = %64
%69 = load i32, i32* %13
%70 = load i32, i32* @Z_MEM_ERROR
%71 = icmp eq i32 %69, %70
br i1 %71, label %72, label %73
72: ; preds = %68, %64
br label %134
73: ; preds = %68
%74 = load i32, i32* %10
%75 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 5
%76 = load i32, i32* %75
%77 = sub i32 %74, %76
store i32 %77, i32* %14
%78 = load i32, i32* %14
%79 = load i8*, i8** %11
%80 = zext i32 %78 to i64
%81 = getelementptr inbounds i8, i8* %79, i64 %80
store i8* %81, i8** %11
%82 = load i32, i32* %14
%83 = load i32, i32* %10
%84 = sub i32 %83, %82
store i32 %84, i32* %10
%85 = load i32, i32* %13
%86 = load i32, i32* @Z_STREAM_END
%87 = icmp eq i32 %85, %86
br i1 %87, label %88, label %101
88: ; preds = %73
%89 = load i32, i32* %10
%90 = zext i32 %89 to i64
%91 = load i64*, i64** %9
%92 = load i64, i64* %91
%93 = sub i64 %92, %90
store i64 %93, i64* %91
%94 = load i8**, i8*** %8
%95 = load i8*, i8** %94
%96 = load i64*, i64** %9
%97 = load i64, i64* %96
%98 = call i64 @realloc(i8* %95, i64 %97)
%99 = inttoptr i64 %98 to i8*
%100 = load i8**, i8*** %8
store i8* %99, i8** %100
br label %132
101: ; preds = %73
%102 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 5
%103 = load i32, i32* %102
%104 = icmp eq i32 %103, 0
br i1 %104, label %105, label %131
105: ; preds = %101
%106 = load i32, i32* %10
%107 = icmp ugt i32 %106, 0
br i1 %107, label %108, label %110
108: ; preds = %105
%109 = call i32 (i8*, ...) @bgen_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
br label %134
110: ; preds = %105
%111 = load i64*, i64** %9
%112 = load i64, i64* %111
%113 = trunc i64 %112 to i32
store i32 %113, i32* %10
%114 = load i32, i32* %10
%115 = zext i32 %114 to i64
%116 = load i64*, i64** %9
%117 = load i64, i64* %116
%118 = add i64 %117, %115
store i64 %118, i64* %116
%119 = load i8**, i8*** %8
%120 = load i8*, i8** %119
%121 = load i64*, i64** %9
%122 = load i64, i64* %121
%123 = call i64 @realloc(i8* %120, i64 %122)
%124 = inttoptr i64 %123 to i8*
%125 = load i8**, i8*** %8
store i8* %124, i8** %125
%126 = load i8**, i8*** %8
%127 = load i8*, i8** %126
%128 = load i32, i32* %10
%129 = zext i32 %128 to i64
%130 = getelementptr inbounds i8, i8* %127, i64 %129
store i8* %130, i8** %11
br label %131
131: ; preds = %110, %101
br label %52
132: ; preds = %88
%133 = call i32 @inflateEnd(%struct.TYPE_5__* %12)
store i32 0, i32* %5
br label %136
134: ; preds = %108, %72, %62, %42
%135 = call i32 @inflateEnd(%struct.TYPE_5__* %12)
store i32 1, i32* %5
br label %136
136: ; preds = %134, %132, %19
%137 = load i32, i32* %5
ret i32 %137
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i8*, i8*, i8*, i32, i8*, i32, i8* }
@UINT_MAX = global i64 0
@.str = [24 x i8] c"zlib *dst_size overflow\00"
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str.1 = [31 x i8] c"zlib failed to uncompress (%s)\00"
@Z_NO_FLUSH = global i32 0
@Z_NEED_DICT = global i32 0
@Z_DATA_ERROR = global i32 0
@Z_MEM_ERROR = global i32 0
@Z_STREAM_END = global i32 0
define i32 @bgen_unzlib_chunked(i8* %0, i64 %1, i8** nocapture %2, i64* nocapture %3) {
%5 = alloca %struct.TYPE_5__
%6 = load i64, i64* %3
%7 = load i64, i64* @UINT_MAX
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (i8*, ...) @bgen_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %85
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = bitcast %struct.TYPE_5__* %5 to i8*
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 0
%15 = load i8*, i8** @Z_NULL
store i8* %15, i8** %14
%16 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 1
store i8* %15, i8** %16
%17 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 2
store i8* %15, i8** %17
%18 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 3
store i32 0, i32* %18
%19 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 4
store i8* %15, i8** %19
%20 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 5
store i32 0, i32* %20
%21 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 6
store i8* null, i8** %21
%22 = call i32 @inflateInit(%struct.TYPE_5__* %5)
%23 = load i32, i32* @Z_OK
%24 = icmp eq i32 %22, %23
br i1 %24, label %28, label %25
25: ; preds = %11
%26 = call i32 @zError(i32 %22)
%27 = call i32 (i8*, ...) @bgen_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %82
28: ; preds = %11
%29 = trunc i64 %6 to i32
%30 = trunc i64 %1 to i32
store i32 %30, i32* %18
store i8* %0, i8** %19
store i32 %29, i32* %20
store i8* %12, i8** %21
%31 = load i32, i32* @Z_NO_FLUSH
%32 = call i32 @inflate(%struct.TYPE_5__* %5, i32 %31)
%33 = load i32, i32* @Z_NEED_DICT
%34 = icmp eq i32 %32, %33
%35 = load i32, i32* @Z_DATA_ERROR
%36 = icmp eq i32 %32, %35
%37 = select i1 %34, i1 true, i1 %36
%38 = load i32, i32* @Z_MEM_ERROR
%39 = icmp eq i32 %32, %38
%40 = select i1 %37, i1 true, i1 %39
br i1 %40, label %82, label %41
41: ; preds = %28, %62
%42 = phi i32 [ %66, %62 ], [ %32, %28 ]
%43 = phi i8* [ %64, %62 ], [ %12, %28 ]
%44 = phi i32 [ %63, %62 ], [ %29, %28 ]
%45 = load i32, i32* %20
%46 = load i32, i32* @Z_STREAM_END
%47 = icmp eq i32 %42, %46
br i1 %47, label %75, label %48
48: ; preds = %41
%49 = sub i32 %44, %45
%50 = zext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %43, i64 %50
%52 = icmp eq i32 %45, 0
br i1 %52, label %53, label %62
53: ; preds = %48
%54 = load i64, i64* %3
%55 = trunc i64 %54 to i32
%56 = and i64 %54, 4294967295
%57 = add i64 %56, %54
store i64 %57, i64* %3
%58 = load i8*, i8** %2
%59 = call i64 @realloc(i8* %58, i64 %57)
%60 = inttoptr i64 %59 to i8*
store i8* %60, i8** %2
%61 = getelementptr inbounds i8, i8* %60, i64 %56
br label %62
62: ; preds = %48, %53
%63 = phi i32 [ %55, %53 ], [ %45, %48 ]
%64 = phi i8* [ %61, %53 ], [ %51, %48 ]
store i32 %63, i32* %20
store i8* %64, i8** %21
%65 = load i32, i32* @Z_NO_FLUSH
%66 = call i32 @inflate(%struct.TYPE_5__* %5, i32 %65)
%67 = load i32, i32* @Z_NEED_DICT
%68 = icmp eq i32 %66, %67
%69 = load i32, i32* @Z_DATA_ERROR
%70 = icmp eq i32 %66, %69
%71 = select i1 %68, i1 true, i1 %70
%72 = load i32, i32* @Z_MEM_ERROR
%73 = icmp eq i32 %66, %72
%74 = select i1 %71, i1 true, i1 %73
br i1 %74, label %82, label %41
75: ; preds = %41
%76 = zext i32 %45 to i64
%77 = load i64, i64* %3
%78 = sub i64 %77, %76
store i64 %78, i64* %3
%79 = load i8*, i8** %2
%80 = call i64 @realloc(i8* %79, i64 %78)
%81 = inttoptr i64 %80 to i8*
store i8* %81, i8** %2
br label %82
82: ; preds = %62, %25, %28, %75
%83 = phi i32 [ 0, %75 ], [ 1, %28 ], [ 1, %25 ], [ 1, %62 ]
%84 = call i32 @inflateEnd(%struct.TYPE_5__* %5)
br label %85
85: ; preds = %82, %9
%86 = phi i32 [ 1, %9 ], [ %83, %82 ]
ret i32 %86
}