// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sg_striped_sse2_128_16.c
// Function: parasail_sg_flags_table_striped_profile_sse2_128_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;
    __m128i* restrict vProfile = NULL;
    __m128i* restrict pvHStore = NULL;
    __m128i* restrict pvHLoad = NULL;
    __m128i* restrict pvE = NULL;
    int16_t* restrict boundary = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int16_t NEG_LIMIT = 0;
    int16_t POS_LIMIT = 0;
    int16_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vMaxH;
    __m128i 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 = 8; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    vProfile = (__m128i*)profile->profile16.score;
    vGapO = _mm_set1_epi16(open);
    vGapE = _mm_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 = _mm_set1_epi16(NEG_LIMIT);
    vPosLimit = _mm_set1_epi16(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vPosMask = _mm_cmpeq_epi16(_mm_set1_epi16(position),
            _mm_set_epi16(0,1,2,3,4,5,6,7));

    /* 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_8;
    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___m128i(16, segLen);
    pvHLoad =  parasail_memalign___m128i(16, segLen);
    pvE      = parasail_memalign___m128i(16, segLen);
    boundary = parasail_memalign_int16_t(16, 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;
            __m128i_16_t h;
            __m128i_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;
            }
            _mm_store_si128(&pvHStore[index], h.m);
            _mm_store_si128(&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) {
        __m128i vE;
        /* Initialize F value to -inf.  Any errors to vH values will be
         * corrected in the Lazy_F loop.  */
        __m128i vF = vNegLimit;

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

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

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

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

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

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

            /* Update vE value. */
            vH = _mm_subs_epi16(vH, vGapO);
            vE = _mm_subs_epi16(vE, vGapE);
            vE = _mm_max_epi16(vE, vH);
            _mm_store_si128(pvE + i, vE);

            /* Update vF value. */
            vF = _mm_subs_epi16(vF, vGapE);
            vF = _mm_max_epi16(vF, vH);

            /* Load the next vH. */
            vH = _mm_load_si128(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 = _mm_slli_si128(vF, 2);
            vF = _mm_insert_epi16(vF, tmp2, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm_load_si128(pvHStore + i);
                vH = _mm_max_epi16(vH,vF);
                _mm_store_si128(pvHStore + i, vH);
                vSaturationCheckMin = _mm_min_epi16(vSaturationCheckMin, vH);
                vSaturationCheckMax = _mm_max_epi16(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
                arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
                vH = _mm_subs_epi16(vH, vGapO);
                vF = _mm_subs_epi16(vF, vGapE);
                if (! _mm_movemask_epi8(_mm_cmpgt_epi16(vF, vH))) goto end;
                /*vF = _mm_max_epi16(vF, vH);*/
            }
        }
end:
        {
            /* extract vector containing last value from the column */
            __m128i vCompare;
            vH = _mm_load_si128(pvHStore + offset);
            vCompare = _mm_and_si128(vPosMask, _mm_cmpgt_epi16(vH, vMaxH));
            vMaxH = _mm_max_epi16(vH, vMaxH);
            if (_mm_movemask_epi8(vCompare)) {
                end_ref = j;
            }
#ifdef PARASAIL_ROWCOL
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 2);
            }
            result->rowcols->score_row[j] = (int16_t) _mm_extract_epi16 (vH, 7);
#endif
        }
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m128i vH = _mm_load_si128(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 = _mm_slli_si128(vMaxH, 2);
        }
        score = (int16_t) _mm_extract_epi16(vMaxH, 7);
        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 */
        {
            __m128i vH = _mm_load_si128(pvHStore + offset);
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 2);
            }
            score = (int16_t) _mm_extract_epi16 (vH, 7);
            end_ref = s2Len - 1;
            end_query = s1Len - 1;
        }
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi16(vSaturationCheckMin, vNegLimit),
            _mm_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 $0xf8, %rsp
movl %ecx, 0x14(%rsp)
movq %rsi, 0x78(%rsp)
testq %rdi, %rdi
je 0x3021fb
movq 0x30(%rdi), %rax
movq %rax, 0xc0(%rsp)
testq %rax, %rax
je 0x302202
movq 0x10(%rdi), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x302209
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
jle 0x302210
cmpq $0x0, 0x78(%rsp)
je 0x302217
movl %r8d, %r12d
movl %edx, %r8d
testl %edx, %edx
jle 0x30221e
cmpl $0x0, 0x14(%rsp)
js 0x302225
testl %r12d, %r12d
js 0x30222c
movl %r9d, %ebp
leal -0x1(%rcx), %eax
movq %rcx, 0xa0(%rsp)
leaq 0x7(%rcx), %rbx
movq %rbx, %r15
shrq $0x3, %r15
movl %eax, 0x6c(%rsp)
cltd
idivl %r15d
movl %eax, %r14d
movl %edx, 0x28(%rsp)
movl 0x14(%rsp), %ecx
movl %ecx, %esi
negl %esi
movq 0x70(%rsp), %rdx
movl 0x20(%rdx), %eax
movl %eax, %r13d
negl %r13d
movl %esi, 0x24(%rsp)
cmpl %esi, %eax
cmovgl %ecx, %r13d
movw $0x7ffe, %ax            # imm = 0x7FFE
subw 0x1c(%rdx), %ax
movl %eax, 0x30(%rsp)
andl $0x7ffffff8, %ebx       # imm = 0x7FFFFFF8
movl %ebx, %edi
movl %r8d, %esi
movq %r8, 0x18(%rsp)
callq 0x20959f
testq %rax, %rax
je 0x302231
movl %r14d, 0x3c(%rsp)
movq %rbx, 0x98(%rsp)
movl %r13d, 0x20(%rsp)
xorl %edi, %edi
testl %ebp, %ebp
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x130(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x138(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x140(%rsp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x8220802, %ecx        # imm = 0x8220802
movq %rax, 0x60(%rsp)
movl %ecx, 0xc(%rax)
movl $0x10, %edi
movq %r15, %rsi
callq 0x2ea474
movq %rax, %r14
movl $0x10, %edi
movq %r15, %rsi
callq 0x2ea474
movq %rax, %r13
movl $0x10, %edi
movq %r15, 0x50(%rsp)
movq %r15, %rsi
callq 0x2ea474
movq %rax, %rbx
movq 0x18(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x10, %edi
callq 0x2094cd
testq %r14, %r14
sete %dl
movq %r13, 0x48(%rsp)
testq %r13, %r13
sete %cl
orb %dl, %cl
movq %rbx, 0x58(%rsp)
testq %rbx, %rbx
sete %sil
testq %rax, %rax
sete %dl
orb %sil, %dl
orb %cl, %dl
jne 0x302231
movq %r14, %r15
movq %rax, 0x40(%rsp)
movq 0x18(%rsp), %rax
decl %eax
movl %eax, 0x10(%rsp)
movl $0x7, %ecx
subl 0x3c(%rsp), %ecx
movl 0x14(%rsp), %eax
movd %eax, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm3      # xmm3 = xmm0[0,0,0,0]
movd %r12d, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm5      # xmm5 = xmm0[0,0,0,0]
movl 0x20(%rsp), %r13d
addl $0xffff8001, %r13d      # imm = 0xFFFF8001
movd %r13d, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movd 0x30(%rsp), %xmm1
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movl %ecx, 0x38(%rsp)
movd %ecx, %xmm2
pshuflw $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm2, %xmm6      # xmm6 = xmm2[0,0,0,0]
movl %eax, %eax
movl %r12d, %ecx
movslq 0x24(%rsp), %rdx
movl 0x50(%rsp), %esi
movq %rsi, 0x30(%rsp)
imulq %rcx, %rsi
xorl %edi, %edi
movq $-0x7fff, %r9           # imm = 0x8001
movq $-0x8000, %r10          # imm = 0x8000
movq %rdx, %r11
xorl %ebx, %ebx
testl %ebp, %ebp
je 0x301bd0
xorl %r8d, %r8d
jmp 0x301bd3
movq %r11, %r8
cmpq %r9, %r8
movq $-0x8000, %r14          # imm = 0x8000
cmovgeq %r8, %r14
movw %r14w, 0xe0(%rsp,%rbx,2)
subq %rax, %r8
cmpq %r9, %r8
cmovlq %r10, %r8
movw %r8w, 0xd0(%rsp,%rbx,2)
incq %rbx
subq %rsi, %r11
cmpq $0x8, %rbx
jne 0x301bc7
movq %rdi, %r8
shlq $0x4, %r8
movaps 0xe0(%rsp), %xmm2
movaps %xmm2, (%r15,%r8)
movdqa 0xd0(%rsp), %xmm2
movq 0x58(%rsp), %r11
movdqa %xmm2, (%r11,%r8)
incq %rdi
subq %rcx, %rdx
cmpq 0x30(%rsp), %rdi
jne 0x301bc2
movl %r13d, 0x20(%rsp)
movq 0x18(%rsp), %rcx
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
movq 0x40(%rsp), %r8
movw $0x0, (%r8)
xorl %ecx, %ecx
xorl %edx, %edx
movl 0x24(%rsp), %esi
movl 0x138(%rsp), %r9d
cmpl $0xffff8001, %esi       # imm = 0xFFFF8001
movl $0xffff8000, %edi       # imm = 0xFFFF8000
cmovgel %esi, %edi
testl %r9d, %r9d
cmovnel %ecx, %edi
movw %di, 0x2(%r8,%rdx,2)
subl %r12d, %esi
incq %rdx
cmpq %rdx, %rax
jne 0x301c6e
movq 0x50(%rsp), %r11
leal -0x1(%r11), %r10d
movq 0x18(%rsp), %rdx
movl %edx, %eax
movl 0x28(%rsp), %r8d
cmpl $0x1, %r11d
adcl $0x0, %r11d
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
movq %rcx, 0xb0(%rsp)
movq 0x30(%rsp), %rbp
imulq %rax, %rbp
leaq (,%rbp,4), %rsi
shlq $0x2, %rax
movq %rax, 0x18(%rsp)
leaq (,%rbp,8), %rdx
leaq (%rsi,%rsi,2), %rcx
leaq (,%rbp,8), %rax
addq %rbp, %rax
leaq (%rax,%rax,2), %r9
addq %rbp, %r9
shlq $0x4, %rbp
leaq (%rsi,%rsi,4), %rdi
leaq (%rdx,%rdx,2), %r13
shlq $0x4, %r11
xorl %r14d, %r14d
shlq $0x4, %r10
movq %r10, 0xb8(%rsp)
pcmpeqw 0x2f3cfe(%rip), %xmm6   # 0x5f5a20
movq %r8, 0x90(%rsp)
shlq $0x4, %r8
movq %r8, 0xa8(%rsp)
movdqa %xmm0, %xmm8
movdqa %xmm0, %xmm2
movdqa %xmm1, %xmm4
xorl %r12d, %r12d
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x60(%rsp), %r10
movq 0x48(%rsp), %rbx
movq %r15, %rax
movq %r11, 0xc8(%rsp)
movq %rbx, %r15
movq %rax, %rbx
movdqa %xmm8, %xmm7
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x78(%rsp), %r8
movzbl (%r8,%r12), %r8d
movslq (%rax,%r8,4), %rax
movq 0x30(%rsp), %r8
imulq %rax, %r8
shlq $0x4, %r8
movq 0xb8(%rsp), %rax
movq %rbx, 0x48(%rsp)
movdqa (%rbx,%rax), %xmm11
pslldq $0x2, %xmm11            # xmm11 = zero,zero,xmm11[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movq 0x40(%rsp), %rax
movq %r12, 0x80(%rsp)
pinsrw $0x0, (%rax,%r12,2), %xmm11
addq 0xc0(%rsp), %r8
movq %r8, 0x28(%rsp)
movq %r14, 0x88(%rsp)
xorl %r12d, %r12d
movdqa %xmm0, %xmm8
movq 0x58(%rsp), %rax
movq 0x28(%rsp), %r8
paddsw (%r8,%r12), %xmm11
movdqa (%rax,%r12), %xmm10
movdqa %xmm10, %xmm9
pmaxsw %xmm8, %xmm9
pmaxsw %xmm11, %xmm9
movdqa %xmm9, (%r15,%r12)
movq 0x10(%r10), %r8
movq (%r8), %rbx
movd %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%rbx,%r14)
addq %r14, %rbx
pextrw $0x1, %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%rsi,%rbx)
pextrw $0x2, %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%rdx,%rbx)
pextrw $0x3, %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%rcx,%rbx)
pextrw $0x4, %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%rbp,%rbx)
pextrw $0x5, %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%rdi,%rbx)
pextrw $0x6, %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%r13,%rbx)
pextrw $0x7, %xmm9, %r8d
movswl %r8w, %r8d
movl %r8d, (%r9,%rbx)
pmaxsw %xmm9, %xmm2
pminsw %xmm10, %xmm4
pminsw %xmm8, %xmm4
pminsw %xmm9, %xmm4
psubsw %xmm3, %xmm9
psubsw %xmm5, %xmm10
pmaxsw %xmm9, %xmm10
movdqa %xmm10, (%rax,%r12)
psubsw %xmm5, %xmm8
pmaxsw %xmm9, %xmm8
movq 0x48(%rsp), %r8
movaps (%r8,%r12), %xmm11
addq $0x10, %r12
addq 0x18(%rsp), %r14
cmpq %r12, 0xc8(%rsp)
jne 0x301de1
movq $0x0, 0x28(%rsp)
movl 0x24(%rsp), %eax
cmpl $0x0, 0x138(%rsp)
jne 0x301f04
movq 0x40(%rsp), %rax
movq 0x80(%rsp), %r8
movswl 0x2(%rax,%r8,2), %eax
subl 0x14(%rsp), %eax
pslldq $0x2, %xmm8             # xmm8 = zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
cmpl $0xffff8001, %eax       # imm = 0xFFFF8001
movl $0xffff8000, %r8d       # imm = 0xFFFF8000
cmovll %r8d, %eax
pinsrw $0x0, %eax, %xmm8
movb $0x1, %r14b
movl $0x1, %r12d
movq 0x88(%rsp), %rbx
xorl %eax, %eax
movdqa (%r15,%rax), %xmm9
pmaxsw %xmm8, %xmm9
movdqa %xmm9, (%r15,%rax)
pminsw %xmm9, %xmm4
pmaxsw %xmm9, %xmm2
movq 0x10(%r10), %r8
movq (%r8), %r8
movd %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%r8,%rbx)
addq %rbx, %r8
pextrw $0x1, %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%rsi,%r8)
pextrw $0x2, %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%rdx,%r8)
pextrw $0x3, %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%rcx,%r8)
pextrw $0x4, %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%rbp,%r8)
pextrw $0x5, %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%rdi,%r8)
pextrw $0x6, %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%r13,%r8)
pextrw $0x7, %xmm9, %r10d
movswl %r10w, %r10d
movl %r10d, (%r9,%r8)
movq 0x60(%rsp), %r10
psubsw %xmm3, %xmm9
psubsw %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtw %xmm9, %xmm10
pmovmskb %xmm10, %r8d
testl %r8d, %r8d
movq 0x18(%rsp), %r8
je 0x30200c
cmpq 0x30(%rsp), %r12
setb %r14b
addq $0x10, %rax
addq %r8, %rbx
incq %r12
cmpq %rax, %r11
jne 0x301f32
testb $0x1, %r14b
jne 0x30202a
movq 0x28(%rsp), %r8
leal 0x1(%r8), %eax
cmpl $0x7, %r8d
movq %rax, 0x28(%rsp)
jb 0x301edf
movq 0xa8(%rsp), %rax
movdqa (%r15,%rax), %xmm8
movdqa %xmm8, %xmm9
pcmpgtw %xmm7, %xmm9
pand %xmm6, %xmm9
pmaxsw %xmm7, %xmm8
pmovmskb %xmm9, %eax
testl %eax, %eax
movl 0xc(%rsp), %eax
movq 0x80(%rsp), %r12
cmovnel %r12d, %eax
movl %eax, 0xc(%rsp)
incq %r12
movq 0x88(%rsp), %r14
addq $0x4, %r14
movq %r15, %rax
cmpq 0xb0(%rsp), %r12
movq 0x48(%rsp), %rbx
jne 0x301d63
movl 0x140(%rsp), %r13d
testl %r13d, %r13d
movl 0x6c(%rsp), %r8d
movq 0xa0(%rsp), %r9
movl 0x3c(%rsp), %r11d
movl 0x20(%rsp), %ebp
movq 0x50(%rsp), %r12
je 0x3020d9
cmpl $0x6, %r11d
jg 0x3020d3
movl 0x38(%rsp), %ecx
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
pslldq $0x2, %xmm8             # xmm8 = zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
decl %eax
jne 0x3020c9
pextrw $0x7, %xmm8, %ebp
cmpl $0x0, 0x130(%rsp)
je 0x30214c
cmpl $0x0, 0x98(%rsp)
je 0x30214c
movl %r12d, %ecx
andl $0xfffffff, %ecx        # imm = 0xFFFFFFF
shll $0x3, %ecx
xorl %edx, %edx
movl %r8d, %eax
movl %edx, %edi
shrl $0x3, %edi
movl %edx, %esi
andl $0x7, %esi
imull %r12d, %esi
addl %edi, %esi
cmpl %r9d, %esi
jge 0x302143
movzwl (%r15,%rdx,2), %edi
cmpw %bp, %di
jle 0x30212b
movl %edi, %ebp
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movl %esi, %eax
jmp 0x302143
cmpl %eax, %esi
cmovgel %eax, %esi
movl 0xc(%rsp), %r14d
cmpl 0x10(%rsp), %r14d
cmovnel %eax, %esi
cmpw %bp, %di
cmovel %esi, %eax
incq %rdx
cmpl %edx, %ecx
jne 0x3020fe
jmp 0x30214f
movl %r8d, %eax
orl 0x130(%rsp), %r13d
jne 0x302199
movq 0x90(%rsp), %rax
shlq $0x4, %rax
movdqa (%r15,%rax), %xmm3
cmpl $0x6, %r11d
jg 0x302189
movl 0x38(%rsp), %ecx
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
pslldq $0x2, %xmm3             # xmm3 = zero,zero,xmm3[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
decl %eax
jne 0x302180
pextrw $0x7, %xmm3, %ebp
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movl %r8d, %eax
pcmpgtw %xmm4, %xmm0
pcmpgtw %xmm1, %xmm2
por %xmm0, %xmm2
pmovmskb %xmm2, %ecx
testl %ecx, %ecx
je 0x3021be
orb $0x40, 0xc(%r10)
xorl %ebp, %ebp
movl $0x0, 0xc(%rsp)
xorl %eax, %eax
movswl %bp, %ecx
movl %ecx, (%r10)
movl %eax, 0x4(%r10)
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r10)
movq 0x40(%rsp), %rdi
callq 0x2094b5
movq 0x58(%rsp), %rdi
callq 0x2094b5
movq %rbx, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
movq 0x60(%rsp), %rax
jmp 0x302233
callq 0x1ae7db
jmp 0x302231
callq 0x1ae7b5
jmp 0x302231
callq 0x1ae78f
jmp 0x302231
callq 0x1ae769
jmp 0x302231
callq 0x1ae743
jmp 0x302231
callq 0x1ae71d
jmp 0x302231
callq 0x1ae6f7
jmp 0x302231
callq 0x1ae6d1
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq