// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/../foreign/miniz-c.h
// 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 $0x2140, %rsp           # imm = 0x2140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq $0x0, -0x20e8(%rbp)
movq $0x0, -0x20f8(%rbp)
movq $0x0, -0x2100(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x20e0(%rbp)
jmp 0x197802
movq -0x18(%rbp), %rax
subq -0x20f8(%rbp), %rax
movq %rax, -0x2108(%rbp)
movq -0x2100(%rbp), %rax
movq -0x20(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x2110(%rbp)
movq -0x10(%rbp), %rax
addq -0x20f8(%rbp), %rax
movq %rax, -0x2130(%rbp)
movq -0x20e8(%rbp), %rax
movq %rax, -0x2128(%rbp)
cmpq $0x0, -0x20e8(%rbp)
je 0x19786a
movq -0x20e8(%rbp), %rax
movq -0x20(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x2138(%rbp)
jmp 0x197875
xorl %eax, %eax
movq %rax, -0x2138(%rbp)
jmp 0x197875
movq -0x2128(%rbp), %rcx
movq -0x2130(%rbp), %rsi
movq -0x2138(%rbp), %r8
movl -0x24(%rbp), %eax
andl $-0x3, %eax
orl $0x4, %eax
leaq -0x20e0(%rbp), %rdi
leaq -0x2108(%rbp), %rdx
leaq -0x2110(%rbp), %r9
movl %eax, (%rsp)
callq 0x191aa0
movl %eax, -0x211c(%rbp)
cmpl $0x0, -0x211c(%rbp)
jl 0x1978c8
cmpl $0x1, -0x211c(%rbp)
jne 0x1978ec
movq -0x20e8(%rbp), %rdi
callq 0x19030
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x1979ba
movq -0x2108(%rbp), %rax
addq -0x20f8(%rbp), %rax
movq %rax, -0x20f8(%rbp)
movq -0x2110(%rbp), %rcx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
cmpl $0x0, -0x211c(%rbp)
jne 0x197920
jmp 0x1979af
movq -0x2100(%rbp), %rax
shlq %rax
movq %rax, -0x2118(%rbp)
cmpq $0x80, -0x2118(%rbp)
jae 0x197949
movq $0x80, -0x2118(%rbp)
movq -0x20e8(%rbp), %rdi
movq -0x2118(%rbp), %rsi
callq 0x19240
movq %rax, -0x20f0(%rbp)
cmpq $0x0, -0x20f0(%rbp)
jne 0x19798e
movq -0x20e8(%rbp), %rdi
callq 0x19030
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x1979ba
movq -0x20f0(%rbp), %rax
movq %rax, -0x20e8(%rbp)
movq -0x2118(%rbp), %rax
movq %rax, -0x2100(%rbp)
jmp 0x197802
movq -0x20e8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x2140, %rsp           # imm = 0x2140
popq %rbp
retq
nopw (%rax,%rax)