// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rcx, %r14
leaq 0x750(%rsp), %rbp
leaq 0xd0(%rsp), %r8
movq %rdi, %r12
movq %rsi, %r15
movq %rsi, 0x20(%rsp)
movq %rdx, %rbx
movq %rbp, %rcx
callq 0x119a2
movq $0x1, 0x800(%rbp)
movl $0x120, %esi            # imm = 0x120
movq %rbp, %rdi
movl $0xf, %edx
movq %r14, %rcx
callq 0x11258
movl $0x20, %esi
leaq 0xd0(%rsp), %rbp
movq %rbp, %rdi
movl $0xf, %edx
movq %r13, %rcx
callq 0x11258
movq %r13, %rdi
callq 0xfef9
movq %r14, %rdi
movq %r13, %rsi
callq 0xff32
movq %rax, %xmm0
punpckldq 0x6444(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x644c(%rip), %xmm0     # 0x15030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movq %rbx, (%rsp)
leaq 0x750(%rsp), %rdi
movq %rbp, %rsi
movq %r14, 0x38(%rsp)
movq %r14, %rdx
movq %r13, 0x30(%rsp)
movq %r13, %rcx
movq %r12, %r8
movq %r15, %r9
callq 0xfe16
movq %rax, %xmm0
punpckldq 0x63f3(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x63fb(%rip), %xmm0     # 0x15030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x10(%rsp), %xmm1
movapd %xmm1, 0x10(%rsp)
leaq 0x1050(%rsp), %r14
movl $0x900, %edx            # imm = 0x900
movq %r14, %rdi
leaq 0x750(%rsp), %r13
movq %r13, %rsi
callq 0x3360
leaq 0x1d0(%rsp), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3360
movl $0x120, %edi            # imm = 0x120
movq %r14, %rsi
callq 0xe740
movl $0x20, %edi
movq %r15, %rsi
callq 0xe740
leaq 0x2d0(%rsp), %rbp
movl $0x120, %esi            # imm = 0x120
movq %r14, %rdi
movl $0xf, %edx
movq %rbp, %rcx
callq 0x11258
leaq 0x50(%rsp), %r14
movl $0x20, %esi
movq %r15, %rdi
movl $0xf, %edx
movq %r14, %rcx
callq 0x11258
movq %r14, %rdi
callq 0xfef9
movq %rbp, %rdi
movq %r14, %rsi
callq 0xff32
movq %rax, %xmm0
punpckldq 0x632a(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6332(%rip), %xmm0     # 0x15030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x40(%rsp)
movq %rbx, (%rsp)
movq %r13, %rdi
leaq 0xd0(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq %r12, %r8
movq 0x20(%rsp), %r9
callq 0xfe16
movq %rax, %xmm0
punpckldq 0x62e1(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x62e9(%rip), %xmm0     # 0x15030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd 0x10(%rsp), %xmm0
addsd 0x40(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xed99
leaq 0x2d0(%rsp), %rsi
movl $0x480, %edx            # imm = 0x480
movq 0x38(%rsp), %rdi
movapd %xmm1, 0x20(%rsp)
callq 0x3360
leaq 0x50(%rsp), %rsi
movl $0x20, %ecx
movq 0x30(%rsp), %rdi
rep  movsl (%rsi), %es:(%rdi)
movapd 0x20(%rsp), %xmm0
addq $0x1958, %rsp           # imm = 0x1958
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq