// File: /workspace/github_c_makefile_star2_O0/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: AddLZ77Data
static void AddLZ77Data(const ZopfliLZ77Store* lz77,
                        size_t lstart, size_t lend,
                        size_t expected_data_size,
                        const unsigned* ll_symbols, const unsigned* ll_lengths,
                        const unsigned* d_symbols, const unsigned* d_lengths,
                        unsigned char* bp,
                        unsigned char** out, size_t* outsize) {
  size_t testlength = 0;
  size_t i;

  for (i = lstart; i < lend; i++) {
    unsigned dist = lz77->dists[i];
    unsigned litlen = lz77->litlens[i];
    if (dist == 0) {
      assert(litlen < 256);
      assert(ll_lengths[litlen] > 0);
      AddHuffmanBits(ll_symbols[litlen], ll_lengths[litlen], bp, out, outsize);
      testlength++;
    } else {
      unsigned lls = ZopfliGetLengthSymbol(litlen);
      unsigned ds = ZopfliGetDistSymbol(dist);
      assert(litlen >= 3 && litlen <= 288);
      assert(ll_lengths[lls] > 0);
      assert(d_lengths[ds] > 0);
      AddHuffmanBits(ll_symbols[lls], ll_lengths[lls], bp, out, outsize);
      AddBits(ZopfliGetLengthExtraBitsValue(litlen),
              ZopfliGetLengthExtraBits(litlen),
              bp, out, outsize);
      AddHuffmanBits(d_symbols[ds], d_lengths[ds], bp, out, outsize);
      AddBits(ZopfliGetDistExtraBitsValue(dist),
              ZopfliGetDistExtraBits(dist),
              bp, out, outsize);
      testlength += litlen;
    }
  }
  assert(expected_data_size == 0 || testlength == expected_data_size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x1595b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x157ff
cmpl $0x100, -0x48(%rbp)     # imm = 0x100
jae 0x1577c
jmp 0x1579b
leaq 0x8813(%rip), %rdi      # 0x1df96
leaq 0x868a(%rip), %rsi      # 0x1de14
movl $0x137, %edx            # imm = 0x137
leaq 0x880d(%rip), %rcx      # 0x1dfa3
callq 0x3220
movq -0x30(%rbp), %rax
movl -0x48(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jbe 0x157aa
jmp 0x157c9
leaq 0x88b9(%rip), %rdi      # 0x1e06a
leaq 0x865c(%rip), %rsi      # 0x1de14
movl $0x138, %edx            # imm = 0x138
leaq 0x87df(%rip), %rcx      # 0x1dfa3
callq 0x3220
movq -0x28(%rbp), %rax
movl -0x48(%rbp), %ecx
movl (%rax,%rcx,4), %edi
movq -0x30(%rbp), %rax
movl -0x48(%rbp), %ecx
movl (%rax,%rcx,4), %esi
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq 0x30(%rbp), %r8
callq 0x15400
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x15948
movl -0x48(%rbp), %edi
callq 0x1bb70
movl %eax, -0x4c(%rbp)
movl -0x44(%rbp), %edi
callq 0x1bae0
movl %eax, -0x50(%rbp)
cmpl $0x3, -0x48(%rbp)
jb 0x15826
cmpl $0x120, -0x48(%rbp)     # imm = 0x120
ja 0x15826
jmp 0x15845
leaq 0x8854(%rip), %rdi      # 0x1e081
leaq 0x85e0(%rip), %rsi      # 0x1de14
movl $0x13e, %edx            # imm = 0x13E
leaq 0x8763(%rip), %rcx      # 0x1dfa3
callq 0x3220
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jbe 0x15854
jmp 0x15873
leaq 0x8843(%rip), %rdi      # 0x1e09e
leaq 0x85b2(%rip), %rsi      # 0x1de14
movl $0x13f, %edx            # imm = 0x13F
leaq 0x8735(%rip), %rcx      # 0x1dfa3
callq 0x3220
movq 0x18(%rbp), %rax
movl -0x50(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jbe 0x15882
jmp 0x158a1
leaq 0x8829(%rip), %rdi      # 0x1e0b2
leaq 0x8584(%rip), %rsi      # 0x1de14
movl $0x140, %edx            # imm = 0x140
leaq 0x8707(%rip), %rcx      # 0x1dfa3
callq 0x3220
movq -0x28(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %edi
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %esi
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq 0x30(%rbp), %r8
callq 0x15400
movl -0x48(%rbp), %edi
callq 0x1bb50
movl %eax, -0x58(%rbp)
movl -0x48(%rbp), %edi
callq 0x1bb30
movl -0x58(%rbp), %edi
movl %eax, %esi
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq 0x30(%rbp), %r8
callq 0x152e0
movq 0x10(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %edi
movq 0x18(%rbp), %rax
movl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %esi
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq 0x30(%rbp), %r8
callq 0x15400
movl -0x44(%rbp), %edi
callq 0x1ba80
movl %eax, -0x54(%rbp)
movl -0x44(%rbp), %edi
callq 0x1ba50
movl -0x54(%rbp), %edi
movl %eax, %esi
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq 0x30(%rbp), %r8
callq 0x152e0
movl -0x48(%rbp), %eax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x1594a
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x15734
cmpq $0x0, -0x20(%rbp)
je 0x1596c
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x1596e
jmp 0x1598d
leaq 0x874f(%rip), %rdi      # 0x1e0c4
leaq 0x8498(%rip), %rsi      # 0x1de14
movl $0x14c, %edx            # imm = 0x14C
leaq 0x861b(%rip), %rcx      # 0x1dfa3
callq 0x3220
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)