// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_scan_sse41_128_8.c
// Function: parasail_nw_table_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;

    /* 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;
    vNegInfFront = _mm_insert_epi8(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm_adds_epi8(vNegInfFront,
            _mm_slli_si128(_mm_set1_epi8(-segLen*gap), 1));

    /* 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_NW | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_BITS_8 | PARASAIL_FLAG_LANES_16;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    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 vHt;
        __m128i vF;
        __m128i vH;
        __m128i vHp;
        __m128i *pvW;
        __m128i vW;

        /* 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);
            vE = _mm_max_epi8(
                    _mm_subs_epi8(vE, vGapE),
                    _mm_subs_epi8(vH, vGapO));
            vHp = _mm_adds_epi8(vHp, vW);
            vF = _mm_max_epi8(vF, _mm_adds_epi8(vHt, pvGapper[i]));
            vHt = _mm_max_epi8(vE, vHp);
            _mm_store_si128(pvE+i, vE);
            _mm_store_si128(pvHt+i, vHt);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm_slli_si128(vHt, 1);
        vHt = _mm_insert_epi8(vHt, boundary[j+1], 0);
        vF = _mm_max_epi8(vF, _mm_adds_epi8(vHt, pvGapper[0]));
        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(vHt, vF);
        for (i=0; i<segLen; ++i) {
            vHt = _mm_load_si128(pvHt+i);
            vF = _mm_max_epi8(
                    _mm_subs_epi8(vF, vGapE),
                    _mm_subs_epi8(vH, vGapO));
            vH = _mm_max_epi8(vHt, vF);
            _mm_store_si128(pvH+i, vH);
            vSaturationCheckMin = _mm_min_epi8(vSaturationCheckMin, vH);
            vSaturationCheckMax = _mm_max_epi8(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
        } 


#ifdef PARASAIL_ROWCOL
        /* extract last value from the column */
        {
            vH = _mm_load_si128(pvH + offset);
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 1);
            }
            result->rowcols->score_row[j] = (int8_t) _mm_extract_epi8 (vH, 15);
        }
#endif
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m128i vH = _mm_load_si128(pvH+i);
        arr_store_col(result->rowcols->score_col, vH, i, segLen);
    }
