// File: /workspace/github_c_makefile_star2_O0/wkoszek[P]mini_gzip/mini_gzip.c
// Function: mini_gz_unpack
int
mini_gz_unpack(struct mini_gzip *gz_ptr, void *mem_out, size_t mem_out_len)
{
	z_stream s;
	int	ret, in_bytes_avail, bytes_to_read;

	assert(gz_ptr != 0);
	assert(gz_ptr->data_len > 0);
	assert(gz_ptr->magic == MINI_GZIP_MAGIC);

	memset (&s, 0, sizeof (z_stream));
	inflateInit2(&s, -MZ_DEFAULT_WINDOW_BITS);
	in_bytes_avail = gz_ptr->data_len;
	s.avail_out = mem_out_len;
	s.next_in = gz_ptr->data_ptr;
	s.next_out = mem_out;
	for (;;) {
		bytes_to_read = MINI_GZ_MIN(gz_ptr->chunk_size, in_bytes_avail);
		s.avail_in += bytes_to_read;
		ret = mz_inflate(&s, MZ_SYNC_FLUSH);
		in_bytes_avail -= bytes_to_read;
		if (s.avail_out == 0 && in_bytes_avail != 0) {
			return (-3);
		}
		assert(ret != MZ_BUF_ERROR);
		if (ret == MZ_PARAM_ERROR) {
			return (-1);
		}
		if (ret == MZ_DATA_ERROR) {
			return (-2);
		}
		if (ret == MZ_STREAM_END) {
			break;
		}
	}
	ret = inflateEnd(&s);
	if (ret != Z_OK) {
		return (-4);
	}
	return (s.total_out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1530
jmp 0x154f
leaq 0xab1e(%rip), %rdi      # 0xc055
leaq 0xaad5(%rip), %rsi      # 0xc013
movl $0x68, %edx
leaq 0xab6c(%rip), %rcx      # 0xc0b6
callq 0x1080
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0x155c
jmp 0x157b
leaq 0xab8a(%rip), %rdi      # 0xc0ed
leaq 0xaaa9(%rip), %rsi      # 0xc013
movl $0x69, %edx
leaq 0xab40(%rip), %rcx      # 0xc0b6
callq 0x1080
movq -0x10(%rbp), %rax
cmpl $0xbeebb00b, 0x18(%rax) # imm = 0xBEEBB00B
jne 0x158a
jmp 0x15a9
leaq 0xab04(%rip), %rdi      # 0xc095
leaq 0xaa7b(%rip), %rsi      # 0xc013
movl $0x6a, %edx
leaq 0xab12(%rip), %rcx      # 0xc0b6
callq 0x1080
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
movl $0x78, %edx
callq 0x1090
leaq -0x98(%rbp), %rdi
movl $0xfffffff1, %esi       # imm = 0xFFFFFFF1
callq 0x2be0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, -0xa0(%rbp)
movq -0x20(%rbp), %rax
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xa0(%rbp), %rcx
cmpq %rcx, %rax
jae 0x161e
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0x162c
movslq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
addl -0x90(%rbp), %eax
movl %eax, -0x90(%rbp)
leaq -0x98(%rbp), %rdi
movl $0x2, %esi
callq 0x2d70
movl %eax, -0x9c(%rbp)
movl -0xa4(%rbp), %ecx
movl -0xa0(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xa0(%rbp)
cmpl $0x0, -0x78(%rbp)
jne 0x1691
cmpl $0x0, -0xa0(%rbp)
je 0x1691
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x171d
cmpl $-0x5, -0x9c(%rbp)
je 0x169c
jmp 0x16bb
leaq 0xaa5f(%rip), %rdi      # 0xc102
leaq 0xa969(%rip), %rsi      # 0xc013
movl $0x7a, %edx
leaq 0xaa00(%rip), %rcx      # 0xc0b6
callq 0x1080
cmpl $0xffffd8f0, -0x9c(%rbp) # imm = 0xFFFFD8F0
jne 0x16d0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x171d
cmpl $-0x3, -0x9c(%rbp)
jne 0x16e2
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x171d
cmpl $0x1, -0x9c(%rbp)
jne 0x16ed
jmp 0x16f2
jmp 0x15f9
leaq -0x98(%rbp), %rdi
callq 0x5fc0
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x9c(%rbp)
je 0x1716
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x171d
movq -0x70(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)