// File: /workspace/github_c_makefile_star2_O0/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: filter
static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h,
                       const LodePNGColorMode* color, const LodePNGEncoderSettings* settings) {
  /*
  For PNG filter method 0
  out must be a buffer with as size: h + (w * h * bpp + 7u) / 8u, because there are
  the scanlines with 1 extra byte per scanline
  */

  unsigned bpp = lodepng_get_bpp(color);
  /*the width of a scanline in bytes, not including the filter type*/
  size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u;

  /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/
  size_t bytewidth = (bpp + 7u) / 8u;
  const unsigned char* prevline = 0;
  unsigned x, y;
  unsigned error = 0;
  LodePNGFilterStrategy strategy = settings->filter_strategy;

  /*
  There is a heuristic called the minimum sum of absolute differences heuristic, suggested by the PNG standard:
   *  If the image type is Palette, or the bit depth is smaller than 8, then do not filter the image (i.e.
      use fixed filtering, with the filter None).
   * (The other case) If the image type is Grayscale or RGB (with or without Alpha), and the bit depth is
     not smaller than 8, then use adaptive filtering heuristic as follows: independently for each row, apply
     all five filters and select the filter that produces the smallest sum of absolute values per row.
  This heuristic is used if filter strategy is LFS_MINSUM and filter_palette_zero is true.

  If filter_palette_zero is true and filter_strategy is not LFS_MINSUM, the above heuristic is followed,
  but for "the other case", whatever strategy filter_strategy is set to instead of the minimum sum
  heuristic is used.
  */
  if(settings->filter_palette_zero &&
     (color->colortype == LCT_PALETTE || color->bitdepth < 8)) strategy = LFS_ZERO;

  if(bpp == 0) return 31; /*error: invalid color type*/

  if(strategy >= LFS_ZERO && strategy <= LFS_FOUR) {
    unsigned char type = (unsigned char)strategy;
    for(y = 0; y != h; ++y) {
      size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/
      size_t inindex = linebytes * y;
      out[outindex] = type; /*filter type byte*/
      filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type);
      prevline = &in[inindex];
    }
  } else if(strategy == LFS_MINSUM) {
    /*adaptive filtering*/
    unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/
    size_t smallest = 0;
    unsigned char type, bestType = 0;

    for(type = 0; type != 5; ++type) {
      attempt[type] = (unsigned char*)lodepng_malloc(linebytes);
      if(!attempt[type]) error = 83; /*alloc fail*/
    }

    if(!error) {
      for(y = 0; y != h; ++y) {
        /*try the 5 filter types*/
        for(type = 0; type != 5; ++type) {
          size_t sum = 0;
          filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type);

          /*calculate the sum of the result*/
          if(type == 0) {
            for(x = 0; x != linebytes; ++x) sum += (unsigned char)(attempt[type][x]);
          } else {
            for(x = 0; x != linebytes; ++x) {
              /*For differences, each byte should be treated as signed, values above 127 are negative
              (converted to signed char). Filtertype 0 isn't a difference though, so use unsigned there.
              This means filtertype 0 is almost never chosen, but that is justified.*/
              unsigned char s = attempt[type][x];
              sum += s < 128 ? s : (255U - s);
            }
          }

          /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/
          if(type == 0 || sum < smallest) {
            bestType = type;
            smallest = sum;
          }
        }

        prevline = &in[y * linebytes];

        /*now fill the out values*/
        out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/
        for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x];
      }
    }

    for(type = 0; type != 5; ++type) lodepng_free(attempt[type]);
  } else if(strategy == LFS_ENTROPY) {
    unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/
    size_t bestSum = 0;
    unsigned type, bestType = 0;
    unsigned count[256];

    for(type = 0; type != 5; ++type) {
      attempt[type] = (unsigned char*)lodepng_malloc(linebytes);
      if(!attempt[type]) error = 83; /*alloc fail*/
    }

    if(!error) {
      for(y = 0; y != h; ++y) {
        /*try the 5 filter types*/
        for(type = 0; type != 5; ++type) {
          size_t sum = 0;
          filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type);
          lodepng_memset(count, 0, 256 * sizeof(*count));
          for(x = 0; x != linebytes; ++x) ++count[attempt[type][x]];
          ++count[type]; /*the filter type itself is part of the scanline*/
          for(x = 0; x != 256; ++x) {
            sum += ilog2i(count[x]);
          }
          /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/
          if(type == 0 || sum > bestSum) {
            bestType = type;
            bestSum = sum;
          }
        }

        prevline = &in[y * linebytes];

        /*now fill the out values*/
        out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/
        for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x];
      }
    }

    for(type = 0; type != 5; ++type) lodepng_free(attempt[type]);
  } else if(strategy == LFS_PREDEFINED) {
    for(y = 0; y != h; ++y) {
      size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/
      size_t inindex = linebytes * y;
      unsigned char type = settings->predefined_filters[y];
      out[outindex] = type; /*filter type byte*/
      filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type);
      prevline = &in[inindex];
    }
  } else if(strategy == LFS_BRUTE_FORCE) {
    /*brute force filter chooser.
    deflate the scanline after every filter attempt to see which one deflates best.
    This is very slow and gives only slightly smaller, sometimes even larger, result*/
    size_t size[5];
    unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/
    size_t smallest = 0;
    unsigned type = 0, bestType = 0;
    unsigned char* dummy;
    LodePNGCompressSettings zlibsettings;
    lodepng_memcpy(&zlibsettings, &settings->zlibsettings, sizeof(LodePNGCompressSettings));
    /*use fixed tree on the attempts so that the tree is not adapted to the filtertype on purpose,
    to simulate the true case where the tree is the same for the whole image. Sometimes it gives
    better result with dynamic tree anyway. Using the fixed tree sometimes gives worse, but in rare
    cases better compression. It does make this a bit less slow, so it's worth doing this.*/
    zlibsettings.btype = 1;
    /*a custom encoder likely doesn't read the btype setting and is optimized for complete PNG
    images only, so disable it*/
    zlibsettings.custom_zlib = 0;
    zlibsettings.custom_deflate = 0;
    for(type = 0; type != 5; ++type) {
      attempt[type] = (unsigned char*)lodepng_malloc(linebytes);
      if(!attempt[type]) error = 83; /*alloc fail*/
    }
    if(!error) {
      for(y = 0; y != h; ++y) /*try the 5 filter types*/ {
        for(type = 0; type != 5; ++type) {
          unsigned testsize = (unsigned)linebytes;
          /*if(testsize > 8) testsize /= 8;*/ /*it already works good enough by testing a part of the row*/

          filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type);
          size[type] = 0;
          dummy = 0;
          zlib_compress(&dummy, &size[type], attempt[type], testsize, &zlibsettings);
          lodepng_free(dummy);
          /*check if this is smallest size (or if type == 0 it's the first case so always store the values)*/
          if(type == 0 || size[type] < smallest) {
            bestType = type;
            smallest = size[type];
          }
        }
        prevline = &in[y * linebytes];
        out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/
        for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x];
      }
    }
    for(type = 0; type != 5; ++type) lodepng_free(attempt[type]);
  }
  else return 88; /* unknown filter strategy */

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5d0, %rsp            # imm = 0x5D0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x6680
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %edi
movl -0x34(%rbp), %edx
movl $0x1, %esi
callq 0x14700
subq $0x1, %rax
movq %rax, -0x40(%rbp)
movl -0x34(%rbp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x5c(%rbp)
movq -0x30(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x34(%rax)
je 0x15e51
movq -0x28(%rbp), %rax
cmpl $0x3, (%rax)
je 0x15e4a
movq -0x28(%rbp), %rax
cmpl $0x8, 0x4(%rax)
jae 0x15e51
movl $0x0, -0x60(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x15e63
movl $0x1f, -0x4(%rbp)
jmp 0x1680e
cmpl $0x0, -0x60(%rbp)
jb 0x15f05
cmpl $0x4, -0x60(%rbp)
ja 0x15f05
movl -0x60(%rbp), %eax
movb %al, -0x61(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x15f00
movq -0x40(%rbp), %rax
addq $0x1, %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x40(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x78(%rbp)
movb -0x61(%rbp), %dl
movq -0x10(%rbp), %rax
movq -0x70(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x70(%rbp), %rax
addq $0x1, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
addq -0x78(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movzbl -0x61(%rbp), %r9d
callq 0x16bf0
movq -0x18(%rbp), %rax
addq -0x78(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x15e84
jmp 0x16808
cmpl $0x5, -0x60(%rbp)
jne 0x161d4
movq $0x0, -0xa8(%rbp)
movb $0x0, -0xaa(%rbp)
movb $0x0, -0xa9(%rbp)
movzbl -0xa9(%rbp), %eax
cmpl $0x5, %eax
je 0x15f7a
movq -0x40(%rbp), %rdi
callq 0x3de0
movq %rax, %rcx
movzbl -0xa9(%rbp), %eax
movq %rcx, -0xa0(%rbp,%rax,8)
movzbl -0xa9(%rbp), %eax
cmpq $0x0, -0xa0(%rbp,%rax,8)
jne 0x15f68
movl $0x53, -0x5c(%rbp)
jmp 0x15f6a
movb -0xa9(%rbp), %al
addb $0x1, %al
movb %al, -0xa9(%rbp)
jmp 0x15f28
cmpl $0x0, -0x5c(%rbp)
jne 0x16198
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x16196
movb $0x0, -0xa9(%rbp)
movzbl -0xa9(%rbp), %eax
cmpl $0x5, %eax
je 0x16107
movq $0x0, -0xb8(%rbp)
movzbl -0xa9(%rbp), %eax
movq -0xa0(%rbp,%rax,8), %rdi
movq -0x18(%rbp), %rsi
movl -0x58(%rbp), %eax
imulq -0x40(%rbp), %rax
addq %rax, %rsi
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movzbl -0xa9(%rbp), %r9d
callq 0x16bf0
movzbl -0xa9(%rbp), %eax
cmpl $0x0, %eax
jne 0x1603d
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x1603b
movzbl -0xa9(%rbp), %eax
movq -0xa0(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movzbl (%rax,%rcx), %eax
addq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x16003
jmp 0x160bc
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x160ba
movzbl -0xa9(%rbp), %eax
movq -0xa0(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0xb9(%rbp)
movzbl -0xb9(%rbp), %eax
cmpl $0x80, %eax
jge 0x16085
movzbl -0xb9(%rbp), %eax
movl %eax, -0x5d0(%rbp)
jmp 0x16099
movzbl -0xb9(%rbp), %ecx
movl $0xff, %eax
subl %ecx, %eax
movl %eax, -0x5d0(%rbp)
movl -0x5d0(%rbp), %eax
movl %eax, %eax
addq -0xb8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x16044
jmp 0x160bc
movzbl -0xa9(%rbp), %eax
cmpl $0x0, %eax
je 0x160d8
movq -0xb8(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jae 0x160f2
movb -0xa9(%rbp), %al
movb %al, -0xaa(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x160f4
movb -0xa9(%rbp), %al
addb $0x1, %al
movb %al, -0xa9(%rbp)
jmp 0x15f9e
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movb -0xaa(%rbp), %dl
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
imulq %rsi, %rcx
movb %dl, (%rax,%rcx)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x16186
movzbl -0xaa(%rbp), %eax
movq -0xa0(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
imulq %rsi, %rcx
addq $0x1, %rcx
movl -0x54(%rbp), %esi
addq %rsi, %rcx
movb %dl, (%rax,%rcx)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1613d
jmp 0x16188
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x15f8b
jmp 0x16198
movb $0x0, -0xa9(%rbp)
movzbl -0xa9(%rbp), %eax
cmpl $0x5, %eax
je 0x161cf
movzbl -0xa9(%rbp), %eax
movq -0xa0(%rbp,%rax,8), %rdi
callq 0x5060
movb -0xa9(%rbp), %al
addb $0x1, %al
movb %al, -0xa9(%rbp)
jmp 0x1619f
jmp 0x16806
cmpl $0x6, -0x60(%rbp)
jne 0x1647e
movq $0x0, -0xf8(%rbp)
movl $0x0, -0x100(%rbp)
movl $0x0, -0xfc(%rbp)
cmpl $0x5, -0xfc(%rbp)
je 0x1624b
movq -0x40(%rbp), %rdi
callq 0x3de0
movq %rax, %rcx
movl -0xfc(%rbp), %eax
movq %rcx, -0xf0(%rbp,%rax,8)
movl -0xfc(%rbp), %eax
cmpq $0x0, -0xf0(%rbp,%rax,8)
jne 0x16238
movl $0x53, -0x5c(%rbp)
jmp 0x1623a
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x161fd
cmpl $0x0, -0x5c(%rbp)
jne 0x16442
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x16440
movl $0x0, -0xfc(%rbp)
cmpl $0x5, -0xfc(%rbp)
je 0x163b0
movq $0x0, -0x508(%rbp)
movl -0xfc(%rbp), %eax
movq -0xf0(%rbp,%rax,8), %rdi
movq -0x18(%rbp), %rsi
movl -0x58(%rbp), %eax
imulq -0x40(%rbp), %rax
addq %rax, %rsi
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movl -0xfc(%rbp), %eax
movzbl %al, %r9d
callq 0x16bf0
leaq -0x500(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x4a10
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x16316
movl -0xfc(%rbp), %eax
movq -0xf0(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl -0x500(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x500(%rbp,%rax,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x162dc
movl -0xfc(%rbp), %eax
movl -0x500(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x500(%rbp,%rax,4)
movl $0x0, -0x54(%rbp)
cmpl $0x100, -0x54(%rbp)     # imm = 0x100
je 0x16367
movl -0x54(%rbp), %eax
movl -0x500(%rbp,%rax,4), %eax
movl %eax, %edi
callq 0x17030
addq -0x508(%rbp), %rax
movq %rax, -0x508(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x16334
cmpl $0x0, -0xfc(%rbp)
je 0x16380
movq -0x508(%rbp), %rax
cmpq -0xf8(%rbp), %rax
jbe 0x1639a
movl -0xfc(%rbp), %eax
movl %eax, -0x100(%rbp)
movq -0x508(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x1639c
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x16272
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x100(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
imulq %rsi, %rcx
movb %dl, (%rax,%rcx)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x16430
movl -0x100(%rbp), %eax
movq -0xf0(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
imulq %rsi, %rcx
addq $0x1, %rcx
movl -0x54(%rbp), %esi
addq %rsi, %rcx
movb %dl, (%rax,%rcx)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x163e8
jmp 0x16432
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1625c
jmp 0x16442
movl $0x0, -0xfc(%rbp)
cmpl $0x5, -0xfc(%rbp)
je 0x16479
movl -0xfc(%rbp), %eax
movq -0xf0(%rbp,%rax,8), %rdi
callq 0x5060
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x1644c
jmp 0x16804
cmpl $0x8, -0x60(%rbp)
jne 0x16543
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x1653e
movq -0x40(%rbp), %rax
addq $0x1, %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x510(%rbp)
movq -0x40(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x518(%rbp)
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x58(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x519(%rbp)
movb -0x519(%rbp), %dl
movq -0x10(%rbp), %rax
movq -0x510(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x510(%rbp), %rax
addq $0x1, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
addq -0x518(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movzbl -0x519(%rbp), %r9d
callq 0x16bf0
movq -0x18(%rbp), %rax
addq -0x518(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1648f
jmp 0x16802
cmpl $0x7, -0x60(%rbp)
jne 0x167f7
movq $0x0, -0x588(%rbp)
movl $0x0, -0x58c(%rbp)
movl $0x0, -0x590(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x5c8(%rbp), %rdi
movl $0x30, %edx
callq 0x6440
movl $0x1, -0x5c8(%rbp)
movq $0x0, -0x5b0(%rbp)
movq $0x0, -0x5a8(%rbp)
movl $0x0, -0x58c(%rbp)
cmpl $0x5, -0x58c(%rbp)
je 0x165f9
movq -0x40(%rbp), %rdi
callq 0x3de0
movq %rax, %rcx
movl -0x58c(%rbp), %eax
movq %rcx, -0x580(%rbp,%rax,8)
movl -0x58c(%rbp), %eax
cmpq $0x0, -0x580(%rbp,%rax,8)
jne 0x165e6
movl $0x53, -0x5c(%rbp)
jmp 0x165e8
movl -0x58c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58c(%rbp)
jmp 0x165ab
cmpl $0x0, -0x5c(%rbp)
jne 0x167be
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x167bc
movl $0x0, -0x58c(%rbp)
cmpl $0x5, -0x58c(%rbp)
je 0x1672c
movq -0x40(%rbp), %rax
movl %eax, -0x5cc(%rbp)
movl -0x58c(%rbp), %eax
movq -0x580(%rbp,%rax,8), %rdi
movq -0x18(%rbp), %rsi
movl -0x58(%rbp), %eax
imulq -0x40(%rbp), %rax
addq %rax, %rsi
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movl -0x58c(%rbp), %eax
movzbl %al, %r9d
callq 0x16bf0
movl -0x58c(%rbp), %eax
movq $0x0, -0x550(%rbp,%rax,8)
movq $0x0, -0x598(%rbp)
movl -0x58c(%rbp), %eax
leaq -0x550(%rbp), %rsi
shlq $0x3, %rax
addq %rax, %rsi
movl -0x58c(%rbp), %eax
movq -0x580(%rbp,%rax,8), %rdx
movl -0x5cc(%rbp), %eax
movl %eax, %ecx
leaq -0x598(%rbp), %rdi
leaq -0x5c8(%rbp), %r8
callq 0x170a0
movq -0x598(%rbp), %rdi
callq 0x5060
cmpl $0x0, -0x58c(%rbp)
je 0x166f5
movl -0x58c(%rbp), %eax
movq -0x550(%rbp,%rax,8), %rax
cmpq -0x588(%rbp), %rax
jae 0x16716
movl -0x58c(%rbp), %eax
movl %eax, -0x590(%rbp)
movl -0x58c(%rbp), %eax
movq -0x550(%rbp,%rax,8), %rax
movq %rax, -0x588(%rbp)
jmp 0x16718
movl -0x58c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58c(%rbp)
jmp 0x16620
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x590(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
imulq %rsi, %rcx
movb %dl, (%rax,%rcx)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x167ac
movl -0x590(%rbp), %eax
movq -0x580(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x58(%rbp), %ecx
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
imulq %rsi, %rcx
addq $0x1, %rcx
movl -0x54(%rbp), %esi
addq %rsi, %rcx
movb %dl, (%rax,%rcx)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x16764
jmp 0x167ae
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1660a
jmp 0x167be
movl $0x0, -0x58c(%rbp)
cmpl $0x5, -0x58c(%rbp)
je 0x167f5
movl -0x58c(%rbp), %eax
movq -0x580(%rbp,%rax,8), %rdi
callq 0x5060
movl -0x58c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58c(%rbp)
jmp 0x167c8
jmp 0x16800
movl $0x58, -0x4(%rbp)
jmp 0x1680e
jmp 0x16802
jmp 0x16804
jmp 0x16806
jmp 0x16808
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x5d0, %rsp            # imm = 0x5D0
popq %rbp
retq
nopw (%rax,%rax)