// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sg_diag_sse2_128_32.c
// Function: parasail_sg_flags_rowcol_diag_sse2_128_32
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,
        int s1_beg, int s1_end, int s2_beg, int s2_end)
{
    /* 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;
    int32_t * restrict s1 = NULL;
    int32_t * restrict s2B = NULL;
    int32_t * restrict _H_pr = NULL;
    int32_t * restrict _F_pr = NULL;
    int32_t * restrict s2 = NULL;
    int32_t * restrict H_pr = NULL;
    int32_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;
    int32_t NEG_LIMIT = 0;
    int32_t POS_LIMIT = 0;
    int32_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vNegInf;
    __m128i vOpen;
    __m128i vGap;
    __m128i vOne;
    __m128i vN;
    __m128i vGapN;
    __m128i vNegOne;
    __m128i vI;
    __m128i vJreset;
    __m128i vMaxHRow;
    __m128i vMaxHCol;
    __m128i vLastVal;
    __m128i vEndI;
    __m128i vEndJ;
    __m128i vILimit;
    __m128i vILimit1;
    __m128i vJLimit;
    __m128i vJLimit1;
    __m128i vIBoundary;

    /* 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 = 4; /* 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 ? INT32_MIN + open : INT32_MIN - matrix->min) + 1;
    POS_LIMIT = INT32_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm_set1_epi32(NEG_LIMIT);
    vOpen = _mm_set1_epi32(open);
    vGap  = _mm_set1_epi32(gap);
    vOne = _mm_set1_epi32(1);
    vN = _mm_set1_epi32(N);
    vGapN = s1_beg ? _mm_set1_epi32(0) : _mm_set1_epi32(gap*N);
    vNegOne = _mm_set1_epi32(-1);
    vI = _mm_set_epi32(0,1,2,3);
    vJreset = _mm_set_epi32(0,-1,-2,-3);
    vMaxHRow = vNegInf;
    vMaxHCol = vNegInf;
    vLastVal = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm_set1_epi32(s1Len);
    vILimit1 = _mm_sub_epi32(vILimit, vOne);
    vJLimit = _mm_set1_epi32(s2Len);
    vJLimit1 = _mm_sub_epi32(vJLimit, vOne);
    vIBoundary = s1_beg ? _mm_set1_epi32(0) : _mm_set_epi32(
            -open-0*gap,
            -open-1*gap,
            -open-2*gap,
            -open-3*gap);

    /* 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_SG | PARASAIL_FLAG_DIAG
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_4;
    result->flag |= s1_beg ? PARASAIL_FLAG_SG_S1_BEG : 0;
    result->flag |= s1_end ? PARASAIL_FLAG_SG_S1_END : 0;
    result->flag |= s2_beg ? PARASAIL_FLAG_SG_S2_BEG : 0;
    result->flag |= s2_end ? PARASAIL_FLAG_SG_S2_END : 0;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    s2B= parasail_memalign_int32_t(16, s2Len+PAD2);
    _H_pr = parasail_memalign_int32_t(16, s2Len+PAD2);
    _F_pr = parasail_memalign_int32_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_int32_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 */
    if (s2_beg) {
        for (j=0; j<s2Len; ++j) {
            H_pr[j] = 0;
            F_pr[j] = NEG_LIMIT;
        }
    }
    else {
        for (j=0; j<s2Len; ++j) {
            H_pr[j] = -open - j*gap;
            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;
    }
    H_pr[-1] = 0; /* upper left corner */

    /* iterate over query sequence */
    for (i=0; i<s1Len; i+=N) {
        __m128i vNH = vNegInf;
        __m128i vWH = vNegInf;
        __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))];
        __m128i vIltLimit = _mm_cmplt_epi32(vI, vILimit);
        __m128i vIeqLimit1 = _mm_cmpeq_epi32(vI, vILimit1);
        vNH = _mm_srli_si128(vNH, 4);
        vNH = _mm_insert_epi32_rpl(vNH, H_pr[-1], 3);
        vWH = _mm_srli_si128(vWH, 4);
        vWH = _mm_insert_epi32_rpl(vWH, s1_beg ? 0 : (-open - i*gap), 3);
        H_pr[-1] = -open - (i+N)*gap;
        /* iterate over database sequence */
        for (j=0; j<s2Len+PAD; ++j) {
            __m128i vMat;
            __m128i vNWH = vNH;
            vNH = _mm_srli_si128(vWH, 4);
            vNH = _mm_insert_epi32_rpl(vNH, H_pr[j], 3);
            vF = _mm_srli_si128(vF, 4);
            vF = _mm_insert_epi32_rpl(vF, F_pr[j], 3);
            vF = _mm_max_epi32_rpl(
                    _mm_sub_epi32(vNH, vOpen),
                    _mm_sub_epi32(vF, vGap));
            vE = _mm_max_epi32_rpl(
                    _mm_sub_epi32(vWH, vOpen),
                    _mm_sub_epi32(vE, vGap));
            vMat = _mm_set_epi32(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]],
                    matrow2[s2[j-2]],
                    matrow3[s2[j-3]]
                    );
            vNWH = _mm_add_epi32(vNWH, vMat);
            vWH = _mm_max_epi32_rpl(vNWH, vE);
            vWH = _mm_max_epi32_rpl(vWH, vF);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m128i cond = _mm_cmpeq_epi32(vJ,vNegOne);
                vWH = _mm_blendv_epi8_rpl(vWH, vIBoundary, cond);
                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_epi32_rpl(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm_max_epi32_rpl(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-3] = (int32_t)_mm_extract_epi32_rpl(vWH,0);
            F_pr[j-3] = (int32_t)_mm_extract_epi32_rpl(vF,0);
            /* as minor diagonal vector passes across the i or j limit
             * boundary, extract the last value of the column or row */
            {
                __m128i vJeqLimit1 = _mm_cmpeq_epi32(vJ, vJLimit1);
                __m128i vJgtNegOne = _mm_cmpgt_epi32(vJ, vNegOne);
                __m128i vJltLimit = _mm_cmplt_epi32(vJ, vJLimit);
                __m128i cond_j = _mm_and_si128(vIltLimit, vJeqLimit1);
                __m128i cond_i = _mm_and_si128(vIeqLimit1,
                        _mm_and_si128(vJgtNegOne, vJltLimit));
                __m128i cond_max_row = _mm_cmpgt_epi32(vWH, vMaxHRow);
                __m128i cond_max_col = _mm_cmpgt_epi32(vWH, vMaxHCol);
                __m128i cond_last_val = _mm_and_si128(vIeqLimit1, vJeqLimit1);
                __m128i cond_all_row = _mm_and_si128(cond_max_row, cond_i);
                __m128i cond_all_col = _mm_and_si128(cond_max_col, cond_j);
                vMaxHRow = _mm_blendv_epi8_rpl(vMaxHRow, vWH, cond_all_row);
                vMaxHCol = _mm_blendv_epi8_rpl(vMaxHCol, vWH, cond_all_col);
                vLastVal = _mm_blendv_epi8_rpl(vLastVal, vWH, cond_last_val);
                vEndI = _mm_blendv_epi8_rpl(vEndI, vI, cond_all_col);
                vEndJ = _mm_blendv_epi8_rpl(vEndJ, vJ, cond_all_row);
            }
            vJ = _mm_add_epi32(vJ, vOne);
        }
        vI = _mm_add_epi32(vI, vN);
        vIBoundary = _mm_sub_epi32(vIBoundary, vGapN);
    }

    /* alignment ending position */
    {
        int32_t max_row = NEG_LIMIT;
        int32_t max_col = NEG_LIMIT;
        int32_t last_val = NEG_LIMIT;
        int32_t *s = (int32_t*)&vMaxHRow;
        int32_t *t = (int32_t*)&vMaxHCol;
        int32_t *u = (int32_t*)&vLastVal;
        int32_t *i = (int32_t*)&vEndI;
        int32_t *j = (int32_t*)&vEndJ;
        int32_t k;
        for (k=0; k<N; ++k, ++s, ++t, ++u, ++i, ++j) {
            if (*t > max_col || (*t == max_col && *i < end_query)) {
                max_col = *t;
                end_query = *i;
            }
            if (*s > max_row) {
                max_row = *s;
                end_ref = *j;
            }
            if (*u > last_val) {
                last_val = *u;
            }
        }
        if (s1_end && s2_end) {
            if (max_col > max_row || (max_col == max_row && end_ref == s2Len-1)) {
                score = max_col;
                end_ref = s2Len-1;
            }
            else {
                score = max_row;
                end_query = s1Len-1;
            }
        }
        else if (s1_end) {
            score = max_col;
            end_ref = s2Len-1;
        }
        else if (s2_end) {
            score = max_row;
            end_query = s1Len-1;
        }
        else {
            score = last_val;
            end_query = s1Len-1;
            end_ref = s2Len-1;
        }
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi32(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi32(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 $0x1e8, %rsp            # imm = 0x1E8
movq %r9, 0x18(%rsp)
movq %rdi, 0x90(%rsp)
testq %rdx, %rdx
je 0x2f9fe6
movl %ecx, %r12d
testl %ecx, %ecx
jle 0x2fa00a
testl %r8d, %r8d
js 0x2fa02e
cmpl $0x0, 0x18(%rsp)
js 0x2fa06c
movq 0x220(%rsp), %rbp
testq %rbp, %rbp
je 0x2fa08d
cmpl $0x0, 0x30(%rbp)
je 0x2f949f
movl 0x34(%rbp), %r15d
jmp 0x2f94b9
cmpq $0x0, 0x90(%rsp)
je 0x2fa0ae
movl %esi, %r15d
testl %esi, %esi
jle 0x2fa0cf
leal 0x3(%r15), %edi
leal 0x3(%r12), %eax
movq %rax, 0x28(%rsp)
movl %r8d, %esi
negl %esi
movl 0x20(%rbp), %eax
movl $0x80000000, %r13d      # imm = 0x80000000
movl %r8d, %ecx
orl %r13d, %ecx
subl %eax, %r13d
movl %esi, 0x10(%rsp)
cmpl %esi, %eax
cmovgl %ecx, %r13d
incl %r13d
movl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
subl 0x1c(%rbp), %ebx
movd %r13d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x50(%rsp)
movd 0x18(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pxor %xmm1, %xmm1
movdqa %xmm1, 0x70(%rsp)
cmpl $0x0, 0x228(%rsp)
movdqa %xmm0, 0x1b0(%rsp)
movl %edi, 0x20(%rsp)
je 0x2f9535
pxor %xmm0, %xmm0
jmp 0x2f953a
pslld $0x2, %xmm0
movdqa %xmm0, 0x130(%rsp)
movq %rdx, 0x80(%rsp)
movdqa 0x50(%rsp), %xmm0
movdqa %xmm0, 0xe0(%rsp)
movdqa %xmm0, 0xd0(%rsp)
movdqa %xmm0, 0x140(%rsp)
movdqa %xmm0, 0xc0(%rsp)
jne 0x2f95b2
movl 0x10(%rsp), %edi
movl %edi, %eax
movq 0x18(%rsp), %rsi
subl %esi, %eax
movl %edi, %edx
subl %esi, %edx
subl %esi, %edx
imull $-0x3, %esi, %ecx
subl %r8d, %ecx
movd %edx, %xmm0
movd %ecx, %xmm2
punpckldq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movd %eax, %xmm0
movd %edi, %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
movdqa %xmm2, 0x70(%rsp)
movl %r8d, 0x40(%rsp)
movl %r15d, %edi
movl %r12d, %esi
callq 0x1ab93b
testq %rax, %rax
je 0x2f9678
movq %rax, %r14
movl %ebx, 0x30(%rsp)
movl %r13d, 0x14(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x228(%rsp)
setne %al
xorl %ecx, %ecx
cmpl $0x0, 0x230(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x238(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x240(%rsp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rax,8), %eax
orl %edx, %eax
orl %esi, %eax
orl 0xc(%r14), %eax
orl $0x4441002, %eax        # imm = 0x4441002
movl %eax, 0xc(%r14)
movq %r12, 0x8(%rsp)
leal 0x6(%r12), %r13d
pushq $0x10
popq %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1ab783
movq %rax, %r12
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1ab783
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %r13
callq 0x1ab783
movq %rax, %r11
testq %r12, %r12
sete %al
testq %r13, %r13
sete %cl
orb %al, %cl
testq %r11, %r11
sete %al
orb %cl, %al
je 0x2f967f
xorl %ebx, %ebx
jmp 0x2fa0f7
movq %r14, 0x68(%rsp)
cmpl $0x0, 0x30(%rbp)
movslq %r15d, %r14
movq %r11, 0x38(%rsp)
je 0x2f9797
xorl %eax, %eax
movl 0x14(%rsp), %r10d
movl 0x230(%rsp), %r9d
movq 0x80(%rsp), %r8
movl 0x30(%rsp), %ebx
movd %r15d, %xmm0
movq 0x8(%rsp), %rcx
movd %ecx, %xmm1
movd %ebx, %xmm2
movd 0x40(%rsp), %xmm3
pshufd $0x0, %xmm0, %xmm4      # xmm4 = xmm0[0,0,0,0]
pcmpeqd %xmm5, %xmm5
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
pshufd $0x0, %xmm2, %xmm0      # xmm0 = xmm2[0,0,0,0]
movdqa %xmm0, 0x120(%rsp)
pshufd $0x0, %xmm3, %xmm0      # xmm0 = xmm3[0,0,0,0]
movdqa %xmm0, 0x170(%rsp)
movdqa %xmm4, 0x1a0(%rsp)
paddd %xmm5, %xmm4
movdqa %xmm4, 0x160(%rsp)
movdqa %xmm1, 0x180(%rsp)
paddd %xmm1, %xmm5
movdqa %xmm5, 0x190(%rsp)
movl %ecx, %ebx
movq 0x10(%rbp), %rcx
xorl %edx, %edx
cmpq %rdx, %rbx
je 0x2f973e
movzbl (%r8,%rdx), %esi
movl (%rcx,%rsi,4), %esi
movl %esi, 0xc(%r12,%rdx,4)
incq %rdx
jmp 0x2f9727
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x2f9750
andl $0x0, (%r12,%rcx,4)
incq %rcx
jmp 0x2f9740
leaq (%r12,%rbx,4), %rcx
addq $0xc, %rcx
movq 0x8(%rsp), %rdx
cmpl %edx, 0x28(%rsp)
jle 0x2f976e
andl $0x0, (%rcx)
addq $0x4, %rcx
incl %edx
jmp 0x2f975d
xorl %ecx, %ecx
cmpl $0x0, 0x238(%rsp)
je 0x2f9802
cmpq %rcx, %rbx
je 0x2f981e
andl $0x0, 0xc(%r13,%rcx,4)
movl %r10d, 0xc(%r11,%rcx,4)
incq %rcx
jmp 0x2f977e
movslq 0x20(%rsp), %rsi
pushq $0x10
popq %rdi
movq %rsi, 0x20(%rsp)
callq 0x1ab783
xorl %edi, %edi
testq %rax, %rax
movl 0x14(%rsp), %r10d
movl 0x30(%rsp), %ebx
je 0x2f9678
testl %r15d, %r15d
movl $0x0, %ecx
cmovgl %r15d, %ecx
movq 0x38(%rsp), %r11
movl 0x230(%rsp), %r9d
movq 0x80(%rsp), %r8
cmpq %rdi, %rcx
je 0x2fa052
movq 0x10(%rbp), %rdx
movq 0x90(%rsp), %rsi
movzbl (%rsi,%rdi), %esi
movl (%rdx,%rsi,4), %edx
movl %edx, (%rax,%rdi,4)
incq %rdi
jmp 0x2f97de
movl 0x10(%rsp), %edx
cmpq %rcx, %rbx
je 0x2f981e
movl %edx, 0xc(%r13,%rcx,4)
movl %r10d, 0xc(%r11,%rcx,4)
incq %rcx
subl 0x18(%rsp), %edx
jmp 0x2f9806
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x2f9834
movl %r10d, (%r13,%rcx,4)
movl %r10d, (%r11,%rcx,4)
incq %rcx
jmp 0x2f9820
movq %rbx, %rcx
cmpl %ecx, 0x28(%rsp)
jle 0x2f984c
movl %r10d, 0xc(%r13,%rcx,4)
movl %r10d, 0xc(%r11,%rcx,4)
incq %rcx
jmp 0x2f9837
movq %rax, 0x60(%rsp)
andl $0x0, 0x8(%r13)
decl %r15d
movdqa 0x50(%rsp), %xmm1
movdqa %xmm1, %xmm0
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movdqa %xmm0, 0x150(%rsp)
movq 0x8(%rsp), %rcx
decl %ecx
movq %rcx, 0x8(%rsp)
xorl %ecx, %ecx
movq 0x28(%rsp), %rax
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, 0x28(%rsp)
movdqa 0xe0(%rsp), %xmm11
movdqa 0xd0(%rsp), %xmm0
leaq 0x2(%rbx), %rax
movq %rax, 0x108(%rsp)
leaq 0x1(%rbx), %rax
movq %rax, 0x100(%rsp)
movdqa 0x2ce0ff(%rip), %xmm2   # 0x5c79c0
movdqa %xmm2, 0x40(%rsp)
movdqa %xmm1, %xmm10
movdqa %xmm1, %xmm5
xorl %edi, %edi
movdqa %xmm1, %xmm13
movdqa %xmm1, %xmm9
movdqa %xmm1, %xmm12
movdqa %xmm1, 0xb0(%rsp)
movdqa 0x120(%rsp), %xmm1
movdqa %xmm1, 0xa0(%rsp)
movq %r13, 0x20(%rsp)
cmpq %r14, %rdi
jge 0x2f9e71
movq %rdi, %r8
orq $0x3, %r8
cmpl $0x0, 0x30(%rbp)
je 0x2f9947
movq %rdi, %r9
orq $0x1, %r9
cmpq %r14, %r9
movl %r15d, %ecx
cmovll %r9d, %ecx
movq %rdi, %r10
orq $0x2, %r10
cmpq %r14, %r10
movl %r10d, %edx
cmovgel %r15d, %edx
cmpq %r14, %r8
movl %r8d, %esi
cmovgel %r15d, %esi
movl %edi, %eax
jmp 0x2f9969
movq 0x60(%rsp), %rsi
movl (%rsi,%rdi,4), %eax
movl 0x4(%rsi,%rdi,4), %ecx
movq %rdi, %r9
orq $0x1, %r9
movq %rdi, %r10
orq $0x2, %r10
movl 0x8(%rsi,%rdi,4), %edx
movl (%rsi,%r8,4), %esi
movq 0x8(%rbp), %r13
movl 0x18(%rbp), %r11d
imull %r11d, %ecx
imull %r11d, %eax
imull %r11d, %edx
imull %r11d, %esi
movl %edi, %r11d
imull 0x18(%rsp), %r11d
movl 0x10(%rsp), %ebp
subl %r11d, %ebp
cmpl $0x0, 0x228(%rsp)
movslq %ecx, %rcx
leaq (%r13,%rcx,4), %rcx
movq %rcx, 0x30(%rsp)
movslq %eax, %rcx
leaq (%r13,%rcx,4), %rax
movq %rax, 0x118(%rsp)
movslq %edx, %rdx
leaq (%r13,%rdx,4), %rax
movq %rax, 0x110(%rsp)
movslq %esi, %rdx
leaq (%r13,%rdx,4), %rdx
movq 0x20(%rsp), %r13
movss 0x8(%r13), %xmm1
movaps 0x150(%rsp), %xmm4
shufps $0xe4, %xmm4, %xmm1     # xmm1 = xmm1[0,1],xmm4[2,3]
movaps %xmm4, %xmm8
shufps $0x24, %xmm1, %xmm8     # xmm8 = xmm8[0,1],xmm1[2,0]
movl $0x0, %ecx
cmovnel %ecx, %ebp
movd %ebp, %xmm3
shufps $0xe4, %xmm4, %xmm3     # xmm3 = xmm3[0,1],xmm4[2,3]
movaps %xmm4, %xmm1
shufps $0x24, %xmm3, %xmm1     # xmm1 = xmm1[0,1],xmm3[2,0]
leaq 0x4(%rdi), %rax
movq %rax, 0xf8(%rsp)
movl %eax, %esi
imull 0x18(%rsp), %esi
movl 0x10(%rsp), %ebp
subl %esi, %ebp
movl %ebp, 0x8(%r13)
movdqa 0x160(%rsp), %xmm3
pcmpeqd 0x40(%rsp), %xmm3
movdqa %xmm3, 0x1c0(%rsp)
xorl %esi, %esi
movaps 0x50(%rsp), %xmm4
movaps %xmm4, %xmm7
movdqa 0x2ce164(%rip), %xmm6   # 0x5c7bb0
movq 0x38(%rsp), %r11
cmpq %rsi, 0x28(%rsp)
je 0x2f9e26
movdqa %xmm12, 0x80(%rsp)
movdqa %xmm13, 0x90(%rsp)
movss 0xc(%r13,%rsi,4), %xmm0
shufps $0xf4, %xmm1, %xmm0     # xmm0 = xmm0[0,1],xmm1[3,3]
movaps %xmm1, %xmm3
shufps $0x29, %xmm0, %xmm3     # xmm3 = xmm3[1,2],xmm0[2,0]
movss 0xc(%r11,%rsi,4), %xmm0
shufps $0xf4, %xmm4, %xmm0     # xmm0 = xmm0[0,1],xmm4[3,3]
shufps $0x29, %xmm0, %xmm4     # xmm4 = xmm4[1,2],xmm0[2,0]
movaps %xmm3, %xmm11
movdqa 0x170(%rsp), %xmm13
psubd %xmm13, %xmm11
movdqa 0x1b0(%rsp), %xmm12
psubd %xmm12, %xmm4
movdqa %xmm11, %xmm0
pcmpgtd %xmm4, %xmm0
pand %xmm0, %xmm11
pandn %xmm4, %xmm0
por %xmm11, %xmm0
psubd %xmm13, %xmm1
psubd %xmm12, %xmm7
movdqa %xmm1, %xmm12
pcmpgtd %xmm7, %xmm12
pand %xmm12, %xmm1
pandn %xmm7, %xmm12
por %xmm1, %xmm12
movslq 0xc(%r12,%rsi,4), %r13
movslq 0x8(%r12,%rsi,4), %rbp
movslq 0x4(%r12,%rsi,4), %r11
movslq (%r12,%rsi,4), %rcx
movq 0x118(%rsp), %rax
movd (%rax,%r13,4), %xmm1
movq 0x30(%rsp), %r13
movd (%r13,%rbp,4), %xmm4
punpckldq %xmm1, %xmm4    # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
movq 0x110(%rsp), %rax
movd (%rax,%r11,4), %xmm1
movd (%rdx,%rcx,4), %xmm7
punpckldq %xmm1, %xmm7    # xmm7 = xmm7[0],xmm1[0],xmm7[1],xmm1[1]
punpcklqdq %xmm4, %xmm7    # xmm7 = xmm7[0],xmm4[0]
paddd %xmm8, %xmm7
movdqa %xmm7, %xmm1
pcmpgtd %xmm12, %xmm1
pand %xmm1, %xmm7
pandn %xmm12, %xmm1
por %xmm7, %xmm1
movdqa %xmm1, %xmm11
pcmpgtd %xmm0, %xmm11
pand %xmm11, %xmm1
pandn %xmm0, %xmm11
por %xmm1, %xmm11
movdqa %xmm6, %xmm8
pcmpeqd 0x2cdfe5(%rip), %xmm8   # 0x5c7b60
movdqa %xmm8, %xmm4
pandn %xmm11, %xmm4
movdqa 0x70(%rsp), %xmm1
pand %xmm8, %xmm1
por %xmm4, %xmm1
cmpq $0x4, %rsi
jb 0x2f9bf2
movdqa 0xa0(%rsp), %xmm13
movdqa %xmm13, %xmm4
pcmpgtd %xmm1, %xmm4
movdqa %xmm1, %xmm7
pand %xmm4, %xmm7
pandn %xmm13, %xmm4
por %xmm7, %xmm4
movdqa 0xb0(%rsp), %xmm13
movdqa %xmm13, %xmm7
pcmpgtd %xmm1, %xmm7
pand %xmm7, %xmm13
pandn %xmm1, %xmm7
por %xmm7, %xmm13
movdqa %xmm13, 0xb0(%rsp)
movdqa %xmm4, 0xa0(%rsp)
cmpq %r15, %rdi
setne %cl
movq 0x68(%rsp), %r11
movq 0x10(%r11), %r11
movq (%r11), %rbp
movq 0x8(%r11), %r13
cmpq %rbx, %rsi
setae %r11b
orb %cl, %r11b
pshufd $0xff, %xmm1, %xmm4     # xmm4 = xmm1[3,3,3,3]
jne 0x2f9c1f
movd %xmm4, (%rbp,%rsi,4)
cmpq %rsi, 0x8(%rsp)
jne 0x2f9c2d
movd %xmm4, (%r13,%rdi,4)
cmpq %r15, %r9
setne %cl
leaq -0x1(%rsi), %r11
cmpq %rbx, %r11
setae %r11b
orb %cl, %r11b
pshufd $0xee, %xmm1, %xmm4     # xmm4 = xmm1[2,3,2,3]
jne 0x2f9c4e
movd %xmm4, -0x4(%rbp,%rsi,4)
cmpq %r14, %r9
setge %cl
cmpq %rsi, %rbx
setne %r11b
orb %cl, %r11b
jne 0x2f9c67
movd %xmm4, (%r13,%r9,4)
pshufd $0x55, %xmm1, %xmm4     # xmm4 = xmm1[1,1,1,1]
cmpq %r15, %r10
jne 0x2f9c91
leaq -0x2(%rsi), %rcx
cmpq $0x2, %rsi
setae %r11b
cmpq %rbx, %rcx
setl %cl
andb %r11b, %cl
cmpb $0x1, %cl
jne 0x2f9c91
movd %xmm4, -0x8(%rbp,%rsi,4)
cmpq %r14, %r10
setge %cl
cmpq %rsi, 0x100(%rsp)
setne %r11b
orb %cl, %r11b
jne 0x2f9caf
movd %xmm4, (%r13,%r10,4)
cmpq %r15, %r8
setne %cl
cmpq $0x3, %rsi
setb %r11b
orb %cl, %r11b
jne 0x2f9cc8
movd %xmm1, -0xc(%rbp,%rsi,4)
movdqa %xmm8, %xmm4
pandn %xmm0, %xmm4
movdqa 0x50(%rsp), %xmm7
pand %xmm8, %xmm7
por %xmm7, %xmm4
pandn %xmm12, %xmm8
cmpq %r14, %r8
setge %cl
cmpq %rsi, 0x108(%rsp)
setne %r11b
movd %xmm1, %ebp
orb %cl, %r11b
jne 0x2f9d05
movl %ebp, (%r13,%r8,4)
por %xmm8, %xmm7
movdqa 0x1a0(%rsp), %xmm8
movdqa 0x40(%rsp), %xmm14
pcmpgtd %xmm14, %xmm8
movdqa 0x190(%rsp), %xmm12
pcmpeqd %xmm6, %xmm12
movdqa 0x180(%rsp), %xmm0
pcmpgtd %xmm6, %xmm0
movdqa %xmm6, %xmm13
psrad $0x1f, %xmm13
pandn %xmm0, %xmm13
movdqa %xmm1, %xmm0
pcmpgtd %xmm5, %xmm0
movdqa 0x1c0(%rsp), %xmm2
pand %xmm2, %xmm13
pand %xmm0, %xmm13
movdqa %xmm1, %xmm0
movdqa %xmm10, %xmm15
pcmpgtd %xmm10, %xmm0
pand %xmm12, %xmm8
pand %xmm0, %xmm8
movdqa %xmm13, %xmm0
pandn %xmm5, %xmm0
pand %xmm2, %xmm12
pand %xmm13, %xmm11
por %xmm0, %xmm11
movdqa %xmm8, %xmm10
pandn %xmm15, %xmm10
movdqa %xmm1, %xmm0
pand %xmm8, %xmm0
por %xmm10, %xmm0
movdqa %xmm1, %xmm2
pand %xmm12, %xmm2
pandn 0x80(%rsp), %xmm12
por %xmm2, %xmm12
pand %xmm8, %xmm14
pandn %xmm9, %xmm8
movq 0x20(%rsp), %r13
movl %ebp, (%r13,%rsi,4)
movq 0x38(%rsp), %r11
movd %xmm4, (%r11,%rsi,4)
por %xmm14, %xmm8
movdqa %xmm6, %xmm2
pand %xmm13, %xmm2
pandn 0x90(%rsp), %xmm13
por %xmm2, %xmm13
psubd 0x2cdd55(%rip), %xmm6   # 0x5c7b60
incq %rsi
movdqa %xmm0, %xmm10
movdqa %xmm11, %xmm5
movdqa %xmm8, %xmm9
movaps %xmm3, %xmm8
jmp 0x2f9a51
movdqa 0x40(%rsp), %xmm1
paddd 0x2cdd8c(%rip), %xmm1   # 0x5c7bc0
movdqa %xmm1, 0x40(%rsp)
movdqa 0x70(%rsp), %xmm1
psubd 0x130(%rsp), %xmm1
movdqa %xmm1, 0x70(%rsp)
movq 0xf8(%rsp), %rdi
movq 0x220(%rsp), %rbp
movl 0x14(%rsp), %r10d
movl 0x230(%rsp), %r9d
jmp 0x2f9901
movdqa %xmm11, 0xe0(%rsp)
movdqa %xmm0, 0xd0(%rsp)
movdqa %xmm12, 0x140(%rsp)
movdqa %xmm9, 0xc0(%rsp)
movdqa %xmm13, 0x1d0(%rsp)
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r10d, %eax
movl %r10d, %esi
movq 0x68(%rsp), %rbx
movl 0x240(%rsp), %r14d
cmpl $0x4, %edi
je 0x2f9f21
movl 0xd0(%rsp,%rdi,4), %r8d
cmpl %eax, %r8d
jle 0x2f9ed9
movl 0xc0(%rsp,%rdi,4), %ecx
movl %r8d, %eax
jmp 0x2f9ef6
jne 0x2f9ef6
movl 0xc0(%rsp,%rdi,4), %r9d
cmpl %ecx, %r9d
cmovll %r9d, %ecx
movl 0x230(%rsp), %r9d
cmovll %r8d, %eax
movl 0xe0(%rsp,%rdi,4), %r8d
cmpl %r10d, %r8d
jle 0x2f9f0d
movl 0x1d0(%rsp,%rdi,4), %edx
movl %r8d, %r10d
movl 0x140(%rsp,%rdi,4), %r8d
cmpl %esi, %r8d
cmovgl %r8d, %esi
incq %rdi
jmp 0x2f9ebb
testl %r14d, %r14d
sete %dil
testl %r9d, %r9d
sete %r8b
orb %dil, %r8b
jne 0x2f9f4d
cmpl %r10d, %eax
jg 0x2f9f6b
jne 0x2f9f41
cmpl 0x8(%rsp), %edx
je 0x2f9f6b
movl %r10d, %eax
movl %edx, %ecx
movq %rcx, 0x8(%rsp)
jmp 0x2f9f68
testl %r9d, %r9d
jne 0x2f9f6b
testl %r14d, %r14d
cmovnel %r10d, %esi
movq 0x8(%rsp), %rax
cmovnel %edx, %eax
movq %rax, 0x8(%rsp)
movl %esi, %eax
movl %r15d, %ecx
movdqa 0x50(%rsp), %xmm0
pcmpgtd 0xa0(%rsp), %xmm0
movdqa 0xb0(%rsp), %xmm1
pcmpgtd 0x120(%rsp), %xmm1
por %xmm0, %xmm1
movmskps %xmm1, %edx
testl %edx, %edx
je 0x2f9fa8
orb $0x40, 0xc(%rbx)
xorl %eax, %eax
movq $0x0, 0x8(%rsp)
xorl %ecx, %ecx
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
movq 0x8(%rsp), %rax
movl %eax, 0x8(%rbx)
movq %r11, %rdi
callq 0x1ab763
movq %r13, %rdi
callq 0x1ab763
movq %r12, %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%rbp)
jne 0x2fa0f7
movq 0x60(%rsp), %rdi
callq 0x1ab763
jmp 0x2fa0f7
movq 0x440feb(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2ccff4(%rip), %rsi    # 0x5c6feb
leaq 0x2cef54(%rip), %rdx    # 0x5c8f52
leaq 0x2cd6f8(%rip), %rcx    # 0x5c76fd
jmp 0x2fa0ee
movq 0x440fc7(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2cd6e6(%rip), %rsi    # 0x5c7701
leaq 0x2cef30(%rip), %rdx    # 0x5c8f52
leaq 0x2cd6ec(%rip), %rcx    # 0x5c7715
jmp 0x2fa0ee
movq 0x440fa3(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2cd6dc(%rip), %rsi    # 0x5c771b
leaq 0x2cef0c(%rip), %rdx    # 0x5c8f52
leaq 0x2cd6e3(%rip), %rcx    # 0x5c7730
jmp 0x2fa0ee
movq %r14, %rcx
movq 0x20(%rsp), %rdx
cmpq %rdx, %rcx
jge 0x2f96b1
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x2fa05a
movq 0x440f65(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2cd69e(%rip), %rsi    # 0x5c771b
leaq 0x2ceece(%rip), %rdx    # 0x5c8f52
leaq 0x2cd6aa(%rip), %rcx    # 0x5c7735
jmp 0x2fa0ee
movq 0x440f44(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2ccf4d(%rip), %rsi    # 0x5c6feb
leaq 0x2ceead(%rip), %rdx    # 0x5c8f52
leaq 0x2cd896(%rip), %rcx    # 0x5c7942
jmp 0x2fa0ee
movq 0x440f23(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2ccf2c(%rip), %rsi    # 0x5c6feb
leaq 0x2cee8c(%rip), %rdx    # 0x5c8f52
leaq 0x2cd66c(%rip), %rcx    # 0x5c7739
jmp 0x2fa0ee
movq 0x440f02(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2cd621(%rip), %rsi    # 0x5c7701
leaq 0x2cee6b(%rip), %rdx    # 0x5c8f52
leaq 0x2cd64f(%rip), %rcx    # 0x5c773d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq