// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_striped_avx2_256_16.c
// Function: parasail_nw_rowcol_striped_profile_avx2_256_16
parasail_result_t* PNAME(
        const parasail_profile_t * const restrict profile,
        const char * const restrict s2, const int s2Len,
        const int open, const int gap)
{
    /* declare local variables */
    int32_t i = 0;
    int32_t j = 0;
    int32_t k = 0;
    int s1Len = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
    int32_t offset = 0;
    int32_t position = 0;
    __m256i* restrict vProfile = NULL;
    __m256i* restrict pvHStore = NULL;
    __m256i* restrict pvHLoad = NULL;
    __m256i* restrict pvE = NULL;
    int16_t* restrict boundary = NULL;
    __m256i vGapO;
    __m256i vGapE;
    int16_t NEG_LIMIT = 0;
    int16_t POS_LIMIT = 0;
    int16_t score = 0;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    parasail_result_t *result = NULL;

    /* validate inputs */
    PARASAIL_CHECK_NULL(profile);
    PARASAIL_CHECK_NULL(profile->profile16.score);
    PARASAIL_CHECK_NULL(profile->matrix);
    PARASAIL_CHECK_GT0(profile->s1Len);
    PARASAIL_CHECK_NULL(s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);

    /* initialize stack variables */
    i = 0;
    j = 0;
    k = 0;
    s1Len = profile->s1Len;
    end_query = s1Len-1;
    end_ref = s2Len-1;
    matrix = profile->matrix;
    segWidth = 16; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    vProfile = (__m256i*)profile->profile16.score;
    vGapO = _mm256_set1_epi16(open);
    vGapE = _mm256_set1_epi16(gap);
    NEG_LIMIT = (-open < matrix->min ? INT16_MIN + open : INT16_MIN - matrix->min) + 1;
    POS_LIMIT = INT16_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi16(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi16(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;

    /* initialize result */
#ifdef PARASAIL_TABLE
    result = parasail_result_new_table1(segLen*segWidth, s2Len);
#else
#ifdef PARASAIL_ROWCOL
    result = parasail_result_new_rowcol1(segLen*segWidth, s2Len);
#else
    result = parasail_result_new();
#endif
#endif
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_NW | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_BITS_16 | PARASAIL_FLAG_LANES_16;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    pvHStore = parasail_memalign___m256i(32, segLen);
    pvHLoad  = parasail_memalign___m256i(32, segLen);
    pvE      = parasail_memalign___m256i(32, segLen);
    boundary = parasail_memalign_int16_t(32, s2Len+1);

    /* validate heap variables */
    if (!pvHStore) return NULL;
    if (!pvHLoad) return NULL;
    if (!pvE) return NULL;
    if (!boundary) return NULL;

    /* initialize H and E */
    {
        int32_t index = 0;
        for (i=0; i<segLen; ++i) {
            int32_t segNum = 0;
            __m256i_16_t h;
            __m256i_16_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = -open-gap*(segNum*segLen+i);
                h.v[segNum] = tmp < INT16_MIN ? INT16_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT16_MIN ? INT16_MIN : tmp;
            }
            _mm256_store_si256(&pvHStore[index], h.m);
            _mm256_store_si256(&pvE[index], e.m);
            ++index;
        }
    }

    /* initialize uppder boundary */
    {
        boundary[0] = 0;
        for (i=1; i<=s2Len; ++i) {
            int64_t tmp = -open-gap*(i-1);
            boundary[i] = tmp < INT16_MIN ? INT16_MIN : tmp;
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m256i vE;
        /* Initialize F value to -inf.  Any errors to vH values will be
         * corrected in the Lazy_F loop.  */
        __m256i vF = vNegLimit;

        /* load final segment of pvHStore and shift left by 2 bytes */
        __m256i vH = _mm256_slli_si256_rpl(pvHStore[segLen - 1], 2);

        /* Correct part of the vProfile */
        const __m256i* vP = vProfile + matrix->mapper[(unsigned char)s2[j]] * segLen;

        /* Swap the 2 H buffers. */
        __m256i* pv = pvHLoad;
        pvHLoad = pvHStore;
        pvHStore = pv;

        /* insert upper boundary condition */
        vH = _mm256_insert_epi16_rpl(vH, boundary[j], 0);

        /* inner loop to process the query sequence */
        for (i=0; i<segLen; ++i) {
            vH = _mm256_adds_epi16(vH, _mm256_load_si256(vP + i));
            vE = _mm256_load_si256(pvE + i);

            /* Get max from vH, vE and vF. */
            vH = _mm256_max_epi16(vH, vE);
            vH = _mm256_max_epi16(vH, vF);
            /* Save vH values. */
            _mm256_store_si256(pvHStore + i, vH);
            vSaturationCheckMax = _mm256_max_epi16(vSaturationCheckMax, vH);
            vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vE);
            vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vF);
#ifdef PARASAIL_TABLE
            arr_store_si256(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif

            /* Update vE value. */
            vH = _mm256_subs_epi16(vH, vGapO);
            vE = _mm256_subs_epi16(vE, vGapE);
            vE = _mm256_max_epi16(vE, vH);
            _mm256_store_si256(pvE + i, vE);

            /* Update vF value. */
            vF = _mm256_subs_epi16(vF, vGapE);
            vF = _mm256_max_epi16(vF, vH);

            /* Load the next vH. */
            vH = _mm256_load_si256(pvHLoad + i);
        }

        /* Lazy_F loop: has been revised to disallow adjecent insertion and
         * then deletion, so don't update E(i, i), learn from SWPS3 */
        for (k=0; k<segWidth; ++k) {
            int64_t tmp = boundary[j+1]-open;
            int16_t tmp2 = tmp < INT16_MIN ? INT16_MIN : tmp;
            vF = _mm256_slli_si256_rpl(vF, 2);
            vF = _mm256_insert_epi16_rpl(vF, tmp2, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm256_load_si256(pvHStore + i);
                vH = _mm256_max_epi16(vH,vF);
                _mm256_store_si256(pvHStore + i, vH);
                vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vH);
                vSaturationCheckMax = _mm256_max_epi16(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
                arr_store_si256(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
                vH = _mm256_subs_epi16(vH, vGapO);
                vF = _mm256_subs_epi16(vF, vGapE);
                if (! _mm256_movemask_epi8(_mm256_cmpgt_epi16(vF, vH))) goto end;
                /*vF = _mm256_max_epi16(vF, vH);*/
            }
        }
end:
        {
        }

#ifdef PARASAIL_ROWCOL
        /* extract last value from the column */
        {
            vH = _mm256_load_si256(pvHStore + offset);
            for (k=0; k<position; ++k) {
                vH = _mm256_slli_si256_rpl(vH, 2);
            }
            result->rowcols->score_row[j] = (int16_t) _mm256_extract_epi16_rpl (vH, 15);
        }
#endif
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m256i vH = _mm256_load_si256(pvHStore+i);
        arr_store_col(result->rowcols->score_col, vH, i, segLen);
    }
#endif

    /* extract last value from the last column */
    {
        __m256i vH = _mm256_load_si256(pvHStore + offset);
        for (k=0; k<position; ++k) {
            vH = _mm256_slli_si256_rpl (vH, 2);
        }
        score = (int16_t) _mm256_extract_epi16_rpl (vH, 15);
    }

    if (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi16_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_cmpgt_epi16(vSaturationCheckMax, vPosLimit)))) {
        result->flag |= PARASAIL_FLAG_SATURATED;
        score = 0;
        end_query = 0;
        end_ref = 0;
    }

    result->score = score;
    result->end_query = end_query;
    result->end_ref = end_ref;

    parasail_free(boundary);
    parasail_free(pvE);
    parasail_free(pvHLoad);
    parasail_free(pvHStore);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, 0x38(%rsp)
testq %rdi, %rdi
je 0x56a479
movq 0x30(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x56a480
movq 0x10(%rdi), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x56a487
movl 0x8(%rdi), %edi
testl %edi, %edi
jle 0x56a48e
cmpq $0x0, 0x38(%rsp)
je 0x56a495
movl %edx, %r9d
testl %edx, %edx
jle 0x56a49c
testl %ecx, %ecx
js 0x56a4a3
testl %r8d, %r8d
js 0x56a4aa
movl %r8d, 0xb0(%rsp)
leal -0x1(%rdi), %r14d
addq $0xf, %rdi
movl %ecx, %esi
movq %rdi, %r13
shrq $0x4, %r13
movl %r14d, %eax
xorl %edx, %edx
divl %r13d
movl %eax, 0xc(%rsp)
movl %edx, %r15d
movl %ecx, %edx
negl %edx
movq 0x30(%rsp), %rcx
movl 0x20(%rcx), %eax
movl %eax, %ebx
negl %ebx
movl %edx, 0x48(%rsp)
cmpl %edx, %eax
movl %esi, 0x28(%rsp)
cmovgl %esi, %ebx
movw $0x7ffe, %bp            # imm = 0x7FFE
subw 0x1c(%rcx), %bp
andl $0x7ffffff0, %edi       # imm = 0x7FFFFFF0
movl %r9d, %esi
movq %r9, 0x90(%rsp)
callq 0x20ac53
testq %rax, %rax
je 0x56a4af
movl %r15d, 0x40(%rsp)
movl %r14d, 0x24(%rsp)
movq %rax, 0x18(%rsp)
orl $0x10240801, 0xc(%rax)  # imm = 0x10240801
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r14
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r12
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r15
movq 0x90(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x20, %edi
callq 0x20a625
testq %r14, %r14
sete %cl
testq %r12, %r12
sete %dl
orb %cl, %dl
testq %r15, %r15
sete %cl
testq %rax, %rax
sete %sil
orb %cl, %sil
orb %dl, %sil
jne 0x56a4af
movq 0x90(%rsp), %r9
leal -0x1(%r9), %ecx
movl %ecx, 0x5c(%rsp)
movl $0xf, %edx
subl 0xc(%rsp), %edx
movl 0x28(%rsp), %ecx
vmovd %ecx, %xmm0
vpbroadcastw %xmm0, %ymm2
movl 0xb0(%rsp), %r10d
vmovd %r10d, %xmm0
vpbroadcastw %xmm0, %ymm3
addl $0xffff8001, %ebx       # imm = 0xFFFF8001
vmovd %ebx, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x110(%rsp)
vmovd %ebp, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0xf0(%rsp)
movl %ecx, %ecx
movl %r13d, %r8d
movl %r10d, %esi
movl 0x48(%rsp), %r11d
movslq %r11d, %rdi
vmovq %rsi, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovq %rdi, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovq %rcx, %xmm8
movq %r8, 0x10(%rsp)
vmovq %r8, %xmm4
vpbroadcastq %xmm4, %ymm7
vpmuldq 0xc43cb(%rip), %ymm7, %ymm4 # 0x62dde0
vmovdqu %ymm4, 0x60(%rsp)
vpmuldq 0xc43dc(%rip), %ymm7, %ymm4 # 0x62de00
vmovdqu %ymm4, 0xd0(%rsp)
vpmuldq 0xc420a(%rip), %ymm7, %ymm6 # 0x62dc40
vpmuldq 0xc4101(%rip), %ymm7, %ymm7 # 0x62db40
vpbroadcastq %xmm8, %ymm8
xorl %ecx, %ecx
vpbroadcastq 0xc43f1(%rip), %ymm9 # 0x62de40
vpxor %xmm10, %xmm10, %xmm10
movq %r14, %rsi
movq %r15, %rdi
vmovq %rcx, %xmm11
vpbroadcastq %xmm11, %ymm11
vpaddq %ymm6, %ymm11, %ymm12
vpaddq %ymm7, %ymm11, %ymm13
vpaddq 0xd0(%rsp), %ymm11, %ymm14
vpaddq 0x60(%rsp), %ymm11, %ymm11
vpmuludq %ymm0, %ymm11, %ymm15
vpsrlq $0x20, %ymm11, %ymm11
vpmuludq %ymm0, %ymm11, %ymm11
vpsllq $0x20, %ymm11, %ymm11
vpaddq %ymm11, %ymm15, %ymm11
vpmuludq %ymm0, %ymm14, %ymm15
vpsrlq $0x20, %ymm14, %ymm14
vpmuludq %ymm0, %ymm14, %ymm14
vpsllq $0x20, %ymm14, %ymm14
vpaddq %ymm14, %ymm15, %ymm14
vpmuludq %ymm0, %ymm13, %ymm15
vpsrlq $0x20, %ymm13, %ymm13
vpmuludq %ymm0, %ymm13, %ymm13
vpsllq $0x20, %ymm13, %ymm13
vpaddq %ymm13, %ymm15, %ymm13
vpmuludq %ymm0, %ymm12, %ymm15
vpsrlq $0x20, %ymm12, %ymm12
vpmuludq %ymm0, %ymm12, %ymm12
vpsllq $0x20, %ymm12, %ymm12
vpaddq %ymm12, %ymm15, %ymm12
vpsubq %ymm11, %ymm1, %ymm11
vpcmpgtq %ymm9, %ymm11, %ymm15
vblendvpd %ymm15, %ymm11, %ymm9, %ymm15
vpsubq %ymm13, %ymm1, %ymm13
vpcmpgtq %ymm9, %ymm13, %ymm4
vblendvpd %ymm4, %ymm13, %ymm9, %ymm4
vpsubq %ymm12, %ymm1, %ymm12
vpcmpgtq %ymm9, %ymm12, %ymm5
vblendvpd %ymm5, %ymm12, %ymm9, %ymm5
vpsubq %ymm14, %ymm1, %ymm14
vpblendw $0x11, %ymm5, %ymm10, %ymm5 # ymm5 = ymm5[0],ymm10[1,2,3],ymm5[4],ymm10[5,6,7],ymm5[8],ymm10[9,10,11],ymm5[12],ymm10[13,14,15]
vpblendw $0x11, %ymm4, %ymm10, %ymm4 # ymm4 = ymm4[0],ymm10[1,2,3],ymm4[4],ymm10[5,6,7],ymm4[8],ymm10[9,10,11],ymm4[12],ymm10[13,14,15]
vpackusdw %ymm5, %ymm4, %ymm4
vpcmpgtq %ymm9, %ymm14, %ymm5
vblendvpd %ymm5, %ymm14, %ymm9, %ymm5
vpblendw $0x11, %ymm5, %ymm10, %ymm5 # ymm5 = ymm5[0],ymm10[1,2,3],ymm5[4],ymm10[5,6,7],ymm5[8],ymm10[9,10,11],ymm5[12],ymm10[13,14,15]
vpblendw $0x11, %ymm15, %ymm10, %ymm15 # ymm15 = ymm15[0],ymm10[1,2,3],ymm15[4],ymm10[5,6,7],ymm15[8],ymm10[9,10,11],ymm15[12],ymm10[13,14,15]
vpackusdw %ymm15, %ymm5, %ymm5
vpsubq %ymm8, %ymm12, %ymm12
vpsubq %ymm8, %ymm13, %ymm13
vpsubq %ymm8, %ymm11, %ymm11
vpcmpgtq %ymm9, %ymm11, %ymm15
vblendvpd %ymm15, %ymm11, %ymm9, %ymm11
vpsubq %ymm8, %ymm14, %ymm14
vpcmpgtq %ymm9, %ymm14, %ymm15
vblendvpd %ymm15, %ymm14, %ymm9, %ymm14
vpcmpgtq %ymm9, %ymm13, %ymm15
vblendvpd %ymm15, %ymm13, %ymm9, %ymm13
vpcmpgtq %ymm9, %ymm12, %ymm15
vblendvpd %ymm15, %ymm12, %ymm9, %ymm12
vpermq $0xd8, %ymm4, %ymm4     # ymm4 = ymm4[0,2,1,3]
vpermq $0xd8, %ymm5, %ymm5     # ymm5 = ymm5[0,2,1,3]
vpackusdw %ymm5, %ymm4, %ymm4
vpblendw $0x11, %ymm12, %ymm10, %ymm5 # ymm5 = ymm12[0],ymm10[1,2,3],ymm12[4],ymm10[5,6,7],ymm12[8],ymm10[9,10,11],ymm12[12],ymm10[13,14,15]
vpblendw $0x11, %ymm13, %ymm10, %ymm12 # ymm12 = ymm13[0],ymm10[1,2,3],ymm13[4],ymm10[5,6,7],ymm13[8],ymm10[9,10,11],ymm13[12],ymm10[13,14,15]
vpackusdw %ymm5, %ymm12, %ymm5
vpblendw $0x11, %ymm14, %ymm10, %ymm12 # ymm12 = ymm14[0],ymm10[1,2,3],ymm14[4],ymm10[5,6,7],ymm14[8],ymm10[9,10,11],ymm14[12],ymm10[13,14,15]
vpblendw $0x11, %ymm11, %ymm10, %ymm11 # ymm11 = ymm11[0],ymm10[1,2,3],ymm11[4],ymm10[5,6,7],ymm11[8],ymm10[9,10,11],ymm11[12],ymm10[13,14,15]
vpackusdw %ymm11, %ymm12, %ymm11
vpermq $0xd8, %ymm4, %ymm4     # ymm4 = ymm4[0,2,1,3]
vmovdqa %ymm4, (%rsi)
vpermq $0xd8, %ymm5, %ymm4     # ymm4 = ymm5[0,2,1,3]
vpermq $0xd8, %ymm11, %ymm5    # ymm5 = ymm11[0,2,1,3]
vpackusdw %ymm5, %ymm4, %ymm4
vpermq $0xd8, %ymm4, %ymm4     # ymm4 = ymm4[0,2,1,3]
vmovdqa %ymm4, (%rdi)
incq %rcx
addq $0x20, %rdi
addq $0x20, %rsi
cmpq %rcx, %r13
jne 0x569a5a
movw $0x0, (%rax)
movl %r9d, %edi
addl $0xf, %r9d
andl $-0x10, %r9d
leaq -0x1(%rdi), %rcx
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm4
vmovd %r10d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0xd0(%rsp)
vmovd %r11d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0x90(%rsp)
vpmovsxbd 0xc420e(%rip), %ymm7 # 0x62de48
vpmovsxbd 0xc408d(%rip), %ymm8 # 0x62dcd0
xorl %r8d, %r8d
vpbroadcastq 0xc3f31(%rip), %xmm13 # 0x62db80
vpcmpeqd %xmm14, %xmm14, %xmm14
vpcmpeqd %ymm15, %ymm15, %ymm15
vbroadcastss 0xc41ee(%rip), %ymm0 # 0x62de50
vmovups %ymm0, 0xb0(%rsp)
vpbroadcastq 0xc3f0c(%rip), %ymm9 # 0x62db80
vpbroadcastd 0xc3f43(%rip), %xmm0 # 0x62dbc0
vmovdqu %ymm0, 0x60(%rsp)
vpbroadcastd 0xc41c8(%rip), %ymm11 # 0x62de54
vmovq %r8, %xmm0
vpbroadcastq %xmm0, %ymm12
vpor 0xc3ea2(%rip), %ymm12, %ymm6 # 0x62db40
vpxor %xmm4, %xmm13, %xmm0
vpxor %xmm6, %xmm13, %xmm5
vpcmpgtq %xmm0, %xmm5, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpxor %xmm0, %xmm14, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpaddd %ymm15, %ymm8, %ymm5
vpaddd %ymm7, %ymm15, %ymm1
vmovdqu 0xd0(%rsp), %ymm10
vpmulld %ymm10, %ymm1, %ymm1
vpmulld %ymm10, %ymm5, %ymm5
vmovdqu 0x90(%rsp), %ymm10
vpsubd %ymm5, %ymm10, %ymm5
vpsubd %ymm1, %ymm10, %ymm1
vmovdqu 0xb0(%rsp), %ymm10
vpmaxsd %ymm10, %ymm1, %ymm1
vpmaxsd %ymm10, %ymm5, %ymm5
vpxor %xmm10, %xmm10, %xmm10
vpblendw $0xaa, %ymm10, %ymm5, %ymm5 # ymm5 = ymm5[0],ymm10[1],ymm5[2],ymm10[3],ymm5[4],ymm10[5],ymm5[6],ymm10[7],ymm5[8],ymm10[9],ymm5[10],ymm10[11],ymm5[12],ymm10[13],ymm5[14],ymm10[15]
vpblendw $0xaa, %ymm10, %ymm1, %ymm1 # ymm1 = ymm1[0],ymm10[1],ymm1[2],ymm10[3],ymm1[4],ymm10[5],ymm1[6],ymm10[7],ymm1[8],ymm10[9],ymm1[10],ymm10[11],ymm1[12],ymm10[13],ymm1[14],ymm10[15]
vpackusdw %ymm1, %ymm5, %ymm1
vpermq $0xd8, %ymm1, %ymm5     # ymm5 = ymm1[0,2,1,3]
vmovd %xmm0, %ecx
testb $0x1, %cl
je 0x569d28
vpextrw $0x0, %xmm5, 0x2(%rax,%r8,2)
vpxor %xmm4, %xmm13, %xmm0
vpxor %xmm6, %xmm13, %xmm1
vpcmpgtq %xmm0, %xmm1, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpxor %xmm0, %xmm14, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0x1, %xmm0, %ecx
testb $0x1, %cl
je 0x569d58
vpextrw $0x1, %xmm5, 0x4(%rax,%r8,2)
vpxor %ymm4, %ymm9, %ymm0
vpxor %ymm6, %ymm9, %ymm1
vpcmpgtq %ymm0, %ymm1, %ymm6
vpshuflw $0xe8, %ymm6, %ymm1     # ymm1 = ymm6[0,2,2,3,4,5,6,7,8,10,10,11,12,13,14,15]
vpxor %ymm1, %ymm15, %ymm1
vmovdqu 0x60(%rsp), %ymm10
vpermd %ymm1, %ymm10, %ymm1
vpackssdw %xmm1, %xmm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x2, %xmm1, %ecx
testb $0x1, %cl
je 0x569d94
vpextrw $0x2, %xmm5, 0x6(%rax,%r8,2)
vextracti128 $0x1, %ymm6, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpxor %xmm1, %xmm14, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x3, %xmm1, %ecx
testb $0x1, %cl
je 0x569dbd
vpextrw $0x3, %xmm5, 0x8(%rax,%r8,2)
vpor 0xc3e7b(%rip), %ymm12, %ymm6 # 0x62dc40
vpxor %xmm4, %xmm13, %xmm1
vpxor %xmm6, %xmm13, %xmm10
vpcmpgtq %xmm1, %xmm10, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpxor %xmm1, %xmm14, %xmm1
vpermq $0x55, %ymm1, %ymm1     # ymm1 = ymm1[1,1,1,1]
vpackssdw %ymm0, %ymm1, %ymm1
vextracti128 $0x1, %ymm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x8, %xmm1, %ecx
testb $0x1, %cl
je 0x569e01
vpextrw $0x4, %xmm5, 0xa(%rax,%r8,2)
vpxor %xmm4, %xmm13, %xmm1
vpxor %xmm6, %xmm13, %xmm10
vpcmpgtq %xmm1, %xmm10, %xmm1
vpshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
vpxor %xmm1, %xmm14, %xmm1
vpermq $0x55, %ymm1, %ymm1     # ymm1 = ymm1[1,1,1,1]
vpackssdw %ymm0, %ymm1, %ymm1
vextracti128 $0x1, %ymm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x9, %xmm1, %ecx
testb $0x1, %cl
je 0x569e3e
vpextrw $0x5, %xmm5, 0xc(%rax,%r8,2)
vpxor %ymm6, %ymm9, %ymm1
vpcmpgtq %ymm0, %ymm1, %ymm6
vpackssdw %ymm6, %ymm0, %ymm1
vpxor %ymm1, %ymm15, %ymm1
vpackssdw %ymm0, %ymm1, %ymm1
vextracti128 $0x1, %ymm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0xa, %xmm1, %ecx
testb $0x1, %cl
je 0x569e70
vpextrw $0x6, %xmm5, 0xe(%rax,%r8,2)
vpackssdw %ymm6, %ymm0, %ymm1
vpxor %ymm1, %ymm15, %ymm1
vpackssdw %ymm0, %ymm1, %ymm1
vextracti128 $0x1, %ymm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0xb, %xmm1, %ecx
testb $0x1, %cl
je 0x569e99
vpextrw $0x7, %xmm5, 0x10(%rax,%r8,2)
vpor 0xc3f5f(%rip), %ymm12, %ymm6 # 0x62de00
vpxor %xmm4, %xmm13, %xmm1
vpxor %xmm6, %xmm13, %xmm10
vpcmpgtq %xmm1, %xmm10, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpxor %xmm1, %xmm14, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x4, %xmm1, %ecx
vextracti128 $0x1, %ymm5, %xmm5
testb $0x1, %cl
je 0x569ed7
vpextrw $0x0, %xmm5, 0x12(%rax,%r8,2)
vpxor %xmm4, %xmm13, %xmm1
vpxor %xmm6, %xmm13, %xmm10
vpcmpgtq %xmm1, %xmm10, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpxor %xmm1, %xmm14, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x5, %xmm1, %ecx
testb $0x1, %cl
je 0x569f07
vpextrw $0x1, %xmm5, 0x14(%rax,%r8,2)
vpxor %ymm6, %ymm9, %ymm1
vpcmpgtq %ymm0, %ymm1, %ymm6
vpshuflw $0xe8, %ymm6, %ymm1     # ymm1 = ymm6[0,2,2,3,4,5,6,7,8,10,10,11,12,13,14,15]
vpxor %ymm1, %ymm15, %ymm1
vmovdqu 0x60(%rsp), %ymm10
vpermd %ymm1, %ymm10, %ymm1
vpackssdw %xmm1, %xmm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x6, %xmm1, %ecx
testb $0x1, %cl
je 0x569f3f
vpextrw $0x2, %xmm5, 0x16(%rax,%r8,2)
vextracti128 $0x1, %ymm6, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpxor %xmm1, %xmm14, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0x7, %xmm1, %ecx
testb $0x1, %cl
je 0x569f68
vpextrw $0x3, %xmm5, 0x18(%rax,%r8,2)
vpor 0xc3e70(%rip), %ymm12, %ymm6 # 0x62dde0
vpxor %xmm4, %xmm13, %xmm1
vpxor %xmm6, %xmm13, %xmm10
vpcmpgtq %xmm1, %xmm10, %xmm1
vpackssdw %xmm1, %xmm1, %xmm1
vpxor %xmm1, %xmm14, %xmm1
vpermq $0x55, %ymm1, %ymm1     # ymm1 = ymm1[1,1,1,1]
vpackssdw %ymm1, %ymm0, %ymm1
vextracti128 $0x1, %ymm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0xc, %xmm1, %ecx
testb $0x1, %cl
je 0x569fac
vpextrw $0x4, %xmm5, 0x1a(%rax,%r8,2)
vpxor %xmm4, %xmm13, %xmm1
vpxor %xmm6, %xmm13, %xmm10
vpcmpgtq %xmm1, %xmm10, %xmm1
vpshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
vpxor %xmm1, %xmm14, %xmm1
vpermq $0x55, %ymm1, %ymm1     # ymm1 = ymm1[1,1,1,1]
vpackssdw %ymm1, %ymm0, %ymm1
vextracti128 $0x1, %ymm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0xd, %xmm1, %ecx
testb $0x1, %cl
je 0x569fe9
vpextrw $0x5, %xmm5, 0x1c(%rax,%r8,2)
vpxor %ymm6, %ymm9, %ymm1
vpcmpgtq %ymm0, %ymm1, %ymm0
vpackssdw %ymm0, %ymm0, %ymm1
vpxor %ymm1, %ymm15, %ymm1
vpackssdw %ymm1, %ymm0, %ymm1
vextracti128 $0x1, %ymm1, %xmm1
vpacksswb %xmm1, %xmm1, %xmm1
vpextrb $0xe, %xmm1, %ecx
testb $0x1, %cl
je 0x56a01b
vpextrw $0x6, %xmm5, 0x1e(%rax,%r8,2)
vpackssdw %ymm0, %ymm0, %ymm0
vpxor %ymm0, %ymm15, %ymm0
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0xf, %xmm0, %ecx
testb $0x1, %cl
je 0x56a044
vpextrw $0x7, %xmm5, 0x20(%rax,%r8,2)
addq $0x10, %r8
vpaddd %ymm11, %ymm8, %ymm8
vpaddd %ymm7, %ymm11, %ymm7
cmpq %r8, %r9
jne 0x569c8c
movq %r13, 0x60(%rsp)
leal -0x1(%r13), %r10d
movl 0x40(%rsp), %r8d
movq 0x10(%rsp), %r9
shlq $0x5, %r9
xorl %r11d, %r11d
shlq $0x5, %r10
movl $0xffff8000, %ecx       # imm = 0xFFFF8000
movq %r8, 0x88(%rsp)
shlq $0x5, %r8
vmovdqu 0x110(%rsp), %ymm8
vmovdqa %ymm8, %ymm4
vmovdqu 0xf0(%rsp), %ymm9
vmovdqa %ymm9, %ymm5
movl 0x28(%rsp), %r13d
movq %r14, %rbp
movq %r12, %r14
vmovdqa (%rbp,%r10), %ymm0
vinserti128 $0x1, %xmm0, %ymm0, %ymm1
vpalignr $0xe, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm1[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
movq 0x30(%rsp), %rsi
movq 0x10(%rsi), %rsi
movq 0x38(%rsp), %rbx
movzbl (%rbx,%r11), %ebx
movslq (%rsi,%rbx,4), %rbx
movq 0x10(%rsp), %rsi
imulq %rbx, %rsi
shlq $0x5, %rsi
addq 0x50(%rsp), %rsi
vpinsrw $0x0, (%rax,%r11,2), %xmm0, %xmm1
vpblendd $0xf, %ymm1, %ymm0, %ymm1 # ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7]
xorl %ebx, %ebx
vmovdqa %ymm8, %ymm0
vpaddsw (%rsi,%rbx), %ymm1, %ymm1
vmovdqa (%r15,%rbx), %ymm6
vpmaxsw %ymm0, %ymm6, %ymm7
vpmaxsw %ymm7, %ymm1, %ymm1
vmovdqa %ymm1, (%r14,%rbx)
vpmaxsw %ymm1, %ymm4, %ymm4
vpminsw %ymm6, %ymm5, %ymm5
vpminsw %ymm0, %ymm5, %ymm5
vpminsw %ymm1, %ymm5, %ymm5
vpsubsw %ymm2, %ymm1, %ymm1
vpsubsw %ymm3, %ymm6, %ymm6
vpmaxsw %ymm1, %ymm6, %ymm6
vmovdqa %ymm6, (%r15,%rbx)
vpsubsw %ymm3, %ymm0, %ymm0
vpmaxsw %ymm1, %ymm0, %ymm0
vmovdqa (%rbp,%rbx), %ymm1
addq $0x20, %rbx
cmpq %rbx, %r9
jne 0x56a0fd
xorl %esi, %esi
movswl 0x2(%rax,%r11,2), %ebx
subl %r13d, %ebx
cmpl $0xffff8001, %ebx       # imm = 0xFFFF8001
cmovll %ecx, %ebx
vinserti128 $0x1, %xmm0, %ymm0, %ymm1
vpalignr $0xe, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm1[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpinsrw $0x0, %ebx, %xmm0, %xmm1
vpblendd $0xf, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
xorl %ebx, %ebx
vpmaxsw (%r14,%rbx), %ymm0, %ymm1
vmovdqa %ymm1, (%r14,%rbx)
vpminsw %ymm1, %ymm5, %ymm5
vpmaxsw %ymm1, %ymm4, %ymm4
vpsubsw %ymm2, %ymm1, %ymm1
vpsubsw %ymm3, %ymm0, %ymm0
vpcmpgtw %ymm1, %ymm0, %ymm1
vpmovmskb %ymm1, %r12d
testl %r12d, %r12d
je 0x56a1b5
addq $0x20, %rbx
cmpq %rbx, %r9
jne 0x56a17c
incl %esi
cmpl $0x10, %esi
jne 0x56a151
vmovdqa (%r14,%r8), %ymm0
cmpl $0xe, 0xc(%rsp)
jg 0x56a1dd
xorl %esi, %esi
movq 0x18(%rsp), %rbx
vperm2i128 $0x28, %ymm0, %ymm0, %ymm1 # ymm1 = zero,zero,ymm0[0,1]
vpalignr $0xe, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm1[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
incl %esi
cmpl %edx, %esi
jl 0x56a1c9
jmp 0x56a1e2
movq 0x18(%rsp), %rbx
vextracti128 $0x1, %ymm0, %xmm0
vpextrw $0x7, %xmm0, %esi
movswl %si, %esi
movq 0x10(%rbx), %rbx
movq (%rbx), %rbx
movl %esi, (%rbx,%r11,4)
incq %r11
movq %rbp, %r12
cmpq %rdi, %r11
jne 0x56a0a8
movq 0x60(%rsp), %rsi
leal (,%rsi,4), %ecx
leal (,%rsi,8), %esi
movq %rsi, 0x60(%rsp)
leaq (%rcx,%rcx,2), %rsi
movq %rsi, 0x38(%rsp)
movq 0x10(%rsp), %rdi
imulq $0x3c, %rdi, %rsi
movq %rsi, 0x30(%rsp)
imulq $0x38, %rdi, %rsi
movq %rsi, 0x50(%rsp)
imulq $0x34, %rdi, %rsi
movq %rsi, 0xd0(%rsp)
movq %rdi, %rsi
shlq $0x4, %rsi
movq %rsi, 0x90(%rsp)
leaq (%rsi,%rsi,2), %rsi
movq %rsi, 0xb0(%rsp)
imulq $0x2c, %rdi, %rsi
movq %rsi, 0x28(%rsp)
leal (,%rdi,8), %esi
leaq (%rsi,%rsi,4), %r8
movq %r8, 0x48(%rsp)
leal (,%rdi,4), %ebx
leaq (%rbx,%rbx,8), %r8
movq %r8, 0x40(%rsp)
leaq (%rdi,%rdi,8), %r10
leaq (%r10,%r10,2), %r10
addq %rdi, %r10
leaq (%rsi,%rsi,2), %rsi
movq %rsi, 0x10(%rsp)
leaq (%rbx,%rbx,4), %r12
xorl %esi, %esi
movq 0x18(%rsp), %r13
movq 0x10(%r13), %rbx
movq 0x8(%rbx), %rbx
vmovdqa (%r14,%rsi,8), %xmm1
vmovdqa 0x10(%r14,%rsi,8), %xmm0
vmovd %xmm1, %edi
movswl %di, %edi
movl %edi, (%rbx,%rsi)
vpextrw $0x1, %xmm1, %edi
addq %rsi, %rbx
movswl %di, %edi
vpextrw $0x2, %xmm1, %r8d
movl %edi, (%rcx,%rbx)
movswl %r8w, %edi
vpextrw $0x3, %xmm1, %r8d
movq 0x60(%rsp), %r11
movl %edi, (%r11,%rbx)
movswl %r8w, %edi
vpextrw $0x4, %xmm1, %r8d
movq 0x38(%rsp), %r11
movl %edi, (%r11,%rbx)
movswl %r8w, %edi
vpextrw $0x5, %xmm1, %r8d
movq 0x90(%rsp), %r11
movl %edi, (%r11,%rbx)
movswl %r8w, %edi
vpextrw $0x6, %xmm1, %r8d
movl %edi, (%r12,%rbx)
movswl %r8w, %edi
vpextrw $0x7, %xmm1, %r8d
movq 0x10(%rsp), %r11
movl %edi, (%r11,%rbx)
movswl %r8w, %edi
movl %edi, (%r10,%rbx)
vmovd %xmm0, %edi
movswl %di, %edi
movl %edi, (%r9,%rbx)
vpextrw $0x1, %xmm0, %edi
movswl %di, %edi
movq 0x40(%rsp), %r8
movl %edi, (%r8,%rbx)
vpextrw $0x2, %xmm0, %edi
movswl %di, %edi
movq 0x48(%rsp), %r8
movl %edi, (%r8,%rbx)
vpextrw $0x3, %xmm0, %edi
movswl %di, %edi
movq 0x28(%rsp), %r8
movl %edi, (%r8,%rbx)
vpextrw $0x4, %xmm0, %edi
movswl %di, %edi
movq 0xb0(%rsp), %r8
movl %edi, (%r8,%rbx)
vpextrw $0x5, %xmm0, %edi
movswl %di, %edi
movq 0xd0(%rsp), %r8
movl %edi, (%r8,%rbx)
vpextrw $0x6, %xmm0, %edi
movswl %di, %edi
movq 0x50(%rsp), %r8
movl %edi, (%r8,%rbx)
vpextrw $0x7, %xmm0, %edi
movswl %di, %edi
movq 0x30(%rsp), %r8
movl %edi, (%r8,%rbx)
addq $0x4, %rsi
cmpq %rsi, %rcx
jne 0x56a2b1
movq 0x88(%rsp), %rcx
shlq $0x5, %rcx
vmovdqa (%r14,%rcx), %ymm0
cmpl $0xe, 0xc(%rsp)
jg 0x56a410
xorl %ecx, %ecx
movq 0x18(%rsp), %rbx
movl 0x24(%rsp), %esi
vperm2i128 $0x28, %ymm0, %ymm0, %ymm1 # ymm1 = zero,zero,ymm0[0,1]
vpalignr $0xe, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm1[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
incl %ecx
cmpl %edx, %ecx
jl 0x56a3fc
jmp 0x56a419
movq 0x18(%rsp), %rbx
movl 0x24(%rsp), %esi
vpcmpgtw %ymm5, %ymm8, %ymm1
vpcmpgtw %ymm9, %ymm4, %ymm2
vpor %ymm1, %ymm2, %ymm1
vpmovmskb %ymm1, %ecx
testl %ecx, %ecx
je 0x56a43a
orb $0x40, 0xc(%rbx)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
jmp 0x56a449
vextracti128 $0x1, %ymm0, %xmm0
vpextrw $0x7, %xmm0, %ecx
movl 0x5c(%rsp), %edx
movswl %cx, %ecx
movl %ecx, (%rbx)
movl %esi, 0x4(%rbx)
movl %edx, 0x8(%rbx)
movq %rax, %rdi
vzeroupper
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
jmp 0x56a4b1
callq 0x1f24f9
jmp 0x56a4af
callq 0x1f24d3
jmp 0x56a4af
callq 0x1f24ad
jmp 0x56a4af
callq 0x1f2487
jmp 0x56a4af
callq 0x1f2461
jmp 0x56a4af
callq 0x1f243b
jmp 0x56a4af
callq 0x1f2415
jmp 0x56a4af
callq 0x1f23ef
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop