// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_trace_scan_sse41_128_8.c
// Function: parasail_nw_trace_scan_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 pvP = NULL;
    __m128i* restrict pvE = NULL;
    int8_t* restrict boundary = NULL;
    __m128i* restrict pvHt = NULL;
    __m128i* restrict pvH = NULL;
    __m128i* restrict pvGapper = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int8_t NEG_LIMIT = 0;
    int8_t POS_LIMIT = 0;
    __m128i vZero;
    int8_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vNegInfFront;
    __m128i vSegLenXgap;
    parasail_result_t *result = NULL;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;

    /* 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;
    pvP = (__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;
    vZero = _mm_setzero_si128();
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi8(NEG_LIMIT);
    vPosLimit = _mm_set1_epi8(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInfFront = vZero;
    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);
    vNegInfFront = _mm_insert_epi8(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm_adds_epi8(vNegInfFront,
            _mm_slli_si128(_mm_set1_epi8(-segLen*gap), 1));

    /* 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_SCAN
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_8 | PARASAIL_FLAG_LANES_16;

    /* initialize heap variables */
    pvE = parasail_memalign___m128i(16, segLen);
    boundary = parasail_memalign_int8_t(16, s2Len+1);
    pvHt= parasail_memalign___m128i(16, segLen);
    pvH = parasail_memalign___m128i(16, segLen);
    pvGapper = parasail_memalign___m128i(16, segLen);

    /* validate heap variables */
    if (!pvE) return NULL;
    if (!boundary) return NULL;
    if (!pvHt) return NULL;
    if (!pvH) return NULL;
    if (!pvGapper) 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(&pvH[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 = -open-gap*(i-1);
            boundary[i] = tmp < INT8_MIN ? INT8_MIN : tmp;
        }
    }

    {
        __m128i vGapper = _mm_subs_epi8(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm_store_si128(pvGapper+i, vGapper);
            vGapper = _mm_subs_epi8(vGapper, vGapE);
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vE;
        __m128i vE_ext;
        __m128i vE_opn;
        __m128i vHt;
        __m128i vF;
        __m128i vF_ext;
        __m128i vF_opn;
        __m128i vH;
        __m128i vHp;
        __m128i *pvW;
        __m128i vW;
        __m128i case1;
        __m128i case2;
        __m128i vGapper;
        __m128i vT;
        __m128i vET;
        __m128i vFT;

        /* calculate E */
        /* calculate Ht */
        /* calculate F and H first pass */
        vHp = _mm_load_si128(pvH+(segLen-1));
        vHp = _mm_slli_si128(vHp, 1);
        vHp = _mm_insert_epi8(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm_subs_epi8(vNegLimit, pvGapper[0]);
        vF = vNegLimit;
        for (i=0; i<segLen; ++i) {
            vH = _mm_load_si128(pvH+i);
            vE = _mm_load_si128(pvE+i);
            vW = _mm_load_si128(pvW+i);
            vGapper = _mm_load_si128(pvGapper+i);
            vE_opn = _mm_subs_epi8(vH, vGapO);
            vE_ext = _mm_subs_epi8(vE, vGapE);
            case1 = _mm_cmpgt_epi8(vE_opn, vE_ext);
            vET = _mm_blendv_epi8(vTInsE, vTDiagE, case1);
            arr_store(result->trace->trace_table, vET, i, segLen, j);
            vE = _mm_max_epi8(vE_opn, vE_ext);
            vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vE);
            vGapper = _mm_adds_epi8(vHt, vGapper);
            vF = _mm_max_epi8(vF, vGapper);
            vHp = _mm_adds_epi8(vHp, vW);
            vHt = _mm_max_epi8(vE, vHp);
            _mm_store_si128(pvE+i, vE);
            _mm_store_si128(pvHt+i, vHt);
            _mm_store_si128(pvH+i, vHp);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm_slli_si128(vHt, 1);
        vHt = _mm_insert_epi8(vHt, boundary[j+1], 0);
        vGapper = _mm_load_si128(pvGapper);
        vGapper = _mm_adds_epi8(vHt, vGapper);
        vF = _mm_max_epi8(vF, vGapper);
        for (i=0; i<segWidth-2; ++i) {
            __m128i vFt = _mm_slli_si128(vF, 1);
            vFt = _mm_adds_epi8(vFt, vSegLenXgap);
            vF = _mm_max_epi8(vF, vFt);
        }

        /* calculate final H */
        vF = _mm_slli_si128(vF, 1);
        vF = _mm_adds_epi8(vF, vNegInfFront);
        vH = _mm_max_epi8(vF, vHt);
        for (i=0; i<segLen; ++i) {
            vET = arr_load(result->trace->trace_table, i, segLen, j);
            vHp = _mm_load_si128(pvH+i);
            vHt = _mm_load_si128(pvHt+i);
            vF_opn = _mm_subs_epi8(vH, vGapO);
            vF_ext = _mm_subs_epi8(vF, vGapE);
            vF = _mm_max_epi8(vF_opn, vF_ext);
            case1 = _mm_cmpgt_epi8(vF_opn, vF_ext);
            vFT = _mm_blendv_epi8(vTDelF, vTDiagF, case1);
            vH = _mm_max_epi8(vHt, vF);
            case1 = _mm_cmpeq_epi8(vH, vHp);
            case2 = _mm_cmpeq_epi8(vH, vF);
            vT = _mm_blendv_epi8(
                    _mm_blendv_epi8(vTIns, vTDel, case2),
                    vTDiag, case1);
            vT = _mm_or_si128(vT, vET);
            vT = _mm_or_si128(vT, vFT);
            arr_store(result->trace->trace_table, vT, i, segLen, j);
            _mm_store_si128(pvH+i, vH);
            vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm_max_epi8(vSaturationCheckMax, vH);
        }
    }

    /* extract last value from the last column */
    {
        __m128i vH = _mm_load_si128(pvH + 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(pvGapper);
    parasail_free(pvH);
    parasail_free(pvHt);
    parasail_free(boundary);
    parasail_free(pvE);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %ecx, 0x20(%rsp)
movq %rsi, 0x70(%rsp)
testq %rdi, %rdi
je 0x497f11
movq 0x18(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x497f18
movq 0x10(%rdi), %rax
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x497f1f
movq %r8, 0x38(%rsp)
movl 0x8(%rdi), %r14d
testl %r14d, %r14d
jle 0x497f26
cmpq $0x0, 0x70(%rsp)
je 0x497f2d
movl %edx, %r12d
testl %edx, %edx
jle 0x497f34
cmpl $0x0, 0x20(%rsp)
js 0x497f3b
cmpl $0x0, 0x38(%rsp)
js 0x497f42
leal -0x1(%r14), %ebp
addq $0xf, %r14
shrq $0x4, %r14
movl %ebp, %eax
xorl %edx, %edx
divl %r14d
movl %eax, 0x14(%rsp)
movl %edx, %r15d
movl 0x20(%rsp), %esi
movl %esi, %r13d
negl %r13d
movq 0x68(%rsp), %rdx
movl 0x20(%rdx), %eax
movl %eax, %ecx
negb %cl
cmpl %r13d, %eax
movzbl %cl, %eax
cmovgl %esi, %eax
movl %eax, 0x50(%rsp)
movb $0x7e, %al
subb 0x1c(%rdx), %al
movb %al, (%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movl %r14d, %edi
movl %r12d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x497f47
movq %rax, %rbx
movl %r13d, 0x10(%rsp)
movl %r15d, 0x4c(%rsp)
movl %ebp, 0x48(%rsp)
orl $0x10180401, 0xc(%rax)  # imm = 0x10180401
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, %r15
leal 0x1(%r12), %esi
movl $0x10, %edi
callq 0x20a620
movq %r12, 0x18(%rsp)
movq %rax, %r12
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, %r13
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, %rbp
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
testq %r15, %r15
sete %cl
testq %r12, %r12
sete %dl
orb %cl, %dl
testq %r13, %r13
sete %cl
testq %rbp, %rbp
sete %sil
orb %cl, %sil
orb %dl, %sil
testq %rax, %rax
sete %cl
orb %sil, %cl
jne 0x497f47
movq 0x18(%rsp), %rcx
decl %ecx
movl %ecx, 0xc(%rsp)
movl $0xf, %ecx
subl 0x14(%rsp), %ecx
movl %ecx, 0x44(%rsp)
movl 0x20(%rsp), %esi
movd %esi, %xmm4
pxor %xmm1, %xmm1
pshufb %xmm1, %xmm4
movq 0x38(%rsp), %rdx
movd %edx, %xmm0
movdqa %xmm0, %xmm5
pshufb %xmm1, %xmm5
movl 0x50(%rsp), %ecx
addb $-0x7f, %cl
movzbl %cl, %ecx
movd %ecx, %xmm3
movdqa %xmm3, %xmm2
pshufb %xmm1, %xmm2
movdqa %xmm2, 0x50(%rsp)
movzbl (%rsp), %ecx
movd %ecx, %xmm7
pshufb %xmm1, %xmm7
movl %r14d, %ecx
imull %edx, %ecx
negb %cl
movzbl %cl, %ecx
movd %ecx, %xmm1
pshufb 0x1929e8(%rip), %xmm1   # 0x62a100
movdqa %xmm3, 0x90(%rsp)
paddsb %xmm3, %xmm1
movdqa %xmm1, 0x80(%rsp)
movl %esi, %esi
movl %edx, %edi
movslq 0x10(%rsp), %r8
negq %rsi
movq %r14, (%rsp)
movq %r14, %rcx
imulq %rdi, %rcx
xorl %r9d, %r9d
movq $-0x80, %r10
movq %r8, %r11
xorl %edx, %edx
cmpq $-0x7f, %r11
movq $-0x80, %r14
cmovgeq %r11, %r14
movb %r14b, 0xb0(%rsp,%rdx)
leaq (%rsi,%r11), %r14
cmpq $-0x7f, %r14
cmovlq %r10, %r14
movb %r14b, 0xa0(%rsp,%rdx)
incq %rdx
subq %rcx, %r11
cmpq $0x10, %rdx
jne 0x497754
movq %r9, %rdx
shlq $0x4, %rdx
movaps 0xb0(%rsp), %xmm1
movaps %xmm1, (%rbp,%rdx)
movdqa 0xa0(%rsp), %xmm1
movdqa %xmm1, (%r15,%rdx)
incq %r9
subq %rdi, %r8
cmpq (%rsp), %r9
jne 0x49774f
movb $0x0, (%r12)
movq 0x18(%rsp), %rsi
movl %esi, %ecx
addl $0xf, %esi
andl $-0x10, %esi
movq %rcx, 0x18(%rsp)
decq %rcx
movq %rcx, %xmm1
pshufd $0x44, %xmm1, %xmm3     # xmm3 = xmm1[0,1,0,1]
movd 0x10(%rsp), %xmm1
pshufd $0x0, %xmm0, %xmm8      # xmm8 = xmm0[0,0,0,0]
movq 0x38(%rsp), %r14
movl %r14d, %edi
negl %edi
movl %r14d, %r8d
shll $0x4, %r8d
leal (%r14,%r14,2), %r9d
addl %r14d, %r14d
xorl %r10d, %r10d
movdqa 0x194482(%rip), %xmm9   # 0x62bc90
pcmpeqd %xmm10, %xmm10
xorl %r11d, %r11d
pmovsxbd 0x1945ec(%rip), %xmm14  # 0x62be0c
movq %r11, %xmm0
pshufd $0x44, %xmm0, %xmm15    # xmm15 = xmm0[0,1,0,1]
movdqa %xmm15, %xmm6
por 0x191658(%rip), %xmm6   # 0x628e90
movdqa %xmm3, %xmm0
pxor %xmm9, %xmm0
pxor %xmm9, %xmm6
pcmpgtq %xmm0, %xmm6
pshuflw $0xe8, %xmm6, %xmm2     # xmm2 = xmm6[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm2
packssdw %xmm2, %xmm2
leal (%r14,%r10), %ecx
leal (%r9,%r10), %edx
movdqa %xmm1, %xmm11
pinsrd $0x1, %edi, %xmm11
pshufd $0x4, %xmm11, %xmm12    # xmm12 = xmm11[0,1,0,0]
movd %r10d, %xmm13
pinsrd $0x1, 0x20(%rsp), %xmm13
pinsrd $0x2, %ecx, %xmm13
pinsrd $0x3, %edx, %xmm13
psubd %xmm13, %xmm12
pmaxsd %xmm14, %xmm12
movd %xmm2, %ecx
testb $0x1, %cl
je 0x4978ac
pextrb $0x0, %xmm12, 0x1(%r12,%r11)
packssdw %xmm6, %xmm6
pxor %xmm10, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrb $0x1, %xmm6, %ecx
testb $0x1, %cl
je 0x4978d1
pextrb $0x4, %xmm12, 0x2(%r12,%r11)
movdqa %xmm15, %xmm2
por 0x1915a2(%rip), %xmm2   # 0x628e80
pxor %xmm9, %xmm2
pcmpgtq %xmm0, %xmm2
packssdw %xmm2, %xmm6
pxor %xmm10, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrb $0x2, %xmm6, %ecx
testb $0x1, %cl
je 0x49790d
pextrb $0x8, %xmm12, 0x3(%r12,%r11)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrb $0x3, %xmm2, %ecx
testb $0x1, %cl
je 0x497933
pextrb $0xc, %xmm12, 0x4(%r12,%r11)
movdqa %xmm15, %xmm2
por 0x191590(%rip), %xmm2   # 0x628ed0
movd %r11d, %xmm6
pshufd $0x0, %xmm6, %xmm12     # xmm12 = xmm6[0,0,0,0]
movdqa %xmm12, %xmm6
por 0x1921a8(%rip), %xmm6   # 0x629b00
pmulld %xmm8, %xmm6
pshufd $0x0, %xmm11, %xmm13    # xmm13 = xmm11[0,0,0,0]
movdqa %xmm13, %xmm11
psubd %xmm6, %xmm11
pmaxsd %xmm14, %xmm11
pxor %xmm9, %xmm2
pcmpgtq %xmm0, %xmm2
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrb $0x4, %xmm6, %ecx
testb $0x1, %cl
je 0x4979a4
pextrb $0x0, %xmm11, 0x5(%r12,%r11)
packssdw %xmm2, %xmm2
pxor %xmm10, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrb $0x5, %xmm2, %ecx
testb $0x1, %cl
je 0x4979c9
pextrb $0x4, %xmm11, 0x6(%r12,%r11)
movdqa %xmm15, %xmm2
por 0x1914ea(%rip), %xmm2   # 0x628ec0
pxor %xmm9, %xmm2
pcmpgtq %xmm0, %xmm2
packssdw %xmm2, %xmm6
pxor %xmm10, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrb $0x6, %xmm6, %ecx
testb $0x1, %cl
je 0x497a05
pextrb $0x8, %xmm11, 0x7(%r12,%r11)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrb $0x7, %xmm2, %ecx
testb $0x1, %cl
je 0x497a2b
pextrb $0xc, %xmm11, 0x8(%r12,%r11)
movdqa %xmm15, %xmm2
por 0x1921a8(%rip), %xmm2   # 0x629be0
movdqa %xmm12, %xmm6
por 0x1921ab(%rip), %xmm6   # 0x629bf0
pmulld %xmm8, %xmm6
movdqa %xmm13, %xmm11
psubd %xmm6, %xmm11
pmaxsd %xmm14, %xmm11
pxor %xmm9, %xmm2
pcmpgtq %xmm0, %xmm2
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrb $0x8, %xmm6, %ecx
testb $0x1, %cl
je 0x497a8b
pextrb $0x0, %xmm11, 0x9(%r12,%r11)
packssdw %xmm2, %xmm2
pxor %xmm10, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrb $0x9, %xmm2, %ecx
testb $0x1, %cl
je 0x497ab0
pextrb $0x4, %xmm11, 0xa(%r12,%r11)
movdqa %xmm15, %xmm2
por 0x192113(%rip), %xmm2   # 0x629bd0
pxor %xmm9, %xmm2
pcmpgtq %xmm0, %xmm2
packssdw %xmm2, %xmm6
pxor %xmm10, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrb $0xa, %xmm6, %ecx
testb $0x1, %cl
je 0x497aec
pextrb $0x8, %xmm11, 0xb(%r12,%r11)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrb $0xb, %xmm2, %ecx
testb $0x1, %cl
je 0x497b12
pextrb $0xc, %xmm11, 0xc(%r12,%r11)
movdqa %xmm15, %xmm2
por 0x1920a1(%rip), %xmm2   # 0x629bc0
por 0x1920d8(%rip), %xmm12  # 0x629c00
pmulld %xmm8, %xmm12
psubd %xmm12, %xmm13
pmaxsd %xmm14, %xmm13
pxor %xmm9, %xmm2
pcmpgtq %xmm0, %xmm2
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrb $0xc, %xmm6, %ecx
testb $0x1, %cl
je 0x497b69
pextrb $0x0, %xmm13, 0xd(%r12,%r11)
packssdw %xmm2, %xmm2
pxor %xmm10, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrb $0xd, %xmm2, %ecx
testb $0x1, %cl
je 0x497b8e
pextrb $0x4, %xmm13, 0xe(%r12,%r11)
por 0x192019(%rip), %xmm15  # 0x629bb0
pxor %xmm9, %xmm15
pcmpgtq %xmm0, %xmm15
packssdw %xmm15, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrb $0xe, %xmm0, %ecx
testb $0x1, %cl
je 0x497bc8
pextrb $0x8, %xmm13, 0xf(%r12,%r11)
pshufhw $0x84, %xmm15, %xmm0    # xmm0 = xmm15[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrb $0xf, %xmm0, %ecx
testb $0x1, %cl
je 0x497bef
pextrb $0xc, %xmm13, 0x10(%r12,%r11)
addq $0x10, %r11
subl %r8d, %edi
addl %r8d, %r10d
cmpq %r11, %rsi
jne 0x497820
pxor %xmm0, %xmm0
psubsb %xmm4, %xmm0
movq (%rsp), %rdi
leal -0x1(%rdi), %ecx
shlq $0x4, %rcx
movq %rax, %rdx
addq %rcx, %rdx
movdqa %xmm0, (%rdx)
psubsb %xmm5, %xmm0
addq $-0x10, %rdx
decl %edi
jg 0x497c1b
movq %rbp, %rdi
addq %rcx, %rdi
movq (%rsp), %rcx
movq %rcx, %r8
shlq $0x4, %r8
xorl %r9d, %r9d
movl %ecx, %r10d
movdqa 0x132575(%rip), %xmm9   # 0x5ca1c0
movdqa 0x13255c(%rip), %xmm10  # 0x5ca1b0
movdqa 0x132583(%rip), %xmm11  # 0x5ca1e0
movdqa 0x13253a(%rip), %xmm14  # 0x5ca1a0
xorl %r11d, %r11d
movdqa 0x50(%rsp), %xmm3
movdqa %xmm7, 0x20(%rsp)
movdqa %xmm7, %xmm8
movq 0x18(%rsp), %rsi
movdqa (%rdi), %xmm6
pslldq $0x1, %xmm6             # xmm6 = zero,xmm6[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, (%r12,%r11), %xmm6
movq 0x68(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x70(%rsp), %rdx
movzbl (%rdx,%r11), %edx
movslq (%rcx,%rdx,4), %r14
imulq %r10, %r14
shlq $0x4, %r14
addq 0x78(%rsp), %r14
movdqa 0x50(%rsp), %xmm15
movdqa %xmm15, %xmm1
psubsb (%rax), %xmm1
xorl %ecx, %ecx
movdqa %xmm10, %xmm13
movdqa (%rbp,%rcx), %xmm10
movdqa (%r15,%rcx), %xmm7
movdqa %xmm10, %xmm2
psubsb %xmm4, %xmm2
psubsb %xmm5, %xmm7
movdqa %xmm2, %xmm0
pcmpgtb %xmm7, %xmm0
movdqa %xmm9, %xmm12
pblendvb %xmm0, %xmm13, %xmm9
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r9, %rdx
paddsb (%rax,%rcx), %xmm1
paddsb (%r14,%rcx), %xmm6
pmaxsb %xmm1, %xmm15
movdqa %xmm9, (%rcx,%rdx)
movdqa %xmm12, %xmm9
pmaxsb %xmm2, %xmm7
pminsb %xmm7, %xmm8
movdqa %xmm7, (%r15,%rcx)
movdqa %xmm7, %xmm1
pmaxsb %xmm6, %xmm1
movdqa %xmm1, (%r13,%rcx)
movdqa %xmm6, (%rbp,%rcx)
addq $0x10, %rcx
movdqa %xmm10, %xmm6
cmpq %rcx, %r8
jne 0x497ccb
pslldq $0x1, %xmm1             # xmm1 = zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, 0x1(%r12,%r11), %xmm1
incq %r11
movdqa (%rax), %xmm0
paddsb %xmm1, %xmm0
pmaxsb %xmm0, %xmm15
movl $0xe, %ecx
movdqa 0x80(%rsp), %xmm2
movdqa %xmm15, %xmm0
pslldq $0x1, %xmm15            # xmm15 = zero,xmm15[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
paddsb %xmm2, %xmm15
pmaxsb %xmm0, %xmm15
decl %ecx
jne 0x497d84
pslldq $0x1, %xmm15            # xmm15 = zero,xmm15[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
paddsb 0x90(%rsp), %xmm15
pmaxsb %xmm15, %xmm1
xorl %r14d, %r14d
movdqa %xmm13, %xmm10
movdqa 0x13240b(%rip), %xmm12  # 0x5ca1d0
movdqa 0x1323b2(%rip), %xmm13  # 0x5ca180
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
movdqa (%r13,%r14), %xmm2
psubsb %xmm4, %xmm1
psubsb %xmm5, %xmm15
movdqa %xmm1, %xmm6
pmaxsb %xmm15, %xmm6
pcmpgtb %xmm15, %xmm1
movdqa %xmm11, %xmm7
movdqa %xmm1, %xmm0
pblendvb %xmm0, %xmm12, %xmm7
movdqa %xmm2, %xmm1
pmaxsb %xmm6, %xmm1
movdqa (%rbp,%r14), %xmm0
pcmpeqb %xmm1, %xmm0
pcmpgtb %xmm6, %xmm2
paddb %xmm13, %xmm2
pblendvb %xmm0, %xmm14, %xmm2
addq %r9, %rcx
por (%r14,%rcx), %xmm7
por %xmm2, %xmm7
movdqa %xmm7, (%r14,%rcx)
movdqa %xmm1, (%rbp,%r14)
pminsb %xmm6, %xmm8
pminsb %xmm1, %xmm8
pmaxsb %xmm1, %xmm3
addq $0x10, %r14
movdqa %xmm6, %xmm15
cmpq %r14, %r8
jne 0x497dce
addq %r8, %r9
cmpq %rsi, %r11
jne 0x497c7f
movl 0x4c(%rsp), %ecx
shlq $0x4, %rcx
movdqa (%rbp,%rcx), %xmm0
cmpl $0xe, 0x14(%rsp)
jg 0x497ea1
xorl %ecx, %ecx
movl 0xc(%rsp), %esi
movl 0x44(%rsp), %edx
movdqa 0x20(%rsp), %xmm2
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
incl %ecx
cmpl %edx, %ecx
jl 0x497e94
jmp 0x497eab
movl 0xc(%rsp), %esi
movdqa 0x20(%rsp), %xmm2
movdqa 0x50(%rsp), %xmm1
pcmpgtb %xmm8, %xmm1
pcmpgtb %xmm2, %xmm3
por %xmm1, %xmm3
pmovmskb %xmm3, %ecx
testl %ecx, %ecx
je 0x497ed2
orb $0x40, 0xc(%rbx)
xorl %ecx, %ecx
xorl %esi, %esi
xorl %edx, %edx
jmp 0x497edc
pextrb $0xf, %xmm0, %ecx
movl 0x48(%rsp), %edx
movsbl %cl, %ecx
movl %ecx, (%rbx)
movl %edx, 0x4(%rbx)
movl %esi, 0x8(%rbx)
movq %rax, %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
jmp 0x497f49
callq 0x1dafd7
jmp 0x497f47
callq 0x1dafb1
jmp 0x497f47
callq 0x1daf8b
jmp 0x497f47
callq 0x1daf65
jmp 0x497f47
callq 0x1daf3f
jmp 0x497f47
callq 0x1daf19
jmp 0x497f47
callq 0x1daef3
jmp 0x497f47
callq 0x1daecd
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop