// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/htscodecs/htscodecs/rANS_static32x16pr_avx2.c
// Function: rans_compress_O1_32x16_avx2
unsigned char *rans_compress_O1_32x16_avx2(unsigned char *in, unsigned int in_size,
                                           unsigned char *out, unsigned int *out_size) {
    unsigned char *cp, *out_end, *out_free = NULL;
    unsigned int tab_size;
    uint32_t bound = rans_compress_bound_4x16(in_size,1)-20;
    int z;
    RansState ransN[NX] __attribute__((aligned(32)));

    if (in_size < NX) // force O0 instead
        return NULL;

    if (!out) {
        *out_size = bound;
        out = malloc(*out_size);
    }
    if (!out || bound > *out_size)
        return NULL;

    if (((size_t)out)&1)
        bound--;
    out_end = out + bound;

    RansEncSymbol (*syms)[256] = htscodecs_tls_alloc(256 * (sizeof(*syms)));
    if (!syms) {
        free(out_free);
        return NULL;
    }

    cp = out;
    int shift = encode_freq1(in, in_size, 32, syms, &cp); 
    if (shift < 0) {
        free(out_free);
        htscodecs_tls_free(syms);
        return NULL;
    }
    tab_size = cp - out;

    for (z = 0; z < NX; z++)
      RansEncInit(&ransN[z]);

    uint8_t* ptr = out_end;

    int iN[NX], isz4 = in_size/NX;
    for (z = 0; z < NX; z++)
        iN[z] = (z+1)*isz4-2;

    unsigned char lN[NX];
    for (z = 0; z < NX; z++)
        lN[z] = in[iN[z]+1];

    // Deal with the remainder
    z = NX-1;
    lN[z] = in[in_size-1];
    for (iN[z] = in_size-2; iN[z] > NX*isz4-2; iN[z]--) {
        unsigned char c = in[iN[z]];
        RansEncPutSymbol(&ransN[z], &ptr, &syms[c][lN[z]]);
        lN[z] = c;
    }

    uint16_t *ptr16 = (uint16_t *)ptr;

//       clang16      clang10      gcc7         gcc13
//       587 435 381  588 438 403  504 386 415  527 381 394
// simT  611 432 402  475 401 367  472 422 386  486 353 324

    LOAD(Rv, ransN);

    for (; iN[0] >= 0; ) {
        // We need to gather sym[curr_char][last_char] structs.
        // These hold 4 32-bit values, so are 128 bit each, and
        // are loaded from 32 distinct addresses.
        //
        // We load them into 32 128-bit lanes and then combine to get
        // 16 avx-256 registers.
        // These are now ABCD ABCD ABCD ABCD... orientation
        // Code we can then "gather" from these registers via a combination
        // of shuffle / permutes / and / or operations.  This is less
        // IO than repeating 4 sets of gathers/loads 32-times over.

        // DCBA holding 4 elements in a syms[] array
        // -> 4-way rotate via shuffles
        // [0] DCBA  11 10 01 00  E4
        // [1] CBAD  10 01 00 11  93
        // [2] BADC  01 00 11 10  4E
        // [3] ADCB  00 11 10 01  39
        //
        // Then AND to select relevant lanes and OR
        // [0] ......A0
        // [1] ....A1..
        // [2] ..A2....
        // [3] A3......  OR to get A3A2A1A0
        //
        // or:
        // [0] ....B0..
        // [1] ..B1....
        // [2] B2......
        // [3] ......B3  OR to get B2B1B0B3 and shuffle to B3B2B1B0

        __m256i xmaxv[4];
        __m256i rfv[4];
        __m256i SDv[4];
        __m256i biasv[4];

        const __m256i xA = _mm256_set_epi32(0,0,0,-1, 0,0,0,-1);
        const __m256i xB = _mm256_set_epi32(0,0,-1,0, 0,0,-1,0);
        const __m256i xC = _mm256_set_epi32(0,-1,0,0, 0,-1,0,0);
        const __m256i xD = _mm256_set_epi32(-1,0,0,0, -1,0,0,0);

        for (z = 0; z < 32; z += 8) {
#define m128_to_256 _mm256_castsi128_si256
            __m128i *s0 = (__m128i *)(&syms[in[iN[z+0]]][lN[z+0]]);
            __m128i *s1 = (__m128i *)(&syms[in[iN[z+4]]][lN[z+4]]);
            __m128i *s2 = (__m128i *)(&syms[in[iN[z+1]]][lN[z+1]]);
            __m128i *s3 = (__m128i *)(&syms[in[iN[z+5]]][lN[z+5]]);

            __m256i t0, t1, t2, t3;
            t0 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s0)), 0xE4);
            t1 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s1)), 0xE4);
            t2 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s2)), 0x93);
            t3 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s3)), 0x93);

            __m256i sh0 = _mm256_permute2x128_si256(t0, t1, 0x20);
            __m256i sh1 = _mm256_permute2x128_si256(t2, t3, 0x20);

            lN[z+0] = in[iN[z+0]];
            lN[z+4] = in[iN[z+4]];
            lN[z+1] = in[iN[z+1]];
            lN[z+5] = in[iN[z+5]];

            // Initialise first half of xmax, rf, SD and bias vectors
            __m128i *s4 = (__m128i *)(&syms[in[iN[z+2]]][lN[z+2]]);
            __m128i *s5 = (__m128i *)(&syms[in[iN[z+6]]][lN[z+6]]);
            __m128i *s6 = (__m128i *)(&syms[in[iN[z+3]]][lN[z+3]]);
            __m128i *s7 = (__m128i *)(&syms[in[iN[z+7]]][lN[z+7]]);

            __m256i t4, t5, t6, t7;
            t4 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s4)), 0x4E);
            t5 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s5)), 0x4E);
            t6 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s6)), 0x39);
            t7 = _mm256_shuffle_epi32(m128_to_256(_mm_loadu_si128(s7)), 0x39);

            __m256i sh2 = _mm256_permute2x128_si256(t4, t5, 0x20);
            __m256i sh3 = _mm256_permute2x128_si256(t6, t7, 0x20);

            lN[z+2] = in[iN[z+2]];
            lN[z+6] = in[iN[z+6]];
            lN[z+3] = in[iN[z+3]];
            lN[z+7] = in[iN[z+7]];

#define SH_LOAD(A, B, C, D)                                        \
            _mm256_or_si256(_mm256_or_si256(_mm256_and_si256(sh0, A), \
                                            _mm256_and_si256(sh1, B)),\
                            _mm256_or_si256(_mm256_and_si256(sh2, C), \
                                            _mm256_and_si256(sh3, D)))
            xmaxv[z/8] = SH_LOAD(xA, xB, xC, xD);
            rfv  [z/8] = SH_LOAD(xB, xC, xD, xA);
            SDv  [z/8] = SH_LOAD(xD, xA, xB, xC);
            biasv[z/8] = SH_LOAD(xC, xD, xA, xB);

            rfv  [z/8] = _mm256_shuffle_epi32(rfv  [z/8],  0x39);
            SDv  [z/8] = _mm256_shuffle_epi32(SDv  [z/8],  0x93);
            biasv[z/8] = _mm256_shuffle_epi32(biasv[z/8],0x4E);
        }

        // ------------------------------------------------------------
        //      for (z = NX-1; z >= 0; z--) {
        //          if (ransN[z] >= x_max[z]) {
        //              *--ptr16 = ransN[z] & 0xffff;
        //              ransN[z] >>= 16;
        //          }
        //      }
        __m256i cv1 = _mm256_cmpgt_epi32(Rv1, xmaxv[0]);
        __m256i cv2 = _mm256_cmpgt_epi32(Rv2, xmaxv[1]);
        __m256i cv3 = _mm256_cmpgt_epi32(Rv3, xmaxv[2]);
        __m256i cv4 = _mm256_cmpgt_epi32(Rv4, xmaxv[3]);

        // Store bottom 16-bits at ptr16
        //
        // for (z = NX-1; z >= 0; z--) {
        //     if (cond[z]) *--ptr16 = (uint16_t )(ransN[z] & 0xffff);
        // }
        unsigned int imask1 = _mm256_movemask_ps((__m256)cv1);
        unsigned int imask2 = _mm256_movemask_ps((__m256)cv2);
        unsigned int imask3 = _mm256_movemask_ps((__m256)cv3);
        unsigned int imask4 = _mm256_movemask_ps((__m256)cv4);

        __m256i idx1 = _mm256_load_si256((const __m256i*)permutec[imask1]);
        __m256i idx2 = _mm256_load_si256((const __m256i*)permutec[imask2]);
        __m256i idx3 = _mm256_load_si256((const __m256i*)permutec[imask3]);
        __m256i idx4 = _mm256_load_si256((const __m256i*)permutec[imask4]);

        // Permute; to gather together the rans states that need flushing
        __m256i V1, V2, V3, V4;
        V1 = _mm256_permutevar8x32_epi32(_mm256_and_si256(Rv1, cv1), idx1);
        V2 = _mm256_permutevar8x32_epi32(_mm256_and_si256(Rv2, cv2), idx2);
        V3 = _mm256_permutevar8x32_epi32(_mm256_and_si256(Rv3, cv3), idx3);
        V4 = _mm256_permutevar8x32_epi32(_mm256_and_si256(Rv4, cv4), idx4);

        // We only flush bottom 16 bits, to squash 32-bit states into 16 bit.
        V1 = _mm256_and_si256(V1, _mm256_set1_epi32(0xffff));
        V2 = _mm256_and_si256(V2, _mm256_set1_epi32(0xffff));
        V3 = _mm256_and_si256(V3, _mm256_set1_epi32(0xffff));
        V4 = _mm256_and_si256(V4, _mm256_set1_epi32(0xffff));
        __m256i V12 = _mm256_packus_epi32(V1, V2);
        __m256i V34 = _mm256_packus_epi32(V3, V4);

        // It's BAba order, want BbAa so shuffle.
        V12 = _mm256_permute4x64_epi64(V12, 0xd8);
        V34 = _mm256_permute4x64_epi64(V34, 0xd8);

        // Now we have bottom N 16-bit values in each V12/V34 to flush
        __m128i f =  _mm256_extractf128_si256(V34, 1);
        _mm_storeu_si128((__m128i *)(ptr16-8), f);
        ptr16 -= _mm_popcnt_u32(imask4);

        f =  _mm256_extractf128_si256(V34, 0);
        _mm_storeu_si128((__m128i *)(ptr16-8), f);
        ptr16 -= _mm_popcnt_u32(imask3);

        f =  _mm256_extractf128_si256(V12, 1);
        _mm_storeu_si128((__m128i *)(ptr16-8), f);
        ptr16 -= _mm_popcnt_u32(imask2);

        f =  _mm256_extractf128_si256(V12, 0);
        _mm_storeu_si128((__m128i *)(ptr16-8), f);
        ptr16 -= _mm_popcnt_u32(imask1);

        __m256i Rs1, Rs2, Rs3, Rs4;
        Rs1 = _mm256_srli_epi32(Rv1,16);
        Rs2 = _mm256_srli_epi32(Rv2,16);
        Rs3 = _mm256_srli_epi32(Rv3,16);
        Rs4 = _mm256_srli_epi32(Rv4,16);

        Rv1 = _mm256_blendv_epi8(Rv1, Rs1, cv1);
        Rv2 = _mm256_blendv_epi8(Rv2, Rs2, cv2);
        Rv3 = _mm256_blendv_epi8(Rv3, Rs3, cv3);
        Rv4 = _mm256_blendv_epi8(Rv4, Rs4, cv4);

        // ------------------------------------------------------------
        // uint32_t q = (uint32_t) (((uint64_t)ransN[z] *
        //                           rcp_freq[z]) >> rcp_shift[z]);
        // ransN[z] = ransN[z] + bias[z] + q * cmpl_freq[z];

        // Cannot trivially replace the multiply as mulhi_epu32 doesn't exist
        // (only mullo).  However we can use _mm256_mul_epu32 twice to get
        // 64bit results (half our lanes) and shift/or to get the answer.
        //
        // (AVX512 allows us to hold it all in 64-bit lanes and use mullo_epi64
        // plus a shift.  KNC has mulhi_epi32, but not sure if this is
        // available.)
        rfv[0] = _mm256_mulhi_epu32(Rv1, rfv[0]);
        rfv[1] = _mm256_mulhi_epu32(Rv2, rfv[1]);
        rfv[2] = _mm256_mulhi_epu32(Rv3, rfv[2]);
        rfv[3] = _mm256_mulhi_epu32(Rv4, rfv[3]);

        __m256i shiftv1 = _mm256_srli_epi32(SDv[0], 16);
        __m256i shiftv2 = _mm256_srli_epi32(SDv[1], 16);
        __m256i shiftv3 = _mm256_srli_epi32(SDv[2], 16);
        __m256i shiftv4 = _mm256_srli_epi32(SDv[3], 16);

        shiftv1 = _mm256_sub_epi32(shiftv1, _mm256_set1_epi32(32));
        shiftv2 = _mm256_sub_epi32(shiftv2, _mm256_set1_epi32(32));
        shiftv3 = _mm256_sub_epi32(shiftv3, _mm256_set1_epi32(32));
        shiftv4 = _mm256_sub_epi32(shiftv4, _mm256_set1_epi32(32));

        __m256i qv1 = _mm256_srlv_epi32(rfv[0], shiftv1);
        __m256i qv2 = _mm256_srlv_epi32(rfv[1], shiftv2);

        __m256i freqv1 = _mm256_and_si256(SDv[0], _mm256_set1_epi32(0xffff));
        __m256i freqv2 = _mm256_and_si256(SDv[1], _mm256_set1_epi32(0xffff));
        qv1 = _mm256_mullo_epi32(qv1, freqv1);
        qv2 = _mm256_mullo_epi32(qv2, freqv2);

        __m256i qv3 = _mm256_srlv_epi32(rfv[2], shiftv3);
        __m256i qv4 = _mm256_srlv_epi32(rfv[3], shiftv4);

        __m256i freqv3 = _mm256_and_si256(SDv[2], _mm256_set1_epi32(0xffff));
        __m256i freqv4 = _mm256_and_si256(SDv[3], _mm256_set1_epi32(0xffff));
        qv3 = _mm256_mullo_epi32(qv3, freqv3);
        qv4 = _mm256_mullo_epi32(qv4, freqv4);

        qv1 = _mm256_add_epi32(qv1, biasv[0]);
        qv2 = _mm256_add_epi32(qv2, biasv[1]);
        qv3 = _mm256_add_epi32(qv3, biasv[2]);
        qv4 = _mm256_add_epi32(qv4, biasv[3]);

        for (z = 0; z < NX; z++)
            iN[z]--;

        Rv1 = _mm256_add_epi32(Rv1, qv1);
        Rv2 = _mm256_add_epi32(Rv2, qv2);
        Rv3 = _mm256_add_epi32(Rv3, qv3);
        Rv4 = _mm256_add_epi32(Rv4, qv4);
    }

    STORE(Rv, ransN);

    ptr = (uint8_t *)ptr16;

    for (z = NX-1; z>=0; z--)
        RansEncPutSymbol(&ransN[z], &ptr, &syms[0][lN[z]]);

    for (z = NX-1; z>=0; z--)
        RansEncFlush(&ransN[z], &ptr);

    *out_size = (out_end - ptr) + tab_size;

    cp = out;
    memmove(out + tab_size, ptr, out_end-ptr);

    htscodecs_tls_free(syms);
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0xba0, %rsp            # imm = 0xBA0
movq %rcx, %r12
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r13
movl %esi, %edi
movl $0x1, %esi
callq 0x61e28
cmpl $0x20, %ebx
jb 0x6996b
movl %eax, %r15d
movq %rbx, 0xe0(%rsp)
leal -0x14(%r15), %ebx
testq %r14, %r14
je 0x68c77
cmpl (%r12), %ebx
jbe 0x68c8e
jmp 0x6996b
movl %ebx, (%r12)
movl %ebx, %edi
callq 0x4680
movq %rax, %r14
testq %rax, %rax
je 0x6996b
movq %r12, 0xb8(%rsp)
addl $-0x15, %r15d
testb $0x1, %r14b
cmovel %ebx, %r15d
movq %r15, 0x48(%rsp)
movl $0x100000, %edi         # imm = 0x100000
callq 0x7e144
testq %rax, %rax
je 0x6996b
movq %rax, %r12
movl $0x100, %edi            # imm = 0x100
movl $0x400, %esi            # imm = 0x400
callq 0x7e245
testq %rax, %rax
je 0x69963
movq %rax, 0x60(%rsp)
leaq 0x360(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
movq 0xe0(%rsp), %r10
movl %r10d, %ebx
addq %r13, %rbx
cmpl $0x7a120, %r10d         # imm = 0x7A120
jbe 0x68e4f
movl $0x100, %edi            # imm = 0x100
movl $0x40c, %esi            # imm = 0x40C
callq 0x7e245
testq %rax, %rax
je 0x69588
leaq -0x8(%rbx), %rsi
xorl %edx, %edx
movq %r13, %rcx
movq 0x60(%rsp), %r11
movzbl (%rcx), %r8d
movzbl 0x1(%rcx), %r9d
movzbl 0x2(%rcx), %r10d
movzbl 0x3(%rcx), %edi
movzbl %dl, %edx
shll $0xa, %edx
addq %r11, %rdx
incl (%rdx,%r8,4)
imulq $0x40c, %r8, %rdx       # imm = 0x40C
addq %rax, %rdx
incl (%rdx,%r9,4)
shll $0xa, %r9d
addq %r11, %r9
incl (%r9,%r10,4)
imulq $0x40c, %r10, %rdx      # imm = 0x40C
addq %rax, %rdx
incl (%rdx,%rdi,4)
movzbl 0x4(%rcx), %r8d
movzbl 0x5(%rcx), %r9d
movzbl 0x6(%rcx), %r10d
movzbl 0x7(%rcx), %edx
shll $0xa, %edi
addq %r11, %rdi
incl (%rdi,%r8,4)
imulq $0x40c, %r8, %rdi       # imm = 0x40C
addq %rax, %rdi
incl (%rdi,%r9,4)
shll $0xa, %r9d
addq %r11, %r9
incl (%r9,%r10,4)
addq $0x8, %rcx
imulq $0x40c, %r10, %rdi      # imm = 0x40C
addq %rax, %rdi
incl (%rdi,%rdx,4)
cmpq %rsi, %rcx
jb 0x68d2f
cmpq %rbx, %rcx
jae 0x68de5
movl %edx, %esi
movzbl (%rcx), %edx
movzbl %sil, %esi
shll $0xa, %esi
addq %r11, %rsi
incl (%rsi,%rdx,4)
incq %rcx
movl %edx, %esi
cmpq %rbx, %rcx
jb 0x68dcb
incl 0x360(%rsp,%rdx,4)
xorl %ecx, %ecx
movq %rax, %rdx
movq %r11, %rsi
xorl %r8d, %r8d
xorl %edi, %edi
movl (%rsi,%r8,4), %r9d
addl (%rdx,%r8,4), %r9d
movl %r9d, (%rsi,%r8,4)
addl %r9d, %edi
incq %r8
cmpq $0x100, %r8             # imm = 0x100
jne 0x68df9
addl %edi, 0x360(%rsp,%rcx,4)
incq %rcx
addq $0x400, %rsi            # imm = 0x400
addq $0x40c, %rdx            # imm = 0x40C
cmpq $0x100, %rcx            # imm = 0x100
jne 0x68df4
movq %rax, %rdi
callq 0x7e26a
movq 0x60(%rsp), %r11
movq 0xe0(%rsp), %r10
jmp 0x68f58
leaq -0x8(%rbx), %rcx
xorl %edx, %edx
movq %r13, %rax
movq 0x60(%rsp), %r11
movzbl (%rax), %r8d
movzbl 0x1(%rax), %r9d
movzbl 0x2(%rax), %edi
movzbl 0x3(%rax), %esi
movzbl %dl, %edx
shll $0xa, %edx
addq %r11, %rdx
incl (%rdx,%r8,4)
shll $0xa, %r8d
addq %r11, %r8
incl (%r8,%r9,4)
shll $0xa, %r9d
addq %r11, %r9
incl (%r9,%rdi,4)
shll $0xa, %edi
addq %r11, %rdi
incl (%rdi,%rsi,4)
movzbl 0x4(%rax), %r8d
movzbl 0x5(%rax), %r9d
movzbl 0x6(%rax), %edi
movzbl 0x7(%rax), %edx
shll $0xa, %esi
addq %r11, %rsi
incl (%rsi,%r8,4)
shll $0xa, %r8d
addq %r11, %r8
incl (%r8,%r9,4)
shll $0xa, %r9d
addq %r11, %r9
incl (%r9,%rdi,4)
addq $0x8, %rax
shll $0xa, %edi
addq %r11, %rdi
incl (%rdi,%rdx,4)
cmpq %rcx, %rax
jb 0x68e5d
cmpq %rbx, %rax
jae 0x68f02
movl %edx, %ecx
movzbl (%rax), %edx
movzbl %cl, %ecx
shll $0xa, %ecx
addq %r11, %rcx
incl (%rcx,%rdx,4)
incq %rax
movl %edx, %ecx
cmpq %rbx, %rax
jb 0x68ee9
incl 0x360(%rsp,%rdx,4)
xorl %eax, %eax
movq %r11, %rcx
vpxor %xmm0, %xmm0, %xmm0
xorl %edx, %edx
vpaddd (%rcx,%rdx,4), %ymm0, %ymm0
addq $0x8, %rdx
cmpq $0x100, %rdx            # imm = 0x100
jne 0x68f14
vextracti128 $0x1, %ymm0, %xmm1
vphaddd %xmm0, %xmm1, %xmm0
vphaddd %xmm0, %xmm0, %xmm0
vphaddd %xmm0, %xmm0, %xmm0
vmovd %xmm0, %edx
addl %edx, 0x360(%rsp,%rax,4)
incq %rax
addq $0x400, %rcx            # imm = 0x400
cmpq $0x100, %rax            # imm = 0x100
jne 0x68f0e
movq 0x48(%rsp), %rax
leaq (%r14,%rax), %r9
movl %r10d, %eax
shrl $0x5, %eax
movl %eax, 0x54(%rsp)
movl %eax, %eax
leaq (%rax,%r13), %rcx
movl $0x1f, %edx
movzbl (%rcx), %esi
incl (%r11,%rsi,4)
addq %rax, %rcx
decq %rdx
jne 0x68f76
movl 0x360(%rsp), %eax
movl $0x1, 0x360(%rsp)
leaq 0x1(%r14), %r10
movb $0x0, (%r14)
xorl %ecx, %ecx
movl $0x1, %edx
xorl %esi, %esi
movq %r10, %r8
movq %r8, %rdi
cmpl $0x0, 0x360(%rsp,%rcx,4)
je 0x68fbe
testl %esi, %esi
je 0x68fd2
decl %esi
movq %rdi, %r8
incq %rcx
incq %rdx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x68fab
jmp 0x69024
leaq 0x1(%rdi), %r8
movb %cl, (%rdi)
xorl %esi, %esi
testq %rcx, %rcx
je 0x68fc1
cmpl $0x0, 0x35c(%rsp,%rcx,4)
je 0x68fc1
leal 0x1(%rcx), %r8d
movl %r8d, %esi
cmpq $0xfe, %rcx
ja 0x69017
movq %rdx, %rsi
cmpl $0x0, 0x360(%rsp,%rsi,4)
je 0x69017
incq %rsi
cmpq $0x100, %rsi            # imm = 0x100
jne 0x68ffc
movl $0x100, %esi            # imm = 0x100
subl %r8d, %esi
movb %sil, 0x1(%rdi)
addq $0x2, %rdi
jmp 0x68fbe
movq %r13, 0x100(%rsp)
movq %r9, 0x58(%rsp)
movq %r14, 0xb0(%rsp)
addl $0x1f, %eax
movb $0x0, (%r8)
subl %r10d, %r8d
incl %r8d
movslq %r8d, %rcx
movq %r10, 0x40(%rsp)
addq %r10, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x360(%rsp), %r14
movl %eax, (%r14)
leaq 0x780(%rsp), %r13
xorl %r15d, %r15d
movl $0x400, %edx            # imm = 0x400
movq %r13, %rdi
xorl %esi, %esi
vzeroupper
callq 0x4260
movq %r14, %rdi
movq 0x60(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x62f73
movq %rbx, %rdi
movl %eax, %ecx
movl $0x1, %r13d
movl $0x1, %r8d
shll %cl, %r8d
movl $0x8000, %eax           # imm = 0x8000
movl %ecx, 0xc0(%rsp)
shrl %cl, %eax
shll $0x10, %eax
movl %eax, 0x80(%rsp)
leal -0x1(%r8), %eax
movq %rax, 0x140(%rsp)
vpmovsxbd 0x36eb3(%rip), %xmm0 # 0x9ff88
vmovd 0x32e73(%rip), %xmm1    # 0x9bf50
vpbroadcastb 0x32e7b(%rip), %xmm4 # 0x9bf61
movq %rbx, %r14
movl 0x360(%rsp,%r15,4), %edx
testl %edx, %edx
je 0x694d2
movl 0x780(%rsp,%r15,4), %eax
movl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
movl $0x400, %ecx            # imm = 0x400
cmovbl %eax, %ecx
cmpl $0xa, 0xc0(%rsp)
cmovnel %eax, %ecx
movq %r15, %rbx
shlq $0xa, %rbx
addq %rdi, %rbx
movq %rcx, 0x120(%rsp)
shlq $0x1f, %rcx
movb $0x1, %r10b
movq %r15, %rdi
movslq %edx, %r11
xorl %r9d, %r9d
movq %rcx, %rax
xorl %edx, %edx
divq %r11
movq %rax, %rsi
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %r11d
movslq %eax, %r15
addq %rsi, %r15
xorl %edx, %edx
xorl %esi, %esi
xorl %eax, %eax
movl (%r14,%r9,4), %r11d
testq %r11, %r11
je 0x6918c
cmpl %r11d, %esi
cmovbl %r9d, %eax
cmovbel %r11d, %esi
imulq %r15, %r11
shrq $0x1f, %r11
cmpl $0x2, %r11d
cmovbl %r13d, %r11d
movl %r11d, (%r14,%r9,4)
addl %edx, %r11d
movl %r11d, %edx
incq %r9
cmpq $0x100, %r9             # imm = 0x100
jne 0x6915e
movq 0x120(%rsp), %rsi
subl %edx, %esi
cltq
testl %esi, %esi
jg 0x6923a
jns 0x69233
movl (%rbx,%rax,4), %r9d
movl %esi, %r11d
negl %r11d
cmpl %r11d, %r9d
jbe 0x691d3
movl %r9d, %r15d
shrl %r15d
cmpl %r11d, %r15d
setb %r11b
testb %r11b, %r10b
je 0x69243
testb $0x1, %r10b
movl $0x0, %r10d
jne 0x69137
addl %r9d, %esi
movl $0x1, (%rbx,%rax,4)
decl %esi
je 0x69233
xorl %ecx, %ecx
movq 0x18(%rsp), %r11
movl (%r14,%rcx,4), %edx
cmpl $0x2, %edx
jb 0x69221
movl %esi, %r9d
negl %r9d
movl $0x1, %r10d
subl %edx, %r10d
cmpl %r9d, %edx
cmoval %esi, %r10d
addl %r10d, %edx
movl %edx, (%r14,%rcx,4)
subl %r10d, %esi
cmpq $0xfe, %rcx
ja 0x69252
incq %rcx
testl %esi, %esi
jne 0x691f8
jmp 0x69252
movq 0x18(%rsp), %r11
jmp 0x69252
leaq (%rbx,%rax,4), %rcx
movl (%rcx), %r9d
jmp 0x69247
leaq (%rbx,%rax,4), %rcx
movq 0x18(%rsp), %r11
addl %esi, %r9d
movl %r9d, (%rcx)
cmpl $0x0, (%rbx,%rax,4)
je 0x69588
movq 0x120(%rsp), %rax
movl %eax, 0x360(%rsp,%rdi,4)
xorl %ecx, %ecx
xorl %esi, %esi
movq %r11, %rax
cmpl $0x0, 0x360(%rsp,%rcx,4)
je 0x692b0
movl (%rbx,%rcx,4), %edx
testl %edx, %edx
je 0x692a8
testl %esi, %esi
je 0x69297
decl %esi
movslq %esi, %rdx
subq %rdx, %rax
movb %dl, (%rax)
incq %rax
movl (%rbx,%rcx,4), %edx
cmpl $0x7f, %edx
ja 0x692c1
movb %dl, (%rax)
movl $0x1, %edx
jmp 0x69374
incl %esi
movb $0x0, (%rax)
incq %rax
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x69272
jmp 0x6938e
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x692e5
movl %edx, %esi
shrl $0x7, %esi
orb $-0x80, %sil
movb %sil, (%rax)
andb $0x7f, %dl
movb %dl, 0x1(%rax)
movl $0x2, %edx
jmp 0x69374
cmpl $0x1fffff, %edx         # imm = 0x1FFFFF
ja 0x69313
movl %edx, %esi
shrl $0xe, %esi
orb $-0x80, %sil
movb %sil, (%rax)
movl %edx, %esi
shrl $0x7, %esi
orb $-0x80, %sil
movb %sil, 0x1(%rax)
andb $0x7f, %dl
movb %dl, 0x2(%rax)
movl $0x3, %edx
jmp 0x69374
cmpl $0xfffffff, %edx        # imm = 0xFFFFFFF
ja 0x6934e
movl %edx, %esi
shrl $0x15, %esi
orb $-0x80, %sil
movb %sil, (%rax)
movl %edx, %esi
shrl $0xe, %esi
orb $-0x80, %sil
movb %sil, 0x1(%rax)
movl %edx, %esi
shrl $0x7, %esi
orb $-0x80, %sil
movb %sil, 0x2(%rax)
andb $0x7f, %dl
movb %dl, 0x3(%rax)
movl $0x4, %edx
jmp 0x69374
vmovd %edx, %xmm2
vpbroadcastd %xmm2, %xmm2
vpsrlvd %xmm0, %xmm2, %xmm2
vpshufb %xmm1, %xmm2, %xmm2
vpor %xmm4, %xmm2, %xmm2
vmovd %xmm2, (%rax)
andb $0x7f, %dl
movb %dl, 0x4(%rax)
movl $0x5, %edx
addq %rdx, %rax
incq %rcx
movl $0x0, %esi
cmpq $0x100, %rcx            # imm = 0x100
jne 0x69272
jmp 0x6939f
testl %esi, %esi
je 0x6939f
decl %esi
movslq %esi, %rcx
subq %rcx, %rax
movb %cl, (%rax)
incq %rax
movl 0x360(%rsp,%rdi,4), %ecx
movl %r8d, %edx
notl %edx
testl %edx, %ecx
je 0x693ea
xorl %edx, %edx
cmpl %r8d, %ecx
jae 0x693c1
xorl %edx, %edx
addl %ecx, %ecx
incl %edx
cmpl %r8d, %ecx
jb 0x693b8
vmovd %edx, %xmm2
vpbroadcastd %xmm2, %ymm2
xorl %ecx, %ecx
vmovdqu (%r14,%rcx,4), %ymm3
vpsllvd %ymm2, %ymm3, %ymm3
vmovdqu %ymm3, (%r14,%rcx,4)
addq $0x8, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x693cc
movl %r8d, 0x360(%rsp,%rdi,4)
cmpl $0x10, 0xc0(%rsp)
ja 0x6a0a7
subl %r11d, %eax
cltq
addq %rax, %r11
movq %r11, 0x18(%rsp)
xorl %r10d, %r10d
xorl %r11d, %r11d
movl %r8d, %eax
subl %r11d, %eax
jb 0x6a085
movl (%rbx,%r10,4), %r15d
cmpl %r15d, %eax
jb 0x6a063
movq %rdi, %rax
shlq $0xc, %rax
addq %r12, %rax
movq %r10, %r9
shlq $0x4, %r9
addq %rax, %r9
movl 0x80(%rsp), %eax
imull %r15d, %eax
decl %eax
movl %eax, (%r9)
movl %r8d, %eax
subl %r15d, %eax
movw %ax, 0xc(%r9)
cmpl $0x2, %r15d
jae 0x6947e
movl $0xffffffff, 0x4(%r9)   # imm = 0xFFFFFFFF
movq 0x140(%rsp), %rax
addl %r11d, %eax
movl %eax, 0x8(%r9)
movw $0x20, %si
jmp 0x694b1
movl $0x1e, %esi
leal -0x1e(%rsi), %ecx
movl $0x1, %eax
shll %cl, %eax
incl %esi
cmpl %r15d, %eax
jb 0x69483
movl $0x1, %eax
movl %esi, %ecx
shlq %cl, %rax
addq %r15, %rax
decq %rax
xorl %edx, %edx
divq %r15
movl %eax, 0x4(%r9)
movl %r11d, 0x8(%r9)
movw %si, 0xe(%r9)
addl (%rbx,%r10,4), %r11d
incq %r10
cmpq $0x100, %r10            # imm = 0x100
jne 0x69413
movq %rdi, %r15
movq 0x60(%rsp), %rdi
incq %r15
addq $0x400, %r14            # imm = 0x400
cmpq $0x100, %r15            # imm = 0x100
jne 0x690e9
movl 0xc0(%rsp), %eax
shlb $0x4, %al
movq 0xb0(%rsp), %r14
movb %al, (%r14)
movq 0x18(%rsp), %r13
movq %r13, %rbx
subq %r14, %rbx
cmpq $0x3e9, %rbx            # imm = 0x3E9
jl 0x6959a
vmovdqa %xmm4, 0x80(%rsp)
movq 0x40(%rsp), %rdi
subq %rdi, %r13
leaq 0x160(%rsp), %rcx
movl %r13d, %esi
xorl %edx, %edx
vzeroupper
callq 0x61ed5
movq %rax, %r8
testq %rax, %rax
movq 0x100(%rsp), %r15
je 0x6976f
movl 0x160(%rsp), %edx
leal 0x6(%rdx), %eax
cmpq %rax, %rbx
jbe 0x6976f
orb $0x1, (%r14)
cmpl $0x7f, %r13d
ja 0x695a7
movq 0x40(%rsp), %rdi
movb %r13b, (%rdi)
movl $0x1, %eax
vmovdqa 0x80(%rsp), %xmm1
jmp 0x69685
movq 0x60(%rsp), %rdi
vzeroupper
callq 0x7e26a
jmp 0x69963
movq 0x100(%rsp), %r15
jmp 0x6977c
cmpl $0x3fff, %r13d          # imm = 0x3FFF
movq 0x40(%rsp), %rdi
vmovdqa 0x80(%rsp), %xmm1
movl %r13d, %eax
ja 0x695dc
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x1(%r14)
andb $0x7f, %r13b
movb %r13b, 0x2(%r14)
movl $0x2, %eax
jmp 0x69685
cmpl $0x1fffff, %r13d        # imm = 0x1FFFFF
ja 0x69609
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x1(%r14)
movl %r13d, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x2(%r14)
andb $0x7f, %r13b
movb %r13b, 0x3(%r14)
movl $0x3, %eax
jmp 0x69685
cmpl $0xfffffff, %r13d       # imm = 0xFFFFFFF
ja 0x69642
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0x1(%r14)
movl %r13d, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x2(%r14)
movl %r13d, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x3(%r14)
andb $0x7f, %r13b
movb %r13b, 0x4(%r14)
movl $0x4, %eax
jmp 0x69685
shrl $0x1c, %eax
movl %r13d, %ecx
shrl $0x15, %ecx
movl %r13d, %r9d
shrl $0xe, %r9d
movl %r13d, %esi
vmovd %eax, %xmm0
vpinsrb $0x1, %ecx, %xmm0, %xmm0
vpinsrb $0x2, %r9d, %xmm0, %xmm0
shrl $0x7, %esi
vpinsrb $0x3, %esi, %xmm0, %xmm0
vpor %xmm1, %xmm0, %xmm0
vmovd %xmm0, 0x1(%r14)
andb $0x7f, %r13b
movb %r13b, 0x5(%r14)
movl $0x5, %eax
addq %rax, %rdi
cmpl $0x7f, %edx
ja 0x69699
movb %dl, (%rdi)
movl $0x1, %eax
jmp 0x69746
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x696bb
movl %edx, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %edx, %eax
andb $0x7f, %al
movb %al, 0x1(%rdi)
movl $0x2, %eax
jmp 0x69746
cmpl $0x1fffff, %edx         # imm = 0x1FFFFF
ja 0x696e4
movl %edx, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %edx, %eax
andb $0x7f, %al
movb %al, 0x2(%rdi)
movl $0x3, %eax
jmp 0x69746
cmpl $0xfffffff, %edx        # imm = 0xFFFFFFF
ja 0x69717
movl %edx, %eax
shrl $0x15, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %edx, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x2(%rdi)
movl %edx, %eax
andb $0x7f, %al
movb %al, 0x3(%rdi)
movl $0x4, %eax
jmp 0x69746
vmovd %edx, %xmm0
vpbroadcastd %xmm0, %xmm0
vpsrlvd 0x32817(%rip), %xmm0, %xmm0 # 0x9bf40
vpshufb 0x3281e(%rip), %xmm0, %xmm0 # 0x9bf50
vpor %xmm1, %xmm0, %xmm0
vmovd %xmm0, (%rdi)
movl %edx, %eax
andb $0x7f, %al
movb %al, 0x4(%rdi)
movl $0x5, %eax
addq %rax, %rdi
movq %r8, %rsi
movq %rdx, 0x80(%rsp)
movq %r8, %rbx
movq %rdi, %r13
callq 0x43c0
movq %rbx, %r8
addq 0x80(%rsp), %r13
movq %r13, 0x18(%rsp)
movq %r8, %rdi
callq 0x45c0
movq 0x60(%rsp), %rdi
vzeroupper
callq 0x7e26a
cmpl $0x0, 0xc0(%rsp)
js 0x69963
xorl %eax, %eax
vbroadcastss 0x367e3(%rip), %ymm0 # 0x9ff80
vmovaps %ymm0, 0x360(%rsp,%rax,4)
addq $0x8, %rax
cmpq $0x20, %rax
jne 0x6979d
vmovd 0x54(%rsp), %xmm0
vpbroadcastd %xmm0, %ymm0
vmovaps 0x3681d(%rip), %ymm1    # 0x9ffe0
vmovaps 0x36835(%rip), %ymm2    # 0xa0000
xorl %eax, %eax
vpcmpeqd %ymm3, %ymm3, %ymm3
vpbroadcastd 0x367be(%rip), %ymm4 # 0x9ff98
vpbroadcastq 0x367dd(%rip), %ymm5 # 0x9ffc0
vperm2f128 $0x31, %ymm1, %ymm2, %ymm6 # ymm6 = ymm2[2,3],ymm1[2,3]
vinsertf128 $0x1, %xmm1, %ymm2, %ymm7
vshufps $0x88, %ymm6, %ymm7, %ymm6 # ymm6 = ymm7[0,2],ymm6[0,2],ymm7[4,6],ymm6[4,6]
vpsubd %ymm3, %ymm6, %ymm6
vpmulld %ymm6, %ymm0, %ymm6
vpaddd %ymm4, %ymm6, %ymm6
vmovdqu %ymm6, 0x780(%rsp,%rax,4)
addq $0x8, %rax
vpaddq %ymm5, %ymm2, %ymm2
vpaddq %ymm5, %ymm1, %ymm1
cmpq $0x20, %rax
jne 0x697e3
xorl %eax, %eax
movslq 0x780(%rsp,%rax,4), %rcx
movslq 0x784(%rsp,%rax,4), %rdx
movslq 0x788(%rsp,%rax,4), %rsi
movslq 0x78c(%rsp,%rax,4), %rdi
movslq 0x790(%rsp,%rax,4), %r8
movslq 0x794(%rsp,%rax,4), %r9
movslq 0x798(%rsp,%rax,4), %r10
movslq 0x79c(%rsp,%rax,4), %r11
movzbl 0x1(%r15,%rcx), %ecx
vmovd %ecx, %xmm0
vpinsrb $0x1, 0x1(%r15,%rdx), %xmm0, %xmm0
vpinsrb $0x2, 0x1(%r15,%rsi), %xmm0, %xmm0
vpinsrb $0x3, 0x1(%r15,%rdi), %xmm0, %xmm0
vpinsrb $0x4, 0x1(%r15,%r8), %xmm0, %xmm0
vpinsrb $0x5, 0x1(%r15,%r9), %xmm0, %xmm0
vpinsrb $0x6, 0x1(%r15,%r10), %xmm0, %xmm0
vpinsrb $0x7, 0x1(%r15,%r11), %xmm0, %xmm0
vmovq %xmm0, 0x20(%rsp,%rax)
addq $0x8, %rax
cmpq $0x20, %rax
jne 0x6981e
movq 0xe0(%rsp), %r10
leal -0x1(%r10), %eax
movb (%r15,%rax), %cl
movb %cl, 0x3f(%rsp)
leal -0x2(%r10), %esi
andl $-0x20, %r10d
addl $-0x2, %r10d
movl %esi, 0x7fc(%rsp)
cmpl %r10d, %esi
jle 0x69980
movl 0x3dc(%rsp), %eax
movq 0x58(%rsp), %r11
movl %esi, %edx
movzbl %cl, %esi
movzbl (%r15,%rdx), %edx
movl %edx, %edi
shll $0xc, %edi
addq %r12, %rdi
shll $0x4, %esi
xorl %ecx, %ecx
cmpl (%rsi,%rdi), %eax
seta %cl
leal (%rcx,%rcx), %r8d
movw %ax, -0x2(%r11)
shll $0x4, %ecx
shrl %cl, %eax
movl 0x4(%rsi,%rdi), %r9d
imulq %rax, %r9
movb 0xe(%rsi,%rdi), %cl
shrq %cl, %r9
addl 0x8(%rsi,%rdi), %eax
subq %r8, %r11
movzwl 0xc(%rsi,%rdi), %ecx
imull %r9d, %ecx
addl %eax, %ecx
movl %ecx, 0x3dc(%rsp)
movb %dl, 0x3f(%rsp)
movl 0x7fc(%rsp), %esi
decl %esi
movl %esi, 0x7fc(%rsp)
movl %ecx, %eax
movl %edx, %ecx
cmpl %r10d, %esi
jg 0x698f0
jmp 0x69985
movq %r12, %rdi
callq 0x7e26a
xorl %r14d, %r14d
movq %r14, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x58(%rsp), %r11
vmovdqa 0x360(%rsp), %ymm3
vmovdqa 0x380(%rsp), %ymm4
vmovdqa 0x3a0(%rsp), %ymm5
vmovdqa 0x3c0(%rsp), %ymm6
cmpl $0x0, 0x780(%rsp)
js 0x69f61
vpxor %xmm0, %xmm0, %xmm0
leaq 0x325be(%rip), %rax     # 0x9bf80
vpbroadcastd 0x365b9(%rip), %ymm1 # 0x9ff84
vmovdqa %ymm1, 0x80(%rsp)
vpcmpeqd %ymm2, %ymm2, %ymm2
movq $-0x8, %rcx
movslq 0x7a0(%rsp,%rcx,4), %rdx
movzbl (%r15,%rdx), %edx
movzbl 0x28(%rsp,%rcx), %r9d
movl %edx, %r10d
shll $0xc, %r10d
addq %r12, %r10
shll $0x4, %r9d
movslq 0x7b0(%rsp,%rcx,4), %rsi
movzbl (%r15,%rsi), %esi
movzbl 0x2c(%rsp,%rcx), %r8d
movslq 0x7a4(%rsp,%rcx,4), %rdi
movzbl (%r15,%rdi), %edi
vmovdqu (%r9,%r10), %xmm1
movzbl 0x29(%rsp,%rcx), %r9d
movl %edi, %r10d
shll $0xc, %r10d
addq %r12, %r10
shll $0x4, %r9d
vmovdqu (%r9,%r10), %xmm8
movl %esi, %r9d
shll $0xc, %r9d
addq %r12, %r9
shll $0x4, %r8d
movslq 0x7b4(%rsp,%rcx,4), %r10
movzbl (%r15,%r10), %r10d
vinserti128 $0x1, (%r8,%r9), %ymm1, %ymm7
movzbl 0x2d(%rsp,%rcx), %r8d
movl %r10d, %r9d
shll $0xc, %r9d
addq %r12, %r9
shll $0x4, %r8d
vinserti128 $0x1, (%r8,%r9), %ymm8, %ymm8
movb %dl, 0x28(%rsp,%rcx)
movb %sil, 0x2c(%rsp,%rcx)
movb %dil, 0x29(%rsp,%rcx)
movb %r10b, 0x2d(%rsp,%rcx)
movslq 0x7a8(%rsp,%rcx,4), %rdx
movzbl (%r15,%rdx), %edx
movzbl 0x2a(%rsp,%rcx), %edi
movl %edx, %r8d
shll $0xc, %r8d
addq %r12, %r8
shll $0x4, %edi
movslq 0x7b8(%rsp,%rcx,4), %rsi
movzbl (%r15,%rsi), %esi
movzbl 0x2e(%rsp,%rcx), %r9d
movl %esi, %r10d
shll $0xc, %r10d
addq %r12, %r10
shll $0x4, %r9d
vmovdqu (%rdi,%r8), %xmm1
movslq 0x7ac(%rsp,%rcx,4), %rdi
movzbl (%r15,%rdi), %edi
movzbl 0x2b(%rsp,%rcx), %r8d
vinserti128 $0x1, (%r9,%r10), %ymm1, %ymm9
movl %edi, %r9d
shll $0xc, %r9d
addq %r12, %r9
shll $0x4, %r8d
movslq 0x7bc(%rsp,%rcx,4), %r10
movzbl (%r15,%r10), %r10d
vmovdqu (%r8,%r9), %xmm1
movzbl 0x2f(%rsp,%rcx), %r8d
movl %r10d, %r9d
shll $0xc, %r9d
addq %r12, %r9
shll $0x4, %r8d
vinserti128 $0x1, (%r8,%r9), %ymm1, %ymm10
movb %dl, 0x2a(%rsp,%rcx)
movb %sil, 0x2e(%rsp,%rcx)
movb %dil, 0x2b(%rsp,%rcx)
movb %r10b, 0x2f(%rsp,%rcx)
vpshufd $0x93, %ymm8, %ymm1     # ymm1 = ymm8[3,0,1,2,7,4,5,6]
vpshufd $0x4e, %ymm9, %ymm11    # ymm11 = ymm9[2,3,0,1,6,7,4,5]
vpshufd $0x39, %ymm10, %ymm12   # ymm12 = ymm10[1,2,3,0,5,6,7,4]
vpblendd $0x11, %ymm7, %ymm0, %ymm13 # ymm13 = ymm7[0],ymm0[1,2,3],ymm7[4],ymm0[5,6,7]
vpblendd $0x22, %ymm1, %ymm0, %ymm14 # ymm14 = ymm0[0],ymm1[1],ymm0[2,3,4],ymm1[5],ymm0[6,7]
vpor %ymm13, %ymm14, %ymm13
vpblendd $0x44, %ymm11, %ymm0, %ymm11 # ymm11 = ymm0[0,1],ymm11[2],ymm0[3,4,5],ymm11[6],ymm0[7]
vpslldq $0xc, %ymm10, %ymm14    # ymm14 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm10[0,1,2,3],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm10[16,17,18,19]
vpor %ymm14, %ymm11, %ymm11
vpor %ymm11, %ymm13, %ymm11
vmovdqa %ymm11, 0x180(%rsp,%rcx,4)
vpblendd $0x44, %ymm7, %ymm0, %ymm11 # ymm11 = ymm0[0,1],ymm7[2],ymm0[3,4,5],ymm7[6],ymm0[7]
vpblendd $0x88, %ymm1, %ymm0, %ymm1 # ymm1 = ymm0[0,1,2],ymm1[3],ymm0[4,5,6],ymm1[7]
vpblendd $0x22, %ymm12, %ymm0, %ymm13 # ymm13 = ymm0[0],ymm12[1],ymm0[2,3,4],ymm12[5],ymm0[6,7]
vpblendd $0x22, %ymm8, %ymm0, %ymm14 # ymm14 = ymm0[0],ymm8[1],ymm0[2,3,4],ymm8[5],ymm0[6,7]
vpshufd $0x55, %ymm7, %ymm15    # ymm15 = ymm7[1,1,1,1,5,5,5,5]
vpblendd $0x11, %ymm15, %ymm0, %ymm15 # ymm15 = ymm15[0],ymm0[1,2,3],ymm15[4],ymm0[5,6,7]
vpor %ymm15, %ymm14, %ymm14
vpshufd $0x55, %ymm9, %ymm15    # ymm15 = ymm9[1,1,1,1,5,5,5,5]
vpblendd $0x44, %ymm15, %ymm0, %ymm15 # ymm15 = ymm0[0,1],ymm15[2],ymm0[3,4,5],ymm15[6],ymm0[7]
vpslldq $0xc, %ymm12, %ymm12    # ymm12 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm12[0,1,2,3],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm12[16,17,18,19]
vpor %ymm12, %ymm15, %ymm12
vpor %ymm12, %ymm14, %ymm12
vmovdqa %ymm12, 0x300(%rsp,%rcx,4)
vpshufd $0xff, %ymm8, %ymm8     # ymm8 = ymm8[3,3,3,3,7,7,7,7]
vpblendd $0x22, %ymm8, %ymm0, %ymm8 # ymm8 = ymm0[0],ymm8[1],ymm0[2,3,4],ymm8[5],ymm0[6,7]
vpsrldq $0xc, %ymm7, %ymm7      # ymm7 = ymm7[12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,ymm7[28,29,30,31],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
vpor %ymm7, %ymm8, %ymm7
vpshufd $0xff, %ymm9, %ymm8     # ymm8 = ymm9[3,3,3,3,7,7,7,7]
vpblendd $0x44, %ymm8, %ymm0, %ymm8 # ymm8 = ymm0[0,1],ymm8[2],ymm0[3,4,5],ymm8[6],ymm0[7]
vpor %ymm7, %ymm8, %ymm7
vpblendd $0x88, %ymm10, %ymm7, %ymm7 # ymm7 = ymm7[0,1,2],ymm10[3],ymm7[4,5,6],ymm10[7]
vmovdqa %ymm7, 0x280(%rsp,%rcx,4)
vpshufd $0x4e, %ymm11, %ymm7    # ymm7 = ymm11[2,3,0,1,6,7,4,5]
vpshufd $0x4e, %ymm1, %ymm1     # ymm1 = ymm1[2,3,0,1,6,7,4,5]
vpblendd $0xbb, %ymm0, %ymm9, %ymm8 # ymm8 = ymm0[0,1],ymm9[2],ymm0[3,4,5],ymm9[6],ymm0[7]
vpor %ymm7, %ymm8, %ymm7
vpor %ymm7, %ymm1, %ymm1
vpshufd $0x4e, %ymm13, %ymm7    # ymm7 = ymm13[2,3,0,1,6,7,4,5]
vpor %ymm7, %ymm1, %ymm1
vmovdqa %ymm1, 0x200(%rsp,%rcx,4)
addq $0x8, %rcx
cmpq $0x18, %rcx
jb 0x699df
vpcmpgtd 0x160(%rsp), %ymm3, %ymm7
vmovmskps %ymm7, %r8d
vpcmpgtd 0x180(%rsp), %ymm4, %ymm8
vmovmskps %ymm8, %esi
vpcmpgtd 0x1a0(%rsp), %ymm5, %ymm9
vpcmpgtd 0x1c0(%rsp), %ymm6, %ymm10
vmovmskps %ymm9, %edi
vmovmskps %ymm10, %edx
popcntl %r8d, %ecx
shll $0x5, %r8d
vmovdqa (%r8,%rax), %ymm1
popcntl %esi, %r8d
shll $0x5, %esi
vmovdqa (%rsi,%rax), %ymm11
popcntl %edi, %esi
shll $0x5, %edi
vmovdqa (%rdi,%rax), %ymm12
popcntl %edx, %edi
shll $0x5, %edx
vmovdqa (%rdx,%rax), %ymm13
vpand %ymm3, %ymm7, %ymm14
vpermd %ymm14, %ymm1, %ymm1
vpand %ymm4, %ymm8, %ymm14
vpermd %ymm14, %ymm11, %ymm11
vpand %ymm5, %ymm9, %ymm14
vpermd %ymm14, %ymm12, %ymm12
vpand %ymm6, %ymm10, %ymm14
vpermd %ymm14, %ymm13, %ymm13
vpblendw $0xaa, %ymm0, %ymm1, %ymm1 # ymm1 = ymm1[0],ymm0[1],ymm1[2],ymm0[3],ymm1[4],ymm0[5],ymm1[6],ymm0[7],ymm1[8],ymm0[9],ymm1[10],ymm0[11],ymm1[12],ymm0[13],ymm1[14],ymm0[15]
vpblendw $0xaa, %ymm0, %ymm11, %ymm11 # ymm11 = ymm11[0],ymm0[1],ymm11[2],ymm0[3],ymm11[4],ymm0[5],ymm11[6],ymm0[7],ymm11[8],ymm0[9],ymm11[10],ymm0[11],ymm11[12],ymm0[13],ymm11[14],ymm0[15]
vpackusdw %ymm11, %ymm1, %ymm1
vpblendw $0xaa, %ymm0, %ymm12, %ymm11 # ymm11 = ymm12[0],ymm0[1],ymm12[2],ymm0[3],ymm12[4],ymm0[5],ymm12[6],ymm0[7],ymm12[8],ymm0[9],ymm12[10],ymm0[11],ymm12[12],ymm0[13],ymm12[14],ymm0[15]
vpblendw $0xaa, %ymm0, %ymm13, %ymm12 # ymm12 = ymm13[0],ymm0[1],ymm13[2],ymm0[3],ymm13[4],ymm0[5],ymm13[6],ymm0[7],ymm13[8],ymm0[9],ymm13[10],ymm0[11],ymm13[12],ymm0[13],ymm13[14],ymm0[15]
vpackusdw %ymm12, %ymm11, %ymm11
vpermq $0xd8, %ymm11, %ymm11   # ymm11 = ymm11[0,2,1,3]
vextracti128 $0x1, %ymm11, -0x10(%r11)
addl %edi, %edi
subq %rdi, %r11
vmovdqu %xmm11, -0x10(%r11)
addl %esi, %esi
subq %rsi, %r11
vpermq $0xd8, %ymm1, %ymm1     # ymm1 = ymm1[0,2,1,3]
vextracti128 $0x1, %ymm1, -0x10(%r11)
addl %r8d, %r8d
subq %r8, %r11
vmovdqu %xmm1, -0x10(%r11)
vpsrld $0x10, %ymm3, %ymm1
vpsrld $0x10, %ymm4, %ymm11
vpsrld $0x10, %ymm5, %ymm12
vpsrld $0x10, %ymm6, %ymm13
vblendvps %ymm7, %ymm1, %ymm3, %ymm3
vblendvps %ymm8, %ymm11, %ymm4, %ymm4
vblendvps %ymm9, %ymm12, %ymm5, %ymm5
vblendvps %ymm10, %ymm13, %ymm6, %ymm6
negq %rcx
vpsrlq $0x20, %ymm3, %ymm1
vmovdqa 0x2e0(%rsp), %ymm7
vmovdqa 0x300(%rsp), %ymm8
vmovdqa 0x320(%rsp), %ymm9
vmovdqa 0x340(%rsp), %ymm10
vpsrlq $0x20, %ymm7, %ymm11
vpmuludq %ymm1, %ymm11, %ymm1
vpmuludq %ymm3, %ymm7, %ymm7
vpsrlq $0x20, %ymm7, %ymm7
vpblendd $0xaa, %ymm1, %ymm7, %ymm1 # ymm1 = ymm7[0],ymm1[1],ymm7[2],ymm1[3],ymm7[4],ymm1[5],ymm7[6],ymm1[7]
vpsrlq $0x20, %ymm4, %ymm7
vpsrlq $0x20, %ymm8, %ymm11
vpmuludq %ymm7, %ymm11, %ymm7
vpmuludq %ymm4, %ymm8, %ymm8
vpsrlq $0x20, %ymm8, %ymm8
vpblendd $0xaa, %ymm7, %ymm8, %ymm7 # ymm7 = ymm8[0],ymm7[1],ymm8[2],ymm7[3],ymm8[4],ymm7[5],ymm8[6],ymm7[7]
vmovdqa %ymm7, 0x140(%rsp)
vpsrlq $0x20, %ymm5, %ymm7
vpsrlq $0x20, %ymm9, %ymm8
vpmuludq %ymm7, %ymm8, %ymm7
vpmuludq %ymm5, %ymm9, %ymm8
vpsrlq $0x20, %ymm8, %ymm8
vpblendd $0xaa, %ymm7, %ymm8, %ymm7 # ymm7 = ymm8[0],ymm7[1],ymm8[2],ymm7[3],ymm8[4],ymm7[5],ymm8[6],ymm7[7]
vpsrlq $0x20, %ymm6, %ymm8
vpsrlq $0x20, %ymm10, %ymm9
vpmuludq %ymm8, %ymm9, %ymm8
vpmuludq %ymm6, %ymm10, %ymm9
vpsrlq $0x20, %ymm9, %ymm9
vpblendd $0xaa, %ymm8, %ymm9, %ymm8 # ymm8 = ymm9[0],ymm8[1],ymm9[2],ymm8[3],ymm9[4],ymm8[5],ymm9[6],ymm8[7]
vmovdqa %ymm8, 0x120(%rsp)
vmovdqa 0x260(%rsp), %ymm8
vmovdqa 0x280(%rsp), %ymm12
vmovdqa 0x2a0(%rsp), %ymm10
vmovdqa 0x2c0(%rsp), %ymm9
vpsrld $0x10, %ymm8, %ymm11
vpsrld $0x10, %ymm10, %ymm13
vmovdqa 0x80(%rsp), %ymm14
vpaddd %ymm14, %ymm11, %ymm11
vpsrlvd %ymm11, %ymm1, %ymm1
vmovdqa %ymm1, 0xc0(%rsp)
vpaddd %ymm14, %ymm13, %ymm1
vpsrlvd %ymm1, %ymm7, %ymm1
vmovdqa %ymm1, 0x60(%rsp)
vpblendw $0xaa, %ymm0, %ymm8, %ymm1 # ymm1 = ymm8[0],ymm0[1],ymm8[2],ymm0[3],ymm8[4],ymm0[5],ymm8[6],ymm0[7],ymm8[8],ymm0[9],ymm8[10],ymm0[11],ymm8[12],ymm0[13],ymm8[14],ymm0[15]
vmovdqa %ymm1, 0xe0(%rsp)
vpblendw $0xaa, %ymm0, %ymm12, %ymm11 # ymm11 = ymm12[0],ymm0[1],ymm12[2],ymm0[3],ymm12[4],ymm0[5],ymm12[6],ymm0[7],ymm12[8],ymm0[9],ymm12[10],ymm0[11],ymm12[12],ymm0[13],ymm12[14],ymm0[15]
vpblendw $0xaa, %ymm0, %ymm10, %ymm14 # ymm14 = ymm10[0],ymm0[1],ymm10[2],ymm0[3],ymm10[4],ymm0[5],ymm10[6],ymm0[7],ymm10[8],ymm0[9],ymm10[10],ymm0[11],ymm10[12],ymm0[13],ymm10[14],ymm0[15]
vpblendw $0xaa, %ymm0, %ymm9, %ymm10 # ymm10 = ymm9[0],ymm0[1],ymm9[2],ymm0[3],ymm9[4],ymm0[5],ymm9[6],ymm0[7],ymm9[8],ymm0[9],ymm9[10],ymm0[11],ymm9[12],ymm0[13],ymm9[14],ymm0[15]
vmovdqa 0x1e0(%rsp), %ymm15
vmovdqa 0x200(%rsp), %ymm1
vmovdqa %ymm1, 0x100(%rsp)
xorl %edx, %edx
vmovdqa 0x220(%rsp), %ymm7
vmovdqa 0x240(%rsp), %ymm8
vpaddd 0x780(%rsp,%rdx,4), %ymm2, %ymm13
vmovdqu %ymm13, 0x780(%rsp,%rdx,4)
addq $0x8, %rdx
cmpq $0x20, %rdx
jne 0x69eaf
vpsrld $0x10, %ymm12, %ymm12
vmovdqa 0x80(%rsp), %ymm13
vpaddd %ymm13, %ymm12, %ymm12
vmovdqa 0x140(%rsp), %ymm1
vpsrlvd %ymm12, %ymm1, %ymm12
vpmulld %ymm11, %ymm12, %ymm11
vpsrld $0x10, %ymm9, %ymm9
vpaddd %ymm13, %ymm9, %ymm9
vmovdqa 0x120(%rsp), %ymm1
vpsrlvd %ymm9, %ymm1, %ymm9
vpmulld %ymm10, %ymm9, %ymm9
vmovdqa 0xe0(%rsp), %ymm1
vpmulld 0xc0(%rsp), %ymm1, %ymm10
vpmulld 0x60(%rsp), %ymm14, %ymm12
vpaddd %ymm3, %ymm10, %ymm3
vpaddd %ymm3, %ymm15, %ymm3
vpaddd 0x100(%rsp), %ymm4, %ymm1
vpaddd %ymm1, %ymm11, %ymm4
vpaddd %ymm5, %ymm12, %ymm1
vpaddd %ymm7, %ymm1, %ymm5
vpaddd %ymm6, %ymm8, %ymm1
vpaddd %ymm1, %ymm9, %ymm6
leaq (%r11,%rcx,2), %r11
cmpl $0x0, 0x780(%rsp)
jns 0x699d8
movq 0x18(%rsp), %rax
subq %r14, %rax
vmovdqa %ymm3, 0x360(%rsp)
vmovdqa %ymm4, 0x380(%rsp)
vmovdqa %ymm5, 0x3a0(%rsp)
vmovdqa %ymm6, 0x3c0(%rsp)
movl $0x1f, %edx
movzbl 0x20(%rsp,%rdx), %r8d
shll $0x4, %r8d
movl 0x360(%rsp,%rdx,4), %r9d
xorl %ecx, %ecx
cmpl (%r12,%r8), %r9d
seta %cl
movq %r11, %rsi
leal (%rcx,%rcx), %edi
movw %r9w, -0x2(%r11)
shll $0x4, %ecx
shrl %cl, %r9d
movl 0x4(%r12,%r8), %r10d
imulq %r9, %r10
movb 0xe(%r12,%r8), %cl
shrq %cl, %r10
subq %rdi, %r11
addl 0x8(%r12,%r8), %r9d
movzwl 0xc(%r12,%r8), %ecx
imull %r10d, %ecx
addl %r9d, %ecx
movl %ecx, 0x360(%rsp,%rdx,4)
addq $-0x1, %rdx
jb 0x69f92
movl %edi, %ecx
movq %rsi, %r8
subq %rcx, %r8
movq 0x18(%rsp), %r10
addl 0x48(%rsp), %r10d
addl %edi, %r10d
subl %esi, %r10d
xorl %r9d, %r9d
movl 0x3dc(%rsp,%r9), %edi
movl %edi, -0x4(%r8,%r9)
addq $-0x4, %r9
addl $0x4, %r10d
cmpq $-0x80, %r9
jne 0x6a00c
movq 0x48(%rsp), %rdx
addq %r14, %rdx
addq %rcx, %rdx
subq %rsi, %rdx
subq %r9, %rdx
movl %eax, %edi
movq 0xb8(%rsp), %rax
movl %r10d, (%rax)
addq %r14, %rdi
subq %rcx, %rsi
addq %r9, %rsi
vzeroupper
callq 0x4830
movq %r12, %rdi
callq 0x7e26a
jmp 0x6996e
leaq 0x31e68(%rip), %rdi     # 0x9bed2
leaq 0x31ddf(%rip), %rsi     # 0x9be50
leaq 0x31df8(%rip), %rcx     # 0x9be70
movl $0xcd, %edx
vzeroupper
callq 0x42f0
leaq 0x31e2a(%rip), %rdi     # 0x9beb6
leaq 0x31dbd(%rip), %rsi     # 0x9be50
leaq 0x31dd6(%rip), %rcx     # 0x9be70
movl $0xcc, %edx
vzeroupper
callq 0x42f0
leaq 0x35fb2(%rip), %rdi     # 0xa0060
leaq 0x31d9b(%rip), %rsi     # 0x9be50
leaq 0x31db4(%rip), %rcx     # 0x9be70
movl $0xcb, %edx
vzeroupper
callq 0x42f0