// File: /workspace/github_c_makefile_star2_O3/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: GetDynamicLengths
static double GetDynamicLengths(const ZopfliLZ77Store* lz77,
                                size_t lstart, size_t lend,
                                unsigned* ll_lengths, unsigned* d_lengths) {
  size_t ll_counts[ZOPFLI_NUM_LL];
  size_t d_counts[ZOPFLI_NUM_D];

  ZopfliLZ77GetHistogram(lz77, lstart, lend, ll_counts, d_counts);
  ll_counts[256] = 1;  /* End symbol. */
  ZopfliCalculateBitLengths(ll_counts, ZOPFLI_NUM_LL, 15, ll_lengths);
  ZopfliCalculateBitLengths(d_counts, ZOPFLI_NUM_D, 15, d_lengths);
  PatchDistanceCodesForBuggyDecoders(d_lengths);
  return TryOptimizeHuffmanForRle(
      lz77, lstart, lend, ll_counts, d_counts, ll_lengths, d_lengths);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1958, %rsp           # imm = 0x1958
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r13
leaq 0x750(%rsp), %r15
leaq 0xd0(%rsp), %r12
movq %rdi, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %r15, %rcx
movq %r12, %r8
callq 0x11ee9
movq $0x1, 0x800(%r15)
movl $0x120, %esi            # imm = 0x120
movq %r15, %rdi
movl $0xf, %edx
movq %r14, %rcx
callq 0x117ac
movl $0x20, %esi
movq %r12, %rdi
movl $0xf, %edx
movq %rbx, %rcx
callq 0x117ac
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x1, (%rbx,%rax,4)
sbbl $-0x1, %ecx
cmpl $0x1, %ecx
ja 0xefbc
incq %rax
cmpq $0x1e, %rax
jne 0xef85
testl %ecx, %ecx
je 0xefac
xorl %eax, %eax
cmpl $0x0, (%rbx)
setne %al
leaq (%rbx,%rax,4), %rax
jmp 0xefb6
movl $0x1, 0x4(%rbx)
movq %rbx, %rax
movl $0x1, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1038a
movq %rax, %xmm0
punpckldq 0x604c(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6054(%rip), %xmm0     # 0x15030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x40(%rsp)
movq %r13, (%rsp)
leaq 0x750(%rsp), %r12
leaq 0xd0(%rsp), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
callq 0x10270
movq %rax, %xmm0
punpckldq 0x5ff6(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5ffe(%rip), %xmm0     # 0x15030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
leaq 0x1050(%rsp), %r15
movl $0x900, %edx            # imm = 0x900
movq %r15, %rdi
movq %r12, %rsi
callq 0x3370
leaq 0x1d0(%rsp), %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3370
movl $0x120, %edi            # imm = 0x120
movq %r15, %rsi
callq 0xead8
movl $0x20, %edi
movq %r12, %rsi
callq 0xead8
leaq 0x2d0(%rsp), %rcx
movl $0x120, %esi            # imm = 0x120
movq %r15, %rdi
movl $0xf, %edx
callq 0x117ac
leaq 0x50(%rsp), %rbp
movl $0x20, %esi
movq %r12, %rdi
movl $0xf, %edx
movq %rbp, %rcx
callq 0x117ac
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x1, 0x50(%rsp,%rax,4)
sbbl $-0x1, %ecx
cmpl $0x1, %ecx
ja 0xf103
incq %rax
cmpq $0x1e, %rax
jne 0xf0c6
testl %ecx, %ecx
je 0xf0f4
xorl %eax, %eax
cmpl $0x0, 0x50(%rsp)
setne %al
leaq (%rsp,%rax,4), %rbp
addq $0x50, %rbp
jmp 0xf0fc
movl $0x1, 0x54(%rsp)
movl $0x1, (%rbp)
leaq 0x2d0(%rsp), %r15
leaq 0x50(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1038a
movq %rax, %xmm0
movq 0x5ef8(%rip), %xmm1     # 0x15020
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x5efc(%rip), %xmm1     # 0x15030
subpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
movq %r13, (%rsp)
leaq 0x750(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r15, %rdx
movq %r12, %rcx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
callq 0x10270
movq %rax, %xmm0
punpckldq 0x5ea0(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5ea8(%rip), %xmm0     # 0x15030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x20(%rsp), %xmm1
movapd 0x40(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf1dc
leaq 0x2d0(%rsp), %rsi
movl $0x480, %edx            # imm = 0x480
movq %r14, %rdi
movapd %xmm1, 0x10(%rsp)
callq 0x3370
leaq 0x50(%rsp), %rsi
movl $0x20, %ecx
movq %rbx, %rdi
rep  movsl (%rsi), %es:(%rdi)
movapd 0x10(%rsp), %xmm0
addq $0x1958, %rsp           # imm = 0x1958
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq