// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sw_diag_sse2_128_16.c
// Function: parasail_sw_rowcol_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 = 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 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;

    /* 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);

    /* initialize result */
#ifdef PARASAIL_TABLE
    result = parasail_result_new_table1(s1Len, s2Len);
#else
#ifdef PARASAIL_ROWCOL
    result = parasail_result_new_rowcol1(s1Len, s2Len);
#else
    result = parasail_result_new();
#endif
#endif
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_DIAG
        | 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 */
    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 vF = 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 = _mm_max_epi16(
                    _mm_subs_epi16(vNH, vOpen),
                    _mm_subs_epi16(vF, vGap));
            vE = _mm_max_epi16(
                    _mm_subs_epi16(vWH, vOpen),
                    _mm_subs_epi16(vE, vGap));
            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);
            vWH = _mm_max_epi16(vNWH, vE);
            vWH = _mm_max_epi16(vWH, vF);
            vWH = _mm_max_epi16(vWH, vZero);
            /* 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);
            }
#ifdef PARASAIL_TABLE
            arr_store_si128(result->tables->score_table, vWH, i, s1Len, j, s2Len);
#endif
#ifdef PARASAIL_ROWCOL
            arr_store_rowcol(result->rowcols->score_row, result->rowcols->score_col, vWH, i, s1Len, j, s2Len);
#endif
            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 0x2fcda5
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x2fcdc9
testl %r8d, %r8d
js 0x2fcded
movl %r9d, %ebp
testl %r9d, %r9d
js 0x2fd869
movq 0x230(%rsp), %r15
testq %r15, %r15
je 0x2fd88a
movq %rdx, %r12
cmpl $0x0, 0x30(%r15)
je 0x2fcc2b
movl 0x34(%r15), %r13d
jmp 0x2fcc3f
testq %rdi, %rdi
je 0x2fd8ab
movl %esi, %r13d
testl %esi, %esi
jle 0x2fd8cc
movq %rdi, 0x70(%rsp)
movl %r8d, %eax
negl %eax
movl 0x20(%r15), %ecx
movl %ecx, %edx
negl %edx
cmpl %eax, %ecx
movl %r8d, 0x18(%rsp)
cmovgl %r8d, %edx
addl $0xffff8001, %edx       # imm = 0xFFFF8001
movw $0x7ffe, %ax            # imm = 0x7FFE
subw 0x1c(%r15), %ax
movl %eax, 0x10(%rsp)
movl %edx, 0xc(%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, 0x100(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0xc0(%rsp)
movl %r13d, %edi
movl %r14d, %esi
callq 0x1ab93b
testq %rax, %rax
je 0x2fcd12
movq %rax, %rbx
movl %ebp, 0x40(%rsp)
movq %r12, 0x50(%rsp)
orl $0x8241004, 0xc(%rax)   # imm = 0x8241004
movq %r14, 0x20(%rsp)
leal 0xe(%r14), %r12d
pushq $0x10
popq %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1ab77b
movq %rax, %r14
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1ab77b
movq %rax, %rbp
pushq $0x10
popq %rdi
movq %r12, %rsi
callq 0x1ab77b
testq %r14, %r14
sete %dl
movq %rbp, 0x98(%rsp)
testq %rbp, %rbp
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
je 0x2fcd19
xorl %ebx, %ebx
jmp 0x2fd8f4
movq %rbx, 0x90(%rsp)
cmpl $0x0, 0x30(%r15)
movslq %r13d, %rbx
movq %rax, 0x68(%rsp)
je 0x2fcd4d
movq $0x0, 0x60(%rsp)
movl 0xc(%rsp), %r8d
movq 0x50(%rsp), %r9
movl 0x40(%rsp), %r10d
jmp 0x2fce28
leal 0x7(%r13), %eax
movslq %eax, %r12
pushq $0x10
popq %rdi
movq %r12, %rsi
callq 0x1ab77b
xorl %edi, %edi
testq %rax, %rax
movq 0x50(%rsp), %r9
movl 0x40(%rsp), %r10d
je 0x2fcd12
testl %r13d, %r13d
movl $0x0, %ecx
cmovgl %r13d, %ecx
movl 0xc(%rsp), %r8d
movq 0x70(%rsp), %r11
cmpq %rdi, %rcx
je 0x2fce11
movq 0x10(%r15), %rdx
movzbl (%r11,%rdi), %esi
movzwl (%rdx,%rsi,4), %edx
movw %dx, (%rax,%rdi,2)
incq %rdi
jmp 0x2fcd86
movq 0x43e22c(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2ca235(%rip), %rsi    # 0x5c6feb
leaq 0x28a3c2(%rip), %rdx    # 0x58717f
leaq 0x2ca939(%rip), %rcx    # 0x5c76fd
jmp 0x2fd8eb
movq 0x43e208(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2ca927(%rip), %rsi    # 0x5c7701
leaq 0x28a39e(%rip), %rdx    # 0x58717f
leaq 0x2ca92d(%rip), %rcx    # 0x5c7715
jmp 0x2fd8eb
movq 0x43e1e4(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2ca91d(%rip), %rsi    # 0x5c771b
leaq 0x28a37a(%rip), %rdx    # 0x58717f
leaq 0x2ca924(%rip), %rcx    # 0x5c7730
jmp 0x2fd8eb
movq %rbx, %rcx
cmpq %r12, %rcx
jge 0x2fce23
andw $0x0, (%rax,%rcx,2)
incq %rcx
jmp 0x2fce14
movq %rax, 0x60(%rsp)
movq 0x20(%rsp), %rax
leal 0x7(%rax), %edi
movd 0x10(%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, 0x180(%rsp)
movaps 0x2cae20(%rip), %xmm0   # 0x5c7c70
andps 0x80(%rsp), %xmm0
movaps %xmm0, 0x1a0(%rsp)
movd 0x18(%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 %r10d, %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 %r13d, %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 0x98(%rsp), %rbp
cmpq %rdx, %rcx
je 0x2fcee9
movzbl (%r9,%rdx), %esi
movzwl (%rax,%rsi,4), %esi
movw %si, 0xe(%r14,%rdx,2)
incq %rdx
jmp 0x2fced0
xorl %eax, %eax
movq 0x68(%rsp), %rdx
cmpq $0x7, %rax
je 0x2fcf01
andw $0x0, (%r14,%rax,2)
incq %rax
jmp 0x2fcef0
movq %rcx, %rax
cmpl %eax, %edi
jle 0x2fcf14
andw $0x0, 0xe(%r14,%rax,2)
incq %rax
jmp 0x2fcf04
xorl %eax, %eax
cmpq %rax, %rcx
je 0x2fcf2c
andw $0x0, 0xe(%rbp,%rax,2)
movw %r8w, 0xe(%rdx,%rax,2)
incq %rax
jmp 0x2fcf16
xorl %eax, %eax
cmpq $0x7, %rax
je 0x2fcf44
movw %r8w, (%rbp,%rax,2)
movw %r8w, (%rdx,%rax,2)
incq %rax
jmp 0x2fcf2e
movq %rcx, %rax
cmpl %eax, %edi
jle 0x2fcf5c
movw %r8w, 0xe(%rbp,%rax,2)
movw %r8w, 0xe(%rdx,%rax,2)
incq %rax
jmp 0x2fcf47
decl %r13d
movq 0x20(%rsp), %rax
decl %eax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
testl %edi, %edi
cmovlel %eax, %edi
movq %rdi, 0x178(%rsp)
movdqa 0x100(%rsp), %xmm15
movdqa 0xc0(%rsp), %xmm2
leaq 0x6(%rcx), %rsi
movq %rsi, 0x140(%rsp)
leaq 0x5(%rcx), %rsi
movq %rsi, 0x138(%rsp)
leaq 0x4(%rcx), %rsi
movq %rsi, 0x130(%rsp)
leaq 0x3(%rcx), %rsi
movq %rsi, 0x128(%rsp)
leaq 0x2(%rcx), %rsi
movq %rsi, 0x120(%rsp)
leaq 0x1(%rcx), %rsi
movq %rsi, 0x118(%rsp)
movaps 0x2caa64(%rip), %xmm0   # 0x5c7a40
movaps %xmm0, 0xa0(%rsp)
movdqa 0x80(%rsp), %xmm0
movdqa %xmm0, %xmm3
movdqa %xmm0, 0xe0(%rsp)
movdqa 0x180(%rsp), %xmm0
movdqa %xmm0, 0xd0(%rsp)
movdqa 0x1d0(%rsp), %xmm5
movdqa 0x1c0(%rsp), %xmm10
movq %rax, 0x38(%rsp)
cmpq %rbx, %rax
jge 0x2fd766
cmpl $0x0, 0x30(%r15)
je 0x2fd0d8
movq 0x38(%rsp), %r10
movq %r10, %rax
orq $0x1, %rax
cmpq %rbx, %rax
movq %rax, 0x18(%rsp)
cmovgel %r13d, %eax
movl %eax, 0x70(%rsp)
movq %r10, %rax
orq $0x2, %rax
cmpq %rbx, %rax
movq %rax, 0x10(%rsp)
cmovgel %r13d, %eax
movl %eax, 0x50(%rsp)
movq %r10, %rax
orq $0x3, %rax
cmpq %rbx, %rax
movl %eax, %esi
cmovgel %r13d, %esi
movl %esi, 0xb0(%rsp)
movq %r10, %rsi
orq $0x4, %rsi
cmpq %rbx, %rsi
movl %esi, %edi
cmovgel %r13d, %edi
movl %edi, 0x40(%rsp)
movq %r10, %rdi
orq $0x5, %rdi
cmpq %rbx, %rdi
movl %edi, %r11d
cmovgel %r13d, %r11d
movq %r10, %r8
orq $0x6, %r8
cmpq %rbx, %r8
movl %r8d, %r9d
cmovgel %r13d, %r9d
movl %r9d, 0x28(%rsp)
movq %r10, %r9
orq $0x7, %r9
cmpq %rbx, %r9
movl %r9d, %r12d
cmovgel %r13d, %r12d
movl %r10d, 0x30(%rsp)
jmp 0x2fd168
movq 0x60(%rsp), %r10
movq 0x38(%rsp), %r12
movswl (%r10,%r12,2), %eax
movl %eax, 0x30(%rsp)
movq %r12, %rax
orq $0x1, %rax
movq %rax, 0x18(%rsp)
movswl 0x2(%r10,%r12,2), %eax
movl %eax, 0x70(%rsp)
movq %r12, %rax
orq $0x2, %rax
movq %rax, 0x10(%rsp)
movswl 0x4(%r10,%r12,2), %eax
movl %eax, 0x50(%rsp)
movq %r12, %rax
orq $0x3, %rax
movswl 0x6(%r10,%r12,2), %esi
movl %esi, 0xb0(%rsp)
movq %r12, %rsi
orq $0x4, %rsi
movswl 0x8(%r10,%r12,2), %edi
movl %edi, 0x40(%rsp)
movq %r12, %rdi
orq $0x5, %rdi
movswl 0xa(%r10,%r12,2), %r11d
movq %r12, %r8
orq $0x6, %r8
movswl 0xc(%r10,%r12,2), %r9d
movl %r9d, 0x28(%rsp)
movq %r12, %r9
orq $0x7, %r9
movswl 0xe(%r10,%r12,2), %r12d
movq 0x8(%r15), %r10
movl 0x18(%r15), %r15d
imull %r15d, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r11
movq %r11, 0x170(%rsp)
movl 0xb0(%rsp), %r11d
imull %r15d, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r11
movq %r11, 0x168(%rsp)
movl 0x70(%rsp), %r11d
imull %r15d, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r11
movq %r11, 0x160(%rsp)
movl 0x30(%rsp), %r11d
imull %r15d, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r11
movq %r11, 0x30(%rsp)
movl 0x50(%rsp), %r11d
imull %r15d, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r11
movq %r11, 0x158(%rsp)
movl 0x40(%rsp), %r11d
imull %r15d, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r11
movq %r11, 0x150(%rsp)
movl 0x28(%rsp), %r11d
imull %r15d, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r11
movq %r11, 0x28(%rsp)
imull %r15d, %r12d
movslq %r12d, %r11
leaq (%r10,%r11,4), %r10
movq %r10, 0x148(%rsp)
movdqa 0x190(%rsp), %xmm0
pcmpgtw 0xa0(%rsp), %xmm0
movdqa %xmm0, 0x1e0(%rsp)
xorl %r11d, %r11d
movdqa 0x1a0(%rsp), %xmm1
movdqa %xmm1, %xmm11
movdqa 0x80(%rsp), %xmm13
movdqa %xmm13, %xmm7
movdqa 0x2ca9a9(%rip), %xmm9   # 0x5c7c10
cmpq %r11, 0x178(%rsp)
je 0x2fd731
movdqa %xmm3, 0x40(%rsp)
movdqa %xmm15, 0x50(%rsp)
movdqa %xmm2, 0x70(%rsp)
movswq 0xe(%r14,%r11,2), %r10
movq 0x30(%rsp), %r15
movd (%r15,%r10,4), %xmm14
movswq 0xc(%r14,%r11,2), %r10
movq 0x160(%rsp), %r15
movd (%r15,%r10,4), %xmm15
movswq 0xa(%r14,%r11,2), %r10
movq 0x158(%rsp), %r15
movd (%r15,%r10,4), %xmm8
movswq 0x8(%r14,%r11,2), %r10
movq 0x168(%rsp), %r15
movd (%r15,%r10,4), %xmm12
movswq 0x6(%r14,%r11,2), %r10
movq 0x150(%rsp), %r15
movd (%r15,%r10,4), %xmm4
movswq 0x4(%r14,%r11,2), %r10
movq 0x170(%rsp), %r15
movd (%r15,%r10,4), %xmm2
movswq 0x2(%r14,%r11,2), %r10
movq 0x28(%rsp), %r15
movd (%r15,%r10,4), %xmm3
movswq (%r14,%r11,2), %r10
movq 0x148(%rsp), %r15
movd (%r15,%r10,4), %xmm0
movdqa %xmm1, %xmm6
psrldq $0x2, %xmm6             # xmm6 = xmm6[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
pinsrw $0x7, 0xe(%rbp,%r11,2), %xmm6
psrldq $0x2, %xmm13            # xmm13 = xmm13[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
pinsrw $0x7, 0xe(%rdx,%r11,2), %xmm13
movdqa %xmm6, 0xb0(%rsp)
psubsw %xmm5, %xmm6
psubsw %xmm10, %xmm13
pmaxsw %xmm6, %xmm13
psubsw %xmm5, %xmm1
psubsw %xmm10, %xmm7
pmaxsw %xmm1, %xmm7
punpcklwd %xmm14, %xmm15  # xmm15 = xmm15[0],xmm14[0],xmm15[1],xmm14[1],xmm15[2],xmm14[2],xmm15[3],xmm14[3]
punpcklwd %xmm8, %xmm12   # xmm12 = xmm12[0],xmm8[0],xmm12[1],xmm8[1],xmm12[2],xmm8[2],xmm12[3],xmm8[3]
punpckldq %xmm15, %xmm12  # xmm12 = xmm12[0],xmm15[0],xmm12[1],xmm15[1]
punpcklwd %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1],xmm2[2],xmm4[2],xmm2[3],xmm4[3]
movq 0x38(%rsp), %rbp
cmpq %r13, %rbp
setne %r10b
punpcklwd %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1],xmm0[2],xmm3[2],xmm0[3],xmm3[3]
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm12, %xmm0   # xmm0 = xmm0[0],xmm12[0]
paddsw %xmm0, %xmm11
movdqa %xmm7, %xmm15
pmaxsw %xmm13, %xmm15
pmaxsw 0x2ca858(%rip), %xmm15  # 0x5c7c00
pmaxsw %xmm11, %xmm15
movdqa %xmm9, %xmm14
pcmpeqw 0x2ca7a5(%rip), %xmm14  # 0x5c7b60
movdqa %xmm14, %xmm1
pandn %xmm15, %xmm1
cmpq $0x8, %r11
jb 0x2fd3f7
movdqa 0xd0(%rsp), %xmm0
pminsw %xmm1, %xmm0
movdqa %xmm0, 0xd0(%rsp)
movdqa 0xe0(%rsp), %xmm0
pmaxsw %xmm1, %xmm0
movdqa %xmm0, 0xe0(%rsp)
movq 0x90(%rsp), %rdx
movq 0x10(%rdx), %r15
movq (%r15), %r12
movq 0x8(%r15), %r15
cmpq %rcx, %r11
setae %dl
orb %dl, %r10b
pextrw $0x7, %xmm1, %r10d
jne 0x2fd41f
movl %r10d, (%r12,%r11,4)
cmpq %r11, 0x20(%rsp)
jne 0x2fd42a
movl %r10d, (%r15,%rbp,4)
cmpq %r13, 0x18(%rsp)
setne %dl
leaq -0x1(%r11), %r10
cmpq %rcx, %r10
setae %r10b
orb %dl, %r10b
pextrw $0x6, %xmm1, %r10d
jne 0x2fd44d
movl %r10d, -0x4(%r12,%r11,4)
cmpq %rbx, 0x18(%rsp)
setge %dl
cmpq %r11, %rcx
setne %bpl
orb %dl, %bpl
jne 0x2fd46a
movq 0x18(%rsp), %rdx
movl %r10d, (%r15,%rdx,4)
pextrw $0x5, %xmm1, %r10d
cmpq %r13, 0x10(%rsp)
jne 0x2fd496
leaq -0x2(%r11), %rdx
cmpq $0x2, %r11
setae %bpl
cmpq %rcx, %rdx
setl %dl
andb %bpl, %dl
cmpb $0x1, %dl
jne 0x2fd496
movl %r10d, -0x8(%r12,%r11,4)
cmpq %rbx, 0x10(%rsp)
setge %dl
cmpq %r11, 0x118(%rsp)
setne %bpl
orb %dl, %bpl
jne 0x2fd4b8
movq 0x10(%rsp), %rdx
movl %r10d, (%r15,%rdx,4)
pextrw $0x4, %xmm1, %r10d
cmpq %r13, %rax
jne 0x2fd4e2
leaq -0x3(%r11), %rdx
cmpq $0x3, %r11
setae %bpl
cmpq %rcx, %rdx
setl %dl
andb %bpl, %dl
cmpb $0x1, %dl
jne 0x2fd4e2
movl %r10d, -0xc(%r12,%r11,4)
cmpq %rbx, %rax
setge %dl
cmpq %r11, 0x120(%rsp)
setne %bpl
orb %dl, %bpl
jne 0x2fd4fd
movl %r10d, (%r15,%rax,4)
pextrw $0x3, %xmm1, %r10d
cmpq %r13, %rsi
jne 0x2fd527
leaq -0x4(%r11), %rdx
cmpq $0x4, %r11
setae %bpl
cmpq %rcx, %rdx
setl %dl
andb %bpl, %dl
cmpb $0x1, %dl
jne 0x2fd527
movl %r10d, -0x10(%r12,%r11,4)
cmpq %rbx, %rsi
setge %dl
cmpq %r11, 0x128(%rsp)
setne %bpl
orb %dl, %bpl
jne 0x2fd542
movl %r10d, (%r15,%rsi,4)
pextrw $0x2, %xmm1, %r10d
cmpq %r13, %rdi
jne 0x2fd56c
leaq -0x5(%r11), %rdx
cmpq $0x5, %r11
setae %bpl
cmpq %rcx, %rdx
setl %dl
andb %bpl, %dl
cmpb $0x1, %dl
jne 0x2fd56c
movl %r10d, -0x14(%r12,%r11,4)
cmpq %rbx, %rdi
setge %dl
cmpq %r11, 0x130(%rsp)
setne %bpl
orb %dl, %bpl
jne 0x2fd587
movl %r10d, (%r15,%rdi,4)
pextrw $0x1, %xmm1, %r10d
cmpq %r13, %r8
jne 0x2fd5b1
leaq -0x6(%r11), %rdx
cmpq $0x6, %r11
setae %bpl
cmpq %rcx, %rdx
setl %dl
andb %bpl, %dl
cmpb $0x1, %dl
jne 0x2fd5b1
movl %r10d, -0x18(%r12,%r11,4)
cmpq %rbx, %r8
setge %dl
cmpq %r11, 0x138(%rsp)
setne %bpl
orb %dl, %bpl
jne 0x2fd5cc
movl %r10d, (%r15,%r8,4)
cmpq %r13, %r9
setne %dl
cmpq $0x7, %r11
setb %r10b
orb %dl, %r10b
movq 0x98(%rsp), %rbp
jne 0x2fd5f1
pextrw $0x0, %xmm1, %edx
movl %edx, -0x1c(%r12,%r11,4)
cmpq %rbx, %r9
setge %dl
cmpq %r11, 0x140(%rsp)
setne %r10b
movd %xmm1, %r12d
orb %dl, %r10b
jne 0x2fd615
movzwl %r12w, %edx
movl %edx, (%r15,%r9,4)
movdqa %xmm14, %xmm12
pandn %xmm13, %xmm12
movdqa 0x80(%rsp), %xmm0
pand %xmm14, %xmm0
por %xmm0, %xmm12
pandn %xmm7, %xmm14
por %xmm0, %xmm14
movdqa 0x1b0(%rsp), %xmm0
pcmpgtw %xmm9, %xmm0
pand 0x1e0(%rsp), %xmm0
movdqa %xmm9, %xmm11
psraw $0xf, %xmm11
pandn %xmm0, %xmm11
movdqa %xmm1, %xmm0
movdqa 0x50(%rsp), %xmm4
pcmpeqw %xmm4, %xmm0
movdqa %xmm1, %xmm2
pcmpgtw %xmm4, %xmm2
movdqa 0x70(%rsp), %xmm3
movdqa %xmm3, %xmm7
pcmpgtw %xmm9, %xmm7
pand %xmm0, %xmm7
movdqa %xmm11, %xmm0
pand %xmm7, %xmm0
movdqa %xmm7, %xmm13
por %xmm2, %xmm7
pand %xmm11, %xmm2
pand %xmm2, %xmm15
pandn %xmm2, %xmm13
pandn %xmm4, %xmm2
por %xmm2, %xmm15
por %xmm0, %xmm13
movdqa 0xa0(%rsp), %xmm0
pand %xmm13, %xmm0
pandn 0x40(%rsp), %xmm13
por %xmm0, %xmm13
pand %xmm11, %xmm7
movdqa %xmm9, %xmm0
pand %xmm7, %xmm0
pandn %xmm3, %xmm7
por %xmm0, %xmm7
movw %r12w, (%rbp,%r11,2)
movd %xmm12, %edx
movq 0x68(%rsp), %r10
movw %dx, (%r10,%r11,2)
movq %r10, %rdx
paddsw 0x2ca514(%rip), %xmm9   # 0x5c7c20
incq %r11
movdqa %xmm7, %xmm2
movdqa %xmm13, %xmm3
movdqa 0xb0(%rsp), %xmm11
movdqa %xmm14, %xmm7
movdqa %xmm12, %xmm13
jmp 0x2fd267
movdqa 0xa0(%rsp), %xmm0
paddsw 0x2ca4ee(%rip), %xmm0   # 0x5c7c30
movdqa %xmm0, 0xa0(%rsp)
movq 0x38(%rsp), %rax
addq $0x8, %rax
movq 0x230(%rsp), %r15
movl 0xc(%rsp), %r8d
jmp 0x2fd01f
movdqa %xmm15, 0x100(%rsp)
movdqa %xmm2, 0xc0(%rsp)
movdqa %xmm3, 0xf0(%rsp)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
movq 0x90(%rsp), %rbx
cmpl $0x8, %ecx
je 0x2fd7ee
movzwl 0x100(%rsp,%rcx,2), %esi
cmpw %r8w, %si
jle 0x2fd7b5
movswl 0xf0(%rsp,%rcx,2), %eax
movswl 0xc0(%rsp,%rcx,2), %edi
jmp 0x2fd7e4
jne 0x2fd7df
movswl 0xc0(%rsp,%rcx,2), %edi
cmpl %edi, %edx
jle 0x2fd7d0
movswl 0xf0(%rsp,%rcx,2), %eax
movl %r8d, %esi
jmp 0x2fd7e4
jne 0x2fd7df
movswl 0xf0(%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 0x2fd790
movdqa 0x80(%rsp), %xmm0
pcmpgtw 0xd0(%rsp), %xmm0
movdqa 0xe0(%rsp), %xmm1
pcmpgtw 0x180(%rsp), %xmm1
por %xmm0, %xmm1
pmovmskb %xmm1, %ecx
testl %ecx, %ecx
je 0x2fd829
orb $0x40, 0xc(%rbx)
xorl %r8d, %r8d
xorl %edx, %edx
xorl %eax, %eax
movswl %r8w, %ecx
movl %ecx, (%rbx)
movl %eax, 0x4(%rbx)
movl %edx, 0x8(%rbx)
movq 0x68(%rsp), %rdi
callq 0x1ab763
movq %rbp, %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%r15)
jne 0x2fd8f4
movq 0x60(%rsp), %rdi
callq 0x1ab763
jmp 0x2fd8f4
movq 0x43d768(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2c9ea1(%rip), %rsi    # 0x5c771b
leaq 0x2898fe(%rip), %rdx    # 0x58717f
leaq 0x2c9ead(%rip), %rcx    # 0x5c7735
jmp 0x2fd8eb
movq 0x43d747(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2c9750(%rip), %rsi    # 0x5c6feb
leaq 0x2898dd(%rip), %rdx    # 0x58717f
leaq 0x2ca099(%rip), %rcx    # 0x5c7942
jmp 0x2fd8eb
movq 0x43d726(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2c972f(%rip), %rsi    # 0x5c6feb
leaq 0x2898bc(%rip), %rdx    # 0x58717f
leaq 0x2c9e6f(%rip), %rcx    # 0x5c7739
jmp 0x2fd8eb
movq 0x43d705(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2c9e24(%rip), %rsi    # 0x5c7701
leaq 0x28989b(%rip), %rdx    # 0x58717f
leaq 0x2c9e52(%rip), %rcx    # 0x5c773d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)