// File: /workspace/github_c_makefile_star2_O0/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: deflateFixed
static unsigned deflateFixed(LodePNGBitWriter* writer, Hash* hash,
                             const unsigned char* data,
                             size_t datapos, size_t dataend,
                             const LodePNGCompressSettings* settings, unsigned final) {
  HuffmanTree tree_ll; /*tree for literal values and length codes*/
  HuffmanTree tree_d; /*tree for distance codes*/

  unsigned BFINAL = final;
  unsigned error = 0;
  size_t i;

  HuffmanTree_init(&tree_ll);
  HuffmanTree_init(&tree_d);

  error = generateFixedLitLenTree(&tree_ll);
  if(!error) error = generateFixedDistanceTree(&tree_d);

  if(!error) {
    writeBits(writer, BFINAL, 1);
    writeBits(writer, 1, 1); /*first bit of BTYPE*/
    writeBits(writer, 0, 1); /*second bit of BTYPE*/

    if(settings->use_lz77) /*LZ77 encoded*/ {
      uivector lz77_encoded;
      uivector_init(&lz77_encoded);
      error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize,
                         settings->minmatch, settings->nicematch, settings->lazymatching);
      if(!error) writeLZ77data(writer, &lz77_encoded, &tree_ll, &tree_d);
      uivector_cleanup(&lz77_encoded);
    } else /*no LZ77, but still will be Huffman compressed*/ {
      for(i = datapos; i < dataend; ++i) {
        writeBitsReversed(writer, tree_ll.codes[data[i]], tree_ll.lengths[data[i]]);
      }
    }
    /*add END code*/
    if(!error) writeBitsReversed(writer,tree_ll.codes[256], tree_ll.lengths[256]);
  }

  /*cleanup*/
  HuffmanTree_cleanup(&tree_ll);
  HuffmanTree_cleanup(&tree_d);

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl 0x10(%rbp), %eax
movl %eax, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x10b50
leaq -0x80(%rbp), %rdi
callq 0x10b50
leaq -0x58(%rbp), %rdi
callq 0x11240
movl %eax, -0x88(%rbp)
cmpl $0x0, -0x88(%rbp)
jne 0x12082
leaq -0x80(%rbp), %rdi
callq 0x11350
movl %eax, -0x88(%rbp)
cmpl $0x0, -0x88(%rbp)
jne 0x121ec
movq -0x8(%rbp), %rdi
movl -0x84(%rbp), %esi
movl $0x1, %edx
callq 0x12e90
movq -0x8(%rbp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x12e90
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x12e90
movq -0x30(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x1215d
leaq -0xa8(%rbp), %rdi
callq 0x13010
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
movl 0xc(%rax), %r11d
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r10d
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
leaq -0xa8(%rbp), %rdi
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x13040
movl %eax, -0x88(%rbp)
cmpl $0x0, -0x88(%rbp)
jne 0x1214f
movq -0x8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x58(%rbp), %rdx
leaq -0x80(%rbp), %rcx
callq 0x13740
leaq -0xa8(%rbp), %rdi
callq 0x138b0
jmp 0x121c2
movq -0x20(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x121c0
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x90(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %esi
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x90(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, %edx
callq 0x13900
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x12168
jmp 0x121c2
cmpl $0x0, -0x88(%rbp)
jne 0x121ea
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rax
movl 0x400(%rax), %esi
movq -0x50(%rbp), %rax
movl 0x400(%rax), %eax
movl %eax, %edx
callq 0x13900
jmp 0x121ec
leaq -0x58(%rbp), %rdi
callq 0x111f0
leaq -0x80(%rbp), %rdi
callq 0x111f0
movl -0x88(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)