// File: /workspace/github_c_makefile_star2_O1/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_compute_color_stats
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], 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;
    for(i = 0; i != numpixels; ++i) {
      getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in);

      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, %rbx
movq %rsi, 0x40(%rsp)
movq %rdi, %r14
movl %edx, %eax
movl %ecx, %ecx
imulq %rax, %rcx
movq %rcx, 0x30(%rsp)
movl (%r8), %r15d
movq %r8, %rdi
callq 0x5930
movl %eax, %ebp
xorl $0x1, %ebp
movq %rbx, 0x38(%rsp)
movl 0x4(%rbx), %ebx
movl %r15d, %edi
callq 0x58b3
imull %ebx, %eax
movl 0x418(%r14), %esi
movl %esi, %ecx
xorl $0x1, %ecx
movl %eax, %edx
xorl $0x1, %edx
orl %ecx, %edx
sete 0x1c(%rsp)
movl $0x101, %edx            # imm = 0x101
cmpl $0x8, %eax
ja 0x7617
movl $0x1, %edx
movl %eax, %ecx
shll %cl, %edx
addl 0x14(%r14), %edx
movl $0x101, %ecx            # imm = 0x101
cmpl %ecx, %edx
cmovael %ecx, %edx
testl $0xfffffffb, %r15d      # imm = 0xFFFFFFFB
sete 0x58(%rsp)
movq 0x30(%rsp), %rcx
addq %rcx, 0x420(%r14)
cmpl $0x0, 0x428(%r14)
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(%r14)
movl $0x1, %edi
cmovel %ebp, %edi
movl %edi, 0x18(%rsp)
cmpl $0x0, (%r14)
setne %r13b
cmpl $0x10, %esi
sete %bpl
movl %eax, 0x54(%rsp)
cmpl %eax, %esi
setae %r12b
movl %edx, 0x60(%rsp)
cmpl %edx, 0x14(%r14)
setae %dl
orb %cl, %bpl
xorl %eax, %eax
orb %dl, %bpl
je 0x76c9
movq %r14, %rbx
jmp 0x7711
cmpl $0x0, 0x14(%r14)
movq %r14, %rbx
je 0x7711
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 0x679c
testl %eax, %eax
jne 0x784f
incq %r14
movl 0x14(%rbx), %ecx
cmpq %rcx, %r14
jb 0x76db
movl %eax, 0x24(%rsp)
movq %rbx, 0x28(%rsp)
orb 0x58(%rsp), %r13b
orb 0x1c(%rsp), %r12b
movzbl %r12b, %r15d
movzbl %bpl, %r12d
movb $0x1, %bpl
movq 0x38(%rsp), %rax
cmpl $0x10, 0x4(%rax)
jne 0x7843
xorl %eax, %eax
movw %ax, 0x12(%rsp)
movw %ax, 0x10(%rsp)
movw %ax, 0xe(%rsp)
movw %ax, 0x14(%rsp)
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
sete %bpl
je 0x7858
movb %r13b, 0x1c(%rsp)
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
leaq 0x12(%rsp), %r14
leaq 0x10(%rsp), %rsi
leaq 0xe(%rsp), %rdx
leaq 0x14(%rsp), %rcx
movq %r14, %rdi
movq 0x40(%rsp), %r8
xorl %r9d, %r9d
callq 0x6876
movzwl (%r14), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x785f
movl $0x1, %r13d
movq 0x28(%rsp), %r14
movq 0x30(%rsp), %rdx
movzwl 0x10(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x7869
movzwl 0xe(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x7869
movzwl 0x14(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %eax, %ecx
jne 0x7869
cmpq %r13, %rdx
sete %bpl
je 0x7880
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
leaq 0x12(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xe(%rsp), %rdx
leaq 0x14(%rsp), %rcx
movq 0x40(%rsp), %r8
movq %r13, %r9
callq 0x6876
movq 0x30(%rsp), %rdx
movzwl 0x12(%rsp), %eax
movzbl %al, %ecx
shrl $0x8, %eax
incq %r13
cmpl %eax, %ecx
je 0x77ba
jmp 0x7869
movq 0x28(%rsp), %r14
movq 0x30(%rsp), %rdx
jmp 0x7885
movl %eax, 0x24(%rsp)
jmp 0x7f75
movq 0x28(%rsp), %r14
jmp 0x7885
movq 0x28(%rsp), %r14
movq 0x30(%rsp), %rdx
movl $0x10, 0x418(%r14)
movl $0x1, %r15d
movl $0x1, %r12d
movb 0x1c(%rsp), %r13b
movzbl %r13b, %r13d
xorl %eax, %eax
testb $0x1, %bpl
je 0x7c23
movb %al, 0x12(%rsp)
movb %al, 0x10(%rsp)
movb %al, 0xe(%rsp)
movb %al, 0x14(%rsp)
testq %rdx, %rdx
je 0x7e83
movl %r13d, 0x1c(%rsp)
leaq -0x1(%rdx), %rax
movq %rax, 0x68(%rsp)
xorl %r13d, %r13d
movl %r12d, %ebp
movl 0x54(%rsp), %r12d
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
leaq 0x12(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xe(%rsp), %rdx
leaq 0x14(%rsp), %rcx
movq 0x40(%rsp), %r8
movq %r13, %r9
callq 0x70dc
testl %r15d, %r15d
movl 0x18(%rsp), %edi
jne 0x794f
movl 0x418(%r14), %eax
cmpl $0x7, %eax
ja 0x794f
movzbl 0x12(%rsp), %ecx
leal 0x1(%rcx), %esi
movl $0x1, %edx
cmpb $0x2, %sil
jb 0x7944
imull $0xf0f0f0f1, %ecx, %esi # imm = 0xF0F0F0F1
movl $0x8, %edx
cmpl $0xf0f0f0f, %esi        # imm = 0xF0F0F0F
ja 0x7944
imull $0xfcfcfcfd, %ecx, %ecx # imm = 0xFCFCFCFD
xorl %edx, %edx
cmpl $0x3030304, %ecx        # imm = 0x3030304
setae %dl
leal 0x2(,%rdx,2), %edx
cmpl %eax, %edx
jbe 0x794f
movl %edx, 0x418(%r14)
movq %r13, 0x58(%rsp)
movl 0x418(%r14), %r9d
cmpl %r12d, %r9d
setae %r8b
movb $0x1, %r13b
movb $0x1, %r10b
cmpl $0x0, 0x1c(%rsp)
movl $0x1, %edx
jne 0x79af
movb 0x12(%rsp), %al
cmpb 0x10(%rsp), %al
jne 0x798c
xorl %r10d, %r10d
movl $0x0, %edx
cmpb 0xe(%rsp), %al
je 0x79af
movl $0x1, (%r14)
movb $0x1, %r10b
movl $0x1, %edx
cmpl $0x7, %r9d
ja 0x79af
movl $0x8, 0x418(%r14)
movb $0x1, %r10b
testl %edi, %edi
movl %edx, 0x1c(%rsp)
je 0x79d1
movb $0x1, %r13b
movl $0x1, %esi
movl %esi, 0x18(%rsp)
testl %ebp, %ebp
je 0x7a03
movl $0x1, %ecx
jmp 0x7af2
movzbl 0x12(%rsp), %eax
cmpw %ax, 0x8(%r14)
jne 0x7b32
movzbl 0x10(%rsp), %ecx
cmpw %cx, 0xa(%r14)
jne 0x7b32
movzbl 0xe(%rsp), %ecx
cmpw %cx, 0xc(%r14)
sete %cl
jmp 0x7b34
movb 0x12(%rsp), %al
movb 0x10(%rsp), %cl
movb 0xe(%rsp), %bl
movb 0x14(%rsp), %bpl
movb %al, 0x22(%rsp)
movzbl %al, %esi
movb %cl, 0x23(%rsp)
movzbl %cl, %r14d
movzbl %bl, %r15d
movzbl %bpl, %r12d
leaq 0x70(%rsp), %rdi
movl %esi, 0x64(%rsp)
movl %r14d, %edx
movl %r15d, %ecx
movb %r8b, 0x17(%rsp)
movl %r12d, %r8d
movl %r9d, 0x50(%rsp)
movl %r10d, 0x4c(%rsp)
callq 0xd51d
movl 0x4c(%rsp), %r10d
movl 0x50(%rsp), %r9d
movb 0x17(%rsp), %r8b
xorl %ecx, %ecx
testl %eax, %eax
jns 0x7af2
movb %bpl, 0x21(%rsp)
movb %bl, 0x24(%rsp)
movq 0x28(%rsp), %rbx
movl 0x14(%rbx), %r9d
leaq 0x70(%rsp), %rdi
movl 0x64(%rsp), %esi
movl %r14d, %edx
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x679c
testl %eax, %eax
jne 0x7f95
movl 0x14(%rbx), %eax
cmpq $0xff, %rax
ja 0x7acd
leal (,%rax,4), %ecx
movb 0x22(%rsp), %dl
movb %dl, 0x18(%rbx,%rax,4)
movb 0x23(%rsp), %dl
movb %dl, 0x19(%rbx,%rcx)
movb 0x24(%rsp), %dl
movb %dl, 0x1a(%rbx,%rcx)
movb 0x21(%rsp), %dl
movb %dl, 0x1b(%rbx,%rcx)
incl %eax
movl %eax, 0x14(%rbx)
xorl %ecx, %ecx
cmpl 0x60(%rsp), %eax
setae %cl
movl $0x0, 0x24(%rsp)
movb 0x17(%rsp), %r8b
movl 0x50(%rsp), %r9d
movl 0x4c(%rsp), %r10d
movl 0x54(%rsp), %r12d
cmpl %r12d, %r9d
setae %al
andb %cl, %r13b
andb %r13b, %r10b
testb %al, %r10b
jne 0x7e7e
movl %ecx, %ebp
xorl %r15d, %r15d
movb %r8b, %r15b
movq 0x58(%rsp), %rcx
leaq 0x1(%rcx), %r13
cmpq %rcx, 0x68(%rsp)
movq 0x28(%rsp), %r14
jne 0x78c7
jmp 0x7e83
xorl %ecx, %ecx
movzbl 0x14(%rsp), %edx
cmpl $0xff, %edx
je 0x7b90
testl %edx, %edx
jne 0x7bca
cmpl $0x0, 0x4(%r14)
sete %sil
orb %cl, %sil
testb $0x1, %sil
je 0x7bca
cmpl $0xff, %edx
je 0x7b90
xorl %r13d, %r13d
movl $0x0, %esi
testl %edx, %edx
jne 0x79bf
cmpl $0x0, 0x10(%r14)
jne 0x7b81
cmpl $0x0, 0x4(%r14)
je 0x7bf8
xorl %r13d, %r13d
cmpl $0xff, %edx
jne 0x79bf
cmpl $0x0, 0x4(%r14)
setne %al
andb %cl, %al
xorl %r13d, %r13d
movl $0x0, %esi
cmpb $0x1, %al
jne 0x79bf
movl $0x1, 0x10(%r14)
movl $0x0, 0x4(%r14)
cmpl $0x7, 0x418(%r14)
ja 0x79b7
jmp 0x7be8
movl $0x1, 0x10(%r14)
movl $0x0, 0x4(%r14)
cmpl $0x7, 0x418(%r14)
ja 0x79ba
movl $0x8, 0x418(%r14)
jmp 0x79b7
movl $0x1, 0x4(%r14)
movw %ax, 0x8(%r14)
movzbl 0x10(%rsp), %eax
movw %ax, 0xa(%r14)
movzbl 0xe(%rsp), %eax
movw %ax, 0xc(%r14)
xorl %r13d, %r13d
xorl %esi, %esi
jmp 0x79bf
movw %ax, 0x12(%rsp)
movw %ax, 0x10(%rsp)
movw %ax, 0xe(%rsp)
movw %ax, 0x14(%rsp)
testq %rdx, %rdx
je 0x7dc1
movl %r12d, %ebp
movq 0x30(%rsp), %rax
leaq -0x1(%rax), %rbx
xorl %r12d, %r12d
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
leaq 0x12(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xe(%rsp), %rdx
leaq 0x14(%rsp), %rcx
movq 0x40(%rsp), %r8
movq %r12, %r9
callq 0x6876
movb $0x1, %cl
movb $0x1, %al
testl %r13d, %r13d
movl $0x1, %r13d
jne 0x7cb2
movzwl 0x12(%rsp), %edx
cmpw 0x10(%rsp), %dx
jne 0x7ca3
xorl %eax, %eax
movl $0x0, %r13d
cmpw 0xe(%rsp), %dx
je 0x7cb2
movl $0x1, (%r14)
movb $0x1, %al
movl $0x1, %r13d
cmpl $0x0, 0x18(%rsp)
jne 0x7d6a
movzwl 0x12(%rsp), %edx
cmpw 0x8(%r14), %dx
jne 0x7ce5
movzwl 0x10(%rsp), %ecx
cmpw 0xa(%r14), %cx
jne 0x7ce5
movzwl 0xe(%rsp), %ecx
cmpw 0xc(%r14), %cx
sete %sil
jmp 0x7ce7
xorl %esi, %esi
movzwl 0x14(%rsp), %edi
cmpl $0xffff, %edi           # imm = 0xFFFF
je 0x7d3e
testl %edi, %edi
jne 0x7d58
cmpl $0x0, 0x4(%r14)
sete %cl
orb %sil, %cl
testb $0x1, %cl
je 0x7d58
cmpl $0xffff, %edi           # imm = 0xFFFF
je 0x7d3e
xorl %ecx, %ecx
movl $0x0, 0x18(%rsp)
testl %edi, %edi
jne 0x7d72
cmpl $0x0, 0x10(%r14)
jne 0x7d2c
cmpl $0x0, 0x4(%r14)
je 0x7d94
xorl %ecx, %ecx
movl $0x0, 0x18(%rsp)
cmpl $0xffff, %edi           # imm = 0xFFFF
jne 0x7d72
cmpl $0x0, 0x4(%r14)
setne %dl
andb %sil, %dl
xorl %ecx, %ecx
movl $0x0, 0x18(%rsp)
cmpb $0x1, %dl
jne 0x7d72
movl $0x1, 0x10(%r14)
movl $0x0, 0x4(%r14)
movb $0x1, %cl
movl $0x1, 0x18(%rsp)
testl %r15d, %r15d
setne %dl
andb %bpl, %cl
andb %cl, %al
testb %dl, %al
jne 0x7dc1
leaq 0x1(%r12), %rax
cmpq %r12, %rbx
movq %rax, %r12
jne 0x7c4f
jmp 0x7dc1
movl $0x1, 0x4(%r14)
movw %dx, 0x8(%r14)
movzwl 0x10(%rsp), %ecx
movw %cx, 0xa(%r14)
movzwl 0xe(%rsp), %ecx
movw %cx, 0xc(%r14)
xorl %ecx, %ecx
movl $0x0, 0x18(%rsp)
jmp 0x7d72
cmpl $0x0, 0x4(%r14)
movq 0x38(%rsp), %rbx
movq 0x30(%rsp), %rcx
je 0x7f75
movq 0x28(%rsp), %rax
cmpl $0x0, 0x10(%rax)
setne %al
testq %rcx, %rcx
sete %cl
orb %al, %cl
jne 0x7f75
xorl %r15d, %r15d
leaq 0x12(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0xe(%rsp), %r14
leaq 0x14(%rsp), %rbp
movq %rbx, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq 0x40(%rsp), %r8
movq %r15, %r9
callq 0x6876
cmpw $0x0, 0x14(%rsp)
je 0x7e6f
movzwl 0x12(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpw 0x8(%rcx), %ax
jne 0x7e6f
movzwl 0x10(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpw 0xa(%rcx), %ax
jne 0x7e6f
movzwl 0xe(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpw 0xc(%rcx), %ax
jne 0x7e6f
movq 0x28(%rsp), %rax
movl $0x1, 0x10(%rax)
movl $0x0, 0x4(%rax)
incq %r15
cmpq %r15, 0x30(%rsp)
jne 0x7e07
jmp 0x7f75
movq 0x28(%rsp), %r14
cmpl $0x0, 0x4(%r14)
movq 0x30(%rsp), %rcx
je 0x7f39
cmpl $0x0, 0x10(%r14)
setne %al
testq %rcx, %rcx
sete %cl
orb %al, %cl
jne 0x7f39
xorl %r12d, %r12d
leaq 0x12(%rsp), %rbp
leaq 0xe(%rsp), %r15
leaq 0x14(%rsp), %r13
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
movq %r13, %rcx
movq 0x40(%rsp), %r8
movq %r12, %r9
callq 0x70dc
cmpb $0x0, 0x14(%rsp)
je 0x7f2f
movzbl 0x12(%rsp), %eax
cmpw %ax, 0x8(%r14)
jne 0x7f2f
movzbl 0x10(%rsp), %eax
cmpw %ax, 0xa(%r14)
jne 0x7f2f
movzbl 0xe(%rsp), %eax
cmpw %ax, 0xc(%r14)
jne 0x7f2f
movl $0x1, 0x10(%r14)
movl $0x0, 0x4(%r14)
cmpl $0x7, 0x418(%r14)
ja 0x7f2f
movl $0x8, 0x418(%r14)
incq %r12
cmpq %r12, 0x30(%rsp)
jne 0x7ebb
movl 0x8(%r14), %eax
movl 0xc(%r14), %ecx
movl %eax, %edx
shll $0x8, %edx
addl %eax, %edx
movw %dx, 0x8(%r14)
movzwl 0xa(%r14), %eax
movl %eax, %edx
shll $0x8, %edx
addl %eax, %edx
movw %dx, 0xa(%r14)
movl %ecx, %eax
shll $0x8, %eax
addl %ecx, %eax
movw %ax, 0xc(%r14)
xorl %eax, %eax
cmpl $0x5, %eax
je 0x7f75
testl %eax, %eax
jne 0x7f7f
leaq 0x70(%rsp), %rdi
callq 0x73af
movl 0x24(%rsp), %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, 0x24(%rsp)
movl $0x5, %eax
jmp 0x7f6c