// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/../foreign/miniz-c.h
// Function: mz_inflate
int mz_inflate(mz_streamp pStream, int flush)
{
    inflate_state *pState;
    mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32;
    size_t in_bytes, out_bytes, orig_avail_in;
    tinfl_status status;

    if ((!pStream) || (!pStream->state))
        return MZ_STREAM_ERROR;
    if (flush == MZ_PARTIAL_FLUSH)
        flush = MZ_SYNC_FLUSH;
    if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH))
        return MZ_STREAM_ERROR;

    pState = (inflate_state *)pStream->state;
    if (pState->m_window_bits > 0)
        decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER;
    orig_avail_in = pStream->avail_in;

    first_call = pState->m_first_call;
    pState->m_first_call = 0;
    if (pState->m_last_status < 0)
        return MZ_DATA_ERROR;

    if (pState->m_has_flushed && (flush != MZ_FINISH))
        return MZ_STREAM_ERROR;
    pState->m_has_flushed |= (flush == MZ_FINISH);

    if ((flush == MZ_FINISH) && (first_call))
    {
        /* MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. */
        decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
        in_bytes = pStream->avail_in;
        out_bytes = pStream->avail_out;
        status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags);
        pState->m_last_status = status;
        pStream->next_in += (mz_uint)in_bytes;
        pStream->avail_in -= (mz_uint)in_bytes;
        pStream->total_in += (mz_uint)in_bytes;
        pStream->adler = tinfl_get_adler32(&pState->m_decomp);
        pStream->next_out += (mz_uint)out_bytes;
        pStream->avail_out -= (mz_uint)out_bytes;
        pStream->total_out += (mz_uint)out_bytes;

        if (status < 0)
            return MZ_DATA_ERROR;
        else if (status != TINFL_STATUS_DONE)
        {
            pState->m_last_status = TINFL_STATUS_FAILED;
            return MZ_BUF_ERROR;
        }
        return MZ_STREAM_END;
    }
    /* flush != MZ_FINISH then we must assume there's more input. */
    if (flush != MZ_FINISH)
        decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT;

    if (pState->m_dict_avail)
    {
        n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
        memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
        pStream->next_out += n;
        pStream->avail_out -= n;
        pStream->total_out += n;
        pState->m_dict_avail -= n;
        pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
        return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
    }

    for (;;)
    {
        in_bytes = pStream->avail_in;
        out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs;

        status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags);
        pState->m_last_status = status;

        pStream->next_in += (mz_uint)in_bytes;
        pStream->avail_in -= (mz_uint)in_bytes;
        pStream->total_in += (mz_uint)in_bytes;
        pStream->adler = tinfl_get_adler32(&pState->m_decomp);

        pState->m_dict_avail = (mz_uint)out_bytes;

        n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
        memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
        pStream->next_out += n;
        pStream->avail_out -= n;
        pStream->total_out += n;
        pState->m_dict_avail -= n;
        pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);

        if (status < 0)
            return MZ_DATA_ERROR; /* Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). */
        else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in))
            return MZ_BUF_ERROR; /* Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. */
        else if (flush == MZ_FINISH)
        {
            /* The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. */
            if (status == TINFL_STATUS_DONE)
                return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
            /* status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. */
            else if (!pStream->avail_out)
                return MZ_BUF_ERROR;
        }
        else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail))
            break;
    }

    return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x8, -0x2c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x191508
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x191514
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x191a97
cmpl $0x1, -0x14(%rbp)
jne 0x191521
movl $0x2, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x19153f
cmpl $0x2, -0x14(%rbp)
je 0x19153f
cmpl $0x4, -0x14(%rbp)
je 0x19153f
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x191a97
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20c8(%rax)
jle 0x191561
movl -0x2c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movl 0x20c0(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, 0x20c0(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0xa0cc(%rax)
jge 0x1915a0
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x191a97
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20c4(%rax)
je 0x1915bf
cmpl $0x4, -0x14(%rbp)
je 0x1915bf
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x191a97
cmpl $0x4, -0x14(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x20(%rbp), %rax
orl 0x20c4(%rax), %ecx
movl %ecx, 0x20c4(%rax)
cmpl $0x4, -0x14(%rbp)
jne 0x191715
cmpl $0x0, -0x28(%rbp)
je 0x191715
movl -0x2c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %r8
movl -0x2c(%rbp), %eax
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %r9
movl %eax, (%rsp)
callq 0x191aa0
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xa0cc(%rax)
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
movl %eax, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x20(%rax)
movq -0x40(%rbp), %rax
movl %eax, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
cmpl $0x0, -0x4c(%rbp)
jge 0x1916e7
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x191a97
cmpl $0x0, -0x4c(%rbp)
je 0x191707
movq -0x20(%rbp), %rax
movl $0xffffffff, 0xa0cc(%rax) # imm = 0xFFFFFFFF
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x191a97
jmp 0x191709
movl $0x1, -0x4(%rbp)
jmp 0x191a97
cmpl $0x4, -0x14(%rbp)
je 0x191724
movl -0x2c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20bc(%rax)
je 0x191834
movq -0x20(%rbp), %rax
movl 0x20bc(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x191757
movq -0x20(%rbp), %rax
movl 0x20bc(%rax), %eax
movl %eax, -0x50(%rbp)
jmp 0x191761
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x20cc, %rsi           # imm = 0x20CC
movq -0x20(%rbp), %rax
movl 0x20b8(%rax), %eax
addq %rax, %rsi
movl -0x24(%rbp), %eax
movl %eax, %edx
callq 0x191e0
movl -0x24(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x18(%rax)
movl -0x24(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x20(%rax)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
movl -0x24(%rbp), %edx
movq -0x20(%rbp), %rax
movl 0x20bc(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x20bc(%rax)
movq -0x20(%rbp), %rax
movl 0x20b8(%rax), %ecx
addl -0x24(%rbp), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movq -0x20(%rbp), %rax
movl %ecx, 0x20b8(%rax)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0xa0cc(%rcx)
movb %al, -0x51(%rbp)
jne 0x19181c
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20bc(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x191a97
jmp 0x191836
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rcx
movl $0x8000, %eax           # imm = 0x8000
subl 0x20b8(%rcx), %eax
movl %eax, %eax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rcx
addq $0x20cc, %rcx           # imm = 0x20CC
movq -0x20(%rbp), %r8
addq $0x20cc, %r8            # imm = 0x20CC
movq -0x20(%rbp), %rax
movl 0x20b8(%rax), %eax
addq %rax, %r8
movl -0x2c(%rbp), %eax
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %r9
movl %eax, (%rsp)
callq 0x191aa0
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xa0cc(%rax)
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
movl %eax, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x40(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20bc(%rax)
movq -0x20(%rbp), %rax
movl 0x20bc(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x191925
movq -0x20(%rbp), %rax
movl 0x20bc(%rax), %eax
movl %eax, -0x58(%rbp)
jmp 0x19192f
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x20cc, %rsi           # imm = 0x20CC
movq -0x20(%rbp), %rax
movl 0x20b8(%rax), %eax
addq %rax, %rsi
movl -0x24(%rbp), %eax
movl %eax, %edx
callq 0x191e0
movl -0x24(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x18(%rax)
movl -0x24(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x20(%rax)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
movl -0x24(%rbp), %edx
movq -0x20(%rbp), %rax
movl 0x20bc(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x20bc(%rax)
movq -0x20(%rbp), %rax
movl 0x20b8(%rax), %ecx
addl -0x24(%rbp), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movq -0x20(%rbp), %rax
movl %ecx, 0x20b8(%rax)
cmpl $0x0, -0x4c(%rbp)
jge 0x1919d7
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x191a97
cmpl $0x1, -0x4c(%rbp)
jne 0x1919f0
cmpq $0x0, -0x48(%rbp)
jne 0x1919f0
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x191a97
cmpl $0x4, -0x14(%rbp)
jne 0x191a32
cmpl $0x0, -0x4c(%rbp)
jne 0x191a1b
movq -0x20(%rbp), %rax
movl 0x20bc(%rax), %edx
movl $0x1, %eax
movl $0xfffffffb, %ecx       # imm = 0xFFFFFFFB
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x191a97
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x191a2e
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x191a97
jmp 0x191a30
jmp 0x191a5d
cmpl $0x0, -0x4c(%rbp)
je 0x191a59
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x191a59
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x191a59
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20bc(%rax)
je 0x191a5b
jmp 0x191a66
jmp 0x191a5d
jmp 0x191a5f
jmp 0x191a61
jmp 0x191836
xorl %eax, %eax
cmpl $0x0, -0x4c(%rbp)
movb %al, -0x59(%rbp)
jne 0x191a84
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20bc(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq