// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_striped_avx2_256_16.c
// Function: parasail_sw_table_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;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    int32_t s1Len = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
#ifdef PARASAIL_ROWCOL
    int32_t offset = 0;
    int32_t position = 0;
#endif
    __m256i* restrict vProfile = NULL;
    __m256i* restrict pvHStore = NULL;
    __m256i* restrict pvHLoad = NULL;
    __m256i* restrict pvHMax = NULL;
    __m256i* restrict pvE = NULL;
    __m256i vGapO;
    __m256i vGapE;
    __m256i vZero;
    int16_t bias = 0;
    int16_t score = 0;
    __m256i vBias;
    __m256i vMaxH;
    __m256i vMaxHUnit;
    int16_t maxp = 0;
    __m256i insert_mask;
    /*int16_t stop = 0;*/
    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;
    end_query = 0;
    end_ref = 0;
    s1Len = profile->s1Len;
    matrix = profile->matrix;
    segWidth = 16; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
#ifdef PARASAIL_ROWCOL
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
#endif
    vProfile = (__m256i*)profile->profile16.score;
    vGapO = _mm256_set1_epi16(open);
    vGapE = _mm256_set1_epi16(gap);
    vZero = _mm256_set1_epi16(0);
    bias = INT16_MIN;
    score = bias;
    vBias = _mm256_set1_epi16(bias);
    vMaxH = vBias;
    vMaxHUnit = vBias;
    maxp = INT16_MAX - (int16_t)(matrix->max+1);
    insert_mask = _mm256_cmpgt_epi16(
            _mm256_set_epi16(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
            vZero);
    /*stop = profile->stop == INT32_MAX ?  INT16_MAX : (int16_t)profile->stop-bias;*/

    /* 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_SW | 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);
    pvHMax = parasail_memalign___m256i(32, segLen);
    pvE = parasail_memalign___m256i(32, segLen);

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

    /* initialize H and E */
    parasail_memset___m256i(pvHStore, vBias, segLen);
    parasail_memset___m256i(pvE, vBias, segLen);

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m256i vE;
        __m256i vF;
        __m256i vH;
        const __m256i* vP = NULL;
        __m256i* pv = NULL;

        /* Initialize F value to 0.  Any errors to vH values will be
         * corrected in the Lazy_F loop.  */
        vF = vBias;

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

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

        if (end_ref == j-2) {
            /* Swap in the max buffer. */
            pv = pvHMax;
            pvHMax = pvHLoad;
            pvHLoad = pvHStore;
            pvHStore = pv;
        }
        else {
            /* Swap the 2 H buffers. */
            pv = pvHLoad;
            pvHLoad = pvHStore;
            pvHStore = pv;
        }

        /* 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);
#ifdef PARASAIL_TABLE
            arr_store_si256(result->tables->score_table, vH, i, segLen, j, s2Len, bias);
#endif
            vMaxH = _mm256_max_epi16(vH, vMaxH);

            /* 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) {
            vF = _mm256_slli_si256_rpl(vF, 2);
            vF = _mm256_blendv_epi8(vF, vBias, insert_mask);
            for (i=0; i<segLen; ++i) {
                vH = _mm256_load_si256(pvHStore + i);
                vH = _mm256_max_epi16(vH,vF);
                _mm256_store_si256(pvHStore + i, vH);
#ifdef PARASAIL_TABLE
                arr_store_si256(result->tables->score_table, vH, i, segLen, j, s2Len, bias);
#endif
                vMaxH = _mm256_max_epi16(vH, vMaxH);
                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) - bias;
        }
#endif

        {
            __m256i vCompare = _mm256_cmpgt_epi16(vMaxH, vMaxHUnit);
            if (_mm256_movemask_epi8(vCompare)) {
                score = _mm256_hmax_epi16_rpl(vMaxH);
                /* if score has potential to overflow, abort early */
                if (score > maxp) {
                    result->flag |= PARASAIL_FLAG_SATURATED;
                    break;
                }
                vMaxHUnit = _mm256_set1_epi16(score);
                end_ref = j;
            }
        }

        /*if (score == stop) break;*/
    }

#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, bias);
    }
#endif

    if (score == INT16_MAX) {
        result->flag |= PARASAIL_FLAG_SATURATED;
    }

    if (parasail_result_is_saturated(result)) {
        score = INT16_MAX;
        end_query = 0;
        end_ref = 0;
    }
    else {
        if (end_ref == j-1) {
            /* end_ref was the last store column */
            __m256i *pv = pvHMax;
            pvHMax = pvHStore;
            pvHStore = pv;
        }
        else if (end_ref == j-2) {
            /* end_ref was the last load column */
            __m256i *pv = pvHMax;
            pvHMax = pvHLoad;
            pvHLoad = pv;
        }
        /* Trace the alignment ending position on read. */
        {
            int16_t *t = (int16_t*)pvHMax;
            int32_t column_len = segLen * segWidth;
            end_query = s1Len - 1;
            for (i = 0; i<column_len; ++i, ++t) {
                if (*t == score) {
                    int32_t temp = i / segWidth + i % segWidth * segLen;
                    if (temp < end_query) {
                        end_query = temp;
                    }
                }
            }
        }
    }

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

    parasail_free(pvE);
    parasail_free(pvHMax);
    parasail_free(pvHLoad);
    parasail_free(pvHStore);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, 0x58(%rsp)
testq %rdi, %rdi
je 0x4e46a0
movq 0x30(%rdi), %rax
movq %rax, 0x110(%rsp)
testq %rax, %rax
je 0x4e46a7
movq 0x10(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x4e46ae
movl 0x8(%rdi), %r14d
testl %r14d, %r14d
jle 0x4e46b5
cmpq $0x0, 0x58(%rsp)
je 0x4e46bc
movl %edx, %r13d
testl %edx, %edx
jle 0x4e46c3
testl %ecx, %ecx
js 0x4e46ca
movl %r8d, %r15d
testl %r8d, %r8d
js 0x4e46d1
movl %ecx, 0x120(%rsp)
leaq 0xf(%r14), %rbp
movq 0x50(%rsp), %rax
movl 0x1c(%rax), %eax
movl %eax, 0x28(%rsp)
movl %ebp, %ebx
andl $0x7ffffff0, %ebx       # imm = 0x7FFFFFF0
movl %ebx, %edi
movl %r13d, %esi
callq 0x20959f
testq %rax, %rax
je 0x4e46d6
movq %rax, %r12
movl %r15d, 0x20(%rsp)
movl %ebx, 0x44(%rsp)
movq %r13, 0x30(%rsp)
shrq $0x4, %rbp
orl $0x10220804, 0xc(%rax)  # imm = 0x10220804
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4c5e3c
movq %rax, %r15
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4c5e3c
movq %rax, %r13
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4c5e3c
movq %rax, %rbx
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4c5e3c
testq %r15, %r15
sete %dl
testq %r13, %r13
sete %cl
orb %dl, %cl
movq %rbx, 0x18(%rsp)
testq %rbx, %rbx
sete %sil
testq %rax, %rax
sete %dl
orb %sil, %dl
orb %cl, %dl
jne 0x4e46d6
movq %r14, 0xf0(%rsp)
vmovd 0x120(%rsp), %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x160(%rsp)
vmovd 0x20(%rsp), %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x140(%rsp)
vbroadcastsd 0x115d86(%rip), %ymm0 # 0x5f9cd0
vmovups %ymm0, 0x120(%rsp)
movq %rax, %r14
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4c5e45
movq %r14, 0x38(%rsp)
movq %r14, %rdi
vmovups 0x120(%rsp), %ymm0
movq %rbp, %rsi
callq 0x4c5e45
vmovdqu 0x140(%rsp), %ymm9
vmovdqu 0x160(%rsp), %ymm8
leal -0x1(%rbp), %ecx
movl 0x30(%rsp), %edx
movl $0x7ffe, %eax           # imm = 0x7FFE
subl 0x28(%rsp), %eax
cwtl
movl %eax, 0x48(%rsp)
movq %rbp, 0xe8(%rsp)
movl %ebp, %edi
movq %rdi, %rsi
imulq %rdx, %rsi
leaq (,%rsi,4), %r11
movq %rdx, 0xf8(%rsp)
leaq (,%rdx,4), %rax
movq %rax, 0xd8(%rsp)
leaq (,%rsi,8), %r9
leaq (%rsi,%rsi,8), %rax
leaq (%rax,%rax,2), %rax
addq %rsi, %rax
movq %rax, 0xc0(%rsp)
movq %rsi, %rax
imulq $0x2c, %rsi, %rdx
movq %rdx, 0x20(%rsp)
imulq $0x34, %rsi, %rbp
imulq $0x38, %rsi, %rdx
imulq $0x3c, %rsi, %r10
movq %r10, 0x90(%rsp)
movq %r13, %r8
movq %rsi, %r10
movq %r11, %rsi
shlq $0x4, %r10
shlq $0x5, %rax
movq %rax, 0xb8(%rsp)
movq %rdi, 0x100(%rsp)
shlq $0x5, %rdi
movq %rdi, 0xd0(%rsp)
vpbroadcastw 0x1166ad(%rip), %ymm0 # 0x5fa6f0
shlq $0x5, %rcx
movq %rcx, 0x108(%rsp)
vpbroadcastw 0x116698(%rip), %xmm1 # 0x5fa6f0
vmovdqa %ymm0, %ymm3
vmovdqa %ymm0, %ymm2
leaq (%r11,%r11,2), %rax
movq %rax, 0x88(%rsp)
leaq (%r11,%r11,4), %rdi
leaq (%r9,%r9,2), %r11
movq %rsi, 0xe0(%rsp)
leaq (%rsi,%rsi,8), %rax
movq %rax, 0x78(%rsp)
movq %r9, 0x28(%rsp)
leaq (%r9,%r9,4), %rbx
movq %r10, %r13
leaq (%r10,%r10,2), %rax
movq %rax, 0x70(%rsp)
movw $0x8000, %ax            # imm = 0x8000
movl %eax, 0xc(%rsp)
movl $0x8000, %r10d          # imm = 0x8000
xorl %esi, %esi
xorl %r9d, %r9d
xorl %eax, %eax
movq %rdi, 0x80(%rsp)
movq %r11, 0x120(%rsp)
movq %rbp, 0xb0(%rsp)
movq %rdx, 0xa8(%rsp)
movq %rbx, 0xa0(%rsp)
movq %r13, 0x98(%rsp)
movq 0x50(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x58(%rsp), %rdx
movzbl (%rdx,%r9), %edx
movslq (%rcx,%rdx,4), %rcx
movq 0x100(%rsp), %rbp
imulq %rcx, %rbp
shlq $0x5, %rbp
addq 0x110(%rsp), %rbp
movq %r9, 0x118(%rsp)
leal -0x2(%r9), %ecx
movq %rax, 0x60(%rsp)
cmpl %ecx, %eax
movq %r8, %rcx
movq 0x18(%rsp), %rax
cmoveq %rax, %rcx
movq %rcx, 0xc8(%rsp)
cmoveq %r8, %rax
movq %rax, 0x18(%rsp)
movq 0x108(%rsp), %rax
movq %r15, 0x10(%rsp)
vmovdqa (%r15,%rax), %ymm4
vinserti128 $0x1, %xmm4, %ymm0, %ymm5
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]
vpblendw $0x1, %xmm0, %xmm4, %xmm5 # xmm5 = xmm0[0],xmm4[1,2,3,4,5,6,7]
vpblendd $0xf0, %ymm4, %ymm5, %ymm5 # ymm5 = ymm5[0,1,2,3],ymm4[4,5,6,7]
movq %rsi, 0x68(%rsp)
movq %rsi, %r11
xorl %edx, %edx
vmovdqa %ymm0, %ymm4
movq 0x38(%rsp), %rsi
movq %rdi, %r15
movq 0x88(%rsp), %r9
movq 0x90(%rsp), %r13
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %r8
vpaddsw (%rbp,%rdx), %ymm5, %ymm6
vmovdqa (%rsi,%rdx), %ymm5
vpmaxsw %ymm4, %ymm5, %ymm7
vpmaxsw %ymm7, %ymm6, %ymm6
movq 0xc8(%rsp), %rax
vmovdqa %ymm6, (%rax,%rdx)
movq 0x10(%r12), %rcx
movq (%rcx), %rcx
vmovd %xmm6, %eax
cwtl
addl %r10d, %eax
movl %eax, (%rcx,%r11)
addq %r11, %rcx
vpextrw $0x1, %xmm6, %eax
cwtl
addl %r10d, %eax
movq 0xe0(%rsp), %rbx
movl %eax, (%rbx,%rcx)
vpextrw $0x2, %xmm6, %eax
cwtl
addl %r10d, %eax
movq %r12, %r14
vpextrw $0x3, %xmm6, %r12d
movq 0x28(%rsp), %rbx
movl %eax, (%rbx,%rcx)
movswl %r12w, %eax
addl %r10d, %eax
movl %eax, (%r9,%rcx)
vpextrw $0x4, %xmm6, %eax
cwtl
addl %r10d, %eax
movq 0x98(%rsp), %rbx
movl %eax, (%rbx,%rcx)
vpextrw $0x5, %xmm6, %eax
cwtl
addl %r10d, %eax
movl %eax, (%r15,%rcx)
vpextrw $0x6, %xmm6, %eax
cwtl
addl %r10d, %eax
vpextrw $0x7, %xmm6, %r12d
movq 0x120(%rsp), %rbx
movl %eax, (%rbx,%rcx)
movswl %r12w, %eax
addl %r10d, %eax
movq 0xc0(%rsp), %rbx
movl %eax, (%rbx,%rcx)
vextracti128 $0x1, %ymm6, %xmm7
vmovd %xmm7, %eax
cwtl
addl %r10d, %eax
movq 0xb8(%rsp), %rbx
movl %eax, (%rbx,%rcx)
vpextrw $0x1, %xmm7, %eax
cwtl
addl %r10d, %eax
movl %eax, (%rdi,%rcx)
vpextrw $0x2, %xmm7, %eax
cwtl
addl %r10d, %eax
vpextrw $0x3, %xmm7, %r12d
movq 0xa0(%rsp), %rbx
movl %eax, (%rbx,%rcx)
movswl %r12w, %eax
addl %r10d, %eax
movq 0x20(%rsp), %rbx
movl %eax, (%rbx,%rcx)
vpextrw $0x4, %xmm7, %eax
cwtl
addl %r10d, %eax
movl %eax, (%r8,%rcx)
vpextrw $0x5, %xmm7, %eax
cwtl
addl %r10d, %eax
movq 0xb0(%rsp), %r12
movl %eax, (%r12,%rcx)
vpextrw $0x6, %xmm7, %eax
cwtl
addl %r10d, %eax
vpextrw $0x7, %xmm7, %r12d
movq 0xa8(%rsp), %rbx
movl %eax, (%rbx,%rcx)
movswl %r12w, %eax
movq %r14, %r12
addl %r10d, %eax
movl %eax, (%r13,%rcx)
vpmaxsw %ymm2, %ymm6, %ymm2
vpsubsw %ymm8, %ymm6, %ymm6
vpsubsw %ymm9, %ymm5, %ymm5
vpmaxsw %ymm6, %ymm5, %ymm5
vmovdqa %ymm5, (%rsi,%rdx)
vpsubsw %ymm9, %ymm4, %ymm4
vpmaxsw %ymm6, %ymm4, %ymm4
movq 0x10(%rsp), %rax
vmovdqa (%rax,%rdx), %ymm5
addq $0x20, %rdx
addq 0xd8(%rsp), %r11
cmpq %rdx, 0xd0(%rsp)
jne 0x4e4199
movq 0x98(%rsp), %r13
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rbp
xorl %eax, %eax
movq 0xc0(%rsp), %r8
movq 0xb8(%rsp), %rdi
movq 0xc8(%rsp), %r15
movq 0xa0(%rsp), %rbx
movl %eax, 0x4c(%rsp)
vinserti128 $0x1, %xmm4, %ymm0, %ymm5
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]
vpblendw $0x1, %xmm1, %xmm4, %xmm5 # xmm5 = xmm1[0],xmm4[1,2,3,4,5,6,7]
vpblendd $0xf0, %ymm4, %ymm5, %ymm4 # ymm4 = ymm5[0,1,2,3],ymm4[4,5,6,7]
movq 0x68(%rsp), %rdx
xorl %r11d, %r11d
vpmaxsw (%r15,%r11), %ymm4, %ymm5
vmovdqa %ymm5, (%r15,%r11)
movq 0x10(%r12), %rax
movq (%rax), %rcx
vmovd %xmm5, %eax
cwtl
addl %r10d, %eax
movl %eax, (%rcx,%rdx)
vpextrw $0x1, %xmm5, %eax
addq %rdx, %rcx
cwtl
addl %r10d, %eax
movq 0xe0(%rsp), %r9
movl %eax, (%r9,%rcx)
vpextrw $0x2, %xmm5, %eax
cwtl
addl %r10d, %eax
movq 0x28(%rsp), %r9
movl %eax, (%r9,%rcx)
vpextrw $0x3, %xmm5, %eax
cwtl
addl %r10d, %eax
movq 0x88(%rsp), %r12
movl %eax, (%r12,%rcx)
vpextrw $0x4, %xmm5, %eax
cwtl
addl %r10d, %eax
vpextrw $0x5, %xmm5, %r12d
movl %eax, (%r13,%rcx)
movswl %r12w, %eax
addl %r10d, %eax
movq 0x80(%rsp), %r12
movl %eax, (%r12,%rcx)
vpextrw $0x6, %xmm5, %eax
cwtl
addl %r10d, %eax
movq 0x120(%rsp), %r12
movl %eax, (%r12,%rcx)
vpextrw $0x7, %xmm5, %eax
cwtl
addl %r10d, %eax
movl %eax, (%r8,%rcx)
vextracti128 $0x1, %ymm5, %xmm6
vmovd %xmm6, %eax
cwtl
addl %r10d, %eax
vpextrw $0x1, %xmm6, %r12d
movl %eax, (%rdi,%rcx)
movswl %r12w, %eax
addl %r10d, %eax
movq %rbx, %r12
movq 0x78(%rsp), %rbx
movl %eax, (%rbx,%rcx)
movq %r12, %rbx
vpextrw $0x2, %xmm6, %eax
cwtl
addl %r10d, %eax
movl %eax, (%r12,%rcx)
vpextrw $0x3, %xmm6, %eax
cwtl
addl %r10d, %eax
movq 0x20(%rsp), %r9
movl %eax, (%r9,%rcx)
vpextrw $0x4, %xmm6, %eax
cwtl
addl %r10d, %eax
vpextrw $0x5, %xmm6, %r12d
movq 0x70(%rsp), %r9
movl %eax, (%r9,%rcx)
movswl %r12w, %eax
addl %r10d, %eax
movl %eax, (%rbp,%rcx)
vpextrw $0x6, %xmm6, %eax
cwtl
addl %r10d, %eax
movl %eax, (%rsi,%rcx)
vpextrw $0x7, %xmm6, %eax
cwtl
addl %r10d, %eax
movq 0x90(%rsp), %r12
movl %eax, (%r12,%rcx)
vpmaxsw %ymm2, %ymm5, %ymm2
vpsubsw %ymm8, %ymm5, %ymm5
vpsubsw %ymm9, %ymm4, %ymm4
vpcmpgtw %ymm5, %ymm4, %ymm5
vpmovmskb %ymm5, %eax
testl %eax, %eax
je 0x4e4508
addq $0x20, %r11
addq 0xd8(%rsp), %rdx
cmpq %r11, 0xd0(%rsp)
movq %r14, %r12
jne 0x4e438d
movl 0x4c(%rsp), %eax
incl %eax
cmpl $0x10, %eax
jne 0x4e4369
jmp 0x4e450b
movq %r14, %r12
vpcmpgtw %ymm3, %ymm2, %ymm4
vpmovmskb %ymm4, %eax
movb $0x1, %cl
testl %eax, %eax
movq 0x80(%rsp), %rdi
movq 0x118(%rsp), %r9
je 0x4e4578
vpermq $0x44, %ymm2, %ymm4     # ymm4 = ymm2[0,1,0,1]
vpmaxsw %ymm4, %ymm2, %ymm4
vpslldq $0x8, %ymm4, %ymm5      # ymm5 = zero,zero,zero,zero,zero,zero,zero,zero,ymm4[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm4[16,17,18,19,20,21,22,23]
vpmaxsw %ymm5, %ymm4, %ymm4
vpslldq $0x4, %ymm4, %ymm5      # ymm5 = zero,zero,zero,zero,ymm4[0,1,2,3,4,5,6,7,8,9,10,11],zero,zero,zero,zero,ymm4[16,17,18,19,20,21,22,23,24,25,26,27]
vpmaxsw %ymm5, %ymm4, %ymm4
vpslldq $0x2, %ymm4, %ymm5      # ymm5 = zero,zero,ymm4[0,1,2,3,4,5,6,7,8,9,10,11,12,13],zero,zero,ymm4[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpmaxsw %ymm5, %ymm4, %ymm4
vextracti128 $0x1, %ymm4, %xmm5
vpextrw $0x7, %xmm5, %eax
movl %eax, 0xc(%rsp)
cwtl
cmpl %eax, 0x48(%rsp)
movq 0x10(%rsp), %rsi
jge 0x4e4584
orb $0x40, 0xc(%r12)
xorl %ecx, %ecx
movq 0x60(%rsp), %rax
jmp 0x4e459a
movq 0x60(%rsp), %rax
movq 0x10(%rsp), %rsi
jmp 0x4e459a
vpshufhw $0xff, %ymm4, %ymm3     # ymm3 = ymm4[0,1,2,3,7,7,7,7,8,9,10,11,15,15,15,15]
vpbroadcastd 0x11531e(%rip), %ymm4 # 0x5f98b0
vpermd %ymm3, %ymm4, %ymm3
movl %r9d, %eax
testb %cl, %cl
je 0x4e45c3
incq %r9
movq 0x68(%rsp), %rcx
addq $0x4, %rcx
movq %rsi, %r8
movq %rcx, %rsi
cmpq 0xf8(%rsp), %r9
jne 0x4e40df
movq %rax, %rbp
jmp 0x4e45ce
movq %rax, %rbp
movl %r9d, %eax
movq %rax, 0x30(%rsp)
movzwl 0xc(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
movq 0xf0(%rsp), %rbx
movq 0xe8(%rsp), %r13
jne 0x4e45f0
orb $0x40, 0xc(%r12)
movq %r12, %rdi
vzeroupper
callq 0x20a805
testl %eax, %eax
je 0x4e461d
xorl %r9d, %r9d
movl $0xffff, %eax           # imm = 0xFFFF
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rbp
xorl %ebx, %ebx
movq 0x38(%rsp), %rdi
jmp 0x4e46ff
movq 0x30(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movq %rbp, %rdx
cmpl %ecx, %edx
movq 0x10(%rsp), %rcx
movq %rcx, %r12
movq 0x18(%rsp), %r8
cmoveq %r8, %r12
movq %r8, %rbp
cmoveq %rcx, %rbp
movq %rdx, %r9
cmpl %eax, %edx
cmovneq %r15, %r8
cmoveq %rcx, %r12
cmoveq %r15, %rbp
decl %ebx
cmpl $0x0, 0x44(%rsp)
movq 0x38(%rsp), %rdi
je 0x4e46ee
movl %r13d, %eax
andl $0x7ffffff, %eax        # imm = 0x7FFFFFF
shll $0x4, %eax
xorl %ecx, %ecx
movl 0xc(%rsp), %r10d
cmpw %r10w, (%rbp,%rcx,2)
jne 0x4e4697
movl %ecx, %edx
shrl $0x4, %edx
movl %ecx, %esi
andl $0xf, %esi
imull %r13d, %esi
addl %edx, %esi
cmpl %ebx, %esi
cmovll %esi, %ebx
incq %rcx
cmpl %ecx, %eax
jne 0x4e467a
jmp 0x4e46f3
callq 0x1ea14d
jmp 0x4e46d6
callq 0x1ea127
jmp 0x4e46d6
callq 0x1ea101
jmp 0x4e46d6
callq 0x1ea0db
jmp 0x4e46d6
callq 0x1ea0b5
jmp 0x4e46d6
callq 0x1ea08f
jmp 0x4e46d6
callq 0x1ea069
jmp 0x4e46d6
callq 0x1ea043
xorl %r14d, %r14d
movq %r14, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xc(%rsp), %r10d
movswl %r10w, %eax
addl $0x8000, %eax           # imm = 0x8000
movq %r8, %r15
movl %eax, (%r14)
movl %ebx, 0x4(%r14)
movl %r9d, 0x8(%r14)
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
jmp 0x4e46d9
nopl (%rax)