// File: /workspace/github_c_makefile_star2_O2/madler[P]pigz/zopfli/src/zopfli/deflate.c
// Function: AddLZ77Block
static void AddLZ77Block(const ZopfliOptions* options, int btype, int final,
                         const ZopfliLZ77Store* lz77,
                         size_t lstart, size_t lend,
                         size_t expected_data_size,
                         unsigned char* bp,
                         unsigned char** out, size_t* outsize) {
  unsigned ll_lengths[ZOPFLI_NUM_LL];
  unsigned d_lengths[ZOPFLI_NUM_D];
  unsigned ll_symbols[ZOPFLI_NUM_LL];
  unsigned d_symbols[ZOPFLI_NUM_D];
  size_t detect_block_size = *outsize;
  size_t compressed_size;
  size_t uncompressed_size = 0;
  size_t i;
  if (btype == 0) {
    size_t length = ZopfliLZ77GetByteRange(lz77, lstart, lend);
    size_t pos = lstart == lend ? 0 : lz77->pos[lstart];
    size_t end = pos + length;
    AddNonCompressedBlock(options, final,
                          lz77->data, pos, end, bp, out, outsize);
    return;
  }

  AddBit(final, bp, out, outsize);
  AddBit(btype & 1, bp, out, outsize);
  AddBit((btype & 2) >> 1, bp, out, outsize);

  if (btype == 1) {
    /* Fixed block. */
    GetFixedTree(ll_lengths, d_lengths);
  } else {
    /* Dynamic block. */
    unsigned detect_tree_size;
    assert(btype == 2);

    GetDynamicLengths(lz77, lstart, lend, ll_lengths, d_lengths);

    detect_tree_size = *outsize;
    AddDynamicTree(ll_lengths, d_lengths, bp, out, outsize);
    if (options->verbose) {
      fprintf(stderr, "treesize: %d\n", (int)(*outsize - detect_tree_size));
    }
  }

  ZopfliLengthsToSymbols(ll_lengths, ZOPFLI_NUM_LL, 15, ll_symbols);
  ZopfliLengthsToSymbols(d_lengths, ZOPFLI_NUM_D, 15, d_symbols);

  detect_block_size = *outsize;
  AddLZ77Data(lz77, lstart, lend, expected_data_size,
              ll_symbols, ll_lengths, d_symbols, d_lengths,
              bp, out, outsize);
  /* End symbol. */
  AddHuffmanBits(ll_symbols[256], ll_lengths[256], bp, out, outsize);

  for (i = lstart; i < lend; i++) {
    uncompressed_size += lz77->dists[i] == 0 ? 1 : lz77->litlens[i];
  }
  compressed_size = *outsize - detect_block_size;
  if (options->verbose) {
    fprintf(stderr, "compressed block size: %d (%dk) (unc: %d)\n",
           (int)compressed_size, (int)(compressed_size / 1024),
           (int)(uncompressed_size));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa48, %rsp            # imm = 0xA48
movq %r9, %r13
movq %r8, %r15
movq %rcx, %r12
movl %edx, %ebx
movq 0xa90(%rsp), %r14
movq 0xa88(%rsp), %rax
movq 0xa80(%rsp), %rcx
testl %esi, %esi
je 0xeeb2
movl %esi, %ebp
movq %rdi, 0x20(%rsp)
movl %ebx, %edi
movq %rcx, %rsi
movq %rax, %rbx
movq %rax, %rdx
movq %r14, %rcx
callq 0xff3c
movl %ebp, %edi
andl $0x1, %edi
movq 0xa80(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xff3c
movl %ebp, %edi
shrl %edi
andl $0x1, %edi
movq 0xa80(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xff3c
cmpl $0x1, %ebp
movq %r15, 0x28(%rsp)
movq %r13, 0x30(%rsp)
jne 0xeed0
leaq 0x140(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xe235
jmp 0xef98
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x11093
cmpq %r13, %r15
jne 0xf1ae
xorl %edx, %edx
jmp 0xf1b7
leaq 0x140(%rsp), %rcx
leaq 0x40(%rsp), %r8
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r8, %rbp
callq 0xe2a8
movq (%r14), %rax
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpl $0x8, %r15d
je 0xef45
movl %r15d, %edx
andl $0x1, %edx
movl %r15d, %ecx
andl $0x2, %ecx
movl %r15d, %r8d
andl $0x4, %r8d
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq 0x140(%rsp), %rdi
movq %rbp, %rsi
xorl %r9d, %r9d
callq 0xf679
leaq -0x1(%r13), %rcx
cmpq %rax, %rcx
cmovael %r15d, %ebx
cmovaeq %rax, %r13
incl %r15d
jmp 0xeefe
movl %ebx, %edx
andl $0x1, %edx
movl %ebx, %ecx
andl $0x2, %ecx
andl $0x4, %ebx
movq %r14, 0x8(%rsp)
movq 0xa88(%rsp), %rax
movq %rax, (%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebx, %r8d
movq 0xa80(%rsp), %r9
callq 0xf679
movq 0x20(%rsp), %rax
cmpl $0x0, (%rax)
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %r13
jne 0xf1ef
leaq 0x140(%rsp), %rdi
pushq $0xf
popq %rbx
leaq 0x5c0(%rsp), %rcx
movl $0x120, %esi            # imm = 0x120
movl %ebx, %edx
callq 0x107cc
leaq 0x40(%rsp), %rdi
pushq $0x20
popq %rsi
leaq 0xc0(%rsp), %rcx
movl %ebx, %edx
callq 0x107cc
movq (%r14), %rax
movq %rax, 0x18(%rsp)
movq %r12, 0x38(%rsp)
cmpq %r13, %r15
jae 0xf127
movq (%r12), %rax
movq 0x8(%r12), %rcx
movzwl (%rcx,%r15,2), %ebx
movzwl (%rax,%r15,2), %ebp
testl %ebx, %ebx
je 0xf0e4
movl %ebp, %edi
callq 0x137a5
movl %eax, %r13d
movl %ebx, %edi
callq 0x13764
leal -0x3(%rbp), %ecx
cmpw $0x11e, %cx             # imm = 0x11E
jae 0xf251
movl %r13d, %ecx
movl 0x140(%rsp,%rcx,4), %esi
testl %esi, %esi
je 0xf213
movq %r14, %r12
movl %eax, %r14d
cmpl $0x0, 0x40(%rsp,%r14,4)
je 0xf232
movl 0x5c0(%rsp,%rcx,4), %edi
movq 0xa80(%rsp), %rdx
movq 0xa88(%rsp), %rcx
movq %r12, %r8
callq 0xfe98
movl %ebp, %edi
callq 0x13797
movl %eax, %r13d
movl %ebp, %edi
callq 0x13789
movl %r13d, %edi
movl %eax, %esi
movq 0xa80(%rsp), %rbp
movq %rbp, %rdx
movq 0xa88(%rsp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0xfdeb
movl 0xc0(%rsp,%r14,4), %edi
movl 0x40(%rsp,%r14,4), %esi
movq %r12, %r14
movq %rbp, %rdx
movq %rbp, %r12
movq %r13, %rcx
movq %r14, %r8
callq 0xfe98
movl %ebx, %edi
callq 0x1373d
movl %eax, %ebp
movl %ebx, %edi
callq 0x13728
movl %ebp, %edi
movl %eax, %esi
movq %r12, %rdx
movq %r13, %rcx
movq %r14, %r8
callq 0xfdeb
movq 0x38(%rsp), %r12
movq 0x30(%rsp), %r13
jmp 0xf11f
cmpw $0x100, %bp             # imm = 0x100
jae 0xf270
movl %ebp, %eax
movl 0x140(%rsp,%rax,4), %esi
testl %esi, %esi
je 0xf28f
movl 0x5c0(%rsp,%rax,4), %edi
movq 0xa80(%rsp), %rdx
movq 0xa88(%rsp), %rcx
movq %r14, %r8
callq 0xfe98
incq %r15
jmp 0xefdb
movl 0x9c0(%rsp), %edi
movl 0x540(%rsp), %esi
movq 0xa80(%rsp), %rdx
movq 0xa88(%rsp), %rcx
movq %r14, %r8
callq 0xfe98
xorl %r8d, %r8d
pushq $0x1
popq %rax
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rsi
cmpq %r13, %rdx
jae 0xf180
movq 0x8(%r12), %rcx
cmpw $0x0, (%rcx,%rdx,2)
movl %eax, %ecx
je 0xf178
movq (%r12), %rcx
movzwl (%rcx,%rdx,2), %ecx
addl %ecx, %r8d
incq %rdx
jmp 0xf15d
cmpl $0x0, (%rsi)
je 0xf1dd
movq (%r14), %rdx
subq 0x18(%rsp), %rdx
movq 0xce5c(%rip), %rax      # 0x1bff0
movq (%rax), %rdi
movq %rdx, %rcx
shrq $0xa, %rcx
leaq 0x6d32(%rip), %rsi      # 0x15ed7
xorl %eax, %eax
callq 0x3340
jmp 0xf1dd
movq 0x20(%r12), %rcx
movq (%rcx,%r15,8), %rdx
addq %rdx, %rax
movq 0x18(%r12), %rsi
movq %r14, (%rsp)
movl %ebx, %edi
movq %rax, %rcx
movq 0xa80(%rsp), %r8
movq 0xa88(%rsp), %r9
callq 0xebea
addq $0xa48, %rsp            # imm = 0xA48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xcdfa(%rip), %rax      # 0x1bff0
movq (%rax), %rdi
movl (%r14), %edx
subl 0x18(%rsp), %edx
leaq 0x6cc2(%rip), %rsi      # 0x15ec9
xorl %eax, %eax
callq 0x3340
jmp 0xef98
leaq 0x6df0(%rip), %rdi      # 0x1600a
leaq 0x6bfb(%rip), %rsi      # 0x15e1c
leaq 0x6ce7(%rip), %rcx      # 0x15f0f
movl $0x13f, %edx            # imm = 0x13F
callq 0x3220
leaq 0x6de5(%rip), %rdi      # 0x1601e
leaq 0x6bdc(%rip), %rsi      # 0x15e1c
leaq 0x6cc8(%rip), %rcx      # 0x15f0f
movl $0x140, %edx            # imm = 0x140
callq 0x3220
leaq 0x6d95(%rip), %rdi      # 0x15fed
leaq 0x6bbd(%rip), %rsi      # 0x15e1c
leaq 0x6ca9(%rip), %rcx      # 0x15f0f
movl $0x13e, %edx            # imm = 0x13E
callq 0x3220
leaq 0x6c8b(%rip), %rdi      # 0x15f02
leaq 0x6b9e(%rip), %rsi      # 0x15e1c
leaq 0x6c8a(%rip), %rcx      # 0x15f0f
movl $0x137, %edx            # imm = 0x137
callq 0x3220
leaq 0x6d40(%rip), %rdi      # 0x15fd6
leaq 0x6b7f(%rip), %rsi      # 0x15e1c
leaq 0x6c6b(%rip), %rcx      # 0x15f0f
movl $0x138, %edx            # imm = 0x138
callq 0x3220