// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: deflateDynamic(ucvector*, unsigned char const*, unsigned long, LodeZlib_DeflateSettings const*)
static unsigned deflateDynamic(ucvector* out, const unsigned char* data, size_t datasize, const LodeZlib_DeflateSettings* settings)
{
  /*
  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)
  */
  
  unsigned error = 0;
  
  uivector lz77_encoded;
  HuffmanTree codes; /*tree for literal values and length codes*/
  HuffmanTree codesD; /*tree for distance codes*/
  HuffmanTree codelengthcodes;
  uivector frequencies;
  uivector frequenciesD;
  uivector amounts; /*the amounts in the "normal" order*/
  uivector lldl;
  uivector lldll; /*lit/len & dist code lenghts*/
  uivector clcls;
  
  unsigned BFINAL = 1; /*make only one block... the first and final one*/
  size_t numcodes, numcodesD, i, bp = 0; /*the bit pointer*/
  unsigned HLIT, HDIST, HCLEN;
  
  uivector_init(&lz77_encoded);
  HuffmanTree_init(&codes);
  HuffmanTree_init(&codesD);
  HuffmanTree_init(&codelengthcodes);
  uivector_init(&frequencies);
  uivector_init(&frequenciesD);
  uivector_init(&amounts);
  uivector_init(&lldl);
  uivector_init(&lldll);
  uivector_init(&clcls);
  
  while(!error) /*the goto-avoiding while construct: break out to go to the cleanup phase, a break at the end makes sure the while is never repeated*/
  {
    if(settings->useLZ77)
    {
      error = encodeLZ77(&lz77_encoded, data, datasize, settings->windowSize); /*LZ77 encoded*/
      if(error) break;
    }
    else
    {
      if(!uivector_resize(&lz77_encoded, datasize)) { error = 9923; break; }
      for(i = 0; i < datasize; i++) lz77_encoded.data[i] = data[i]; /*no LZ77, but still will be Huffman compressed*/
    }
    
    if(!uivector_resizev(&frequencies, 286, 0)) { error = 9924; break; }
    if(!uivector_resizev(&frequenciesD, 30, 0)) { error = 9925; break; }
    for(i = 0; i < lz77_encoded.size; i++)
    {
      unsigned symbol = lz77_encoded.data[i];
      frequencies.data[symbol]++;
      if(symbol > 256)
      {
        unsigned dist = lz77_encoded.data[i + 2];
        frequenciesD.data[dist]++;
        i += 3;
      }
    }
    frequencies.data[256] = 1; /*there will be exactly 1 end code, at the end of the block*/
    
    error = HuffmanTree_makeFromFrequencies(&codes, frequencies.data, frequencies.size, 15);
    if(error) break;
    error = HuffmanTree_makeFromFrequencies(&codesD, frequenciesD.data, frequenciesD.size, 15);
    if(error) break;
    
    addBitToStream(&bp, out, BFINAL);
    addBitToStream(&bp, out, 0); /*first bit of BTYPE "dynamic"*/
    addBitToStream(&bp, out, 1); /*second bit of BTYPE "dynamic"*/
  
    numcodes = codes.numcodes; if(numcodes > 286) numcodes = 286;
    numcodesD = codesD.numcodes; if(numcodesD > 30) numcodesD = 30;
    for(i = 0; i < numcodes; i++) uivector_push_back(&lldll, HuffmanTree_getLength(&codes, (unsigned)i));
    for(i = 0; i < numcodesD; i++) uivector_push_back(&lldll, HuffmanTree_getLength(&codesD, (unsigned)i));
    
    /*make lldl smaller by using repeat codes 16 (copy length 3-6 times), 17 (3-10 zeroes), 18 (11-138 zeroes)*/
    for(i = 0; i < (unsigned)lldll.size; i++)
    {
      unsigned j = 0;
      while(i + j + 1 < (unsigned)lldll.size && lldll.data[i + j + 1] == lldll.data[i]) j++;
      
      if(lldll.data[i] == 0 && j >= 2)
      {
        j++; /*include the first zero*/
        if(j <= 10) { uivector_push_back(&lldl, 17); uivector_push_back(&lldl, j - 3); }
        else
        {
          if(j > 138) j = 138;
          uivector_push_back(&lldl, 18); uivector_push_back(&lldl, j - 11);
        }
        i += (j - 1);
      }
      else if(j >= 3)
      {
        size_t k;
        unsigned num = j / 6, rest = j % 6;
        uivector_push_back(&lldl, lldll.data[i]);
        for(k = 0; k < num; k++) { uivector_push_back(&lldl, 16); uivector_push_back(&lldl,    6 - 3); }
        if(rest >= 3)            { uivector_push_back(&lldl, 16); uivector_push_back(&lldl, rest - 3); }
        else j -= rest;
        i += j;
      }
      else uivector_push_back(&lldl, lldll.data[i]);
    }
    
    /*generate huffmantree for the length codes of lit/len and dist codes*/
    if(!uivector_resizev(&amounts, 19, 0)) { error = 9926; break; } /*16 possible lengths (0-15) and 3 repeat codes (16, 17 and 18)*/
    for(i = 0; i < lldl.size; i++)
    {
      amounts.data[lldl.data[i]]++;
      if(lldl.data[i] >= 16) i++; /*after a repeat code come the bits that specify the amount, those don't need to be in the amounts calculation*/
    }
    
    error = HuffmanTree_makeFromFrequencies(&codelengthcodes, amounts.data, amounts.size, 7);
    if(error) break;
    
    if(!uivector_resize(&clcls, 19)) { error = 9927; break; }
    for(i = 0; i < 19; i++) clcls.data[i] = HuffmanTree_getLength(&codelengthcodes, CLCL[i]); /*lenghts of code length tree is in the order as specified by deflate*/
    while(clcls.data[clcls.size - 1] == 0 && clcls.size > 4)
    {
      if(!uivector_resize(&clcls, clcls.size - 1)) { error = 9928; break; } /*remove zeros at the end, but minimum size must be 4*/
    }
    if(error) break;
    
    /*write the HLIT, HDIST and HCLEN values*/
    HLIT = (unsigned)(numcodes - 257);
    HDIST = (unsigned)(numcodesD - 1);
    HCLEN = (unsigned)clcls.size - 4;
    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, clcls.data[i], 3);
  
    /*write the lenghts of the lit/len AND the dist alphabet*/
    for(i = 0; i < lldl.size; i++)
    {
      addHuffmanSymbol(&bp, out, HuffmanTree_getCode(&codelengthcodes, lldl.data[i]), HuffmanTree_getLength(&codelengthcodes, lldl.data[i]));
      /*extra bits of repeat codes*/
      if(lldl.data[i] == 16) addBitsToStream(&bp, out, lldl.data[++i], 2);
      else if(lldl.data[i] == 17) addBitsToStream(&bp, out, lldl.data[++i], 3);
      else if(lldl.data[i] == 18) addBitsToStream(&bp, out, lldl.data[++i], 7);
    }
    
    /*write the compressed data symbols*/
    writeLZ77data(&bp, out, &lz77_encoded, &codes, &codesD);
    if(HuffmanTree_getLength(&codes, 256) == 0) { error = 64; break; } /*the length of the end code 256 must be larger than 0*/
    addHuffmanSymbol(&bp, out, HuffmanTree_getCode(&codes, 256), HuffmanTree_getLength(&codes, 256)); /*end code*/
    
    break; /*end of error-while*/
  }
  
  /*cleanup*/
  uivector_cleanup(&lz77_encoded);
  HuffmanTree_cleanup(&codes);
  HuffmanTree_cleanup(&codesD);
  HuffmanTree_cleanup(&codelengthcodes);
  uivector_cleanup(&frequencies);
  uivector_cleanup(&frequenciesD);
  uivector_cleanup(&amounts);
  uivector_cleanup(&lldl);
  uivector_cleanup(&lldll);
  uivector_cleanup(&clcls);
  
  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x1, -0x1c4(%rbp)
