// File: /workspace/github_c_makefile_star2_O1/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 $0x1c8, %rsp            # imm = 0x1C8
testq %rdx, %rdx
je 0x393f2b
movl %ecx, %ebp
testl %ecx, %ecx
jle 0x393f32
testl %r8d, %r8d
js 0x393f39
movl %r9d, %r12d
testl %r9d, %r9d
js 0x393f40
movq 0x200(%rsp), %rbx
testq %rbx, %rbx
je 0x393f47
movq %rdx, %r15
movl 0x30(%rbx), %eax
testl %eax, %eax
jne 0x393380
testq %rdi, %rdi
je 0x393f4e
movl %esi, %r14d
testl %esi, %esi
jle 0x393f55
testl %eax, %eax
je 0x393384
movl 0x34(%rbx), %r14d
movq %rdi, 0x38(%rsp)
movl %r8d, %eax
negl %eax
movl 0x20(%rbx), %ecx
movl %ecx, %edx
negl %edx
cmpl %eax, %ecx
movl %r8d, 0x60(%rsp)
cmovgl %r8d, %edx
addl $0xffff8001, %edx       # imm = 0xFFFF8001
movw $0x7ffe, %ax            # imm = 0x7FFE
subw 0x1c(%rbx), %ax
movl %eax, 0x50(%rsp)
movl %edx, 0x10(%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, 0x110(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x40(%rsp)
movdqa %xmm0, 0xf0(%rsp)
movl $0x10, %edx
movl $0x1, %ecx
movl %r14d, %edi
movl %ebp, %esi
callq 0x2097d1
testq %rax, %rax
je 0x393f5a
movq %rax, %r13
movl %r12d, 0x30(%rsp)
movq %r15, 0x18(%rsp)
movq %r14, 0x8(%rsp)
orl $0x8281004, 0xc(%rax)   # imm = 0x8281004
leal 0xe(%rbp), %r12d
movl $0x10, %edi
movq %r12, %rsi
callq 0x2094cd
movq %rax, %r14
movl $0x10, %edi
movq %r12, %rsi
callq 0x2094cd
movq %rax, %r15
movl $0x10, %edi
movq %r12, %rsi
callq 0x2094cd
testq %r14, %r14
sete %dl
testq %r15, %r15
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x393f5a
cmpl $0x0, 0x30(%rbx)
movq %r15, 0x28(%rsp)
movq %rax, 0x20(%rsp)
je 0x39348c
movq $0x0, (%rsp)
movq 0x8(%rsp), %r15
movq 0x18(%rsp), %r12
jmp 0x39350e
movq 0x8(%rsp), %r15
leal 0x7(%r15), %ebx
movslq %ebx, %rsi
movl $0x10, %edi
callq 0x2094cd
movq %rax, (%rsp)
testq %rax, %rax
movq 0x18(%rsp), %r12
je 0x393f5a
testl %r15d, %r15d
movq (%rsp), %rdi
movq 0x38(%rsp), %r8
jle 0x3934e8
movq 0x200(%rsp), %rax
movq 0x10(%rax), %rax
movl %r15d, %ecx
xorl %edx, %edx
movzbl (%r8,%rdx), %esi
movzwl (%rax,%rsi,4), %esi
movw %si, (%rdi,%rdx,2)
incq %rdx
cmpq %rdx, %rcx
jne 0x3934d3
movslq %r15d, %rax
leaq (%rdi,%rax,2), %rdi
leal 0x1(%r15), %eax
cmpl %eax, %ebx
cmovgl %ebx, %eax
movl %r15d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x2(,%rcx,2), %rdx
xorl %esi, %esi
callq 0x19e090
movq %r13, 0xc8(%rsp)
leal 0x7(%rbp), %ebx
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, 0x100(%rsp)
movaps 0x262707(%rip), %xmm0   # 0x5f5c40
andps 0x40(%rsp), %xmm0
movaps %xmm0, 0x170(%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, 0x1a0(%rsp)
movd 0x30(%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 %r15d, %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, 0x160(%rsp)
movd %ebp, %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)
movq 0x200(%rsp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, %ebp
movl $0x1, %r15d
cmovgel %ebp, %r15d
xorl %ecx, %ecx
movzbl (%r12,%rcx), %edx
movzwl (%rax,%rdx,4), %edx
movw %dx, 0xe(%r14,%rcx,2)
incq %rcx
cmpq %rcx, %r15
jne 0x3935c2
xorl %r12d, %r12d
movq %r12, 0x6(%r14)
movq %r12, (%r14)
movl %ebp, %r13d
leaq (%r14,%r13,2), %rdi
addq $0xe, %rdi
leal 0x1(%rbp), %eax
cmpl %eax, %ebx
cmovgl %ebx, %eax
movl %ebp, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x2(,%rcx,2), %rdx
xorl %esi, %esi
callq 0x19e090
movl 0x10(%rsp), %edi
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movw $0x0, 0xe(%rcx,%r12,2)
movw %di, 0xe(%rdx,%r12,2)
incq %r12
cmpq %r12, %r15
jne 0x393619
xorl %eax, %eax
movw %di, (%rcx,%rax,2)
movw %di, (%rdx,%rax,2)
incq %rax
cmpq $0x7, %rax
jne 0x393631
leaq 0x7(%r13), %rax
movq 0x8(%rsp), %rsi
movw %di, (%rcx,%rax,2)
movw %di, (%rdx,%rax,2)
incq %rax
incl %ebp
cmpl %ebp, %ebx
jg 0x39364b
movdqa 0x70(%rsp), %xmm10
testl %esi, %esi
jle 0x393e27
leal -0x1(%rsi), %r15d
cmpl $0x2, %ebx
movl $0x1, %eax
cmovgel %ebx, %eax
movq %rax, 0x138(%rsp)
movl %esi, %edx
leaq (,%r13,8), %rax
leaq -0x1(%r13), %rcx
movq %rcx, 0xc0(%rsp)
movq %rax, 0x128(%rsp)
subq %r13, %rax
addq $-0x7, %rax
movq %rax, 0xb0(%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
leaq -0x6(%rax,%rax), %rax
movq %rax, 0xa8(%rsp)
leaq -0x5(%r13,%r13,4), %rax
movq %rax, 0xa0(%rsp)
leaq -0x4(,%r13,4), %rax
movq %rax, 0x98(%rsp)
leaq -0x3(%r13,%r13,2), %rax
movq %rax, 0x90(%rsp)
leaq -0x2(%r13,%r13), %rax
movq %rax, 0x88(%rsp)
movaps 0x26231b(%rip), %xmm0   # 0x5f5a20
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0xb8(%rsp)
pxor %xmm15, %xmm15
xorl %ebx, %ebx
movaps 0x100(%rsp), %xmm0
movaps %xmm0, 0xd0(%rsp)
movdqa 0x40(%rsp), %xmm0
movdqa %xmm0, 0xe0(%rsp)
movq (%rsp), %rbp
movl %r15d, 0x14(%rsp)
movq 0x200(%rsp), %rax
movl 0x30(%rax), %ecx
movl %ebx, %edi
testl %ecx, %ecx
jne 0x39375b
movswl (%rbp,%rbx,2), %edi
movq %rbx, %r8
orq $0x1, %r8
testl %ecx, %ecx
je 0x393772
cmpq %rdx, %r8
movl %r15d, %esi
cmovbl %r8d, %esi
jmp 0x393778
movswl (%rbp,%r8,2), %esi
movq %rbx, %r9
orq $0x2, %r9
testl %ecx, %ecx
je 0x39378f
cmpq %rdx, %r9
movl %r15d, %r10d
cmovbl %r9d, %r10d
jmp 0x393795
movswl (%rbp,%r9,2), %r10d
movl %r10d, 0x60(%rsp)
movq %r9, 0x38(%rsp)
movq %rbx, %r10
orq $0x3, %r10
testl %ecx, %ecx
je 0x3937b6
cmpq %rdx, %r10
movl %r15d, %r9d
cmovbl %r10d, %r9d
jmp 0x3937bc
movswl (%rbp,%r10,2), %r9d
movq %r10, 0x18(%rsp)
movq %rbx, %r11
orq $0x4, %r11
testl %ecx, %ecx
je 0x3937d8
cmpq %rdx, %r11
movl %r15d, %r10d
cmovbl %r11d, %r10d
jmp 0x3937de
movswl (%rbp,%r11,2), %r10d
movq %r11, 0x30(%rsp)
movq %rbx, %r12
orq $0x5, %r12
testl %ecx, %ecx
movq %r8, 0x8(%rsp)
je 0x3937ff
cmpq %rdx, %r12
movl %r15d, %r11d
cmovbl %r12d, %r11d
jmp 0x393805
movswl (%rbp,%r12,2), %r11d
movq %rbx, %r8
orq $0x6, %r8
testl %ecx, %ecx
movq %r12, 0x158(%rsp)
je 0x393821
cmpq %rdx, %r8
cmovbl %r8d, %r15d
jmp 0x393827
movswl (%rbp,%r8,2), %r15d
movq 0x8(%rax), %r12
movl 0x18(%rax), %eax
movq %rbx, 0x130(%rsp)
orq $0x7, %rbx
testl %ecx, %ecx
je 0x39384a
cmpq %rdx, %rbx
movl 0x14(%rsp), %ebp
cmovbl %ebx, %ebp
jmp 0x39384f
movswl (%rbp,%rbx,2), %ebp
imull %eax, %edi
movslq %edi, %rcx
leaq (%r12,%rcx,4), %rcx
movq %rcx, 0x150(%rsp)
imull %eax, %esi
movslq %esi, %rcx
leaq (%r12,%rcx,4), %rcx
movq %rcx, 0x148(%rsp)
movl 0x60(%rsp), %ecx
imull %eax, %ecx
movslq %ecx, %rcx
leaq (%r12,%rcx,4), %rcx
movq %rcx, 0x140(%rsp)
imull %eax, %r9d
movslq %r9d, %r9
leaq (%r12,%r9,4), %r9
imull %eax, %r10d
movslq %r10d, %r10
leaq (%r12,%r10,4), %r10
imull %eax, %r11d
movslq %r11d, %r11
leaq (%r12,%r11,4), %r11
imull %eax, %r15d
movslq %r15d, %r15
leaq (%r12,%r15,4), %r15
imull %eax, %ebp
movslq %ebp, %rax
leaq (%r12,%rax,4), %r12
movdqa 0x160(%rsp), %xmm0
pcmpgtw 0x50(%rsp), %xmm0
movdqa %xmm0, 0x1b0(%rsp)
xorl %ebp, %ebp
movdqa 0x2622ee(%rip), %xmm11  # 0x5f5bd0
movdqa 0x40(%rsp), %xmm7
movdqa %xmm7, %xmm1
movdqa 0x170(%rsp), %xmm13
movdqa %xmm13, %xmm3
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdi
movdqa %xmm10, 0x60(%rsp)
movswq 0xe(%r14,%rbp,2), %rax
movq 0x150(%rsp), %rcx
movd (%rcx,%rax,4), %xmm4
movswq 0xc(%r14,%rbp,2), %rax
movq 0x148(%rsp), %rcx
movd (%rcx,%rax,4), %xmm5
movswq 0xa(%r14,%rbp,2), %rax
movq 0x140(%rsp), %rcx
movd (%rcx,%rax,4), %xmm6
movswq 0x8(%r14,%rbp,2), %rax
movd (%r9,%rax,4), %xmm8
movswq 0x6(%r14,%rbp,2), %rax
movd (%r10,%rax,4), %xmm10
movswq 0x4(%r14,%rbp,2), %rax
movd (%r11,%rax,4), %xmm12
movswq 0x2(%r14,%rbp,2), %rax
movd (%r15,%rax,4), %xmm14
movswq (%r14,%rbp,2), %rax
movd (%r12,%rax,4), %xmm0
punpcklwd %xmm4, %xmm5    # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1],xmm5[2],xmm4[2],xmm5[3],xmm4[3]
punpcklwd %xmm6, %xmm8    # xmm8 = xmm8[0],xmm6[0],xmm8[1],xmm6[1],xmm8[2],xmm6[2],xmm8[3],xmm6[3]
punpckldq %xmm5, %xmm8    # xmm8 = xmm8[0],xmm5[0],xmm8[1],xmm5[1]
punpcklwd %xmm10, %xmm12  # xmm12 = xmm12[0],xmm10[0],xmm12[1],xmm10[1],xmm12[2],xmm10[2],xmm12[3],xmm10[3]
punpcklwd %xmm14, %xmm0   # xmm0 = xmm0[0],xmm14[0],xmm0[1],xmm14[1],xmm0[2],xmm14[2],xmm0[3],xmm14[3]
punpckldq %xmm12, %xmm0   # xmm0 = xmm0[0],xmm12[0],xmm0[1],xmm12[1]
punpcklqdq %xmm8, %xmm0    # xmm0 = xmm0[0],xmm8[0]
paddsw %xmm13, %xmm0
movdqa %xmm3, %xmm13
psrldq $0x2, %xmm13            # xmm13 = xmm13[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
pinsrw $0x7, 0xe(%rsi,%rbp,2), %xmm13
psrldq $0x2, %xmm1             # xmm1 = xmm1[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
pinsrw $0x7, 0xe(%rdi,%rbp,2), %xmm1
movdqa %xmm13, %xmm9
movdqa 0x1a0(%rsp), %xmm2
psubsw %xmm2, %xmm9
movdqa %xmm1, %xmm6
movdqa 0x190(%rsp), %xmm1
psubsw %xmm1, %xmm6
movdqa %xmm9, %xmm4
pmaxsw %xmm6, %xmm4
movdqa %xmm3, %xmm10
psubsw %xmm2, %xmm10
movdqa %xmm7, %xmm12
psubsw %xmm1, %xmm12
movdqa %xmm10, %xmm5
pmaxsw %xmm12, %xmm5
pmaxsw %xmm15, %xmm0
movdqa %xmm5, %xmm8
pmaxsw %xmm4, %xmm8
pmaxsw %xmm0, %xmm8
movdqa %xmm11, %xmm14
pcmpeqw 0x2621cd(%rip), %xmm14  # 0x5f5c00
movdqa %xmm14, %xmm3
pandn %xmm8, %xmm3
movdqa %xmm14, %xmm1
pandn %xmm4, %xmm1
movdqa 0x40(%rsp), %xmm7
pand %xmm14, %xmm7
por %xmm7, %xmm1
cmpq $0x8, %rbp
jb 0x393a87
movdqa 0xd0(%rsp), %xmm2
pminsw %xmm3, %xmm2
movdqa %xmm2, 0xd0(%rsp)
movdqa 0xe0(%rsp), %xmm2
pmaxsw %xmm3, %xmm2
movdqa %xmm2, 0xe0(%rsp)
pcmpeqw %xmm3, %xmm0
movdqa %xmm3, %xmm4
pcmpgtw %xmm15, %xmm4
pand %xmm0, %xmm4
pand 0x263b60(%rip), %xmm4   # 0x5f7600
movdqa %xmm3, %xmm15
pcmpeqw %xmm1, %xmm15
movdqa 0x26212e(%rip), %xmm2   # 0x5f5be0
psubw %xmm15, %xmm2
pandn %xmm2, %xmm0
por %xmm4, %xmm0
pcmpgtw %xmm12, %xmm10
pand 0x263af3(%rip), %xmm10  # 0x5f75c0
pcmpgtw %xmm6, %xmm9
pand 0x263af5(%rip), %xmm9   # 0x5f75d0
por %xmm10, %xmm9
por %xmm0, %xmm9
pxor 0x263c82(%rip), %xmm9   # 0x5f7770
movq 0xc8(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
cmpq %r13, %rbp
jae 0x393b18
pextrw $0x7, %xmm9, %edi
movq 0xb8(%rsp), %rsi
addq %rax, %rsi
movb %dil, (%rbp,%rsi)
cmpq %rdx, 0x8(%rsp)
setae %sil
leaq -0x1(%rbp), %rdi
cmpq %r13, %rdi
setae %dil
orb %sil, %dil
jne 0x393b47
pextrw $0x6, %xmm9, %esi
movq 0xc0(%rsp), %rdi
addq %rax, %rdi
movb %sil, (%rbp,%rdi)
cmpq %rdx, 0x38(%rsp)
pxor %xmm15, %xmm15
jae 0x393b85
leaq -0x2(%rbp), %rsi
cmpq $0x2, %rbp
setae %dil
cmpq %r13, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x393b85
pextrw $0x5, %xmm9, %esi
movq 0x88(%rsp), %rdi
addq %rax, %rdi
movb %sil, (%rbp,%rdi)
cmpq %rdx, 0x18(%rsp)
jae 0x393bbe
leaq -0x3(%rbp), %rsi
cmpq $0x3, %rbp
setae %dil
cmpq %r13, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x393bbe
pextrw $0x4, %xmm9, %esi
movq 0x90(%rsp), %rdi
addq %rax, %rdi
movb %sil, (%rbp,%rdi)
cmpq %rdx, 0x30(%rsp)
jae 0x393bf7
leaq -0x4(%rbp), %rsi
cmpq $0x4, %rbp
setae %dil
cmpq %r13, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x393bf7
pextrw $0x3, %xmm9, %esi
movq 0x98(%rsp), %rdi
addq %rax, %rdi
movb %sil, (%rbp,%rdi)
cmpq %rdx, 0x158(%rsp)
jae 0x393c33
leaq -0x5(%rbp), %rsi
cmpq $0x5, %rbp
setae %dil
cmpq %r13, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x393c33
pextrw $0x2, %xmm9, %esi
movq 0xa0(%rsp), %rdi
addq %rax, %rdi
movb %sil, (%rbp,%rdi)
cmpq %rdx, %r8
jae 0x393c6c
leaq -0x6(%rbp), %rsi
cmpq $0x6, %rbp
setae %dil
cmpq %r13, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x393c6c
movd %xmm9, %esi
shrl $0x10, %esi
movq 0xa8(%rsp), %rdi
addq %rax, %rdi
movb %sil, (%rbp,%rdi)
cmpq %rdx, %rbx
jae 0x393c9b
leaq -0x7(%rbp), %rsi
cmpq $0x7, %rbp
setb %dil
cmpq %r13, %rsi
setge %sil
orb %dil, %sil
jne 0x393c9b
movd %xmm9, %esi
addq 0xb0(%rsp), %rax
movb %sil, (%rbp,%rax)
pandn %xmm5, %xmm14
por %xmm14, %xmm7
movd %xmm3, %eax
movq 0x28(%rsp), %rsi
movw %ax, (%rsi,%rbp,2)
movd %xmm1, %eax
movq 0x20(%rsp), %rdi
movw %ax, (%rdi,%rbp,2)
movdqa 0x180(%rsp), %xmm2
pcmpgtw %xmm11, %xmm2
pand 0x1b0(%rsp), %xmm2
movdqa %xmm11, %xmm0
psraw $0xf, %xmm0
pandn %xmm2, %xmm0
movdqa 0x110(%rsp), %xmm6
movdqa %xmm3, %xmm2
pcmpeqw %xmm6, %xmm2
movdqa %xmm3, %xmm9
pcmpgtw %xmm6, %xmm9
movdqa 0xf0(%rsp), %xmm5
movdqa %xmm5, %xmm4
pcmpgtw %xmm11, %xmm4
pand %xmm2, %xmm4
movdqa %xmm4, %xmm2
movdqa %xmm0, %xmm10
pand %xmm4, %xmm10
por %xmm9, %xmm4
pand %xmm0, %xmm9
pand %xmm9, %xmm8
pandn %xmm9, %xmm2
pandn %xmm6, %xmm9
por %xmm9, %xmm8
movdqa %xmm8, 0x110(%rsp)
por %xmm2, %xmm10
movdqa 0x50(%rsp), %xmm2
pand %xmm10, %xmm2
pandn 0x60(%rsp), %xmm10
por %xmm2, %xmm10
pand %xmm0, %xmm4
movdqa %xmm11, %xmm0
pand %xmm4, %xmm0
pandn %xmm5, %xmm4
por %xmm0, %xmm4
movdqa %xmm4, 0xf0(%rsp)
paddsw 0x261e52(%rip), %xmm11  # 0x5f5be0
incq %rbp
cmpq %rbp, 0x138(%rsp)
jne 0x393905
movdqa 0x50(%rsp), %xmm0
paddsw 0x261e43(%rip), %xmm0   # 0x5f5bf0
movdqa %xmm0, 0x50(%rsp)
movq 0x130(%rsp), %rbx
addq $0x8, %rbx
movq 0x128(%rsp), %rax
addq %rax, 0xb8(%rsp)
addq %rax, 0xc0(%rsp)
addq %rax, 0xb0(%rsp)
addq %rax, 0xa8(%rsp)
addq %rax, 0xa0(%rsp)
addq %rax, 0x98(%rsp)
addq %rax, 0x90(%rsp)
addq %rax, 0x88(%rsp)
cmpq %rdx, %rbx
movq (%rsp), %rbp
movl 0x14(%rsp), %r15d
jb 0x393745
movq 0x200(%rsp), %rbx
movl 0x10(%rsp), %edi
jmp 0x393e52
movaps 0x40(%rsp), %xmm0
movaps %xmm0, 0xe0(%rsp)
movdqa 0x100(%rsp), %xmm0
movdqa %xmm0, 0xd0(%rsp)
movq 0x200(%rsp), %rbx
movq (%rsp), %rbp
movdqa %xmm10, 0x70(%rsp)
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
movq 0xc8(%rsp), %r15
movzwl 0x110(%rsp,%rdx,2), %esi
cmpw %di, %si
jle 0x393e85
movswl 0x70(%rsp,%rdx,2), %eax
movswl 0xf0(%rsp,%rdx,2), %ecx
movl %esi, %edi
jmp 0x393eb1
jne 0x393eb1
movswl 0xf0(%rsp,%rdx,2), %esi
cmpl %esi, %ecx
jle 0x393e9c
movswl 0x70(%rsp,%rdx,2), %eax
movl %esi, %ecx
jmp 0x393eb1
jne 0x393eb1
movl %edi, %r8d
movswl 0x70(%rsp,%rdx,2), %edi
cmpl %edi, %eax
cmovgl %esi, %ecx
cmovgel %edi, %eax
movl %r8d, %edi
incq %rdx
cmpl $0x8, %edx
jne 0x393e67
movdqa 0x40(%rsp), %xmm0
pcmpgtw 0xd0(%rsp), %xmm0
movdqa 0xe0(%rsp), %xmm1
pcmpgtw 0x100(%rsp), %xmm1
por %xmm0, %xmm1
pmovmskb %xmm1, %edx
testl %edx, %edx
je 0x393ef1
orb $0x40, 0xc(%r15)
xorl %edi, %edi
xorl %ecx, %ecx
xorl %eax, %eax
movswl %di, %edx
movl %edx, (%r15)
movl %eax, 0x4(%r15)
movl %ecx, 0x8(%r15)
movq 0x20(%rsp), %rdi
callq 0x2094b5
movq 0x28(%rsp), %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%rbx)
jne 0x393f5d
movq %rbp, %rdi
callq 0x2094b5
jmp 0x393f5d
callq 0x1be345
jmp 0x393f5a
callq 0x1be31f
jmp 0x393f5a
callq 0x1be2f9
jmp 0x393f5a
callq 0x1be2d3
jmp 0x393f5a
callq 0x1be2ad
jmp 0x393f5a
callq 0x1be287
jmp 0x393f5a
callq 0x1be261
xorl %r15d, %r15d
movq %r15, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop