// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sg_striped_avx2_256_16.c
// Function: parasail_sg_flags_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,
        int s1_beg, int s1_end, int s2_beg, int s2_end)
{
    /* declare local variables */
    int32_t i = 0;
    int32_t j = 0;
    int32_t k = 0;
    int32_t 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;
    __m256i vMaxH;
    __m256i vPosMask;
    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;
    vMaxH = vNegLimit;
    vPosMask = _mm256_cmpeq_epi16(_mm256_set1_epi16(position),
            _mm256_set_epi16(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15));

    /* 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_SG | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_BITS_16 | PARASAIL_FLAG_LANES_16;
    result->flag |= s1_beg ? PARASAIL_FLAG_SG_S1_BEG : 0;
    result->flag |= s1_end ? PARASAIL_FLAG_SG_S1_END : 0;
    result->flag |= s2_beg ? PARASAIL_FLAG_SG_S2_BEG : 0;
    result->flag |= s2_end ? PARASAIL_FLAG_SG_S2_END : 0;
#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 = s1_beg ? 0 : (-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 = s2_beg ? 0 : (-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 = s2_beg ? -open : (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:
        {
            /* extract vector containing last value from the column */
            __m256i vCompare;
            vH = _mm256_load_si256(pvHStore + offset);
            vCompare = _mm256_and_si256(vPosMask, _mm256_cmpgt_epi16(vH, vMaxH));
            vMaxH = _mm256_max_epi16(vH, vMaxH);
            if (_mm256_movemask_epi8(vCompare)) {
                end_ref = j;
            }
#ifdef PARASAIL_ROWCOL
            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

    /* max last value from all columns */
    if (s2_end)
    {
        for (k=0; k<position; ++k) {
            vMaxH = _mm256_slli_si256_rpl(vMaxH, 2);
        }
        score = (int16_t) _mm256_extract_epi16_rpl(vMaxH, 15);
        end_query = s1Len-1;
    }

    /* max of last column */
    if (s1_end)
    {
        /* Trace the alignment ending position on read. */
        int16_t *t = (int16_t*)pvHStore;
        int32_t column_len = segLen * segWidth;
        for (i = 0; i<column_len; ++i, ++t) {
            int32_t temp = i / segWidth + i % segWidth * segLen;
            if (temp >= s1Len) continue;
            if (*t > score) {
                score = *t;
                end_query = temp;
                end_ref = s2Len-1;
            }
            else if (*t == score && end_ref == s2Len-1 && temp < end_query) {
                end_query = temp;
            }
        }
    }

    if (!s1_end && !s2_end) {
        /* 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);
            end_ref = s2Len - 1;
            end_query = s1Len - 1;
        }
    }

    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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x100, %rsp            # imm = 0x100
movl %ecx, 0x30(%rsp)
movq %rsi, 0x58(%rsp)
testq %rdi, %rdi
je 0x53bd9f
movq 0x30(%rdi), %rax
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x53bda6
movq 0x10(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x53bdad
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x53bdb4
cmpq $0x0, 0x58(%rsp)
je 0x53bdbb
movl %edx, %r12d
testl %edx, %edx
jle 0x53bdc2
cmpl $0x0, 0x30(%rsp)
js 0x53bdc9
testl %r8d, %r8d
js 0x53bdd0
movl %r9d, %ebx
movl %r8d, 0x28(%rsp)
leal -0x1(%rax), %r15d
movq %rax, 0x98(%rsp)
leaq 0xf(%rax), %r13
movq %r13, %r14
shrq $0x4, %r14
movl %r15d, %eax
cltd
idivl %r14d
movl %eax, 0xc(%rsp)
movl %edx, 0x60(%rsp)
movl 0x30(%rsp), %edx
movl %edx, %edi
negl %edi
movq 0x50(%rsp), %rsi
movl 0x20(%rsi), %eax
movl %eax, %ecx
negl %ecx
movl %edi, 0x40(%rsp)
cmpl %edi, %eax
cmovgl %edx, %ecx
movl %ecx, 0x24(%rsp)
movw $0x7ffe, %ax            # imm = 0x7FFE
subw 0x1c(%rsi), %ax
movl %eax, 0x18(%rsp)
andl $0x7ffffff0, %r13d      # imm = 0x7FFFFFF0
movl %r13d, %edi
movl %r12d, %esi
movq %r12, 0x10(%rsp)
callq 0x209630
testq %rax, %rax
je 0x53bdd5
movq %rax, %r12
movl %r15d, 0x4(%rsp)
movq %r13, 0x90(%rsp)
xorl %eax, %eax
testl %ebx, %ebx
setne %al
xorl %ecx, %ecx
cmpl $0x0, 0x10(%rbp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x18(%rbp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x20(%rbp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rax,8), %eax
orl %edx, %eax
orl %esi, %eax
orl 0xc(%r12), %eax
orl $0x10240802, %eax       # imm = 0x10240802
movl %eax, 0xc(%r12)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, %r15
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, %r13
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %r14, 0x38(%rsp)
movq %rax, %r14
movq 0x10(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x20, %edi
callq 0x2094cd
movq %r15, 0x48(%rsp)
testq %r15, %r15
sete %cl
movq %r13, 0x70(%rsp)
testq %r13, %r13
sete %dl
orb %cl, %dl
testq %r14, %r14
sete %cl
testq %rax, %rax
sete %sil
orb %cl, %sil
orb %dl, %sil
jne 0x53bdd5
movq %r12, 0x80(%rsp)
movq 0x10(%rsp), %rcx
decl %ecx
movl %ecx, 0x8(%rsp)
movl $0xf, %edx
subl 0xc(%rsp), %edx
movl 0x30(%rsp), %esi
vmovd %esi, %xmm0
vpbroadcastw %xmm0, %ymm5
movl 0x28(%rsp), %edi
vmovd %edi, %xmm0
vpbroadcastw %xmm0, %ymm6
movl 0x24(%rsp), %ecx
addl $0xffff8001, %ecx       # imm = 0xFFFF8001
movl %ecx, 0x24(%rsp)
vmovd %ecx, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovd 0x18(%rsp), %xmm1
vpbroadcastw %xmm1, %ymm1
movl %edx, 0x20(%rsp)
vmovd %edx, %xmm2
vpbroadcastw %xmm2, %ymm2
movl %esi, %ecx
movl %edi, %edx
movslq 0x40(%rsp), %r15
movl 0x38(%rsp), %r8d
movq %r8, %rdi
movq %rdx, 0x18(%rsp)
imulq %rdx, %rdi
xorl %r9d, %r9d
movq $-0x7fff, %r10          # imm = 0x8001
movq $-0x8000, %r11          # imm = 0x8000
movq %r15, %r12
xorl %edx, %edx
testl %ebx, %ebx
je 0x53b75c
xorl %esi, %esi
jmp 0x53b75f
movq %r12, %rsi
cmpq %r10, %rsi
movq $-0x8000, %r13          # imm = 0x8000
cmovgeq %rsi, %r13
movw %r13w, 0xc0(%rsp,%rdx,2)
subq %rcx, %rsi
cmpq %r10, %rsi
cmovlq %r11, %rsi
movw %si, 0xa0(%rsp,%rdx,2)
incq %rdx
subq %rdi, %r12
cmpq $0x10, %rdx
jne 0x53b754
movq %r9, %rdx
shlq $0x5, %rdx
vmovaps 0xc0(%rsp), %ymm3
movq 0x48(%rsp), %rsi
vmovaps %ymm3, (%rsi,%rdx)
vmovaps 0xa0(%rsp), %ymm3
vmovaps %ymm3, (%r14,%rdx)
incq %r9
subq 0x18(%rsp), %r15
cmpq %r8, %r9
jne 0x53b74f
movw $0x0, (%rax)
movq 0x10(%rsp), %r11
cmpl $0x2, %r11d
movl $0x1, %ecx
cmovgel %r11d, %ecx
xorl %edx, %edx
xorl %esi, %esi
movl 0x40(%rsp), %edi
movl 0x18(%rbp), %ebx
movl 0x28(%rsp), %r10d
cmpl $0xffff8001, %edi       # imm = 0xFFFF8001
movl $0xffff8000, %r9d       # imm = 0xFFFF8000
cmovgel %edi, %r9d
testl %ebx, %ebx
cmovnel %edx, %r9d
movw %r9w, 0x2(%rax,%rsi,2)
subl %r10d, %edi
incq %rsi
cmpq %rsi, %rcx
jne 0x53b7f1
movl $0x1, %esi
movq 0x38(%rsp), %rcx
cmpl %esi, %ecx
movl %ecx, %r10d
adcl $0x0, %r10d
movl 0x20(%rsp), %edx
cmpl $0x2, %edx
movl $0x1, %edi
cmovgel %edx, %edi
movl %edi, 0x28(%rsp)
leal -0x1(%rcx), %edx
cmpl $0x2, %r11d
cmovgel %r11d, %esi
movq %rsi, 0x18(%rsp)
movl 0x60(%rsp), %ecx
shlq $0x5, %r10
xorl %edi, %edi
shlq $0x5, %rdx
movq %rdx, 0x10(%rsp)
movl $0xffff8000, %edx       # imm = 0xFFFF8000
vpcmpeqw 0xbdfd2(%rip), %ymm2, %ymm7 # 0x5f9840
movq %rcx, 0x88(%rsp)
shlq $0x5, %rcx
movl 0x8(%rsp), %r13d
vmovdqa %ymm0, %ymm4
vmovdqa %ymm0, %ymm2
vmovdqa %ymm1, %ymm3
movq 0x48(%rsp), %r11
movq 0x70(%rsp), %r12
movq 0x50(%rsp), %rsi
movq 0x10(%rsi), %rsi
movq 0x58(%rsp), %r9
movzbl (%r9,%rdi), %r9d
movslq (%rsi,%r9,4), %r9
movq %r8, %rsi
imulq %r9, %rsi
shlq $0x5, %rsi
addq 0x68(%rsp), %rsi
movq 0x10(%rsp), %r9
vmovdqa (%r11,%r9), %ymm8
vinserti128 $0x1, %xmm8, %ymm0, %ymm9
vpalignr $0xe, %ymm9, %ymm8, %ymm8 # ymm8 = ymm9[14,15],ymm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm9[30,31],ymm8[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpinsrw $0x0, (%rax,%rdi,2), %xmm8, %xmm9
vpblendd $0xf, %ymm9, %ymm8, %ymm9 # ymm9 = ymm9[0,1,2,3],ymm8[4,5,6,7]
xorl %r9d, %r9d
vmovdqa %ymm0, %ymm8
vpaddsw (%rsi,%r9), %ymm9, %ymm9
vmovdqa (%r14,%r9), %ymm10
vpmaxsw %ymm8, %ymm10, %ymm11
vpmaxsw %ymm11, %ymm9, %ymm9
vmovdqa %ymm9, (%r12,%r9)
vpmaxsw %ymm2, %ymm9, %ymm2
vpminsw %ymm3, %ymm10, %ymm3
vpminsw %ymm3, %ymm8, %ymm3
vpminsw %ymm3, %ymm9, %ymm3
vpsubsw %ymm5, %ymm9, %ymm9
vpsubsw %ymm6, %ymm10, %ymm10
vpmaxsw %ymm9, %ymm10, %ymm10
vmovdqa %ymm10, (%r14,%r9)
vpsubsw %ymm6, %ymm8, %ymm8
vpmaxsw %ymm9, %ymm8, %ymm8
vmovdqa (%r11,%r9), %ymm9
addq $0x20, %r9
cmpq %r9, %r10
jne 0x53b8e6
movq %r11, 0x70(%rsp)
xorl %esi, %esi
movl 0x40(%rsp), %r9d
testl %ebx, %ebx
jne 0x53b958
movswl 0x2(%rax,%rdi,2), %r9d
subl 0x30(%rsp), %r9d
vinserti128 $0x1, %xmm8, %ymm0, %ymm9
vpalignr $0xe, %ymm9, %ymm8, %ymm8 # ymm8 = ymm9[14,15],ymm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm9[30,31],ymm8[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
cmpl $0xffff8001, %r9d       # imm = 0xFFFF8001
cmovll %edx, %r9d
vpinsrw $0x0, %r9d, %xmm8, %xmm9
vpblendd $0xf, %ymm9, %ymm8, %ymm8 # ymm8 = ymm9[0,1,2,3],ymm8[4,5,6,7]
movb $0x1, %r11b
movl $0x1, %r9d
xorl %ebx, %ebx
vpmaxsw (%r12,%rbx), %ymm8, %ymm9
vmovdqa %ymm9, (%r12,%rbx)
vpminsw %ymm3, %ymm9, %ymm3
vpmaxsw %ymm2, %ymm9, %ymm2
vpsubsw %ymm5, %ymm9, %ymm9
vpsubsw %ymm6, %ymm8, %ymm8
vpcmpgtw %ymm9, %ymm8, %ymm9
vpmovmskb %ymm9, %r15d
testl %r15d, %r15d
je 0x53b9c4
cmpq %r8, %r9
setb %r11b
addq $0x20, %rbx
incq %r9
cmpq %rbx, %r10
jne 0x53b986
testb $0x1, %r11b
movl 0x18(%rbp), %ebx
jne 0x53b9dd
leal 0x1(%rsi), %r9d
cmpl $0xf, %esi
movl %r9d, %esi
jb 0x53b944
vmovdqa (%r12,%rcx), %ymm8
vpcmpgtw %ymm4, %ymm8, %ymm9
vpand %ymm7, %ymm9, %ymm9
vpmovmskb %ymm9, %esi
testl %esi, %esi
cmovnel %edi, %r13d
vmovdqa %ymm8, %ymm9
cmpl $0xe, 0xc(%rsp)
jg 0x53ba1b
movl 0x28(%rsp), %esi
vmovdqa %ymm8, %ymm9
vperm2i128 $0x28, %ymm9, %ymm9, %ymm10 # ymm10 = zero,zero,ymm9[0,1]
vpalignr $0xe, %ymm10, %ymm9, %ymm9 # ymm9 = ymm10[14,15],ymm9[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm10[30,31],ymm9[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
decl %esi
jne 0x53ba0b
vpmaxsw %ymm4, %ymm8, %ymm4
vextracti128 $0x1, %ymm9, %xmm8
vpextrw $0x7, %xmm8, %esi
movswl %si, %esi
movq 0x80(%rsp), %r15
movq 0x10(%r15), %r9
movq (%r9), %r9
movl %esi, (%r9,%rdi,4)
incq %rdi
movq %r12, %r11
cmpq 0x18(%rsp), %rdi
jne 0x53b890
movl %r13d, 0x7c(%rsp)
movq 0x38(%rsp), %r10
leal (,%r10,4), %ebx
cmpl $0x1, %r10d
movl %r10d, %r9d
adcl $0x0, %r9d
imulq $0x3c, %r8, %rcx
movq %rcx, 0x40(%rsp)
imulq $0x38, %r8, %rcx
movq %rcx, 0x30(%rsp)
imulq $0x34, %r8, %rcx
movq %rcx, 0x58(%rsp)
movq %r8, %r11
shlq $0x4, %r11
imulq $0x2c, %r8, %rcx
movq %rcx, 0x50(%rsp)
leal (,%r8,8), %edx
leaq (%rdx,%rdx,4), %rcx
movq %rcx, 0x68(%rsp)
leal (,%r8,4), %esi
leaq (%rsi,%rsi,8), %rcx
movq %rcx, 0x48(%rsp)
leaq (%r8,%r8,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r8, %rcx
movq %rcx, 0x18(%rsp)
shlq $0x5, %r8
leaq (%rdx,%rdx,2), %rcx
movq %rcx, 0x10(%rsp)
leaq (%rsi,%rsi,4), %rcx
movq %rcx, 0x28(%rsp)
shll $0x2, %r9d
leal (,%r10,8), %ecx
movq %rcx, 0x60(%rsp)
movq %rbx, %rdi
leaq (%rbx,%rbx,2), %rbx
movq %r11, %r13
leaq (%r11,%r11,2), %r10
xorl %esi, %esi
movq 0x10(%r15), %rdx
movq 0x8(%rdx), %rdx
vmovdqa (%r12,%rsi,8), %xmm6
vmovdqa 0x10(%r12,%rsi,8), %xmm5
vmovd %xmm6, %r15d
movswl %r15w, %r15d
movl %r15d, (%rdx,%rsi)
vpextrw $0x1, %xmm6, %r15d
addq %rsi, %rdx
movswl %r15w, %r15d
vpextrw $0x2, %xmm6, %r11d
movl %r15d, (%rdi,%rdx)
movswl %r11w, %r11d
vpextrw $0x3, %xmm6, %r15d
movq 0x60(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
movswl %r15w, %r11d
vpextrw $0x4, %xmm6, %r15d
movl %r11d, (%rbx,%rdx)
movswl %r15w, %r11d
vpextrw $0x5, %xmm6, %r15d
movl %r11d, (%r13,%rdx)
movswl %r15w, %r11d
vpextrw $0x6, %xmm6, %r15d
movq 0x28(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
movswl %r15w, %r11d
vpextrw $0x7, %xmm6, %r15d
movq 0x10(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
movswl %r15w, %r11d
movq 0x80(%rsp), %r15
movq 0x18(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
vmovd %xmm5, %r11d
movswl %r11w, %r11d
movl %r11d, (%r8,%rdx)
vpextrw $0x1, %xmm5, %r11d
movswl %r11w, %r11d
movq 0x48(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
vpextrw $0x2, %xmm5, %r11d
movswl %r11w, %r11d
movq 0x68(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
vpextrw $0x3, %xmm5, %r11d
movswl %r11w, %r11d
movq 0x50(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
vpextrw $0x4, %xmm5, %r11d
movswl %r11w, %r11d
movl %r11d, (%r10,%rdx)
vpextrw $0x5, %xmm5, %r11d
movswl %r11w, %r11d
movq 0x58(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
vpextrw $0x6, %xmm5, %r11d
movswl %r11w, %r11d
movq 0x30(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
vpextrw $0x7, %xmm5, %r11d
movswl %r11w, %r11d
movq 0x40(%rsp), %rcx
movl %r11d, (%rcx,%rdx)
addq $0x4, %rsi
cmpq %rsi, %r9
jne 0x53bb03
movl 0x20(%rbp), %r11d
testl %r11d, %r11d
movq 0x98(%rsp), %r9
movl 0x24(%rsp), %r10d
movl 0x10(%rbp), %ebx
movq 0x90(%rsp), %rdx
movl 0x7c(%rsp), %r13d
je 0x53bc8a
cmpl $0xe, 0xc(%rsp)
jg 0x53bc7f
movl 0x20(%rsp), %esi
cmpl $0x2, %esi
movl $0x1, %ecx
cmovgel %esi, %ecx
vperm2i128 $0x28, %ymm4, %ymm4, %ymm5 # ymm5 = zero,zero,ymm4[0,1]
vpalignr $0xe, %ymm5, %ymm4, %ymm4 # ymm4 = ymm5[14,15],ymm4[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm5[30,31],ymm4[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
decl %ecx
jne 0x53bc6f
vextracti128 $0x1, %ymm4, %xmm4
vpextrw $0x7, %xmm4, %r10d
testl %ebx, %ebx
je 0x53bcf3
testl %edx, %edx
je 0x53bcf3
movq 0x38(%rsp), %rdx
andl $0x7ffffff, %edx        # imm = 0x7FFFFFF
shll $0x4, %edx
xorl %esi, %esi
movl 0x4(%rsp), %ecx
movl %esi, %r8d
shrl $0x4, %r8d
movl %esi, %edi
andl $0xf, %edi
imull 0x38(%rsp), %edi
addl %r8d, %edi
cmpl %r9d, %edi
jge 0x53bcea
movzwl (%r12,%rsi,2), %r8d
cmpw %r10w, %r8w
jle 0x53bcd6
movl %r8d, %r10d
movl 0x8(%rsp), %r13d
movl %edi, %ecx
jmp 0x53bcea
cmpl %ecx, %edi
cmovgel %ecx, %edi
cmpl 0x8(%rsp), %r13d
cmovnel %ecx, %edi
cmpw %r10w, %r8w
cmovel %edi, %ecx
incq %rsi
cmpl %esi, %edx
jne 0x53bca6
jmp 0x53bcf7
movl 0x4(%rsp), %ecx
orl %ebx, %r11d
jne 0x53bd48
movq 0x88(%rsp), %rcx
shlq $0x5, %rcx
vmovdqa (%r12,%rcx), %ymm4
cmpl $0xe, 0xc(%rsp)
jg 0x53bd34
movl 0x20(%rsp), %edx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
vperm2i128 $0x28, %ymm4, %ymm4, %ymm5 # ymm5 = zero,zero,ymm4[0,1]
vpalignr $0xe, %ymm5, %ymm4, %ymm4 # ymm4 = ymm5[14,15],ymm4[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm5[30,31],ymm4[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
decl %ecx
jne 0x53bd24
vextracti128 $0x1, %ymm4, %xmm4
vpextrw $0x7, %xmm4, %r10d
movl 0x8(%rsp), %r13d
movl 0x4(%rsp), %ecx
vpcmpgtw %ymm3, %ymm0, %ymm0
vpcmpgtw %ymm1, %ymm2, %ymm1
vpor %ymm0, %ymm1, %ymm0
vpmovmskb %ymm0, %edx
testl %edx, %edx
je 0x53bd69
orb $0x40, 0xc(%r15)
xorl %r10d, %r10d
xorl %r13d, %r13d
xorl %ecx, %ecx
movswl %r10w, %edx
movl %edx, (%r15)
movl %ecx, 0x4(%r15)
movl %r13d, 0x8(%r15)
movq %rax, %rdi
vzeroupper
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq 0x70(%rsp), %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
jmp 0x53bdd8
callq 0x1f273f
jmp 0x53bdd5
callq 0x1f2719
jmp 0x53bdd5
callq 0x1f26f3
jmp 0x53bdd5
callq 0x1f26cd
jmp 0x53bdd5
callq 0x1f26a7
jmp 0x53bdd5
callq 0x1f2681
jmp 0x53bdd5
callq 0x1f265b
jmp 0x53bdd5
callq 0x1f2635
xorl %r15d, %r15d
movq %r15, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq