// File: /workspace/github_cpp_makefile_star2_O1/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 $0x508, %rsp            # imm = 0x508
movq %r9, %r13
movq %rsi, %r12
movq %rdi, %rbp
movl (%r8), %eax
movl 0x4(%r8), %r8d
xorl %ebx, %ebx
cmpq $0x6, %rax
ja 0xfa82
leaq 0x2705(%rip), %rsi      # 0x12184
movl (%rsi,%rax,4), %ebx
imull %r8d, %ebx
testl %ebx, %ebx
je 0xfb39
movl 0x38(%r13), %edi
xorl %esi, %esi
cmpl $0x8, %r8d
movl %edi, %r8d
cmovbl %esi, %r8d
cmpl $0x3, %eax
cmovel %esi, %r8d
cmpl $0x0, 0x34(%r13)
cmovel %edi, %r8d
cmpl $0x4, %r8d
ja 0xfcb8
imull %ebx, %edx
addl $0x7, %edx
movl %edx, 0x10(%rsp)
movl %edx, %r15d
shrl $0x3, %r15d
addl $0x7, %ebx
shrl $0x3, %ebx
leaq 0x1da9(%rip), %rax      # 0x11880
movslq (%rax,%r8,4), %rdx
addq %rax, %rdx
movq %rbp, 0x28(%rsp)
jmpq *%rdx
testl %ecx, %ecx
je 0x10310
movq %r12, %r9
leaq 0x1(%r15), %rax
movl %ecx, %ecx
leaq 0x1(%rbp), %rdx
xorl %esi, %esi
movq %rax, %rdi
imulq %rsi, %rdi
movb $0x0, (%rbp,%rdi)
cmpl $0x8, 0x10(%rsp)
jb 0xfb21
xorl %edi, %edi
movb (%r9,%rdi), %r8b
movb %r8b, (%rdx,%rdi)
incq %rdi
cmpq %rdi, %r15
jne 0xfb11
incq %rsi
addq %rax, %rdx
addq %r15, %r9
cmpq %rcx, %rsi
movq 0x28(%rsp), %rbp
jne 0xfafc
jmp 0x10310
movl $0x1f, %eax
jmp 0x10312
testl %ecx, %ecx
je 0x10310
movq %rbp, %r14
movq %r12, %rax
movq %rbx, %r12
leaq 0x1(%r15), %rdx
movq %rdx, 0x10(%rsp)
movl %ecx, %ecx
movq %rcx, 0x20(%rsp)
incq %r14
xorl %ebp, %ebp
xorl %edx, %edx
movq %rax, %rbx
movq 0x40(%r13), %rax
movzbl (%rax,%rbp), %r9d
movb %r9b, -0x1(%r14)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
movq %r12, %r8
callq 0x10324
incq %rbp
addq 0x10(%rsp), %r14
leaq (%rbx,%r15), %rax
movq %rbx, %rdx
cmpq %rbp, 0x20(%rsp)
jne 0xfb6b
jmp 0x10310
movl %ecx, %r13d
movq %r15, %rdi
callq 0x21e0
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0xfcae
movl $0x1, %ecx
movq %rcx, %r14
cmpq $0x5, %rcx
je 0xfcc2
movq %r15, %rdi
callq 0x21e0
movq %rax, 0x60(%rsp,%r14,8)
leaq 0x1(%r14), %rcx
testq %rax, %rax
jne 0xfbc5
jmp 0x10305
movl %ecx, %ebp
vmovdqu (%r13), %ymm0
vmovdqu 0x10(%r13), %ymm1
vmovdqu %ymm0, 0x100(%rsp)
vmovdqu %ymm1, 0x110(%rsp)
movl $0x1, 0x100(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, 0x118(%rsp)
movq %r15, %rdi
vzeroupper
callq 0x21e0
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0xfcae
movl $0x1, %ecx
movq %rcx, %r14
cmpq $0x5, %rcx
je 0xff31
movq %r15, %rdi
callq 0x21e0
movq %rax, 0x90(%rsp,%r14,8)
leaq 0x1(%r14), %rcx
testq %rax, %rax
jne 0xfc42
jmp 0x10305
movl %ecx, %ebp
movq %r15, %rdi
callq 0x21e0
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0xfcae
movl $0x1, %ecx
movq %rcx, %r14
cmpq $0x5, %rcx
je 0x100a9
movq %r15, %rdi
callq 0x21e0
movq %rax, 0x60(%rsp,%r14,8)
leaq 0x1(%r14), %rcx
testq %rax, %rax
jne 0xfc86
jmp 0x10305
movl $0x53, %eax
jmp 0x10312
movl $0x58, %eax
jmp 0x10312
movq %r14, 0x30(%rsp)
testl %r13d, %r13d
je 0xff12
movq %rbx, %r14
leaq 0x1(%r15), %rsi
vcvtsi2ss %rsi, %xmm0, %xmm0
vmovss %xmm0, 0x8(%rsp)
movl %r13d, %eax
movq %rax, 0x38(%rsp)
leaq 0x1(%rbp), %rdi
vxorps %xmm0, %xmm0, %xmm0
vmovss %xmm0, 0x20(%rsp)
xorl %eax, %eax
xorl %r13d, %r13d
movl $0x0, 0xc0(%rsp)
movq %r12, 0x50(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdi, 0x48(%rsp)
movq %r13, %rbx
movq %rax, 0x18(%rsp)
movq %rax, %r13
imulq %r15, %r13
addq %r12, %r13
xorl %r12d, %r12d
movq 0x60(%rsp,%r12,8), %rbp
movzbl %r12b, %r9d
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x10324
movl $0x400, %edx            # imm = 0x400
leaq 0x100(%rsp), %rdi
xorl %esi, %esi
callq 0x20b0
cmpl $0x8, 0x10(%rsp)
jb 0xfd7a
xorl %eax, %eax
movzbl (%rbp,%rax), %ecx
incl 0x100(%rsp,%rcx,4)
incq %rax
cmpl %eax, %r15d
jne 0xfd66
incl 0x100(%rsp,%r12,4)
movl $0x0, 0x90(%rsp,%r12,4)
vxorps %xmm0, %xmm0, %xmm0
xorl %eax, %eax
vmovss 0x8(%rsp), %xmm6
vmovss 0x252e(%rip), %xmm7     # 0x122d0
vmovss 0x252a(%rip), %xmm8     # 0x122d4
vmovss 0x2526(%rip), %xmm9     # 0x122d8
vmovss 0x2522(%rip), %xmm10    # 0x122dc
vmovss 0x251e(%rip), %xmm11    # 0x122e0
vmovss 0x251a(%rip), %xmm12    # 0x122e4
vmovss 0x2516(%rip), %xmm13    # 0x122e8
vmovss 0x2512(%rip), %xmm14    # 0x122ec
vmovss 0x250e(%rip), %xmm15    # 0x122f0
vmovss 0x2508(%rip), %xmm16    # 0x122f4
movl 0x100(%rsp,%rax,4), %ecx
vxorps %xmm1, %xmm1, %xmm1
testl %ecx, %ecx
je 0xfe5d
vcvtusi2ss %ecx, %xmm17, %xmm1
vdivss %xmm6, %xmm1, %xmm1
vdivss %xmm1, %xmm7, %xmm3
vxorps %xmm2, %xmm2, %xmm2
vucomiss %xmm8, %xmm3
jbe 0xfe26
vaddss %xmm2, %xmm9, %xmm2
vmulss %xmm3, %xmm10, %xmm3
jmp 0xfe0d
vaddss %xmm7, %xmm2, %xmm2
vmulss %xmm3, %xmm12, %xmm3
vucomiss %xmm11, %xmm3
ja 0xfe1e
vmulss %xmm3, %xmm3, %xmm4
vmulss %xmm4, %xmm3, %xmm4
vdivss %xmm13, %xmm4, %xmm4
vmulss %xmm3, %xmm13, %xmm5
vmulss %xmm5, %xmm3, %xmm5
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 0xfdec
vmovss %xmm0, 0x90(%rsp,%r12,4)
testq %r12, %r12
je 0xfe8d
vmovss 0x20(%rsp), %xmm0
vucomiss 0x90(%rsp,%r12,4), %xmm0
jbe 0xfea5
vmovss 0x90(%rsp,%r12,4), %xmm0
vmovss %xmm0, 0x20(%rsp)
movl %r12d, 0xc0(%rsp)
incq %r12
cmpq $0x5, %r12
jne 0xfd2c
movq 0x40(%rsp), %rsi
movq %rsi, %rax
imulq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movl 0xc0(%rsp), %edx
movb %dl, (%rcx,%rax)
cmpl $0x8, 0x10(%rsp)
movq 0x48(%rsp), %rdi
jb 0xfef7
movl 0xc0(%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 0xfee9
movq 0x18(%rsp), %rax
incq %rax
addq %rsi, %rdi
cmpq 0x38(%rsp), %rax
movq 0x50(%rsp), %r12
jne 0xfd12
xorl %ebx, %ebx
movq 0x30(%rsp), %r14
movq 0x60(%rsp,%rbx,8), %rdi
callq 0x21b0
incq %rbx
cmpq $0x5, %rbx
jne 0xff19
jmp 0x10305
movq %r14, 0x30(%rsp)
movq %rbx, 0x20(%rsp)
movq %r12, 0x50(%rsp)
testl %ebp, %ebp
je 0x10087
leaq 0x1(%r15), %rsi
movl %ebp, %eax
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rax
leaq 0x1(%rax), %rdi
xorl %r8d, %r8d
movl $0x0, 0xc0(%rsp)
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x8(%rsp), %rbp
movq %r8, 0x48(%rsp)
imulq %r15, %r8
addq 0x50(%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 0x20(%rsp), %r8
callq 0x10324
xorl %eax, %eax
movq %rax, (%r13)
movq %rax, 0x58(%rsp)
movq 0x118(%rsp), %rax
leaq 0x58(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
leaq 0x100(%rsp), %r8
testq %rax, %rax
je 0xfff5
callq *%rax
jmp 0xfffa
callq 0x6f94
movq 0x58(%rsp), %rdi
callq 0x21b0
testq %rbx, %rbx
je 0x1000f
cmpq %r12, (%r13)
jae 0x1001a
movq (%r13), %r12
movl %ebx, 0xc0(%rsp)
incq %rbx
addq $0x8, %r13
cmpq $0x5, %rbx
jne 0xff9f
movq 0x40(%rsp), %rsi
movq %rsi, %rax
movq 0x48(%rsp), %r8
imulq %r8, %rax
movq 0x28(%rsp), %rcx
movl 0xc0(%rsp), %edx
movb %dl, (%rcx,%rax)
cmpl $0x8, 0x10(%rsp)
movq 0x18(%rsp), %rdi
jb 0x10076
movl 0xc0(%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 0x10068
incq %r8
addq %rsi, %rdi
cmpq 0x38(%rsp), %r8
jne 0xff7b
xorl %ebx, %ebx
movq 0x30(%rsp), %r14
movq 0x90(%rsp,%rbx,8), %rdi
callq 0x21b0
incq %rbx
cmpq $0x5, %rbx
jne 0x1008e
jmp 0x10305
movq %r14, 0x88(%rsp)
movq %rbx, 0x20(%rsp)
movq %r12, 0x50(%rsp)
testl %ebp, %ebp
je 0x102e5
leaq 0x1(%r15), %rsi
movl %ebp, %eax
movq %rax, 0x30(%rsp)
leal -0x1(%r15), %eax
leaq 0x8(%rax), %r14
andq $-0x8, %r14
vpbroadcastq %rax, %zmm0
vmovdqu64 %zmm0, 0xc0(%rsp)
movq 0x28(%rsp), %rax
leaq 0x1(%rax), %rdi
xorl %r8d, %r8d
movq $0x0, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
movq %rsi, 0x38(%rsp)
movq %rdi, 0x48(%rsp)
movq 0x8(%rsp), %r13
movq %r8, 0x40(%rsp)
imulq %r15, %r8
addq 0x50(%rsp), %r8
movq %r8, 0x8(%rsp)
xorl %ebx, %ebx
movq 0x60(%rsp,%rbx,8), %rbp
movzbl %bl, %r9d
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movq %r15, %rcx
movq 0x20(%rsp), %r8
vzeroupper
callq 0x10324
movq $0x0, 0x100(%rsp,%rbx,8)
testq %rbx, %rbx
je 0x101dc
cmpl $0x8, 0x10(%rsp)
vmovdqu64 0xc0(%rsp), %zmm3
vpmovsxbq 0x203f(%rip), %zmm4 # 0x121b8
vpbroadcastd 0x2176(%rip), %ymm5 # 0x122f8
jb 0x10265
vmovq 0x100(%rsp,%rbx,8), %xmm1
xorl %eax, %eax
vmovdqa64 %zmm1, %zmm0
vpbroadcastq %rax, %zmm1
vporq %zmm4, %zmm1, %zmm1
vpcmpleuq %zmm3, %zmm1, %k1
vmovdqu8 (%rbp,%rax), %xmm1 {%k1} {z}
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
addq $0x8, %rax
cmpq %rax, %r14
jne 0x10193
jmp 0x10236
cmpl $0x8, 0x10(%rsp)
vmovdqu64 0xc0(%rsp), %zmm2
vpmovsxbq 0x1fc5(%rip), %zmm3 # 0x121b8
jb 0x10265
vmovq 0x100(%rsp,%rbx,8), %xmm1
xorl %eax, %eax
vmovdqa64 %zmm1, %zmm0
vpbroadcastq %rax, %zmm1
vporq %zmm3, %zmm1, %zmm1
vpcmpleuq %zmm2, %zmm1, %k1
vmovdqu8 (%rbp,%rax), %xmm1 {%k1} {z}
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
addq $0x8, %rax
cmpq %rax, %r14
jne 0x10200
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, 0x100(%rsp,%rbx,8)
testq %rbx, %rbx
je 0x10274
cmpq %r12, 0x100(%rsp,%rbx,8)
jae 0x10283
movq 0x100(%rsp,%rbx,8), %r12
movl %ebx, %eax
movq %rax, 0x18(%rsp)
incq %rbx
cmpq $0x5, %rbx
jne 0x1012d
movq 0x38(%rsp), %rsi
movq %rsi, %rax
movq 0x40(%rsp), %r8
imulq %r8, %rax
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rdx
movb %dl, (%rcx,%rax)
cmpl $0x8, 0x10(%rsp)
movq 0x48(%rsp), %rdi
jb 0x102d4
movzbl 0x18(%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 0x102c6
incq %r8
addq %rsi, %rdi
cmpq 0x30(%rsp), %r8
jne 0x1010e
xorl %ebx, %ebx
movq 0x88(%rsp), %r14
movq 0x60(%rsp,%rbx,8), %rdi
vzeroupper
callq 0x21b0
incq %rbx
cmpq $0x5, %rbx
jne 0x102ef
movl $0x53, %eax
cmpq $0x5, %r14
jne 0x10312
xorl %eax, %eax
addq $0x508, %rsp            # imm = 0x508
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq