#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_6__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  unsigned int avail_in;
  unsigned char *next_out;
  int avail_out;
  unsigned int total_in;
  unsigned int total_out;
  int /*<<< orphan*/ *next_in;
  int /*<<< orphan*/ *opaque;
  int /*<<< orphan*/ *zfree;
  int /*<<< orphan*/ *zalloc;
};
typedef TYPE_1__ z_stream;
typedef int /*<<< orphan*/ c_stream;
typedef int /*<<< orphan*/ Bytef;

/* Variables and functions */
int /*<<< orphan*/ Z_FINISH;
int /*<<< orphan*/ Z_NO_FLUSH;
scalar_t__ Z_OK;
int Z_STREAM_END;
int inflate(TYPE_1__ *, int /*<<< orphan*/);
int inflateEnd(TYPE_1__ *);
scalar_t__ inflateInit2(TYPE_1__ *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(TYPE_1__ *, int /*<<< orphan*/, int);
scalar_t__ realloc(unsigned char *, unsigned int);
int Decompress(const unsigned char *source, unsigned int sourcelen,
               unsigned char **target, unsigned int *targetlen) {
  z_stream c_stream;
  memset(&c_stream, 0, sizeof(c_stream));
  int ret = 0;
  int err;
  int alloclen = ((sourcelen * 2) > (10240) ? (sourcelen * 2) : (10240));
  c_stream.zalloc = NULL;
  c_stream.zfree = NULL;
  c_stream.opaque = NULL;
  *target = (unsigned char *)malloc(alloclen + 1);
  *targetlen = 0;
  if (inflateInit2(&c_stream, 15 + 16) == Z_OK) {
    c_stream.next_in = (Bytef *)source;
    c_stream.avail_in = sourcelen;
    c_stream.next_out = *target;
    c_stream.avail_out = alloclen;
    while (c_stream.total_in != sourcelen && c_stream.total_out < *targetlen) {
      err = inflate(&c_stream, Z_NO_FLUSH);
      if (c_stream.avail_out == 0) {
        int now = alloclen;
        alloclen += alloclen / 10 + 10240;
        *target = (unsigned char *)realloc(*target, alloclen + 1);
        c_stream.next_out = *target + now;
        c_stream.avail_out = alloclen - now;
      }
    }
    for (;;) {
      err = inflate(&c_stream, Z_FINISH);
      if (err == Z_STREAM_END)
        break;
      if (c_stream.avail_out == 0) {
        int now = alloclen;
        alloclen += alloclen / 10 + 10240;
        *target = (unsigned char *)realloc(*target, alloclen + 1);
        c_stream.next_out = *target + now;
        c_stream.avail_out = alloclen - now;
      }
    }
    err = inflateEnd(&c_stream);
  }
  *targetlen = c_stream.total_out;
  *target = (unsigned char *)realloc(*target, *targetlen);
  return 0;
}


x86 assembly (clang, -O0):
<Decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
movl   $0x0,-0x64(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cmp    $0x2800,%eax
jbe    11b0 <Decompress+0x50>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11bd <Decompress+0x5d>
mov    $0x2800,%eax
mov    %eax,-0x78(%rbp)
jmp    11bd <Decompress+0x5d>
mov    -0x78(%rbp),%eax
mov    %eax,-0x6c(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x6c(%rbp),%edi
add    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
lea    -0x60(%rbp),%rdi
mov    $0x1f,%esi
call   1040 <inflateInit2@plt>
mov    0x2de1(%rip),%rcx
cmp    (%rcx),%rax
jne    137d <Decompress+0x21d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x79(%rbp)
je     1257 <Decompress+0xf7>
mov    -0x48(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setb   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    1267 <Decompress+0x107>
jmp    12de <Decompress+0x17e>
mov    0x2d62(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdi
call   1030 <inflate@plt>
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x50(%rbp)
jne    12d9 <Decompress+0x179>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x6c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x2800,%eax
add    -0x6c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x6c(%rbp),%esi
add    $0x1,%esi
call   1080 <realloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x70(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x6c(%rbp),%eax
sub    -0x70(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    1237 <Decompress+0xd7>
jmp    12e3 <Decompress+0x183>
mov    0x2cde(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdi
call   1030 <inflate@plt>
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
mov    0x2cde(%rip),%rcx
cmp    (%rcx),%eax
jne    130f <Decompress+0x1af>
jmp    1371 <Decompress+0x211>
cmpl   $0x0,-0x50(%rbp)
jne    136c <Decompress+0x20c>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x6c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x2800,%eax
add    -0x6c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x6c(%rbp),%esi
add    $0x1,%esi
call   1080 <realloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x74(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x6c(%rbp),%eax
sub    -0x74(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    12e3 <Decompress+0x183>
lea    -0x60(%rbp),%rdi
call   1060 <inflateEnd@plt>
mov    %eax,-0x68(%rbp)
mov    -0x48(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1080 <realloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decompress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,%r14
mov    %rdx,%r13
mov    %esi,%ebp
mov    %rdi,%r12
lea    0x18(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
lea    0x0(%rbp,%rbp,1),%eax
cmp    $0x2801,%eax
mov    $0x2800,%ebx
cmovae %eax,%ebx
lea    0x1(%rbx),%edi
xorps  %xmm0,%xmm0
movups %xmm0,0x40(%rsp)
movq   $0x0,0x50(%rsp)
call   1070 <malloc@plt>
mov    %rax,0x0(%r13)
movl   $0x0,(%r14)
mov    %r15,%rdi
mov    $0x1f,%esi
call   1040 <inflateInit2@plt>
mov    0x2e1a(%rip),%rcx
cmp    (%rcx),%rax
jne    123c <Decompress+0xdc>
mov    %r12,0x38(%rsp)
mov    %ebp,0x18(%rsp)
mov    %r13,0x8(%rsp)
mov    0x0(%r13),%rax
mov    %rax,0x20(%rsp)
mov    %ebx,0x28(%rsp)
cmp    %ebp,0x2c(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,(%rsp)
jne    1261 <Decompress+0x101>
mov    0x2dbc(%rip),%rbx
mov    (%rbx),%esi
lea    0x18(%rsp),%rdi
call   1030 <inflate@plt>
mov    0x2dc1(%rip),%r15
cmp    (%r15),%eax
mov    0x8(%rsp),%r13
jne    12fe <Decompress+0x19e>
lea    0x18(%rsp),%rdi
call   1060 <inflateEnd@plt>
mov    0x10(%rsp),%r14
mov    0x30(%rsp),%esi
mov    %esi,(%r14)
mov    0x0(%r13),%rdi
call   1080 <realloc@plt>
mov    %rax,0x0(%r13)
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d68(%rip),%rbx
lea    0x18(%rsp),%r12
jmp    1276 <Decompress+0x116>
nop
cmp    %ebp,0x2c(%rsp)
je     1205 <Decompress+0xa5>
mov    0x30(%rsp),%eax
cmp    (%r14),%eax
jae    1205 <Decompress+0xa5>
mov    (%rbx),%esi
mov    %r12,%rdi
call   1030 <inflate@plt>
cmpl   $0x0,0x28(%rsp)
jne    1270 <Decompress+0x110>
movslq (%rsp),%r13
imul   $0x66666667,%r13,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
lea    (%rax,%rcx,1),%edx
mov    %r12,%rbx
lea    (%rax,%rcx,1),%r12d
add    $0x2800,%r12d
lea    0x2800(%r13,%rdx,1),%eax
mov    %rax,(%rsp)
mov    0x8(%rsp),%r14
mov    (%r14),%rdi
lea    (%rdx,%r13,1),%esi
add    $0x2801,%esi
call   1080 <realloc@plt>
mov    %rax,(%r14)
add    %r13,%rax
mov    0x10(%rsp),%r14
mov    %rax,0x20(%rsp)
mov    %r12d,0x28(%rsp)
mov    %rbx,%r12
mov    0x2cd7(%rip),%rbx
jmp    1270 <Decompress+0x110>
lea    0x18(%rsp),%rbp
jmp    1323 <Decompress+0x1c3>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx),%esi
mov    %rbp,%rdi
call   1030 <inflate@plt>
cmp    (%r15),%eax
je     122d <Decompress+0xcd>
cmpl   $0x0,0x28(%rsp)
jne    1310 <Decompress+0x1b0>
movslq (%rsp),%r14
imul   $0x66666667,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
lea    (%rax,%rcx,1),%edx
lea    (%rax,%rcx,1),%r12d
add    $0x2800,%r12d
lea    0x2800(%r14,%rdx,1),%eax
mov    %rax,(%rsp)
mov    0x0(%r13),%rdi
lea    (%r14,%rdx,1),%esi
add    $0x2801,%esi
call   1080 <realloc@plt>
mov    %rax,0x0(%r13)
add    %r14,%rax
mov    %rax,0x20(%rsp)
mov    %r12d,0x28(%rsp)
jmp    1310 <Decompress+0x1b0>

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

LLVM IR (-O2):
%struct.TYPE_6__ = type { i32, i8*, i32, i32, i32, i32*, i32*, i32*, i32* }
@Z_OK = global i64 0
@Z_NO_FLUSH = global i32 0
@Z_FINISH = global i32 0
@Z_STREAM_END = global i32 0
define i32 @Decompress(i8* %0, i32 %1, i8** nocapture %2, i32* nocapture %3) {
%5 = alloca %struct.TYPE_6__
%6 = bitcast %struct.TYPE_6__* %5 to i8*
%7 = call i32 @memset(%struct.TYPE_6__* %5, i32 0, i32 64)
%8 = shl i32 %1, 1
%9 = icmp ugt i32 %8, 10240
%10 = select i1 %9, i32 %8, i32 10240
%11 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 6
%12 = or i32 %10, 1
%13 = bitcast i32** %11 to i8*
%14 = call i64 @malloc(i32 %12)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %2
store i32 0, i32* %3
%16 = call i64 @inflateInit2(%struct.TYPE_6__* %5, i32 31)
%17 = load i64, i64* @Z_OK
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %82
19: ; preds = %4
%20 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 5
%21 = bitcast i32** %20 to i8**
store i8* %0, i8** %21
%22 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 0
store i32 %1, i32* %22
%23 = load i8*, i8** %2
%24 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 1
store i8* %23, i8** %24
%25 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 2
store i32 %10, i32* %25
%26 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 4
%27 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 3
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, %1
br i1 %29, label %54, label %30
30: ; preds = %19, %50
%31 = phi i32 [ %51, %50 ], [ %10, %19 ]
%32 = load i32, i32* %26
%33 = load i32, i32* %3
%34 = icmp ult i32 %32, %33
br i1 %34, label %35, label %54
35: ; preds = %30
%36 = load i32, i32* @Z_NO_FLUSH
%37 = call i32 @inflate(%struct.TYPE_6__* %5, i32 %36)
%38 = load i32, i32* %25
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %50
40: ; preds = %35
%41 = sdiv i32 %31, 10
%42 = add nsw i32 %41, 10240
%43 = add nsw i32 %42, %31
%44 = load i8*, i8** %2
%45 = add nsw i32 %43, 1
%46 = call i64 @realloc(i8* %44, i32 %45)
%47 = inttoptr i64 %46 to i8*
store i8* %47, i8** %2
%48 = sext i32 %31 to i64
%49 = getelementptr inbounds i8, i8* %47, i64 %48
store i8* %49, i8** %24
store i32 %42, i32* %25
br label %50
50: ; preds = %40, %35
%51 = phi i32 [ %43, %40 ], [ %31, %35 ]
%52 = load i32, i32* %27
%53 = icmp eq i32 %52, %1
br i1 %53, label %54, label %30
54: ; preds = %30, %50, %19
%55 = phi i32 [ %10, %19 ], [ %51, %50 ], [ %31, %30 ]
%56 = load i32, i32* @Z_FINISH
%57 = call i32 @inflate(%struct.TYPE_6__* %5, i32 %56)
%58 = load i32, i32* @Z_STREAM_END
%59 = icmp eq i32 %57, %58
br i1 %59, label %80, label %60
60: ; preds = %54, %74
%61 = phi i32 [ %75, %74 ], [ %55, %54 ]
%62 = load i32, i32* %25
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %74
64: ; preds = %60
%65 = sdiv i32 %61, 10
%66 = add nsw i32 %65, 10240
%67 = add nsw i32 %66, %61
%68 = load i8*, i8** %2
%69 = add nsw i32 %67, 1
%70 = call i64 @realloc(i8* %68, i32 %69)
%71 = inttoptr i64 %70 to i8*
store i8* %71, i8** %2
%72 = sext i32 %61 to i64
%73 = getelementptr inbounds i8, i8* %71, i64 %72
store i8* %73, i8** %24
store i32 %66, i32* %25
br label %74
74: ; preds = %64, %60
%75 = phi i32 [ %67, %64 ], [ %61, %60 ]
%76 = load i32, i32* @Z_FINISH
%77 = call i32 @inflate(%struct.TYPE_6__* %5, i32 %76)
%78 = load i32, i32* @Z_STREAM_END
%79 = icmp eq i32 %77, %78
br i1 %79, label %80, label %60
80: ; preds = %74, %54
%81 = call i32 @inflateEnd(%struct.TYPE_6__* %5)
br label %82
82: ; preds = %80, %4
%83 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %5, i64 0, i32 4
%84 = load i32, i32* %83
store i32 %84, i32* %3
%85 = load i8*, i8** %2
%86 = call i64 @realloc(i8* %85, i32 %84)
%87 = inttoptr i64 %86 to i8*
store i8* %87, i8** %2
ret i32 0
}