// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/../foreign/miniz-c.h
// Function: mz_deflateInit2
int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy)
{
    tdefl_compressor *pComp;
    mz_uint comp_flags = TDEFL_COMPUTE_ADLER32 | tdefl_create_comp_flags_from_zip_params(level, window_bits, strategy);

    if (!pStream)
        return MZ_STREAM_ERROR;
    if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
        return MZ_PARAM_ERROR;

    pStream->data_type = 0;
    pStream->adler = MZ_ADLER32_INIT;
    pStream->msg = NULL;
    pStream->reserved = 0;
    pStream->total_in = 0;
    pStream->total_out = 0;
    if (!pStream->zalloc)
        pStream->zalloc = miniz_def_alloc_func;
    if (!pStream->zfree)
        pStream->zfree = miniz_def_free_func;

    pComp = (tdefl_compressor *)pStream->zalloc(pStream->opaque, 1, sizeof(tdefl_compressor));
    if (!pComp)
        return MZ_MEM_ERROR;

    pStream->state = (struct mz_internal_state *)pComp;

    if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY)
    {
        mz_deflateEnd(pStream);
        return MZ_PARAM_ERROR;
    }

    return MZ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl -0x14(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0x24(%rbp), %edx
callq 0x190670
orl $0x2000, %eax           # imm = 0x2000
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x190546
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x19065c
cmpl $0x8, -0x18(%rbp)
jne 0x190568
cmpl $0x1, -0x20(%rbp)
jl 0x190568
cmpl $0x9, -0x20(%rbp)
jg 0x190568
cmpl $0xf, -0x1c(%rbp)
je 0x190574
xorl %eax, %eax
subl -0x1c(%rbp), %eax
cmpl $0xf, %eax
je 0x190574
movl $0xffffd8f0, -0x4(%rbp) # imm = 0xFFFFD8F0
jmp 0x19065c
movq -0x10(%rbp), %rax
movl $0x0, 0x58(%rax)
movq -0x10(%rbp), %rax
movq $0x1, 0x60(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x1905d5
movq -0x10(%rbp), %rax
leaq -0x1a1(%rip), %rcx      # 0x190430
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x1905ef
movq -0x10(%rbp), %rax
leaq -0x18b(%rip), %rcx      # 0x190460
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rdi
movl $0x1, %esi
movl $0x4df78, %edx          # imm = 0x4DF78
callq *%rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x19061f
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x19065c
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %ecx
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x190750
cmpl $0x0, %eax
je 0x190655
movq -0x10(%rbp), %rdi
callq 0x190a10
movl $0xffffd8f0, -0x4(%rbp) # imm = 0xFFFFD8F0
jmp 0x19065c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)