#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 int avail_in;
  long avail_out;
  unsigned char *next_out;
  int /*<<< orphan*/ *next_in;
  void *opaque;
  void *zfree;
  void *zalloc;
};
typedef TYPE_1__ z_stream;
typedef int /*<<< orphan*/ Bytef;

/* Variables and functions */
scalar_t__ MAX_WBITS;
#define Z_DATA_ERROR 130
#define Z_MEM_ERROR 129
#define Z_NEED_DICT 128
void *Z_NULL;
int Z_OK;
int Z_STREAM_END;
int Z_STREAM_ERROR;
int /*<<< orphan*/ Z_SYNC_FLUSH;
int /*<<< orphan*/ assert(int);
int inflate(TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ inflateEnd(TYPE_1__ *);
int inflateInit2(TYPE_1__ *, scalar_t__);
unsigned char *malloc(int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
unsigned char *realloc(unsigned char *, unsigned int);
int inf(unsigned char *source, unsigned int srcSize, unsigned char **dest,
        unsigned long *destSize) {
  int ret;
  unsigned int have;
  z_stream strm;
  unsigned char out[65536L];
  unsigned int sz = 0;
  unsigned char *t;
  unsigned int left = srcSize;
  t = malloc(1);
  strm.zalloc = Z_NULL;
  strm.zfree = Z_NULL;
  strm.opaque = Z_NULL;
  strm.avail_in = 0;
  strm.next_in = Z_NULL;
  ret = inflateInit2(&strm, 16 + MAX_WBITS);
  if (ret != Z_OK)
    return ret;
  do {
    strm.next_in = (Bytef *)(&source[srcSize - left]);
    strm.avail_in = left > 65536L ? ((left -= 65536L), 65536L) : srcSize;
    if (strm.avail_in == 0)
      break;
    do {
      strm.avail_out = 65536L;
      strm.next_out = out;
      ret = inflate(&strm, Z_SYNC_FLUSH);
      assert(ret != Z_STREAM_ERROR);
      switch (ret) {
      case Z_NEED_DICT:
        ret = Z_DATA_ERROR;
      case Z_DATA_ERROR:
      case Z_MEM_ERROR:
        (void)inflateEnd(&strm);
        return ret;
      }
      have = 65536L - strm.avail_out;
      t = realloc(t, sz += have);
      memcpy(&t[sz - have], out, have);
    } while (strm.avail_out == 0);
  } while (ret != Z_STREAM_END);
  (void)inflateEnd(&strm);
  *dest = t;
  *destSize = sz;
  return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR;
}


x86 assembly (clang, -O0):
<inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100a0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x10074(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10084(%rbp)
mov    $0x1,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10080(%rbp)
mov    0x2e03(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x2df5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    0x2de7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x68(%rbp)
mov    0x2dd2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    0x2ddc(%rip),%rax
mov    (%rax),%rsi
add    $0x10,%rsi
lea    -0x68(%rbp),%rdi
call   1040 <inflateInit2@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2ddf(%rip),%rcx
cmp    (%rcx),%eax
je     1224 <inf+0xb4>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1403 <inf+0x293>
jmp    1229 <inf+0xb9>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    -0x10084(%rbp),%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x10084(%rbp),%eax
cmp    $0x10000,%rax
jle    1274 <inf+0x104>
mov    -0x10084(%rbp),%eax
sub    $0x10000,%rax
mov    %eax,-0x10084(%rbp)
mov    $0x10000,%eax
mov    %rax,-0x10090(%rbp)
jmp    127e <inf+0x10e>
mov    -0x14(%rbp),%eax
mov    %rax,-0x10090(%rbp)
mov    -0x10090(%rbp),%rax
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x68(%rbp)
jne    1297 <inf+0x127>
jmp    139e <inf+0x22e>
jmp    129c <inf+0x12c>
movq   $0x10000,-0x60(%rbp)
lea    -0x10070(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2d22(%rip),%rax
mov    (%rax),%esi
lea    -0x68(%rbp),%rdi
call   1030 <inflate@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2cf2(%rip),%rcx
mov    (%rcx),%ecx
sub    %ecx,%eax
setne  %al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x10094(%rbp)
sub    $0x80,%eax
je     130f <inf+0x19f>
jmp    12f6 <inf+0x186>
mov    -0x10094(%rbp),%eax
add    $0xffffff7f,%eax
sub    $0x2,%eax
jb     1316 <inf+0x1a6>
jmp    132a <inf+0x1ba>
movl   $0x82,-0x2c(%rbp)
lea    -0x68(%rbp),%rdi
call   1070 <inflateEnd@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1403 <inf+0x293>
mov    $0x10000,%eax
sub    -0x60(%rbp),%rax
mov    %eax,-0x30(%rbp)
mov    -0x10080(%rbp),%rdi
mov    -0x30(%rbp),%esi
add    -0x10074(%rbp),%esi
mov    %esi,-0x10074(%rbp)
call   1090 <realloc@plt>
mov    %rax,-0x10080(%rbp)
mov    -0x10080(%rbp),%rdi
mov    -0x10074(%rbp),%eax
sub    -0x30(%rbp),%eax
mov    %eax,%eax
add    %rax,%rdi
lea    -0x10070(%rbp),%rsi
mov    -0x30(%rbp),%edx
call   1060 <memcpy@plt>
cmpq   $0x0,-0x60(%rbp)
je     129c <inf+0x12c>
jmp    138c <inf+0x21c>
mov    -0x2c(%rbp),%eax
mov    0x2c4a(%rip),%rcx
cmp    (%rcx),%eax
jne    1229 <inf+0xb9>
lea    -0x68(%rbp),%rdi
call   1070 <inflateEnd@plt>
mov    -0x10080(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10074(%rbp),%eax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%eax
mov    0x2c12(%rip),%rcx
cmp    (%rcx),%eax
jne    13ea <inf+0x27a>
mov    0x2c13(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10098(%rbp)
jmp    13fa <inf+0x28a>
mov    $0x82,%eax
mov    %eax,-0x10098(%rbp)
jmp    13fa <inf+0x28a>
mov    -0x10098(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10068,%rsp
mov    %rcx,0x8(%rsp)
mov    %rdx,%r15
mov    %esi,%r13d
mov    %rdi,%r14
mov    $0x1,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    0x2e15(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x40(%rsp)
mov    %rax,0x38(%rsp)
mov    %rax,0x30(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rax,0x28(%rsp)
mov    0x2e07(%rip),%rax
mov    (%rax),%rsi
add    $0x10,%rsi
lea    0x10(%rsp),%rdi
call   1040 <inflateInit2@plt>
mov    %eax,%ebp
mov    0x2e0d(%rip),%r12
cmp    (%r12),%eax
jne    136a <inf+0x1fa>
mov    %r15,%rdx
mov    0x8(%rsp),%r15
cmp    $0x10001,%r13d
mov    $0x10000,%ecx
mov    %r13d,%eax
cmovae %ecx,%eax
mov    %r14,0x28(%rsp)
mov    %eax,0x10(%rsp)
mov    %r13,%rcx
xor    %r13d,%r13d
test   %eax,%eax
je     1343 <inf+0x1d3>
mov    %r14,0x50(%rsp)
mov    %rdx,0x48(%rsp)
lea    -0x10000(%rcx),%eax
cmp    $0x10001,%ecx
mov    %rcx,0x58(%rsp)
cmovb  %ecx,%eax
mov    %rax,(%rsp)
lea    0x60(%rsp),%r14
mov    %r13d,%r15d
nopl   0x0(%rax,%rax,1)
movq   $0x10000,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    0x2d73(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdi
call   1030 <inflate@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    0x2d44(%rip),%rax
cmp    (%rax),%ebp
setne  %dil
call   1050 <assert@plt>
lea    -0x80(%rbp),%eax
cmp    $0x2,%eax
jbe    132b <inf+0x1bb>
mov    $0x10000,%r12d
sub    0x18(%rsp),%r12d
lea    (%r12,%r15,1),%r13d
mov    %rbx,%rdi
mov    %r13d,%esi
call   1090 <realloc@plt>
mov    %rax,%rbx
mov    %r15d,%edi
add    %rax,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
call   1060 <memcpy@plt>
cmpq   $0x0,0x18(%rsp)
mov    %r13d,%r15d
je     1250 <inf+0xe0>
mov    0x2d0d(%rip),%rax
cmp    (%rax),%ebp
je     1315 <inf+0x1a5>
mov    0x58(%rsp),%rcx
mov    %ecx,%eax
mov    (%rsp),%rdx
sub    %edx,%eax
add    0x50(%rsp),%rax
mov    %rax,0x28(%rsp)
lea    -0x10000(%rdx),%eax
cmp    $0x10001,%edx
cmovb  %edx,%eax
mov    $0x10000,%edx
cmovae %edx,%ecx
mov    %ecx,0x10(%rsp)
mov    %rax,(%rsp)
test   %ecx,%ecx
jne    1245 <inf+0xd5>
mov    %r13d,%r13d
mov    0x8(%rsp),%r15
mov    0x48(%rsp),%r14
mov    0x2cc7(%rip),%r12
jmp    1346 <inf+0x1d6>
cltq
lea    0xccc(%rip),%rcx
mov    (%rcx,%rax,4),%ebp
lea    0x10(%rsp),%rdi
call   1070 <inflateEnd@plt>
jmp    136a <inf+0x1fa>
mov    %rdx,%r14
lea    0x10(%rsp),%rdi
call   1070 <inflateEnd@plt>
mov    %rbx,(%r14)
mov    %r13,(%r15)
mov    0x2c83(%rip),%rax
cmp    (%rax),%ebp
mov    $0x82,%ebp
jne    136a <inf+0x1fa>
mov    (%r12),%ebp
mov    %ebp,%eax
add    $0x10068,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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