// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sg_diag_sse41_128_32.c
// Function: parasail_sg_flags_rowcol_diag_sse41_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(vNH, H_pr[-1], 3);
        vWH = _mm_srli_si128(vWH, 4);
        vWH = _mm_insert_epi32(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(vNH, H_pr[j], 3);
            vF = _mm_srli_si128(vF, 4);
            vF = _mm_insert_epi32(vF, F_pr[j], 3);
            vF = _mm_max_epi32(
                    _mm_sub_epi32(vNH, vOpen),
                    _mm_sub_epi32(vF, vGap));
            vE = _mm_max_epi32(
                    _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(vNWH, vE);
            vWH = _mm_max_epi32(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(vWH, vIBoundary, cond);
                vF = _mm_blendv_epi8(vF, vNegInf, cond);
                vE = _mm_blendv_epi8(vE, vNegInf, cond);
            }
            /* cannot start checking sat until after J clears boundary */
            if (j > PAD) {
                vSaturationCheckMin = _mm_min_epi32(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm_max_epi32(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(vWH,0);
            F_pr[j-3] = (int32_t)_mm_extract_epi32(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(vMaxHRow, vWH, cond_all_row);
                vMaxHCol = _mm_blendv_epi8(vMaxHCol, vWH, cond_all_col);
                vLastVal = _mm_blendv_epi8(vLastVal, vWH, cond_last_val);
                vEndI = _mm_blendv_epi8(vEndI, vI, cond_all_col);
                vEndJ = _mm_blendv_epi8(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 $0x1c8, %rsp            # imm = 0x1C8
testq %rdx, %rdx
je 0x42d9d7
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x42d9e1
movl %r8d, %r12d
testl %r8d, %r8d
js 0x42d9eb
testl %r9d, %r9d
js 0x42d9f5
movq 0x200(%rsp), %r13
testq %r13, %r13
je 0x42d9ff
movq %rdx, %rbx
movl 0x30(%r13), %eax
testl %eax, %eax
jne 0x42cfd3
testq %rdi, %rdi
je 0x42da94
testl %esi, %esi
jle 0x42da9b
testl %eax, %eax
je 0x42cfd7
movl 0x34(%r13), %esi
leal 0x3(%rsi), %eax
movl %eax, 0x10(%rsp)
leal 0x3(%r14), %eax
movl %eax, 0x28(%rsp)
movl %r12d, %r8d
negl %r8d
movl 0x20(%r13), %eax
movl $0x80000000, %edx       # imm = 0x80000000
movl %r12d, %ecx
orl %edx, %ecx
subl %eax, %edx
movl %r8d, 0x1c(%rsp)
cmpl %r8d, %eax
cmovgl %ecx, %edx
incl %edx
movl $0x7ffffffe, %r15d      # imm = 0x7FFFFFFE
subl 0x1c(%r13), %r15d
movd %edx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x50(%rsp)
movd %r9d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
xorps %xmm1, %xmm1
movaps %xmm1, 0x70(%rsp)
cmpl $0x0, 0x208(%rsp)
movdqa %xmm0, 0x1b0(%rsp)
je 0x42d04d
pxor %xmm0, %xmm0
jmp 0x42d052
pslld $0x2, %xmm0
movdqa %xmm0, 0x140(%rsp)
movq %rdi, %rbp
movl %edx, 0x18(%rsp)
movdqa 0x50(%rsp), %xmm0
movdqa %xmm0, 0xf0(%rsp)
movdqa %xmm0, 0xe0(%rsp)
movdqa %xmm0, 0xd0(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0xc0(%rsp)
jne 0x42d0cd
movl 0x1c(%rsp), %edi
movl %edi, %eax
subl %r9d, %eax
movl %edi, %edx
subl %r9d, %edx
subl %r9d, %edx
leal (%r9,%r9,2), %ecx
addl %r12d, %ecx
negl %ecx
movd %ecx, %xmm0
pinsrd $0x1, %edx, %xmm0
pinsrd $0x2, %eax, %xmm0
pinsrd $0x3, %edi, %xmm0
movdqa %xmm0, 0x70(%rsp)
movq %r9, 0x68(%rsp)
movq %rsi, 0x38(%rsp)
movl %esi, %edi
movl %r14d, %esi
callq 0x209630
testq %rax, %rax
je 0x42daa0
movl %r12d, 0x48(%rsp)
xorl %edi, %edi
cmpl $0x0, 0x208(%rsp)
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x210(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x218(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x220(%rsp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x4441002, %ecx        # imm = 0x4441002
movq %rax, 0x20(%rsp)
movl %ecx, 0xc(%rax)
movq %r14, 0x8(%rsp)
addl $0x6, %r14d
movl $0x10, %edi
movq %r14, %rsi
callq 0x2094d5
movq %rax, %r12
movl $0x10, %edi
movq %r14, %rsi
callq 0x2094d5
movl $0x10, %edi
movq %r14, %rsi
movq %rax, %r14
callq 0x2094d5
testq %r12, %r12
sete %dl
testq %r14, %r14
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x42daa0
cmpl $0x0, 0x30(%r13)
movq %rax, 0x30(%rsp)
je 0x42d1af
movq $0x0, 0x40(%rsp)
jmp 0x42d221
movslq 0x10(%rsp), %rsi
movl $0x10, %edi
callq 0x2094d5
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x42daa0
movq 0x38(%rsp), %r8
testl %r8d, %r8d
movq 0x40(%rsp), %rdi
jle 0x42d1f7
movq 0x10(%r13), %rax
movl %r8d, %ecx
xorl %edx, %edx
movzbl (%rbp,%rdx), %esi
movl (%rax,%rsi,4), %esi
movl %esi, (%rdi,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x42d1e4
movslq %r8d, %rax
leaq (%rdi,%rax,4), %rdi
leal 0x1(%r8), %eax
movl 0x10(%rsp), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl %r8d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %esi, %esi
callq 0x19e090
movq %r14, 0x10(%rsp)
movd %r15d, %xmm0
movd 0x38(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movd %edx, %xmm2
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x90(%rsp)
movd 0x48(%rsp), %xmm0
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
pcmpeqd %xmm3, %xmm3
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x170(%rsp)
movdqa %xmm1, 0x1a0(%rsp)
paddd %xmm3, %xmm1
movdqa %xmm1, 0x160(%rsp)
movdqa %xmm2, 0x180(%rsp)
paddd %xmm2, %xmm3
movdqa %xmm3, 0x190(%rsp)
movq 0x10(%r13), %rax
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
xorl %edx, %edx
movl 0x210(%rsp), %ebp
movzbl (%rbx,%rdx), %esi
movl (%rax,%rsi,4), %esi
movl %esi, 0xc(%r12,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x42d2ae
movl $0x0, 0x8(%r12)
movq $0x0, (%r12)
movq 0x8(%rsp), %r14
movl %r14d, %ebx
leaq 0xc(%r12,%rbx,4), %rdi
leal 0x1(%r14), %eax
movl 0x28(%rsp), %r15d
cmpl %eax, %r15d
cmovgl %r15d, %eax
movl %r14d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %esi, %esi
callq 0x19e090
cmpl $0x2, %r14d
movl $0x1, %eax
cmovgel %r14d, %eax
xorl %ecx, %ecx
cmpl $0x0, 0x218(%rsp)
je 0x42d346
movl 0x18(%rsp), %r10d
movq 0x10(%rsp), %r14
movq 0x30(%rsp), %rdi
movl $0x0, 0xc(%r14,%rcx,4)
movl %r10d, 0xc(%rdi,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x42d32e
jmp 0x42d372
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %r10d
movq 0x10(%rsp), %r14
movq 0x68(%rsp), %rsi
movq 0x30(%rsp), %rdi
movl %edx, 0xc(%r14,%rcx,4)
movl %r10d, 0xc(%rdi,%rcx,4)
incq %rcx
subl %esi, %edx
cmpq %rcx, %rax
jne 0x42d35e
xorl %eax, %eax
movq 0x38(%rsp), %r9
movl %r10d, (%r14,%rax,4)
movl %r10d, (%rdi,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x42d379
leaq 0x3(%rbx), %rax
movq 0x8(%rsp), %rcx
movl %r10d, (%r14,%rax,4)
movl %r10d, (%rdi,%rax,4)
incq %rax
incl %ecx
cmpl %ecx, %r15d
jg 0x42d393
movl $0x0, 0x8(%r14)
movaps 0xd0(%rsp), %xmm6
movaps 0x80(%rsp), %xmm7
movaps 0xc0(%rsp), %xmm8
testl %r9d, %r9d
jle 0x42d8ff
movq 0x8(%r13), %rax
movq %rax, 0x108(%rsp)
leal -0x1(%r9), %ecx
movdqa 0x50(%rsp), %xmm0
movdqa %xmm0, %xmm1
psrldq $0x4, %xmm1             # xmm1 = xmm1[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movdqa %xmm1, 0x150(%rsp)
cmpl $0x2, %r15d
movl $0x1, %eax
cmovgel %r15d, %eax
movq %rax, 0x130(%rsp)
movq 0x8(%rsp), %rax
decl %eax
movq %rax, 0x128(%rsp)
movl %r9d, %edi
leaq 0x1(%rbx), %rax
movq %rax, 0x120(%rsp)
leaq 0x2(%rbx), %rax
movq %rax, 0x118(%rsp)
pmovsxbd 0x1ca76e(%rip), %xmm10  # 0x5f7bae
pcmpeqd %xmm12, %xmm12
xorl %ebp, %ebp
movdqa 0x90(%rsp), %xmm1
movdqa %xmm1, 0xa0(%rsp)
movdqa %xmm0, 0xb0(%rsp)
movl 0x30(%r13), %r9d
movl %ebp, %edx
testl %r9d, %r9d
movq 0x40(%rsp), %r14
jne 0x42d476
movl (%r14,%rbp,4), %edx
movq %rbp, %r11
orq $0x1, %r11
testl %r9d, %r9d
je 0x42d48d
cmpq %rdi, %r11
movl %ecx, %esi
cmovbl %r11d, %esi
jmp 0x42d491
movl (%r14,%r11,4), %esi
movq %rbp, %r10
orq $0x2, %r10
testl %r9d, %r9d
je 0x42d4a9
cmpq %rdi, %r10
movl %ecx, %r8d
cmovbl %r10d, %r8d
jmp 0x42d4ad
movl (%r14,%r10,4), %r8d
movq %rbp, %rax
orq $0x3, %rax
testl %r9d, %r9d
je 0x42d4c5
cmpq %rdi, %rax
movl %ecx, %r9d
cmovbl %eax, %r9d
jmp 0x42d4c9
movl (%r14,%rax,4), %r9d
movl 0x18(%r13), %r14d
imull %r14d, %edx
movl %edx, 0x28(%rsp)
imull %r14d, %esi
imull %r14d, %r8d
imull %r14d, %r9d
leaq 0x4(%rbp), %rdx
movq %rdx, 0x110(%rsp)
movl %edx, %r14d
movq 0x68(%rsp), %r13
imull %r13d, %r14d
movl 0x1c(%rsp), %edx
movl %edx, %r15d
subl %r14d, %r15d
movl %ebp, %r14d
imull %r13d, %r14d
movl %edx, %r13d
subl %r14d, %r13d
movdqa 0x150(%rsp), %xmm9
movdqa %xmm9, %xmm4
movq 0x10(%rsp), %r14
pinsrd $0x3, 0x8(%r14), %xmm4
movl %r15d, 0x8(%r14)
movslq 0x28(%rsp), %rdx
movq 0x108(%rsp), %r14
leaq (%r14,%rdx,4), %rdx
movq %rdx, 0x28(%rsp)
movslq %esi, %rdx
leaq (%r14,%rdx,4), %rdx
movq %rdx, 0x48(%rsp)
movslq %r8d, %rsi
leaq (%r14,%rsi,4), %rdx
movq %rdx, 0x138(%rsp)
cmpl $0x0, 0x208(%rsp)
movslq %r9d, %r8
leaq (%r14,%r8,4), %r8
movl $0x0, %edx
cmovnel %edx, %r13d
pinsrd $0x3, %r13d, %xmm9
movdqa 0x160(%rsp), %xmm14
pcmpeqd %xmm10, %xmm14
xorl %r9d, %r9d
pmovsxbd 0x1ca616(%rip), %xmm15  # 0x5f7bb2
movdqa 0x50(%rsp), %xmm5
movdqa %xmm5, %xmm13
movq 0x30(%rsp), %rsi
movslq 0xc(%r12,%r9,4), %r14
movslq 0x8(%r12,%r9,4), %r15
movslq 0x4(%r12,%r9,4), %r13
movslq (%r12,%r9,4), %rdx
movd (%r8,%rdx,4), %xmm0
movq 0x138(%rsp), %rdx
pinsrd $0x1, (%rdx,%r13,4), %xmm0
movq 0x48(%rsp), %rdx
pinsrd $0x2, (%rdx,%r15,4), %xmm0
movq 0x28(%rsp), %rdx
pinsrd $0x3, (%rdx,%r14,4), %xmm0
paddd %xmm4, %xmm0
pshufd $0xf9, %xmm9, %xmm4     # xmm4 = xmm9[1,2,3,3]
movq 0x10(%rsp), %rdx
pinsrd $0x3, 0xc(%rdx,%r9,4), %xmm4
cmpq %rcx, %rbp
pshufd $0xf9, %xmm13, %xmm13   # xmm13 = xmm13[1,2,3,3]
pinsrd $0x3, 0xc(%rsi,%r9,4), %xmm13
movdqa %xmm4, %xmm1
movdqa 0x170(%rsp), %xmm3
psubd %xmm3, %xmm1
movdqa 0x1b0(%rsp), %xmm2
psubd %xmm2, %xmm13
pmaxsd %xmm1, %xmm13
psubd %xmm3, %xmm9
psubd %xmm2, %xmm5
pmaxsd %xmm9, %xmm5
movdqa %xmm5, %xmm11
pmaxsd %xmm13, %xmm11
pmaxsd %xmm0, %xmm11
movdqa %xmm15, %xmm0
pcmpeqd %xmm12, %xmm0
movdqa %xmm11, %xmm9
blendvps %xmm0, 0x70(%rsp), %xmm9
setne %r15b
movaps 0x50(%rsp), %xmm1
blendvps %xmm0, %xmm1, %xmm13
blendvps %xmm0, %xmm1, %xmm5
cmpq $0x4, %r9
jb 0x42d6bf
movdqa 0xa0(%rsp), %xmm0
pminsd %xmm9, %xmm0
movdqa %xmm0, 0xa0(%rsp)
movdqa 0xb0(%rsp), %xmm0
pmaxsd %xmm9, %xmm0
movdqa %xmm0, 0xb0(%rsp)
movq 0x20(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq (%rdx), %r13
movq 0x8(%rdx), %r14
cmpq %rbx, %r9
setae %dl
orb %dl, %r15b
jne 0x42d6e3
pextrd $0x3, %xmm9, (%r13,%r9,4)
cmpq %r9, 0x128(%rsp)
jne 0x42d6f5
pextrd $0x3, %xmm9, (%r14,%rbp,4)
cmpq %rcx, %r11
setne %dl
leaq -0x1(%r9), %r15
cmpq %rbx, %r15
setae %r15b
orb %dl, %r15b
jne 0x42d714
pextrd $0x2, %xmm9, -0x4(%r13,%r9,4)
cmpq %rdi, %r11
setae %dl
cmpq %r9, %rbx
setne %r15b
orb %dl, %r15b
jne 0x42d72e
pextrd $0x2, %xmm9, (%r14,%r11,4)
cmpq %rcx, %r10
jne 0x42d756
leaq -0x2(%r9), %rdx
cmpq $0x2, %r9
setae %r15b
cmpq %rbx, %rdx
setl %dl
andb %r15b, %dl
cmpb $0x1, %dl
jne 0x42d756
pextrd $0x1, %xmm9, -0x8(%r13,%r9,4)
cmpq %rdi, %r10
setae %dl
cmpq %r9, 0x120(%rsp)
setne %r15b
orb %dl, %r15b
jne 0x42d775
pextrd $0x1, %xmm9, (%r14,%r10,4)
cmpq %rcx, %rax
jne 0x42d798
leaq -0x3(%r9), %rdx
cmpq $0x3, %r9
setb %r15b
cmpq %rbx, %rdx
setge %dl
orb %r15b, %dl
jne 0x42d798
movd %xmm9, -0xc(%r13,%r9,4)
cmpq %rdi, %rax
setae %dl
cmpq %r9, 0x118(%rsp)
setne %r15b
orb %dl, %r15b
jne 0x42d7b5
movd %xmm9, (%r14,%rax,4)
movdqa 0x1a0(%rsp), %xmm1
pcmpgtd %xmm10, %xmm1
movq 0x10(%rsp), %r14
movd %xmm9, (%r14,%r9,4)
movq 0x30(%rsp), %rsi
movss %xmm13, (%rsi,%r9,4)
movdqa 0x190(%rsp), %xmm2
pcmpeqd %xmm15, %xmm2
movdqa 0x180(%rsp), %xmm0
pcmpgtd %xmm15, %xmm0
movdqa 0xf0(%rsp), %xmm12
movdqa %xmm15, %xmm3
pandn %xmm0, %xmm3
movdqa %xmm9, %xmm0
pcmpgtd %xmm12, %xmm0
pand %xmm14, %xmm3
pand %xmm0, %xmm3
movdqa %xmm3, %xmm0
blendvps %xmm0, %xmm11, %xmm12
movdqa 0xe0(%rsp), %xmm11
movdqa %xmm9, %xmm0
pcmpgtd %xmm11, %xmm0
pand %xmm2, %xmm1
pand %xmm0, %xmm1
movdqa %xmm1, %xmm0
blendvps %xmm0, %xmm9, %xmm11
pand %xmm14, %xmm2
movdqa %xmm2, %xmm0
blendvps %xmm0, %xmm9, %xmm6
movdqa %xmm1, %xmm0
blendvps %xmm0, %xmm10, %xmm7
movaps %xmm12, 0xf0(%rsp)
movdqa %xmm3, %xmm0
blendvps %xmm0, %xmm15, %xmm8
movaps %xmm11, 0xe0(%rsp)
pcmpeqd %xmm12, %xmm12
psubd %xmm12, %xmm15
incq %r9
cmpq %r9, 0x130(%rsp)
jne 0x42d5ac
paddd 0x1c82ec(%rip), %xmm10  # 0x5f5b90
movdqa 0x70(%rsp), %xmm0
psubd 0x140(%rsp), %xmm0
movdqa %xmm0, 0x70(%rsp)
movq 0x110(%rsp), %rax
movq %rax, %rbp
cmpq %rdi, %rax
movq 0x200(%rsp), %r13
jb 0x42d462
movq 0x38(%rsp), %r9
movl 0x18(%rsp), %r10d
movq 0x30(%rsp), %rdi
movl 0x210(%rsp), %ebp
movdqa 0xb0(%rsp), %xmm1
movdqa 0xa0(%rsp), %xmm2
jmp 0x42d90e
movdqa 0x50(%rsp), %xmm1
movdqa 0x90(%rsp), %xmm2
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0x80(%rsp)
movaps %xmm8, 0xc0(%rsp)
xorl %r11d, %r11d
movl %r10d, %ecx
movl %r10d, %esi
xorl %edx, %edx
xorl %eax, %eax
movl 0x220(%rsp), %ebx
movl 0xe0(%rsp,%r11,4), %r8d
cmpl %ecx, %r8d
jle 0x42d955
movl 0x80(%rsp,%r11,4), %edx
movl %r8d, %ecx
jmp 0x42d961
jne 0x42d961
cmpl %edx, 0x80(%rsp,%r11,4)
jl 0x42d948
movl 0xf0(%rsp,%r11,4), %r8d
cmpl %esi, %r8d
jle 0x42d979
movl 0xc0(%rsp,%r11,4), %eax
movl %r8d, %esi
movl 0xd0(%rsp,%r11,4), %r8d
cmpl %r10d, %r8d
cmovgl %r8d, %r10d
incq %r11
cmpl $0x4, %r11d
jne 0x42d93b
testl %ebx, %ebx
sete %r11b
testl %ebp, %ebp
sete %r8b
orb %r11b, %r8b
jne 0x42d9c5
cmpl %esi, %ecx
jg 0x42d9bc
movl %ecx, %r10d
xorl %esi, %r10d
movq 0x8(%rsp), %r8
decl %r8d
xorl %eax, %r8d
orl %r10d, %r8d
jne 0x42da26
movq 0x8(%rsp), %rax
decl %eax
jmp 0x42da2e
testl %ebp, %ebp
movq 0x20(%rsp), %r8
je 0x42da09
movq 0x8(%rsp), %rax
decl %eax
jmp 0x42da33
callq 0x1d315d
jmp 0x42daa0
callq 0x1d3137
jmp 0x42daa0
callq 0x1d3111
jmp 0x42daa0
callq 0x1d30eb
jmp 0x42daa0
callq 0x1d30c5
jmp 0x42daa0
decl %r9d
movq 0x8(%rsp), %rdx
decl %edx
testl %ebx, %ebx
cmovnel %esi, %r10d
cmovnel %eax, %edx
movl %r10d, %ecx
movl %edx, %eax
movl %r9d, %edx
jmp 0x42da33
decl %r9d
movl %esi, %ecx
movl %r9d, %edx
movq 0x20(%rsp), %r8
movdqa 0x50(%rsp), %xmm0
pcmpgtd %xmm2, %xmm0
pcmpgtd 0x90(%rsp), %xmm1
por %xmm0, %xmm1
movmskps %xmm1, %esi
testl %esi, %esi
je 0x42da5c
orb $0x40, 0xc(%r8)
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
movl %ecx, (%r8)
movl %edx, 0x4(%r8)
movl %eax, 0x8(%r8)
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%r13)
jne 0x42da8d
movq 0x40(%rsp), %rdi
callq 0x2094b5
movq 0x20(%rsp), %rax
jmp 0x42daa2
callq 0x1d309f
jmp 0x42daa0
callq 0x1d3079
xorl %eax, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq