// File: /workspace/github_cpp_makefile_star2_O3/phillip-h[P]fractal-gen/lodepng.cpp
// Function: filter(unsigned char*, unsigned char const*, unsigned int, unsigned int, LodePNGColorMode const*, LodePNGEncoderSettings const*)
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 $0x518, %rsp            # imm = 0x518
movl %ecx, %ebx
movq %rsi, %rbp
movq %rdi, %r12
xorl %r13d, %r13d
cmpl $0x6, %r8d
ja 0xf666
leaq 0x2b65(%rip), %rcx      # 0x121c4
movl %r8d, %eax
movl (%rcx,%rax,4), %r13d
imull %r9d, %r13d
testl %r13d, %r13d
je 0xf71d
movq 0x550(%rsp), %rdi
xorl %esi, %esi
cmpl $0x8, %r9d
movl 0x38(%rdi), %ecx
movl %ecx, %eax
cmovbl %esi, %eax
cmpl $0x3, %r8d
cmovel %esi, %eax
cmpl $0x0, 0x34(%rdi)
cmovel %ecx, %eax
cmpl $0x4, %eax
ja 0xfe32
leaq 0x2219(%rip), %rcx      # 0x118c0
imull %r13d, %edx
addl $0x7, %r13d
movq %r12, 0x58(%rsp)
movslq (%rcx,%rax,4), %rax
shrl $0x3, %r13d
addl $0x7, %edx
movl %edx, %r15d
movl %edx, 0x8(%rsp)
shrl $0x3, %r15d
addq %rcx, %rax
jmpq *%rax
testl %ebx, %ebx
je 0xfe27
leaq 0x1(%r15), %rax
leaq 0x1(%r12), %rdx
movl %ebx, %ecx
xorl %esi, %esi
movq %rax, %rdi
imulq %rsi, %rdi
cmpl $0x8, 0x8(%rsp)
movb $0x0, (%r12,%rdi)
jb 0xf70a
xorl %edi, %edi
movb (%rbp,%rdi), %r8b
movb %r8b, (%rdx,%rdi)
incq %rdi
cmpq %rdi, %r15
jne 0xf6f9
incq %rsi
addq %rax, %rdx
addq %r15, %rbp
cmpq %rcx, %rsi
jne 0xf6e4
jmp 0xfe27
movl $0x1f, %eax
jmp 0xfe37
testl %ebx, %ebx
je 0xfe27
leaq 0x1(%r15), %rax
incq %r12
movq %r13, 0x10(%rsp)
xorl %edx, %edx
movq %rax, 0x8(%rsp)
movq %rbp, %rax
movl %ebx, %ebp
xorl %ebx, %ebx
movq 0x40(%rdi), %rcx
movq 0x10(%rsp), %r8
movq %rax, %r14
movq %rdi, %r13
movq %r12, %rdi
movq %r14, %rsi
movzbl (%rcx,%rbx), %r9d
movq %r15, %rcx
movb %r9b, -0x1(%r12)
callq 0xfe49
addq 0x8(%rsp), %r12
incq %rbx
leaq (%r14,%r15), %rax
movq %r13, %rdi
movq %r14, %rdx
cmpq %rbx, %rbp
jne 0xf749
jmp 0xfe27
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x21e0
movq %rax, 0x70(%rsp,%r14,8)
testq %rax, %rax
je 0xfe2b
incq %r14
cmpq $0x5, %r14
jne 0xf78f
movq %r13, 0x10(%rsp)
movq %rbp, 0x30(%rsp)
testl %ebx, %ebx
je 0xf9c9
leaq 0x1(%r15), %rax
leaq 0x1(%r12), %rsi
vxorps %xmm1, %xmm1, %xmm1
xorl %edi, %edi
xorl %r13d, %r13d
xorl %ebp, %ebp
vcvtsi2ss %rax, %xmm0, %xmm6
movq %rax, 0xa0(%rsp)
movl %ebx, %eax
movq %rax, 0x18(%rsp)
vmovss %xmm6, 0x38(%rsp)
movq %r13, %rbx
movq %rdi, %r13
imulq %r15, %r13
addq 0x30(%rsp), %r13
xorl %r12d, %r12d
movq %rsi, 0x28(%rsp)
movq %rdi, 0x20(%rsp)
movq 0x70(%rsp,%r12,8), %r14
movq 0x10(%rsp), %r8
movzbl %r12b, %r9d
vmovaps %xmm1, 0x40(%rsp)
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r14, %rdi
callq 0xfe49
movl $0x400, %edx            # imm = 0x400
leaq 0x110(%rsp), %rdi
xorl %esi, %esi
callq 0x20b0
cmpl $0x8, 0x8(%rsp)
jb 0xf860
xorl %eax, %eax
movzbl (%r14,%rax), %ecx
incq %rax
incl 0x110(%rsp,%rcx,4)
cmpl %eax, %r15d
jne 0xf84c
vmovss 0x38(%rsp), %xmm6
vmovss 0x2ac2(%rip), %xmm7     # 0x12330
vmovss 0x2abe(%rip), %xmm8     # 0x12334
vmovss 0x2aba(%rip), %xmm9     # 0x12338
vmovss 0x2ab6(%rip), %xmm10    # 0x1233c
vmovss 0x2ab2(%rip), %xmm11    # 0x12340
vmovss 0x2aae(%rip), %xmm12    # 0x12344
vmovss 0x2aaa(%rip), %xmm13    # 0x12348
vmovss 0x2aa6(%rip), %xmm14    # 0x1234c
vmovss 0x2aa2(%rip), %xmm15    # 0x12350
vmovss 0x2a9c(%rip), %xmm16    # 0x12354
incl 0x110(%rsp,%r12,4)
vxorps %xmm0, %xmm0, %xmm0
xorl %eax, %eax
movl 0x110(%rsp,%rax,4), %ecx
vxorps %xmm1, %xmm1, %xmm1
testl %ecx, %ecx
je 0xf937
vcvtusi2ss %ecx, %xmm17, %xmm1
vxorps %xmm2, %xmm2, %xmm2
vdivss %xmm6, %xmm1, %xmm1
vdivss %xmm1, %xmm7, %xmm3
vucomiss %xmm8, %xmm3
jbe 0xf900
vaddss %xmm2, %xmm9, %xmm2
vmulss %xmm3, %xmm10, %xmm3
jmp 0xf8e7
vaddss %xmm7, %xmm2, %xmm2
vmulss %xmm3, %xmm12, %xmm3
vucomiss %xmm11, %xmm3
ja 0xf8f8
vmulss %xmm3, %xmm3, %xmm4
vmulss %xmm3, %xmm13, %xmm5
vmulss %xmm4, %xmm3, %xmm4
vmulss %xmm5, %xmm3, %xmm5
vdivss %xmm13, %xmm4, %xmm4
vmulss %xmm5, %xmm14, %xmm5
vaddss %xmm5, %xmm4, %xmm4
vfmadd231ss %xmm3, %xmm13, %xmm4 # xmm4 = (xmm13 * xmm3) + xmm4
vaddss %xmm4, %xmm15, %xmm3
vfmadd132ss %xmm16, %xmm2, %xmm3 # xmm3 = (xmm3 * xmm16) + xmm2
vmulss %xmm3, %xmm1, %xmm1
vaddss %xmm0, %xmm1, %xmm0
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0xf8c6
vmovaps 0x40(%rsp), %xmm1
testq %r12, %r12
sete %al
vucomiss %xmm0, %xmm1
seta %cl
orb %al, %cl
kmovd %ecx, %k1
cmovnel %r12d, %ebp
incq %r12
vmovss %xmm0, %xmm1, %xmm1 {%k1}
cmpq $0x5, %r12
jne 0xf80a
movq 0xa0(%rsp), %rax
movq 0x20(%rsp), %rdi
movq 0x58(%rsp), %rcx
movq 0x28(%rsp), %rsi
imulq %rdi, %rax
cmpl $0x8, 0x8(%rsp)
movb %bpl, (%rcx,%rax)
jb 0xf9b3
movl %ebp, %eax
movq 0x70(%rsp,%rax,8), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
movb %dl, (%rsi,%rcx)
incq %rcx
cmpl %ecx, %r15d
jne 0xf9a5
addq 0xa0(%rsp), %rsi
incq %rdi
cmpq 0x18(%rsp), %rdi
jne 0xf7ee
xorl %ebx, %ebx
movq 0x70(%rsp,%rbx,8), %rdi
callq 0x21b0
incq %rbx
cmpq $0x5, %rbx
jne 0xf9cb
jmp 0xfe27
vmovdqu (%rdi), %ymm0
vmovdqu 0x10(%rdi), %ymm1
xorl %r14d, %r14d
vmovdqu %ymm0, 0x110(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %ymm1, 0x120(%rsp)
movl $0x1, 0x110(%rsp)
vmovdqu %xmm0, 0x128(%rsp)
movq %r15, %rdi
vzeroupper
callq 0x21e0
movq %rax, 0xe0(%rsp,%r14,8)
testq %rax, %rax
je 0xfe2b
incq %r14
cmpq $0x5, %r14
jne 0xfa19
movq %r13, 0x10(%rsp)
testl %ebx, %ebx
je 0xfb93
movq 0x58(%rsp), %rcx
leaq 0x1(%r15), %rsi
movl %ebx, %eax
movq %rax, 0x18(%rsp)
xorl %r8d, %r8d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq $0x0, 0x40(%rsp)
movq %rbp, 0x30(%rsp)
movq %rsi, 0x20(%rsp)
leaq 0x1(%rcx), %rdi
movq 0x40(%rsp), %rax
movq %r8, 0x28(%rsp)
imulq %r15, %r8
movq %rdi, 0xa0(%rsp)
xorl %r14d, %r14d
addq %rbp, %r8
xorl %ebp, %ebp
movq %r8, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movq 0xe0(%rsp,%r14,8), %rbx
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %r8
movzbl %r14b, %r9d
movq %r15, %rcx
movq %rbx, %rdi
callq 0xfe49
xorl %eax, %eax
movq %rax, 0x70(%rsp,%r14,8)
movq %rax, 0x60(%rsp)
movq 0x128(%rsp), %rax
leaq 0x70(%rsp,%rbp), %rsi
leaq 0x60(%rsp), %rdi
leaq 0x110(%rsp), %r8
movq %rbx, %rdx
movq %r15, %rcx
testq %rax, %rax
je 0xfafe
callq *%rax
jmp 0xfb03
callq 0x6f8b
movq 0x60(%rsp), %rdi
callq 0x21b0
movq 0x70(%rsp,%r14,8), %rcx
testq %r14, %r14
sete %al
cmpq %r13, %rcx
setb %dl
orb %al, %dl
cmovneq %rcx, %r13
cmovnel %r14d, %r12d
incq %r14
addq $0x8, %rbp
cmpq $0x5, %r14
jne 0xfaa3
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %r8
movq 0x58(%rsp), %rcx
movq 0xa0(%rsp), %rdi
movq %rsi, %rax
imulq %r8, %rax
cmpl $0x8, 0x8(%rsp)
movb %r12b, (%rcx,%rax)
jb 0xfb7d
movl %r12d, %eax
movq 0xe0(%rsp,%rax,8), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
movb %dl, (%rdi,%rcx)
incq %rcx
cmpl %ecx, %r15d
jne 0xfb6f
movq 0x30(%rsp), %rbp
incq %r8
addq %rsi, %rdi
cmpq 0x18(%rsp), %r8
jne 0xfa7b
xorl %ebx, %ebx
movq 0xe0(%rsp,%rbx,8), %rdi
callq 0x21b0
incq %rbx
cmpq $0x5, %rbx
jne 0xfb95
jmp 0xfe27
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x21e0
movq %rax, 0x110(%rsp,%r14,8)
testq %rax, %rax
je 0xfe2b
incq %r14
cmpq $0x5, %r14
jne 0xfbb3
movq %r13, 0x10(%rsp)
movq %rbp, 0x30(%rsp)
testl %ebx, %ebx
je 0xfe0c
movl %ebx, %eax
movq %rax, 0x68(%rsp)
leal -0x1(%r15), %eax
leaq 0x1(%r15), %r8
leaq 0x1(%r12), %r9
xorl %r10d, %r10d
movq $0x0, 0x40(%rsp)
xorl %ecx, %ecx
leaq 0x8(%rax), %rbp
vpbroadcastq %rax, %zmm3
xorl %eax, %eax
movq %r8, 0x18(%rsp)
andq $-0x8, %rbp
vmovdqu64 %zmm3, 0xa0(%rsp)
movq 0x40(%rsp), %rdx
movq %r10, 0x20(%rsp)
imulq %r15, %r10
addq 0x30(%rsp), %r10
movq %r9, 0x28(%rsp)
movq %rdx, 0x38(%rsp)
xorl %edx, %edx
movq %r10, 0x40(%rsp)
movq %rdx, %r12
movq 0x110(%rsp,%rdx,8), %r14
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x10(%rsp), %r8
movzbl %r12b, %r9d
movl %ecx, %ebx
movq %rax, %r13
movq %r15, %rcx
movq %r14, %rdi
vzeroupper
callq 0xfe49
testq %r12, %r12
je 0xfcfd
vmovdqu64 0xa0(%rsp), %zmm3
vpmovsxbq 0x2558(%rip), %zmm4 # 0x121f0
cmpl $0x8, 0x8(%rsp)
jae 0xfca6
xorl %eax, %eax
jmp 0xfd94
vpbroadcastd 0x26a9(%rip), %ymm5 # 0x12358
vpxor %xmm1, %xmm1, %xmm1
xorl %eax, %eax
vpbroadcastq %rax, %zmm6
vmovdqa64 %zmm1, %zmm0
vporq %zmm4, %zmm6, %zmm1
vpcmpleuq %zmm3, %zmm1, %k1
vmovdqu8 (%r14,%rax), %xmm1 {%k1} {z}
addq $0x8, %rax
vpmovzxbd %xmm1, %ymm2    # ymm2 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero,xmm1[4],zero,zero,zero,xmm1[5],zero,zero,zero,xmm1[6],zero,zero,zero,xmm1[7],zero,zero,zero
vpmovb2m %xmm1, %k2
vpxord %ymm5, %ymm2, %ymm2 {%k2}
vpmovzxdq %ymm2, %zmm1    # zmm1 = ymm2[0],zero,ymm2[1],zero,ymm2[2],zero,ymm2[3],zero,ymm2[4],zero,ymm2[5],zero,ymm2[6],zero,ymm2[7],zero
vpaddq %zmm1, %zmm0, %zmm1
cmpq %rax, %rbp
jne 0xfcb5
jmp 0xfd64
vmovdqu64 0xa0(%rsp), %zmm3
vpmovsxbq 0x24de(%rip), %zmm2 # 0x121f0
xorl %ecx, %ecx
cmpl $0x8, 0x8(%rsp)
movl $0x1, %edx
movl $0x0, %eax
jb 0xfc4d
vpxor %xmm1, %xmm1, %xmm1
xorl %eax, %eax
vpbroadcastq %rax, %zmm4
vmovdqa64 %zmm1, %zmm0
vporq %zmm2, %zmm4, %zmm1
vpcmpleuq %zmm3, %zmm1, %k1
vmovdqu8 (%r14,%rax), %xmm1 {%k1} {z}
addq $0x8, %rax
vpmovzxbq %xmm1, %zmm1    # zmm1 = xmm1[0],zero,zero,zero,zero,zero,zero,zero,xmm1[1],zero,zero,zero,zero,zero,zero,zero,xmm1[2],zero,zero,zero,zero,zero,zero,zero,xmm1[3],zero,zero,zero,zero,zero,zero,zero,xmm1[4],zero,zero,zero,zero,zero,zero,zero,xmm1[5],zero,zero,zero,zero,zero,zero,zero,xmm1[6],zero,zero,zero,zero,zero,zero,zero,xmm1[7],zero,zero,zero,zero,zero,zero,zero
vpaddq %zmm1, %zmm0, %zmm1
cmpq %rax, %rbp
jne 0xfd2f
vmovdqa64 %zmm1, %zmm0 {%k1}
vextracti64x4 $0x1, %zmm0, %ymm1
vpaddq %zmm1, %zmm0, %zmm0
vextracti128 $0x1, %ymm0, %xmm1
vpaddq %xmm1, %xmm0, %xmm0
vpshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
vpaddq %xmm1, %xmm0, %xmm0
vmovq %xmm0, %rax
testq %r12, %r12
je 0xfda7
cmpq %r13, %rax
movzbl %r12b, %edx
movzbl %bl, %ecx
cmovaeq %r13, %rax
cmovbl %edx, %ecx
jmp 0xfda9
xorl %ecx, %ecx
incq %r12
movq %r12, %rdx
cmpq $0x5, %r12
jne 0xfc4d
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %r10
movq 0x58(%rsp), %rsi
movq 0x28(%rsp), %r9
movq %r8, %rdx
imulq %r10, %rdx
cmpl $0x8, 0x8(%rsp)
movb %cl, (%rsi,%rdx)
jb 0xfdfb
movzbl %cl, %edx
xorl %esi, %esi
movq 0x110(%rsp,%rdx,8), %rdx
movb (%rdx,%rsi), %dil
movb %dil, (%r9,%rsi)
incq %rsi
cmpl %esi, %r15d
jne 0xfdeb
incq %r10
addq %r8, %r9
cmpq 0x68(%rsp), %r10
jne 0xfc29
xorl %ebx, %ebx
movq 0x110(%rsp,%rbx,8), %rdi
vzeroupper
callq 0x21b0
incq %rbx
cmpq $0x5, %rbx
jne 0xfe0e
xorl %eax, %eax
jmp 0xfe37
movl $0x53, %eax
jmp 0xfe37
movl $0x58, %eax
addq $0x518, %rsp            # imm = 0x518
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq