// File: /workspace/github_c_makefile_star2_O0/wkoszek[P]mini_gzip/miniz.c
// Function: tinfl_decompress_mem_to_heap
void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags)
{
  tinfl_decompressor decomp; void *pBuf = NULL, *pNew_buf; size_t src_buf_ofs = 0, out_buf_capacity = 0;
  *pOut_len = 0;
  tinfl_init(&decomp);
  for ( ; ; )
  {
    size_t src_buf_size = src_buf_len - src_buf_ofs, dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity;
    tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8*)pBuf, pBuf ? (mz_uint8*)pBuf + *pOut_len : NULL, &dst_buf_size,
      (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
    if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
    {
      MZ_FREE(pBuf); *pOut_len = 0; return NULL;
    }
    src_buf_ofs += src_buf_size;
    *pOut_len += dst_buf_size;
    if (status == TINFL_STATUS_DONE) break;
    new_out_buf_capacity = out_buf_capacity * 2; if (new_out_buf_capacity < 128) new_out_buf_capacity = 128;
    pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity);
    if (!pNew_buf)
    {
      MZ_FREE(pBuf); *pOut_len = 0; return NULL;
    }
    pBuf = pNew_buf; out_buf_capacity = new_out_buf_capacity;
  }
  return pBuf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b90, %rsp           # imm = 0x2B90
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq $0x0, -0x2b30(%rbp)
movq $0x0, -0x2b40(%rbp)
movq $0x0, -0x2b48(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x2b28(%rbp)
jmp 0x6212
movq -0x18(%rbp), %rax
subq -0x2b40(%rbp), %rax
movq %rax, -0x2b50(%rbp)
movq -0x2b48(%rbp), %rax
movq -0x20(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x2b58(%rbp)
movq -0x10(%rbp), %rax
addq -0x2b40(%rbp), %rax
movq %rax, -0x2b78(%rbp)
movq -0x2b30(%rbp), %rax
movq %rax, -0x2b70(%rbp)
cmpq $0x0, -0x2b30(%rbp)
je 0x627a
movq -0x2b30(%rbp), %rax
movq -0x20(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x2b80(%rbp)
jmp 0x6285
xorl %eax, %eax
movq %rax, -0x2b80(%rbp)
jmp 0x6285
movq -0x2b70(%rbp), %rcx
movq -0x2b78(%rbp), %rsi
movq -0x2b80(%rbp), %r8
movl -0x24(%rbp), %eax
andl $-0x3, %eax
orl $0x4, %eax
leaq -0x2b28(%rbp), %rdi
leaq -0x2b50(%rbp), %rdx
leaq -0x2b58(%rbp), %r9
movl %eax, (%rsp)
callq 0x3360
movl %eax, -0x2b64(%rbp)
cmpl $0x0, -0x2b64(%rbp)
jl 0x62d8
cmpl $0x1, -0x2b64(%rbp)
jne 0x62fc
movq -0x2b30(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x63ca
movq -0x2b50(%rbp), %rax
addq -0x2b40(%rbp), %rax
movq %rax, -0x2b40(%rbp)
movq -0x2b58(%rbp), %rcx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
cmpl $0x0, -0x2b64(%rbp)
jne 0x6330
jmp 0x63bf
movq -0x2b48(%rbp), %rax
shlq %rax
movq %rax, -0x2b60(%rbp)
cmpq $0x80, -0x2b60(%rbp)
jae 0x6359
movq $0x80, -0x2b60(%rbp)
movq -0x2b30(%rbp), %rdi
movq -0x2b60(%rbp), %rsi
callq 0x10f0
movq %rax, -0x2b38(%rbp)
cmpq $0x0, -0x2b38(%rbp)
jne 0x639e
movq -0x2b30(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x63ca
movq -0x2b38(%rbp), %rax
movq %rax, -0x2b30(%rbp)
movq -0x2b60(%rbp), %rax
movq %rax, -0x2b48(%rbp)
jmp 0x6212
movq -0x2b30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x2b90, %rsp           # imm = 0x2B90
popq %rbp
retq
nopw (%rax,%rax)