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

  unsigned bpp = lodepng_get_bpp(info);
  /*the width of a scanline in bytes, not including the filter type*/
  size_t linebytes = (w * bpp + 7) / 8;
  /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/
  size_t bytewidth = (bpp + 7) / 8;
  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 &&
     (info->colortype == LCT_PALETTE || info->bitdepth < 8)) strategy = LFS_ZERO;

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

  if(strategy == LFS_ZERO)
  {
    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] = 0; /*filter type byte*/
      filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, 0);
      prevline = &in[inindex];
    }
  }
  else if(strategy == LFS_MINSUM)
  {
    /*adaptive filtering*/
    size_t sum[5];
    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]) return 83; /*alloc fail*/
    }

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

          /*calculate the sum of the result*/
          sum[type] = 0;
          if(type == 0)
          {
            for(x = 0; x != linebytes; ++x) sum[type] += (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[type] += 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[type] < smallest)
          {
            bestType = type;
            smallest = sum[type];
          }
        }

        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)
  {
    float sum[5];
    unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/
    float smallest = 0;
    unsigned type, bestType = 0;
    unsigned count[256];

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

    for(y = 0; y != h; ++y)
    {
      /*try the 5 filter types*/
      for(type = 0; type != 5; ++type)
      {
        filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type);
        for(x = 0; x != 256; ++x) count[x] = 0;
        for(x = 0; x != linebytes; ++x) ++count[attempt[type][x]];
        ++count[type]; /*the filter type itself is part of the scanline*/
        sum[type] = 0;
        for(x = 0; x != 256; ++x)
        {
          float p = count[x] / (float)(linebytes + 1);
          sum[type] += count[x] == 0 ? 0 : flog2(1 / p) * p;
        }
        /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/
        if(type == 0 || sum[type] < smallest)
        {
          bestType = type;
          smallest = sum[type];
        }
      }

      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 = settings->zlibsettings;
    /*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]) return 83; /*alloc fail*/
    }
    for(y = 0; y != h; ++y) /*try the 5 filter types*/
    {
      for(type = 0; type != 5; ++type)
      {
        unsigned testsize = 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 $0x610, %rsp            # imm = 0x610
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 0x30e0
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %eax
imull -0x34(%rbp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
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 0x1029c
movq -0x28(%rbp), %rax
cmpl $0x3, (%rax)
je 0x10295
movq -0x28(%rbp), %rax
cmpl $0x8, 0x4(%rax)
jae 0x1029c
movl $0x0, -0x60(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x102ae
movl $0x1f, -0x4(%rbp)
jmp 0x10d64
cmpl $0x0, -0x60(%rbp)
jne 0x1033c
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x10337
movq -0x40(%rbp), %rax
addq $0x1, %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq -0x68(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
addq $0x1, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
addq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
xorl %r9d, %r9d
callq 0x11140
movq -0x18(%rbp), %rax
addq -0x70(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x102bf
jmp 0x10d5e
cmpl $0x1, -0x60(%rbp)
jne 0x10644
movq $0x0, -0xd8(%rbp)
movb $0x0, -0xda(%rbp)
movb $0x0, -0xd9(%rbp)
movzbl -0xd9(%rbp), %eax
cmpl $0x5, %eax
je 0x103b6
movq -0x40(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movzbl -0xd9(%rbp), %eax
movq %rcx, -0xd0(%rbp,%rax,8)
movzbl -0xd9(%rbp), %eax
cmpq $0x0, -0xd0(%rbp,%rax,8)
jne 0x103a4
movl $0x53, -0x4(%rbp)
jmp 0x10d64
jmp 0x103a6
movb -0xd9(%rbp), %al
addb $0x1, %al
movb %al, -0xd9(%rbp)
jmp 0x1035f
cmpl $0x0, -0x5c(%rbp)
jne 0x10608
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x10606
movb $0x0, -0xd9(%rbp)
movzbl -0xd9(%rbp), %eax
cmpl $0x5, %eax
je 0x10577
movzbl -0xd9(%rbp), %eax
movq -0xd0(%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 -0xd9(%rbp), %r9d
callq 0x11140
movzbl -0xd9(%rbp), %eax
movq $0x0, -0xa0(%rbp,%rax,8)
movzbl -0xd9(%rbp), %eax
cmpl $0x0, %eax
jne 0x1048f
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x1048a
movzbl -0xd9(%rbp), %eax
movq -0xd0(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
movzbl -0xd9(%rbp), %eax
addq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x10447
jmp 0x1051c
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x1051a
movzbl -0xd9(%rbp), %eax
movq -0xd0(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0xdb(%rbp)
movzbl -0xdb(%rbp), %eax
cmpl $0x80, %eax
jge 0x104d7
movzbl -0xdb(%rbp), %eax
movl %eax, -0x600(%rbp)
jmp 0x104eb
movzbl -0xdb(%rbp), %ecx
movl $0xff, %eax
subl %ecx, %eax
movl %eax, -0x600(%rbp)
movl -0x600(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
movzbl -0xd9(%rbp), %eax
addq -0xa0(%rbp,%rax,8), %rcx
movq %rcx, -0xa0(%rbp,%rax,8)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x10496
jmp 0x1051c
movzbl -0xd9(%rbp), %eax
cmpl $0x0, %eax
je 0x10540
movzbl -0xd9(%rbp), %eax
movq -0xa0(%rbp,%rax,8), %rax
cmpq -0xd8(%rbp), %rax
jae 0x10562
movb -0xd9(%rbp), %al
movb %al, -0xda(%rbp)
movzbl -0xd9(%rbp), %eax
movq -0xa0(%rbp,%rax,8), %rax
movq %rax, -0xd8(%rbp)
jmp 0x10564
movb -0xd9(%rbp), %al
addb $0x1, %al
movb %al, -0xd9(%rbp)
jmp 0x103da
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movb -0xda(%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 0x105f6
movzbl -0xda(%rbp), %eax
movq -0xd0(%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 0x105ad
jmp 0x105f8
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x103c7
jmp 0x10608
movb $0x0, -0xd9(%rbp)
movzbl -0xd9(%rbp), %eax
cmpl $0x5, %eax
je 0x1063f
movzbl -0xd9(%rbp), %eax
movq -0xd0(%rbp,%rax,8), %rdi
callq 0x1e60
movb -0xd9(%rbp), %al
addb $0x1, %al
movb %al, -0xd9(%rbp)
jmp 0x1060f
jmp 0x10d5c
cmpl $0x2, -0x60(%rbp)
jne 0x109db
xorps %xmm0, %xmm0
movss %xmm0, -0x124(%rbp)
movl $0x0, -0x12c(%rbp)
movl $0x0, -0x128(%rbp)
cmpl $0x5, -0x128(%rbp)
je 0x106c0
movq -0x40(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movl -0x128(%rbp), %eax
movq %rcx, -0x120(%rbp,%rax,8)
movl -0x128(%rbp), %eax
cmpq $0x0, -0x120(%rbp,%rax,8)
jne 0x106ad
movl $0x53, -0x4(%rbp)
jmp 0x10d64
jmp 0x106af
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x1066d
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x1099f
movl $0x0, -0x128(%rbp)
cmpl $0x5, -0x128(%rbp)
je 0x1090f
movl -0x128(%rbp), %eax
movq -0x120(%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 -0x128(%rbp), %eax
movzbl %al, %r9d
callq 0x11140
movl $0x0, -0x54(%rbp)
cmpl $0x100, -0x54(%rbp)     # imm = 0x100
je 0x1074b
movl -0x54(%rbp), %eax
movl $0x0, -0x530(%rbp,%rax,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x10729
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x40(%rbp), %rax
je 0x1078c
movl -0x128(%rbp), %eax
movq -0x120(%rbp,%rax,8), %rax
movl -0x54(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl -0x530(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x530(%rbp,%rax,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x10752
movl -0x128(%rbp), %eax
movl -0x530(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x530(%rbp,%rax,4)
movl -0x128(%rbp), %eax
xorps %xmm0, %xmm0
movss %xmm0, -0xf0(%rbp,%rax,4)
movl $0x0, -0x54(%rbp)
cmpl $0x100, -0x54(%rbp)     # imm = 0x100
je 0x108b1
movl -0x54(%rbp), %eax
movl -0x530(%rbp,%rax,4), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, -0x60c(%rbp)
movq -0x40(%rbp), %rax
incq %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x608(%rbp)
testq %rax, %rax
movss %xmm0, -0x604(%rbp)
js 0x10828
movss -0x608(%rbp), %xmm0
movss %xmm0, -0x604(%rbp)
movss -0x60c(%rbp), %xmm0
movss -0x604(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x534(%rbp)
movl -0x54(%rbp), %eax
cmpl $0x0, -0x530(%rbp,%rax,4)
jne 0x1085e
xorps %xmm0, %xmm0
movss %xmm0, -0x610(%rbp)
jmp 0x10883
movss 0x3ca6(%rip), %xmm0     # 0x1450c
divss -0x534(%rbp), %xmm0
callq 0x11580
mulss -0x534(%rbp), %xmm0
movss %xmm0, -0x610(%rbp)
movss -0x610(%rbp), %xmm0
movl -0x128(%rbp), %eax
addss -0xf0(%rbp,%rax,4), %xmm0
movss %xmm0, -0xf0(%rbp,%rax,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x107bc
cmpl $0x0, -0x128(%rbp)
je 0x108d6
movl -0x128(%rbp), %eax
movss -0xf0(%rbp,%rax,4), %xmm1
movss -0x124(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x108f9
movl -0x128(%rbp), %eax
movl %eax, -0x12c(%rbp)
movl -0x128(%rbp), %eax
movss -0xf0(%rbp,%rax,4), %xmm0
movss %xmm0, -0x124(%rbp)
jmp 0x108fb
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x106dd
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x12c(%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 0x1098f
movl -0x12c(%rbp), %eax
movq -0x120(%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 0x10947
jmp 0x10991
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x106c7
movl $0x0, -0x128(%rbp)
cmpl $0x5, -0x128(%rbp)
je 0x109d6
movl -0x128(%rbp), %eax
movq -0x120(%rbp,%rax,8), %rdi
callq 0x1e60
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x109a9
jmp 0x10d5a
cmpl $0x4, -0x60(%rbp)
jne 0x10aa0
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x10a9b
movq -0x40(%rbp), %rax
addq $0x1, %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x540(%rbp)
movq -0x40(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x548(%rbp)
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x58(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x549(%rbp)
movb -0x549(%rbp), %dl
movq -0x10(%rbp), %rax
movq -0x540(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x540(%rbp), %rax
addq $0x1, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
addq -0x548(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movzbl -0x549(%rbp), %r9d
callq 0x11140
movq -0x18(%rbp), %rax
addq -0x548(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x109ec
jmp 0x10d58
cmpl $0x3, -0x60(%rbp)
jne 0x10d4d
movq $0x0, -0x5b8(%rbp)
movl $0x0, -0x5bc(%rbp)
movl $0x0, -0x5c0(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x5f8(%rbp), %rdi
movl $0x30, %edx
callq 0x10c0
movl $0x1, -0x5f8(%rbp)
movq $0x0, -0x5e0(%rbp)
movq $0x0, -0x5d8(%rbp)
movl $0x0, -0x5bc(%rbp)
cmpl $0x5, -0x5bc(%rbp)
je 0x10b5b
movq -0x40(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movl -0x5bc(%rbp), %eax
movq %rcx, -0x5b0(%rbp,%rax,8)
movl -0x5bc(%rbp), %eax
cmpq $0x0, -0x5b0(%rbp,%rax,8)
jne 0x10b48
movl $0x53, -0x4(%rbp)
jmp 0x10d64
jmp 0x10b4a
movl -0x5bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5bc(%rbp)
jmp 0x10b08
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0x10d14
movl $0x0, -0x5bc(%rbp)
cmpl $0x5, -0x5bc(%rbp)
je 0x10c84
movq -0x40(%rbp), %rax
movl %eax, -0x5fc(%rbp)
movl -0x5bc(%rbp), %eax
movq -0x5b0(%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 -0x5bc(%rbp), %eax
movzbl %al, %r9d
callq 0x11140
movl -0x5bc(%rbp), %eax
movq $0x0, -0x580(%rbp,%rax,8)
movq $0x0, -0x5c8(%rbp)
movl -0x5bc(%rbp), %eax
leaq -0x580(%rbp), %rsi
shlq $0x3, %rax
addq %rax, %rsi
movl -0x5bc(%rbp), %eax
movq -0x5b0(%rbp,%rax,8), %rdx
movl -0x5fc(%rbp), %eax
movl %eax, %ecx
leaq -0x5c8(%rbp), %rdi
leaq -0x5f8(%rbp), %r8
callq 0x11680
movq -0x5c8(%rbp), %rdi
callq 0x1e60
cmpl $0x0, -0x5bc(%rbp)
je 0x10c4d
movl -0x5bc(%rbp), %eax
movq -0x580(%rbp,%rax,8), %rax
cmpq -0x5b8(%rbp), %rax
jae 0x10c6e
movl -0x5bc(%rbp), %eax
movl %eax, -0x5c0(%rbp)
movl -0x5bc(%rbp), %eax
movq -0x580(%rbp,%rax,8), %rax
movq %rax, -0x5b8(%rbp)
jmp 0x10c70
movl -0x5bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5bc(%rbp)
jmp 0x10b78
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x5c0(%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 0x10d04
movl -0x5c0(%rbp), %eax
movq -0x5b0(%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 0x10cbc
jmp 0x10d06
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x10b62
movl $0x0, -0x5bc(%rbp)
cmpl $0x5, -0x5bc(%rbp)
je 0x10d4b
movl -0x5bc(%rbp), %eax
movq -0x5b0(%rbp,%rax,8), %rdi
callq 0x1e60
movl -0x5bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5bc(%rbp)
jmp 0x10d1e
jmp 0x10d56
movl $0x58, -0x4(%rbp)
jmp 0x10d64
jmp 0x10d58
jmp 0x10d5a
jmp 0x10d5c
jmp 0x10d5e
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x610, %rsp            # imm = 0x610
popq %rbp
retq