// File: WojciechMula[P]utf16utf8/src/sse.cpp
// Function: sse_convert_utf16_to_utf8_hybrid(unsigned short const*, unsigned long, unsigned char*)
size_t sse_convert_utf16_to_utf8_hybrid(const uint16_t *input, size_t size,
                                        uint8_t *output) {

  const uint16_t *end = input + (size & ~0x7); // round down size to 8
  uint8_t *start = output;
  while (input != end) {
    const __m128i in = _mm_loadu_si128((__m128i *)input);
    // 1. test for ASCII

    const __m128i lt0080 =
        _mm_cmpeq_epi16(_mm_setzero_si128(),
                        _mm_and_si128(in, _mm_set1_epi16((int16_t)0xff80)));
    uint16_t ascii_patterns = uint16_t(_mm_movemask_epi8(lt0080));

    if (ascii_patterns == 0xFFFF) {
      // Fast path: only ASCII values

      // [0000|0000|0ccc|dddd] => [0ccc|dddd]
      const __m128i lt0 = _mm_packus_epi16(in, in);
      uint64_t tmp = _mm_cvtsi128_si64(lt0);
      memcpy(output, &tmp, 8);
      output += 8;
      input += 8;
      continue;
    }

    ascii_patterns &= 0x5555;
       
    // 0. determine how many bytes each 16-bit value produces
    //      1 byte  =     (in < 0x0080)
    //      2 bytes = not (in < 0x0080) and (in < 0x0800)
    //      3 bytes = not (in < 0x0800)

    const __m128i lt0800 =
        _mm_cmpeq_epi16(_mm_setzero_si128(),
                        _mm_and_si128(in, _mm_set1_epi16((int16_t)0xf800)));


    const uint16_t twobyte_patterns = uint16_t(_mm_movemask_epi8(lt0800));
    // 2. test for two-byte
    if (twobyte_patterns == 0xFFFF) {

      // twobyte_patterns
      // Fast path: values are in range 0x0000 ... 0x07ff
      // UTF16 codeword is valid and is expanded to either 1 or 2 bytes of UTF8

      // a. for values 00 .. 7f we have transformation (two UTF16 bytes -> one
      // UTF8 byte):
      //    [0000|0000|0ccc|dddd] => [0ccc|dddd]
      // b. for value  0080 .. 07ff we have (two UTF16 bytes -> two UTF8 bytes)
      //    [0000|0bbb|cccc|dddd] => [110b|bbcc|10cc|dddd]

      // tmp      = [0g0h|0i0j|0k0l|0m0n]
      // pattern  =           [gkhl|imjn]

      const uint8_t pattern = uint8_t(ascii_patterns | (ascii_patterns >> 7));

      // [0000|0000|0ccc|dddd]
      const __m128i utf8_1byte = in;

      __m128i byte0;
      __m128i byte1;
      __m128i word0;

      byte0 =
          _mm_and_si128(in, _mm_set1_epi16(0x003f)); // [0000|0000|00cc|dddd]
      byte1 = _mm_slli_epi16(in, 2);                 // [000b|bbcc|xxxx|xxxx]
      byte1 = _mm_and_si128(
          byte1, _mm_set1_epi16((int16_t)0x1f00)); // [000b|bbcc|0000|0000]

      word0 = _mm_or_si128(byte0, byte1); // [000b|bbcc|00cc|dddd]

      // update UTF8 markers:
      __m128i utf8_2bytes;
      utf8_2bytes = _mm_or_si128(
          word0, _mm_set1_epi16((int16_t)0xc080)); // [110b|bbcc|10cc|dddd]

      // keep in 16-bits proper UTF8 variants
      const __m128i utf8_t0 = _mm_blendv_epi8(utf8_2bytes, utf8_1byte, lt0080);

      // compress zeros from 1-byte words
      const __m128i lookup =
          _mm_loadu_si128((const __m128i *)compress_16bit_lookup[pattern]);
      const __m128i utf8 = _mm_shuffle_epi8(utf8_t0, lookup);

      _mm_storeu_si128((__m128i *)output, utf8);
      output += compress_16bit_length[pattern];
      input += 8;
      continue;
    }

    // 3. test if there are any surrogates

    __m128i basicplane =
        _mm_cmplt_epi16(_mm_sub_epi16(in, _mm_set1_epi16(uint16_t(0x5800))),
                        _mm_set1_epi16(uint16_t(0x8800)));

    if (_mm_movemask_epi8(basicplane)) {

      // for now only scalar fallback
      auto save_utf8 = [&output](uint32_t value) {
        auto save_bytes = [&output](int byte) { *output++ = uint8_t(byte); };
        encode_utf8(value, save_bytes);
      };

      bool malformed = false;
      int consumed = 8;
      auto on_error = [&consumed, &malformed](const uint16_t *data,
                                              const uint16_t *current,
                                              utf16::Error error) {
        const auto error_pos = (current - data);
        if (error == utf16::Error::missing_low_surrogate and error_pos == 7)
          consumed = 7; // hi surrogate at the and of 8-byte block, would
                        // reprocess it again
        else
          malformed = true;
      };

      utf16::decode(input, 8, save_utf8, on_error);
      if (malformed)
        return output - start;
      else
        input += consumed;

      continue;
    }
    // 4. finally, three-byte pattern

    {
      const uint16_t patterns = (ascii_patterns) | (twobyte_patterns & 0xaaaa);

      // input in range 0x0000 .. 0xffff

      // 1. prepare UTF8 bytes

      // output 1 UTF8 byte  : [0000|0000|0ccc|dddd] => [0ccc|dddd]
      // output 2 UTF8 bytes : [0000|0bbb|cccc|dddd] => [110b|bbcc], [10cc|dddd]
      // output 3 UTF8 bytes : [aaaa|bbbb|cccc|dddd] => [1110|aaaa],
      // [10bb|bbcc], [10cc|dddd]

      // a. 1 byte code equals to input
      __m128i word0_1 = in;

      // a. build 2 byte codes
      __m128i tmp;
      __m128i byte0_2;
      __m128i byte1_2;
      __m128i word0_2;

      // [0000|0bbb|cccc|dddd]
      byte0_2 =
          _mm_and_si128(in, _mm_set1_epi16(0x003f)); // [0000|0000|00cc|dddd]

      tmp = _mm_slli_epi32(in, 2); // [000b|bbcc|ccdd|dd00] // reused later
      byte1_2 =
          _mm_and_si128(tmp, _mm_set1_epi16(0x1f00)); // [000b|bbcc|0000|0000]

      const __m128i loct0 = _mm_set1_epi16((int16_t)0xc080);
      word0_2 = _mm_or_si128(byte0_2, byte1_2); // [000b|bbcc|00cc|dddd]
      word0_2 = _mm_or_si128(word0_2, loct0);   // [110b|bbcc|10cc|dddd]

      // b. build 3 byte codes
      __m128i byte0_3;
      __m128i byte1_3;
      __m128i byte2_3;
      __m128i word0_3;
      __m128i word1_3;

      byte0_3 = byte0_2; // reuse from 2-byte case                //
                         // [0000|0000|00cc|dddd]

      byte1_3 =
          _mm_and_si128(tmp, _mm_set1_epi16(0x3f00)); // [00bb|bbcc|0000|0000]

      const __m128i t1 = _mm_set1_epi16((int16_t)0x8080);
      word0_3 = _mm_or_si128(byte0_3, byte1_3); // [00bb|bbcc|00cc|dddd]
      word0_3 = _mm_or_si128(word0_3, t1);      // [10bb|bbcc|10cc|dddd]

      byte2_3 = _mm_srli_epi16(in, 12);
      byte2_3 = _mm_or_si128(byte2_3,
                             _mm_set1_epi16(0x00e0)); // [0000|0000|1110|aaaa]
      word1_3 = byte2_3;

      word0_1 = _mm_and_si128(lt0080, word0_1);

      const __m128i m2 = _mm_andnot_si128(lt0080, lt0800);
      word0_2 = _mm_and_si128(m2, word0_2);

      word0_3 = _mm_andnot_si128(lt0800, word0_3);
      word1_3 = _mm_andnot_si128(lt0800, word1_3);

      // 2. expand 2-byte codes into 4-byte codes, possible dwords:
      //    - [0000|0000|0000|0000|0000|0000|0ccc|dddd]
      //    - [0000|0000|0000|0000|110b|bbcc|10cc|dddd]
      //    - [0000|0000|1110|aaaa|10bb|bbcc|10cc|dddd]

      __m128i word0;
      __m128i word1;
      word0 = nonstd::_mm_or_si128(word0_1, word0_2, word0_3);
      word1 = word1_3;

      __m128i dword_lo = _mm_unpacklo_epi16(word0, word1);
      __m128i dword_hi = _mm_unpackhi_epi16(word0, word1);

      // 3. compress bytes
      // a. compress lo dwords
      {
        const uint8_t pattern = uint8_t(patterns & 0x00ff);
        const __m128i lookup =
            _mm_loadu_si128((const __m128i *)compress_32bit_lookup[pattern]);
        const __m128i utf8 = _mm_shuffle_epi8(dword_lo, lookup);

        _mm_storeu_si128((__m128i *)output, utf8);
        output += compress_32bit_length[pattern];
      }

      // b. compress hi dwords
      {
        const uint8_t pattern = uint8_t(patterns >> 8);
        const __m128i lookup =
            _mm_loadu_si128((const __m128i *)compress_32bit_lookup[pattern]);
        const __m128i utf8 = _mm_shuffle_epi8(dword_hi, lookup);

        _mm_storeu_si128((__m128i *)output, utf8);
        output += compress_32bit_length[pattern];
      }
      input += 8;
    }
  }

  // process tail
  return output - start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9e0, %rsp            # imm = 0x9E0
movq %rdi, -0x6f0(%rbp)
movq %rsi, -0x6f8(%rbp)
movq %rdx, -0x700(%rbp)
movq -0x6f0(%rbp), %rax
movq -0x6f8(%rbp), %rcx
andq $-0x8, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x708(%rbp)
movq -0x700(%rbp), %rax
movq %rax, -0x710(%rbp)
movq -0x6f0(%rbp), %rax
cmpq -0x708(%rbp), %rax
je 0x532d
movq -0x6f0(%rbp), %rax
movq %rax, -0x6c8(%rbp)
movq -0x6c8(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0x720(%rbp)
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, -0x420(%rbp)
vmovdqa -0x420(%rbp), %xmm1
vmovdqa -0x720(%rbp), %xmm2
movw $0xff80, -0x582(%rbp)   # imm = 0xFF80
movw -0x582(%rbp), %ax
movw %ax, -0x9c2(%rbp)
movw %ax, -0x1a2(%rbp)
movw %ax, -0x1a4(%rbp)
movw %ax, -0x1a6(%rbp)
movw %ax, -0x1a8(%rbp)
movw %ax, -0x1aa(%rbp)
movw %ax, -0x1ac(%rbp)
movw %ax, -0x1ae(%rbp)
movw %ax, -0x1b0(%rbp)
movzwl -0x1b0(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x1ae(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x1ac(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x1aa(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x1a8(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x1a6(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x1a4(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x1a2(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x1c0(%rbp)
vmovdqa -0x1c0(%rbp), %xmm0
vmovdqa %xmm2, -0x5b0(%rbp)
vmovdqa %xmm0, -0x5c0(%rbp)
vmovdqa -0x5b0(%rbp), %xmm0
vmovdqa -0x5c0(%rbp), %xmm2
vpand %xmm2, %xmm0, %xmm0
vmovdqa %xmm1, -0x550(%rbp)
vmovdqa %xmm0, -0x560(%rbp)
vmovdqa -0x550(%rbp), %xmm0
vmovdqa -0x560(%rbp), %xmm1
vpcmpeqw %xmm1, %xmm0, %k0
vpmovm2w %k0, %xmm0
vmovdqa %xmm0, -0x730(%rbp)
vmovdqa -0x730(%rbp), %xmm0
vmovdqa %xmm0, -0x440(%rbp)
vmovdqa -0x440(%rbp), %xmm0
vpmovmskb %xmm0, %eax
movw %ax, -0x732(%rbp)
movzwl -0x732(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x4035
vmovdqa -0x720(%rbp), %xmm0
vmovdqa %xmm0, -0x3d0(%rbp)
vmovdqa %xmm0, -0x3e0(%rbp)
vmovdqa -0x3d0(%rbp), %xmm0
vmovdqa -0x3e0(%rbp), %xmm1
vpackuswb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x750(%rbp)
vmovdqa -0x750(%rbp), %xmm0
vmovdqa %xmm0, -0x3c0(%rbp)
movq -0x3c0(%rbp), %rax
movq %rax, -0x758(%rbp)
movq -0x700(%rbp), %rax
movq -0x758(%rbp), %rcx
movq %rcx, (%rax)
movq -0x700(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x700(%rbp)
movq -0x6f0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x6f0(%rbp)
jmp 0x3e0d
movw -0x732(%rbp), %ax
andw $0x5555, %ax            # imm = 0x5555
movw %ax, -0x732(%rbp)
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, -0x430(%rbp)
vmovdqa -0x430(%rbp), %xmm1
vmovdqa -0x720(%rbp), %xmm2
movw $0xf800, -0x584(%rbp)   # imm = 0xF800
movw -0x584(%rbp), %ax
movw %ax, -0x9c4(%rbp)
movw %ax, -0x182(%rbp)
movw %ax, -0x184(%rbp)
movw %ax, -0x186(%rbp)
movw %ax, -0x188(%rbp)
movw %ax, -0x18a(%rbp)
movw %ax, -0x18c(%rbp)
movw %ax, -0x18e(%rbp)
movw %ax, -0x190(%rbp)
movzwl -0x190(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x18e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x18c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x18a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x188(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x186(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x184(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x182(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x1a0(%rbp)
vmovdqa -0x1a0(%rbp), %xmm0
vmovdqa %xmm2, -0x5d0(%rbp)
vmovdqa %xmm0, -0x5e0(%rbp)
vmovdqa -0x5d0(%rbp), %xmm0
vmovdqa -0x5e0(%rbp), %xmm2
vpand %xmm2, %xmm0, %xmm0
vmovdqa %xmm1, -0x570(%rbp)
vmovdqa %xmm0, -0x580(%rbp)
vmovdqa -0x570(%rbp), %xmm0
vmovdqa -0x580(%rbp), %xmm1
vpcmpeqw %xmm1, %xmm0, %k0
vpmovm2w %k0, %xmm0
vmovdqa %xmm0, -0x770(%rbp)
vmovdqa -0x770(%rbp), %xmm0
vmovdqa %xmm0, -0x450(%rbp)
vmovdqa -0x450(%rbp), %xmm0
vpmovmskb %xmm0, %eax
movw %ax, -0x772(%rbp)
movzwl -0x772(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x464a
movzwl -0x732(%rbp), %eax
movl %eax, %ecx
shrl $0x7, %ecx
orl %ecx, %eax
movb %al, -0x773(%rbp)
vmovdqa -0x720(%rbp), %xmm0
vmovdqa %xmm0, -0x790(%rbp)
vmovdqa -0x720(%rbp), %xmm1
movw $0x3f, -0x586(%rbp)
movw -0x586(%rbp), %ax
movw %ax, -0x9ca(%rbp)
movw %ax, -0x162(%rbp)
movw %ax, -0x164(%rbp)
movw %ax, -0x166(%rbp)
movw %ax, -0x168(%rbp)
movw %ax, -0x16a(%rbp)
movw %ax, -0x16c(%rbp)
movw %ax, -0x16e(%rbp)
movw %ax, -0x170(%rbp)
movzwl -0x170(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x16e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x16c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x16a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x168(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x166(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x164(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x162(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x180(%rbp)
vmovdqa -0x180(%rbp), %xmm0
vmovdqa %xmm1, -0x5f0(%rbp)
vmovdqa %xmm0, -0x600(%rbp)
vmovdqa -0x5f0(%rbp), %xmm0
vmovdqa -0x600(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x7a0(%rbp)
vmovdqa -0x720(%rbp), %xmm0
vmovdqa %xmm0, -0x3a0(%rbp)
movl $0x2, -0x3a4(%rbp)
vmovdqa -0x3a0(%rbp), %xmm0
vmovd -0x3a4(%rbp), %xmm1
vpsllw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x7b0(%rbp)
vmovdqa -0x7b0(%rbp), %xmm1
movw $0x1f00, -0x588(%rbp)   # imm = 0x1F00
movw -0x588(%rbp), %ax
movw %ax, -0x9c8(%rbp)
movw %ax, -0x142(%rbp)
movw %ax, -0x144(%rbp)
movw %ax, -0x146(%rbp)
movw %ax, -0x148(%rbp)
movw %ax, -0x14a(%rbp)
movw %ax, -0x14c(%rbp)
movw %ax, -0x14e(%rbp)
movw %ax, -0x150(%rbp)
movzwl -0x150(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x14e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x14c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x14a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x148(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x146(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x144(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x142(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x160(%rbp)
vmovdqa -0x160(%rbp), %xmm0
vmovdqa %xmm1, -0x610(%rbp)
vmovdqa %xmm0, -0x620(%rbp)
vmovdqa -0x610(%rbp), %xmm0
vmovdqa -0x620(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x7b0(%rbp)
vmovdqa -0x7a0(%rbp), %xmm1
vmovdqa -0x7b0(%rbp), %xmm0
vmovdqa %xmm1, -0x470(%rbp)
vmovdqa %xmm0, -0x480(%rbp)
vmovdqa -0x470(%rbp), %xmm0
vmovdqa -0x480(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x7c0(%rbp)
vmovdqa -0x7c0(%rbp), %xmm1
movw $0xc080, -0x58a(%rbp)   # imm = 0xC080
movw -0x58a(%rbp), %ax
movw %ax, -0x9c6(%rbp)
movw %ax, -0x122(%rbp)
movw %ax, -0x124(%rbp)
movw %ax, -0x126(%rbp)
movw %ax, -0x128(%rbp)
movw %ax, -0x12a(%rbp)
movw %ax, -0x12c(%rbp)
movw %ax, -0x12e(%rbp)
movw %ax, -0x130(%rbp)
movzwl -0x130(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x12e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x12c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x12a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x128(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x126(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x124(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x122(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x140(%rbp)
vmovdqa -0x140(%rbp), %xmm0
vmovdqa %xmm1, -0x490(%rbp)
vmovdqa %xmm0, -0x4a0(%rbp)
vmovdqa -0x490(%rbp), %xmm0
vpor -0x4a0(%rbp), %xmm0, %xmm0
vmovdqa %xmm0, -0x7d0(%rbp)
vmovdqa -0x7d0(%rbp), %xmm2
vmovdqa -0x790(%rbp), %xmm1
vmovdqa -0x730(%rbp), %xmm0
vmovdqa %xmm2, -0x3f0(%rbp)
vmovdqa %xmm1, -0x400(%rbp)
vmovdqa %xmm0, -0x410(%rbp)
vmovdqa -0x3f0(%rbp), %xmm0
vmovdqa -0x400(%rbp), %xmm1
vmovdqa -0x410(%rbp), %xmm2
vpblendvb %xmm2, %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x7e0(%rbp)
movzbl -0x773(%rbp), %eax
movl %eax, %ecx
leaq 0xfab4(%rip), %rax      # 0x14030
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x6d0(%rbp)
movq -0x6d0(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0x7f0(%rbp)
vmovdqa -0x7e0(%rbp), %xmm1
vmovdqa -0x7f0(%rbp), %xmm0
vmovdqa %xmm1, -0x340(%rbp)
vmovdqa %xmm0, -0x350(%rbp)
vmovdqa -0x340(%rbp), %xmm0
vmovdqa -0x350(%rbp), %xmm1
vpshufb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x800(%rbp)
movq -0x700(%rbp), %rax
vmovdqa -0x800(%rbp), %xmm0
movq %rax, -0x2e0(%rbp)
vmovdqa %xmm0, -0x2f0(%rbp)
vmovdqa -0x2f0(%rbp), %xmm0
movq -0x2e0(%rbp), %rax
vmovdqu %xmm0, (%rax)
movzbl -0x773(%rbp), %eax
movl %eax, %ecx
leaq 0x10a15(%rip), %rax     # 0x15030
movzbl (%rax,%rcx), %ecx
movq -0x700(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x700(%rbp)
movq -0x6f0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x6f0(%rbp)
jmp 0x3e0d
vmovdqa -0x720(%rbp), %xmm1
movw $0x5800, -0x58c(%rbp)   # imm = 0x5800
movw -0x58c(%rbp), %ax
movw %ax, -0x9ce(%rbp)
movw %ax, -0x102(%rbp)
movw %ax, -0x104(%rbp)
movw %ax, -0x106(%rbp)
movw %ax, -0x108(%rbp)
movw %ax, -0x10a(%rbp)
movw %ax, -0x10c(%rbp)
movw %ax, -0x10e(%rbp)
movw %ax, -0x110(%rbp)
movzwl -0x110(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x10e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x10c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x10a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x108(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x106(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x104(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x102(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x120(%rbp)
vmovdqa -0x120(%rbp), %xmm0
vmovdqa %xmm1, -0x1d0(%rbp)
vmovdqa %xmm0, -0x1e0(%rbp)
vmovdqa -0x1d0(%rbp), %xmm0
vmovdqa -0x1e0(%rbp), %xmm1
vpsubw %xmm1, %xmm0, %xmm1
movw $0x8800, -0x58e(%rbp)   # imm = 0x8800
movw -0x58e(%rbp), %ax
movw %ax, -0x9cc(%rbp)
movw %ax, -0xe2(%rbp)
movw %ax, -0xe4(%rbp)
movw %ax, -0xe6(%rbp)
movw %ax, -0xe8(%rbp)
movw %ax, -0xea(%rbp)
movw %ax, -0xec(%rbp)
movw %ax, -0xee(%rbp)
movw %ax, -0xf0(%rbp)
movzwl -0xf0(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0xee(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0xec(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0xea(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0xe8(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0xe6(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0xe4(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0xe2(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x100(%rbp)
vmovdqa -0x100(%rbp), %xmm0
vmovdqa %xmm1, -0x1f0(%rbp)
vmovdqa %xmm0, -0x200(%rbp)
vmovdqa -0x200(%rbp), %xmm1
vmovdqa -0x1f0(%rbp), %xmm0
vmovdqa %xmm1, -0x10(%rbp)
vmovdqa %xmm0, -0x20(%rbp)
vmovdqa -0x10(%rbp), %xmm0
vmovdqa -0x20(%rbp), %xmm1
vpcmpgtw %xmm1, %xmm0, %k0
vpmovm2w %k0, %xmm0
vmovdqa %xmm0, -0x810(%rbp)
vmovdqa -0x810(%rbp), %xmm0
vmovdqa %xmm0, -0x460(%rbp)
vmovdqa -0x460(%rbp), %xmm0
vpmovmskb %xmm0, %eax
cmpl $0x0, %eax
je 0x4932
leaq -0x700(%rbp), %rax
movq %rax, -0x818(%rbp)
movb $0x0, -0x819(%rbp)
movl $0x8, -0x820(%rbp)
leaq -0x820(%rbp), %rax
movq %rax, -0x830(%rbp)
leaq -0x819(%rbp), %rax
movq %rax, -0x828(%rbp)
movq -0x6f0(%rbp), %rdi
movq -0x818(%rbp), %rax
movq %rax, -0x838(%rbp)
movq -0x830(%rbp), %rax
movq %rax, -0x848(%rbp)
movq -0x828(%rbp), %rax
movq %rax, -0x840(%rbp)
movq -0x838(%rbp), %rdx
movq -0x848(%rbp), %rcx
movq -0x840(%rbp), %r8
movl $0x8, %esi
callq 0x5360
testb $0x1, -0x819(%rbp)
je 0x4910
movq -0x700(%rbp), %rax
movq -0x710(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x6e8(%rbp)
jmp 0x5345
movl -0x820(%rbp), %ecx
movq -0x6f0(%rbp), %rax
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x6f0(%rbp)
jmp 0x3e0d
movzwl -0x732(%rbp), %eax
movzwl -0x772(%rbp), %ecx
andl $0xaaaa, %ecx           # imm = 0xAAAA
orl %ecx, %eax
movw %ax, -0x84a(%rbp)
vmovdqa -0x720(%rbp), %xmm0
vmovdqa %xmm0, -0x860(%rbp)
vmovdqa -0x720(%rbp), %xmm1
movw $0x3f, -0x590(%rbp)
movw -0x590(%rbp), %ax
movw %ax, -0x9da(%rbp)
movw %ax, -0xc2(%rbp)
movw %ax, -0xc4(%rbp)
movw %ax, -0xc6(%rbp)
movw %ax, -0xc8(%rbp)
movw %ax, -0xca(%rbp)
movw %ax, -0xcc(%rbp)
movw %ax, -0xce(%rbp)
movw %ax, -0xd0(%rbp)
movzwl -0xd0(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0xce(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0xcc(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0xca(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0xc8(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0xc6(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0xc4(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0xc2(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0xe0(%rbp)
vmovdqa -0xe0(%rbp), %xmm0
vmovdqa %xmm1, -0x630(%rbp)
vmovdqa %xmm0, -0x640(%rbp)
vmovdqa -0x630(%rbp), %xmm0
vmovdqa -0x640(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x880(%rbp)
vmovdqa -0x720(%rbp), %xmm0
vmovdqa %xmm0, -0x2d0(%rbp)
movl $0x2, -0x2d4(%rbp)
vmovdqa -0x2d0(%rbp), %xmm0
vmovd -0x2d4(%rbp), %xmm1
vpslld %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x870(%rbp)
vmovdqa -0x870(%rbp), %xmm1
movw $0x1f00, -0x592(%rbp)   # imm = 0x1F00
movw -0x592(%rbp), %ax
movw %ax, -0x9d8(%rbp)
movw %ax, -0xa2(%rbp)
movw %ax, -0xa4(%rbp)
movw %ax, -0xa6(%rbp)
movw %ax, -0xa8(%rbp)
movw %ax, -0xaa(%rbp)
movw %ax, -0xac(%rbp)
movw %ax, -0xae(%rbp)
movw %ax, -0xb0(%rbp)
movzwl -0xb0(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0xae(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0xac(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0xaa(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0xa8(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0xa6(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0xa4(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0xa2(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0xc0(%rbp)
vmovdqa -0xc0(%rbp), %xmm0
vmovdqa %xmm1, -0x650(%rbp)
vmovdqa %xmm0, -0x660(%rbp)
vmovdqa -0x650(%rbp), %xmm0
vmovdqa -0x660(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x890(%rbp)
movw $0xc080, -0x594(%rbp)   # imm = 0xC080
movw -0x594(%rbp), %ax
movw %ax, -0x9d6(%rbp)
movw %ax, -0x82(%rbp)
movw %ax, -0x84(%rbp)
movw %ax, -0x86(%rbp)
movw %ax, -0x88(%rbp)
movw %ax, -0x8a(%rbp)
movw %ax, -0x8c(%rbp)
movw %ax, -0x8e(%rbp)
movw %ax, -0x90(%rbp)
movzwl -0x90(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x8e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x8c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x8a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x88(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x86(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x84(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x82(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0xa0(%rbp)
vmovdqa -0xa0(%rbp), %xmm0
vmovdqa %xmm0, -0x8b0(%rbp)
vmovdqa -0x880(%rbp), %xmm1
vmovdqa -0x890(%rbp), %xmm0
vmovdqa %xmm1, -0x4b0(%rbp)
vmovdqa %xmm0, -0x4c0(%rbp)
vmovdqa -0x4b0(%rbp), %xmm0
vmovdqa -0x4c0(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8a0(%rbp)
vmovdqa -0x8a0(%rbp), %xmm1
vmovdqa -0x8b0(%rbp), %xmm0
vmovdqa %xmm1, -0x4d0(%rbp)
vmovdqa %xmm0, -0x4e0(%rbp)
vmovdqa -0x4d0(%rbp), %xmm0
vmovdqa -0x4e0(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8a0(%rbp)
vmovdqa -0x880(%rbp), %xmm0
vmovdqa %xmm0, -0x8c0(%rbp)
vmovdqa -0x870(%rbp), %xmm1
movw $0x3f00, -0x596(%rbp)   # imm = 0x3F00
movw -0x596(%rbp), %ax
movw %ax, -0x9d4(%rbp)
movw %ax, -0x62(%rbp)
movw %ax, -0x64(%rbp)
movw %ax, -0x66(%rbp)
movw %ax, -0x68(%rbp)
movw %ax, -0x6a(%rbp)
movw %ax, -0x6c(%rbp)
movw %ax, -0x6e(%rbp)
movw %ax, -0x70(%rbp)
movzwl -0x70(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x6e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x6c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x6a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x68(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x66(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x64(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x62(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x80(%rbp)
vmovdqa -0x80(%rbp), %xmm0
vmovdqa %xmm1, -0x670(%rbp)
vmovdqa %xmm0, -0x680(%rbp)
vmovdqa -0x670(%rbp), %xmm0
vmovdqa -0x680(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8d0(%rbp)
movw $0x8080, -0x598(%rbp)   # imm = 0x8080
movw -0x598(%rbp), %ax
movw %ax, -0x9d2(%rbp)
movw %ax, -0x42(%rbp)
movw %ax, -0x44(%rbp)
movw %ax, -0x46(%rbp)
movw %ax, -0x48(%rbp)
movw %ax, -0x4a(%rbp)
movw %ax, -0x4c(%rbp)
movw %ax, -0x4e(%rbp)
movw %ax, -0x50(%rbp)
movzwl -0x50(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x4e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x4c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x4a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x48(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x46(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x44(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x42(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x60(%rbp)
vmovdqa -0x60(%rbp), %xmm0
vmovdqa %xmm0, -0x910(%rbp)
vmovdqa -0x8c0(%rbp), %xmm1
vmovdqa -0x8d0(%rbp), %xmm0
vmovdqa %xmm1, -0x4f0(%rbp)
vmovdqa %xmm0, -0x500(%rbp)
vmovdqa -0x4f0(%rbp), %xmm0
vmovdqa -0x500(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8f0(%rbp)
vmovdqa -0x8f0(%rbp), %xmm1
vmovdqa -0x910(%rbp), %xmm0
vmovdqa %xmm1, -0x510(%rbp)
vmovdqa %xmm0, -0x520(%rbp)
vmovdqa -0x510(%rbp), %xmm0
vmovdqa -0x520(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8f0(%rbp)
vmovdqa -0x720(%rbp), %xmm0
vmovdqa %xmm0, -0x2b0(%rbp)
movl $0xc, -0x2b4(%rbp)
vmovdqa -0x2b0(%rbp), %xmm0
vmovd -0x2b4(%rbp), %xmm1
vpsrlw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8e0(%rbp)
vmovdqa -0x8e0(%rbp), %xmm1
movw $0xe0, -0x59a(%rbp)
movw -0x59a(%rbp), %ax
movw %ax, -0x9d0(%rbp)
movw %ax, -0x22(%rbp)
movw %ax, -0x24(%rbp)
movw %ax, -0x26(%rbp)
movw %ax, -0x28(%rbp)
movw %ax, -0x2a(%rbp)
movw %ax, -0x2c(%rbp)
movw %ax, -0x2e(%rbp)
movw %ax, -0x30(%rbp)
movzwl -0x30(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x2e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x2c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x2a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x28(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x26(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x24(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x22(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x40(%rbp)
vmovdqa -0x40(%rbp), %xmm0
vmovdqa %xmm1, -0x530(%rbp)
vmovdqa %xmm0, -0x540(%rbp)
vmovdqa -0x530(%rbp), %xmm0
vmovdqa -0x540(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8e0(%rbp)
vmovdqa -0x8e0(%rbp), %xmm0
vmovdqa %xmm0, -0x900(%rbp)
vmovdqa -0x730(%rbp), %xmm1
vmovdqa -0x860(%rbp), %xmm0
vmovdqa %xmm1, -0x690(%rbp)
vmovdqa %xmm0, -0x6a0(%rbp)
vmovdqa -0x690(%rbp), %xmm0
vmovdqa -0x6a0(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x860(%rbp)
vmovdqa -0x730(%rbp), %xmm1
vmovdqa -0x770(%rbp), %xmm0
vmovdqa %xmm1, -0x250(%rbp)
vmovdqa %xmm0, -0x260(%rbp)
vmovdqa -0x250(%rbp), %xmm0
vmovdqa -0x260(%rbp), %xmm1
vpandn %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x920(%rbp)
vmovdqa -0x920(%rbp), %xmm1
vmovdqa -0x8a0(%rbp), %xmm0
vmovdqa %xmm1, -0x6b0(%rbp)
vmovdqa %xmm0, -0x6c0(%rbp)
vmovdqa -0x6b0(%rbp), %xmm0
vmovdqa -0x6c0(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8a0(%rbp)
vmovdqa -0x770(%rbp), %xmm1
vmovdqa -0x8f0(%rbp), %xmm0
vmovdqa %xmm1, -0x270(%rbp)
vmovdqa %xmm0, -0x280(%rbp)
vmovdqa -0x270(%rbp), %xmm0
vmovdqa -0x280(%rbp), %xmm1
vpandn %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8f0(%rbp)
vmovdqa -0x770(%rbp), %xmm1
vmovdqa -0x900(%rbp), %xmm0
vmovdqa %xmm1, -0x290(%rbp)
vmovdqa %xmm0, -0x2a0(%rbp)
vmovdqa -0x290(%rbp), %xmm0
vmovdqa -0x2a0(%rbp), %xmm1
vpandn %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x900(%rbp)
vmovdqa -0x860(%rbp), %xmm0
vmovdqa -0x8a0(%rbp), %xmm1
vmovdqa -0x8f0(%rbp), %xmm2
callq 0x3d70
vmovdqa %xmm0, -0x930(%rbp)
vmovdqa -0x900(%rbp), %xmm0
vmovdqa %xmm0, -0x940(%rbp)
vmovdqa -0x930(%rbp), %xmm1
vmovdqa -0x940(%rbp), %xmm0
vmovdqa %xmm1, -0x230(%rbp)
vmovdqa %xmm0, -0x240(%rbp)
vmovdqa -0x230(%rbp), %xmm0
vmovdqa -0x240(%rbp), %xmm1
vpunpcklwd %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
vmovdqa %xmm0, -0x950(%rbp)
vmovdqa -0x930(%rbp), %xmm1
vmovdqa -0x940(%rbp), %xmm0
vmovdqa %xmm1, -0x210(%rbp)
vmovdqa %xmm0, -0x220(%rbp)
vmovdqa -0x210(%rbp), %xmm0
vmovdqa -0x220(%rbp), %xmm1
vpunpckhwd %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
vmovdqa %xmm0, -0x960(%rbp)
movzwl -0x84a(%rbp), %eax
andl $0xff, %eax
movb %al, -0x961(%rbp)
movzbl -0x961(%rbp), %eax
movl %eax, %ecx
leaq 0xffa8(%rip), %rax      # 0x15130
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x6d8(%rbp)
movq -0x6d8(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0x980(%rbp)
vmovdqa -0x950(%rbp), %xmm1
vmovdqa -0x980(%rbp), %xmm0
vmovdqa %xmm1, -0x360(%rbp)
vmovdqa %xmm0, -0x370(%rbp)
vmovdqa -0x360(%rbp), %xmm0
vmovdqa -0x370(%rbp), %xmm1
vpshufb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x990(%rbp)
movq -0x700(%rbp), %rax
vmovdqa -0x990(%rbp), %xmm0
movq %rax, -0x2f8(%rbp)
vmovdqa %xmm0, -0x310(%rbp)
vmovdqa -0x310(%rbp), %xmm0
movq -0x2f8(%rbp), %rax
vmovdqu %xmm0, (%rax)
movzbl -0x961(%rbp), %eax
movl %eax, %ecx
leaq 0x10f09(%rip), %rax     # 0x16130
movzbl (%rax,%rcx), %ecx
movq -0x700(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x700(%rbp)
movzwl -0x84a(%rbp), %eax
sarl $0x8, %eax
movb %al, -0x991(%rbp)
movzbl -0x991(%rbp), %eax
movl %eax, %ecx
leaq 0xfed1(%rip), %rax      # 0x15130
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x6e0(%rbp)
movq -0x6e0(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0x9b0(%rbp)
vmovdqa -0x960(%rbp), %xmm1
vmovdqa -0x9b0(%rbp), %xmm0
vmovdqa %xmm1, -0x380(%rbp)
vmovdqa %xmm0, -0x390(%rbp)
vmovdqa -0x380(%rbp), %xmm0
vmovdqa -0x390(%rbp), %xmm1
vpshufb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x9c0(%rbp)
movq -0x700(%rbp), %rax
vmovdqa -0x9c0(%rbp), %xmm0
movq %rax, -0x318(%rbp)
vmovdqa %xmm0, -0x330(%rbp)
vmovdqa -0x330(%rbp), %xmm0
movq -0x318(%rbp), %rax
vmovdqu %xmm0, (%rax)
movzbl -0x991(%rbp), %eax
movl %eax, %ecx
leaq 0x10e32(%rip), %rax     # 0x16130
movzbl (%rax,%rcx), %ecx
movq -0x700(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x700(%rbp)
movq -0x6f0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x6f0(%rbp)
jmp 0x3e0d
movq -0x700(%rbp), %rax
movq -0x710(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x6e8(%rbp)
movq -0x6e8(%rbp), %rax
addq $0x9e0, %rsp            # imm = 0x9E0
popq %rbp
retq
nopw %cs:(%rax,%rax)