// File: sisong[P]ApkDiffPatch/zlib1.3.1/trees.c
// Function: send_all_trees
local void send_all_trees(deflate_state *s, int lcodes, int dcodes,
                          int blcodes) {
    int rank;                    /* index in bl_order */

    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
            "too many codes");
    Tracev((stderr, "\nbl counts: "));
    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
    send_bits(s, dcodes - 1,   5);
    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
    for (rank = 0; rank < blcodes; rank++) {
        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
    }
    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));

    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));

    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x5, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jle 0xa0752
movl -0xc(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movzwl %ax, %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x20(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1730(%rax)
movl -0x1c(%rbp), %ecx
subl $0x10, %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xa0790
movl -0xc(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
movzwl %ax, %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
movl $0x5, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jle 0xa087b
movl -0x10(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movzwl %ax, %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x28(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1730(%rax)
movl -0x24(%rbp), %ecx
subl $0x10, %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xa08b7
movl -0x10(%rbp), %eax
subl $0x1, %eax
movzwl %ax, %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x24(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
movl $0x4, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x2c(%rbp), %ecx
cmpl %ecx, %eax
jle 0xa09a2
movl -0x14(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movzwl %ax, %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x30(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1730(%rax)
movl -0x2c(%rbp), %ecx
subl $0x10, %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xa09de
movl -0x14(%rbp), %eax
subl $0x4, %eax
movzwl %ax, %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x2c(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xa0b4f
movl $0x3, -0x34(%rbp)
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %eax
movl $0x10, %ecx
subl -0x34(%rbp), %ecx
cmpl %ecx, %eax
jle 0xa0af1
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rdx
leaq 0x1e00f(%rip), %rcx     # 0xbea30
movzbl (%rcx,%rdx), %ecx
movzwl 0xabe(%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movzwl %ax, %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, (%rax,%rcx)
movl -0x38(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rdx
movl $0x10, %ecx
subl 0x1734(%rdx), %ecx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1730(%rax)
movl -0x34(%rbp), %ecx
subl $0x10, %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xa0b3f
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rdx
leaq 0x1df30(%rip), %rcx     # 0xbea30
movzbl (%rcx,%rdx), %ecx
movzwl 0xabe(%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movl 0x1734(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1730(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1730(%rax)
movl -0x34(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1734(%rax), %ecx
movl %ecx, 0x1734(%rax)
jmp 0xa0b41
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xa09e5
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xd4, %rsi
movl -0xc(%rbp), %edx
subl $0x1, %edx
callq 0xa1530
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x9c8, %rsi            # imm = 0x9C8
movl -0x10(%rbp), %edx
subl $0x1, %edx
callq 0xa1530
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)