// File: /workspace/github_c_makefile_star2_O0/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: deflateFixed
static unsigned deflateFixed(ucvector* out, size_t* bp, 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);

  generateFixedLitLenTree(&tree_ll);
  generateFixedDistanceTree(&tree_d);

  addBitToStream(bp, out, BFINAL);
  addBitToStream(bp, out, 1); /*first bit of BTYPE*/
  addBitToStream(bp, out, 0); /*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(bp, out, &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)
    {
      addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, data[i]), HuffmanTree_getLength(&tree_ll, data[i]));
    }
  }
  /*add END code*/
  if(!error) addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, 256), HuffmanTree_getLength(&tree_ll, 256));

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

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl 0x18(%rbp), %eax
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)
movl 0x18(%rbp), %eax
movl %eax, -0x74(%rbp)
movl $0x0, -0x78(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xab40
leaq -0x70(%rbp), %rdi
callq 0xab40
leaq -0x50(%rbp), %rdi
callq 0xb340
leaq -0x70(%rbp), %rdi
callq 0xb450
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
cmpq $0x0, %rax
jne 0xbf47
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2660
movl -0x74(%rbp), %esi
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
movl %eax, %ecx
shll %cl, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
cmpq $0x0, %rax
jne 0xbf9f
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2660
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
movl %eax, %ecx
movl $0x1, %esi
shll %cl, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
cmpq $0x0, %rax
jne 0xbff9
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2660
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
movl %eax, %ecx
xorl %esi, %esi
shll %cl, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0xc0cc
leaq -0x98(%rbp), %rdi
callq 0xb750
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq 0x10(%rbp), %rax
movl 0x8(%rax), %r9d
movq 0x10(%rbp), %rax
movl 0xc(%rax), %r11d
movq 0x10(%rbp), %rax
movl 0x10(%rax), %r10d
movq 0x10(%rbp), %rax
movl 0x14(%rax), %eax
leaq -0x98(%rbp), %rdi
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0xcf50
movl %eax, -0x78(%rbp)
cmpl $0x0, -0x78(%rbp)
jne 0xc0bb
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x98(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq -0x70(%rbp), %r8
callq 0xd650
leaq -0x98(%rbp), %rdi
callq 0xb800
jmp 0xc14f
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0xc14d
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %esi
leaq -0x50(%rbp), %rdi
callq 0xd840
movl %eax, -0x9c(%rbp)
movq -0x20(%rbp), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %esi
leaq -0x50(%rbp), %rdi
callq 0xd860
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movl -0x9c(%rbp), %edx
movl %eax, %ecx
callq 0xd800
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0xc0d4
jmp 0xc14f
cmpl $0x0, -0x78(%rbp)
jne 0xc1a8
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xd840
movl %eax, -0xb4(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xd860
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movl -0xb4(%rbp), %edx
movl %eax, %ecx
callq 0xd800
leaq -0x50(%rbp), %rdi
callq 0xb300
leaq -0x70(%rbp), %rdi
callq 0xb300
movl -0x78(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)