movq $0x0, -0x1e8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2d6a0
leaq -0x90(%rbp), %rdi
callq 0x2cf70
leaq -0xe0(%rbp), %rdi
callq 0x2cf70
leaq -0x130(%rbp), %rdi
callq 0x2cf70
leaq -0x148(%rbp), %rdi
callq 0x2d6a0
leaq -0x160(%rbp), %rdi
callq 0x2d6a0
leaq -0x178(%rbp), %rdi
callq 0x2d6a0
leaq -0x190(%rbp), %rdi
callq 0x2d6a0
leaq -0x1a8(%rbp), %rdi
callq 0x2d6a0
leaq -0x1c0(%rbp), %rdi
callq 0x2d6a0
cmpl $0x0, -0x24(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x24a0e
jmp 0x2547a
movq -0x20(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x24a40
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
leaq -0x40(%rbp), %rdi
callq 0x2df80
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x24a3e
jmp 0x2547a
jmp 0x24aa9
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2d870
cmpl $0x0, %eax
jne 0x24a5e
movl $0x26c3, -0x24(%rbp)    # imm = 0x26C3
jmp 0x2547a
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x24aa7
movq -0x10(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movzbl (%rax,%rcx), %edx
movq -0x40(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24a69
jmp 0x24aa9
leaq -0x148(%rbp), %rdi
movl $0x11e, %esi            # imm = 0x11E
xorl %edx, %edx
callq 0x2dbb0
cmpl $0x0, %eax
jne 0x24acd
movl $0x26c4, -0x24(%rbp)    # imm = 0x26C4
jmp 0x2547a
leaq -0x160(%rbp), %rdi
movl $0x1e, %esi
xorl %edx, %edx
callq 0x2dbb0
cmpl $0x0, %eax
jne 0x24af1
movl $0x26c5, -0x24(%rbp)    # imm = 0x26C5
jmp 0x2547a
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x24b99
movq -0x40(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1f8(%rbp)
movq -0x148(%rbp), %rax
movl -0x1f8(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
cmpl $0x100, -0x1f8(%rbp)    # imm = 0x100
jbe 0x24b80
movq -0x40(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl 0x8(%rax,%rcx,4), %eax
movl %eax, -0x1fc(%rbp)
movq -0x160(%rbp), %rax
movl -0x1fc(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x1e0(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24b82
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24afc
movq -0x148(%rbp), %rax
movl $0x1, 0x400(%rax)
movq -0x148(%rbp), %rsi
movq -0x140(%rbp), %rdx
leaq -0x90(%rbp), %rdi
movl $0xf, %ecx
callq 0x2eb60
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x24bd7
jmp 0x2547a
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
movl $0xf, %ecx
callq 0x2eb60
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x24c04
jmp 0x2547a
movq -0x8(%rbp), %rsi
movl -0x1c4(%rbp), %eax
leaq -0x1e8(%rbp), %rdi
movzbl %al, %edx
callq 0x2df00
movq -0x8(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
xorl %edx, %edx
callq 0x2df00
movq -0x8(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
movl $0x1, %edx
callq 0x2df00
movl -0x44(%rbp), %eax
movq %rax, -0x1d0(%rbp)
cmpq $0x11e, -0x1d0(%rbp) # imm = 0x11E
jbe 0x24c66
movq $0x11e, -0x1d0(%rbp) # imm = 0x11E
movl -0x94(%rbp), %eax
movq %rax, -0x1d8(%rbp)
cmpq $0x1e, -0x1d8(%rbp)
jbe 0x24c88
movq $0x1e, -0x1d8(%rbp)
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jae 0x24cda
movq -0x1e0(%rbp), %rax
movl %eax, %esi
leaq -0x90(%rbp), %rdi
callq 0x2e690
movl %eax, %esi
leaq -0x1a8(%rbp), %rdi
callq 0x2e870
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24c93
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
cmpq -0x1d8(%rbp), %rax
jae 0x24d2c
movq -0x1e0(%rbp), %rax
movl %eax, %esi
leaq -0xe0(%rbp), %rdi
callq 0x2e690
movl %eax, %esi
leaq -0x1a8(%rbp), %rdi
callq 0x2e870
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24ce5
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movq -0x1a0(%rbp), %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x24fd1
movl $0x0, -0x200(%rbp)
movq -0x1e0(%rbp), %rcx
movl -0x200(%rbp), %eax
addq %rax, %rcx
addq $0x1, %rcx
movq -0x1a0(%rbp), %rax
movl %eax, %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x211(%rbp)
jae 0x24dbb
movq -0x1a8(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl -0x200(%rbp), %edx
addq %rdx, %rcx
movl 0x4(%rax,%rcx,4), %eax
movq -0x1a8(%rbp), %rcx
movq -0x1e0(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
sete %al
movb %al, -0x211(%rbp)
movb -0x211(%rbp), %al
testb $0x1, %al
jne 0x24dc7
jmp 0x24dd8
movl -0x200(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x200(%rbp)
jmp 0x24d5a
movq -0x1a8(%rbp), %rax
movq -0x1e0(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x24e97
cmpl $0x2, -0x200(%rbp)
jb 0x24e97
movl -0x200(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x200(%rbp)
cmpl $0xa, -0x200(%rbp)
ja 0x24e3d
leaq -0x190(%rbp), %rdi
movl $0x11, %esi
callq 0x2e870
movl -0x200(%rbp), %esi
subl $0x3, %esi
leaq -0x190(%rbp), %rdi
callq 0x2e870
jmp 0x24e79
cmpl $0x8a, -0x200(%rbp)
jbe 0x24e53
movl $0x8a, -0x200(%rbp)
leaq -0x190(%rbp), %rdi
movl $0x12, %esi
callq 0x2e870
movl -0x200(%rbp), %esi
subl $0xb, %esi
leaq -0x190(%rbp), %rdi
callq 0x2e870
movl -0x200(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
addq -0x1e0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24fb8
cmpl $0x3, -0x200(%rbp)
jb 0x24f99
movl -0x200(%rbp), %eax
movl $0x6, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x20c(%rbp)
movl -0x200(%rbp), %eax
movl $0x6, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x210(%rbp)
movq -0x1a8(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x190(%rbp), %rdi
callq 0x2e870
movq $0x0, -0x208(%rbp)
movq -0x208(%rbp), %rax
movl -0x20c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x24f3e
leaq -0x190(%rbp), %rdi
movl $0x10, %esi
callq 0x2e870
leaq -0x190(%rbp), %rdi
movl $0x3, %esi
callq 0x2e870
movq -0x208(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x208(%rbp)
jmp 0x24ef6
cmpl $0x3, -0x210(%rbp)
jb 0x24f6f
leaq -0x190(%rbp), %rdi
movl $0x10, %esi
callq 0x2e870
movl -0x210(%rbp), %esi
subl $0x3, %esi
leaq -0x190(%rbp), %rdi
callq 0x2e870
jmp 0x24f83
movl -0x210(%rbp), %ecx
movl -0x200(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x200(%rbp)
movl -0x200(%rbp), %eax
addq -0x1e0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24fb6
movq -0x1a8(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x190(%rbp), %rdi
callq 0x2e870
jmp 0x24fb8
jmp 0x24fba
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x24d37
leaq -0x178(%rbp), %rdi
movl $0x13, %esi
xorl %edx, %edx
callq 0x2dbb0
cmpl $0x0, %eax
jne 0x24ff5
movl $0x26c6, -0x24(%rbp)    # imm = 0x26C6
jmp 0x2547a
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
cmpq -0x188(%rbp), %rax
jae 0x2506d
movq -0x178(%rbp), %rax
movq -0x190(%rbp), %rcx
movq -0x1e0(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
cmpl $0x10, (%rax,%rcx,4)
jb 0x25057
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x25059
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x25000
movq -0x178(%rbp), %rsi
movq -0x170(%rbp), %rdx
leaq -0x130(%rbp), %rdi
movl $0x7, %ecx
callq 0x2eb60
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x2509a
jmp 0x2547a
leaq -0x1c0(%rbp), %rdi
movl $0x13, %esi
callq 0x2d870
cmpl $0x0, %eax
jne 0x250bc
movl $0x26c7, -0x24(%rbp)    # imm = 0x26C7
jmp 0x2547a
movq $0x0, -0x1e0(%rbp)
cmpq $0x13, -0x1e0(%rbp)
jae 0x25115
movq -0x1e0(%rbp), %rcx
leaq 0x26991(%rip), %rax     # 0x4ba70
movl (%rax,%rcx,4), %esi
leaq -0x130(%rbp), %rdi
callq 0x2e690
movl %eax, %edx
movq -0x1c0(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x250c7
jmp 0x25117
movq -0x1c0(%rbp), %rcx
movq -0x1b8(%rbp), %rdx
subq $0x1, %rdx
xorl %eax, %eax
cmpl $0x0, (%rcx,%rdx,4)
movb %al, -0x212(%rbp)
jne 0x25148
cmpq $0x4, -0x1b8(%rbp)
seta %al
movb %al, -0x212(%rbp)
movb -0x212(%rbp), %al
testb $0x1, %al
jne 0x25154
jmp 0x2517b
movq -0x1b8(%rbp), %rsi
subq $0x1, %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x2d870
cmpl $0x0, %eax
jne 0x25179
movl $0x26c8, -0x24(%rbp)    # imm = 0x26C8
jmp 0x2517b
jmp 0x25117
cmpl $0x0, -0x24(%rbp)
je 0x25186
jmp 0x2547a
movq -0x1d0(%rbp), %rax
subq $0x101, %rax            # imm = 0x101
movl %eax, -0x1ec(%rbp)
movq -0x1d8(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x1f0(%rbp)
movq -0x1b8(%rbp), %rax
subl $0x4, %eax
movl %eax, -0x1f4(%rbp)
movq -0x8(%rbp), %rsi
movl -0x1ec(%rbp), %edx
leaq -0x1e8(%rbp), %rdi
movl $0x5, %ecx
callq 0x2ea90
movq -0x8(%rbp), %rsi
movl -0x1f0(%rbp), %edx
leaq -0x1e8(%rbp), %rdi
movl $0x5, %ecx
callq 0x2ea90
movq -0x8(%rbp), %rsi
movl -0x1f4(%rbp), %edx
leaq -0x1e8(%rbp), %rdi
movl $0x4, %ecx
callq 0x2ea90
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movl -0x1f4(%rbp), %ecx
addl $0x4, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x25267
movq -0x8(%rbp), %rsi
movq -0x1c0(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq -0x1e8(%rbp), %rdi
movl $0x3, %ecx
callq 0x2ea90
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x25216
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
cmpq -0x188(%rbp), %rax
jae 0x253eb
movq -0x8(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x130(%rbp), %rdi
callq 0x2e670
movl %eax, -0x218(%rbp)
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x130(%rbp), %rdi
callq 0x2e690
movq -0x220(%rbp), %rsi
movl -0x218(%rbp), %edx
movl %eax, %ecx
leaq -0x1e8(%rbp), %rdi
callq 0x2e630
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
cmpl $0x10, (%rax,%rcx,4)
jne 0x2533a
movq -0x8(%rbp), %rsi
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x1e0(%rbp)
movl 0x4(%rax,%rcx,4), %edx
leaq -0x1e8(%rbp), %rdi
movl $0x2, %ecx
callq 0x2ea90
jmp 0x253d2
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
cmpl $0x11, (%rax,%rcx,4)
jne 0x25385
movq -0x8(%rbp), %rsi
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x1e0(%rbp)
movl 0x4(%rax,%rcx,4), %edx
leaq -0x1e8(%rbp), %rdi
movl $0x3, %ecx
callq 0x2ea90
jmp 0x253d0
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
cmpl $0x12, (%rax,%rcx,4)
jne 0x253ce
movq -0x8(%rbp), %rsi
movq -0x190(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x1e0(%rbp)
movl 0x4(%rax,%rcx,4), %edx
leaq -0x1e8(%rbp), %rdi
movl $0x7, %ecx
callq 0x2ea90
jmp 0x253d0
jmp 0x253d2
jmp 0x253d4
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x25272
movq -0x8(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
leaq -0x40(%rbp), %rdx
leaq -0x90(%rbp), %rcx
leaq -0xe0(%rbp), %r8
callq 0x2e480
leaq -0x90(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2e690
cmpl $0x0, %eax
jne 0x2542c
movl $0x40, -0x24(%rbp)
jmp 0x2547a
movq -0x8(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq -0x90(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2e670
movl %eax, -0x224(%rbp)
leaq -0x90(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x2e690
movq -0x230(%rbp), %rsi
movl -0x224(%rbp), %edx
movl %eax, %ecx
leaq -0x1e8(%rbp), %rdi
callq 0x2e630
leaq -0x40(%rbp), %rdi
callq 0x2d9b0
leaq -0x90(%rbp), %rdi
callq 0x2d540
leaq -0xe0(%rbp), %rdi
callq 0x2d540
leaq -0x130(%rbp), %rdi
callq 0x2d540
leaq -0x148(%rbp), %rdi
callq 0x2d9b0
leaq -0x160(%rbp), %rdi
callq 0x2d9b0
leaq -0x178(%rbp), %rdi
callq 0x2d9b0
leaq -0x190(%rbp), %rdi
callq 0x2d9b0
leaq -0x1a8(%rbp), %rdi
callq 0x2d9b0
leaq -0x1c0(%rbp), %rdi
callq 0x2d9b0
movl -0x24(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax,%rax)