// File: WojciechMula[P]utf16utf8/src/sse.cpp
// Function: sse_convert_utf16_to_utf8(unsigned short const*, unsigned long, unsigned char*)
size_t sse_convert_utf16_to_utf8(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);

        // 0. test if there are any surrogates
        const __m128i msn = _mm_and_si128(in, _mm_set1_epi16(int16_t(0xf800)));
        const __m128i hi_surrogates = _mm_cmpeq_epi16(msn, _mm_set1_epi16(int16_t(0xd800))); // higher byte: 0b1101_10xx
        const __m128i lo_surrogates = _mm_cmpeq_epi16(msn, _mm_set1_epi16(int16_t(0xdc00))); // higher byte: 0b1101_11xx
        const __m128i any_surrogate = _mm_or_si128(lo_surrogates, hi_surrogates);
        const uint16_t surrogates_mask = uint16_t(_mm_movemask_epi8(any_surrogate));
        if (surrogates_mask) {
            // 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;
        }

        // if no surrogates: we for sure process whole register
        input += 8;

        // 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 lt0080 = _mm_cmpeq_epi16(_mm_setzero_si128(),
                                               _mm_and_si128(in, _mm_set1_epi16((int16_t)0xff80)));
        const __m128i lt0800 = _mm_cmpeq_epi16(_mm_setzero_si128(),
                                               _mm_and_si128(in, _mm_set1_epi16((int16_t)0xf800)));

        // a. store lt0080 and lt0800 as bitmask, interleaving bits from both vectors
        const __m128i t0 = _mm_blendv_epi8(lt0080, lt0800, _mm_set1_epi16((int16_t)0xff00));
        const uint16_t patterns = uint16_t(_mm_movemask_epi8(t0));

        if (patterns == 0xffff) { // condition: (in < 0x0080)
            // 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;
        }
        else if ((patterns & 0xaaaa) == 0xaaaa) { // condition: (in < 0x0800)
            // 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 uint16_t tmp     = patterns & 0x5555;
            const uint8_t  pattern = uint8_t(tmp | (tmp >> 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];
        } else {
            // 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];
            }
        }
    }

    // process tail
    return output - start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa90, %rsp            # imm = 0xA90
