// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/sw_trace_striped_sse2_128_16.c
// Function: parasail_sw_trace_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)
{
    /* 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;
    __m128i* restrict vProfile = NULL;
    __m128i* restrict pvHStore = NULL;
    __m128i* restrict pvHLoad = NULL;
    __m128i* restrict pvE = NULL;
    __m128i* restrict pvEaStore = NULL;
    __m128i* restrict pvEaLoad = NULL;
    __m128i* restrict pvHT = NULL;
    __m128i* restrict pvHMax = NULL;
    __m128i vGapO;
    __m128i vGapE;
    __m128i vZero;
    int16_t score = 0;
    __m128i vMaxH;
    __m128i vMaxHUnit;
    int16_t maxp = 0;
    parasail_result_t *result = NULL;
    __m128i vTZero;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;
    __m128i vTMask;
    __m128i vFTMask;

    /* 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 = 8; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    vProfile = (__m128i*)profile->profile16.score;
    vGapO = _mm_set1_epi16(open);
    vGapE = _mm_set1_epi16(gap);
    vZero = _mm_setzero_si128();
    score = NEG_INF;
    vMaxH = vZero;
    vMaxHUnit = vZero;
    maxp = INT16_MAX - (int16_t)(matrix->max+1);
    vTZero = _mm_set1_epi16(PARASAIL_ZERO);
    vTIns  = _mm_set1_epi16(PARASAIL_INS);
    vTDel  = _mm_set1_epi16(PARASAIL_DEL);
    vTDiag = _mm_set1_epi16(PARASAIL_DIAG);
    vTDiagE= _mm_set1_epi16(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi16(PARASAIL_INS_E);
    vTDiagF= _mm_set1_epi16(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi16(PARASAIL_DEL_F);
    vTMask = _mm_set1_epi16(PARASAIL_ZERO_MASK);
    vFTMask= _mm_set1_epi16(PARASAIL_F_MASK);

    /* initialize result */
    result = parasail_result_new_trace(segLen, s2Len, 16, sizeof(__m128i));
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_16 | PARASAIL_FLAG_LANES_8;

    /* initialize heap variables */
    pvHStore = parasail_memalign___m128i(16, segLen);
    pvHLoad =  parasail_memalign___m128i(16, segLen);
    pvE = parasail_memalign___m128i(16, segLen);
    pvEaStore = parasail_memalign___m128i(16, segLen);
    pvEaLoad = parasail_memalign___m128i(16, segLen);
    pvHT = parasail_memalign___m128i(16, segLen);
    pvHMax = parasail_memalign___m128i(16, segLen);

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

    /* initialize H and E */
    parasail_memset___m128i(pvHStore, vZero, segLen);
    parasail_memset___m128i(pvE, _mm_set1_epi16(-open), segLen);
    parasail_memset___m128i(pvEaStore, _mm_set1_epi16(-open), segLen);

    for (i=0; i<segLen; ++i) {
        arr_store(result->trace->trace_table, vTDiagE, i, segLen, 0);
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vEF_opn;
        __m128i vE;
        __m128i vE_ext;
        __m128i vF;
        __m128i vF_ext;
        __m128i vFa;
        __m128i vFa_ext;
        __m128i vH;
        __m128i vH_dag;
        const __m128i* vP = NULL;

        /* Initialize F value to 0.  Any errors to vH values will be
         * corrected in the Lazy_F loop. */
        vF = _mm_subs_epi16(vZero,vGapO);

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

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

        if (end_ref == j-2) {
            /* Swap in the max buffer. */
            SWAP3(pvHMax,  pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }
        else {
            /* Swap the 2 H buffers. */
            SWAP(pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }

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

            /* Get max from vH, vE and vF. */
            vH_dag = _mm_adds_epi16(vH, _mm_load_si128(vP + i));
            vH_dag = _mm_max_epi16(vH_dag, vZero);
            vH = _mm_max_epi16(vH_dag, vE);
            vH = _mm_max_epi16(vH, vF);
            /* Save vH values. */
            _mm_store_si128(pvHStore + i, vH);

            {
                __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                __m128i cond_zero = _mm_cmpeq_epi16(vH, vZero);
                __m128i case1 = _mm_cmpeq_epi16(vH, vH_dag);
                __m128i case2 = _mm_cmpeq_epi16(vH, vF);
                __m128i vT = _mm_blendv_epi8_rpl(
                        _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                        _mm_blendv_epi8_rpl(vTDiag, vTZero, cond_zero),
                        case1);
                _mm_store_si128(pvHT + i, vT);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i, segLen, j);
            }
            vMaxH = _mm_max_epi16(vH, vMaxH);
            vEF_opn = _mm_subs_epi16(vH, vGapO);

            /* Update vE value. */
            vE_ext = _mm_subs_epi16(vE, vGapE);
            vE = _mm_max_epi16(vEF_opn, vE_ext);
            _mm_store_si128(pvE + i, vE);
            {
                __m128i vEa = _mm_load_si128(pvEaLoad + i);
                __m128i vEa_ext = _mm_subs_epi16(vEa, vGapE);
                vEa = _mm_max_epi16(vEF_opn, vEa_ext);
                _mm_store_si128(pvEaStore + i, vEa);
                if (j+1<s2Len) {
                    __m128i cond = _mm_cmpgt_epi16(vEF_opn, vEa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                    arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                }
            }

            /* Update vF value. */
            vF_ext = _mm_subs_epi16(vF, vGapE);
            vF = _mm_max_epi16(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m128i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m128i cond = _mm_cmpgt_epi16(vEF_opn, vF_ext);
                __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i+1, segLen, j);
            }

            /* 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 */
        vFa_ext = vF_ext;
        vFa = vF;
        for (k=0; k<segWidth; ++k) {
            __m128i vHp = _mm_load_si128(&pvHLoad[segLen - 1]);
            vHp = _mm_slli_si128(vHp, 2);
            vEF_opn = _mm_slli_si128(vEF_opn, 2);
            vEF_opn = _mm_insert_epi16(vEF_opn, -open, 0);
            vF_ext = _mm_slli_si128(vF_ext, 2);
            vF_ext = _mm_insert_epi16(vF_ext, NEG_INF, 0);
            vF = _mm_slli_si128(vF, 2);
            vF = _mm_insert_epi16(vF, -open, 0);
            vFa_ext = _mm_slli_si128(vFa_ext, 2);
            vFa_ext = _mm_insert_epi16(vFa_ext, NEG_INF, 0);
            vFa = _mm_slli_si128(vFa, 2);
            vFa = _mm_insert_epi16(vFa, -open, 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);
                {
                    __m128i vTAll;
                    __m128i vT;
                    __m128i case1;
                    __m128i case2;
                    __m128i cond;
                    vHp = _mm_adds_epi16(vHp, _mm_load_si128(vP + i));
                    vHp = _mm_max_epi16(vHp, vZero);
                    case1 = _mm_cmpeq_epi16(vH, vHp);
                    case2 = _mm_cmpeq_epi16(vH, vF);
                    cond = _mm_andnot_si128(case1,case2);
                    vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    vT = _mm_load_si128(pvHT + i);
                    vT = _mm_blendv_epi8_rpl(vT, vTDel, cond);
                    _mm_store_si128(pvHT + i, vT);
                    vTAll = _mm_and_si128(vTAll, vTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vMaxH = _mm_max_epi16(vH, vMaxH);
                /* Update vF value. */
                {
                    __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m128i cond = _mm_cmpgt_epi16(vEF_opn, vFa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                    vTAll = _mm_and_si128(vTAll, vFTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vEF_opn = _mm_subs_epi16(vH, vGapO);
                vF_ext = _mm_subs_epi16(vF, vGapE);
                {
                    __m128i vEa = _mm_load_si128(pvEaLoad + i);
                    __m128i vEa_ext = _mm_subs_epi16(vEa, vGapE);
                    vEa = _mm_max_epi16(vEF_opn, vEa_ext);
                    _mm_store_si128(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m128i cond = _mm_cmpgt_epi16(vEF_opn, vEa_ext);
                        __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                        arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                    }
                }
                if (! _mm_movemask_epi8(
                            _mm_or_si128(
                                _mm_cmpgt_epi16(vF_ext, vEF_opn),
                                _mm_cmpeq_epi16(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm_max_epi16(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm_subs_epi16(vFa, vGapE);
                vFa = _mm_max_epi16(vEF_opn, vFa_ext);
                vHp = _mm_load_si128(pvHLoad + i);
            }
        }
end:
        {
        }

        {
            __m128i vCompare = _mm_cmpgt_epi16(vMaxH, vMaxHUnit);
            if (_mm_movemask_epi8(vCompare)) {
                score = _mm_hmax_epi16_rpl(vMaxH);
                /* if score has potential to overflow, abort early */
                if (score > maxp) {
                    result->flag |= PARASAIL_FLAG_SATURATED;
                    break;
                }
                vMaxHUnit = _mm_set1_epi16(score);
                end_ref = j;
            }
        }

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

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

    if (parasail_result_is_saturated(result)) {
        score = 0;
        end_query = 0;
        end_ref = 0;
    }
    else {
        if (end_ref == j-1) {
            /* end_ref was the last store column */
            SWAP(pvHMax,  pvHStore)
        }
        else if (end_ref == j-2) {
            /* end_ref was the last load column */
            SWAP(pvHMax,  pvHLoad)
        }
        /* 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;
    result->end_query = end_query;
    result->end_ref = end_ref;

    parasail_free(pvHMax);
    parasail_free(pvHT);
    parasail_free(pvEaLoad);
    parasail_free(pvEaStore);
    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 $0xe8, %rsp
movq %rsi, 0x68(%rsp)
testq %rdi, %rdi
je 0x3bde8d
movq 0x30(%rdi), %rax
movq %rax, 0xc0(%rsp)
testq %rax, %rax
je 0x3bde94
movq 0x10(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x3bde9b
movl 0x8(%rdi), %r15d
testl %r15d, %r15d
jle 0x3bdea2
cmpq $0x0, 0x68(%rsp)
je 0x3bdea9
movl %edx, %r12d
testl %edx, %edx
jle 0x3bdeb0
testl %ecx, %ecx
js 0x3bdeb7
testl %r8d, %r8d
js 0x3bdebe
movl %r8d, 0x40(%rsp)
movl %ecx, 0x10(%rsp)
leaq 0x7(%r15), %r14
movq %r14, %r13
shrq $0x3, %r13
movq 0x60(%rsp), %rax
movl 0x1c(%rax), %ebp
movl $0x10, %edx
movl $0x10, %ecx
movl %r13d, %edi
movl %r12d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x3bdec3
movq %rax, %rbx
movl %ebp, 0x70(%rsp)
movq %r12, 0x50(%rsp)
movq %r15, 0xa0(%rsp)
movq %r14, 0xa8(%rsp)
orl $0x8280804, 0xc(%rax)   # imm = 0x8280804
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %r15
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %rbp
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, 0x38(%rsp)
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %r12
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %r14
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %r13, %rsi
movq %rax, %r13
movl $0x10, %edi
movq %rsi, 0x30(%rsp)
callq 0x2f600c
movq %rax, %rdx
movq %r15, %xmm0
movq %rbp, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq 0x38(%rsp), %xmm1
movq %r12, 0x28(%rsp)
movq %r12, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
pxor %xmm2, %xmm2
pcmpeqd %xmm2, %xmm0
pcmpeqd %xmm2, %xmm1
movdqa %xmm0, %xmm2
shufps $0xdd, %xmm1, %xmm2     # xmm2 = xmm2[1,3],xmm1[1,3]
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
andps %xmm2, %xmm0
movmskps %xmm0, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x3bdf30
testq %r14, %r14
je 0x3bdf30
testq %r13, %r13
je 0x3bdf30
testq %rdx, %rdx
je 0x3bdf30
movq %rdx, 0x20(%rsp)
movd 0x10(%rsp), %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]
movdqa %xmm0, 0x90(%rsp)
movd 0x40(%rsp), %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]
movdqa %xmm0, 0x80(%rsp)
pxor %xmm0, %xmm0
movq %r15, %rdi
movq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x2f6015
movl 0x10(%rsp), %eax
negl %eax
movl %eax, 0x10(%rsp)
movd %eax, %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]
movdqa %xmm0, 0x40(%rsp)
movq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0x2f6015
movq 0x28(%rsp), %rdi
movaps 0x40(%rsp), %xmm0
movq %r12, %rsi
callq 0x2f6015
shlq $0x4, %r12
xorl %ecx, %ecx
movdqa 0x26c598(%rip), %xmm0   # 0x629d90
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
movdqa %xmm0, (%rdx,%rcx)
addq $0x10, %rcx
cmpq %rcx, %r12
jne 0x3bd7f8
pxor %xmm0, %xmm0
pxor %xmm1, %xmm1
psubsw 0x90(%rsp), %xmm1
movdqa %xmm1, 0xd0(%rsp)
movq 0x30(%rsp), %rcx
leal -0x1(%rcx), %esi
movl $0x7ffe, %eax           # imm = 0x7FFE
subl 0x70(%rsp), %eax
cwtl
movl %eax, 0x5c(%rsp)
movl 0x50(%rsp), %edx
movl %ecx, %edi
movq %rdi, 0xb0(%rsp)
shlq $0x4, %rdi
movw $0x8000, %ax            # imm = 0x8000
movl %eax, 0xc(%rsp)
xorl %r8d, %r8d
shlq $0x4, %rsi
movq %rsi, 0xb8(%rsp)
movdqa 0x26dfc2(%rip), %xmm2   # 0x62b830
movdqa 0x26dfca(%rip), %xmm3   # 0x62b840
movdqa 0x26c6c2(%rip), %xmm5   # 0x629f40
movdqa 0x26df8a(%rip), %xmm6   # 0x62b810
movdqa 0x26df92(%rip), %xmm7   # 0x62b820
movdqa 0x26e309(%rip), %xmm9   # 0x62bba0
movq %rdi, 0x40(%rsp)
xorl %r11d, %r11d
movl $0x0, 0x14(%rsp)
pxor %xmm10, %xmm10
pxor %xmm4, %xmm4
movdqa 0x80(%rsp), %xmm8
movq 0x28(%rsp), %r10
movdqa %xmm4, 0x70(%rsp)
movq 0x20(%rsp), %r9
movq %r9, 0x18(%rsp)
movq %r14, %r12
movq %rbp, 0xc8(%rsp)
movq %r15, %rbp
movq %r11, %rax
movq 0xb8(%rsp), %r14
leaq (%r15,%r14), %rcx
movq %rcx, 0x28(%rsp)
movq 0x60(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq 0x68(%rsp), %rcx
movzbl (%rcx,%r11), %r11d
movslq (%rsi,%r11,4), %r11
movq 0xb0(%rsp), %rsi
imulq %r11, %rsi
shlq $0x4, %rsi
addq 0xc0(%rsp), %rsi
leal -0x2(%rax), %r11d
cmpl %r11d, 0x14(%rsp)
movq 0xc8(%rsp), %r15
cmoveq %r15, %r9
movq %r9, 0x20(%rsp)
cmoveq 0x18(%rsp), %r15
movdqa (%rbp,%r14), %xmm1
pslldq $0x2, %xmm1             # xmm1 = zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movq %rax, 0x18(%rsp)
leaq 0x1(%rax), %r11
movl $0x1, %eax
xorl %r9d, %r9d
movdqa 0xd0(%rsp), %xmm12
movq 0x38(%rsp), %r14
movdqa (%r14,%r9), %xmm15
paddsw (%rsi,%r9), %xmm1
pmaxsw %xmm0, %xmm1
movdqa %xmm1, %xmm11
pmaxsw %xmm15, %xmm11
movdqa %xmm11, %xmm14
pmaxsw %xmm12, %xmm14
movdqa %xmm14, (%r15,%r9)
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
pcmpeqw %xmm14, %xmm1
movdqa %xmm14, %xmm13
pcmpgtw %xmm0, %xmm13
pand %xmm1, %xmm13
pand %xmm3, %xmm13
pcmpgtw %xmm12, %xmm11
paddw %xmm2, %xmm11
pandn %xmm11, %xmm1
por %xmm13, %xmm1
movdqa (%r9,%rcx), %xmm11
por %xmm1, %xmm11
movdqa %xmm1, (%r13,%r9)
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa %xmm11, (%r9,%rcx)
movdqa %xmm14, %xmm13
psubsw 0x90(%rsp), %xmm13
psubsw %xmm8, %xmm15
pmaxsw %xmm13, %xmm15
movdqa %xmm15, (%r14,%r9)
movdqa (%r10,%r9), %xmm1
psubsw %xmm8, %xmm1
movdqa %xmm13, %xmm11
pmaxsw %xmm1, %xmm11
movdqa %xmm11, (%r12,%r9)
cmpq %rdx, %r11
jae 0x3bda58
movdqa %xmm13, %xmm11
pcmpgtw %xmm1, %xmm11
pand 0x26ddbf(%rip), %xmm11  # 0x62b800
pxor %xmm5, %xmm11
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq 0x40(%rsp), %rcx
movdqa %xmm11, (%r9,%rcx)
movdqa %xmm12, %xmm15
psubsw %xmm8, %xmm15
cmpq 0x30(%rsp), %rax
jae 0x3bda93
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa %xmm13, %xmm1
pcmpgtw %xmm15, %xmm1
pand %xmm6, %xmm1
pxor %xmm7, %xmm1
por 0x10(%r9,%rcx), %xmm1
movdqa %xmm1, 0x10(%r9,%rcx)
pmaxsw %xmm14, %xmm10
movdqa %xmm13, %xmm12
pmaxsw %xmm15, %xmm12
movdqa (%rbp,%r9), %xmm1
addq $0x10, %r9
incq %rax
cmpq %r9, %rdi
jne 0x3bd967
xorl %eax, %eax
movdqa %xmm12, %xmm14
movq %r10, %r14
movl 0x10(%rsp), %r10d
pslldq $0x2, %xmm14            # xmm14 = zero,zero,xmm14[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
pinsrw $0x0, %r10d, %xmm14
pslldq $0x2, %xmm15            # xmm15 = zero,zero,xmm15[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movl $0x8000, %ecx           # imm = 0x8000
pinsrw $0x0, %ecx, %xmm15
pslldq $0x2, %xmm12            # xmm12 = zero,zero,xmm12[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
pinsrw $0x0, %r10d, %xmm12
pslldq $0x2, %xmm13            # xmm13 = zero,zero,xmm13[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
pinsrw $0x0, %r10d, %xmm13
movq 0x28(%rsp), %rcx
movdqa (%rcx), %xmm1
pslldq $0x2, %xmm1             # xmm1 = zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
xorl %r9d, %r9d
pcmpgtw %xmm15, %xmm13
movdqa (%r15,%r9), %xmm15
movdqa %xmm15, %xmm11
pmaxsw %xmm12, %xmm11
movdqa %xmm11, (%r15,%r9)
paddsw (%rsi,%r9), %xmm1
pmaxsw %xmm0, %xmm1
pcmpeqw %xmm11, %xmm1
pcmpgtw %xmm12, %xmm15
por %xmm1, %xmm15
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa (%r9,%rcx), %xmm1
pand 0x26e036(%rip), %xmm1   # 0x62bb90
movdqa %xmm8, %xmm4
movdqa (%r13,%r9), %xmm8
pand %xmm15, %xmm8
pandn %xmm2, %xmm15
por %xmm8, %xmm15
movdqa %xmm15, (%r13,%r9)
por %xmm1, %xmm15
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa %xmm15, (%r9,%rcx)
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
pand %xmm6, %xmm13
movdqa (%r9,%rcx), %xmm1
pand %xmm9, %xmm1
por %xmm13, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, (%r9,%rcx)
movdqa %xmm11, %xmm13
psubsw 0x90(%rsp), %xmm13
movdqa (%r14,%r9), %xmm1
psubsw %xmm4, %xmm1
movdqa %xmm13, %xmm8
pmaxsw %xmm1, %xmm8
movdqa %xmm8, (%r12,%r9)
cmpq %rdx, %r11
jae 0x3bdc12
movdqa %xmm13, %xmm8
pcmpgtw %xmm1, %xmm8
pand 0x26dc05(%rip), %xmm8   # 0x62b800
pxor %xmm5, %xmm8
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq 0x40(%rsp), %rcx
movdqa %xmm8, (%r9,%rcx)
pmaxsw %xmm11, %xmm10
movdqa 0x80(%rsp), %xmm8
psubsw %xmm8, %xmm12
movdqa %xmm13, %xmm1
pcmpgtw %xmm12, %xmm1
pmovmskb %xmm1, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x3bdc6f
movdqa %xmm14, %xmm15
psubsw %xmm8, %xmm15
movdqa %xmm13, %xmm14
pmaxsw %xmm15, %xmm14
movdqa (%rbp,%r9), %xmm1
addq $0x10, %r9
cmpq %r9, %rdi
jne 0x3bdb0e
incl %eax
cmpl $0x8, %eax
jne 0x3bdac8
movdqa %xmm10, %xmm1
movdqa 0x70(%rsp), %xmm4
pcmpgtw %xmm4, %xmm1
pmovmskb %xmm1, %eax
testl %eax, %eax
je 0x3bdce0
movdqa %xmm10, %xmm1
psrldq $0x8, %xmm1             # xmm1 = xmm1[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
pmaxsw %xmm10, %xmm1
movdqa %xmm1, %xmm8
psrldq $0x4, %xmm8             # xmm8 = xmm8[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
pmaxsw %xmm1, %xmm8
movdqa %xmm8, %xmm1
psrldq $0x2, %xmm1             # xmm1 = xmm1[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
pmaxsw %xmm8, %xmm1
movd %xmm1, %eax
movl %eax, 0xc(%rsp)
cwtl
cmpl %eax, 0x5c(%rsp)
jl 0x3bdcf6
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm1, %xmm4      # xmm4 = xmm1[0,0,0,0]
movq 0x18(%rsp), %rax
movl %eax, 0x14(%rsp)
movdqa 0x80(%rsp), %xmm8
addq %rdi, 0x40(%rsp)
addq %rdi, %r8
movq %r12, %r10
cmpq %rdx, %r11
jne 0x3bd8bf
jmp 0x3bdd04
orb $0x40, 0xc(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x50(%rsp)
movzwl 0xc(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jne 0x3bdd14
orb $0x40, 0xc(%rbx)
movq %rbx, %rdi
callq 0x20be2e
xorl %ecx, %ecx
testl %eax, %eax
je 0x3bdd31
movq 0x20(%rsp), %rdi
xorl %r8d, %r8d
xorl %esi, %esi
jmp 0x3bdeed
movq 0x50(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movl 0x14(%rsp), %r8d
cmpl %ecx, %r8d
movq 0x20(%rsp), %rcx
movq %rcx, %rdi
cmoveq %rbp, %rdi
movq %rbp, %rdx
cmoveq %rcx, %rdx
cmpl %eax, %r8d
cmoveq %r15, %rdi
cmoveq %rbp, %rdx
movq %rdx, %rbp
cmoveq %rcx, %r15
movq 0xa0(%rsp), %rsi
decl %esi
movq 0xa8(%rsp), %rdx
testl $0x7ffffff8, %edx       # imm = 0x7FFFFFF8
je 0x3bdec7
andl $0x7ffffff8, %edx       # imm = 0x7FFFFFF8
movl 0xc(%rsp), %r9d
je 0x3bdece
movd %esi, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movd %r9d, %xmm1
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
movd 0x30(%rsp), %xmm2
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
movdqa 0x26bd12(%rip), %xmm3   # 0x629ad0
xorl %eax, %eax
movdqa 0x26bdd8(%rip), %xmm4   # 0x629ba0
pshufd $0xf5, %xmm2, %xmm5     # xmm5 = xmm2[1,1,3,3]
movdqa 0x26bd1b(%rip), %xmm6   # 0x629af0
movq (%rdi,%rax,2), %xmm7
pcmpeqw %xmm1, %xmm7
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
movdqa %xmm3, %xmm8
psrld $0x3, %xmm8
movdqa %xmm3, %xmm9
pand %xmm4, %xmm9
pshufd $0xf5, %xmm9, %xmm10    # xmm10 = xmm9[1,1,3,3]
pmuludq %xmm2, %xmm9
pshufd $0xe8, %xmm9, %xmm9     # xmm9 = xmm9[0,2,2,3]
pmuludq %xmm5, %xmm10
pshufd $0xe8, %xmm10, %xmm10   # xmm10 = xmm10[0,2,2,3]
punpckldq %xmm10, %xmm9   # xmm9 = xmm9[0],xmm10[0],xmm9[1],xmm10[1]
paddd %xmm8, %xmm9
movdqa %xmm0, %xmm8
pcmpgtd %xmm9, %xmm8
pand %xmm8, %xmm9
pandn %xmm0, %xmm8
por %xmm9, %xmm8
pand %xmm7, %xmm8
pandn %xmm0, %xmm7
movdqa %xmm7, %xmm0
por %xmm8, %xmm0
addq $0x4, %rax
paddd %xmm6, %xmm3
cmpq %rax, %rdx
jne 0x3bddd5
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm0, %xmm2
pshufd $0x55, %xmm2, %xmm0     # xmm0 = xmm2[1,1,1,1]
movdqa %xmm0, %xmm1
pcmpgtd %xmm2, %xmm1
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movd %xmm1, %esi
jmp 0x3bdee9
callq 0x1bfa61
jmp 0x3bdec3
callq 0x1bfa3b
jmp 0x3bdec3
callq 0x1bfa15
jmp 0x3bdec3
callq 0x1bf9ef
jmp 0x3bdec3
callq 0x1bf9c9
jmp 0x3bdec3
callq 0x1bf9a3
jmp 0x3bdec3
callq 0x1bf97d
jmp 0x3bdec3
callq 0x1bf957
xorl %eax, %eax
jmp 0x3bdf30
movl 0xc(%rsp), %r9d
jmp 0x3bdee9
xorl %eax, %eax
movl %eax, %ecx
shrl $0x3, %ecx
cmpl %esi, %ecx
cmovgel %esi, %ecx
cmpw %r9w, (%rdi,%rax,2)
cmovel %ecx, %esi
incq %rax
cmpl %eax, %edx
jne 0x3bded0
movswl %r9w, %ecx
movl %ecx, (%rbx)
movl %esi, 0x4(%rbx)
movl %r8d, 0x8(%rbx)
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq 0x38(%rsp), %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop