// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_scan_sse2_128_16.c
// Function: parasail_nw_table_scan_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 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;
    int16_t* restrict boundary = NULL;
    __m128i* restrict pvHt = NULL;
    __m128i* restrict pvH = NULL;
    __m128i* restrict pvGapper = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int16_t NEG_LIMIT = 0;
    int16_t POS_LIMIT = 0;
    __m128i vZero;
    int16_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->profile16.score);
    PARASAIL_CHECK_NULL(profile->matrix);
    PARASAIL_CHECK_GT0(profile->s1Len);
    PARASAIL_CHECK_NULL(s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);

    /* initialize stack variables */
    i = 0;
    j = 0;
    k = 0;
    s1Len = profile->s1Len;
    end_query = s1Len-1;
    end_ref = s2Len-1;
    matrix = profile->matrix;
    segWidth = 8; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    pvP = (__m128i*)profile->profile16.score;
    vGapO = _mm_set1_epi16(open);
    vGapE = _mm_set1_epi16(gap);
    NEG_LIMIT = (-open < matrix->min ? INT16_MIN + open : INT16_MIN - matrix->min) + 1;
    POS_LIMIT = INT16_MAX - matrix->max - 1;
    vZero = _mm_setzero_si128();
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi16(NEG_LIMIT);
    vPosLimit = _mm_set1_epi16(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInfFront = vZero;
    vNegInfFront = _mm_insert_epi16(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm_adds_epi16(vNegInfFront,
            _mm_slli_si128(_mm_set1_epi16(-segLen*gap), 2));

    /* 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_16 | PARASAIL_FLAG_LANES_8;
#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_int16_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_16_t h;
            __m128i_16_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = -open-gap*(segNum*segLen+i);
                h.v[segNum] = tmp < INT16_MIN ? INT16_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT16_MIN ? INT16_MIN : tmp;
            }
            _mm_store_si128(&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 < INT16_MIN ? INT16_MIN : tmp;
        }
    }

    {
        __m128i vGapper = _mm_subs_epi16(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm_store_si128(pvGapper+i, vGapper);
            vGapper = _mm_subs_epi16(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, 2);
        vHp = _mm_insert_epi16(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm_subs_epi16(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_epi16(
                    _mm_subs_epi16(vE, vGapE),
                    _mm_subs_epi16(vH, vGapO));
            vHp = _mm_adds_epi16(vHp, vW);
            vF = _mm_max_epi16(vF, _mm_adds_epi16(vHt, pvGapper[i]));
            vHt = _mm_max_epi16(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, 2);
        vHt = _mm_insert_epi16(vHt, boundary[j+1], 0);
        vF = _mm_max_epi16(vF, _mm_adds_epi16(vHt, pvGapper[0]));
        for (i=0; i<segWidth-2; ++i) {
            __m128i vFt = _mm_slli_si128(vF, 2);
            vFt = _mm_adds_epi16(vFt, vSegLenXgap);
            vF = _mm_max_epi16(vF, vFt);
        }

        /* calculate final H */
        vF = _mm_slli_si128(vF, 2);
        vF = _mm_adds_epi16(vF, vNegInfFront);
        vH = _mm_max_epi16(vHt, vF);
        for (i=0; i<segLen; ++i) {
            vHt = _mm_load_si128(pvHt+i);
            vF = _mm_max_epi16(
                    _mm_subs_epi16(vF, vGapE),
                    _mm_subs_epi16(vH, vGapO));
            vH = _mm_max_epi16(vHt, vF);
            _mm_store_si128(pvH+i, vH);
            vSaturationCheckMin = _mm_min_epi16(vSaturationCheckMin, vH);
            vSaturationCheckMax = _mm_max_epi16(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
        } 


#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, 2);
            }
            result->rowcols->score_row[j] = (int16_t) _mm_extract_epi16 (vH, 7);
        }
#endif
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m128i vH = _mm_load_si128(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, 2);
        }
        score = (int16_t) _mm_extract_epi16 (vH, 7);
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi16(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi16(vSaturationCheckMax, vPosLimit)))) {
        result->flag |= PARASAIL_FLAG_SATURATED;
        score = 0;
        end_query = 0;
        end_ref = 0;
    }

    result->score = score;
    result->end_query = end_query;
    result->end_ref = end_ref;

    parasail_free(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 $0x118, %rsp            # imm = 0x118
movq %rsi, 0x88(%rsp)
testq %rdi, %rdi
je 0x2fbe0d
movq 0x30(%rdi), %rax
movq %rax, 0xb8(%rsp)
testq %rax, %rax
je 0x2fbe14
movq 0x10(%rdi), %rax
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x2fbe1b
movl 0x8(%rdi), %edi
testl %edi, %edi
jle 0x2fbe22
cmpq $0x0, 0x88(%rsp)
je 0x2fbe29
movl %edx, %ebx
testl %edx, %edx
jle 0x2fbe30
testl %ecx, %ecx
js 0x2fbe37
movl %r8d, %r15d
testl %r8d, %r8d
js 0x2fbe3e
leal -0x1(%rdi), %eax
addq $0x7, %rdi
movq %rdi, %r12
shrq $0x3, %r12
movl %eax, 0x18(%rsp)
xorl %edx, %edx
divl %r12d
movl %eax, 0x1c(%rsp)
movl %edx, %r14d
movl %ecx, %r13d
negl %r13d
movq 0x80(%rsp), %rdx
movl 0x20(%rdx), %eax
movl %eax, %esi
negl %esi
cmpl %r13d, %eax
movl %ecx, 0x50(%rsp)
cmovgl %ecx, %esi
movl %esi, 0x28(%rsp)
movw $0x7ffe, %ax            # imm = 0x7FFE
subw 0x1c(%rdx), %ax
movl %eax, 0x60(%rsp)
andl $0x7ffffff8, %edi       # imm = 0x7FFFFFF8
movl %ebx, %esi
callq 0x20abc2
testq %rax, %rax
je 0x2fbe43
movq %rax, %rbp
movl %r14d, 0x4c(%rsp)
orl $0x8220401, 0xc(%rax)   # imm = 0x8220401
movl $0x10, %edi
movq %r12, %rsi
callq 0x2f600c
movq %rax, %r14
movq %rbx, 0x20(%rsp)
leal 0x1(%rbx), %esi
movl $0x10, %edi
callq 0x20a625
movq %rax, 0x38(%rsp)
movl $0x10, %edi
movq %r12, %rsi
callq 0x2f600c
movq %rax, %rbx
movl $0x10, %edi
movq %r12, %rsi
callq 0x2f600c
movq %r12, %rsi
movq %rax, %r12
movl $0x10, %edi
movq %rsi, 0x8(%rsp)
callq 0x2f600c
movq 0x38(%rsp), %rcx
movq %r14, 0x78(%rsp)
movq %r14, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %rbx, %xmm1
movq %r12, (%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 %edx, %edx
testl %ecx, %ecx
jne 0x2fbe45
testq %rax, %rax
je 0x2fbe45
movq %rax, 0x30(%rsp)
movq %rbx, 0x40(%rsp)
movq 0x20(%rsp), %rax
decl %eax
movl $0x7, %ecx
subl 0x1c(%rsp), %ecx
movl %ecx, 0x48(%rsp)
movl 0x50(%rsp), %edx
movd %edx, %xmm0
movdqa %xmm0, 0x90(%rsp)
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm2      # xmm2 = xmm0[0,0,0,0]
movd %r15d, %xmm1
pshuflw $0x0, %xmm1, %xmm0      # xmm0 = xmm1[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm3      # xmm3 = xmm0[0,0,0,0]
movl 0x28(%rsp), %ecx
addl $0xffff8001, %ecx       # imm = 0xFFFF8001
movd %ecx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm4      # xmm4 = xmm0[0,0,0,0]
movd 0x60(%rsp), %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm6      # xmm6 = xmm0[0,0,0,0]
movzwl %cx, %ecx
movd %ecx, %xmm7
movq 0x8(%rsp), %rdi
movl %edi, %ecx
imull %r15d, %ecx
negl %ecx
movd %ecx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm5      # xmm5 = xmm0[0,0,0,0]
pslldq $0x2, %xmm5             # xmm5 = zero,zero,xmm5[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
paddsw %xmm7, %xmm5
movl %edx, %ecx
movl %r15d, %edx
movslq %r13d, %rsi
negq %rcx
imulq %rdx, %rdi
xorl %r8d, %r8d
movq $-0x7fff, %r9           # imm = 0x8001
movq $-0x8000, %r10          # imm = 0x8000
movq 0x78(%rsp), %rbx
movq %rsi, %r11
xorl %r14d, %r14d
cmpq %r9, %r11
movq $-0x8000, %r12          # imm = 0x8000
cmovgeq %r11, %r12
movw %r12w, 0x100(%rsp,%r14,2)
leaq (%rcx,%r11), %r12
cmpq %r9, %r12
cmovlq %r10, %r12
movw %r12w, 0xf0(%rsp,%r14,2)
incq %r14
subq %rdi, %r11
cmpq $0x8, %r14
jne 0x2fb662
movq %r8, %r11
shlq $0x4, %r11
movaps 0x100(%rsp), %xmm0
movq (%rsp), %r14
movaps %xmm0, (%r14,%r11)
movdqa 0xf0(%rsp), %xmm0
movdqa %xmm0, (%rbx,%r11)
incq %r8
subq %rdx, %rsi
movq 0x8(%rsp), %r14
cmpq %r14, %r8
jne 0x2fb65c
movdqa %xmm7, 0xc0(%rsp)
movdqa %xmm6, 0xd0(%rsp)
movdqa %xmm4, 0xe0(%rsp)
movq 0x38(%rsp), %r12
movw $0x0, (%r12)
movq 0x20(%rsp), %rdx
movl %edx, %ecx
addl $0x7, %edx
andl $-0x8, %edx
movq %rcx, 0x28(%rsp)
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm7     # xmm7 = xmm0[0,1,0,1]
movd %r13d, %xmm0
movdqa %xmm0, 0x50(%rsp)
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x60(%rsp)
pshufd $0x0, %xmm1, %xmm10     # xmm10 = xmm1[0,0,0,0]
movl %r15d, %edi
negl %edi
leal (,%r15,8), %r8d
leal (%r15,%r15,2), %r9d
negl %r9d
addl %r15d, %r15d
xorl %r10d, %r10d
movdqa 0x32d74b(%rip), %xmm15  # 0x628ea0
pxor %xmm15, %xmm7
pcmpeqd %xmm1, %xmm1
movdqa 0x32e3a9(%rip), %xmm11  # 0x629b10
movq %r10, %xmm0
pshufd $0x44, %xmm0, %xmm12    # xmm12 = xmm0[0,1,0,1]
movdqa %xmm12, %xmm0
por 0x32d711(%rip), %xmm0   # 0x628e90
pxor %xmm15, %xmm0
movdqa %xmm0, %xmm6
pcmpgtd %xmm7, %xmm6
pshufd $0xa0, %xmm6, %xmm4     # xmm4 = xmm6[0,0,2,2]
pshuflw $0xe8, %xmm4, %xmm13    # xmm13 = xmm4[0,2,2,3,4,5,6,7]
pcmpeqd %xmm7, %xmm0
pshufd $0xf5, %xmm0, %xmm14    # xmm14 = xmm0[1,1,3,3]
pshuflw $0xe8, %xmm14, %xmm9    # xmm9 = xmm14[0,2,2,3,4,5,6,7]
pand %xmm13, %xmm9
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pshuflw $0xe8, %xmm6, %xmm0     # xmm0 = xmm6[0,2,2,3,4,5,6,7]
por %xmm9, %xmm0
pxor %xmm1, %xmm0
packssdw %xmm0, %xmm0
movd %edi, %xmm9
punpckldq 0x50(%rsp), %xmm9 # xmm9 = xmm9[0],mem[0],xmm9[1],mem[1]
movd %r15d, %xmm13
movdqa 0x90(%rsp), %xmm8
punpckldq %xmm13, %xmm8   # xmm8 = xmm8[0],xmm13[0],xmm8[1],xmm13[1]
psubd %xmm8, %xmm9
leal (%r9,%r13), %ecx
movd %r13d, %xmm8
movd %ecx, %xmm13
shufps $0xd4, %xmm9, %xmm13    # xmm13 = xmm13[0,1],xmm9[1,3]
punpckldq %xmm8, %xmm9    # xmm9 = xmm9[0],xmm8[0],xmm9[1],xmm8[1]
shufps $0x21, %xmm13, %xmm9    # xmm9 = xmm9[1,0],xmm13[2,0]
movaps %xmm9, %xmm13
pcmpgtd %xmm11, %xmm13
andps %xmm13, %xmm9
pandn %xmm11, %xmm13
por %xmm9, %xmm13
movd %xmm0, %ecx
testb $0x1, %cl
je 0x2fb830
movd %xmm13, %ecx
movw %cx, 0x2(%r12,%r10,2)
pand %xmm4, %xmm14
por %xmm6, %xmm14
packssdw %xmm14, %xmm14
pxor %xmm1, %xmm14
packssdw %xmm14, %xmm14
movd %xmm14, %ecx
shrl $0x10, %ecx
testb $0x1, %cl
je 0x2fb862
pextrw $0x2, %xmm13, %ecx
movw %cx, 0x4(%r12,%r10,2)
movdqa %xmm12, %xmm4
por 0x32d611(%rip), %xmm4   # 0x628e80
pxor %xmm15, %xmm4
movdqa %xmm4, %xmm6
pcmpgtd %xmm7, %xmm6
pshufd $0xa0, %xmm6, %xmm0     # xmm0 = xmm6[0,0,2,2]
pcmpeqd %xmm7, %xmm4
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
movdqa %xmm4, %xmm8
pand %xmm0, %xmm8
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
por %xmm6, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm1, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x2, %xmm8, %ecx
testb $0x1, %cl
je 0x2fb8c4
pextrw $0x4, %xmm13, %ecx
movw %cx, 0x6(%r12,%r10,2)
pshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm4
pshufhw $0x84, %xmm6, %xmm0     # xmm0 = xmm6[0,1,2,3,4,5,4,6]
por %xmm4, %xmm0
pxor %xmm1, %xmm0
packssdw %xmm0, %xmm0
pextrw $0x3, %xmm0, %ecx
testb $0x1, %cl
je 0x2fb8f9
pextrw $0x6, %xmm13, %ecx
movw %cx, 0x8(%r12,%r10,2)
movdqa %xmm12, %xmm4
por 0x32d5ca(%rip), %xmm4   # 0x628ed0
movd %r10d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
por 0x32e1e8(%rip), %xmm0   # 0x629b00
pshufd $0xf5, %xmm0, %xmm6     # xmm6 = xmm0[1,1,3,3]
pmuludq %xmm10, %xmm0
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
pshufd $0xf5, %xmm10, %xmm8    # xmm8 = xmm10[1,1,3,3]
pmuludq %xmm6, %xmm8
pshufd $0xe8, %xmm8, %xmm6     # xmm6 = xmm8[0,2,2,3]
punpckldq %xmm6, %xmm0    # xmm0 = xmm0[0],xmm6[0],xmm0[1],xmm6[1]
movdqa 0x60(%rsp), %xmm6
psubd %xmm0, %xmm6
movdqa %xmm6, %xmm13
pcmpgtd %xmm11, %xmm13
pand %xmm13, %xmm6
pandn %xmm11, %xmm13
por %xmm6, %xmm13
pxor %xmm15, %xmm4
movdqa %xmm4, %xmm8
pcmpgtd %xmm7, %xmm8
pshufd $0xa0, %xmm8, %xmm6     # xmm6 = xmm8[0,0,2,2]
pshuflw $0xe8, %xmm6, %xmm9     # xmm9 = xmm6[0,2,2,3,4,5,6,7]
pcmpeqd %xmm7, %xmm4
pshufd $0xf5, %xmm4, %xmm0     # xmm0 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm0, %xmm14    # xmm14 = xmm0[0,2,2,3,4,5,6,7]
pand %xmm9, %xmm14
pshufd $0xf5, %xmm8, %xmm4     # xmm4 = xmm8[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm8     # xmm8 = xmm4[0,2,2,3,4,5,6,7]
por %xmm14, %xmm8
pxor %xmm1, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x4, %xmm8, %ecx
testb $0x1, %cl
je 0x2fb9bf
movd %xmm13, %ecx
movw %cx, 0xa(%r12,%r10,2)
pand %xmm6, %xmm0
por %xmm4, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm1, %xmm0
packssdw %xmm0, %xmm0
pextrw $0x5, %xmm0, %ecx
testb $0x1, %cl
je 0x2fb9e9
pextrw $0x2, %xmm13, %ecx
movw %cx, 0xc(%r12,%r10,2)
por 0x32d4ce(%rip), %xmm12  # 0x628ec0
pxor %xmm15, %xmm12
movdqa %xmm12, %xmm6
pcmpgtd %xmm7, %xmm6
pshufd $0xa0, %xmm6, %xmm0     # xmm0 = xmm6[0,0,2,2]
pcmpeqd %xmm7, %xmm12
pshufd $0xf5, %xmm12, %xmm4    # xmm4 = xmm12[1,1,3,3]
movdqa %xmm4, %xmm8
pand %xmm0, %xmm8
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
por %xmm6, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm1, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x6, %xmm8, %ecx
testb $0x1, %cl
je 0x2fba4a
pextrw $0x4, %xmm13, %ecx
movw %cx, 0xe(%r12,%r10,2)
pshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm4
pshufhw $0x84, %xmm6, %xmm0     # xmm0 = xmm6[0,1,2,3,4,5,4,6]
por %xmm4, %xmm0
pxor %xmm1, %xmm0
packssdw %xmm0, %xmm0
pextrw $0x7, %xmm0, %ecx
testb $0x1, %cl
je 0x2fba7f
pextrw $0x6, %xmm13, %ecx
movw %cx, 0x10(%r12,%r10,2)
addq $0x8, %r10
subl %r8d, %edi
subl %r8d, %r13d
addl %r8d, %r15d
cmpq %r10, %rdx
jne 0x2fb767
pxor %xmm0, %xmm0
psubsw %xmm2, %xmm0
leal -0x1(%r14), %ecx
shlq $0x4, %rcx
movq 0x30(%rsp), %rdx
addq %rcx, %rdx
movl %r14d, %esi
movdqa %xmm0, (%rdx)
psubsw %xmm3, %xmm0
addq $-0x10, %rdx
decl %esi
jg 0x2fbab0
movl %eax, 0x14(%rsp)
movq (%rsp), %rax
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq %r14, %r13
shlq $0x4, %r13
movq %r14, %rcx
movq 0x28(%rsp), %rax
imulq %rax, %rcx
leaq (,%rcx,4), %rsi
leaq (,%rax,4), %r10
leaq (,%rcx,8), %rax
leaq (%rsi,%rsi,2), %r11
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
shlq $0x4, %rcx
movq %rsi, 0x20(%rsp)
leaq (%rsi,%rsi,4), %rsi
movq %rax, 0xb0(%rsp)
leaq (%rax,%rax,2), %r8
movq $0x0, 0x50(%rsp)
movl %r14d, %eax
movq %rax, 0xa8(%rsp)
xorl %r14d, %r14d
movdqa 0xe0(%rsp), %xmm10
movdqa %xmm10, %xmm1
movdqa 0xd0(%rsp), %xmm11
movdqa %xmm11, %xmm4
movdqa 0xc0(%rsp), %xmm12
movq %r10, 0x90(%rsp)
movq 0x20(%rsp), %r10
movq 0xb0(%rsp), %r15
movq 0x60(%rsp), %rax
movdqa (%rax), %xmm8
pslldq $0x2, %xmm8             # xmm8 = zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
pinsrw $0x0, (%r12,%r14,2), %xmm8
movq 0x80(%rsp), %rdi
movq 0x10(%rdi), %rdi
movq 0x88(%rsp), %r9
movq %r14, 0x8(%rsp)
movzbl (%r9,%r14), %r14d
movslq (%rdi,%r14,4), %rdi
imulq 0xa8(%rsp), %rdi
shlq $0x4, %rdi
addq 0xb8(%rsp), %rdi
movdqa %xmm10, %xmm6
movq 0x30(%rsp), %r12
psubsw (%r12), %xmm6
xorl %r14d, %r14d
movdqa %xmm10, %xmm7
movq 0x40(%rsp), %r9
movq (%rsp), %rax
movdqa (%rax,%r14), %xmm0
movdqa (%rbx,%r14), %xmm9
paddsw (%rdi,%r14), %xmm8
paddsw (%r12,%r14), %xmm6
psubsw %xmm3, %xmm9
pmaxsw %xmm6, %xmm7
movdqa %xmm8, %xmm6
movdqa %xmm0, %xmm8
psubsw %xmm2, %xmm0
pmaxsw %xmm9, %xmm0
pmaxsw %xmm0, %xmm6
movdqa %xmm0, (%rbx,%r14)
movdqa %xmm6, (%r9,%r14)
addq $0x10, %r14
cmpq %r14, %r13
jne 0x2fbbe6
movq %r11, %rbx
pslldq $0x2, %xmm6             # xmm6 = zero,zero,xmm6[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movq 0x38(%rsp), %rax
movq 0x8(%rsp), %rdi
pinsrw $0x0, 0x2(%rax,%rdi,2), %xmm6
incq %rdi
movq %rdi, 0x8(%rsp)
movdqa (%r12), %xmm0
paddsw %xmm6, %xmm0
pmaxsw %xmm0, %xmm7
movl $0x6, %edi
movdqa %xmm7, %xmm0
pslldq $0x2, %xmm7             # xmm7 = zero,zero,xmm7[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
paddsw %xmm5, %xmm7
pmaxsw %xmm0, %xmm7
decl %edi
jne 0x2fbc67
pslldq $0x2, %xmm7             # xmm7 = zero,zero,xmm7[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
paddsw %xmm12, %xmm7
pmaxsw %xmm7, %xmm6
movq 0x50(%rsp), %rdi
xorl %r14d, %r14d
movq (%rsp), %rax
movq %rbx, %r11
psubsw %xmm3, %xmm7
psubsw %xmm2, %xmm6
pmaxsw %xmm6, %xmm7
movdqa (%r9,%r14), %xmm6
pmaxsw %xmm7, %xmm6
movdqa %xmm6, (%rax,%r14)
movq 0x10(%rbp), %r12
movq (%r12), %r12
movq %rbp, %r9
movd %xmm6, %ebp
movswl %bp, %ebp
movl %ebp, (%r12,%rdi)
pextrw $0x1, %xmm6, %ebp
addq %rdi, %r12
movswl %bp, %ebp
pextrw $0x2, %xmm6, %ebx
movl %ebp, (%r10,%r12)
movswl %bx, %ebx
pextrw $0x3, %xmm6, %ebp
movl %ebx, (%r15,%r12)
movswl %bp, %ebx
pextrw $0x4, %xmm6, %ebp
movl %ebx, (%r11,%r12)
movswl %bp, %ebx
pextrw $0x5, %xmm6, %ebp
movl %ebx, (%rcx,%r12)
movswl %bp, %ebx
pextrw $0x6, %xmm6, %ebp
movl %ebx, (%rsi,%r12)
movswl %bp, %ebx
pextrw $0x7, %xmm6, %ebp
movl %ebx, (%r8,%r12)
movswl %bp, %ebx
movq %r9, %rbp
movq 0x40(%rsp), %r9
movl %ebx, (%rdx,%r12)
pminsw %xmm6, %xmm4
pmaxsw %xmm6, %xmm1
addq $0x10, %r14
addq 0x90(%rsp), %rdi
cmpq %r14, %r13
jne 0x2fbc99
addq $0x4, 0x50(%rsp)
movq 0x8(%rsp), %r14
cmpq 0x28(%rsp), %r14
movq 0x78(%rsp), %rbx
movq 0x38(%rsp), %r12
jne 0x2fbb77
movl 0x4c(%rsp), %ecx
shlq $0x4, %rcx
movq (%rsp), %rax
movdqa (%rax,%rcx), %xmm2
cmpl $0x6, 0x1c(%rsp)
jg 0x2fbd9f
xorl %ecx, %ecx
movl 0x18(%rsp), %edx
movq 0x30(%rsp), %rdi
movl 0x14(%rsp), %eax
movl 0x48(%rsp), %esi
pslldq $0x2, %xmm2             # xmm2 = zero,zero,xmm2[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
incl %ecx
cmpl %esi, %ecx
jl 0x2fbd92
jmp 0x2fbdac
movl 0x18(%rsp), %edx
movq 0x30(%rsp), %rdi
movl 0x14(%rsp), %eax
pcmpgtw %xmm4, %xmm10
pcmpgtw %xmm11, %xmm1
por %xmm10, %xmm1
pmovmskb %xmm1, %ecx
testl %ecx, %ecx
je 0x2fbdcf
orb $0x40, 0xc(%rbp)
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
jmp 0x2fbdd4
pextrw $0x7, %xmm2, %ecx
movswl %cx, %ecx
movl %ecx, (%rbp)
movl %edx, 0x4(%rbp)
movl %eax, 0x8(%rbp)
callq 0x20a60d
movq (%rsp), %rdi
callq 0x20a60d
movq 0x40(%rsp), %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %rbx, %rdi
callq 0x20a60d
movq %rbp, %rdx
jmp 0x2fbe45
callq 0x1abe65
jmp 0x2fbe43
callq 0x1abe3f
jmp 0x2fbe43
callq 0x1abe19
jmp 0x2fbe43
callq 0x1abdf3
jmp 0x2fbe43
callq 0x1abdcd
jmp 0x2fbe43
callq 0x1abda7
jmp 0x2fbe43
callq 0x1abd81
jmp 0x2fbe43
callq 0x1abd5b
xorl %edx, %edx
movq %rdx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop