// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sw_trace_diag_sse2_128_16.c
// Function: parasail_sw_trace_diag_sse2_128_16
parasail_result_t* FNAME(
        const char * const restrict _s1, const int _s1Len,
        const char * const restrict _s2, const int s2Len,
        const int open, const int gap, const parasail_matrix_t *matrix)
{
    /* declare local variables */
    int32_t N = 0;
    int32_t PAD = 0;
    int32_t PAD2 = 0;
    int32_t s1Len_PAD = 0;
    int32_t s2Len_PAD = 0;
    int16_t * restrict s1 = NULL;
    int16_t * restrict s2B = NULL;
    int16_t * restrict _H_pr = NULL;
    int16_t * restrict _F_pr = NULL;
    int16_t * restrict s2 = NULL;
    int16_t * restrict H_pr = NULL;
    int16_t * restrict F_pr = NULL;
    parasail_result_t *result = NULL;
    int32_t i = 0;
    int32_t j = 0;
    int32_t s1Len = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    int16_t NEG_LIMIT = 0;
    int16_t POS_LIMIT = 0;
    int16_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vNegInf;
    __m128i vNegInf0;
    __m128i vOpen;
    __m128i vGap;
    __m128i vZero;
    __m128i vOne;
    __m128i vN;
    __m128i vNegOne;
    __m128i vI;
    __m128i vJreset;
    __m128i vMaxH;
    __m128i vEndI;
    __m128i vEndJ;
    __m128i vILimit;
    __m128i vJLimit;
    __m128i vTDiag;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTZero;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;

    /* validate inputs */
    PARASAIL_CHECK_NULL(_s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);
    PARASAIL_CHECK_NULL(matrix);
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        PARASAIL_CHECK_NULL(_s1);
        PARASAIL_CHECK_GT0(_s1Len);
    }
        
    /* initialize stack variables */
    N = 8; /* number of values in vector */
    PAD = N-1;
    PAD2 = PAD*2;
    s1Len = matrix->type == PARASAIL_MATRIX_TYPE_SQUARE ? _s1Len : matrix->length;
    s1Len_PAD = s1Len+PAD;
    s2Len_PAD = s2Len+PAD;
    i = 0;
    j = 0;
    end_query = 0;
    end_ref = 0;
    NEG_LIMIT = (-open < matrix->min ? INT16_MIN + open : INT16_MIN - matrix->min) + 1;
    POS_LIMIT = INT16_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi16(NEG_LIMIT);
    vPosLimit = _mm_set1_epi16(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm_set1_epi16(NEG_LIMIT);
    vNegInf0 = _mm_srli_si128(vNegInf, 2); /* shift in a 0 */
    vOpen = _mm_set1_epi16(open);
    vGap  = _mm_set1_epi16(gap);
    vZero = _mm_set1_epi16(0);
    vOne = _mm_set1_epi16(1);
    vN = _mm_set1_epi16(N);
    vNegOne = _mm_set1_epi16(-1);
    vI = _mm_set_epi16(0,1,2,3,4,5,6,7);
    vJreset = _mm_set_epi16(0,-1,-2,-3,-4,-5,-6,-7);
    vMaxH = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm_set1_epi16(s1Len);
    vJLimit = _mm_set1_epi16(s2Len);
    vTDiag = _mm_set1_epi16(PARASAIL_DIAG);
    vTIns = _mm_set1_epi16(PARASAIL_INS);
    vTDel = _mm_set1_epi16(PARASAIL_DEL);
    vTZero = _mm_set1_epi16(PARASAIL_ZERO);
    vTDiagE = _mm_set1_epi16(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi16(PARASAIL_INS_E);
    vTDiagF = _mm_set1_epi16(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi16(PARASAIL_DEL_F);

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

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

    /* initialize heap variables */
    s2B= parasail_memalign_int16_t(16, s2Len+PAD2);
    _H_pr = parasail_memalign_int16_t(16, s2Len+PAD2);
    _F_pr = parasail_memalign_int16_t(16, s2Len+PAD2);
    s2 = s2B+PAD; /* will allow later for negative indices */
    H_pr = _H_pr+PAD;
    F_pr = _F_pr+PAD;

    /* validate heap variables */
    if (!s2B) return NULL;
    if (!_H_pr) return NULL;
    if (!_F_pr) return NULL;

    /* convert _s1 from char to int in range 0-23 */
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        s1 = parasail_memalign_int16_t(16, s1Len+PAD);
        if (!s1) return NULL;
        for (i=0; i<s1Len; ++i) {
            s1[i] = matrix->mapper[(unsigned char)_s1[i]];
        }
        /* pad back of s1 with dummy values */
        for (i=s1Len; i<s1Len_PAD; ++i) {
            s1[i] = 0; /* point to first matrix row because we don't care */
        }
    }

    /* convert _s2 from char to int in range 0-23 */
    for (j=0; j<s2Len; ++j) {
        s2[j] = matrix->mapper[(unsigned char)_s2[j]];
    }
    /* pad front of s2 with dummy values */
    for (j=-PAD; j<0; ++j) {
        s2[j] = 0; /* point to first matrix row because we don't care */
    }
    /* pad back of s2 with dummy values */
    for (j=s2Len; j<s2Len_PAD; ++j) {
        s2[j] = 0; /* point to first matrix row because we don't care */
    }

    /* set initial values for stored row */
    for (j=0; j<s2Len; ++j) {
        H_pr[j] = 0;
        F_pr[j] = NEG_LIMIT;
    }
    /* pad front of stored row values */
    for (j=-PAD; j<0; ++j) {
        H_pr[j] = NEG_LIMIT;
        F_pr[j] = NEG_LIMIT;
    }
    /* pad back of stored row values */
    for (j=s2Len; j<s2Len+PAD; ++j) {
        H_pr[j] = NEG_LIMIT;
        F_pr[j] = NEG_LIMIT;
    }

    /* iterate over query sequence */
    for (i=0; i<s1Len; i+=N) {
        __m128i vNH = vNegInf0;
        __m128i vWH = vNegInf0;
        __m128i vE = vNegInf;
        __m128i vE_opn = vNegInf;
        __m128i vE_ext = vNegInf;
        __m128i vF = vNegInf;
        __m128i vF_opn = vNegInf;
        __m128i vF_ext = vNegInf;
        __m128i vJ = vJreset;
        const int * const restrict matrow0 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+0] : ((i+0 >= s1Len) ? s1Len-1 : i+0))];
        const int * const restrict matrow1 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+1] : ((i+1 >= s1Len) ? s1Len-1 : i+1))];
        const int * const restrict matrow2 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+2] : ((i+2 >= s1Len) ? s1Len-1 : i+2))];
        const int * const restrict matrow3 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+3] : ((i+3 >= s1Len) ? s1Len-1 : i+3))];
        const int * const restrict matrow4 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+4] : ((i+4 >= s1Len) ? s1Len-1 : i+4))];
        const int * const restrict matrow5 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+5] : ((i+5 >= s1Len) ? s1Len-1 : i+5))];
        const int * const restrict matrow6 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+6] : ((i+6 >= s1Len) ? s1Len-1 : i+6))];
        const int * const restrict matrow7 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+7] : ((i+7 >= s1Len) ? s1Len-1 : i+7))];
        __m128i vIltLimit = _mm_cmplt_epi16(vI, vILimit);
        /* iterate over database sequence */
        for (j=0; j<s2Len+PAD; ++j) {
            __m128i vMat;
            __m128i vNWH = vNH;
            vNH = _mm_srli_si128(vWH, 2);
            vNH = _mm_insert_epi16(vNH, H_pr[j], 7);
            vF = _mm_srli_si128(vF, 2);
            vF = _mm_insert_epi16(vF, F_pr[j], 7);
            vF_opn = _mm_subs_epi16(vNH, vOpen);
            vF_ext = _mm_subs_epi16(vF, vGap);
            vF = _mm_max_epi16(vF_opn, vF_ext);
            vE_opn = _mm_subs_epi16(vWH, vOpen);
            vE_ext = _mm_subs_epi16(vE, vGap);
            vE = _mm_max_epi16(vE_opn, vE_ext);
            vMat = _mm_set_epi16(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]],
                    matrow2[s2[j-2]],
                    matrow3[s2[j-3]],
                    matrow4[s2[j-4]],
                    matrow5[s2[j-5]],
                    matrow6[s2[j-6]],
                    matrow7[s2[j-7]]
                    );
            vNWH = _mm_adds_epi16(vNWH, vMat);
            vNWH = _mm_max_epi16(vNWH, vZero);
            vWH = _mm_max_epi16(vNWH, vE);
            vWH = _mm_max_epi16(vWH, vF);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m128i cond = _mm_cmpeq_epi16(vJ,vNegOne);
                vWH = _mm_andnot_si128(cond, vWH);
                vF = _mm_blendv_epi8_rpl(vF, vNegInf, cond);
                vE = _mm_blendv_epi8_rpl(vE, vNegInf, cond);
            }
            /* cannot start checking sat until after J clears boundary */
            if (j > PAD) {
                vSaturationCheckMin = _mm_min_epi16(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm_max_epi16(vSaturationCheckMax, vWH);
            }
            /* trace table */
            {
                __m128i cond_zero = _mm_cmpeq_epi16(vWH, vZero);
                __m128i case1 = _mm_cmpeq_epi16(vWH, vNWH);
                __m128i case2 = _mm_cmpeq_epi16(vWH, vF);
                __m128i vT = _mm_blendv_epi8_rpl(
                        _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                        _mm_blendv_epi8_rpl(vTDiag, vTZero, cond_zero),
                        case1);
                __m128i condE = _mm_cmpgt_epi16(vE_opn, vE_ext);
                __m128i condF = _mm_cmpgt_epi16(vF_opn, vF_ext);
                __m128i vET = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, condE);
                __m128i vFT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, condF);
                vT = _mm_or_si128(vT, vET);
                vT = _mm_or_si128(vT, vFT);
                arr_store_si128(result->trace->trace_table, vT, i, s1Len, j, s2Len);
            }
            H_pr[j-7] = (int16_t)_mm_extract_epi16(vWH,0);
            F_pr[j-7] = (int16_t)_mm_extract_epi16(vF,0);
            /* as minor diagonal vector passes across table, extract
             * max values within the i,j bounds */
            {
                __m128i cond_valid_J = _mm_and_si128(
                        _mm_cmpgt_epi16(vJ, vNegOne),
                        _mm_cmplt_epi16(vJ, vJLimit));
                __m128i cond_valid_IJ = _mm_and_si128(cond_valid_J, vIltLimit);
                __m128i cond_eq = _mm_cmpeq_epi16(vWH, vMaxH);
                __m128i cond_max = _mm_cmpgt_epi16(vWH, vMaxH);
                __m128i cond_all = _mm_and_si128(cond_max, cond_valid_IJ);
                __m128i cond_Jlt = _mm_cmplt_epi16(vJ, vEndJ);
                vMaxH = _mm_blendv_epi8_rpl(vMaxH, vWH, cond_all);
                vEndI = _mm_blendv_epi8_rpl(vEndI, vI, cond_all);
                vEndJ = _mm_blendv_epi8_rpl(vEndJ, vJ, cond_all);
                cond_all = _mm_and_si128(cond_Jlt, cond_eq);
                cond_all = _mm_and_si128(cond_all, cond_valid_IJ);
                vEndI = _mm_blendv_epi8_rpl(vEndI, vI, cond_all);
                vEndJ = _mm_blendv_epi8_rpl(vEndJ, vJ, cond_all);
            }
            vJ = _mm_adds_epi16(vJ, vOne);
        }
        vI = _mm_adds_epi16(vI, vN);
    }

    /* alignment ending position */
    {
        int16_t *t = (int16_t*)&vMaxH;
        int16_t *i = (int16_t*)&vEndI;
        int16_t *j = (int16_t*)&vEndJ;
        int32_t k;
        for (k=0; k<N; ++k, ++t, ++i, ++j) {
            if (*t > score) {
                score = *t;
                end_query = *i;
                end_ref = *j;
            }
            else if (*t == score) {
                if (*j < end_ref) {
                    end_query = *i;
                    end_ref = *j;
                }
                else if (*j == end_ref && *i < end_query) {
                    end_query = *i;
                    end_ref = *j;
                }
            }
        }
    }

    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(_F_pr);
    parasail_free(_H_pr);
    parasail_free(s2B);
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        parasail_free(s1);
    }

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
testq %rdx, %rdx
je 0x3510ed
movl %ecx, %r13d
testl %ecx, %ecx
jle 0x351111
testl %r8d, %r8d
js 0x351135
testl %r9d, %r9d
js 0x351179
movq 0x230(%rsp), %r15
testq %r15, %r15
je 0x35119a
movq %rdx, %r12
cmpl $0x0, 0x30(%r15)
je 0x3504f4
movl 0x34(%r15), %r14d
jmp 0x350508
testq %rdi, %rdi
je 0x3511bb
movl %esi, %r14d
testl %esi, %esi
jle 0x3511dc
movq %rdi, 0x40(%rsp)
movl %r9d, 0x60(%rsp)
movl %r8d, %eax
negl %eax
movl 0x20(%r15), %ecx
movl %ecx, %edx
negl %edx
cmpl %eax, %ecx
movl %r8d, 0x50(%rsp)
cmovgl %r8d, %edx
addl $0xffff8001, %edx       # imm = 0xFFFF8001
movw $0x7ffe, %bx            # imm = 0x7FFE
subw 0x1c(%r15), %bx
movl %edx, 0x4(%rsp)
movd %edx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xf0(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0xb0(%rsp)
pushq $0x10
popq %rdx
pushq $0x1
popq %rcx
movl %r14d, %edi
movl %r13d, %esi
callq 0x1abb59
testq %rax, %rax
je 0x3505e4
movq %rax, %rbp
movq %r12, 0x30(%rsp)
movq %r14, 0x8(%rsp)
orl $0x8281004, 0xc(%rax)   # imm = 0x8281004
movq %r13, 0x78(%rsp)
leal 0xe(%r13), %r12d
pushq $0x10
popq %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1ab77b
movq %rax, %r14
movq %r13, %rdi
movq %r12, %rsi
callq 0x1ab77b
movq %rax, %r13
pushq $0x10
popq %rdi
movq %r12, %rsi
callq 0x1ab77b
testq %r14, %r14
sete %dl
movq %r13, 0xa8(%rsp)
testq %r13, %r13
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
je 0x3505eb
xorl %ebp, %ebp
jmp 0x351204
cmpl $0x0, 0x30(%r15)
movq 0x8(%rsp), %r12
movslq %r12d, %r13
movq %rax, 0x28(%rsp)
je 0x351089
movq $0x0, 0x10(%rsp)
movl 0x4(%rsp), %r8d
movq 0x30(%rsp), %r9
movq 0x78(%rsp), %rax
leal 0x7(%rax), %edi
movd %ebx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x180(%rsp)
movaps 0x277634(%rip), %xmm0   # 0x5c7c70
andps 0x80(%rsp), %xmm0
movaps %xmm0, 0x1a0(%rsp)
movd 0x50(%rsp), %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x1d0(%rsp)
movd 0x60(%rsp), %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x1c0(%rsp)
movd 0x8(%rsp), %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x190(%rsp)
movd %eax, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x1b0(%rsp)
movl %eax, %ecx
movq 0x10(%r15), %rax
xorl %edx, %edx
movq 0xa8(%rsp), %rbx
cmpq %rdx, %rcx
je 0x3506d7
movzbl (%r9,%rdx), %esi
movzwl (%rax,%rsi,4), %esi
movw %si, 0xe(%r14,%rdx,2)
incq %rdx
jmp 0x3506be
xorl %eax, %eax
movq 0x28(%rsp), %rdx
cmpq $0x7, %rax
je 0x3506ef
andw $0x0, (%r14,%rax,2)
incq %rax
jmp 0x3506de
movq %rcx, %rax
cmpl %eax, %edi
jle 0x350702
andw $0x0, 0xe(%r14,%rax,2)
incq %rax
jmp 0x3506f2
xorl %eax, %eax
cmpq %rax, %rcx
je 0x35071a
andw $0x0, 0xe(%rbx,%rax,2)
movw %r8w, 0xe(%rdx,%rax,2)
incq %rax
jmp 0x350704
xorl %eax, %eax
cmpq $0x7, %rax
je 0x350731
movw %r8w, (%rbx,%rax,2)
movw %r8w, (%rdx,%rax,2)
incq %rax
jmp 0x35071c
movq %rcx, %rax
cmpl %eax, %edi
jle 0x350749
movw %r8w, 0xe(%rbx,%rax,2)
movw %r8w, 0xe(%rdx,%rax,2)
incq %rax
jmp 0x350734
movq 0x8(%rsp), %rax
decl %eax
movq %rax, 0x8(%rsp)
xorl %edx, %edx
testl %edi, %edi
movl $0x0, %eax
movq %rax, 0xa0(%rsp)
cmovlel %edx, %edi
movq %rdi, 0x78(%rsp)
movdqa 0xf0(%rsp), %xmm4
movdqa 0xb0(%rsp), %xmm1
leaq (,%rcx,8), %rax
movq %rax, 0x108(%rsp)
movaps 0x2772a9(%rip), %xmm0   # 0x5c7a40
movaps %xmm0, 0x30(%rsp)
xorl %edi, %edi
movdqa 0x80(%rsp), %xmm0
movdqa %xmm0, %xmm2
movdqa %xmm0, 0xd0(%rsp)
movdqa 0x180(%rsp), %xmm0
movdqa %xmm0, 0xc0(%rsp)
cmpq %r13, %rdi
jge 0x350f8e
cmpl $0x0, 0x30(%r15)
movq %rdi, 0x110(%rsp)
je 0x350881
movq %rdi, %r12
orq $0x1, %r12
cmpq %r13, %r12
movq 0x8(%rsp), %rsi
movl %esi, %eax
cmovll %r12d, %eax
movq %rdi, %rdx
orq $0x2, %rdx
cmpq %r13, %rdx
movq %rdx, 0x60(%rsp)
cmovgel %esi, %edx
movl %edx, 0x20(%rsp)
movq %rdi, %rdx
orq $0x3, %rdx
cmpq %r13, %rdx
movq %rdi, %r8
movq %rdx, 0x50(%rsp)
movl %edx, %edi
cmovgel %esi, %edi
movq %r8, %rdx
orq $0x4, %rdx
cmpq %r13, %rdx
movq %rdx, 0x40(%rsp)
cmovgel %esi, %edx
movl %edx, 0x18(%rsp)
movq %r8, %rdx
orq $0x5, %rdx
cmpq %r13, %rdx
movq %rdx, 0x98(%rsp)
movl %edx, %r10d
cmovgel %esi, %r10d
movq %r8, %rdx
orq $0x6, %rdx
cmpq %r13, %rdx
movq %rdx, 0x90(%rsp)
movl %edx, %r11d
cmovgel %esi, %r11d
movq %r8, %r9
orq $0x7, %r9
cmpq %r13, %r9
movl %r9d, %edx
cmovgel %esi, %edx
jmp 0x35090d
movq 0x10(%rsp), %rdx
movswl (%rdx,%rdi,2), %r8d
movq %rdi, %r12
orq $0x1, %r12
movswl 0x2(%rdx,%rdi,2), %eax
movq %rdi, %rsi
orq $0x2, %rsi
movq %rsi, 0x60(%rsp)
movswl 0x4(%rdx,%rdi,2), %esi
movl %esi, 0x20(%rsp)
movq %rdi, %rsi
orq $0x3, %rsi
movq %rsi, 0x50(%rsp)
movq %rdi, %rsi
movswl 0x6(%rdx,%rdi,2), %edi
movq %rsi, %r9
orq $0x4, %r9
movq %r9, 0x40(%rsp)
movswl 0x8(%rdx,%rsi,2), %r9d
movl %r9d, 0x18(%rsp)
movq %rsi, %r9
orq $0x5, %r9
movq %r9, 0x98(%rsp)
movswl 0xa(%rdx,%rsi,2), %r10d
movq %rsi, %r9
orq $0x6, %r9
movq %r9, 0x90(%rsp)
movswl 0xc(%rdx,%rsi,2), %r11d
movq %rsi, %r9
orq $0x7, %r9
movswl 0xe(%rdx,%rsi,2), %edx
movq %r9, 0x70(%rsp)
movq %r15, %rsi
movq 0x8(%r15), %r15
movl 0x18(%rsi), %esi
imull %esi, %r10d
movslq %r10d, %r10
leaq (%r15,%r10,4), %r10
movq %r10, 0x178(%rsp)
imull %esi, %edi
movslq %edi, %rdi
leaq (%r15,%rdi,4), %rdi
movq %rdi, 0x170(%rsp)
imull %esi, %eax
cltq
leaq (%r15,%rax,4), %rax
movq %rax, 0x168(%rsp)
imull %esi, %r8d
movslq %r8d, %rdi
leaq (%r15,%rdi,4), %rax
movq %rax, 0x160(%rsp)
movl 0x20(%rsp), %eax
imull %esi, %eax
movslq %eax, %rdi
leaq (%r15,%rdi,4), %rax
movq %rax, 0x20(%rsp)
movl 0x18(%rsp), %eax
imull %esi, %eax
movslq %eax, %rdi
leaq (%r15,%rdi,4), %rax
movq %rax, 0x18(%rsp)
imull %esi, %r11d
movslq %r11d, %rdi
leaq (%r15,%rdi,4), %rax
movq %rax, 0x158(%rsp)
imull %esi, %edx
movslq %edx, %rdx
leaq (%r15,%rdx,4), %rax
movq %rax, 0x150(%rsp)
movq %r12, %rax
imulq %rcx, %rax
movq 0x60(%rsp), %rdx
imulq %rcx, %rdx
movq 0x50(%rsp), %rsi
imulq %rcx, %rsi
movq 0x40(%rsp), %rdi
imulq %rcx, %rdi
movq 0x98(%rsp), %r11
movq %r11, %r8
imulq %rcx, %r8
movq 0x90(%rsp), %r15
movq %r15, %r10
imulq %rcx, %r10
imulq %rcx, %r9
addq $-0x7, %r9
movq %r9, 0x140(%rsp)
addq $-0x2, %rdx
movq %rdx, 0x138(%rsp)
addq $-0x3, %rsi
movq %rsi, 0x130(%rsp)
addq $-0x4, %rdi
movq %rdi, 0x128(%rsp)
addq $-0x5, %r8
movq %r8, 0x120(%rsp)
addq $-0x6, %r10
movq %r10, 0x118(%rsp)
decq %rax
movq %rax, 0x148(%rsp)
movdqa 0x190(%rsp), %xmm0
pcmpgtw 0x30(%rsp), %xmm0
movdqa %xmm0, 0x1e0(%rsp)
movdqa 0x1a0(%rsp), %xmm8
movdqa %xmm8, %xmm13
movdqa 0x80(%rsp), %xmm12
movdqa %xmm12, %xmm6
movdqa 0x27718a(%rip), %xmm15  # 0x5c7c10
xorl %esi, %esi
movq 0x28(%rsp), %rdx
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %r8
movq 0x40(%rsp), %r10
movq %r15, %rdi
cmpq %rsi, 0x78(%rsp)
je 0x350f4c
movdqa %xmm2, 0x40(%rsp)
movdqa %xmm4, 0x50(%rsp)
movdqa %xmm1, 0x60(%rsp)
movdqa %xmm8, %xmm9
psrldq $0x2, %xmm9             # xmm9 = xmm9[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
pinsrw $0x7, 0xe(%rbx,%rsi,2), %xmm9
psrldq $0x2, %xmm12            # xmm12 = xmm12[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
pinsrw $0x7, 0xe(%rdx,%rsi,2), %xmm12
movswq 0xe(%r14,%rsi,2), %rdx
movq 0x160(%rsp), %r9
movd (%r9,%rdx,4), %xmm0
movswq 0xc(%r14,%rsi,2), %rdx
movq 0x168(%rsp), %r9
movd (%r9,%rdx,4), %xmm4
movswq 0xa(%r14,%rsi,2), %rdx
movq 0x20(%rsp), %r9
movd (%r9,%rdx,4), %xmm5
movswq 0x8(%r14,%rsi,2), %rdx
movq 0x170(%rsp), %r9
movd (%r9,%rdx,4), %xmm3
movswq 0x6(%r14,%rsi,2), %rdx
movq 0x18(%rsp), %r9
movd (%r9,%rdx,4), %xmm7
movswq 0x4(%r14,%rsi,2), %rdx
movq 0x178(%rsp), %r9
movd (%r9,%rdx,4), %xmm11
movswq 0x2(%r14,%rsi,2), %rdx
movq 0x158(%rsp), %r9
movd (%r9,%rdx,4), %xmm1
movswq (%r14,%rsi,2), %rdx
punpcklwd %xmm0, %xmm4    # xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3]
movq 0x150(%rsp), %r9
movd (%r9,%rdx,4), %xmm14
punpcklwd %xmm5, %xmm3    # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1],xmm3[2],xmm5[2],xmm3[3],xmm5[3]
movdqa %xmm9, %xmm2
movdqa 0x1d0(%rsp), %xmm5
psubsw %xmm5, %xmm2
movdqa %xmm12, %xmm0
movdqa 0x1c0(%rsp), %xmm12
psubsw %xmm12, %xmm0
punpckldq %xmm4, %xmm3    # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movdqa %xmm2, %xmm10
pmaxsw %xmm0, %xmm10
psubsw %xmm5, %xmm8
psubsw %xmm12, %xmm6
punpcklwd %xmm7, %xmm11   # xmm11 = xmm11[0],xmm7[0],xmm11[1],xmm7[1],xmm11[2],xmm7[2],xmm11[3],xmm7[3]
movdqa %xmm8, %xmm7
pmaxsw %xmm6, %xmm7
punpcklwd %xmm1, %xmm14   # xmm14 = xmm14[0],xmm1[0],xmm14[1],xmm1[1],xmm14[2],xmm1[2],xmm14[3],xmm1[3]
punpckldq %xmm11, %xmm14  # xmm14 = xmm14[0],xmm11[0],xmm14[1],xmm11[1]
punpcklqdq %xmm3, %xmm14   # xmm14 = xmm14[0],xmm3[0]
paddsw %xmm14, %xmm13
pmaxsw 0x277019(%rip), %xmm13  # 0x5c7c00
movdqa %xmm7, %xmm4
pmaxsw %xmm10, %xmm4
pmaxsw %xmm13, %xmm4
movdqa %xmm15, %xmm5
pcmpeqw 0x276f5e(%rip), %xmm5   # 0x5c7b60
movdqa %xmm5, %xmm11
pandn %xmm4, %xmm11
movdqa %xmm5, %xmm12
pandn %xmm10, %xmm12
movdqa 0x80(%rsp), %xmm3
pand %xmm5, %xmm3
por %xmm3, %xmm12
cmpq $0x8, %rsi
jb 0x350c5c
movdqa 0xc0(%rsp), %xmm1
pminsw %xmm11, %xmm1
movdqa %xmm1, 0xc0(%rsp)
movdqa 0xd0(%rsp), %xmm1
pmaxsw %xmm11, %xmm1
movdqa %xmm1, 0xd0(%rsp)
pcmpeqw %xmm11, %xmm13
movdqa %xmm11, %xmm1
pcmpgtw 0x276f92(%rip), %xmm1   # 0x5c7c00
pand %xmm13, %xmm1
pand 0x278aa5(%rip), %xmm1   # 0x5c9720
movdqa %xmm11, %xmm10
pcmpeqw %xmm12, %xmm10
movdqa 0x276f92(%rip), %xmm14  # 0x5c7c20
psubw %xmm10, %xmm14
pandn %xmm14, %xmm13
por %xmm1, %xmm13
pcmpgtw %xmm6, %xmm8
pand 0x278a35(%rip), %xmm8   # 0x5c96e0
pcmpgtw %xmm0, %xmm2
pand 0x278a39(%rip), %xmm2   # 0x5c96f0
por %xmm8, %xmm2
por %xmm13, %xmm2
pxor 0x278bc7(%rip), %xmm2   # 0x5c9890
movq 0x10(%rbp), %rdx
movq (%rdx), %rdx
cmpq %rcx, %rsi
jae 0x350cea
pextrw $0x7, %xmm2, %r15d
movq 0xa0(%rsp), %rbx
addq %rdx, %rbx
movb %r15b, (%rsi,%rbx)
cmpq %r13, %r12
setge %bl
leaq -0x1(%rsi), %r15
cmpq %rcx, %r15
setae %r15b
orb %bl, %r15b
jne 0x350d15
pextrw $0x6, %xmm2, %ebx
movq 0x148(%rsp), %r9
leaq (%rdx,%r9), %r15
movb %bl, (%rsi,%r15)
cmpq %r13, %rax
jge 0x350d49
leaq -0x2(%rsi), %rbx
cmpq $0x2, %rsi
setae %r15b
cmpq %rcx, %rbx
setl %bl
andb %r15b, %bl
cmpb $0x1, %bl
jne 0x350d49
pextrw $0x5, %xmm2, %ebx
movq 0x138(%rsp), %r9
leaq (%rdx,%r9), %r15
movb %bl, (%rsi,%r15)
movq %r8, %r9
cmpq %r13, %r8
jge 0x350d80
leaq -0x3(%rsi), %rbx
cmpq $0x3, %rsi
setae %r15b
cmpq %rcx, %rbx
setl %bl
andb %r15b, %bl
cmpb $0x1, %bl
jne 0x350d80
pextrw $0x4, %xmm2, %ebx
movq 0x130(%rsp), %r8
leaq (%rdx,%r8), %r15
movb %bl, (%rsi,%r15)
movq %rax, %r8
cmpq %r13, %r10
jge 0x350db7
leaq -0x4(%rsi), %rbx
cmpq $0x4, %rsi
setae %r15b
cmpq %rcx, %rbx
setl %bl
andb %r15b, %bl
cmpb $0x1, %bl
jne 0x350db7
pextrw $0x3, %xmm2, %ebx
movq 0x128(%rsp), %rax
leaq (%rdx,%rax), %r15
movb %bl, (%rsi,%r15)
movq %r12, %rax
cmpq %r13, %r11
jge 0x350ded
leaq -0x5(%rsi), %rbx
cmpq $0x5, %rsi
setae %r15b
cmpq %rcx, %rbx
setl %bl
andb %r15b, %bl
cmpb $0x1, %bl
jne 0x350ded
pextrw $0x2, %xmm2, %ebx
movq 0x120(%rsp), %r15
addq %rdx, %r15
movb %bl, (%rsi,%r15)
movq %rbp, %r12
movd %xmm2, %r15d
cmpq %r13, %rdi
jge 0x350e28
leaq -0x6(%rsi), %rbx
cmpq $0x6, %rsi
setae %bpl
cmpq %rcx, %rbx
setl %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x350e28
movl %r15d, %ebx
shrl $0x10, %ebx
movq 0x118(%rsp), %rbp
addq %rdx, %rbp
movb %bl, (%rsi,%rbp)
cmpq %r13, 0x70(%rsp)
setge %bl
cmpq $0x7, %rsi
setb %bpl
orb %bl, %bpl
jne 0x350e49
addq 0x140(%rsp), %rdx
movb %r15b, (%rsi,%rdx)
pandn %xmm7, %xmm5
por %xmm5, %xmm3
movdqa 0x1b0(%rsp), %xmm0
pcmpgtw %xmm15, %xmm0
pand 0x1e0(%rsp), %xmm0
movdqa %xmm15, %xmm5
psraw $0xf, %xmm5
pandn %xmm0, %xmm5
movdqa %xmm11, %xmm1
movdqa 0x50(%rsp), %xmm8
pcmpeqw %xmm8, %xmm1
movdqa %xmm11, %xmm2
pcmpgtw %xmm8, %xmm2
movdqa 0x60(%rsp), %xmm7
movdqa %xmm7, %xmm0
pcmpgtw %xmm15, %xmm0
pand %xmm1, %xmm0
movdqa %xmm5, %xmm1
pand %xmm0, %xmm1
movdqa %xmm0, %xmm6
por %xmm2, %xmm0
pand %xmm5, %xmm2
pand %xmm2, %xmm4
pandn %xmm2, %xmm6
pandn %xmm8, %xmm2
por %xmm2, %xmm4
por %xmm1, %xmm6
movdqa 0x30(%rsp), %xmm1
pand %xmm6, %xmm1
pandn 0x40(%rsp), %xmm6
por %xmm1, %xmm6
pand %xmm5, %xmm0
movdqa %xmm15, %xmm1
pand %xmm0, %xmm1
pandn %xmm7, %xmm0
por %xmm1, %xmm0
movd %xmm11, %edx
movq 0xa8(%rsp), %rbx
movw %dx, (%rbx,%rsi,2)
movd %xmm12, %edx
movq 0x28(%rsp), %r15
movw %dx, (%r15,%rsi,2)
movq %r15, %rdx
paddsw 0x276cfe(%rip), %xmm15  # 0x5c7c20
incq %rsi
movdqa %xmm0, %xmm1
movdqa %xmm6, %xmm2
movdqa %xmm9, %xmm13
movdqa %xmm11, %xmm8
movdqa %xmm3, %xmm6
movq %r12, %rbp
movq %rax, %r12
movq %r8, %rax
movq %r9, %r8
jmp 0x350a9f
movdqa 0x30(%rsp), %xmm0
paddsw 0x276cd6(%rip), %xmm0   # 0x5c7c30
movdqa %xmm0, 0x30(%rsp)
movq 0x110(%rsp), %rdi
addq $0x8, %rdi
movq 0x108(%rsp), %rax
addq %rax, 0xa0(%rsp)
movq 0x230(%rsp), %r15
movl 0x4(%rsp), %r8d
jmp 0x3507c6
movdqa %xmm4, 0xf0(%rsp)
movdqa %xmm1, 0xb0(%rsp)
movdqa %xmm2, 0xe0(%rsp)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
cmpl $0x8, %ecx
je 0x35100d
movzwl 0xf0(%rsp,%rcx,2), %esi
cmpw %r8w, %si
jle 0x350fd4
movswl 0xe0(%rsp,%rcx,2), %eax
movswl 0xb0(%rsp,%rcx,2), %edi
jmp 0x351003
jne 0x350ffe
movswl 0xb0(%rsp,%rcx,2), %edi
cmpl %edi, %edx
jle 0x350fef
movswl 0xe0(%rsp,%rcx,2), %eax
movl %r8d, %esi
jmp 0x351003
jne 0x350ffe
movswl 0xe0(%rsp,%rcx,2), %esi
cmpl %esi, %eax
cmovgel %esi, %eax
movl %r8d, %esi
movl %edx, %edi
incq %rcx
movl %esi, %r8d
movl %edi, %edx
jmp 0x350faf
movdqa 0x80(%rsp), %xmm0
pcmpgtw 0xc0(%rsp), %xmm0
movdqa 0xd0(%rsp), %xmm1
pcmpgtw 0x180(%rsp), %xmm1
por %xmm0, %xmm1
pmovmskb %xmm1, %ecx
testl %ecx, %ecx
je 0x351048
orb $0x40, 0xc(%rbp)
xorl %r8d, %r8d
xorl %edx, %edx
xorl %eax, %eax
movswl %r8w, %ecx
movl %ecx, (%rbp)
movl %eax, 0x4(%rbp)
movl %edx, 0x8(%rbp)
movq 0x28(%rsp), %rdi
callq 0x1ab763
movq %rbx, %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%r15)
jne 0x351204
movq 0x10(%rsp), %rdi
callq 0x1ab763
jmp 0x351204
leal 0x7(%r12), %eax
movslq %eax, %rsi
pushq $0x10
popq %rdi
movq %rsi, 0x70(%rsp)
callq 0x1ab77b
xorl %edi, %edi
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x3505e4
testl %r12d, %r12d
movl $0x0, %ecx
cmovgl %r12d, %ecx
movl 0x4(%rsp), %r8d
movq 0x30(%rsp), %r9
movq 0x40(%rsp), %r10
movq 0x10(%rsp), %rax
cmpq %rdi, %rcx
je 0x351159
movq 0x10(%r15), %rdx
movzbl (%r10,%rdi), %esi
movzwl (%rdx,%rsi,4), %edx
movw %dx, (%rax,%rdi,2)
incq %rdi
jmp 0x3510ce
movq 0x3e9ee4(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x275eed(%rip), %rsi    # 0x5c6feb
leaq 0x246122(%rip), %rdx    # 0x597227
leaq 0x2765f1(%rip), %rcx    # 0x5c76fd
jmp 0x3511fb
movq 0x3e9ec0(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2765df(%rip), %rsi    # 0x5c7701
leaq 0x2460fe(%rip), %rdx    # 0x597227
leaq 0x2765e5(%rip), %rcx    # 0x5c7715
jmp 0x3511fb
movq 0x3e9e9c(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2765d5(%rip), %rsi    # 0x5c771b
leaq 0x2460da(%rip), %rdx    # 0x597227
leaq 0x2765dc(%rip), %rcx    # 0x5c7730
jmp 0x3511fb
movq %r13, %rax
movq 0x70(%rsp), %rdx
movq 0x10(%rsp), %rcx
cmpq %rdx, %rax
jge 0x350616
andw $0x0, (%rcx,%rax,2)
incq %rax
jmp 0x351166
movq 0x3e9e58(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x276591(%rip), %rsi    # 0x5c771b
leaq 0x246096(%rip), %rdx    # 0x597227
leaq 0x27659d(%rip), %rcx    # 0x5c7735
jmp 0x3511fb
movq 0x3e9e37(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x275e40(%rip), %rsi    # 0x5c6feb
leaq 0x246075(%rip), %rdx    # 0x597227
leaq 0x276789(%rip), %rcx    # 0x5c7942
jmp 0x3511fb
movq 0x3e9e16(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x275e1f(%rip), %rsi    # 0x5c6feb
leaq 0x246054(%rip), %rdx    # 0x597227
leaq 0x27655f(%rip), %rcx    # 0x5c7739
jmp 0x3511fb
movq 0x3e9df5(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x276514(%rip), %rsi    # 0x5c7701
leaq 0x246033(%rip), %rdx    # 0x597227
leaq 0x276542(%rip), %rcx    # 0x5c773d
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x19e180
movq %rbp, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)