// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/zlib-1.3.0.1/trees.c
// Function: compress_block
local void compress_block(deflate_state *s, const ct_data *ltree,
                          const ct_data *dtree) {
    unsigned dist;      /* distance of matched string */
    int lc;             /* match length or unmatched char (if dist == 0) */
    unsigned sx = 0;    /* running index in symbol buffers */
    unsigned code;      /* the code to send */
    int extra;          /* number of extra bits to send */

    if (s->sym_next != 0) do {
#ifdef LIT_MEM
        dist = s->d_buf[sx];
        lc = s->l_buf[sx++];
#else
        dist = s->sym_buf[sx++] & 0xff;
        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
        lc = s->sym_buf[sx++];
#endif
        if (dist == 0) {
            send_code(s, lc, ltree); /* send a literal byte */
            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
        } else {
            /* Here, lc is the match length - MIN_MATCH */
            code = _length_code[lc];
            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
            extra = extra_lbits[code];
            if (extra != 0) {
                lc -= base_length[code];
                send_bits(s, lc, extra);       /* send the extra length bits */
            }
            dist--; /* dist is now the match distance - 1 */
            code = d_code(dist);
            Assert (code < D_CODES, "bad d_code");

            send_code(s, code, dtree);       /* send the distance code */
            extra = extra_dbits[code];
            if (extra != 0) {
                dist -= (unsigned)base_dist[code];
                send_bits(s, dist, extra);   /* send the extra distance bits */
            }
        } /* literal or match pair ? */

        /* Check for no overlay of pending_buf on needed symbols */
#ifdef LIT_MEM
        Assert(s->pending < (s->lit_bufsize << 1) + sx, "pendingBuf overflow");
#else
        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
#endif

    } while (sx < s->sym_next);

    send_code(s, END_BLOCK, ltree);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl $0x0, -0x24(%rsp)
movq -0x8(%rsp), %rax
cmpl $0x0, 0x170c(%rax)
je 0xd7dd9
jmp 0xd75cb
movq -0x8(%rsp), %rax
movq 0x1700(%rax), %rax
movl -0x24(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rsp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
andl $0xff, %eax
movl %eax, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq 0x1700(%rax), %rax
movl -0x24(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rsp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
andl $0xff, %eax
shll $0x8, %eax
addl -0x1c(%rsp), %eax
movl %eax, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq 0x1700(%rax), %rax
movl -0x24(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rsp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x20(%rsp)
cmpl $0x0, -0x1c(%rsp)
jne 0xd77aa
movq -0x10(%rsp), %rax
movslq -0x20(%rsp), %rcx
movzwl 0x2(%rax,%rcx,4), %eax
movl %eax, -0x30(%rsp)
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x30(%rsp), %ecx
cmpl %ecx, %eax
jle 0xd7760
movq -0x10(%rsp), %rax
movslq -0x20(%rsp), %rcx
movzwl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rsp)
movl -0x34(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x34(%rsp), %eax
movzwl %ax, %eax
movq -0x8(%rsp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rsp), %rax
movw %cx, 0x1730(%rax)
movl -0x30(%rsp), %ecx
subl $0x10, %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd77a5
movq -0x10(%rsp), %rax
movslq -0x20(%rsp), %rcx
movzwl (%rax,%rcx,4), %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x30(%rsp), %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7dc0
movslq -0x20(%rsp), %rcx
leaq 0x9ee0a(%rip), %rax     # 0x1765c0
movzbl (%rax,%rcx), %eax
movl %eax, -0x28(%rsp)
movq -0x10(%rsp), %rax
movl -0x28(%rsp), %ecx
addl $0x100, %ecx            # imm = 0x100
addl $0x1, %ecx
movl %ecx, %ecx
movzwl 0x2(%rax,%rcx,4), %eax
movl %eax, -0x38(%rsp)
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x38(%rsp), %ecx
cmpl %ecx, %eax
jle 0xd78e2
movq -0x10(%rsp), %rax
movl -0x28(%rsp), %ecx
addl $0x100, %ecx            # imm = 0x100
addl $0x1, %ecx
movl %ecx, %ecx
movzwl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rsp)
movl -0x3c(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x3c(%rsp), %eax
movzwl %ax, %eax
movq -0x8(%rsp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rsp), %rax
movw %cx, 0x1730(%rax)
movl -0x38(%rsp), %ecx
subl $0x10, %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7931
movq -0x10(%rsp), %rax
movl -0x28(%rsp), %ecx
addl $0x100, %ecx            # imm = 0x100
addl $0x1, %ecx
movl %ecx, %ecx
movzwl (%rax,%rcx,4), %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x38(%rsp), %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
movl -0x28(%rsp), %eax
movl %eax, %ecx
leaq 0x9f282(%rip), %rax     # 0x176bc0
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rsp)
cmpl $0x0, -0x2c(%rsp)
je 0xd7aa5
movl -0x28(%rsp), %eax
movl %eax, %ecx
leaq 0x9f3d3(%rip), %rax     # 0x176d30
movl (%rax,%rcx,4), %ecx
movl -0x20(%rsp), %eax
subl %ecx, %eax
movl %eax, -0x20(%rsp)
movl -0x2c(%rsp), %eax
movl %eax, -0x40(%rsp)
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x40(%rsp), %ecx
cmpl %ecx, %eax
jle 0xd7a65
movl -0x20(%rsp), %eax
movl %eax, -0x44(%rsp)
movl -0x44(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x44(%rsp), %eax
movzwl %ax, %eax
movq -0x8(%rsp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rsp), %rax
movw %cx, 0x1730(%rax)
movl -0x40(%rsp), %ecx
subl $0x10, %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7aa3
movl -0x20(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x40(%rsp), %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7aa5
movl -0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rsp)
cmpl $0x100, -0x1c(%rsp)     # imm = 0x100
jae 0xd7ad1
movl -0x1c(%rsp), %eax
movl %eax, %ecx
leaq 0x9e8f9(%rip), %rax     # 0x1763c0
movzbl (%rax,%rcx), %eax
movl %eax, -0x60(%rsp)
jmp 0xd7af0
movl -0x1c(%rsp), %eax
shrl $0x7, %eax
addl $0x100, %eax            # imm = 0x100
movl %eax, %eax
movl %eax, %ecx
leaq 0x9e8d8(%rip), %rax     # 0x1763c0
movzbl (%rax,%rcx), %eax
movl %eax, -0x60(%rsp)
movl -0x60(%rsp), %eax
movl %eax, -0x28(%rsp)
movq -0x18(%rsp), %rax
movl -0x28(%rsp), %ecx
movzwl 0x2(%rax,%rcx,4), %eax
movl %eax, -0x48(%rsp)
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x48(%rsp), %ecx
cmpl %ecx, %eax
jle 0xd7c06
movq -0x18(%rsp), %rax
movl -0x28(%rsp), %ecx
movzwl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rsp)
movl -0x4c(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x4c(%rsp), %eax
movzwl %ax, %eax
movq -0x8(%rsp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rsp), %rax
movw %cx, 0x1730(%rax)
movl -0x48(%rsp), %ecx
subl $0x10, %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7c4a
movq -0x18(%rsp), %rax
movl -0x28(%rsp), %ecx
movzwl (%rax,%rcx,4), %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x48(%rsp), %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
movl -0x28(%rsp), %eax
movl %eax, %ecx
leaq 0x9efe9(%rip), %rax     # 0x176c40
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rsp)
cmpl $0x0, -0x2c(%rsp)
je 0xd7dbe
movl -0x28(%rsp), %eax
movl %eax, %ecx
leaq 0x9f13a(%rip), %rax     # 0x176db0
movl (%rax,%rcx,4), %ecx
movl -0x1c(%rsp), %eax
subl %ecx, %eax
movl %eax, -0x1c(%rsp)
movl -0x2c(%rsp), %eax
movl %eax, -0x50(%rsp)
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x50(%rsp), %ecx
cmpl %ecx, %eax
jle 0xd7d7e
movl -0x1c(%rsp), %eax
movl %eax, -0x54(%rsp)
movl -0x54(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x54(%rsp), %eax
movzwl %ax, %eax
movq -0x8(%rsp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rsp), %rax
movw %cx, 0x1730(%rax)
movl -0x50(%rsp), %ecx
subl $0x10, %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7dbc
movl -0x1c(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x50(%rsp), %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7dbe
jmp 0xd7dc0
jmp 0xd7dc2
movl -0x24(%rsp), %eax
movq -0x8(%rsp), %rcx
cmpl 0x170c(%rcx), %eax
jb 0xd75cb
jmp 0xd7dd9
movq -0x10(%rsp), %rax
movzwl 0x402(%rax), %eax
movl %eax, -0x58(%rsp)
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x58(%rsp), %ecx
cmpl %ecx, %eax
jle 0xd7ee4
movq -0x10(%rsp), %rax
movzwl 0x400(%rax), %eax
movl %eax, -0x5c(%rsp)
movl -0x5c(%rsp), %eax
movzwl %ax, %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x5c(%rsp), %eax
movzwl %ax, %eax
movq -0x8(%rsp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rsp), %rax
movw %cx, 0x1730(%rax)
movl -0x58(%rsp), %ecx
subl $0x10, %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xd7f27
movq -0x10(%rsp), %rax
movzwl 0x400(%rax), %edx
movq -0x8(%rsp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rsp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x58(%rsp), %ecx
movq -0x8(%rsp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
retq
nopl (%rax,%rax)