// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_trace_striped_sse41_128_8.c
// Function: parasail_nw_trace_striped_profile_sse41_128_8
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 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;
    __m128i* restrict pvEaStore = NULL;
    __m128i* restrict pvEaLoad = NULL;
    __m128i* restrict pvHT = NULL;
    int8_t* restrict boundary = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int8_t NEG_LIMIT = 0;
    int8_t POS_LIMIT = 0;
    int8_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    parasail_result_t *result = NULL;
    __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->profile8.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 = (__m128i*)profile->profile8.score;
    vGapO = _mm_set1_epi8(open);
    vGapE = _mm_set1_epi8(gap);
    NEG_LIMIT = (-open < matrix->min ? INT8_MIN + open : INT8_MIN - matrix->min) + 1;
    POS_LIMIT = INT8_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi8(NEG_LIMIT);
    vPosLimit = _mm_set1_epi8(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vTIns  = _mm_set1_epi8(PARASAIL_INS);
    vTDel  = _mm_set1_epi8(PARASAIL_DEL);
    vTDiag = _mm_set1_epi8(PARASAIL_DIAG);
    vTDiagE = _mm_set1_epi8(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi8(PARASAIL_INS_E);
    vTDiagF = _mm_set1_epi8(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi8(PARASAIL_DEL_F);
    vTMask = _mm_set1_epi8(PARASAIL_ZERO_MASK);
    vFTMask = _mm_set1_epi8(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_NW | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_8 | PARASAIL_FLAG_LANES_16;

    /* 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);
    boundary = parasail_memalign_int8_t(16, s2Len+1);

    /* 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 (!boundary) return NULL;

    /* initialize H and E */
    {
        int32_t index = 0;
        for (i=0; i<segLen; ++i) {
            int32_t segNum = 0;
            __m128i_8_t h;
            __m128i_8_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = -open-gap*(segNum*segLen+i);
                h.v[segNum] = tmp < INT8_MIN ? INT8_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT8_MIN ? INT8_MIN : tmp;
            }
            _mm_store_si128(&pvHStore[index], h.m);
            _mm_store_si128(&pvE[index], e.m);
            _mm_store_si128(&pvEaStore[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 < INT8_MIN ? INT8_MIN : tmp;
        }
    }

    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 -inf.  Any errors to vH values will be
         * corrected in the Lazy_F loop.  */
        vF = vNegLimit;

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

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

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

        /* 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_epi8(vH, _mm_load_si128(vP + i));
            vH = _mm_max_epi8(vH_dag, vE);
            vH = _mm_max_epi8(vH, vF);
            /* Save vH values. */
            _mm_store_si128(pvHStore + i, vH);
            vSaturationCheckMax = _mm_max_epi8(vSaturationCheckMax, vH);
            vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vE);
            vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vF);

            {
                __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                __m128i case1 = _mm_cmpeq_epi8(vH, vH_dag);
                __m128i case2 = _mm_cmpeq_epi8(vH, vF);
                __m128i vT = _mm_blendv_epi8(
                        _mm_blendv_epi8(vTIns, vTDel, case2),
                        vTDiag, case1);
                _mm_store_si128(pvHT + i, vT);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i, segLen, j);
            }

            vEF_opn = _mm_subs_epi8(vH, vGapO);

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

            /* Update vF value. */
            vF_ext = _mm_subs_epi8(vF, vGapE);
            vF = _mm_max_epi8(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m128i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m128i cond = _mm_cmpgt_epi8(vEF_opn, vF_ext);
                __m128i vT = _mm_blendv_epi8(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) {
            int64_t tmp = boundary[j+1]-open;
            int8_t tmp2 = tmp < INT8_MIN ? INT8_MIN : tmp;
            __m128i vHp = _mm_load_si128(&pvHLoad[segLen - 1]);
            vHp = _mm_slli_si128(vHp, 1);
            vHp = _mm_insert_epi8(vHp, boundary[j], 0);
            vEF_opn = _mm_slli_si128(vEF_opn, 1);
            vEF_opn = _mm_insert_epi8(vEF_opn, tmp2, 0);
            vF_ext = _mm_slli_si128(vF_ext, 1);
            vF_ext = _mm_insert_epi8(vF_ext, NEG_LIMIT, 0);
            vF = _mm_slli_si128(vF, 1);
            vF = _mm_insert_epi8(vF, tmp2, 0);
            vFa_ext = _mm_slli_si128(vFa_ext, 1);
            vFa_ext = _mm_insert_epi8(vFa_ext, NEG_LIMIT, 0);
            vFa = _mm_slli_si128(vFa, 1);
            vFa = _mm_insert_epi8(vFa, tmp2, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm_load_si128(pvHStore + i);
                vH = _mm_max_epi8(vH,vF);
                _mm_store_si128(pvHStore + i, vH);
                vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vH);
                vSaturationCheckMax = _mm_max_epi8(vSaturationCheckMax, vH);
                {
                    __m128i vTAll;
                    __m128i vT;
                    __m128i case1;
                    __m128i case2;
                    __m128i cond;
                    vHp = _mm_adds_epi8(vHp, _mm_load_si128(vP + i));
                    case1 = _mm_cmpeq_epi8(vH, vHp);
                    case2 = _mm_cmpeq_epi8(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(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);
                }
                /* Update vF value. */
                {
                    __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m128i cond = _mm_cmpgt_epi8(vEF_opn, vFa_ext);
                    __m128i vT = _mm_blendv_epi8(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_epi8(vH, vGapO);
                vF_ext = _mm_subs_epi8(vF, vGapE);
                {
                    __m128i vEa = _mm_load_si128(pvEaLoad + i);
                    __m128i vEa_ext = _mm_subs_epi8(vEa, vGapE);
                    vEa = _mm_max_epi8(vEF_opn, vEa_ext);
                    _mm_store_si128(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m128i cond = _mm_cmpgt_epi8(vEF_opn, vEa_ext);
                        __m128i vT = _mm_blendv_epi8(vTInsE, vTDiagE, cond);
                        arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                    }
                }
                if (! _mm_movemask_epi8(
                            _mm_or_si128(
                                _mm_cmpgt_epi8(vF_ext, vEF_opn),
                                _mm_cmpeq_epi8(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm_max_epi8(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm_subs_epi8(vFa, vGapE);
                vFa = _mm_max_epi8(vEF_opn, vFa_ext);
                vHp = _mm_load_si128(pvHLoad + i);
            }
        }
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, 1);
        }
        score = (int8_t) _mm_extract_epi8 (vH, 15);
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi8(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi8(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(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 $0xd8, %rsp
movl %ecx, 0x10(%rsp)
movq %rsi, 0x78(%rsp)
testq %rdi, %rdi
je 0x4aac25
movq 0x18(%rdi), %rax
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0x4aac2c
movq 0x10(%rdi), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x4aac33
movl 0x8(%rdi), %r15d
testl %r15d, %r15d
jle 0x4aac3a
cmpq $0x0, 0x78(%rsp)
je 0x4aac41
movl %r8d, %r13d
movl %edx, %r8d
testl %edx, %edx
jle 0x4aac48
cmpl $0x0, 0x10(%rsp)
js 0x4aac4f
testl %r13d, %r13d
js 0x4aac56
leal -0x1(%r15), %ebp
addq $0xf, %r15
shrq $0x4, %r15
movl %ebp, %eax
xorl %edx, %edx
divl %r15d
movl %eax, %r14d
movl %edx, %r12d
movl 0x10(%rsp), %edx
movl %edx, %edi
negl %edi
movq 0x70(%rsp), %rsi
movl 0x20(%rsi), %eax
movl %eax, %ecx
negb %cl
movl %edi, 0xc(%rsp)
cmpl %edi, %eax
movzbl %cl, %eax
cmovgl %edx, %eax
movl %eax, 0x14(%rsp)
movb $0x7e, %al
subb 0x1c(%rsi), %al
movb %al, 0x48(%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movl %r15d, %edi
movq %r8, 0x18(%rsp)
movl %r8d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x4aac5b
movq %rax, %rbx
movq %r13, 0x40(%rsp)
movl %r12d, 0x6c(%rsp)
movl %r14d, 0x34(%rsp)
movl %ebp, 0x68(%rsp)
orl $0x10180801, 0xc(%rax)  # imm = 0x10180801
movl $0x10, %edi
movq %r15, %rsi
callq 0x2f600c
movq %rax, 0x28(%rsp)
movl $0x10, %edi
movq %r15, %rsi
callq 0x2f600c
movq %rax, 0x20(%rsp)
movl $0x10, %edi
movq %r15, %rsi
callq 0x2f600c
movq %rax, %r12
movl $0x10, %edi
movq %r15, %rsi
callq 0x2f600c
movq %rax, %r13
movl $0x10, %edi
movq %r15, %rsi
callq 0x2f600c
movq %rax, %rbp
movl $0x10, %edi
movq %r15, %rsi
callq 0x2f600c
movq %rax, %r14
movq 0x18(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x10, %edi
callq 0x20a620
cmpq $0x0, 0x28(%rsp)
sete %dl
cmpq $0x0, 0x20(%rsp)
sete %cl
orb %dl, %cl
movq %r12, 0x58(%rsp)
testq %r12, %r12
sete %sil
movq %r13, 0x38(%rsp)
testq %r13, %r13
sete %dl
orb %sil, %dl
orb %cl, %dl
testq %rbp, %rbp
sete %sil
testq %r14, %r14
sete %cl
orb %sil, %cl
testq %rax, %rax
sete %sil
orb %cl, %sil
orb %dl, %sil
testb $0x1, %sil
jne 0x4aac5b
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %r13
leal -0x1(%r13), %eax
movl %eax, 0x30(%rsp)
movl $0xf, %eax
subl 0x34(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x10(%rsp), %ecx
movd %ecx, %xmm4
pxor %xmm1, %xmm1
pshufb %xmm1, %xmm4
movq 0x40(%rsp), %r12
movd %r12d, %xmm0
movdqa %xmm0, %xmm5
pshufb %xmm1, %xmm5
movl 0x14(%rsp), %eax
addb $-0x7f, %al
movzbl %al, %eax
movl %eax, 0x14(%rsp)
movd %eax, %xmm2
pshufb %xmm1, %xmm2
movdqa %xmm2, 0x80(%rsp)
movzbl 0x48(%rsp), %eax
movd %eax, %xmm2
pshufb %xmm1, %xmm2
movdqa %xmm2, 0xa0(%rsp)
movl %ecx, %eax
movl %r12d, %ecx
movslq 0xc(%rsp), %rdx
negq %rax
movq %r15, %rsi
imulq %rcx, %rsi
xorl %edi, %edi
movq $-0x80, %r8
movq %rdx, %r9
xorl %r10d, %r10d
cmpq $-0x7f, %r9
movq $-0x80, %r11
cmovgeq %r9, %r11
movb %r11b, 0xc0(%rsp,%r10)
leaq (%rax,%r9), %r11
cmpq $-0x7f, %r11
cmovlq %r8, %r11
movb %r11b, 0xb0(%rsp,%r10)
incq %r10
subq %rsi, %r9
cmpq $0x10, %r10
jne 0x4aa25e
movq %rdi, %r9
shlq $0x4, %r9
movaps 0xc0(%rsp), %xmm1
movq 0x28(%rsp), %r10
movaps %xmm1, (%r10,%r9)
movdqa 0xb0(%rsp), %xmm1
movq 0x58(%rsp), %r10
movdqa %xmm1, (%r10,%r9)
movq 0x38(%rsp), %r10
movdqa %xmm1, (%r10,%r9)
incq %rdi
subq %rcx, %rdx
cmpq %r15, %rdi
jne 0x4aa258
movq 0x50(%rsp), %rdi
movb $0x0, (%rdi)
movl %r13d, %eax
addl $0xf, %r13d
andl $-0x10, %r13d
movq %rax, 0x18(%rsp)
decq %rax
movq %rax, %xmm1
pshufd $0x44, %xmm1, %xmm11    # xmm11 = xmm1[0,1,0,1]
movd 0xc(%rsp), %xmm1
pshufd $0x0, %xmm0, %xmm6      # xmm6 = xmm0[0,0,0,0]
movl %r12d, %r8d
negl %r8d
movl %r12d, %r9d
shll $0x4, %r9d
leal (%r12,%r12,2), %r10d
addl %r12d, %r12d
xorl %r11d, %r11d
movdqa 0x181967(%rip), %xmm15  # 0x62bc90
pcmpeqd %xmm3, %xmm3
pmovsxbd 0x181f4f(%rip), %xmm9   # 0x62c286
xorl %ecx, %ecx
pmovsxbd 0x181aca(%rip), %xmm2   # 0x62be0c
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm7     # xmm7 = xmm0[0,1,0,1]
movdqa %xmm7, %xmm14
por 0x17eb36(%rip), %xmm14  # 0x628e90
movdqa %xmm11, %xmm0
pxor %xmm15, %xmm0
pxor %xmm15, %xmm14
pcmpgtq %xmm0, %xmm14
pshuflw $0xe8, %xmm14, %xmm10   # xmm10 = xmm14[0,2,2,3,4,5,6,7]
pxor %xmm3, %xmm10
packssdw %xmm10, %xmm10
leal (%r12,%r11), %eax
leal (%r10,%r11), %edx
movdqa %xmm1, %xmm12
pinsrd $0x1, %r8d, %xmm12
pshufd $0x4, %xmm12, %xmm13    # xmm13 = xmm12[0,1,0,0]
movd %r11d, %xmm8
pinsrd $0x1, 0x10(%rsp), %xmm8
pinsrd $0x2, %eax, %xmm8
pinsrd $0x3, %edx, %xmm8
psubd %xmm8, %xmm13
pmaxsd %xmm2, %xmm13
movd %xmm10, %eax
testb $0x1, %al
je 0x4aa3d2
pextrb $0x0, %xmm13, 0x1(%rdi,%rcx)
packssdw %xmm14, %xmm14
pxor %xmm3, %xmm14
packssdw %xmm14, %xmm14
packsswb %xmm14, %xmm14
pextrb $0x1, %xmm14, %eax
testb $0x1, %al
je 0x4aa3fa
pextrb $0x4, %xmm13, 0x2(%rdi,%rcx)
movdqa %xmm7, %xmm10
por 0x17ea78(%rip), %xmm10  # 0x628e80
pxor %xmm15, %xmm10
pcmpgtq %xmm0, %xmm10
packssdw %xmm10, %xmm8
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0x2, %xmm8, %eax
testb $0x1, %al
je 0x4aa43b
pextrb $0x8, %xmm13, 0x3(%rdi,%rcx)
pshufhw $0x84, %xmm10, %xmm8    # xmm8 = xmm10[0,1,2,3,4,5,4,6]
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0x3, %xmm8, %eax
testb $0x1, %al
je 0x4aa464
pextrb $0xc, %xmm13, 0x4(%rdi,%rcx)
movdqa %xmm7, %xmm10
por 0x17ea5e(%rip), %xmm10  # 0x628ed0
movd %ecx, %xmm8
pshufd $0x0, %xmm8, %xmm13     # xmm13 = xmm8[0,0,0,0]
movdqa %xmm13, %xmm8
por 0x17f675(%rip), %xmm8   # 0x629b00
pmulld %xmm6, %xmm8
pshufd $0x0, %xmm12, %xmm14    # xmm14 = xmm12[0,0,0,0]
movdqa %xmm14, %xmm12
psubd %xmm8, %xmm12
pmaxsd %xmm2, %xmm12
pxor %xmm15, %xmm10
pcmpgtq %xmm0, %xmm10
pshuflw $0xe8, %xmm10, %xmm8    # xmm8 = xmm10[0,2,2,3,4,5,6,7]
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0x4, %xmm8, %eax
testb $0x1, %al
je 0x4aa4db
pextrb $0x0, %xmm12, 0x5(%rdi,%rcx)
packssdw %xmm10, %xmm10
pxor %xmm3, %xmm10
packssdw %xmm10, %xmm8
packsswb %xmm8, %xmm8
pextrb $0x5, %xmm8, %eax
testb $0x1, %al
je 0x4aa503
pextrb $0x4, %xmm12, 0x6(%rdi,%rcx)
movdqa %xmm7, %xmm10
por 0x17e9af(%rip), %xmm10  # 0x628ec0
pxor %xmm15, %xmm10
pcmpgtq %xmm0, %xmm10
packssdw %xmm10, %xmm8
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0x6, %xmm8, %eax
testb $0x1, %al
je 0x4aa544
pextrb $0x8, %xmm12, 0x7(%rdi,%rcx)
pshufhw $0x84, %xmm10, %xmm8    # xmm8 = xmm10[0,1,2,3,4,5,4,6]
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0x7, %xmm8, %eax
testb $0x1, %al
je 0x4aa56d
pextrb $0xc, %xmm12, 0x8(%rdi,%rcx)
movdqa %xmm7, %xmm10
por 0x17f665(%rip), %xmm10  # 0x629be0
movdqa %xmm13, %xmm8
por 0x17f667(%rip), %xmm8   # 0x629bf0
pmulld %xmm6, %xmm8
movdqa %xmm14, %xmm12
psubd %xmm8, %xmm12
pmaxsd %xmm2, %xmm12
pxor %xmm15, %xmm10
pcmpgtq %xmm0, %xmm10
pshuflw $0xe8, %xmm10, %xmm8    # xmm8 = xmm10[0,2,2,3,4,5,6,7]
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0x8, %xmm8, %eax
testb $0x1, %al
je 0x4aa5d3
pextrb $0x0, %xmm12, 0x9(%rdi,%rcx)
packssdw %xmm10, %xmm10
pxor %xmm3, %xmm10
packssdw %xmm10, %xmm10
packsswb %xmm10, %xmm8
pextrb $0x9, %xmm8, %eax
testb $0x1, %al
je 0x4aa5fb
pextrb $0x4, %xmm12, 0xa(%rdi,%rcx)
movdqa %xmm7, %xmm10
por 0x17f5c7(%rip), %xmm10  # 0x629bd0
pxor %xmm15, %xmm10
pcmpgtq %xmm0, %xmm10
packssdw %xmm10, %xmm8
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0xa, %xmm8, %eax
testb $0x1, %al
je 0x4aa63c
pextrb $0x8, %xmm12, 0xb(%rdi,%rcx)
pshufhw $0x84, %xmm10, %xmm8    # xmm8 = xmm10[0,1,2,3,4,5,4,6]
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0xb, %xmm8, %eax
testb $0x1, %al
je 0x4aa665
pextrb $0xc, %xmm12, 0xc(%rdi,%rcx)
movdqa %xmm7, %xmm10
por 0x17f54d(%rip), %xmm10  # 0x629bc0
por %xmm9, %xmm13
pmulld %xmm6, %xmm13
psubd %xmm13, %xmm14
pmaxsd %xmm2, %xmm14
pxor %xmm15, %xmm10
pcmpgtq %xmm0, %xmm10
pshuflw $0xe8, %xmm10, %xmm8    # xmm8 = xmm10[0,2,2,3,4,5,6,7]
pxor %xmm3, %xmm8
packssdw %xmm8, %xmm8
packsswb %xmm8, %xmm8
pextrb $0xc, %xmm8, %eax
testb $0x1, %al
je 0x4aa6bd
pextrb $0x0, %xmm14, 0xd(%rdi,%rcx)
packssdw %xmm10, %xmm10
pxor %xmm3, %xmm10
packssdw %xmm10, %xmm8
packsswb %xmm8, %xmm8
pextrb $0xd, %xmm8, %eax
testb $0x1, %al
je 0x4aa6e5
pextrb $0x4, %xmm14, 0xe(%rdi,%rcx)
por 0x17f4c3(%rip), %xmm7   # 0x629bb0
pxor %xmm15, %xmm7
pcmpgtq %xmm0, %xmm7
packssdw %xmm7, %xmm0
pxor %xmm3, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrb $0xe, %xmm0, %eax
testb $0x1, %al
je 0x4aa71a
pextrb $0x8, %xmm14, 0xf(%rdi,%rcx)
pshufhw $0x84, %xmm7, %xmm0     # xmm0 = xmm7[0,1,2,3,4,5,4,6]
pxor %xmm3, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrb $0xf, %xmm0, %eax
testb $0x1, %al
je 0x4aa73e
pextrb $0xc, %xmm14, 0x10(%rdi,%rcx)
addq $0x10, %rcx
subl %r9d, %r8d
addl %r9d, %r11d
cmpq %rcx, %r13
jne 0x4aa342
movq %r15, %r8
shlq $0x4, %r8
xorl %eax, %eax
movdqa 0x11fa4e(%rip), %xmm0   # 0x5ca1b0
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
movdqa %xmm0, (%rcx,%rax)
addq $0x10, %rax
cmpq %rax, %r8
jne 0x4aa762
leal -0x1(%r15), %eax
xorl %r10d, %r10d
shlq $0x4, %rax
movq %rax, 0x48(%rsp)
movq %r15, %r12
movl %r15d, %eax
movq %rax, 0x40(%rsp)
movdqa 0x11f9e5(%rip), %xmm9   # 0x5ca180
movdqa 0x11f9fc(%rip), %xmm10  # 0x5ca1a0
movdqa 0x11fa13(%rip), %xmm11  # 0x5ca1c0
movdqa 0x11fa2a(%rip), %xmm15  # 0x5ca1e0
movdqa 0x11fa11(%rip), %xmm13  # 0x5ca1d0
movq %r8, %rdx
xorl %esi, %esi
movdqa 0xa0(%rsp), %xmm8
movdqa 0x80(%rsp), %xmm7
movq 0x28(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rbp, %r15
movq %rcx, %rbp
movq 0x20(%rsp), %r13
movq %rsi, %r11
movq 0x48(%rsp), %rcx
leaq (%rax,%rcx), %rsi
movq %rsi, 0x38(%rsp)
movq %rax, 0x20(%rsp)
movdqa (%rax,%rcx), %xmm0
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, (%rdi,%r11), %xmm0
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x78(%rsp), %rax
movzbl (%rax,%r11), %esi
movslq (%rcx,%rsi,4), %r9
imulq 0x40(%rsp), %r9
shlq $0x4, %r9
addq 0x98(%rsp), %r9
movq %r11, 0x28(%rsp)
leaq 0x1(%r11), %rsi
movl $0x1, %r11d
xorl %ecx, %ecx
movdqa 0x80(%rsp), %xmm1
movq %rbp, %rdi
movq 0x58(%rsp), %rbp
movdqa (%rbp,%rcx), %xmm3
paddsb (%r9,%rcx), %xmm0
movdqa %xmm0, %xmm2
pmaxsb %xmm3, %xmm2
movdqa %xmm2, %xmm6
pmaxsb %xmm1, %xmm6
movdqa %xmm6, (%r13,%rcx)
movq 0x10(%rbx), %rax
movq (%rax), %rax
pcmpeqb %xmm6, %xmm0
pcmpgtb %xmm1, %xmm2
paddb %xmm9, %xmm2
pblendvb %xmm0, %xmm10, %xmm2
addq %r10, %rax
movdqa (%rcx,%rax), %xmm0
por %xmm2, %xmm0
movdqa %xmm2, (%r14,%rcx)
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %r10, %rax
movdqa %xmm0, (%rcx,%rax)
movdqa %xmm6, %xmm14
psubsb %xmm4, %xmm14
movdqa %xmm3, %xmm0
psubsb %xmm5, %xmm0
pmaxsb %xmm14, %xmm0
movdqa %xmm0, (%rbp,%rcx)
movq %rdi, %rbp
movdqa (%rdi,%rcx), %xmm2
psubsb %xmm5, %xmm2
movdqa %xmm14, %xmm0
pmaxsb %xmm2, %xmm0
movdqa %xmm0, (%r15,%rcx)
cmpq 0x18(%rsp), %rsi
jae 0x4aa926
movdqa %xmm14, %xmm0
pcmpgtb %xmm2, %xmm0
movdqa %xmm11, %xmm2
pblendvb %xmm0, 0x11f899(%rip), %xmm2 # 0x5ca1b0
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %rdx, %rax
movdqa %xmm2, (%rcx,%rax)
movdqa %xmm1, %xmm2
psubsb %xmm5, %xmm2
cmpq %r12, %r11
jae 0x4aa95f
movq 0x10(%rbx), %rax
movq (%rax), %rax
movdqa %xmm14, %xmm0
pcmpgtb %xmm2, %xmm0
movdqa %xmm15, %xmm12
pblendvb %xmm0, %xmm13, %xmm12
addq %r10, %rax
por 0x10(%rcx,%rax), %xmm12
movdqa %xmm12, 0x10(%rcx,%rax)
pmaxsb %xmm6, %xmm7
pminsb %xmm3, %xmm8
pminsb %xmm1, %xmm8
pminsb %xmm6, %xmm8
movdqa %xmm14, %xmm1
pmaxsb %xmm2, %xmm1
movq 0x20(%rsp), %rax
movdqa (%rax,%rcx), %xmm0
addq $0x10, %rcx
incq %r11
cmpq %rcx, %r8
jne 0x4aa857
movl $0x0, 0xc(%rsp)
movdqa %xmm1, %xmm3
movq 0x28(%rsp), %r11
movq 0x50(%rsp), %rdi
movsbl 0x1(%rdi,%r11), %eax
subl 0x10(%rsp), %eax
cmpl $-0x7f, %eax
movl $0xffffff80, %ecx       # imm = 0xFFFFFF80
cmovll %ecx, %eax
movq 0x38(%rsp), %rcx
movdqa (%rcx), %xmm6
pslldq $0x1, %xmm6             # xmm6 = zero,xmm6[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, (%rdi,%r11), %xmm6
pslldq $0x1, %xmm14            # xmm14 = zero,xmm14[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, %eax, %xmm14
pslldq $0x1, %xmm3             # xmm3 = zero,xmm3[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, %eax, %xmm3
pslldq $0x1, %xmm2             # xmm2 = zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, 0x14(%rsp), %xmm2
pslldq $0x1, %xmm1             # xmm1 = zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, %eax, %xmm1
xorl %ecx, %ecx
pcmpgtb %xmm2, %xmm14
movdqa (%r13,%rcx), %xmm0
movdqa %xmm0, %xmm2
pmaxsb %xmm3, %xmm2
movdqa %xmm2, (%r13,%rcx)
paddsb (%r9,%rcx), %xmm6
pcmpeqb %xmm2, %xmm6
pcmpgtb %xmm3, %xmm0
por %xmm6, %xmm0
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %r10, %rax
movdqa (%rcx,%rax), %xmm6
pand 0x1811be(%rip), %xmm6   # 0x62bc10
movdqa %xmm9, %xmm12
pblendvb %xmm0, (%r14,%rcx), %xmm12
movdqa %xmm12, (%r14,%rcx)
por %xmm6, %xmm12
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %r10, %rax
movdqa %xmm12, (%rcx,%rax)
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %r10, %rax
movdqa %xmm15, %xmm6
movdqa %xmm14, %xmm0
pblendvb %xmm0, %xmm13, %xmm6
movdqa (%rcx,%rax), %xmm0
pand 0x181180(%rip), %xmm0   # 0x62bc20
por %xmm6, %xmm0
movdqa %xmm0, (%rcx,%rax)
movdqa %xmm2, %xmm14
psubsb %xmm4, %xmm14
movdqa (%rbp,%rcx), %xmm6
psubsb %xmm5, %xmm6
movdqa %xmm14, %xmm0
pmaxsb %xmm6, %xmm0
movdqa %xmm0, (%r15,%rcx)
cmpq 0x18(%rsp), %rsi
jae 0x4aaafa
movdqa %xmm14, %xmm0
pcmpgtb %xmm6, %xmm0
movdqa %xmm11, %xmm6
pblendvb %xmm0, 0x11f6c5(%rip), %xmm6 # 0x5ca1b0
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %rdx, %rax
movdqa %xmm6, (%rcx,%rax)
pminsb %xmm2, %xmm8
pmaxsb %xmm2, %xmm7
psubsb %xmm5, %xmm3
movdqa %xmm14, %xmm0
pcmpgtb %xmm3, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x4aab59
movdqa %xmm1, %xmm2
psubsb %xmm5, %xmm2
movdqa %xmm14, %xmm1
pmaxsb %xmm2, %xmm1
movq 0x20(%rsp), %rax
movdqa (%rax,%rcx), %xmm6
addq $0x10, %rcx
cmpq %rcx, %r8
jne 0x4aaa0d
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
cmpl $0x10, %eax
jne 0x4aa9a6
addq %r8, %rdx
addq %r8, %r10
movq %r13, %rax
movq %r15, %rcx
cmpq 0x18(%rsp), %rsi
movq 0x50(%rsp), %rdi
jne 0x4aa7e1
movl 0x6c(%rsp), %eax
shlq $0x4, %rax
movdqa (%r13,%rax), %xmm0
cmpl $0xe, 0x34(%rsp)
jg 0x4aaba2
xorl %eax, %eax
movl 0x30(%rsp), %edx
movl 0x64(%rsp), %ecx
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
incl %eax
cmpl %ecx, %eax
jl 0x4aab95
jmp 0x4aaba6
movl 0x30(%rsp), %edx
movdqa 0x80(%rsp), %xmm1
pcmpgtb %xmm8, %xmm1
pcmpgtb 0xa0(%rsp), %xmm7
por %xmm1, %xmm7
pmovmskb %xmm7, %eax
testl %eax, %eax
je 0x4aabd5
orb $0x40, 0xc(%rbx)
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x4aabdf
pextrb $0xf, %xmm0, %eax
movl 0x68(%rsp), %ecx
movsbl %al, %eax
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
movl %edx, 0x8(%rbx)
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq 0x58(%rsp), %rdi
callq 0x20a60d
movq 0x20(%rsp), %rdi
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
jmp 0x4aac5d
callq 0x1dd707
jmp 0x4aac5b
callq 0x1dd6e1
jmp 0x4aac5b
callq 0x1dd6bb
jmp 0x4aac5b
callq 0x1dd695
jmp 0x4aac5b
callq 0x1dd66f
jmp 0x4aac5b
callq 0x1dd649
jmp 0x4aac5b
callq 0x1dd623
jmp 0x4aac5b
callq 0x1dd5fd
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop