// File: /workspace/github_c_makefile_star2_O1/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 0xf82f
movl %esi, %ebp
movq %rdi, 0x28(%rsp)
movl %ebx, %edi
movq %rcx, %rsi
movq %rax, %rbx
movq %rax, %rdx
movq %r14, %rcx
callq 0x10831
movl %ebp, %edi
andl $0x1, %edi
movq 0xa80(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x10831
movl %ebp, %edi
shrl %edi
andl $0x1, %edi
movq 0xa80(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x10831
cmpl $0x1, %ebp
movq %r15, 0x20(%rsp)
movq %r13, 0x30(%rsp)
jne 0xf84d
leaq 0x140(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xead9
jmp 0xf912
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1196e
cmpq %r13, %r15
jne 0xfb43
xorl %edx, %edx
jmp 0xfb4c
leaq 0x140(%rsp), %rcx
leaq 0x40(%rsp), %r8
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r8, %r13
callq 0xeb42
movq (%r14), %rax
movq %rax, 0x18(%rsp)
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %ebx, %ebx
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 %r13, %rsi
xorl %r9d, %r9d
callq 0xff8c
leaq -0x1(%rbp), %rcx
cmpq %rax, %rcx
cmovael %r15d, %ebx
cmovaeq %rax, %rbp
incl %r15d
cmpl $0x8, %r15d
jne 0xf87a
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 0xff8c
movq 0x28(%rsp), %rax
cmpl $0x0, (%rax)
movq 0x20(%rsp), %r15
movq 0x30(%rsp), %r13
jne 0xfb84
leaq 0x140(%rsp), %rdi
leaq 0x5c0(%rsp), %rcx
movl $0x120, %esi            # imm = 0x120
movl $0xf, %edx
callq 0x11010
leaq 0x40(%rsp), %rdi
leaq 0xc0(%rsp), %rcx
movl $0x20, %esi
movl $0xf, %edx
callq 0x11010
movq (%r14), %rax
movq %rax, 0x18(%rsp)
cmpq %r13, %r15
jae 0xfab4
movq 0x20(%rsp), %r15
movq %r12, 0x38(%rsp)
movq (%r12), %rax
movq 0x8(%r12), %rcx
movzwl (%rcx,%r15,2), %ebx
movzwl (%rax,%r15,2), %ebp
testl %ebx, %ebx
je 0xfa6c
movl %ebp, %edi
callq 0x14249
movl %eax, %r13d
movl %ebx, %edi
callq 0x14208
leal -0x3(%rbp), %ecx
movzwl %cx, %ecx
cmpl $0x11e, %ecx            # imm = 0x11E
jae 0xfbc7
movl %r13d, %ecx
movl 0x140(%rsp,%rcx,4), %esi
testl %esi, %esi
je 0xfbe6
movq %r14, %r12
movl %eax, %r14d
cmpl $0x0, 0x40(%rsp,%r14,4)
je 0xfba8
movl 0x5c0(%rsp,%rcx,4), %edi
movq 0xa80(%rsp), %rdx
movq 0xa88(%rsp), %rcx
movq %r12, %r8
callq 0x1078f
movl %ebp, %edi
callq 0x1423b
movl %eax, %r13d
movl %ebp, %edi
callq 0x1422d
movl %r13d, %edi
movl %eax, %esi
movq 0xa80(%rsp), %rbp
movq %rbp, %rdx
movq 0xa88(%rsp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x106e2
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 0x1078f
movl %ebx, %edi
callq 0x141dd
movl %eax, %ebp
movl %ebx, %edi
callq 0x141c8
movl %ebp, %edi
movl %eax, %esi
movq %r12, %rdx
movq %r13, %rcx
movq %r14, %r8
callq 0x106e2
movq 0x38(%rsp), %r12
movq 0x30(%rsp), %r13
jmp 0xfaa8
cmpl $0x100, %ebp            # imm = 0x100
jae 0xfc24
movl %ebp, %eax
movl 0x140(%rsp,%rax,4), %esi
testl %esi, %esi
je 0xfc05
movl 0x5c0(%rsp,%rax,4), %edi
movq 0xa80(%rsp), %rdx
movq 0xa88(%rsp), %rcx
movq %r14, %r8
callq 0x1078f
incq %r15
cmpq %r15, %r13
jne 0xf968
movl 0x9c0(%rsp), %edi
movl 0x540(%rsp), %esi
movq 0xa80(%rsp), %rdx
movq 0xa88(%rsp), %rcx
movq %r14, %r8
callq 0x1078f
xorl %r8d, %r8d
movq 0x20(%rsp), %rdx
cmpq %r13, %rdx
movq 0x28(%rsp), %rsi
jae 0xfb15
movq 0x8(%r12), %rax
xorl %r8d, %r8d
cmpw $0x0, (%rax,%rdx,2)
je 0xfb05
movq (%r12), %rcx
movzwl (%rcx,%rdx,2), %ecx
jmp 0xfb0a
movl $0x1, %ecx
addq %rcx, %r8
incq %rdx
cmpq %rdx, %r13
jne 0xfaf4
cmpl $0x0, (%rsi)
je 0xfb72
movq (%r14), %rdx
subq 0x18(%rsp), %rdx
movq 0xd4c7(%rip), %rax      # 0x1cff0
movq (%rax), %rdi
movq %rdx, %rcx
shrq $0xa, %rcx
leaq 0x7355(%rip), %rsi      # 0x16e8f
xorl %eax, %eax
callq 0x3340
jmp 0xfb72
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 0xf567
addq $0xa48, %rsp            # imm = 0xA48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd465(%rip), %rax      # 0x1cff0
movq (%rax), %rdi
movl (%r14), %edx
subl 0x18(%rsp), %edx
leaq 0x72e5(%rip), %rsi      # 0x16e81
xorl %eax, %eax
callq 0x3340
jmp 0xf912
leaq 0x7427(%rip), %rdi      # 0x16fd6
leaq 0x721e(%rip), %rsi      # 0x16dd4
leaq 0x730a(%rip), %rcx      # 0x16ec7
movl $0x140, %edx            # imm = 0x140
callq 0x3220
leaq 0x73d7(%rip), %rdi      # 0x16fa5
leaq 0x71ff(%rip), %rsi      # 0x16dd4
leaq 0x72eb(%rip), %rcx      # 0x16ec7
movl $0x13e, %edx            # imm = 0x13E
callq 0x3220
leaq 0x73d5(%rip), %rdi      # 0x16fc2
leaq 0x71e0(%rip), %rsi      # 0x16dd4
leaq 0x72cc(%rip), %rcx      # 0x16ec7
movl $0x13f, %edx            # imm = 0x13F
callq 0x3220
leaq 0x7382(%rip), %rdi      # 0x16f8e
leaq 0x71c1(%rip), %rsi      # 0x16dd4
leaq 0x72ad(%rip), %rcx      # 0x16ec7
movl $0x138, %edx            # imm = 0x138
callq 0x3220
leaq 0x728f(%rip), %rdi      # 0x16eba
leaq 0x71a2(%rip), %rsi      # 0x16dd4
leaq 0x728e(%rip), %rcx      # 0x16ec7
movl $0x137, %edx            # imm = 0x137
callq 0x3220