// File: /workspace/github_c_makefile_star2_O0/snej[P]zdelta/trees.c
// Function: send_all_trees
local void send_all_trees(s, lcodes, dcodes, zcodes, blcodes)
     deflate_state *s;
     int lcodes, dcodes, zcodes, blcodes; /* number of codes for each tree */
{
  int rank;                    /* index in bl_order */

  Assert (lcodes >= 1 && dcodes >= 257 && blcodes >= 4 && zcodes>=1,
	  "not enough codes");
  Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES &&
	  zcodes <= Z_CODES, "too many codes");

  send_bits(s, lcodes-1,   7); /* not +255 as stated in appnote.txt */
  Tracev((stderr, "\n # len codes   :%u", lcodes-1));

  send_bits(s, dcodes-257, 5);
  Tracev((stderr, "\n # dist codes  :%u", dcodes-257));

#if REFNUM>1
  send_bits(s, zcodes-1,   3); /* zdelta code tree size */
  Tracev((stderr, "\n # zdelta codes:%u", zcodes-1));
#endif

  send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */
  Tracev((stderr, "\n # bl codes    :%u", blcodes-4));

  Tracev((stderr, "\nbl counts: "));
    for (rank = 0; rank < blcodes; rank++) {
      Tracev((stderr, "\nbl code %2d len %2d", 
	      bl_order[rank], s->bl_tree[bl_order[rank]].Len));
      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, "\nlen tree: sent %ld", s->bits_sent));
  
  send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
  Tracev((stderr, "\nlit/dist tree: sent %ld", s->bits_sent));

#if REFNUM > 1
  send_tree(s, (ct_data *)s->dyn_ztree, zcodes-1); /* zdelta code tree */
  Tracev((stderr, "\nzd tree: sent %ld", s->bits_sent));
#endif
}

// 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 %r8d, -0x18(%rbp)
movl $0x7, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %eax
movl $0x10, %ecx
subl -0x20(%rbp), %ecx
cmpl %ecx, %eax
jle 0x9509
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x24(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rcx
movslq 0x1a74(%rcx), %rdx
movl $0x10, %ecx
subq %rdx, %rcx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1a70(%rax)
movslq -0x20(%rbp), %rdx
subq $0x10, %rdx
movq -0x8(%rbp), %rax
movslq 0x1a74(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x1a74(%rax)
jmp 0x9542
movl -0xc(%rbp), %edx
subl $0x1, %edx
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1a74(%rax), %ecx
movl %ecx, 0x1a74(%rax)
movl $0x5, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %eax
movl $0x10, %ecx
subl -0x28(%rbp), %ecx
cmpl %ecx, %eax
jle 0x9634
movl -0x10(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rcx
movslq 0x1a74(%rcx), %rdx
movl $0x10, %ecx
subq %rdx, %rcx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1a70(%rax)
movslq -0x28(%rbp), %rdx
subq $0x10, %rdx
movq -0x8(%rbp), %rax
movslq 0x1a74(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x1a74(%rax)
jmp 0x9670
movl -0x10(%rbp), %edx
subl $0x101, %edx            # imm = 0x101
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movl -0x28(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1a74(%rax), %ecx
movl %ecx, 0x1a74(%rax)
movl $0x4, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %eax
movl $0x10, %ecx
subl -0x30(%rbp), %ecx
cmpl %ecx, %eax
jle 0x9760
movl -0x18(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x34(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rcx
movslq 0x1a74(%rcx), %rdx
movl $0x10, %ecx
subq %rdx, %rcx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1a70(%rax)
movslq -0x30(%rbp), %rdx
subq $0x10, %rdx
movq -0x8(%rbp), %rax
movslq 0x1a74(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x1a74(%rax)
jmp 0x9799
movl -0x18(%rbp), %edx
subl $0x4, %edx
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movl -0x30(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1a74(%rax), %ecx
movl %ecx, 0x1a74(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x990f
movl $0x3, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %eax
movl $0x10, %ecx
subl -0x38(%rbp), %ecx
cmpl %ecx, %eax
jle 0x98b1
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rdx
leaq 0x7624(%rip), %rcx      # 0x10e00
movzbl (%rcx,%rdx), %ecx
movzwl 0xd92(%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x3c(%rbp), %eax
movzwl %ax, %eax
movq -0x8(%rbp), %rcx
movslq 0x1a74(%rcx), %rdx
movl $0x10, %ecx
subq %rdx, %rcx
sarl %cl, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1a70(%rax)
movslq -0x38(%rbp), %rdx
subq $0x10, %rdx
movq -0x8(%rbp), %rax
movslq 0x1a74(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0x1a74(%rax)
jmp 0x98ff
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rdx
leaq 0x7540(%rip), %rcx      # 0x10e00
movzbl (%rcx,%rdx), %ecx
movzwl 0xd92(%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movl 0x1a74(%rax), %ecx
shll %cl, %edx
movq -0x8(%rbp), %rax
movzwl 0x1a70(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x1a70(%rax)
movl -0x38(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x1a74(%rax), %ecx
movl %ecx, 0x1a74(%rax)
jmp 0x9901
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x97a0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x104, %rsi            # imm = 0x104
movl -0xc(%rbp), %edx
subl $0x1, %edx
callq 0xa230
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x480, %rsi            # imm = 0x480
movl -0x10(%rbp), %edx
subl $0x1, %edx
callq 0xa230
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)