// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/../foreign/miniz-c.h
// Function: tdefl_compress_lz_codes
static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d)
{
    mz_uint flags;
    mz_uint8 *pLZ_codes;

    flags = 1;
    for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf; flags >>= 1)
    {
        if (flags == 1)
            flags = *pLZ_codes++ | 0x100;
        if (flags & 1)
        {
            mz_uint sym, num_extra_bits;
            mz_uint match_len = pLZ_codes[0], match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8));
            pLZ_codes += 3;

            MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
            TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
            TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]);

            if (match_dist < 512)
            {
                sym = s_tdefl_small_dist_sym[match_dist];
                num_extra_bits = s_tdefl_small_dist_extra[match_dist];
            }
            else
            {
                sym = s_tdefl_large_dist_sym[match_dist >> 8];
                num_extra_bits = s_tdefl_large_dist_extra[match_dist >> 8];
            }
            MZ_ASSERT(d->m_huff_code_sizes[1][sym]);
            TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
            TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
        }
        else
        {
            mz_uint lit = *pLZ_codes++;
            MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
            TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
        }
    }

    TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);

    return (d->m_pOutput_buf < d->m_pOutput_buf_end);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x8(%rbp), %rax
addq $0x92aa, %rax           # imm = 0x92AA
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0x199b83
cmpl $0x1, -0xc(%rbp)
jne 0x1995b3
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x199a51
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x1(%rax), %eax
movq -0x18(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
leaq 0x3f3f0(%rip), %rcx     # 0x1d89f0
movzwl (%rcx,%rdx,2), %ecx
cmpb $0x0, 0x8f4a(%rax,%rcx)
je 0x199610
jmp 0x19962f
leaq 0x3fdf3(%rip), %rdi     # 0x1d940a
leaq 0x3fa50(%rip), %rsi     # 0x1d906e
movl $0x4bd, %edx            # imm = 0x4BD
leaq 0x3fe14(%rip), %rcx     # 0x1d943e
callq 0x19120
jmp 0x199631
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
leaq 0x3f3af(%rip), %rcx     # 0x1d89f0
movzwl (%rcx,%rdx,2), %ecx
movzwl 0x888a(%rax,%rcx,2), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
leaq 0x3f390(%rip), %rcx     # 0x1d89f0
movzwl (%rcx,%rdx,2), %ecx
movzbl 0x8f4a(%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x199687
jmp 0x1996a6
leaq 0x3fcb4(%rip), %rdi     # 0x1d9342
leaq 0x3f9d9(%rip), %rsi     # 0x1d906e
movl $0x4be, %edx            # imm = 0x4BE
leaq 0x3fd9d(%rip), %rcx     # 0x1d943e
callq 0x19120
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x30(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x199721
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x199705
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x1996cb
jmp 0x199723
jmp 0x199725
movl -0x24(%rbp), %eax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
leaq 0x3f52c(%rip), %rcx     # 0x1d8c60
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
leaq 0x3f4cf(%rip), %rcx     # 0x1d8c10
andl (%rcx,%rdx,4), %eax
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0x3f50d(%rip), %rax     # 0x1d8c60
movzbl (%rax,%rcx), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movl -0x38(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x199772
jmp 0x199791
leaq 0x3fbc9(%rip), %rdi     # 0x1d9342
leaq 0x3f8ee(%rip), %rsi     # 0x1d906e
movl $0x4bf, %edx            # imm = 0x4BF
leaq 0x3fcb2(%rip), %rcx     # 0x1d943e
callq 0x19120
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x38(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x19980c
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x1997f0
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x1997b6
jmp 0x19980e
cmpl $0x200, -0x28(%rbp)     # imm = 0x200
jae 0x19983f
movl -0x28(%rbp), %eax
movl %eax, %ecx
leaq 0x3ef4d(%rip), %rax     # 0x1d8770
movzbl (%rax,%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
leaq 0x3f52a(%rip), %rax     # 0x1d8d60
movzbl (%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
jmp 0x19986f
movl -0x28(%rbp), %eax
shrl $0x8, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3f120(%rip), %rax     # 0x1d8970
movzbl (%rax,%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x28(%rbp), %eax
shrl $0x8, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x3f6f8(%rip), %rax     # 0x1d8f60
movzbl (%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpb $0x0, 0x906a(%rax,%rcx)
je 0x199882
jmp 0x1998a1
leaq 0x3fbe9(%rip), %rdi     # 0x1d9472
leaq 0x3f7de(%rip), %rsi     # 0x1d906e
movl $0x4cb, %edx            # imm = 0x4CB
leaq 0x3fba2(%rip), %rcx     # 0x1d943e
callq 0x19120
jmp 0x1998a3
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movzwl 0x8aca(%rax,%rcx,2), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movzbl 0x906a(%rax,%rcx), %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
movl -0x40(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x1998df
jmp 0x1998fe
leaq 0x3fa5c(%rip), %rdi     # 0x1d9342
leaq 0x3f781(%rip), %rsi     # 0x1d906e
movl $0x4cc, %edx            # imm = 0x4CC
leaq 0x3fb45(%rip), %rcx     # 0x1d943e
callq 0x19120
movl -0x3c(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x40(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x199979
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x19995d
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x199923
jmp 0x19997b
jmp 0x19997d
movl -0x28(%rbp), %eax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
leaq 0x3f284(%rip), %rcx     # 0x1d8c10
andl (%rcx,%rdx,4), %eax
movl %eax, -0x44(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %eax
movl -0x48(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x1999b0
jmp 0x1999cf
leaq 0x3f98b(%rip), %rdi     # 0x1d9342
leaq 0x3f6b0(%rip), %rsi     # 0x1d906e
movl $0x4cd, %edx            # imm = 0x4CD
leaq 0x3fa74(%rip), %rcx     # 0x1d943e
callq 0x19120
movl -0x44(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x48(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x199a4a
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x199a2e
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x1999f4
jmp 0x199a4c
jmp 0x199b74
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movl -0x4c(%rbp), %ecx
cmpb $0x0, 0x8f4a(%rax,%rcx)
je 0x199a79
jmp 0x199a98
leaq 0x3fa0f(%rip), %rdi     # 0x1d948f
leaq 0x3f5e7(%rip), %rsi     # 0x1d906e
movl $0x4d2, %edx            # imm = 0x4D2
leaq 0x3f9ab(%rip), %rcx     # 0x1d943e
callq 0x19120
jmp 0x199a9a
movq -0x8(%rbp), %rax
movl -0x4c(%rbp), %ecx
movzwl 0x888a(%rax,%rcx,2), %eax
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movl -0x4c(%rbp), %ecx
movzbl 0x8f4a(%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
movl -0x50(%rbp), %eax
movl -0x54(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x199ad6
jmp 0x199af5
leaq 0x3f865(%rip), %rdi     # 0x1d9342
leaq 0x3f58a(%rip), %rsi     # 0x1d906e
movl $0x4d3, %edx            # imm = 0x4D3
leaq 0x3f94e(%rip), %rcx     # 0x1d943e
callq 0x19120
movl -0x50(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x54(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x199b70
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x199b54
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x199b1a
jmp 0x199b72
jmp 0x199b74
jmp 0x199b76
movl -0xc(%rbp), %eax
shrl %eax
movl %eax, -0xc(%rbp)
jmp 0x199581
jmp 0x199b85
movq -0x8(%rbp), %rax
movzwl 0x8a8a(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x904a(%rax), %eax
movl %eax, -0x5c(%rbp)
movl -0x58(%rbp), %eax
movl -0x5c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x199bb9
jmp 0x199bd8
leaq 0x3f782(%rip), %rdi     # 0x1d9342
leaq 0x3f4a7(%rip), %rsi     # 0x1d906e
movl $0x4d7, %edx            # imm = 0x4D7
leaq 0x3f86b(%rip), %rcx     # 0x1d943e
callq 0x19120
movl -0x58(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x5c(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x199c53
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x199c37
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x199bfd
jmp 0x199c55
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x48(%rcx), %rax
setb %al
andb $0x1, %al
movzbl %al, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)