#endif

    /* 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 $0x168, %rsp            # imm = 0x168
movq %rsi, 0x98(%rsp)
testq %rdi, %rdi
je 0x403f82
movq 0x18(%rdi), %rax
movq %rax, 0x100(%rsp)
testq %rax, %rax
je 0x403f89
movq 0x10(%rdi), %rax
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0x403f90
movl 0x8(%rdi), %edi
testl %edi, %edi
jle 0x403f97
cmpq $0x0, 0x98(%rsp)
je 0x403f9e
testl %edx, %edx
jle 0x403fa5
movl %ecx, %r13d
testl %ecx, %ecx
js 0x403fac
movl %r8d, %r12d
testl %r8d, %r8d
js 0x403fb3
leal -0x1(%rdi), %eax
addq $0xf, %rdi
movq %rdi, %rbp
shrq $0x4, %rbp
movl %eax, 0xc(%rsp)
movq %rdx, %rsi
xorl %edx, %edx
divl %ebp
movl %eax, %ebx
movl %edx, %r15d
movl %r13d, %r8d
negl %r8d
movq 0x90(%rsp), %rdx
movl 0x20(%rdx), %eax
movl %eax, %ecx
negb %cl
movl %r8d, 0x10(%rsp)
cmpl %r8d, %eax
movzbl %cl, %r14d
cmovgl %r13d, %r14d
movb $0x7e, %al
subb 0x1c(%rdx), %al
movb %al, 0x58(%rsp)
andl $0x7ffffff0, %edi       # imm = 0x7FFFFFF0
movq %rsi, 0x20(%rsp)
callq 0x20abc2
testq %rax, %rax
je 0x403fb8
movl %r13d, 0x48(%rsp)
movq %r12, 0x50(%rsp)
movl %r15d, 0x74(%rsp)
movl %ebx, 0x8(%rsp)
movq %rax, 0x60(%rsp)
orl $0x10120401, 0xc(%rax)  # imm = 0x10120401
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2f600c
movq %rax, %r13
movq 0x20(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x10, %edi
callq 0x20a620
movq %rax, %r12
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2f600c
movq %rax, %r15
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2f600c
movq %rax, %rbx
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2f600c
movq %r13, 0x88(%rsp)
testq %r13, %r13
sete %dl
testq %r12, %r12
sete %cl
orb %dl, %cl
testq %r15, %r15
sete %sil
testq %rbx, %rbx
sete %dl
orb %sil, %dl
orb %cl, %dl
testq %rax, %rax
sete %cl
orb %dl, %cl
jne 0x403fb8
movq %rax, 0x80(%rsp)
movq %rbx, (%rsp)
movq %r15, 0x18(%rsp)
movq %r12, 0x38(%rsp)
movq 0x20(%rsp), %rax
movq %rax, %r13
decl %eax
movl %eax, 0x70(%rsp)
movl $0xf, %eax
subl 0x8(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x48(%rsp), %r15d
movd %r15d, %xmm2
pxor %xmm4, %xmm4
pshufb %xmm4, %xmm2
movq 0x50(%rsp), %rbx
movd %ebx, %xmm1
movdqa %xmm1, %xmm3
pshufb %xmm4, %xmm3
addb $-0x7f, %r14b
movzbl %r14b, %eax
movd %eax, %xmm7
movdqa %xmm7, %xmm0
pshufb %xmm4, %xmm0
movzbl 0x58(%rsp), %eax
movd %eax, %xmm6
pshufb %xmm4, %xmm6
movl %ebp, %eax
imull %ebx, %eax
negb %al
movzbl %al, %eax
movd %eax, %xmm5
pshufb 0x226b75(%rip), %xmm5   # 0x62a100
paddsb %xmm7, %xmm5
movl %r15d, %eax
movl %ebx, %ecx
movslq 0x10(%rsp), %rdx
negq %rax
movq %rbp, %rsi
imulq %rcx, %rsi
xorl %edi, %edi
movq $-0x80, %r8
movq 0x88(%rsp), %r14
movq %rbp, %r12
movq %rdx, %r9
xorl %r10d, %r10d
cmpq $-0x7f, %r9
movq $-0x80, %r11
cmovgeq %r9, %r11
movb %r11b, 0x150(%rsp,%r10)
leaq (%rax,%r9), %r11
cmpq $-0x7f, %r11
cmovlq %r8, %r11
movb %r11b, 0x140(%rsp,%r10)
incq %r10
subq %rsi, %r9
cmpq $0x10, %r10
jne 0x4035bd
movq %rdi, %r9
shlq $0x4, %r9
movaps 0x150(%rsp), %xmm4
movq (%rsp), %r10
movaps %xmm4, (%r10,%r9)
movdqa 0x140(%rsp), %xmm4
movdqa %xmm4, (%r14,%r9)
incq %rdi
subq %rcx, %rdx
cmpq %r12, %rdi
jne 0x4035b7
movdqa %xmm7, 0x120(%rsp)
movdqa %xmm6, 0x130(%rsp)
movq 0x38(%rsp), %rsi
movb $0x0, (%rsi)
movq %r13, %rdx
movl %edx, %eax
addl $0xf, %edx
andl $-0x10, %edx
movq %rax, 0x78(%rsp)
decq %rax
movq %rax, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
movdqa %xmm4, 0x20(%rsp)
movd 0x10(%rsp), %xmm7
pshufd $0x0, %xmm1, %xmm8      # xmm8 = xmm1[0,0,0,0]
movl %ebx, %edi
negl %edi
movl %ebx, %r8d
shll $0x4, %r8d
leal (%rbx,%rbx,2), %r9d
addl %ebx, %ebx
xorl %r10d, %r10d
movdqa 0x228604(%rip), %xmm9   # 0x62bc90
pcmpeqd %xmm10, %xmm10
xorl %r11d, %r11d
pmovsxbd 0x22876e(%rip), %xmm14  # 0x62be0c
movq %r11, %xmm1
pshufd $0x44, %xmm1, %xmm13    # xmm13 = xmm1[0,1,0,1]
movdqa %xmm13, %xmm12
por 0x2257d9(%rip), %xmm12  # 0x628e90
movdqa 0x20(%rsp), %xmm6
pxor %xmm9, %xmm6
pxor %xmm9, %xmm12
pcmpgtq %xmm6, %xmm12
pshuflw $0xe8, %xmm12, %xmm15   # xmm15 = xmm12[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm15
packssdw %xmm15, %xmm15
leal (%rbx,%r10), %eax
leal (%r9,%r10), %ecx
movdqa %xmm7, %xmm1
pinsrd $0x1, %edi, %xmm1
pshufd $0x4, %xmm1, %xmm11     # xmm11 = xmm1[0,1,0,0]
movd %r10d, %xmm4
pinsrd $0x1, %r15d, %xmm4
pinsrd $0x2, %eax, %xmm4
pinsrd $0x3, %ecx, %xmm4
psubd %xmm4, %xmm11
pmaxsd %xmm14, %xmm11
movd %xmm15, %eax
testb $0x1, %al
je 0x40372a
pextrb $0x0, %xmm11, 0x1(%rsi,%r11)
packssdw %xmm12, %xmm12
pxor %xmm10, %xmm12
packssdw %xmm12, %xmm12
packsswb %xmm12, %xmm12
pextrb $0x1, %xmm12, %eax
testb $0x1, %al
je 0x403752
pextrb $0x4, %xmm11, 0x2(%rsi,%r11)
movdqa %xmm13, %xmm12
por 0x225720(%rip), %xmm12  # 0x628e80
pxor %xmm9, %xmm12
pcmpgtq %xmm6, %xmm12
packssdw %xmm12, %xmm4
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0x2, %xmm4, %eax
testb $0x1, %al
je 0x403790
pextrb $0x8, %xmm11, 0x3(%rsi,%r11)
pshufhw $0x84, %xmm12, %xmm4    # xmm4 = xmm12[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0x3, %xmm4, %eax
testb $0x1, %al
je 0x4037b6
pextrb $0xc, %xmm11, 0x4(%rsi,%r11)
movdqa %xmm13, %xmm15
por 0x22570c(%rip), %xmm15  # 0x628ed0
movd %r11d, %xmm4
pshufd $0x0, %xmm4, %xmm11     # xmm11 = xmm4[0,0,0,0]
movdqa %xmm11, %xmm4
por 0x226324(%rip), %xmm4   # 0x629b00
pmulld %xmm8, %xmm4
pshufd $0x0, %xmm1, %xmm12     # xmm12 = xmm1[0,0,0,0]
movdqa %xmm12, %xmm1
psubd %xmm4, %xmm1
pmaxsd %xmm14, %xmm1
pxor %xmm9, %xmm15
pcmpgtq %xmm6, %xmm15
pshuflw $0xe8, %xmm15, %xmm4    # xmm4 = xmm15[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0x4, %xmm4, %eax
testb $0x1, %al
je 0x403828
pextrb $0x0, %xmm1, 0x5(%rsi,%r11)
packssdw %xmm15, %xmm15
pxor %xmm10, %xmm15
packssdw %xmm15, %xmm4
packsswb %xmm4, %xmm4
pextrb $0x5, %xmm4, %eax
testb $0x1, %al
je 0x40384e
pextrb $0x4, %xmm1, 0x6(%rsi,%r11)
movdqa %xmm13, %xmm15
por 0x225664(%rip), %xmm15  # 0x628ec0
pxor %xmm9, %xmm15
pcmpgtq %xmm6, %xmm15
packssdw %xmm15, %xmm4
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0x6, %xmm4, %eax
testb $0x1, %al
je 0x40388c
pextrb $0x8, %xmm1, 0x7(%rsi,%r11)
pshufhw $0x84, %xmm15, %xmm4    # xmm4 = xmm15[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0x7, %xmm4, %eax
testb $0x1, %al
je 0x4038b2
pextrb $0xc, %xmm1, 0x8(%rsi,%r11)
movdqa %xmm13, %xmm15
por 0x226320(%rip), %xmm15  # 0x629be0
movdqa %xmm11, %xmm4
por 0x226323(%rip), %xmm4   # 0x629bf0
pmulld %xmm8, %xmm4
movdqa %xmm12, %xmm1
psubd %xmm4, %xmm1
pmaxsd %xmm14, %xmm1
pxor %xmm9, %xmm15
pcmpgtq %xmm6, %xmm15
pshuflw $0xe8, %xmm15, %xmm4    # xmm4 = xmm15[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0x8, %xmm4, %eax
testb $0x1, %al
je 0x403913
pextrb $0x0, %xmm1, 0x9(%rsi,%r11)
packssdw %xmm15, %xmm15
pxor %xmm10, %xmm15
packssdw %xmm15, %xmm15
packsswb %xmm15, %xmm4
pextrb $0x9, %xmm4, %eax
testb $0x1, %al
je 0x40393a
pextrb $0x4, %xmm1, 0xa(%rsi,%r11)
movdqa %xmm13, %xmm15
por 0x226288(%rip), %xmm15  # 0x629bd0
pxor %xmm9, %xmm15
pcmpgtq %xmm6, %xmm15
packssdw %xmm15, %xmm4
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0xa, %xmm4, %eax
testb $0x1, %al
je 0x403978
pextrb $0x8, %xmm1, 0xb(%rsi,%r11)
pshufhw $0x84, %xmm15, %xmm4    # xmm4 = xmm15[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0xb, %xmm4, %eax
testb $0x1, %al
je 0x40399e
pextrb $0xc, %xmm1, 0xc(%rsi,%r11)
movdqa %xmm13, %xmm1
por 0x226215(%rip), %xmm1   # 0x629bc0
por 0x22624c(%rip), %xmm11  # 0x629c00
pmulld %xmm8, %xmm11
psubd %xmm11, %xmm12
pmaxsd %xmm14, %xmm12
pxor %xmm9, %xmm1
pcmpgtq %xmm6, %xmm1
pshuflw $0xe8, %xmm1, %xmm4     # xmm4 = xmm1[0,2,2,3,4,5,6,7]
pxor %xmm10, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrb $0xc, %xmm4, %eax
testb $0x1, %al
je 0x4039f4
pextrb $0x0, %xmm12, 0xd(%rsi,%r11)
packssdw %xmm1, %xmm1
pxor %xmm10, %xmm1
packssdw %xmm1, %xmm1
packsswb %xmm1, %xmm1
pextrb $0xd, %xmm1, %eax
testb $0x1, %al
je 0x403a18
pextrb $0x4, %xmm12, 0xe(%rsi,%r11)
por 0x22618f(%rip), %xmm13  # 0x629bb0
pxor %xmm9, %xmm13
pcmpgtq %xmm6, %xmm13
packssdw %xmm13, %xmm1
pxor %xmm10, %xmm1
packssdw %xmm1, %xmm1
packsswb %xmm1, %xmm1
pextrb $0xe, %xmm1, %eax
testb $0x1, %al
je 0x403a51
pextrb $0x8, %xmm12, 0xf(%rsi,%r11)
pshufhw $0x84, %xmm13, %xmm1    # xmm1 = xmm13[0,1,2,3,4,5,4,6]
pxor %xmm10, %xmm1
packssdw %xmm1, %xmm1
packsswb %xmm1, %xmm1
pextrb $0xf, %xmm1, %eax
testb $0x1, %al
je 0x403a77
pextrb $0xc, %xmm12, 0x10(%rsi,%r11)
addq $0x10, %r11
subl %r8d, %edi
addl %r8d, %r10d
cmpq %r11, %rdx
jne 0x40369e
pxor %xmm1, %xmm1
psubsb %xmm2, %xmm1
leal -0x1(%r12), %eax
shlq $0x4, %rax
movq 0x80(%rsp), %rdi
movq %rdi, %rcx
addq %rax, %rcx
movl %r12d, %edx
movdqa %xmm1, (%rcx)
psubsb %xmm3, %xmm1
addq $-0x10, %rcx
decl %edx
jg 0x403aac
movq (%rsp), %rbx
movq %rbx, %rcx
addq %rax, %rcx
movq %rcx, 0xf8(%rsp)
movq %r12, %r13
shlq $0x4, %r13
movq %r12, %r15
movq 0x78(%rsp), %rax
imulq %rax, %r15
leaq (,%r15,4), %r9
leaq (,%rax,4), %rdx
leaq (,%r15,8), %r11
leaq (%r9,%r9,2), %rax
movq %rax, 0xf0(%rsp)
leaq (%r15,%r15,8), %rax
leaq (%rax,%rax,2), %rax
addq %r15, %rax
movq %r15, %r10
imulq $0x2c, %r15, %rbp
imulq $0x34, %r15, %r8
imulq $0x38, %r15, %rcx
movq %rcx, 0xe8(%rsp)
imulq $0x3c, %r15, %rcx
movq %rcx, 0xe0(%rsp)
shlq $0x4, %r15
leaq (%r9,%r9,4), %rcx
movq %rcx, 0xd0(%rsp)
shlq $0x5, %r10
movl %r12d, %ecx
movq %rcx, 0xc8(%rsp)
movdqa %xmm0, %xmm1
movdqa 0x130(%rsp), %xmm11
movdqa %xmm11, %xmm4
leaq (%r11,%r11,2), %rcx
movq %rcx, 0xc0(%rsp)
leaq (%r9,%r9,8), %rcx
movq %rcx, 0xb8(%rsp)
leaq (%r11,%r11,4), %rcx
movq %rcx, 0xb0(%rsp)
movq %r15, 0xd8(%rsp)
leaq (%r15,%r15,2), %rcx
movq %rcx, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
xorl %r15d, %r15d
movq 0x18(%rsp), %r12
movdqa 0x120(%rsp), %xmm12
movq %rdx, 0x10(%rsp)
movq %rbp, 0x58(%rsp)
movq %r10, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movq %r11, 0x118(%rsp)
movq %rax, 0x110(%rsp)
movq %r8, 0x108(%rsp)
movq %r13, 0x20(%rsp)
movq 0xf0(%rsp), %r9
movq 0xb0(%rsp), %r8
movq 0xa8(%rsp), %r10
movq 0xf8(%rsp), %rcx
movdqa (%rcx), %xmm8
pslldq $0x1, %xmm8             # xmm8 = zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
pinsrb $0x0, (%rsi,%r15), %xmm8
movq 0x90(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x98(%rsp), %rdx
movq %r15, 0x40(%rsp)
movzbl (%rdx,%r15), %edx
movslq (%rcx,%rdx,4), %rcx
imulq 0xc8(%rsp), %rcx
shlq $0x4, %rcx
addq 0x100(%rsp), %rcx
movdqa %xmm0, %xmm6
psubsb (%rdi), %xmm6
xorl %edx, %edx
movdqa %xmm0, %xmm7
movdqa (%rbx,%rdx), %xmm9
movdqa (%r14,%rdx), %xmm10
paddsb (%rcx,%rdx), %xmm8
paddsb (%rdi,%rdx), %xmm6
psubsb %xmm3, %xmm10
pmaxsb %xmm6, %xmm7
movdqa %xmm8, %xmm6
movdqa %xmm9, %xmm8
psubsb %xmm2, %xmm9
pmaxsb %xmm10, %xmm9
pmaxsb %xmm9, %xmm6
movdqa %xmm9, (%r14,%rdx)
movdqa %xmm6, (%r12,%rdx)
addq $0x10, %rdx
cmpq %rdx, %r13
jne 0x403c64
pslldq $0x1, %xmm6             # xmm6 = zero,xmm6[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
movq 0x40(%rsp), %rax
pinsrb $0x0, 0x1(%rsi,%rax), %xmm6
incq %rax
movq %rax, 0x40(%rsp)
movdqa (%rdi), %xmm8
paddsb %xmm6, %xmm8
pmaxsb %xmm8, %xmm7
movl $0xe, %ecx
movdqa %xmm7, %xmm8
pslldq $0x1, %xmm7             # xmm7 = zero,xmm7[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
paddsb %xmm5, %xmm7
pmaxsb %xmm8, %xmm7
decl %ecx
jne 0x403ce4
pslldq $0x1, %xmm7             # xmm7 = zero,xmm7[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
paddsb %xmm12, %xmm7
pmaxsb %xmm7, %xmm6
movq 0xa0(%rsp), %r11
xorl %ecx, %ecx
movq 0xe8(%rsp), %r12
movq 0xe0(%rsp), %r13
movq 0xd8(%rsp), %rbx
movq 0xd0(%rsp), %r15
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rax
psubsb %xmm3, %xmm7
psubsb %xmm2, %xmm6
pmaxsb %xmm6, %xmm7
movq 0x18(%rsp), %rdx
movdqa (%rdx,%rcx), %xmm6
pmaxsb %xmm7, %xmm6
movq (%rsp), %rdx
movdqa %xmm6, (%rdx,%rcx)
movq 0x60(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq (%rdx), %rdx
movd %xmm6, %esi
movsbl %sil, %esi
movl %esi, (%rdx,%r11)
pextrb $0x1, %xmm6, %esi
addq %r11, %rdx
movsbl %sil, %esi
pextrb $0x2, %xmm6, %r14d
movq 0x48(%rsp), %rbp
movl %esi, (%rbp,%rdx)
movsbl %r14b, %esi
pextrb $0x3, %xmm6, %r14d
movq 0x118(%rsp), %rbp
movl %esi, (%rbp,%rdx)
movsbl %r14b, %esi
pextrb $0x4, %xmm6, %r14d
movl %esi, (%r9,%rdx)
movsbl %r14b, %esi
pextrb $0x5, %xmm6, %r14d
movl %esi, (%rbx,%rdx)
movsbl %r14b, %esi
pextrb $0x6, %xmm6, %r14d
movl %esi, (%r15,%rdx)
movsbl %r14b, %esi
pextrb $0x7, %xmm6, %r14d
movl %esi, (%rdi,%rdx)
movsbl %r14b, %esi
pextrb $0x8, %xmm6, %r14d
movq 0x110(%rsp), %rbp
movl %esi, (%rbp,%rdx)
movsbl %r14b, %esi
pextrb $0x9, %xmm6, %r14d
movq 0x50(%rsp), %rbp
movl %esi, (%rbp,%rdx)
movsbl %r14b, %esi
pextrb $0xa, %xmm6, %r14d
movl %esi, (%rax,%rdx)
movsbl %r14b, %esi
pextrb $0xb, %xmm6, %r14d
movl %esi, (%r8,%rdx)
movsbl %r14b, %esi
pextrb $0xc, %xmm6, %r14d
movq 0x58(%rsp), %rbp
movl %esi, (%rbp,%rdx)
movsbl %r14b, %esi
pextrb $0xd, %xmm6, %r14d
movl %esi, (%r10,%rdx)
movsbl %r14b, %esi
pextrb $0xe, %xmm6, %r14d
movq 0x108(%rsp), %rbp
movl %esi, (%rbp,%rdx)
movsbl %r14b, %esi
pextrb $0xf, %xmm6, %r14d
movl %esi, (%r12,%rdx)
movsbl %r14b, %esi
movl %esi, (%r13,%rdx)
movq 0x10(%rsp), %rdx
pminsb %xmm6, %xmm4
pmaxsb %xmm6, %xmm1
addq $0x10, %rcx
addq %rdx, %r11
cmpq %rcx, 0x20(%rsp)
jne 0x403d45
addq $0x4, 0xa0(%rsp)
movq 0x40(%rsp), %r15
cmpq 0x78(%rsp), %r15
movq 0x88(%rsp), %r14
movq 0x38(%rsp), %rsi
movq 0x18(%rsp), %r12
movq (%rsp), %rbx
movq 0x80(%rsp), %rdi
movq 0x20(%rsp), %r13
jne 0x403c04
movl 0x74(%rsp), %eax
shlq $0x4, %rax
movdqa (%rbx,%rax), %xmm2
cmpl $0xe, 0x8(%rsp)
movl 0x70(%rsp), %edx
jg 0x403f1b
xorl %eax, %eax
movq 0x60(%rsp), %rbx
movl 0xc(%rsp), %ecx
movl 0x6c(%rsp), %esi
pslldq $0x1, %xmm2             # xmm2 = zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
incl %eax
cmpl %esi, %eax
jl 0x403f0e
jmp 0x403f24
movq 0x60(%rsp), %rbx
movl 0xc(%rsp), %ecx
pcmpgtb %xmm4, %xmm0
pcmpgtb %xmm11, %xmm1
por %xmm0, %xmm1
pmovmskb %xmm1, %eax
testl %eax, %eax
je 0x403f45
orb $0x40, 0xc(%rbx)
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x403f4b
pextrb $0xf, %xmm2, %eax
movsbl %al, %eax
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
movl %edx, 0x8(%rbx)
callq 0x20a60d
movq (%rsp), %rdi
callq 0x20a60d
movq 0x18(%rsp), %rdi
callq 0x20a60d
movq 0x38(%rsp), %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
jmp 0x403fba
callq 0x1c9f7f
jmp 0x403fb8
callq 0x1c9f59
jmp 0x403fb8
callq 0x1c9f33
jmp 0x403fb8
callq 0x1c9f0d
jmp 0x403fb8
callq 0x1c9ee7
jmp 0x403fb8
callq 0x1c9ec1
jmp 0x403fb8
callq 0x1c9e9b
jmp 0x403fb8
callq 0x1c9e75
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop