// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng.cpp
// Function: lodepng_compute_color_stats(LodePNGColorStats*, unsigned char const*, unsigned int, unsigned int, LodePNGColorMode const*)
unsigned lodepng_compute_color_stats(LodePNGColorStats* stats,
                                     const unsigned char* in, unsigned w, unsigned h,
                                     const LodePNGColorMode* mode_in) {
  size_t i;
  ColorTree tree;
  size_t numpixels = (size_t)w * (size_t)h;
  unsigned error = 0;

  /* mark things as done already if it would be impossible to have a more expensive case */
  unsigned colored_done = lodepng_is_greyscale_type(mode_in) ? 1 : 0;
  unsigned alpha_done = lodepng_can_have_alpha(mode_in) ? 0 : 1;
  unsigned numcolors_done = 0;
  unsigned bpp = lodepng_get_bpp(mode_in);
  unsigned bits_done = (stats->bits == 1 && bpp == 1) ? 1 : 0;
  unsigned sixteen = 0; /* whether the input image is 16 bit */
  unsigned maxnumcolors = 257;
  if(bpp <= 8) maxnumcolors = LODEPNG_MIN(257, stats->numcolors + (1u << bpp));

  stats->numpixels += numpixels;

  /*if palette not allowed, no need to compute numcolors*/
  if(!stats->allow_palette) numcolors_done = 1;

  color_tree_init(&tree);

  /*If the stats was already filled in from previous data, fill its palette in tree
  and mark things as done already if we know they are the most expensive case already*/
  if(stats->alpha) alpha_done = 1;
  if(stats->colored) colored_done = 1;
  if(stats->bits == 16) numcolors_done = 1;
  if(stats->bits >= bpp) bits_done = 1;
  if(stats->numcolors >= maxnumcolors) numcolors_done = 1;

  if(!numcolors_done) {
    for(i = 0; i < stats->numcolors; i++) {
      const unsigned char* color = &stats->palette[i * 4];
      error = color_tree_add(&tree, color[0], color[1], color[2], color[3], (unsigned)i);
      if(error) goto cleanup;
    }
  }

  /*Check if the 16-bit input is truly 16-bit*/
  if(mode_in->bitdepth == 16 && !sixteen) {
    unsigned short r = 0, g = 0, b = 0, a = 0;
    for(i = 0; i != numpixels; ++i) {
      getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in);
      if((r & 255) != ((r >> 8) & 255) || (g & 255) != ((g >> 8) & 255) ||
         (b & 255) != ((b >> 8) & 255) || (a & 255) != ((a >> 8) & 255)) /*first and second byte differ*/ {
        stats->bits = 16;
        sixteen = 1;
        bits_done = 1;
        numcolors_done = 1; /*counting colors no longer useful, palette doesn't support 16-bit*/
        break;
      }
    }
  }

  if(sixteen) {
    unsigned short r = 0, g = 0, b = 0, a = 0;

    for(i = 0; i != numpixels; ++i) {
      getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in);

      if(!colored_done && (r != g || r != b)) {
        stats->colored = 1;
        colored_done = 1;
      }

      if(!alpha_done) {
        unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b);
        if(a != 65535 && (a != 0 || (stats->key && !matchkey))) {
          stats->alpha = 1;
          stats->key = 0;
          alpha_done = 1;
        } else if(a == 0 && !stats->alpha && !stats->key) {
          stats->key = 1;
          stats->key_r = r;
          stats->key_g = g;
          stats->key_b = b;
        } else if(a == 65535 && stats->key && matchkey) {
          /* Color key cannot be used if an opaque pixel also has that RGB color. */
          stats->alpha = 1;
          stats->key = 0;
          alpha_done = 1;
        }
      }
      if(alpha_done && numcolors_done && colored_done && bits_done) break;
    }

    if(stats->key && !stats->alpha) {
      for(i = 0; i != numpixels; ++i) {
        getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in);
        if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) {
          /* Color key cannot be used if an opaque pixel also has that RGB color. */
          stats->alpha = 1;
          stats->key = 0;
          alpha_done = 1;
        }
      }
    }
  } else /* < 16-bit */ {
    unsigned char r = 0, g = 0, b = 0, a = 0;
    unsigned char pr = 0, pg = 0, pb = 0, pa = 0;
    for(i = 0; i != numpixels; ++i) {
      getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in);

      /*skip if color same as before, this speeds up large non-photographic
      images with many same colors by avoiding 'color_tree_has' below */
      if(i != 0 && r == pr && g == pg && b == pb && a == pa) continue;
      pr = r;
      pg = g;
      pb = b;
      pa = a;

      if(!bits_done && stats->bits < 8) {
        /*only r is checked, < 8 bits is only relevant for grayscale*/
        unsigned bits = getValueRequiredBits(r);
        if(bits > stats->bits) stats->bits = bits;
      }
      bits_done = (stats->bits >= bpp);

      if(!colored_done && (r != g || r != b)) {
        stats->colored = 1;
        colored_done = 1;
        if(stats->bits < 8) stats->bits = 8; /*PNG has no colored modes with less than 8-bit per channel*/
      }

      if(!alpha_done) {
        unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b);
        if(a != 255 && (a != 0 || (stats->key && !matchkey))) {
          stats->alpha = 1;
          stats->key = 0;
          alpha_done = 1;
          if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/
        } else if(a == 0 && !stats->alpha && !stats->key) {
          stats->key = 1;
          stats->key_r = r;
          stats->key_g = g;
          stats->key_b = b;
        } else if(a == 255 && stats->key && matchkey) {
          /* Color key cannot be used if an opaque pixel also has that RGB color. */
          stats->alpha = 1;
          stats->key = 0;
          alpha_done = 1;
          if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/
        }
      }

      if(!numcolors_done) {
        if(!color_tree_has(&tree, r, g, b, a)) {
          error = color_tree_add(&tree, r, g, b, a, stats->numcolors);
          if(error) goto cleanup;
          if(stats->numcolors < 256) {
            unsigned char* p = stats->palette;
            unsigned n = stats->numcolors;
            p[n * 4 + 0] = r;
            p[n * 4 + 1] = g;
            p[n * 4 + 2] = b;
            p[n * 4 + 3] = a;
          }
          ++stats->numcolors;
          numcolors_done = stats->numcolors >= maxnumcolors;
        }
      }

      if(alpha_done && numcolors_done && colored_done && bits_done) break;
    }

    if(stats->key && !stats->alpha) {
      for(i = 0; i != numpixels; ++i) {
        getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in);
        if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) {
          /* Color key cannot be used if an opaque pixel also has that RGB color. */
          stats->alpha = 1;
          stats->key = 0;
          alpha_done = 1;
          if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/
        }
      }
    }

    /*make the stats's key always 16-bit for consistency - repeat each byte twice*/
    stats->key_r += (stats->key_r << 8);
    stats->key_g += (stats->key_g << 8);
    stats->key_b += (stats->key_b << 8);
  }

cleanup:
  color_tree_cleanup(&tree);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r8, %r15
movq %rsi, 0x48(%rsp)
movq %rdi, %rbx
movl %edx, %eax
movl %ecx, %ecx
imulq %rax, %rcx
movq %rcx, 0x28(%rsp)
movl (%r8), %r14d
movq %r8, %rdi
callq 0x54e5
movl %eax, %ebp
xorl $0x1, %ebp
movq %r15, 0x40(%rsp)
movl 0x4(%r15), %r15d
movl %r14d, %edi
callq 0x5468
movl %eax, %esi
imull %r15d, %esi
movl 0x418(%rbx), %eax
movl %eax, %ecx
xorl $0x1, %ecx
movl %esi, %edx
xorl $0x1, %edx
orl %ecx, %edx
sete 0x20(%rsp)
movl $0x101, %edx            # imm = 0x101
cmpl $0x8, %esi
ja 0x7345
movl $0x1, %edx
movl %esi, %ecx
shll %cl, %edx
addl 0x14(%rbx), %edx
movl $0x101, %ecx            # imm = 0x101
cmpl %ecx, %edx
cmovael %ecx, %edx
testl $0xfffffffb, %r14d      # imm = 0xFFFFFFFB
sete 0x1c(%rsp)
movq 0x28(%rsp), %rcx
addq %rcx, 0x420(%rbx)
cmpl $0x0, 0x428(%rbx)
sete %cl
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movl $0xffffffff, 0xf0(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x10(%rbx)
movl $0x1, %edi
cmovel %ebp, %edi
movl %edi, %ebp
cmpl $0x0, (%rbx)
setne 0x30(%rsp)
cmpl $0x10, %eax
sete %r12b
movl %esi, 0x58(%rsp)
cmpl %esi, %eax
setae %r13b
movl %edx, 0x5c(%rsp)
cmpl %edx, 0x14(%rbx)
setae %al
orb %cl, %r12b
xorl %ecx, %ecx
orb %al, %r12b
jne 0x7433
cmpl $0x0, 0x14(%rbx)
je 0x7433
xorl %r14d, %r14d
leaq 0x70(%rsp), %r15
movzbl 0x18(%rbx,%r14,4), %esi
movzbl 0x19(%rbx,%r14,4), %edx
movzbl 0x1a(%rbx,%r14,4), %ecx
movzbl 0x1b(%rbx,%r14,4), %r8d
movq %r15, %rdi
movl %r14d, %r9d
callq 0x64c8
movl %eax, %ecx
testl %eax, %eax
jne 0x7c35
incq %r14
movl 0x14(%rbx), %eax
cmpq %rax, %r14
jb 0x73fb
movb 0x1c(%rsp), %al
orb %al, 0x30(%rsp)
orb 0x20(%rsp), %r13b
movzbl %r13b, %eax
movl %eax, 0x20(%rsp)
movzbl %r12b, %r15d
movb $0x1, %r14b
movq 0x40(%rsp), %rax
cmpl $0x10, 0x4(%rax)
movl %ecx, 0x3c(%rsp)
jne 0x7568
xorl %eax, %eax
movw %ax, 0x16(%rsp)
movw %ax, 0x14(%rsp)
movw %ax, 0x12(%rsp)
movw %ax, 0x18(%rsp)
cmpq $0x0, 0x28(%rsp)
sete %r14b
je 0x7568
movl %r15d, 0x1c(%rsp)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
leaq 0x16(%rsp), %r15
leaq 0x14(%rsp), %rsi
leaq 0x12(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
movq 0x48(%rsp), %r8
xorl %r9d, %r9d
callq 0x65a2
movzwl (%r15), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x7550
movl $0x1, %r15d
leaq 0x12(%rsp), %r12
leaq 0x18(%rsp), %r13
movzwl 0x14(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x7550
movzwl 0x12(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x7550
movzwl 0x18(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x7550
cmpq %r15, 0x28(%rsp)
sete %r14b
je 0x7c59
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
leaq 0x16(%rsp), %rdi
leaq 0x14(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
movq 0x48(%rsp), %r8
movq %r15, %r9
callq 0x65a2
movzwl 0x16(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
incq %r15
cmpl %eax, %ecx
je 0x74dc
movl $0x10, 0x418(%rbx)
movl $0x1, 0x20(%rsp)
movl $0x1, %r15d
movb 0x30(%rsp), %al
movzbl %al, %r13d
xorl %eax, %eax
testb $0x1, %r14b
je 0x7941
movb %al, 0x16(%rsp)
movb %al, 0x14(%rsp)
movb %al, 0x12(%rsp)
movb %al, 0x18(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x7b5a
movl %r13d, 0x54(%rsp)
movl %r15d, 0x1c(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x30(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r15d, %r15d
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
leaq 0x16(%rsp), %rdi
leaq 0x14(%rsp), %rsi
leaq 0x12(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq 0x48(%rsp), %r8
movq %r13, %r9
callq 0x6e08
testq %r13, %r13
setne %al
movb 0x16(%rsp), %r9b
movl %r9d, %ecx
xorb %r15b, %cl
movb 0x14(%rsp), %r10b
movl %r10d, %edx
xorb %r12b, %dl
orb %cl, %dl
movb 0x12(%rsp), %r11b
movl %r11d, %ecx
xorb %r14b, %cl
orb %dl, %cl
movb 0x18(%rsp), %sil
movl %esi, %edx
xorb 0x30(%rsp), %dl
orb %cl, %dl
sete %cl
testb %al, %cl
jne 0x7823
movb %sil, 0x30(%rsp)
movzbl %r9b, %esi
cmpl $0x0, 0x20(%rsp)
movl 0x58(%rsp), %r8d
movl 0x54(%rsp), %r15d
movl %ebp, %edi
jne 0x768e
movl 0x418(%rbx), %eax
cmpl $0x7, %eax
ja 0x768e
leal 0x1(%r9), %edx
movl $0x1, %ecx
cmpb $0x2, %dl
jb 0x7684
imull $0xf0f0f0f1, %esi, %edx # imm = 0xF0F0F0F1
movl $0x8, %ecx
cmpl $0xf0f0f0f, %edx        # imm = 0xF0F0F0F
ja 0x7684
imull $0xfcfcfcfd, %esi, %ecx # imm = 0xFCFCFCFD
xorl %edx, %edx
cmpl $0x3030304, %ecx        # imm = 0x3030304
setae %dl
leal 0x2(,%rdx,2), %ecx
cmpl %eax, %ecx
jbe 0x768e
movl %ecx, 0x418(%rbx)
movl 0x418(%rbx), %edx
cmpl %r8d, %edx
setae 0x27(%rsp)
movl $0x1, %r12d
movb $0x1, %r14b
movb $0x1, %bpl
testl %r15d, %r15d
movl $0x1, %r15d
jne 0x76ec
movl %r9d, %eax
xorb %r10b, %al
movl %r9d, %ecx
xorb %r11b, %cl
xorl %ebp, %ebp
orb %al, %cl
movl $0x0, %r15d
je 0x76ec
movl $0x1, (%rbx)
movb $0x1, %bpl
movl $0x1, %r15d
cmpl $0x7, %edx
ja 0x76ec
movl $0x8, 0x418(%rbx)
movb $0x1, %bpl
movl %edx, 0x20(%rsp)
movzbl %r10b, %ecx
movzbl %r11b, %eax
movb 0x30(%rsp), %dl
movzbl %dl, %r8d
testl %edi, %edi
movl %ebp, 0x6c(%rsp)
movl %ecx, 0x50(%rsp)
je 0x7836
movb $0x1, %r14b
movl %r12d, 0x68(%rsp)
movl $0x1, %ecx
cmpl $0x0, 0x1c(%rsp)
movl %r15d, 0x54(%rsp)
jne 0x77df
leaq 0x70(%rsp), %rdi
movl 0x50(%rsp), %ebp
movl %ebp, %edx
movl %eax, %r12d
movl %eax, %ecx
movl %esi, 0x60(%rsp)
movl %r8d, 0x64(%rsp)
movq %r9, %r15
movb %r10b, 0x1b(%rsp)
movb %r11b, 0x1c(%rsp)
callq 0xeac2
movb 0x30(%rsp), %dl
movb 0x1c(%rsp), %r11b
movb 0x1b(%rsp), %r10b
movq %r15, %r9
xorl %ecx, %ecx
testl %eax, %eax
jns 0x77df
movl 0x14(%rbx), %r9d
leaq 0x70(%rsp), %rdi
movl 0x60(%rsp), %esi
movl %ebp, %edx
movl %r12d, %ecx
movl 0x64(%rsp), %r8d
callq 0x64c8
testl %eax, %eax
jne 0x7c63
movl 0x14(%rbx), %eax
cmpq $0xff, %rax
movq %r15, %r9
movb 0x1b(%rsp), %r10b
movb 0x1c(%rsp), %r11b
movb 0x30(%rsp), %dl
ja 0x77c9
leal (,%rax,4), %ecx
movb %r9b, 0x18(%rbx,%rax,4)
movb %r10b, 0x19(%rbx,%rcx)
movb %r11b, 0x1a(%rbx,%rcx)
movb %dl, 0x1b(%rbx,%rcx)
incl %eax
movl %eax, 0x14(%rbx)
xorl %ecx, %ecx
cmpl 0x5c(%rsp), %eax
setae %cl
movl $0x0, 0x3c(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x58(%rsp), %eax
setae %al
andb %cl, %r14b
movl 0x6c(%rsp), %esi
andb %r14b, %sil
testb %al, %sil
jne 0x7b5a
xorl %eax, %eax
movb 0x27(%rsp), %sil
movb %sil, %al
movl %eax, 0x20(%rsp)
movl %edx, %eax
movq %rax, 0x30(%rsp)
movl %r11d, %r14d
movl %r10d, %r12d
movl %r9d, %r15d
movl 0x68(%rsp), %ebp
movl %ecx, 0x1c(%rsp)
incq %r13
cmpq %r13, 0x28(%rsp)
jne 0x75b7
jmp 0x7b5a
cmpw %si, 0x8(%rbx)
jne 0x784c
cmpw %cx, 0xa(%rbx)
jne 0x784c
cmpw %ax, 0xc(%rbx)
sete %dil
jmp 0x784e
xorl %edi, %edi
cmpl $0xff, %r8d
je 0x78aa
testl %r8d, %r8d
jne 0x78f5
cmpl $0x0, 0x4(%rbx)
sete %cl
orb %dil, %cl
testb $0x1, %cl
je 0x78f5
cmpl $0xff, %r8d
je 0x78aa
xorl %r14d, %r14d
movl $0x0, %r12d
testl %r8d, %r8d
jne 0x7713
cmpl $0x0, 0x10(%rbx)
jne 0x789e
cmpl $0x0, 0x4(%rbx)
je 0x791f
xorl %r14d, %r14d
cmpb $-0x1, %dl
jne 0x7713
cmpl $0x0, 0x4(%rbx)
setne %cl
andb %dil, %cl
xorl %r14d, %r14d
movl $0x0, %r12d
cmpb $0x1, %cl
jne 0x7713
movl $0x1, 0x10(%rbx)
movl $0x0, 0x4(%rbx)
cmpl $0x7, 0x418(%rbx)
ja 0x78e7
movl $0x8, 0x418(%rbx)
movb $0x1, %r14b
movl $0x1, %r12d
jmp 0x7713
movl $0x1, 0x10(%rbx)
movl $0x0, 0x4(%rbx)
cmpl $0x7, 0x418(%rbx)
ja 0x7713
movl $0x8, 0x418(%rbx)
jmp 0x7710
movl $0x1, 0x4(%rbx)
movw %si, 0x8(%rbx)
movl 0x50(%rsp), %ecx
movw %cx, 0xa(%rbx)
movw %ax, 0xc(%rbx)
xorl %r14d, %r14d
xorl %r12d, %r12d
jmp 0x7713
movw %ax, 0x16(%rsp)
movw %ax, 0x14(%rsp)
movw %ax, 0x12(%rsp)
movw %ax, 0x18(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x7ab9
movq 0x28(%rsp), %rax
leaq -0x1(%rax), %r14
xorl %r12d, %r12d
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
leaq 0x16(%rsp), %rdi
leaq 0x14(%rsp), %rsi
leaq 0x12(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq 0x48(%rsp), %r8
movq %r12, %r9
callq 0x65a2
movb $0x1, %cl
movb $0x1, %al
testl %r13d, %r13d
movl $0x1, %r13d
jne 0x79cf
movzwl 0x16(%rsp), %edx
cmpw 0x14(%rsp), %dx
jne 0x79c1
xorl %eax, %eax
movl $0x0, %r13d
cmpw 0x12(%rsp), %dx
je 0x79cf
movl $0x1, (%rbx)
movb $0x1, %al
movl $0x1, %r13d
testl %ebp, %ebp
jne 0x7a6d
movzwl 0x16(%rsp), %edx
cmpw 0x8(%rbx), %dx
jne 0x79fc
movzwl 0x14(%rsp), %ecx
cmpw 0xa(%rbx), %cx
jne 0x79fc
movzwl 0x12(%rsp), %ecx
cmpw 0xc(%rbx), %cx
sete %sil
jmp 0x79fe
xorl %esi, %esi
movzwl 0x18(%rsp), %edi
cmpl $0xffff, %edi           # imm = 0xFFFF
je 0x7a47
testl %edi, %edi
jne 0x7a5d
cmpl $0x0, 0x4(%rbx)
sete %cl
orb %sil, %cl
testb $0x1, %cl
je 0x7a5d
cmpl $0xffff, %edi           # imm = 0xFFFF
je 0x7a47
xorl %ecx, %ecx
movl $0x0, %ebp
testl %edi, %edi
jne 0x7a72
cmpl $0x0, 0x10(%rbx)
jne 0x7a3d
cmpl $0x0, 0x4(%rbx)
je 0x7a96
xorl %ecx, %ecx
cmpl $0xffff, %edi           # imm = 0xFFFF
jne 0x7a72
cmpl $0x0, 0x4(%rbx)
setne %dl
andb %sil, %dl
xorl %ecx, %ecx
movl $0x0, %ebp
cmpb $0x1, %dl
jne 0x7a72
movl $0x1, 0x10(%rbx)
movl $0x0, 0x4(%rbx)
movb $0x1, %cl
movl $0x1, %ebp
cmpl $0x0, 0x20(%rsp)
setne %dl
andb %r15b, %cl
andb %cl, %al
testb %dl, %al
jne 0x7ab9
leaq 0x1(%r12), %rax
cmpq %r12, %r14
movq %rax, %r12
jne 0x796d
jmp 0x7ab9
movl $0x1, 0x4(%rbx)
movw %dx, 0x8(%rbx)
movzwl 0x14(%rsp), %ecx
movw %cx, 0xa(%rbx)
movzwl 0x12(%rsp), %ecx
movw %cx, 0xc(%rbx)
xorl %ecx, %ecx
xorl %ebp, %ebp
jmp 0x7a72
cmpl $0x0, 0x4(%rbx)
je 0x7c39
cmpl $0x0, 0x10(%rbx)
setne %al
cmpq $0x0, 0x28(%rsp)
sete %cl
orb %al, %cl
jne 0x7c39
xorl %r14d, %r14d
leaq 0x16(%rsp), %r15
leaq 0x14(%rsp), %r12
leaq 0x12(%rsp), %r13
leaq 0x18(%rsp), %rbp
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movq 0x48(%rsp), %r8
movq %r14, %r9
callq 0x65a2
cmpw $0x0, 0x18(%rsp)
je 0x7b4b
movzwl 0x16(%rsp), %eax
cmpw 0x8(%rbx), %ax
jne 0x7b4b
movzwl 0x14(%rsp), %eax
cmpw 0xa(%rbx), %ax
jne 0x7b4b
movzwl 0x12(%rsp), %eax
cmpw 0xc(%rbx), %ax
jne 0x7b4b
movl $0x1, 0x10(%rbx)
movl $0x0, 0x4(%rbx)
incq %r14
cmpq %r14, 0x28(%rsp)
jne 0x7af2
jmp 0x7c39
cmpl $0x0, 0x4(%rbx)
je 0x7c08
cmpl $0x0, 0x10(%rbx)
setne %al
cmpq $0x0, 0x28(%rsp)
sete %cl
orb %al, %cl
jne 0x7c08
xorl %r15d, %r15d
leaq 0x16(%rsp), %r12
leaq 0x14(%rsp), %r13
leaq 0x12(%rsp), %rbp
leaq 0x18(%rsp), %r14
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq 0x48(%rsp), %r8
movq %r15, %r9
callq 0x6e08
cmpb $0x0, 0x18(%rsp)
je 0x7bfe
movzbl 0x16(%rsp), %eax
cmpw %ax, 0x8(%rbx)
jne 0x7bfe
movzbl 0x14(%rsp), %eax
cmpw %ax, 0xa(%rbx)
jne 0x7bfe
movzbl 0x12(%rsp), %eax
cmpw %ax, 0xc(%rbx)
jne 0x7bfe
movl $0x1, 0x10(%rbx)
movl $0x0, 0x4(%rbx)
cmpl $0x7, 0x418(%rbx)
ja 0x7bfe
movl $0x8, 0x418(%rbx)
incq %r15
cmpq %r15, 0x28(%rsp)
jne 0x7b93
movl 0x8(%rbx), %eax
movl 0xc(%rbx), %ecx
movl %eax, %edx
shll $0x8, %edx
addl %eax, %edx
movw %dx, 0x8(%rbx)
movzwl 0xa(%rbx), %eax
movl %eax, %edx
shll $0x8, %edx
addl %eax, %edx
movw %dx, 0xa(%rbx)
movl %ecx, %eax
shll $0x8, %eax
addl %ecx, %eax
movw %ax, 0xc(%rbx)
jmp 0x7c39
movl %ecx, 0x3c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x70db
movl 0x3c(%rsp), %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x1c(%rsp), %r15d
jmp 0x7568
movl %eax, 0x3c(%rsp)
jmp 0x7c39