#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__ {
  int avail_in;
  char *next_out;
  int avail_out;
  char *next_in;
  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_DEFAULT_COMPRESSION;
int Z_FINISH;
int Z_NO_FLUSH;
void *Z_NULL;
int Z_OK;
int Z_STREAM_END;
int deflate(TYPE_1__ *, int);
int /*<<< orphan*/ deflateEnd(TYPE_1__ *);
int deflateInit(TYPE_1__ *, int /*<<< orphan*/);
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 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;
  int ret_init = 0;
  int flush = Z_NO_FLUSH;
  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 = deflateInit(&z, Z_DEFAULT_COMPRESSION);
  if (ret_init == Z_OK) {
    z.avail_in = 0;
    z.next_out = dest_buf;
    z.avail_out = 1024;
    infp = fopen("jpeg_start_compress.c.txt", "r");
    outfp = fopen("jpeg_start_compress.c.z", "w");
    if (infp != NULL && outfp != NULL) {
      while (1) {
        if (z.avail_in == 0) {
          read_len = fread(src_buf, 1, 1024, infp);
          z.next_in = src_buf;
          z.avail_in = read_len;
          if (z.avail_in < 1024) {
            flush = Z_FINISH;
          }
        }
        status = deflate(&z, 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);
    }
    deflateEnd(&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    0x2dee(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x820(%rbp)
mov    0x2ddd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x828(%rbp)
mov    0x2dcc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x830(%rbp)
movl   $0x0,-0x854(%rbp)
mov    0x2dc1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x858(%rbp)
mov    0x2dd2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x85c(%rbp)
movq   $0x0,-0x868(%rbp)
movq   $0x0,-0x870(%rbp)
movl   $0x0,-0x874(%rbp)
movl   $0x0,-0x878(%rbp)
movl   $0x0,-0x87c(%rbp)
movl   $0x0,-0x880(%rbp)
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
lea    -0x850(%rbp),%rdi
call   1070 <deflateInit@plt>
mov    %eax,-0x854(%rbp)
mov    -0x854(%rbp),%eax
mov    0x2d64(%rip),%rcx
cmp    (%rcx),%eax
jne    14c6 <main+0x346>
movl   $0x0,-0x850(%rbp)
lea    -0x810(%rbp),%rax
mov    %rax,-0x848(%rbp)
movl   $0x400,-0x840(%rbp)
lea    0xd43(%rip),%rdi
lea    0xd56(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x868(%rbp)
lea    0xd45(%rip),%rdi
lea    0xd56(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x870(%rbp)
cmpq   $0x0,-0x868(%rbp)
je     1486 <main+0x306>
cmpq   $0x0,-0x870(%rbp)
je     1486 <main+0x306>
jmp    130b <main+0x18b>
cmpl   $0x0,-0x850(%rbp)
jne    1379 <main+0x1f9>
lea    -0x410(%rbp),%rdi
mov    -0x868(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1030 <fread@plt>
mov    %eax,-0x874(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x838(%rbp)
mov    -0x874(%rbp),%eax
mov    %eax,-0x850(%rbp)
cmpl   $0x400,-0x850(%rbp)
jge    1374 <main+0x1f4>
mov    0x2c4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x858(%rbp)
jmp    1379 <main+0x1f9>
mov    -0x858(%rbp),%esi
lea    -0x850(%rbp),%rdi
call   1050 <deflate@plt>
mov    %eax,-0x85c(%rbp)
mov    -0x85c(%rbp),%eax
mov    0x2c42(%rip),%rcx
cmp    (%rcx),%eax
jne    13b5 <main+0x235>
movl   $0x1,-0x87c(%rbp)
jmp    1445 <main+0x2c5>
mov    -0x85c(%rbp),%eax
mov    0x2c2e(%rip),%rcx
cmp    (%rcx),%eax
je     13d9 <main+0x259>
movl   $0x2,-0x87c(%rbp)
jmp    1445 <main+0x2c5>
cmpl   $0x0,-0x840(%rbp)
jne    1440 <main+0x2c0>
lea    -0x810(%rbp),%rdi
mov    -0x870(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   10a0 <fwrite@plt>
mov    %eax,-0x878(%rbp)
cmpl   $0x400,-0x878(%rbp)
jge    1428 <main+0x2a8>
movl   $0x3,-0x87c(%rbp)
jmp    1445 <main+0x2c5>
lea    -0x810(%rbp),%rax
mov    %rax,-0x848(%rbp)
movl   $0x400,-0x840(%rbp)
jmp    130b <main+0x18b>
mov    $0x400,%eax
sub    -0x840(%rbp),%eax
mov    %eax,-0x880(%rbp)
cmpl   $0x0,-0x880(%rbp)
jle    1481 <main+0x301>
lea    -0x810(%rbp),%rdi
mov    -0x880(%rbp),%edx
mov    -0x870(%rbp),%rcx
mov    $0x1,%esi
call   10a0 <fwrite@plt>
jmp    1486 <main+0x306>
cmpq   $0x0,-0x868(%rbp)
je     14a0 <main+0x320>
mov    -0x868(%rbp),%rdi
call   1040 <fclose@plt>
cmpq   $0x0,-0x870(%rbp)
je     14ba <main+0x33a>
mov    -0x870(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x850(%rbp),%rdi
call   1080 <deflateEnd@plt>
cmpl   $0x1,-0x87c(%rbp)
jne    14df <main+0x35f>
movl   $0x0,-0x4(%rbp)
jmp    14e6 <main+0x366>
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    $0x858,%rsp
lea    0x450(%rsp),%rdi
xor    %r15d,%r15d
mov    $0x400,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x50(%rsp),%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
mov    0x2de6(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x40(%rsp)
mov    %rax,0x38(%rsp)
mov    %rax,0x30(%rsp)
mov    0x2ddd(%rip),%rax
mov    (%rax),%ebp
mov    0x2dcc(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdi
call   1070 <deflateInit@plt>
mov    %eax,%ecx
mov    0x2ddf(%rip),%r14
mov    $0xffffffff,%eax
cmp    (%r14),%ecx
jne    1391 <main+0x211>
movl   $0x0,0x10(%rsp)
mov    %rbx,0x18(%rsp)
movl   $0x400,0x20(%rsp)
lea    0xdc5(%rip),%rdi
lea    0xdd8(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r12
lea    0xdcb(%rip),%rdi
lea    0xddc(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
test   %r12,%r12
je     1362 <main+0x1e2>
test   %rbx,%rbx
je     1362 <main+0x1e2>
mov    %r12,0x8(%rsp)
mov    %rbx,(%rsp)
lea    0x10(%rsp),%r13
mov    0x2d59(%rip),%r12
lea    0x50(%rsp),%rbx
nopl   0x0(%rax)
cmpl   $0x0,0x10(%rsp)
jne    12d4 <main+0x154>
lea    0x450(%rsp),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    0x8(%rsp),%rcx
call   1030 <fread@plt>
mov    %r15,0x28(%rsp)
mov    %eax,0x10(%rsp)
cmp    $0x400,%eax
jge    12cf <main+0x14f>
mov    0x2ceb(%rip),%rax
mov    (%rax),%ebp
lea    0x50(%rsp),%rbx
mov    %r13,%rdi
mov    %ebp,%esi
call   1050 <deflate@plt>
cmp    (%r12),%eax
je     131f <main+0x19f>
cmp    (%r14),%eax
jne    1327 <main+0x1a7>
cmpl   $0x0,0x20(%rsp)
jne    1290 <main+0x110>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    (%rsp),%rcx
call   10a0 <fwrite@plt>
cmp    $0x400,%eax
jl     132f <main+0x1af>
mov    %rbx,0x18(%rsp)
movl   $0x400,0x20(%rsp)
jmp    1290 <main+0x110>
mov    $0x1,%r15d
jmp    1335 <main+0x1b5>
mov    $0x2,%r15d
jmp    1335 <main+0x1b5>
mov    $0x3,%r15d
mov    0x20(%rsp),%eax
cmp    $0x3ff,%eax
mov    (%rsp),%rbx
mov    0x8(%rsp),%r12
jg     1362 <main+0x1e2>
mov    $0x400,%edx
sub    %eax,%edx
lea    0x50(%rsp),%rdi
mov    $0x1,%esi
mov    %rbx,%rcx
call   10a0 <fwrite@plt>
test   %r12,%r12
je     136f <main+0x1ef>
mov    %r12,%rdi
call   1040 <fclose@plt>
test   %rbx,%rbx
je     137c <main+0x1fc>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x10(%rsp),%rdi
call   1080 <deflateEnd@plt>
xor    %eax,%eax
cmp    $0x1,%r15d
setne  %al
neg    %eax
add    $0x858,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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