// File: /workspace/github_c_makefile_star2_O0/Joy-Division[P]tools-mgs/lodepng/lodepng.c
// Function: deflateDynamic
static unsigned deflateDynamic(ucvector* out, size_t* bp, Hash* hash,
                               const unsigned char* data, size_t datapos, size_t dataend,
                               const LodePNGCompressSettings* settings, unsigned final)
{
  unsigned error = 0;

  /*
  A block is compressed as follows: The PNG data is lz77 encoded, resulting in
  literal bytes and length/distance pairs. This is then huffman compressed with
  two huffman trees. One huffman tree is used for the lit and len values ("ll"),
  another huffman tree is used for the dist values ("d"). These two trees are
  stored using their code lengths, and to compress even more these code lengths
  are also run-length encoded and huffman compressed. This gives a huffman tree
  of code lengths "cl". The code lenghts used to describe this third tree are
  the code length code lengths ("clcl").
  */

  /*The lz77 encoded data, represented with integers since there will also be length and distance codes in it*/
  uivector lz77_encoded;
  HuffmanTree tree_ll; /*tree for lit,len values*/
  HuffmanTree tree_d; /*tree for distance codes*/
  HuffmanTree tree_cl; /*tree for encoding the code lengths representing tree_ll and tree_d*/
  uivector frequencies_ll; /*frequency of lit,len codes*/
  uivector frequencies_d; /*frequency of dist codes*/
  uivector frequencies_cl; /*frequency of code length codes*/
  uivector bitlen_lld; /*lit,len,dist code lenghts (int bits), literally (without repeat codes).*/
  uivector bitlen_lld_e; /*bitlen_lld encoded with repeat codes (this is a rudemtary run length compression)*/
  /*bitlen_cl is the code length code lengths ("clcl"). The bit lengths of codes to represent tree_cl
  (these are written as is in the file, it would be crazy to compress these using yet another huffman
  tree that needs to be represented by yet another set of code lengths)*/
  uivector bitlen_cl;
  size_t datasize = dataend - datapos;

  /*
  Due to the huffman compression of huffman tree representations ("two levels"), there are some anologies:
  bitlen_lld is to tree_cl what data is to tree_ll and tree_d.
  bitlen_lld_e is to bitlen_lld what lz77_encoded is to data.
  bitlen_cl is to bitlen_lld_e what bitlen_lld is to lz77_encoded.
  */

  unsigned BFINAL = final;
  size_t numcodes_ll, numcodes_d, i;
  unsigned HLIT, HDIST, HCLEN;

  uivector_init(&lz77_encoded);
  HuffmanTree_init(&tree_ll);
  HuffmanTree_init(&tree_d);
  HuffmanTree_init(&tree_cl);
  uivector_init(&frequencies_ll);
  uivector_init(&frequencies_d);
  uivector_init(&frequencies_cl);
  uivector_init(&bitlen_lld);
  uivector_init(&bitlen_lld_e);
  uivector_init(&bitlen_cl);

  /*This while loop never loops due to a break at the end, it is here to
  allow breaking out of it to the cleanup phase on error conditions.*/
  while(!error)
  {
    if(settings->use_lz77)
    {
      error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize,
                         settings->minmatch, settings->nicematch, settings->lazymatching);
      if(error) break;
    }
    else
    {
      if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83 /*alloc fail*/);
      for(i = datapos; i < dataend; ++i) lz77_encoded.data[i - datapos] = data[i]; /*no LZ77, but still will be Huffman compressed*/
    }

    if(!uivector_resizev(&frequencies_ll, 286, 0)) ERROR_BREAK(83 /*alloc fail*/);
    if(!uivector_resizev(&frequencies_d, 30, 0)) ERROR_BREAK(83 /*alloc fail*/);

    /*Count the frequencies of lit, len and dist codes*/
    for(i = 0; i != lz77_encoded.size; ++i)
    {
      unsigned symbol = lz77_encoded.data[i];
      ++frequencies_ll.data[symbol];
      if(symbol > 256)
      {
        unsigned dist = lz77_encoded.data[i + 2];
        ++frequencies_d.data[dist];
        i += 3;
      }
    }
    frequencies_ll.data[256] = 1; /*there will be exactly 1 end code, at the end of the block*/

    /*Make both huffman trees, one for the lit and len codes, one for the dist codes*/
    error = HuffmanTree_makeFromFrequencies(&tree_ll, frequencies_ll.data, 257, frequencies_ll.size, 15);
    if(error) break;
    /*2, not 1, is chosen for mincodes: some buggy PNG decoders require at least 2 symbols in the dist tree*/
    error = HuffmanTree_makeFromFrequencies(&tree_d, frequencies_d.data, 2, frequencies_d.size, 15);
    if(error) break;

    numcodes_ll = tree_ll.numcodes; if(numcodes_ll > 286) numcodes_ll = 286;
    numcodes_d = tree_d.numcodes; if(numcodes_d > 30) numcodes_d = 30;
    /*store the code lengths of both generated trees in bitlen_lld*/
    for(i = 0; i != numcodes_ll; ++i) uivector_push_back(&bitlen_lld, HuffmanTree_getLength(&tree_ll, (unsigned)i));
    for(i = 0; i != numcodes_d; ++i) uivector_push_back(&bitlen_lld, HuffmanTree_getLength(&tree_d, (unsigned)i));

    /*run-length compress bitlen_ldd into bitlen_lld_e by using repeat codes 16 (copy length 3-6 times),
    17 (3-10 zeroes), 18 (11-138 zeroes)*/
    for(i = 0; i != (unsigned)bitlen_lld.size; ++i)
    {
      unsigned j = 0; /*amount of repititions*/
      while(i + j + 1 < (unsigned)bitlen_lld.size && bitlen_lld.data[i + j + 1] == bitlen_lld.data[i]) ++j;

      if(bitlen_lld.data[i] == 0 && j >= 2) /*repeat code for zeroes*/
      {
        ++j; /*include the first zero*/
        if(j <= 10) /*repeat code 17 supports max 10 zeroes*/
        {
          uivector_push_back(&bitlen_lld_e, 17);
          uivector_push_back(&bitlen_lld_e, j - 3);
        }
        else /*repeat code 18 supports max 138 zeroes*/
        {
          if(j > 138) j = 138;
          uivector_push_back(&bitlen_lld_e, 18);
          uivector_push_back(&bitlen_lld_e, j - 11);
        }
        i += (j - 1);
      }
      else if(j >= 3) /*repeat code for value other than zero*/
      {
        size_t k;
        unsigned num = j / 6, rest = j % 6;
        uivector_push_back(&bitlen_lld_e, bitlen_lld.data[i]);
        for(k = 0; k < num; ++k)
        {
          uivector_push_back(&bitlen_lld_e, 16);
          uivector_push_back(&bitlen_lld_e, 6 - 3);
        }
        if(rest >= 3)
        {
          uivector_push_back(&bitlen_lld_e, 16);
          uivector_push_back(&bitlen_lld_e, rest - 3);
        }
        else j -= rest;
        i += j;
      }
      else /*too short to benefit from repeat code*/
      {
        uivector_push_back(&bitlen_lld_e, bitlen_lld.data[i]);
      }
    }

    /*generate tree_cl, the huffmantree of huffmantrees*/

    if(!uivector_resizev(&frequencies_cl, NUM_CODE_LENGTH_CODES, 0)) ERROR_BREAK(83 /*alloc fail*/);
    for(i = 0; i != bitlen_lld_e.size; ++i)
    {
      ++frequencies_cl.data[bitlen_lld_e.data[i]];
      /*after a repeat code come the bits that specify the number of repetitions,
      those don't need to be in the frequencies_cl calculation*/
      if(bitlen_lld_e.data[i] >= 16) ++i;
    }

    error = HuffmanTree_makeFromFrequencies(&tree_cl, frequencies_cl.data,
                                            frequencies_cl.size, frequencies_cl.size, 7);
    if(error) break;

    if(!uivector_resize(&bitlen_cl, tree_cl.numcodes)) ERROR_BREAK(83 /*alloc fail*/);
    for(i = 0; i != tree_cl.numcodes; ++i)
    {
      /*lenghts of code length tree is in the order as specified by deflate*/
      bitlen_cl.data[i] = HuffmanTree_getLength(&tree_cl, CLCL_ORDER[i]);
    }
    while(bitlen_cl.data[bitlen_cl.size - 1] == 0 && bitlen_cl.size > 4)
    {
      /*remove zeros at the end, but minimum size must be 4*/
      if(!uivector_resize(&bitlen_cl, bitlen_cl.size - 1)) ERROR_BREAK(83 /*alloc fail*/);
    }
    if(error) break;

    /*
    Write everything into the output

    After the BFINAL and BTYPE, the dynamic block consists out of the following:
    - 5 bits HLIT, 5 bits HDIST, 4 bits HCLEN
    - (HCLEN+4)*3 bits code lengths of code length alphabet
    - HLIT + 257 code lenghts of lit/length alphabet (encoded using the code length
      alphabet, + possible repetition codes 16, 17, 18)
    - HDIST + 1 code lengths of distance alphabet (encoded using the code length
      alphabet, + possible repetition codes 16, 17, 18)
    - compressed data
    - 256 (end code)
    */

    /*Write block type*/
    addBitToStream(bp, out, BFINAL);
    addBitToStream(bp, out, 0); /*first bit of BTYPE "dynamic"*/
    addBitToStream(bp, out, 1); /*second bit of BTYPE "dynamic"*/

    /*write the HLIT, HDIST and HCLEN values*/
    HLIT = (unsigned)(numcodes_ll - 257);
    HDIST = (unsigned)(numcodes_d - 1);
    HCLEN = (unsigned)bitlen_cl.size - 4;
    /*trim zeroes for HCLEN. HLIT and HDIST were already trimmed at tree creation*/
    while(!bitlen_cl.data[HCLEN + 4 - 1] && HCLEN > 0) --HCLEN;
    addBitsToStream(bp, out, HLIT, 5);
    addBitsToStream(bp, out, HDIST, 5);
    addBitsToStream(bp, out, HCLEN, 4);

    /*write the code lenghts of the code length alphabet*/
    for(i = 0; i != HCLEN + 4; ++i) addBitsToStream(bp, out, bitlen_cl.data[i], 3);

    /*write the lenghts of the lit/len AND the dist alphabet*/
    for(i = 0; i != bitlen_lld_e.size; ++i)
    {
      addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_cl, bitlen_lld_e.data[i]),
                       HuffmanTree_getLength(&tree_cl, bitlen_lld_e.data[i]));
      /*extra bits of repeat codes*/
      if(bitlen_lld_e.data[i] == 16) addBitsToStream(bp, out, bitlen_lld_e.data[++i], 2);
      else if(bitlen_lld_e.data[i] == 17) addBitsToStream(bp, out, bitlen_lld_e.data[++i], 3);
      else if(bitlen_lld_e.data[i] == 18) addBitsToStream(bp, out, bitlen_lld_e.data[++i], 7);
    }

    /*write the compressed data symbols*/
    writeLZ77data(bp, out, &lz77_encoded, &tree_ll, &tree_d);
    /*error: the length of the end code 256 must be larger than 0*/
    if(HuffmanTree_getLength(&tree_ll, 256) == 0) ERROR_BREAK(64);

    /*write the end code*/
    addHuffmanSymbol(bp, out, HuffmanTree_getCode(&tree_ll, 256), HuffmanTree_getLength(&tree_ll, 256));

    break; /*end of error-while*/
  }

  /*cleanup*/
  uivector_cleanup(&lz77_encoded);
  HuffmanTree_cleanup(&tree_ll);
  HuffmanTree_cleanup(&tree_d);
  HuffmanTree_cleanup(&tree_cl);
  uivector_cleanup(&frequencies_ll);
  uivector_cleanup(&frequencies_d);
  uivector_cleanup(&frequencies_cl);
  uivector_cleanup(&bitlen_lld_e);
  uivector_cleanup(&bitlen_lld);
  uivector_cleanup(&bitlen_cl);

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
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 $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x148(%rbp)
movl 0x18(%rbp), %eax
movl %eax, -0x14c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xb750
leaq -0x70(%rbp), %rdi
callq 0xab40
leaq -0x90(%rbp), %rdi
callq 0xab40
leaq -0xb0(%rbp), %rdi
callq 0xab40
leaq -0xc8(%rbp), %rdi
callq 0xb750
leaq -0xe0(%rbp), %rdi
callq 0xb750
leaq -0xf8(%rbp), %rdi
callq 0xb750
leaq -0x110(%rbp), %rdi
callq 0xb750
leaq -0x128(%rbp), %rdi
callq 0xb750
leaq -0x140(%rbp), %rdi
callq 0xb750
cmpl $0x0, -0x34(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xc29d
jmp 0xce63
movq 0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0xc2fc
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 -0x50(%rbp), %rdi
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0xcf50
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xc2fa
jmp 0xce63
jmp 0xc36c
movq -0x148(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0xba80
cmpl $0x0, %eax
jne 0xc31d
movl $0x53, -0x34(%rbp)
jmp 0xce63
movq -0x28(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0xc36a
movq -0x20(%rbp), %rax
movq -0x168(%rbp), %rcx
movzbl (%rax,%rcx), %edx
movq -0x50(%rbp), %rax
movq -0x168(%rbp), %rcx
subq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc328
jmp 0xc36c
leaq -0xc8(%rbp), %rdi
movl $0x11e, %esi            # imm = 0x11E
xorl %edx, %edx
callq 0xb780
cmpl $0x0, %eax
jne 0xc390
movl $0x53, -0x34(%rbp)
jmp 0xce63
leaq -0xe0(%rbp), %rdi
movl $0x1e, %esi
xorl %edx, %edx
callq 0xb780
cmpl $0x0, %eax
jne 0xc3b4
movl $0x53, -0x34(%rbp)
jmp 0xce63
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0xc45c
movq -0x50(%rbp), %rax
movq -0x168(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x178(%rbp)
movq -0xc8(%rbp), %rax
movl -0x178(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
cmpl $0x100, -0x178(%rbp)    # imm = 0x100
jbe 0xc443
movq -0x50(%rbp), %rax
movq -0x168(%rbp), %rcx
movl 0x8(%rax,%rcx,4), %eax
movl %eax, -0x17c(%rbp)
movq -0xe0(%rbp), %rax
movl -0x17c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x168(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x168(%rbp)
jmp 0xc445
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc3bf
movq -0xc8(%rbp), %rax
movl $0x1, 0x400(%rax)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rcx
leaq -0x70(%rbp), %rdi
movl $0x101, %edx            # imm = 0x101
movl $0xf, %r8d
callq 0xddf0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xc49d
jmp 0xce63
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rcx
leaq -0x90(%rbp), %rdi
movl $0x2, %edx
movl $0xf, %r8d
callq 0xddf0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xc4d0
jmp 0xce63
movl -0x54(%rbp), %eax
movq %rax, -0x158(%rbp)
cmpq $0x11e, -0x158(%rbp) # imm = 0x11E
jbe 0xc4f2
movq $0x11e, -0x158(%rbp) # imm = 0x11E
movl -0x74(%rbp), %eax
movq %rax, -0x160(%rbp)
cmpq $0x1e, -0x160(%rbp)
jbe 0xc511
movq $0x1e, -0x160(%rbp)
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
cmpq -0x158(%rbp), %rax
je 0xc560
movq -0x168(%rbp), %rax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0xd860
movl %eax, %esi
leaq -0x110(%rbp), %rdi
callq 0xdad0
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc51c
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
cmpq -0x160(%rbp), %rax
je 0xc5b2
movq -0x168(%rbp), %rax
movl %eax, %esi
leaq -0x90(%rbp), %rdi
callq 0xd860
movl %eax, %esi
leaq -0x110(%rbp), %rdi
callq 0xdad0
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc56b
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq -0x108(%rbp), %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0xc857
movl $0x0, -0x180(%rbp)
movq -0x168(%rbp), %rcx
movl -0x180(%rbp), %eax
addq %rax, %rcx
addq $0x1, %rcx
movq -0x108(%rbp), %rax
movl %eax, %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x191(%rbp)
jae 0xc641
movq -0x110(%rbp), %rax
movq -0x168(%rbp), %rcx
movl -0x180(%rbp), %edx
addq %rdx, %rcx
movl 0x4(%rax,%rcx,4), %eax
movq -0x110(%rbp), %rcx
movq -0x168(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
sete %al
movb %al, -0x191(%rbp)
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0xc64d
jmp 0xc65e
movl -0x180(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x180(%rbp)
jmp 0xc5e0
movq -0x110(%rbp), %rax
movq -0x168(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xc71d
cmpl $0x2, -0x180(%rbp)
jb 0xc71d
movl -0x180(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x180(%rbp)
cmpl $0xa, -0x180(%rbp)
ja 0xc6c3
leaq -0x128(%rbp), %rdi
movl $0x11, %esi
callq 0xdad0
movl -0x180(%rbp), %esi
subl $0x3, %esi
leaq -0x128(%rbp), %rdi
callq 0xdad0
jmp 0xc6ff
cmpl $0x8a, -0x180(%rbp)
jbe 0xc6d9
movl $0x8a, -0x180(%rbp)
leaq -0x128(%rbp), %rdi
movl $0x12, %esi
callq 0xdad0
movl -0x180(%rbp), %esi
subl $0xb, %esi
leaq -0x128(%rbp), %rdi
callq 0xdad0
movl -0x180(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
addq -0x168(%rbp), %rax
movq %rax, -0x168(%rbp)
jmp 0xc83e
cmpl $0x3, -0x180(%rbp)
jb 0xc81f
movl -0x180(%rbp), %eax
movl $0x6, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x18c(%rbp)
movl -0x180(%rbp), %eax
movl $0x6, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x190(%rbp)
movq -0x110(%rbp), %rax
movq -0x168(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x128(%rbp), %rdi
callq 0xdad0
movq $0x0, -0x188(%rbp)
movq -0x188(%rbp), %rax
movl -0x18c(%rbp), %ecx
cmpq %rcx, %rax
jae 0xc7c4
leaq -0x128(%rbp), %rdi
movl $0x10, %esi
callq 0xdad0
leaq -0x128(%rbp), %rdi
movl $0x3, %esi
callq 0xdad0
movq -0x188(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x188(%rbp)
jmp 0xc77c
cmpl $0x3, -0x190(%rbp)
jb 0xc7f5
leaq -0x128(%rbp), %rdi
movl $0x10, %esi
callq 0xdad0
movl -0x190(%rbp), %esi
subl $0x3, %esi
leaq -0x128(%rbp), %rdi
callq 0xdad0
jmp 0xc809
movl -0x190(%rbp), %ecx
movl -0x180(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x180(%rbp)
movl -0x180(%rbp), %eax
addq -0x168(%rbp), %rax
movq %rax, -0x168(%rbp)
jmp 0xc83c
movq -0x110(%rbp), %rax
movq -0x168(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x128(%rbp), %rdi
callq 0xdad0
jmp 0xc83e
jmp 0xc840
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc5bd
leaq -0xf8(%rbp), %rdi
movl $0x13, %esi
xorl %edx, %edx
callq 0xb780
cmpl $0x0, %eax
jne 0xc87b
movl $0x53, -0x34(%rbp)
jmp 0xce63
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
cmpq -0x120(%rbp), %rax
je 0xc8f3
movq -0xf8(%rbp), %rax
movq -0x128(%rbp), %rcx
movq -0x168(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
cmpl $0x10, (%rax,%rcx,4)
jb 0xc8dd
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc8df
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc886
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
movq -0xf0(%rbp), %rcx
leaq -0xb0(%rbp), %rdi
movl $0x7, %r8d
callq 0xddf0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xc928
jmp 0xce63
movl -0x94(%rbp), %eax
movl %eax, %esi
leaq -0x140(%rbp), %rdi
callq 0xba80
cmpl $0x0, %eax
jne 0xc94d
movl $0x53, -0x34(%rbp)
jmp 0xce63
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
movl -0x94(%rbp), %ecx
cmpq %rcx, %rax
je 0xc9ae
movq -0x168(%rbp), %rcx
leaq 0x7ac8(%rip), %rax      # 0x14440
movl (%rax,%rcx,4), %esi
leaq -0xb0(%rbp), %rdi
callq 0xd860
movl %eax, %edx
movq -0x140(%rbp), %rax
movq -0x168(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xc958
jmp 0xc9b0
movq -0x140(%rbp), %rcx
movq -0x138(%rbp), %rdx
subq $0x1, %rdx
xorl %eax, %eax
cmpl $0x0, (%rcx,%rdx,4)
movb %al, -0x192(%rbp)
jne 0xc9e1
cmpq $0x4, -0x138(%rbp)
seta %al
movb %al, -0x192(%rbp)
movb -0x192(%rbp), %al
testb $0x1, %al
jne 0xc9ed
jmp 0xca14
movq -0x138(%rbp), %rsi
subq $0x1, %rsi
leaq -0x140(%rbp), %rdi
callq 0xba80
cmpl $0x0, %eax
jne 0xca12
movl $0x53, -0x34(%rbp)
jmp 0xca14
jmp 0xc9b0
cmpl $0x0, -0x34(%rbp)
je 0xca1f
jmp 0xce63
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x7, %rax
cmpq $0x0, %rax
jne 0xca3b
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2660
movl -0x14c(%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 0xca96
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
movq (%rax), %rax
andq $0x7, %rax
cmpq $0x0, %rax
jne 0xcaed
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 -0x158(%rbp), %rax
subq $0x101, %rax            # imm = 0x101
movl %eax, -0x16c(%rbp)
movq -0x160(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x170(%rbp)
movq -0x138(%rbp), %rax
subl $0x4, %eax
movl %eax, -0x174(%rbp)
movq -0x140(%rbp), %rcx
movl -0x174(%rbp), %eax
addl $0x4, %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
xorl %eax, %eax
cmpl $0x0, (%rcx,%rdx,4)
movb %al, -0x193(%rbp)
jne 0xcb94
cmpl $0x0, -0x174(%rbp)
seta %al
movb %al, -0x193(%rbp)
movb -0x193(%rbp), %al
testb $0x1, %al
jne 0xcba0
jmp 0xcbb1
movl -0x174(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x174(%rbp)
jmp 0xcb5f
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0x16c(%rbp), %edx
movl $0x5, %ecx
callq 0xdc90
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0x170(%rbp), %edx
movl $0x5, %ecx
callq 0xdc90
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0x174(%rbp), %edx
movl $0x4, %ecx
callq 0xdc90
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
movl -0x174(%rbp), %ecx
addl $0x4, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0xcc52
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x140(%rbp), %rax
movq -0x168(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl $0x3, %ecx
callq 0xdc90
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xcc04
movq $0x0, -0x168(%rbp)
movq -0x168(%rbp), %rax
cmpq -0x120(%rbp), %rax
je 0xcdd8
movq -0x10(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0xb0(%rbp), %rdi
callq 0xd840
movl %eax, -0x198(%rbp)
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0xb0(%rbp), %rdi
callq 0xd860
movq -0x1a8(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
movl -0x198(%rbp), %edx
movl %eax, %ecx
callq 0xd800
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
cmpl $0x10, (%rax,%rcx,4)
jne 0xcd2d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x168(%rbp)
movl 0x4(%rax,%rcx,4), %edx
movl $0x2, %ecx
callq 0xdc90
jmp 0xcdbf
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
cmpl $0x11, (%rax,%rcx,4)
jne 0xcd75
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x168(%rbp)
movl 0x4(%rax,%rcx,4), %edx
movl $0x3, %ecx
callq 0xdc90
jmp 0xcdbd
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
cmpl $0x12, (%rax,%rcx,4)
jne 0xcdbb
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x128(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x168(%rbp)
movl 0x4(%rax,%rcx,4), %edx
movl $0x7, %ecx
callq 0xdc90
jmp 0xcdbd
jmp 0xcdbf
jmp 0xcdc1
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
jmp 0xcc5d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x70(%rbp), %rcx
leaq -0x90(%rbp), %r8
callq 0xd650
leaq -0x70(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xd860
cmpl $0x0, %eax
jne 0xce10
movl $0x40, -0x34(%rbp)
jmp 0xce63
movq -0x10(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xd840
movl %eax, -0x1ac(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xd860
movq -0x1c0(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
movl -0x1ac(%rbp), %edx
movl %eax, %ecx
callq 0xd800
leaq -0x50(%rbp), %rdi
callq 0xb800
leaq -0x70(%rbp), %rdi
callq 0xb300
leaq -0x90(%rbp), %rdi
callq 0xb300
leaq -0xb0(%rbp), %rdi
callq 0xb300
leaq -0xc8(%rbp), %rdi
callq 0xb800
leaq -0xe0(%rbp), %rdi
callq 0xb800
leaq -0xf8(%rbp), %rdi
callq 0xb800
leaq -0x128(%rbp), %rdi
callq 0xb800
leaq -0x110(%rbp), %rdi
callq 0xb800
leaq -0x140(%rbp), %rdi
callq 0xb800
movl -0x34(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopw %cs:(%rax,%rax)