// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4c8, %rsp            # imm = 0x4C8
movq %r9, %r13
movl %ecx, %ebx
movq %rsi, 0x48(%rsp)
movq %rdi, %r12
movl (%r8), %eax
movl 0x4(%r8), %ecx
xorl %r14d, %r14d
cmpq $0x6, %rax
ja 0xbff2
leaq 0x2a36(%rip), %rsi      # 0xea24
movl (%rsi,%rax,4), %r14d
imull %ecx, %r14d
testl %r14d, %r14d
je 0xc0aa
movl 0x38(%r13), %edi
xorl %esi, %esi
cmpl $0x8, %ecx
movl %edi, %ecx
cmovbl %esi, %ecx
cmpl $0x3, %eax
cmovel %esi, %ecx
cmpl $0x0, 0x34(%r13)
cmovel %edi, %ecx
cmpl $0x4, %ecx
ja 0xc224
imull %r14d, %edx
addl $0x7, %edx
movl %edx, 0x10(%rsp)
movl %edx, %r15d
shrl $0x3, %r15d
addl $0x7, %r14d
shrl $0x3, %r14d
leaq 0x20ff(%rip), %rax      # 0xe144
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
movq %r12, 0x20(%rsp)
jmpq *%rcx
testl %ebx, %ebx
movq 0x48(%rsp), %r9
je 0xc78c
leaq 0x1(%r15), %rax
movl %ebx, %ecx
leaq 0x1(%r12), %rdx
xorl %esi, %esi
movq %rax, %rdi
imulq %rsi, %rdi
movb $0x0, (%r12,%rdi)
cmpl $0x8, 0x10(%rsp)
jb 0xc092
xorl %edi, %edi
movb (%r9,%rdi), %r8b
movb %r8b, (%rdx,%rdi)
incq %rdi
cmpq %rdi, %r15
jne 0xc082
incq %rsi
addq %rax, %rdx
addq %r15, %r9
cmpq %rcx, %rsi
movq 0x20(%rsp), %r12
jne 0xc06d
jmp 0xc78c
movl $0x1f, %eax
jmp 0xc78e
testl %ebx, %ebx
movq 0x48(%rsp), %rax
je 0xc78c
leaq 0x1(%r15), %rcx
movq %rcx, 0x10(%rsp)
movl %ebx, %ecx
movq %rcx, 0x18(%rsp)
incq %r12
xorl %ebp, %ebp
xorl %edx, %edx
movq %rax, %rbx
movq 0x40(%r13), %rax
movzbl (%rax,%rbp), %r9d
movb %r9b, -0x1(%r12)
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rcx
movq %r14, %r8
callq 0xc7a0
incq %rbp
addq 0x10(%rsp), %r12
leaq (%rbx,%r15), %rax
movq %rbx, %rdx
cmpq %rbp, 0x18(%rsp)
jne 0xc0d8
jmp 0xc78c
movq %r15, %rdi
callq 0x10f0
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0xc21a
movl $0x1, %ecx
movq %rcx, %r13
cmpq $0x5, %rcx
je 0xc22e
movq %r15, %rdi
callq 0x10f0
movq %rax, 0x60(%rsp,%r13,8)
leaq 0x1(%r13), %rcx
testq %rax, %rax
jne 0xc130
jmp 0xc781
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movaps %xmm0, 0xc0(%rsp)
movaps %xmm2, 0xe0(%rsp)
movaps %xmm1, 0xd0(%rsp)
movl $0x1, 0xc0(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rsp)
movq %r15, %rdi
callq 0x10f0
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0xc21a
movl $0x1, %ecx
movq %rcx, %r12
cmpq $0x5, %rcx
je 0xc499
movq %r15, %rdi
callq 0x10f0
movq %rax, 0x90(%rsp,%r12,8)
leaq 0x1(%r12), %rcx
testq %rax, %rax
jne 0xc1af
jmp 0xc5f7
movq %r15, %rdi
callq 0x10f0
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0xc21a
movl $0x1, %ecx
movq %rcx, %r13
cmpq $0x5, %rcx
je 0xc60b
movq %r15, %rdi
callq 0x10f0
movq %rax, 0x60(%rsp,%r13,8)
leaq 0x1(%r13), %rcx
testq %rax, %rax
jne 0xc1f2
jmp 0xc781
movl $0x53, %eax
jmp 0xc78e
movl $0x58, %eax
jmp 0xc78e
movq %r13, 0x50(%rsp)
testl %ebx, %ebx
je 0xc47a
movq %r14, %r12
leaq 0x1(%r15), %rsi
cvtsi2ss %esi, %xmm0
movss %xmm0, 0x8(%rsp)
movl %ebx, %eax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
leaq 0x1(%rax), %rdi
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
xorl %r8d, %r8d
xorl %r13d, %r13d
movl $0x0, (%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x40(%rsp)
movq %r13, %rbx
movq %r8, 0x38(%rsp)
movq %r8, %r13
imulq %r15, %r13
addq 0x48(%rsp), %r13
xorl %r14d, %r14d
movq 0x60(%rsp,%r14,8), %rbp
movzbl %r14b, %r9d
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0xc7a0
movl $0x400, %edx            # imm = 0x400
leaq 0xc0(%rsp), %rdi
xorl %esi, %esi
callq 0x10b0
cmpl $0x8, 0x10(%rsp)
jb 0xc2e1
xorl %eax, %eax
movzbl (%rbp,%rax), %ecx
incl 0xc0(%rsp,%rcx,4)
incq %rax
cmpl %eax, %r15d
jne 0xc2cd
incl 0xc0(%rsp,%r14,4)
movl $0x0, 0x90(%rsp,%r14,4)
xorps %xmm0, %xmm0
xorl %eax, %eax
movss 0x8(%rsp), %xmm6
movss 0x2738(%rip), %xmm7     # 0xea40
movss 0x2733(%rip), %xmm8     # 0xea44
movss 0x272e(%rip), %xmm9     # 0xea48
movss 0x2729(%rip), %xmm10    # 0xea4c
movss 0x2724(%rip), %xmm11    # 0xea50
movss 0x271f(%rip), %xmm12    # 0xea54
movss 0x271a(%rip), %xmm13    # 0xea58
movss 0x2715(%rip), %xmm14    # 0xea5c
movss 0x2710(%rip), %xmm15    # 0xea60
movl 0xc0(%rsp,%rax,4), %ecx
xorps %xmm1, %xmm1
testl %ecx, %ecx
je 0xc3d5
movl %ecx, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
divss %xmm6, %xmm1
movaps %xmm7, %xmm2
divss %xmm1, %xmm2
xorps %xmm3, %xmm3
ucomiss %xmm8, %xmm2
jbe 0xc391
addss %xmm9, %xmm3
mulss %xmm10, %xmm2
jmp 0xc376
addss %xmm7, %xmm3
mulss %xmm12, %xmm2
ucomiss %xmm11, %xmm2
ja 0xc388
movaps %xmm2, %xmm4
mulss %xmm2, %xmm4
mulss %xmm2, %xmm4
divss %xmm13, %xmm4
movaps %xmm2, %xmm5
mulss %xmm13, %xmm5
mulss %xmm5, %xmm2
mulss %xmm14, %xmm2
addss %xmm4, %xmm2
addss %xmm5, %xmm2
addss %xmm15, %xmm2
mulss 0x2697(%rip), %xmm2     # 0xea64
addss %xmm3, %xmm2
mulss %xmm2, %xmm1
addss %xmm1, %xmm0
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0xc350
movss %xmm0, 0x90(%rsp,%r14,4)
testq %r14, %r14
je 0xc408
movss 0x18(%rsp), %xmm0
ucomiss 0x90(%rsp,%r14,4), %xmm0
jbe 0xc41c
movss 0x90(%rsp,%r14,4), %xmm0
movss %xmm0, 0x18(%rsp)
movl %r14d, (%rsp)
incq %r14
cmpq $0x5, %r14
jne 0xc293
movq 0x30(%rsp), %rsi
movq %rsi, %rax
movq 0x38(%rsp), %r8
imulq %r8, %rax
movq 0x20(%rsp), %rcx
movl (%rsp), %edx
movb %dl, (%rcx,%rax)
cmpl $0x8, 0x10(%rsp)
movq 0x40(%rsp), %rdi
jb 0xc469
movl (%rsp), %eax
movq 0x60(%rsp,%rax,8), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
movb %dl, (%rdi,%rcx)
incq %rcx
cmpl %ecx, %r15d
jne 0xc45b
incq %r8
addq %rsi, %rdi
cmpq 0x28(%rsp), %r8
jne 0xc277
xorl %ebx, %ebx
movq 0x50(%rsp), %r13
movq 0x60(%rsp,%rbx,8), %rdi
callq 0x1030
incq %rbx
cmpq $0x5, %rbx
jne 0xc481
jmp 0xc781
movq %r12, 0x50(%rsp)
movq %r14, 0x18(%rsp)
testl %ebx, %ebx
je 0xc5da
leaq 0x1(%r15), %rsi
movl %ebx, %eax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
leaq 0x1(%rax), %rdi
xorl %r8d, %r8d
movl $0x0, (%rsp)
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x40(%rsp)
movq 0x8(%rsp), %rbp
movq %r8, 0x38(%rsp)
imulq %r15, %r8
addq 0x48(%rsp), %r8
movq %r8, 0x8(%rsp)
leaq 0x60(%rsp), %r13
xorl %ebx, %ebx
movq 0x90(%rsp,%rbx,8), %r14
movzbl %bl, %r9d
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %r15, %rcx
movq 0x18(%rsp), %r8
callq 0xc7a0
xorl %eax, %eax
movq %rax, (%r13)
movq %rax, 0x58(%rsp)
movq 0xd8(%rsp), %rax
leaq 0x58(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
leaq 0xc0(%rsp), %r8
testq %rax, %rax
je 0xc554
callq *%rax
jmp 0xc559
callq 0x3e1e
movq 0x58(%rsp), %rdi
callq 0x1030
testq %rbx, %rbx
je 0xc56e
cmpq %r12, (%r13)
jae 0xc575
movq (%r13), %r12
movl %ebx, (%rsp)
incq %rbx
addq $0x8, %r13
cmpq $0x5, %rbx
jne 0xc4fe
movq 0x30(%rsp), %rsi
movq %rsi, %rax
movq 0x38(%rsp), %r8
imulq %r8, %rax
movq 0x20(%rsp), %rcx
movl (%rsp), %edx
movb %dl, (%rcx,%rax)
cmpl $0x8, 0x10(%rsp)
movq 0x40(%rsp), %rdi
jb 0xc5c9
movl (%rsp), %eax
movq 0x90(%rsp,%rax,8), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
movb %dl, (%rdi,%rcx)
incq %rcx
cmpl %ecx, %r15d
jne 0xc5bb
incq %r8
addq %rsi, %rdi
cmpq 0x28(%rsp), %r8
jne 0xc4da
xorl %ebx, %ebx
movq 0x50(%rsp), %r12
movq 0x90(%rsp,%rbx,8), %rdi
callq 0x1030
incq %rbx
cmpq $0x5, %rbx
jne 0xc5e1
movl $0x53, %eax
cmpq $0x5, %r12
je 0xc78c
jmp 0xc78e
movq %r13, 0x28(%rsp)
movq %r14, 0x18(%rsp)
testl %ebx, %ebx
je 0xc767
leaq 0x1(%r15), %rsi
movl %ebx, %eax
movq %rax, 0x30(%rsp)
leaq 0x1(%r12), %rdi
xorl %r8d, %r8d
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
movq %rsi, 0x38(%rsp)
movq %rdi, (%rsp)
movq %rbx, %r13
movq %r8, 0x40(%rsp)
movq %r8, %rbx
imulq %r15, %rbx
addq 0x48(%rsp), %rbx
xorl %r12d, %r12d
movq 0x60(%rsp,%r12,8), %rbp
movzbl %r12b, %r9d
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq 0x18(%rsp), %r8
callq 0xc7a0
movq $0x0, 0xc0(%rsp,%r12,8)
testq %r12, %r12
je 0xc6be
cmpl $0x8, 0x10(%rsp)
jb 0xc6e7
movq 0xc0(%rsp,%r12,8), %rax
xorl %ecx, %ecx
movzbl (%rbp,%rcx), %edx
movl %edx, %esi
xorl $0xff, %esi
testb %dl, %dl
cmovnsl %edx, %esi
addq %rsi, %rax
incq %rcx
cmpl %ecx, %r15d
jne 0xc69f
jmp 0xc6df
cmpl $0x8, 0x10(%rsp)
jb 0xc6e7
movq 0xc0(%rsp,%r12,8), %rax
xorl %ecx, %ecx
movzbl (%rbp,%rcx), %edx
addq %rdx, %rax
incq %rcx
cmpl %ecx, %r15d
jne 0xc6cf
movq %rax, 0xc0(%rsp,%r12,8)
testq %r12, %r12
je 0xc6f6
cmpq %r14, 0xc0(%rsp,%r12,8)
jae 0xc706
movq 0xc0(%rsp,%r12,8), %r14
movl %r12d, %eax
movq %rax, 0x8(%rsp)
incq %r12
cmpq $0x5, %r12
jne 0xc65e
movq 0x38(%rsp), %rsi
movq %rsi, %rax
movq 0x40(%rsp), %r8
imulq %r8, %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rdx
movb %dl, (%rcx,%rax)
cmpl $0x8, 0x10(%rsp)
movq (%rsp), %rdi
jb 0xc756
movzbl 0x8(%rsp), %eax
movq 0x60(%rsp,%rax,8), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
movb %dl, (%rdi,%rcx)
incq %rcx
cmpl %ecx, %r15d
jne 0xc748
incq %r8
addq %rsi, %rdi
cmpq 0x30(%rsp), %r8
jne 0xc643
xorl %ebx, %ebx
movq 0x28(%rsp), %r13
movq 0x60(%rsp,%rbx,8), %rdi
callq 0x1030
incq %rbx
cmpq $0x5, %rbx
jne 0xc76e
movl $0x53, %eax
cmpq $0x5, %r13
jne 0xc78e
xorl %eax, %eax
addq $0x4c8, %rsp            # imm = 0x4C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq