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

/* Variables and functions */
int O_APPEND;
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_WRONLY;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ Z_DEFAULT_COMPRESSION;
int /*<<< orphan*/ Z_DEFAULT_STRATEGY;
int /*<<< orphan*/ Z_DEFLATED;
int /*<<< orphan*/ Z_FINISH;
void *Z_NULL;
int Z_OK;
int Z_STREAM_END;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int deflate(TYPE_1__ *, int /*<<< orphan*/);
int deflateBound(TYPE_1__ *, unsigned long);
int deflateInit2(TYPE_1__ *, int /*<<< orphan*/, int /*<<< orphan*/, int, int,
                 int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
void *malloc(int);
int open(char *, int, ...);
int /*<<< orphan*/ printf(char *, int);
unsigned long read(int, void *, int);
int /*<<< orphan*/ stderr;
unsigned long write(int, void *, unsigned long);
int main(int argc, char **argv) {
  int fd;
  int ret;
  void *normal_buffer;
  void *comp_buffer;
  unsigned long size;
  unsigned long comp_size;
  z_stream tmp_stream;
  if (argc != 2) {
    fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
    return (-1);
  }
  normal_buffer = malloc(1024 * 1024);
  comp_buffer = malloc(1024 * 1024 + 100);
  assert(normal_buffer && comp_buffer);
  fd = open(argv[1], O_RDONLY);
  assert(fd);
  size = read(fd, normal_buffer, 1024 * 1024);
  assert(size >= 0);
  comp_size = size + 100;
  close(fd);
  tmp_stream.next_in = normal_buffer;
  tmp_stream.avail_in = size;
  tmp_stream.zalloc = Z_NULL;
  tmp_stream.zfree = Z_NULL;
  tmp_stream.opaque = Z_NULL;
  ret = deflateInit2(&tmp_stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 31, 8,
                     Z_DEFAULT_STRATEGY);
  assert(ret == Z_OK);
  tmp_stream.avail_in = size;
  tmp_stream.next_in = normal_buffer;
  tmp_stream.next_out = comp_buffer;
  tmp_stream.avail_out = deflateBound(&tmp_stream, size);
  printf("deflate bound: %u\n", tmp_stream.avail_out);
  ret = deflate(&tmp_stream, Z_FINISH);
  assert(ret == Z_STREAM_END);
  comp_size = tmp_stream.total_out;
  fd = open("out.gz", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
  assert(fd);
  size = write(fd, comp_buffer, comp_size);
  assert(size == comp_size);
  close(fd);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11fb <main+0x4b>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe16(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    140e <main+0x25e>
mov    $0x100000,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x100064,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x79(%rbp)
je     1232 <main+0x82>
cmpq   $0x0,-0x28(%rbp)
setne  %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d8a(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   10c0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1080 <assert@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x100000,%edx
call   1070 <read@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x30(%rbp),%rax
add    $0x64,%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    0x2cec(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    0x2cde(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    0x2cd0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    0x2cca(%rip),%rax
mov    (%rax),%esi
mov    0x2cc9(%rip),%rax
mov    (%rax),%edx
mov    0x2c90(%rip),%rax
mov    (%rax),%r9d
lea    -0x78(%rbp),%rdi
mov    $0x1f,%ecx
mov    $0x8,%r8d
call   10d0 <deflateInit2@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2cd4(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%rsi
lea    -0x78(%rbp),%rdi
call   10a0 <deflateBound@plt>
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%esi
lea    0xcc1(%rip),%rdi
call   1040 <printf@plt>
mov    0x2c2f(%rip),%rax
mov    (%rax),%esi
lea    -0x78(%rbp),%rdi
call   1050 <deflate@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2c57(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x68(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x2be1(%rip),%rax
mov    (%rax),%esi
mov    0x2c58(%rip),%rax
or     (%rax),%esi
mov    0x2bc7(%rip),%rax
or     (%rax),%esi
mov    0x2be6(%rip),%rax
mov    (%rax),%edx
mov    0x2c0d(%rip),%rax
or     (%rax),%edx
lea    0xc65(%rip),%rdi
mov    $0x0,%al
call   10c0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1080 <assert@plt>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1366 <main+0x1b6>
mov    $0x100000,%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
mov    $0x100064,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
test   %r13,%r13
setne  %al
test   %r15,%r15
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1080 <assert@plt>
mov    0x8(%rbx),%rdi
mov    0x2dd3(%rip),%rax
mov    (%rax),%esi
xor    %r14d,%r14d
xor    %eax,%eax
call   10c0 <open@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1080 <assert@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x100000,%edx
call   1070 <read@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1080 <assert@plt>
mov    %ebp,%edi
call   1060 <close@plt>
mov    %r13,0x28(%rsp)
mov    %rbx,0x8(%rsp)
mov    0x2d52(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x40(%rsp)
mov    %rax,0x38(%rsp)
mov    %rax,0x30(%rsp)
mov    0x2d41(%rip),%rax
mov    (%rax),%esi
mov    0x2d40(%rip),%rax
mov    (%rax),%edx
mov    0x2d07(%rip),%rax
mov    (%rax),%r9d
lea    0x8(%rsp),%r12
mov    %r12,%rdi
mov    $0x1f,%ecx
mov    $0x8,%r8d
call   10d0 <deflateInit2@plt>
mov    0x2d4d(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%eax
sete   %dil
call   1080 <assert@plt>
mov    %rbx,0x8(%rsp)
mov    %r13,0x28(%rsp)
mov    %r15,0x20(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <deflateBound@plt>
mov    %eax,0x10(%rsp)
lea    0xd49(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2cb5(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
call   1050 <deflate@plt>
mov    0x2ce4(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%eax
sete   %dil
call   1080 <assert@plt>
mov    0x18(%rsp),%rbx
mov    0x2c73(%rip),%rax
mov    0x2cec(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2c59(%rip),%rax
or     (%rax),%esi
mov    0x2c78(%rip),%rax
mov    0x2ca1(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0xcf7(%rip),%rdi
xor    %eax,%eax
call   10c0 <open@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1080 <assert@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <write@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1080 <assert@plt>
mov    %ebp,%edi
call   1060 <close@plt>
jmp    1384 <main+0x1d4>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xc87(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64, i32, i64, i8*, i8*, i8*, i8*, i8* }
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
@O_RDONLY = global i32 0
@Z_NULL = global i8* null
@Z_DEFAULT_COMPRESSION = global i32 0
@Z_DEFLATED = global i32 0
@Z_DEFAULT_STRATEGY = global i32 0
@Z_OK = global i32 0
@.str.1 = [19 x i8] c"deflate bound: %u\0A\00"
@Z_FINISH = global i32 0
@Z_STREAM_END = global i32 0
@.str.2 = [7 x i8] c"out.gz\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca %struct.TYPE_5__
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 -1, i32* %3
br label %113
21: ; preds = %2
%22 = call i8* @malloc(i32 1048576)
store i8* %22, i8** %8
%23 = call i8* @malloc(i32 1048676)
store i8* %23, i8** %9
%24 = load i8*, i8** %8
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = load i8*, i8** %9
%28 = icmp ne i8* %27, null
br label %29
29: ; preds = %26, %21
%30 = phi i1 [ false, %21 ], [ %28, %26 ]
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = load i32, i32* @O_RDONLY
%37 = call i32 (i8*, i32, ...) @open(i8* %35, i32 %36)
store i32 %37, i32* %6
%38 = load i32, i32* %6
%39 = call i32 @assert(i32 %38)
%40 = load i32, i32* %6
%41 = load i8*, i8** %8
%42 = call i64 @read(i32 %40, i8* %41, i32 1048576)
store i64 %42, i64* %10
%43 = load i64, i64* %10
%44 = icmp uge i64 %43, 0
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = load i64, i64* %10
%48 = add i64 %47, 100
store i64 %48, i64* %11
%49 = load i32, i32* %6
%50 = call i32 @close(i32 %49)
%51 = load i8*, i8** %8
%52 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 4
store i8* %51, i8** %52
%53 = load i64, i64* %10
%54 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 0
store i64 %53, i64* %54
%55 = load i8*, i8** @Z_NULL
%56 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 7
store i8* %55, i8** %56
%57 = load i8*, i8** @Z_NULL
%58 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 6
store i8* %57, i8** %58
%59 = load i8*, i8** @Z_NULL
%60 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 5
store i8* %59, i8** %60
%61 = load i32, i32* @Z_DEFAULT_COMPRESSION
%62 = load i32, i32* @Z_DEFLATED
%63 = load i32, i32* @Z_DEFAULT_STRATEGY
%64 = call i32 @deflateInit2(%struct.TYPE_5__* %12, i32 %61, i32 %62, i32 31, i32 8, i32 %63)
store i32 %64, i32* %7
%65 = load i32, i32* %7
%66 = load i32, i32* @Z_OK
%67 = icmp eq i32 %65, %66
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = load i64, i64* %10
%71 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 0
store i64 %70, i64* %71
%72 = load i8*, i8** %8
%73 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 4
store i8* %72, i8** %73
%74 = load i8*, i8** %9
%75 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 3
store i8* %74, i8** %75
%76 = load i64, i64* %10
%77 = call i32 @deflateBound(%struct.TYPE_5__* %12, i64 %76)
%78 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 1
store i32 %77, i32* %78
%79 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 1
%80 = load i32, i32* %79
%81 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %80)
%82 = load i32, i32* @Z_FINISH
%83 = call i32 @deflate(%struct.TYPE_5__* %12, i32 %82)
store i32 %83, i32* %7
%84 = load i32, i32* %7
%85 = load i32, i32* @Z_STREAM_END
%86 = icmp eq i32 %84, %85
%87 = zext i1 %86 to i32
%88 = call i32 @assert(i32 %87)
%89 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 2
%90 = load i64, i64* %89
store i64 %90, i64* %11
%91 = load i32, i32* @O_WRONLY
%92 = load i32, i32* @O_CREAT
%93 = or i32 %91, %92
%94 = load i32, i32* @O_APPEND
%95 = or i32 %93, %94
%96 = load i32, i32* @S_IRUSR
%97 = load i32, i32* @S_IWUSR
%98 = or i32 %96, %97
%99 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %95, i32 %98)
store i32 %99, i32* %6
%100 = load i32, i32* %6
%101 = call i32 @assert(i32 %100)
%102 = load i32, i32* %6
%103 = load i8*, i8** %9
%104 = load i64, i64* %11
%105 = call i64 @write(i32 %102, i8* %103, i64 %104)
store i64 %105, i64* %10
%106 = load i64, i64* %10
%107 = load i64, i64* %11
%108 = icmp eq i64 %106, %107
%109 = zext i1 %108 to i32
%110 = call i32 @assert(i32 %109)
%111 = load i32, i32* %6
%112 = call i32 @close(i32 %111)
store i32 0, i32* %3
br label %113
113: ; preds = %29, %15
%114 = load i32, i32* %3
ret i32 %114
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64, i32, i64, i8*, i8*, i8*, i8*, i8* }
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s <filename>\0A\00"
@O_RDONLY = global i32 0
@Z_NULL = global i8* null
@Z_DEFAULT_COMPRESSION = global i32 0
@Z_DEFLATED = global i32 0
@Z_DEFAULT_STRATEGY = global i32 0
@Z_OK = global i32 0
@.str.1 = [19 x i8] c"deflate bound: %u\0A\00"
@Z_FINISH = global i32 0
@Z_STREAM_END = global i32 0
@.str.2 = [7 x i8] c"out.gz\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_5__
%4 = bitcast %struct.TYPE_5__* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %67
10: ; preds = %2
%11 = tail call dereferenceable_or_null(1048576) i8* @malloc(i32 1048576)
%12 = tail call dereferenceable_or_null(1048676) i8* @malloc(i32 1048676)
%13 = icmp ne i8* %11, null
%14 = icmp ne i8* %12, null
%15 = and i1 %13, %14
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = load i32, i32* @O_RDONLY
%21 = tail call i32 (i8*, i32, ...) @open(i8* %19, i32 %20)
%22 = tail call i32 @assert(i32 %21)
%23 = tail call i64 @read(i32 %21, i8* %11, i32 1048576)
%24 = tail call i32 @assert(i32 1)
%25 = tail call i32 @close(i32 %21)
%26 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 4
store i8* %11, i8** %26
%27 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 0
store i64 %23, i64* %27
%28 = load i8*, i8** @Z_NULL
%29 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 7
store i8* %28, i8** %29
%30 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 6
store i8* %28, i8** %30
%31 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 5
store i8* %28, i8** %31
%32 = load i32, i32* @Z_DEFAULT_COMPRESSION
%33 = load i32, i32* @Z_DEFLATED
%34 = load i32, i32* @Z_DEFAULT_STRATEGY
%35 = call i32 @deflateInit2(%struct.TYPE_5__* %3, i32 %32, i32 %33, i32 31, i32 8, i32 %34)
%36 = load i32, i32* @Z_OK
%37 = icmp eq i32 %35, %36
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
store i64 %23, i64* %27
store i8* %11, i8** %26
%40 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 3
store i8* %12, i8** %40
%41 = call i32 @deflateBound(%struct.TYPE_5__* %3, i64 %23)
%42 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 1
store i32 %41, i32* %42
%43 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%44 = load i32, i32* @Z_FINISH
%45 = call i32 @deflate(%struct.TYPE_5__* %3, i32 %44)
%46 = load i32, i32* @Z_STREAM_END
%47 = icmp eq i32 %45, %46
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 2
%51 = load i64, i64* %50
%52 = load i32, i32* @O_WRONLY
%53 = load i32, i32* @O_CREAT
%54 = or i32 %53, %52
%55 = load i32, i32* @O_APPEND
%56 = or i32 %54, %55
%57 = load i32, i32* @S_IRUSR
%58 = load i32, i32* @S_IWUSR
%59 = or i32 %58, %57
%60 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %56, i32 %59)
%61 = call i32 @assert(i32 %60)
%62 = call i64 @write(i32 %60, i8* %12, i64 %51)
%63 = icmp eq i64 %62, %51
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = call i32 @close(i32 %60)
br label %67
67: ; preds = %10, %6
%68 = phi i32 [ -1, %6 ], [ 0, %10 ]
ret i32 %68
}