// File: /workspace/github_c_makefile_star2_O2/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 $0x1948, %rsp           # imm = 0x1948
movq %r8, %rbx
movq %rcx, %r14
leaq 0x2c0(%rsp), %rbp
leaq 0x40(%rsp), %r8
movq %rdi, %r13
movq %rdi, 0x30(%rsp)
movq %rsi, %r12
movq %rsi, 0x38(%rsp)
movq %rdx, %r15
movq %rbp, %rcx
callq 0x110c5
movq $0x1, 0x800(%rbp)
pushq $0xf
popq %rdx
movl $0x120, %esi            # imm = 0x120
movq %rbp, %rdi
movl %edx, %ebp
movq %r14, %rcx
callq 0x109be
pushq $0x20
popq %rsi
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x109be
movq %rbx, %rdi
callq 0xf5db
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf615
movq %rax, 0x10(%rsp)
movq %r15, (%rsp)
leaq 0x2c0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r14, 0x20(%rsp)
movq %r14, %rdx
movq %rbx, 0x28(%rsp)
movq %rbx, %rcx
movq %r13, %r8
movq %r12, %r9
callq 0xf4f2
movq %rax, %r12
leaq 0x1040(%rsp), %r14
movl $0x900, %edx            # imm = 0x900
movq %r14, %rdi
leaq 0x2c0(%rsp), %rsi
callq 0x3360
leaq 0x1c0(%rsp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
callq 0x3360
movl $0x120, %edi            # imm = 0x120
movq %r14, %rsi
callq 0xdf04
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0xdf04
leaq 0xbc0(%rsp), %rbp
movl $0x120, %esi            # imm = 0x120
movq %r14, %rdi
pushq $0xf
popq %r13
movl %r13d, %edx
movq %rbp, %rcx
callq 0x109be
leaq 0x140(%rsp), %r14
movq %rbx, %rdi
pushq $0x20
popq %rsi
movl %r13d, %edx
movq %r14, %rcx
callq 0x109be
movq %r14, %rdi
callq 0xf5db
movq %rbp, %rdi
movq %r14, %rsi
callq 0xf615
movq %rax, %rbx
movq %r15, (%rsp)
leaq 0x2c0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq 0x30(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0xf4f2
movq 0x10(%rsp), %xmm1
movq %rbx, %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa 0x7946(%rip), %xmm1     # 0x15d80
movdqa %xmm0, %xmm2
pand %xmm1, %xmm2
movdqa 0x7946(%rip), %xmm3     # 0x15d90
por %xmm3, %xmm2
psrlq $0x20, %xmm0
movdqa 0x7945(%rip), %xmm4     # 0x15da0
por %xmm4, %xmm0
movapd 0x7949(%rip), %xmm5     # 0x15db0
subpd %xmm5, %xmm0
addpd %xmm2, %xmm0
movq %r12, %xmm2
movq %rax, %xmm6
punpcklqdq %xmm2, %xmm6    # xmm6 = xmm6[0],xmm2[0]
pand %xmm6, %xmm1
por %xmm3, %xmm1
psrlq $0x20, %xmm6
por %xmm4, %xmm6
subpd %xmm5, %xmm6
addpd %xmm1, %xmm6
addpd %xmm0, %xmm6
movapd %xmm6, %xmm0
unpckhpd %xmm6, %xmm0            # xmm0 = xmm0[1],xmm6[1]
ucomisd %xmm6, %xmm0
jbe 0xe4dd
leaq 0xbc0(%rsp), %rsi
movl $0x480, %edx            # imm = 0x480
movq 0x20(%rsp), %rdi
movapd %xmm6, 0x10(%rsp)
callq 0x3360
pushq $0x20
popq %rcx
leaq 0x140(%rsp), %rsi
movq 0x28(%rsp), %rdi
rep  movsl (%rsi), %es:(%rdi)
movapd 0x10(%rsp), %xmm0
addq $0x1948, %rsp           # imm = 0x1948
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq