#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__ {
  char *next_in;
  int avail_in;
  char *next_out;
  int avail_out;
  void *opaque;
  void *zfree;
  void *zalloc;
  int /*<<< orphan*/ member_0;
};
typedef TYPE_1__ z_stream;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Z_NO_FLUSH;
void *Z_NULL;
int Z_OK;
int Z_STREAM_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int inflate(TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ inflateEnd(TYPE_1__ *);
int inflateInit(TYPE_1__ *);
int main(void) {
  char src_buf[1024] = {0};
  char dest_buf[1024] = {0};
  z_stream z = {0};
  z.zalloc = Z_NULL;
  z.zfree = Z_NULL;
  z.opaque = Z_NULL;
  z.next_in = Z_NULL;
  z.avail_in = 0;
  int ret_init = 0;
  int status = Z_OK;
  FILE *infp = NULL;
  FILE *outfp = NULL;
  int read_len = 0;
  int write_len = 0;
  int reason = 0;
  int rest = 0;
  ret_init = inflateInit(&z);
  if (ret_init == Z_OK) {
    z.next_out = dest_buf;
    z.avail_out = 1024;
    infp = fopen("jpeg_start_compress.c.z", "r");
    outfp = fopen("jpeg_start_compress.c.txt", "w");
    if (infp != NULL && outfp != NULL) {
      while (status != Z_STREAM_END) {
        if (z.avail_in == 0) {
          read_len = fread(src_buf, 1, 1024, infp);
          z.next_in = src_buf;
          z.avail_in = read_len;
        }
        status = inflate(&z, Z_NO_FLUSH);
        if (status == Z_STREAM_END) {
          reason = 1;
          break;
        }
        if (status != Z_OK) {
          reason = 2;
          break;
        }
        if (z.avail_out == 0) {
          write_len = fwrite(dest_buf, 1, 1024, outfp);
          if (write_len < 1024) {
            reason = 3;
            break;
          }
          z.next_out = dest_buf;
          z.avail_out = 1024;
        }
      }
      rest = 1024 - z.avail_out;
      if (rest > 0) {
        fwrite(dest_buf, 1, rest, outfp);
      }
    }
    if (infp != NULL) {
      fclose(infp);
    }
    if (outfp != NULL) {
      fclose(outfp);
    }
    inflateEnd(&z);
  }
  if (reason == 1) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x880,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    -0x850(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1060 <memset@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x820(%rbp)
mov    0x2de5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x828(%rbp)
mov    0x2dd4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x830(%rbp)
mov    0x2dc3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x850(%rbp)
movl   $0x0,-0x848(%rbp)
movl   $0x0,-0x854(%rbp)
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x858(%rbp)
movq   $0x0,-0x860(%rbp)
movq   $0x0,-0x868(%rbp)
movl   $0x0,-0x86c(%rbp)
movl   $0x0,-0x870(%rbp)
movl   $0x0,-0x874(%rbp)
movl   $0x0,-0x878(%rbp)
lea    -0x850(%rbp),%rdi
call   1070 <inflateInit@plt>
mov    %eax,-0x854(%rbp)
mov    -0x854(%rbp),%eax
mov    0x2d61(%rip),%rcx
cmp    (%rcx),%eax
jne    14b3 <main+0x333>
lea    -0x810(%rbp),%rax
mov    %rax,-0x840(%rbp)
movl   $0x400,-0x838(%rbp)
lea    0xd4a(%rip),%rdi
lea    0xd5b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x860(%rbp)
lea    0xd4a(%rip),%rdi
lea    0xd5d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x868(%rbp)
cmpq   $0x0,-0x860(%rbp)
je     1473 <main+0x2f3>
cmpq   $0x0,-0x868(%rbp)
je     1473 <main+0x2f3>
jmp    1304 <main+0x184>
mov    -0x858(%rbp),%eax
mov    0x2ccf(%rip),%rcx
cmp    (%rcx),%eax
je     1432 <main+0x2b2>
cmpl   $0x0,-0x848(%rbp)
jne    1363 <main+0x1e3>
lea    -0x410(%rbp),%rdi
mov    -0x860(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <fread@plt>
mov    %eax,-0x86c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x850(%rbp)
mov    -0x86c(%rbp),%eax
mov    %eax,-0x848(%rbp)
mov    0x2c66(%rip),%rax
mov    (%rax),%esi
lea    -0x850(%rbp),%rdi
call   1030 <inflate@plt>
mov    %eax,-0x858(%rbp)
mov    -0x858(%rbp),%eax
mov    0x2c55(%rip),%rcx
cmp    (%rcx),%eax
jne    13a2 <main+0x222>
movl   $0x1,-0x874(%rbp)
jmp    1432 <main+0x2b2>
mov    -0x858(%rbp),%eax
mov    0x2c41(%rip),%rcx
cmp    (%rcx),%eax
je     13c6 <main+0x246>
movl   $0x2,-0x874(%rbp)
jmp    1432 <main+0x2b2>
cmpl   $0x0,-0x838(%rbp)
jne    142d <main+0x2ad>
lea    -0x810(%rbp),%rdi
mov    -0x868(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   10a0 <fwrite@plt>
mov    %eax,-0x870(%rbp)
cmpl   $0x400,-0x870(%rbp)
jge    1415 <main+0x295>
movl   $0x3,-0x874(%rbp)
jmp    1432 <main+0x2b2>
lea    -0x810(%rbp),%rax
mov    %rax,-0x840(%rbp)
movl   $0x400,-0x838(%rbp)
jmp    1304 <main+0x184>
mov    $0x400,%eax
sub    -0x838(%rbp),%eax
mov    %eax,-0x878(%rbp)
cmpl   $0x0,-0x878(%rbp)
jle    146e <main+0x2ee>
lea    -0x810(%rbp),%rdi
mov    -0x878(%rbp),%edx
mov    -0x868(%rbp),%rcx
mov    $0x1,%esi
call   10a0 <fwrite@plt>
jmp    1473 <main+0x2f3>
cmpq   $0x0,-0x860(%rbp)
je     148d <main+0x30d>
mov    -0x860(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x868(%rbp)
je     14a7 <main+0x327>
mov    -0x868(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x850(%rbp),%rdi
call   1080 <inflateEnd@plt>
cmpl   $0x1,-0x874(%rbp)
jne    14cc <main+0x34c>
movl   $0x0,-0x4(%rbp)
jmp    14d3 <main+0x353>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x880,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x848,%rsp
lea    0x440(%rsp),%rdi
xor    %r15d,%r15d
mov    $0x400,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x40(%rsp),%r12
mov    $0x400,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0x28(%rsp)
movups %xmm0,0x18(%rsp)
movups %xmm0,0x8(%rsp)
movq   $0x0,0x38(%rsp)
mov    0x2dea(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x30(%rsp)
mov    %rax,0x28(%rsp)
mov    %rax,0x20(%rsp)
mov    %rax,(%rsp)
mov    0x2df5(%rip),%r13
mov    0x0(%r13),%ebp
mov    %rsp,%rdi
call   1070 <inflateInit@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    0x0(%r13),%ecx
jne    12bb <main+0x13b>
mov    %r12,0x10(%rsp)
movl   $0x400,0x18(%rsp)
lea    0xdd4(%rip),%rdi
lea    0xde5(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
lea    0xdd8(%rip),%rdi
lea    0xdeb(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     128e <main+0x10e>
test   %r14,%r14
je     128e <main+0x10e>
mov    0x2d7e(%rip),%r15
cmp    (%r15),%ebp
jne    12d4 <main+0x154>
xor    %r15d,%r15d
mov    0x18(%rsp),%eax
cmp    $0x3ff,%eax
jg     128e <main+0x10e>
mov    $0x400,%edx
sub    %eax,%edx
lea    0x40(%rsp),%rdi
mov    $0x1,%esi
mov    %r14,%rcx
call   10a0 <fwrite@plt>
test   %rbx,%rbx
je     129b <main+0x11b>
mov    %rbx,%rdi
call   1050 <fclose@plt>
test   %r14,%r14
je     12a8 <main+0x128>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rsp,%rdi
call   1080 <inflateEnd@plt>
xor    %eax,%eax
cmp    $0x1,%r15d
setne  %al
neg    %eax
add    $0x848,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
nopl   (%rax)
cmp    %eax,%ebp
je     1267 <main+0xe7>
cmpl   $0x0,0x8(%rsp)
jne    1300 <main+0x180>
lea    0x440(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rbp,(%rsp)
mov    %eax,0x8(%rsp)
mov    0x2cc9(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
call   1030 <inflate@plt>
mov    %eax,%ebp
mov    (%r15),%eax
cmp    %eax,%ebp
je     1358 <main+0x1d8>
cmp    0x0(%r13),%ebp
jne    1363 <main+0x1e3>
cmpl   $0x0,0x18(%rsp)
jne    12d0 <main+0x150>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r14,%rcx
call   10a0 <fwrite@plt>
cmp    $0x400,%eax
jl     136e <main+0x1ee>
mov    %r12,0x10(%rsp)
movl   $0x400,0x18(%rsp)
mov    (%r15),%eax
jmp    12d0 <main+0x150>
mov    $0x1,%r15d
jmp    126a <main+0xea>
mov    $0x2,%r15d
jmp    126a <main+0xea>
mov    $0x3,%r15d
jmp    126a <main+0xea>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i8*, i32, i8*, i32, i8*, i8*, i8*, i32 }
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str = [24 x i8] c"jpeg_start_compress.c.z\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [26 x i8] c"jpeg_start_compress.c.txt\00"
@.str.3 = [2 x i8] c"w\00"
@Z_STREAM_END = global i32 0
@Z_NO_FLUSH = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = alloca %struct.TYPE_5__
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = bitcast [1024 x i8]* %2 to i8*
%14 = bitcast [1024 x i8]* %3 to i8*
%15 = bitcast %struct.TYPE_5__* %4 to i8*
%16 = load i8*, i8** @Z_NULL
%17 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 6
store i8* %16, i8** %17
%18 = load i8*, i8** @Z_NULL
%19 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 5
store i8* %18, i8** %19
%20 = load i8*, i8** @Z_NULL
%21 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 4
store i8* %20, i8** %21
%22 = load i8*, i8** @Z_NULL
%23 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 0
store i8* %22, i8** %23
%24 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 1
store i32 0, i32* %24
store i32 0, i32* %5
%25 = load i32, i32* @Z_OK
store i32 %25, i32* %6
store i32* null, i32** %7
store i32* null, i32** %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
%26 = call i32 @inflateInit(%struct.TYPE_5__* %4)
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = load i32, i32* @Z_OK
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %112
30: ; preds = %0
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%32 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 2
store i8* %31, i8** %32
%33 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 3
store i32 1024, i32* %33
%34 = call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %34, i32** %7
%35 = call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %35, i32** %8
%36 = load i32*, i32** %7
%37 = icmp ne i32* %36, null
br i1 %37, label %38, label %98
38: ; preds = %30
%39 = load i32*, i32** %8
%40 = icmp ne i32* %39, null
br i1 %40, label %41, label %98
41: ; preds = %38
br label %42
42: ; preds = %85, %41
%43 = load i32, i32* %6
%44 = load i32, i32* @Z_STREAM_END
%45 = icmp ne i32 %43, %44
br i1 %45, label %46, label %86
46: ; preds = %42
%47 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 1
%48 = load i32, i32* %47
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %58
50: ; preds = %46
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%52 = load i32*, i32** %7
%53 = call i32 @fread(i8* %51, i32 1, i32 1024, i32* %52)
store i32 %53, i32* %9
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%55 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 0
store i8* %54, i8** %55
%56 = load i32, i32* %9
%57 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 1
store i32 %56, i32* %57
br label %58
58: ; preds = %50, %46
%59 = load i32, i32* @Z_NO_FLUSH
%60 = call i32 @inflate(%struct.TYPE_5__* %4, i32 %59)
store i32 %60, i32* %6
%61 = load i32, i32* %6
%62 = load i32, i32* @Z_STREAM_END
%63 = icmp eq i32 %61, %62
br i1 %63, label %64, label %65
64: ; preds = %58
store i32 1, i32* %11
br label %86
65: ; preds = %58
%66 = load i32, i32* %6
%67 = load i32, i32* @Z_OK
%68 = icmp ne i32 %66, %67
br i1 %68, label %69, label %70
69: ; preds = %65
store i32 2, i32* %11
br label %86
70: ; preds = %65
%71 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 3
%72 = load i32, i32* %71
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %85
74: ; preds = %70
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%76 = load i32*, i32** %8
%77 = call i32 @fwrite(i8* %75, i32 1, i32 1024, i32* %76)
store i32 %77, i32* %10
%78 = load i32, i32* %10
%79 = icmp slt i32 %78, 1024
br i1 %79, label %80, label %81
80: ; preds = %74
store i32 3, i32* %11
br label %86
81: ; preds = %74
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%83 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 2
store i8* %82, i8** %83
%84 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 3
store i32 1024, i32* %84
br label %85
85: ; preds = %81, %70
br label %42
86: ; preds = %80, %69, %64, %42
%87 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i32 0, i32 3
%88 = load i32, i32* %87
%89 = sub nsw i32 1024, %88
store i32 %89, i32* %12
%90 = load i32, i32* %12
%91 = icmp sgt i32 %90, 0
br i1 %91, label %92, label %97
92: ; preds = %86
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%94 = load i32, i32* %12
%95 = load i32*, i32** %8
%96 = call i32 @fwrite(i8* %93, i32 1, i32 %94, i32* %95)
br label %97
97: ; preds = %92, %86
br label %98
98: ; preds = %97, %38, %30
%99 = load i32*, i32** %7
%100 = icmp ne i32* %99, null
br i1 %100, label %101, label %104
101: ; preds = %98
%102 = load i32*, i32** %7
%103 = call i32 @fclose(i32* %102)
br label %104
104: ; preds = %101, %98
%105 = load i32*, i32** %8
%106 = icmp ne i32* %105, null
br i1 %106, label %107, label %110
107: ; preds = %104
%108 = load i32*, i32** %8
%109 = call i32 @fclose(i32* %108)
br label %110
110: ; preds = %107, %104
%111 = call i32 @inflateEnd(%struct.TYPE_5__* %4)
br label %112
112: ; preds = %110, %0
%113 = load i32, i32* %11
%114 = icmp eq i32 %113, 1
br i1 %114, label %115, label %116
115: ; preds = %112
store i32 0, i32* %1
br label %117
116: ; preds = %112
store i32 -1, i32* %1
br label %117
117: ; preds = %116, %115
%118 = load i32, i32* %1
ret i32 %118
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i8*, i32, i8*, i32, i8*, i8*, i8*, i32 }
@Z_NULL = global i8* null
@Z_OK = global i32 0
@.str = [24 x i8] c"jpeg_start_compress.c.z\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [26 x i8] c"jpeg_start_compress.c.txt\00"
@.str.3 = [2 x i8] c"w\00"
@Z_STREAM_END = global i32 0
@Z_NO_FLUSH = global i32 0
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = alloca %struct.TYPE_5__
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = bitcast %struct.TYPE_5__* %3 to i8*
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 1
%8 = bitcast i32* %7 to i8*
%9 = load i8*, i8** @Z_NULL
%10 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 6
store i8* %9, i8** %10
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 5
store i8* %9, i8** %11
%12 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 4
store i8* %9, i8** %12
%13 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 0
store i8* %9, i8** %13
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 1
%15 = load i32, i32* @Z_OK
%16 = call i32 @inflateInit(%struct.TYPE_5__* %3)
%17 = load i32, i32* @Z_OK
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %72
19: ; preds = %0
%20 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 2
store i8* %5, i8** %20
%21 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 3
store i32 1024, i32* %21
%22 = call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i32* %22, null
%25 = icmp ne i32* %23, null
%26 = and i1 %24, %25
br i1 %26, label %27, label %61
27: ; preds = %19
%28 = load i32, i32* @Z_STREAM_END
%29 = icmp eq i32 %15, %28
br i1 %29, label %54, label %30
30: ; preds = %27, %51
%31 = load i32, i32* %14
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @fread(i8* %4, i32 1, i32 1024, i32* %22)
store i8* %4, i8** %13
store i32 %34, i32* %14
br label %35
35: ; preds = %33, %30
%36 = load i32, i32* @Z_NO_FLUSH
%37 = call i32 @inflate(%struct.TYPE_5__* %3, i32 %36)
%38 = load i32, i32* @Z_STREAM_END
%39 = icmp eq i32 %37, %38
br i1 %39, label %54, label %40
40: ; preds = %35
%41 = load i32, i32* @Z_OK
%42 = icmp eq i32 %37, %41
br i1 %42, label %43, label %54
43: ; preds = %40
%44 = load i32, i32* %21
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = call i32 @fwrite(i8* %5, i32 1, i32 1024, i32* %23)
%48 = icmp slt i32 %47, 1024
br i1 %48, label %54, label %49
49: ; preds = %46
store i8* %5, i8** %20
store i32 1024, i32* %21
%50 = load i32, i32* @Z_STREAM_END
br label %51
51: ; preds = %49, %43
%52 = phi i32 [ %50, %49 ], [ %38, %43 ]
%53 = icmp eq i32 %37, %52
br i1 %53, label %54, label %30
54: ; preds = %51, %35, %40, %46, %27
%55 = phi i32 [ 0, %27 ], [ 3, %46 ], [ 2, %40 ], [ 1, %35 ], [ 0, %51 ]
%56 = load i32, i32* %21
%57 = icmp slt i32 %56, 1024
br i1 %57, label %58, label %61
58: ; preds = %54
%59 = sub nsw i32 1024, %56
%60 = call i32 @fwrite(i8* %5, i32 1, i32 %59, i32* %23)
br label %61
61: ; preds = %54, %58, %19
%62 = phi i32 [ %55, %58 ], [ %55, %54 ], [ 0, %19 ]
br i1 %24, label %63, label %65
63: ; preds = %61
%64 = call i32 @fclose(i32* %22)
br label %65
65: ; preds = %63, %61
br i1 %25, label %66, label %68
66: ; preds = %65
%67 = call i32 @fclose(i32* %23)
br label %68
68: ; preds = %65, %66
%69 = call i32 @inflateEnd(%struct.TYPE_5__* %3)
%70 = icmp ne i32 %62, 1
%71 = sext i1 %70 to i32
br label %72
72: ; preds = %68, %0
%73 = phi i32 [ -1, %0 ], [ %71, %68 ]
ret i32 %73
}