// File: /workspace/github_c_makefile_star2_O0/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: CalculateBlockSymbolSizeGivenCounts
static size_t CalculateBlockSymbolSizeGivenCounts(const size_t* ll_counts,
                                                  const size_t* d_counts,
                                                  const unsigned* ll_lengths,
                                                  const unsigned* d_lengths,
                                                  const ZopfliLZ77Store* lz77,
                                                  size_t lstart, size_t lend) {
  size_t result = 0;
  size_t i;
  if (lstart + ZOPFLI_NUM_LL * 3 > lend) {
    return CalculateBlockSymbolSizeSmall(
        ll_lengths, d_lengths, lz77, lstart, lend);
  } else {
    for (i = 0; i < 256; i++) {
      result += ll_lengths[i] * ll_counts[i];
    }
    for (i = 257; i < 286; i++) {
      result += ll_lengths[i] * ll_counts[i];
      result += ZopfliGetLengthSymbolExtraBits(i) * ll_counts[i];
    }
    for (i = 0; i < 30; i++) {
      result += d_lengths[i] * d_counts[i];
      result += ZopfliGetDistSymbolExtraBits(i) * d_counts[i];
    }
    result += ll_lengths[256]; /*end symbol*/
    return result;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rax
addq $0x360, %rax            # imm = 0x360
cmpq 0x10(%rbp), %rax
jbe 0x1417e
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x13fa0
movq %rax, -0x8(%rbp)
jmp 0x14299
movq $0x0, -0x48(%rbp)
cmpq $0x100, -0x48(%rbp)     # imm = 0x100
jae 0x141be
movq -0x20(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq -0x48(%rbp), %rdx
imulq (%rcx,%rdx,8), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x14186
movq $0x101, -0x48(%rbp)     # imm = 0x101
cmpq $0x11e, -0x48(%rbp)     # imm = 0x11E
jae 0x14220
movq -0x20(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq -0x48(%rbp), %rdx
imulq (%rcx,%rdx,8), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movl %eax, %edi
callq 0x1bb90
cltq
movq -0x10(%rbp), %rcx
movq -0x48(%rbp), %rdx
imulq (%rcx,%rdx,8), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x141c6
movq $0x0, -0x48(%rbp)
cmpq $0x1e, -0x48(%rbp)
jae 0x1427f
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x18(%rbp), %rcx
movq -0x48(%rbp), %rdx
imulq (%rcx,%rdx,8), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movl %eax, %edi
callq 0x1bbb0
cltq
movq -0x18(%rbp), %rcx
movq -0x48(%rbp), %rdx
imulq (%rcx,%rdx,8), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x14228
movq -0x20(%rbp), %rax
movl 0x400(%rax), %eax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)