movq %rdi, -0x770(%rbp)
movq %rsi, -0x778(%rbp)
movq %rdx, -0x780(%rbp)
movq -0x770(%rbp), %rax
movq -0x778(%rbp), %rcx
andq $-0x8, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x788(%rbp)
movq -0x780(%rbp), %rax
movq %rax, -0x790(%rbp)
movq -0x770(%rbp), %rax
cmpq -0x788(%rbp), %rax
je 0x3bc1
movq -0x770(%rbp), %rax
movq %rax, -0x748(%rbp)
movq -0x748(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0x7a0(%rbp)
vmovdqa -0x7a0(%rbp), %xmm1
movw $0xf800, -0x5e2(%rbp)   # imm = 0xF800
movw -0x5e2(%rbp), %ax
movw %ax, -0xa76(%rbp)
movw %ax, -0x1c2(%rbp)
movw %ax, -0x1c4(%rbp)
movw %ax, -0x1c6(%rbp)
movw %ax, -0x1c8(%rbp)
movw %ax, -0x1ca(%rbp)
movw %ax, -0x1cc(%rbp)
movw %ax, -0x1ce(%rbp)
movw %ax, -0x1d0(%rbp)
movzwl -0x1d0(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0x1ce(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0x1cc(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0x1ca(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x1c8(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x1c6(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x1c4(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x1c2(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x1e0(%rbp)
vmovdqa -0x1e0(%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 -0x7b0(%rbp), %xmm1
movw $0xd800, -0x5e4(%rbp)   # imm = 0xD800
movw -0x5e4(%rbp), %ax
movw %ax, -0xa74(%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 %xmm1, -0x570(%rbp)
vmovdqa %xmm0, -0x580(%rbp)
vmovdqa -0x570(%rbp), %xmm0
vmovdqa -0x580(%rbp), %xmm1
vpcmpeqw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x7c0(%rbp)
vmovdqa -0x7b0(%rbp), %xmm1
movw $0xdc00, -0x5e6(%rbp)   # imm = 0xDC00
movw -0x5e6(%rbp), %ax
movw %ax, -0xa72(%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 %xmm1, -0x590(%rbp)
vmovdqa %xmm0, -0x5a0(%rbp)
vmovdqa -0x590(%rbp), %xmm0
vmovdqa -0x5a0(%rbp), %xmm1
vpcmpeqw %xmm1, %xmm0, %k0
vpmovm2w %k0, %xmm0
vmovdqa %xmm0, -0x7d0(%rbp)
vmovdqa -0x7d0(%rbp), %xmm1
vmovdqa -0x7c0(%rbp), %xmm0
vmovdqa %xmm1, -0x470(%rbp)
vmovdqa %xmm0, -0x480(%rbp)
vmovdqa -0x470(%rbp), %xmm0
vpor -0x480(%rbp), %xmm0, %xmm0
vmovdqa %xmm0, -0x7e0(%rbp)
vmovdqa -0x7e0(%rbp), %xmm0
vmovdqa %xmm0, -0x450(%rbp)
vmovdqa -0x450(%rbp), %xmm0
vpmovmskb %xmm0, %eax
movw %ax, -0x7e2(%rbp)
cmpw $0x0, -0x7e2(%rbp)
je 0x295c
leaq -0x780(%rbp), %rax
movq %rax, -0x7f0(%rbp)
movb $0x0, -0x7f1(%rbp)
movl $0x8, -0x7f8(%rbp)
leaq -0x7f8(%rbp), %rax
movq %rax, -0x808(%rbp)
leaq -0x7f1(%rbp), %rax
movq %rax, -0x800(%rbp)
movq -0x770(%rbp), %rdi
movq -0x7f0(%rbp), %rax
movq %rax, -0x810(%rbp)
movq -0x808(%rbp), %rax
movq %rax, -0x820(%rbp)
movq -0x800(%rbp), %rax
movq %rax, -0x818(%rbp)
movq -0x810(%rbp), %rdx
movq -0x820(%rbp), %rcx
movq -0x818(%rbp), %r8
movl $0x8, %esi
callq 0x3bf0
testb $0x1, -0x7f1(%rbp)
je 0x293a
movq -0x780(%rbp), %rax
movq -0x790(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x768(%rbp)
jmp 0x3bd9
movl -0x7f8(%rbp), %ecx
movq -0x770(%rbp), %rax
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x770(%rbp)
jmp 0x250d
movq -0x770(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x770(%rbp)
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, -0x430(%rbp)
vmovdqa -0x430(%rbp), %xmm2
vmovdqa -0x7a0(%rbp), %xmm3
movw $0xff80, -0x5e8(%rbp)   # imm = 0xFF80
movw -0x5e8(%rbp), %ax
movw %ax, -0xa7c(%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, %xmm1
movzwl -0x16e(%rbp), %eax
vpinsrw $0x1, %eax, %xmm1, %xmm1
movzwl -0x16c(%rbp), %eax
vpinsrw $0x2, %eax, %xmm1, %xmm1
movzwl -0x16a(%rbp), %eax
vpinsrw $0x3, %eax, %xmm1, %xmm1
movzwl -0x168(%rbp), %eax
vpinsrw $0x4, %eax, %xmm1, %xmm1
movzwl -0x166(%rbp), %eax
vpinsrw $0x5, %eax, %xmm1, %xmm1
movzwl -0x164(%rbp), %eax
vpinsrw $0x6, %eax, %xmm1, %xmm1
movzwl -0x162(%rbp), %eax
vpinsrw $0x7, %eax, %xmm1, %xmm1
vmovdqa %xmm1, -0x180(%rbp)
vmovdqa -0x180(%rbp), %xmm1
vmovdqa %xmm3, -0x630(%rbp)
vmovdqa %xmm1, -0x640(%rbp)
vmovdqa -0x630(%rbp), %xmm1
vmovdqa -0x640(%rbp), %xmm3
vpand %xmm3, %xmm1, %xmm1
vmovdqa %xmm2, -0x5b0(%rbp)
vmovdqa %xmm1, -0x5c0(%rbp)
vmovdqa -0x5b0(%rbp), %xmm1
vmovdqa -0x5c0(%rbp), %xmm2
vpcmpeqw %xmm2, %xmm1, %xmm1
vmovdqa %xmm1, -0x830(%rbp)
vmovdqa %xmm0, -0x440(%rbp)
vmovdqa -0x440(%rbp), %xmm1
vmovdqa -0x7a0(%rbp), %xmm2
movw $0xf800, -0x5ea(%rbp)   # imm = 0xF800
movw -0x5ea(%rbp), %ax
movw %ax, -0xa7a(%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 %xmm2, -0x650(%rbp)
vmovdqa %xmm0, -0x660(%rbp)
vmovdqa -0x650(%rbp), %xmm0
vmovdqa -0x660(%rbp), %xmm2
vpand %xmm2, %xmm0, %xmm0
vmovdqa %xmm1, -0x5d0(%rbp)
vmovdqa %xmm0, -0x5e0(%rbp)
vmovdqa -0x5d0(%rbp), %xmm0
vmovdqa -0x5e0(%rbp), %xmm1
vpcmpeqw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x840(%rbp)
vmovdqa -0x830(%rbp), %xmm2
vmovdqa -0x840(%rbp), %xmm1
movw $0xff00, -0x5ec(%rbp)   # imm = 0xFF00
movw -0x5ec(%rbp), %ax
movw %ax, -0xa78(%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 %xmm2, -0x3d0(%rbp)
vmovdqa %xmm1, -0x3e0(%rbp)
vmovdqa %xmm0, -0x3f0(%rbp)
vmovdqa -0x3d0(%rbp), %xmm0
vmovdqa -0x3e0(%rbp), %xmm1
vmovdqa -0x3f0(%rbp), %xmm2
vpblendvb %xmm2, %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x850(%rbp)
vmovdqa -0x850(%rbp), %xmm0
vmovdqa %xmm0, -0x460(%rbp)
vmovdqa -0x460(%rbp), %xmm0
vpmovmskb %xmm0, %eax
movw %ax, -0x852(%rbp)
movzwl -0x852(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x2d75
vmovdqa -0x7a0(%rbp), %xmm0
vmovdqa %xmm0, -0x3b0(%rbp)
vmovdqa %xmm0, -0x3c0(%rbp)
vmovdqa -0x3b0(%rbp), %xmm0
vmovdqa -0x3c0(%rbp), %xmm1
vpackuswb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x870(%rbp)
vmovdqa -0x870(%rbp), %xmm0
vmovdqa %xmm0, -0x3a0(%rbp)
movq -0x3a0(%rbp), %rax
movq %rax, -0x878(%rbp)
movq -0x780(%rbp), %rax
movq -0x878(%rbp), %rcx
movq %rcx, (%rax)
movq -0x780(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x780(%rbp)
jmp 0x3bbc
movzwl -0x852(%rbp), %eax
andl $0xaaaa, %eax           # imm = 0xAAAA
cmpl $0xaaaa, %eax           # imm = 0xAAAA
jne 0x3229
movzwl -0x852(%rbp), %eax
andl $0x5555, %eax           # imm = 0x5555
movw %ax, -0x87a(%rbp)
movzwl -0x87a(%rbp), %eax
movl %eax, %ecx
shrl $0x7, %ecx
orl %ecx, %eax
movb %al, -0x87b(%rbp)
vmovdqa -0x7a0(%rbp), %xmm0
vmovdqa %xmm0, -0x890(%rbp)
vmovdqa -0x7a0(%rbp), %xmm1
movw $0x3f, -0x5ee(%rbp)
movw -0x5ee(%rbp), %ax
movw %ax, -0xa82(%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, -0x670(%rbp)
vmovdqa %xmm0, -0x680(%rbp)
vmovdqa -0x670(%rbp), %xmm0
vmovdqa -0x680(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8a0(%rbp)
vmovdqa -0x7a0(%rbp), %xmm0
vmovdqa %xmm0, -0x380(%rbp)
movl $0x2, -0x384(%rbp)
vmovdqa -0x380(%rbp), %xmm0
vmovd -0x384(%rbp), %xmm1
vpsllw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8b0(%rbp)
vmovdqa -0x8b0(%rbp), %xmm1
movw $0x1f00, -0x5f0(%rbp)   # imm = 0x1F00
movw -0x5f0(%rbp), %ax
movw %ax, -0xa80(%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, -0x690(%rbp)
vmovdqa %xmm0, -0x6a0(%rbp)
vmovdqa -0x690(%rbp), %xmm0
vmovdqa -0x6a0(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8b0(%rbp)
vmovdqa -0x8a0(%rbp), %xmm1
vmovdqa -0x8b0(%rbp), %xmm0
vmovdqa %xmm1, -0x490(%rbp)
vmovdqa %xmm0, -0x4a0(%rbp)
vmovdqa -0x490(%rbp), %xmm0
vmovdqa -0x4a0(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8c0(%rbp)
vmovdqa -0x8c0(%rbp), %xmm1
movw $0xc080, -0x5f2(%rbp)   # imm = 0xC080
movw -0x5f2(%rbp), %ax
movw %ax, -0xa7e(%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, -0x4b0(%rbp)
vmovdqa %xmm0, -0x4c0(%rbp)
vmovdqa -0x4b0(%rbp), %xmm0
vpor -0x4c0(%rbp), %xmm0, %xmm0
vmovdqa %xmm0, -0x8d0(%rbp)
vmovdqa -0x8d0(%rbp), %xmm2
vmovdqa -0x890(%rbp), %xmm1
vmovdqa -0x830(%rbp), %xmm0
vmovdqa %xmm2, -0x400(%rbp)
vmovdqa %xmm1, -0x410(%rbp)
vmovdqa %xmm0, -0x420(%rbp)
vmovdqa -0x400(%rbp), %xmm0
vmovdqa -0x410(%rbp), %xmm1
vmovdqa -0x420(%rbp), %xmm2
vpblendvb %xmm2, %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x8e0(%rbp)
movzbl -0x87b(%rbp), %eax
movl %eax, %ecx
leaq 0x10ec3(%rip), %rax     # 0x14030
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x750(%rbp)
movq -0x750(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0x8f0(%rbp)
vmovdqa -0x8e0(%rbp), %xmm1
vmovdqa -0x8f0(%rbp), %xmm0
vmovdqa %xmm1, -0x320(%rbp)
vmovdqa %xmm0, -0x330(%rbp)
vmovdqa -0x320(%rbp), %xmm0
vmovdqa -0x330(%rbp), %xmm1
vpshufb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x900(%rbp)
movq -0x780(%rbp), %rax
vmovdqa -0x900(%rbp), %xmm0
movq %rax, -0x2c0(%rbp)
vmovdqa %xmm0, -0x2d0(%rbp)
vmovdqa -0x2d0(%rbp), %xmm0
movq -0x2c0(%rbp), %rax
vmovdqu %xmm0, (%rax)
movzbl -0x87b(%rbp), %eax
movl %eax, %ecx
leaq 0x11e24(%rip), %rax     # 0x15030
movzbl (%rax,%rcx), %ecx
movq -0x780(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x780(%rbp)
jmp 0x3bba
vmovdqa -0x7a0(%rbp), %xmm0
vmovdqa %xmm0, -0x910(%rbp)
vmovdqa -0x7a0(%rbp), %xmm1
movw $0x3f, -0x5f4(%rbp)
movw -0x5f4(%rbp), %ax
movw %ax, -0xa8e(%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, -0x6b0(%rbp)
vmovdqa %xmm0, -0x6c0(%rbp)
vmovdqa -0x6b0(%rbp), %xmm0
vmovdqa -0x6c0(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x930(%rbp)
vmovdqa -0x7a0(%rbp), %xmm0
vmovdqa %xmm0, -0x2b0(%rbp)
movl $0x2, -0x2b4(%rbp)
vmovdqa -0x2b0(%rbp), %xmm0
vmovd -0x2b4(%rbp), %xmm1
vpslld %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x920(%rbp)
vmovdqa -0x920(%rbp), %xmm1
movw $0x1f00, -0x5f6(%rbp)   # imm = 0x1F00
movw -0x5f6(%rbp), %ax
movw %ax, -0xa8c(%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 %xmm1, -0x6d0(%rbp)
vmovdqa %xmm0, -0x6e0(%rbp)
vmovdqa -0x6d0(%rbp), %xmm0
vmovdqa -0x6e0(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x940(%rbp)
movw $0xc080, -0x5f8(%rbp)   # imm = 0xC080
movw -0x5f8(%rbp), %ax
movw %ax, -0xa8a(%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 %xmm0, -0x960(%rbp)
vmovdqa -0x930(%rbp), %xmm1
vmovdqa -0x940(%rbp), %xmm0
vmovdqa %xmm1, -0x4d0(%rbp)
vmovdqa %xmm0, -0x4e0(%rbp)
vmovdqa -0x4d0(%rbp), %xmm0
vmovdqa -0x4e0(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x950(%rbp)
vmovdqa -0x950(%rbp), %xmm1
vmovdqa -0x960(%rbp), %xmm0
vmovdqa %xmm1, -0x4f0(%rbp)
vmovdqa %xmm0, -0x500(%rbp)
vmovdqa -0x4f0(%rbp), %xmm0
vmovdqa -0x500(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x950(%rbp)
vmovdqa -0x930(%rbp), %xmm0
vmovdqa %xmm0, -0x970(%rbp)
vmovdqa -0x920(%rbp), %xmm1
movw $0x3f00, -0x5fa(%rbp)   # imm = 0x3F00
movw -0x5fa(%rbp), %ax
movw %ax, -0xa88(%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 %xmm1, -0x6f0(%rbp)
vmovdqa %xmm0, -0x700(%rbp)
vmovdqa -0x6f0(%rbp), %xmm0
vmovdqa -0x700(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x980(%rbp)
movw $0x8080, -0x5fc(%rbp)   # imm = 0x8080
movw -0x5fc(%rbp), %ax
movw %ax, -0xa86(%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 %xmm0, -0x9c0(%rbp)
vmovdqa -0x970(%rbp), %xmm1
vmovdqa -0x980(%rbp), %xmm0
vmovdqa %xmm1, -0x510(%rbp)
vmovdqa %xmm0, -0x520(%rbp)
vmovdqa -0x510(%rbp), %xmm0
vmovdqa -0x520(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x9a0(%rbp)
vmovdqa -0x9a0(%rbp), %xmm1
vmovdqa -0x9c0(%rbp), %xmm0
vmovdqa %xmm1, -0x530(%rbp)
vmovdqa %xmm0, -0x540(%rbp)
vmovdqa -0x530(%rbp), %xmm0
vmovdqa -0x540(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x9a0(%rbp)
vmovdqa -0x7a0(%rbp), %xmm0
vmovdqa %xmm0, -0x290(%rbp)
movl $0xc, -0x294(%rbp)
vmovdqa -0x290(%rbp), %xmm0
vmovd -0x294(%rbp), %xmm1
vpsrlw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x990(%rbp)
vmovdqa -0x990(%rbp), %xmm1
movw $0xe0, -0x5fe(%rbp)
movw -0x5fe(%rbp), %ax
movw %ax, -0xa84(%rbp)
movw %ax, -0x2(%rbp)
movw %ax, -0x4(%rbp)
movw %ax, -0x6(%rbp)
movw %ax, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movw %ax, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movw %ax, -0x10(%rbp)
movzwl -0x10(%rbp), %eax
vmovd %eax, %xmm0
movzwl -0xe(%rbp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl -0xc(%rbp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl -0xa(%rbp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl -0x8(%rbp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl -0x6(%rbp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl -0x4(%rbp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl -0x2(%rbp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
vmovdqa %xmm0, -0x20(%rbp)
vmovdqa -0x20(%rbp), %xmm0
vmovdqa %xmm1, -0x550(%rbp)
vmovdqa %xmm0, -0x560(%rbp)
vmovdqa -0x550(%rbp), %xmm0
vmovdqa -0x560(%rbp), %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x990(%rbp)
vmovdqa -0x990(%rbp), %xmm0
vmovdqa %xmm0, -0x9b0(%rbp)
vmovdqa -0x830(%rbp), %xmm1
vmovdqa -0x910(%rbp), %xmm0
vmovdqa %xmm1, -0x710(%rbp)
vmovdqa %xmm0, -0x720(%rbp)
vmovdqa -0x710(%rbp), %xmm0
vmovdqa -0x720(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x910(%rbp)
vmovdqa -0x830(%rbp), %xmm1
vmovdqa -0x840(%rbp), %xmm0
vmovdqa %xmm1, -0x230(%rbp)
vmovdqa %xmm0, -0x240(%rbp)
vmovdqa -0x230(%rbp), %xmm0
vmovdqa -0x240(%rbp), %xmm1
vpandn %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x9d0(%rbp)
vmovdqa -0x9d0(%rbp), %xmm1
vmovdqa -0x950(%rbp), %xmm0
vmovdqa %xmm1, -0x730(%rbp)
vmovdqa %xmm0, -0x740(%rbp)
vmovdqa -0x730(%rbp), %xmm0
vmovdqa -0x740(%rbp), %xmm1
vpand %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x950(%rbp)
vmovdqa -0x840(%rbp), %xmm1
vmovdqa -0x9a0(%rbp), %xmm0
vmovdqa %xmm1, -0x250(%rbp)
vmovdqa %xmm0, -0x260(%rbp)
vmovdqa -0x250(%rbp), %xmm0
vmovdqa -0x260(%rbp), %xmm1
vpandn %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x9a0(%rbp)
vmovdqa -0x840(%rbp), %xmm1
vmovdqa -0x9b0(%rbp), %xmm0
vmovdqa %xmm1, -0x270(%rbp)
vmovdqa %xmm0, -0x280(%rbp)
vmovdqa -0x270(%rbp), %xmm0
vmovdqa -0x280(%rbp), %xmm1
vpandn %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x9b0(%rbp)
vmovdqa -0x910(%rbp), %xmm0
vmovdqa -0x950(%rbp), %xmm1
vmovdqa -0x9a0(%rbp), %xmm2
callq 0x3d70
vmovdqa %xmm0, -0x9e0(%rbp)
vmovdqa -0x9b0(%rbp), %xmm0
vmovdqa %xmm0, -0x9f0(%rbp)
vmovdqa -0x9e0(%rbp), %xmm1
vmovdqa -0x9f0(%rbp), %xmm0
vmovdqa %xmm1, -0x210(%rbp)
vmovdqa %xmm0, -0x220(%rbp)
vmovdqa -0x210(%rbp), %xmm0
vmovdqa -0x220(%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, -0xa00(%rbp)
vmovdqa -0x9e0(%rbp), %xmm1
vmovdqa -0x9f0(%rbp), %xmm0
vmovdqa %xmm1, -0x1f0(%rbp)
vmovdqa %xmm0, -0x200(%rbp)
vmovdqa -0x1f0(%rbp), %xmm0
vmovdqa -0x200(%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, -0xa10(%rbp)
movzwl -0x852(%rbp), %eax
andl $0xff, %eax
movb %al, -0xa11(%rbp)
movzbl -0xa11(%rbp), %eax
movl %eax, %ecx
leaq 0x11704(%rip), %rax     # 0x15130
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x758(%rbp)
movq -0x758(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0xa30(%rbp)
vmovdqa -0xa00(%rbp), %xmm1
vmovdqa -0xa30(%rbp), %xmm0
vmovdqa %xmm1, -0x340(%rbp)
vmovdqa %xmm0, -0x350(%rbp)
vmovdqa -0x340(%rbp), %xmm0
vmovdqa -0x350(%rbp), %xmm1
vpshufb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0xa40(%rbp)
movq -0x780(%rbp), %rax
vmovdqa -0xa40(%rbp), %xmm0
movq %rax, -0x2d8(%rbp)
vmovdqa %xmm0, -0x2f0(%rbp)
vmovdqa -0x2f0(%rbp), %xmm0
movq -0x2d8(%rbp), %rax
vmovdqu %xmm0, (%rax)
movzbl -0xa11(%rbp), %eax
movl %eax, %ecx
leaq 0x12665(%rip), %rax     # 0x16130
movzbl (%rax,%rcx), %ecx
movq -0x780(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x780(%rbp)
movzwl -0x852(%rbp), %eax
sarl $0x8, %eax
movb %al, -0xa41(%rbp)
movzbl -0xa41(%rbp), %eax
movl %eax, %ecx
leaq 0x1162d(%rip), %rax     # 0x15130
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x760(%rbp)
movq -0x760(%rbp), %rax
vmovdqu (%rax), %xmm0
vmovdqa %xmm0, -0xa60(%rbp)
vmovdqa -0xa10(%rbp), %xmm1
vmovdqa -0xa60(%rbp), %xmm0
vmovdqa %xmm1, -0x360(%rbp)
vmovdqa %xmm0, -0x370(%rbp)
vmovdqa -0x360(%rbp), %xmm0
vmovdqa -0x370(%rbp), %xmm1
vpshufb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0xa70(%rbp)
movq -0x780(%rbp), %rax
vmovdqa -0xa70(%rbp), %xmm0
movq %rax, -0x2f8(%rbp)
vmovdqa %xmm0, -0x310(%rbp)
vmovdqa -0x310(%rbp), %xmm0
movq -0x2f8(%rbp), %rax
vmovdqu %xmm0, (%rax)
movzbl -0xa41(%rbp), %eax
movl %eax, %ecx
leaq 0x1258e(%rip), %rax     # 0x16130
movzbl (%rax,%rcx), %ecx
movq -0x780(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x780(%rbp)
jmp 0x3bbc
jmp 0x250d
movq -0x780(%rbp), %rax
movq -0x790(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x768(%rbp)
movq -0x768(%rbp), %rax
addq $0xa90, %rsp            # imm = 0xA90
popq %rbp
retq
nopl (%rax)