// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/sg_diag_avx2_256_64.c
// Function: parasail_sg_flags_rowcol_diag_avx2_256_64
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;
    int64_t * restrict s1 = NULL;
    int64_t * restrict s2B = NULL;
    int64_t * restrict _H_pr = NULL;
    int64_t * restrict _F_pr = NULL;
    int64_t * restrict s2 = NULL;
    int64_t * restrict H_pr = NULL;
    int64_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;
    int64_t NEG_LIMIT = 0;
    int64_t POS_LIMIT = 0;
    int64_t score = 0;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    __m256i vNegInf;
    __m256i vOpen;
    __m256i vGap;
    __m256i vOne;
    __m256i vN;
    __m256i vGapN;
    __m256i vNegOne;
    __m256i vI;
    __m256i vJreset;
    __m256i vMaxHRow;
    __m256i vMaxHCol;
    __m256i vLastVal;
    __m256i vEndI;
    __m256i vEndJ;
    __m256i vILimit;
    __m256i vILimit1;
    __m256i vJLimit;
    __m256i vJLimit1;
    __m256i 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 ? INT64_MIN + open : INT64_MIN - matrix->min) + 1;
    POS_LIMIT = INT64_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi64x_rpl(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi64x_rpl(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm256_set1_epi64x_rpl(NEG_LIMIT);
    vOpen = _mm256_set1_epi64x_rpl(open);
    vGap  = _mm256_set1_epi64x_rpl(gap);
    vOne = _mm256_set1_epi64x_rpl(1);
    vN = _mm256_set1_epi64x_rpl(N);
    vGapN = s1_beg ? _mm256_set1_epi64x_rpl(0) : _mm256_set1_epi64x_rpl(gap*N);
    vNegOne = _mm256_set1_epi64x_rpl(-1);
    vI = _mm256_set_epi64x_rpl(0,1,2,3);
    vJreset = _mm256_set_epi64x_rpl(0,-1,-2,-3);
    vMaxHRow = vNegInf;
    vMaxHCol = vNegInf;
    vLastVal = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm256_set1_epi64x_rpl(s1Len);
    vILimit1 = _mm256_sub_epi64(vILimit, vOne);
    vJLimit = _mm256_set1_epi64x_rpl(s2Len);
    vJLimit1 = _mm256_sub_epi64(vJLimit, vOne);
    vIBoundary = s1_beg ? _mm256_set1_epi64x_rpl(0) : _mm256_set_epi64x_rpl(
            -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_64 | 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_int64_t(32, s2Len+PAD2);
    _H_pr = parasail_memalign_int64_t(32, s2Len+PAD2);
    _F_pr = parasail_memalign_int64_t(32, 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_int64_t(32, 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) {
        __m256i vNH = vNegInf;
        __m256i vWH = vNegInf;
        __m256i vE = vNegInf;
        __m256i vF = vNegInf;
        __m256i 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))];
        __m256i vIltLimit = _mm256_cmplt_epi64_rpl(vI, vILimit);
        __m256i vIeqLimit1 = _mm256_cmpeq_epi64(vI, vILimit1);
        vNH = _mm256_srli_si256_rpl(vNH, 8);
        vNH = _mm256_insert_epi64_rpl(vNH, H_pr[-1], 3);
        vWH = _mm256_srli_si256_rpl(vWH, 8);
        vWH = _mm256_insert_epi64_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) {
            __m256i vMat;
            __m256i vNWH = vNH;
            vNH = _mm256_srli_si256_rpl(vWH, 8);
            vNH = _mm256_insert_epi64_rpl(vNH, H_pr[j], 3);
            vF = _mm256_srli_si256_rpl(vF, 8);
            vF = _mm256_insert_epi64_rpl(vF, F_pr[j], 3);
            vF = _mm256_max_epi64_rpl(
                    _mm256_sub_epi64(vNH, vOpen),
                    _mm256_sub_epi64(vF, vGap));
            vE = _mm256_max_epi64_rpl(
                    _mm256_sub_epi64(vWH, vOpen),
                    _mm256_sub_epi64(vE, vGap));
            vMat = _mm256_set_epi64x_rpl(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]],
                    matrow2[s2[j-2]],
                    matrow3[s2[j-3]]
                    );
            vNWH = _mm256_add_epi64(vNWH, vMat);
            vWH = _mm256_max_epi64_rpl(vNWH, vE);
            vWH = _mm256_max_epi64_rpl(vWH, vF);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m256i cond = _mm256_cmpeq_epi64(vJ,vNegOne);
                vWH = _mm256_blendv_epi8(vWH, vIBoundary, cond);
                vF = _mm256_blendv_epi8(vF, vNegInf, cond);
                vE = _mm256_blendv_epi8(vE, vNegInf, cond);
            }
            /* cannot start checking sat until after J clears boundary */
            if (j > PAD) {
                vSaturationCheckMin = _mm256_min_epi64_rpl(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm256_max_epi64_rpl(vSaturationCheckMax, vWH);
            }
#ifdef PARASAIL_TABLE
            arr_store_si256(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] = (int64_t)_mm256_extract_epi64_rpl(vWH,0);
            F_pr[j-3] = (int64_t)_mm256_extract_epi64_rpl(vF,0);
            /* as minor diagonal vector passes across the i or j limit
             * boundary, extract the last value of the column or row */
            {
                __m256i vJeqLimit1 = _mm256_cmpeq_epi64(vJ, vJLimit1);
                __m256i vJgtNegOne = _mm256_cmpgt_epi64(vJ, vNegOne);
                __m256i vJltLimit = _mm256_cmplt_epi64_rpl(vJ, vJLimit);
                __m256i cond_j = _mm256_and_si256(vIltLimit, vJeqLimit1);
                __m256i cond_i = _mm256_and_si256(vIeqLimit1,
                        _mm256_and_si256(vJgtNegOne, vJltLimit));
                __m256i cond_max_row = _mm256_cmpgt_epi64(vWH, vMaxHRow);
                __m256i cond_max_col = _mm256_cmpgt_epi64(vWH, vMaxHCol);
                __m256i cond_last_val = _mm256_and_si256(vIeqLimit1, vJeqLimit1);
                __m256i cond_all_row = _mm256_and_si256(cond_max_row, cond_i);
                __m256i cond_all_col = _mm256_and_si256(cond_max_col, cond_j);
                vMaxHRow = _mm256_blendv_epi8(vMaxHRow, vWH, cond_all_row);
                vMaxHCol = _mm256_blendv_epi8(vMaxHCol, vWH, cond_all_col);
                vLastVal = _mm256_blendv_epi8(vLastVal, vWH, cond_last_val);
                vEndI = _mm256_blendv_epi8(vEndI, vI, cond_all_col);
                vEndJ = _mm256_blendv_epi8(vEndJ, vJ, cond_all_row);
            }
            vJ = _mm256_add_epi64(vJ, vOne);
        }
        vI = _mm256_add_epi64(vI, vN);
        vIBoundary = _mm256_sub_epi64(vIBoundary, vGapN);
    }

    /* alignment ending position */
    {
        int64_t max_row = NEG_LIMIT;
        int64_t max_col = NEG_LIMIT;
        int64_t last_val = NEG_LIMIT;
        int64_t *s = (int64_t*)&vMaxHRow;
        int64_t *t = (int64_t*)&vMaxHCol;
        int64_t *u = (int64_t*)&vLastVal;
        int64_t *i = (int64_t*)&vEndI;
        int64_t *j = (int64_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 (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi64_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_cmpgt_epi64(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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x3a0, %rsp            # imm = 0x3A0
movq %r9, 0x28(%rsp)
testq %rdx, %rdx
je 0x5593e7
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x5593f1
testl %r8d, %r8d
js 0x5593fb
cmpl $0x0, 0x28(%rsp)
js 0x559405
movq 0x10(%rbp), %r13
testq %r13, %r13
je 0x55940f
movq %rdi, %r15
cmpl $0x0, 0x30(%r13)
je 0x55895a
movl 0x34(%r13), %ebx
jmp 0x55896d
testq %r15, %r15
je 0x5594ad
movl %esi, %ebx
testl %esi, %esi
jle 0x5594b4
leal 0x3(%rbx), %eax
movl %eax, 0x60(%rsp)
movl %r8d, %esi
negl %esi
movslq 0x20(%r13), %rax
movl %r8d, %r12d
movq %r12, %rcx
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %r9 # imm = 0x8000000000000000
movq %r9, %rdi
subq %rax, %rdi
movl %esi, 0x1c(%rsp)
cmpl %esi, %eax
leal 0x3(%r14), %esi
cmovgq %rcx, %rdi
incq %rdi
movslq 0x1c(%r13), %rax
subq %rax, %r9
addq $-0x2, %r9
movq %r9, 0x68(%rsp)
movq %rdi, 0x48(%rsp)
vmovq %rdi, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x80(%rsp)
movq 0x28(%rsp), %rax
leal (,%rax,4), %eax
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %ymm0, 0x140(%rsp)
cmpl $0x0, 0x18(%rbp)
movl %esi, 0x160(%rsp)
jne 0x558a01
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x1c0(%rsp)
movq %rdx, 0xe0(%rsp)
vmovdqa 0x80(%rsp), %ymm0
vmovdqa %ymm0, 0x240(%rsp)
vmovdqa %ymm0, 0x220(%rsp)
vmovdqa %ymm0, 0x200(%rsp)
vmovdqa %ymm0, 0x1a0(%rsp)
vmovdqa %ymm0, 0x1e0(%rsp)
jne 0x558a89
movl 0x1c(%rsp), %edi
movl %edi, %eax
movq 0x28(%rsp), %rsi
subl %esi, %eax
movl %edi, %edx
subl %esi, %edx
subl %esi, %edx
leal (%rsi,%rsi,2), %ecx
addl %r8d, %ecx
negl %ecx
vmovd %ecx, %xmm0
vpinsrd $0x1, %edx, %xmm0, %xmm0
vpinsrd $0x2, %eax, %xmm0, %xmm0
vpinsrd $0x3, %edi, %xmm0, %xmm0
vpmovsxdq %xmm0, %ymm0
vmovdqa %ymm0, 0x140(%rsp)
movl %ebx, %edi
movl %r14d, %esi
vzeroupper
callq 0x20ac53
testq %rax, %rax
je 0x5594b9
movq %r12, 0x58(%rsp)
movq %r15, 0x50(%rsp)
movq %rbx, 0x10(%rsp)
xorl %edi, %edi
cmpl $0x0, 0x18(%rbp)
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x20(%rbp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x28(%rbp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x30(%rbp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x4841002, %ecx        # imm = 0x4841002
movq %rax, 0x30(%rsp)
movl %ecx, 0xc(%rax)
leal 0x6(%r14), %ebx
movl $0x20, %edi
movq %rbx, %rsi
callq 0x20a636
movq %rax, %r12
movl $0x20, %edi
movq %rbx, %rsi
callq 0x20a636
movq %rax, %r15
movl $0x20, %edi
movq %rbx, %rsi
callq 0x20a636
testq %r12, %r12
sete %dl
testq %r15, %r15
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x5594b9
movq %r14, 0x20(%rsp)
movslq 0x10(%rsp), %r14
cmpl $0x0, 0x30(%r13)
movq %r15, 0x40(%rsp)
movq %rax, 0x38(%rsp)
je 0x558b66
xorl %eax, %eax
movq 0x48(%rsp), %rbx
jmp 0x558bd8
movl 0x60(%rsp), %r15d
movslq %r15d, %rsi
movl $0x20, %edi
callq 0x20a636
testq %rax, %rax
movq 0x48(%rsp), %rbx
je 0x5594b9
cmpl $0x0, 0x10(%rsp)
movq 0x50(%rsp), %rdi
jle 0x558bac
movq 0x10(%r13), %rsi
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %edx
movslq (%rsi,%rdx,4), %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x558b98
movq 0x10(%rsp), %rcx
leal 0x1(%rcx), %edx
cmpl %edx, %r15d
cmovgl %r15d, %edx
leaq (%rax,%r14,8), %rdi
notl %ecx
addl %edx, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %esi, %esi
movq %rax, %r15
callq 0x19e090
movq %r15, %rax
movq %rax, 0x70(%rsp)
movl 0x20(%rsp), %r15d
movl 0x28(%rsp), %eax
vmovq %r14, %xmm0
vmovq %r15, %xmm1
vmovsd 0x68(%rsp), %xmm2
vmovsd 0x58(%rsp), %xmm3
movq %rax, 0x78(%rsp)
vmovq %rax, %xmm4
vpbroadcastq %xmm0, %ymm5
vpcmpeqd %ymm0, %ymm0, %ymm0
vpbroadcastq %xmm1, %ymm6
vbroadcastsd %xmm2, %ymm1
vmovapd %ymm1, 0x180(%rsp)
vbroadcastsd %xmm3, %ymm1
vmovaps %ymm1, 0x300(%rsp)
vpbroadcastq %xmm4, %ymm1
vmovdqa %ymm1, 0x2e0(%rsp)
vmovdqa %ymm5, 0x340(%rsp)
vpaddq %ymm0, %ymm5, %ymm1
vmovdqa %ymm1, 0x2a0(%rsp)
vmovdqa %ymm6, 0x320(%rsp)
vpaddq %ymm0, %ymm6, %ymm0
vmovdqa %ymm0, 0x2c0(%rsp)
movq 0x10(%r13), %rax
xorl %ecx, %ecx
movl 0x160(%rsp), %esi
movq 0xe0(%rsp), %rdi
movzbl (%rdi,%rcx), %edx
movslq (%rax,%rdx,4), %rdx
movq %rdx, 0x18(%r12,%rcx,8)
incq %rcx
cmpq %rcx, %r15
jne 0x558c7f
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movq 0x20(%rsp), %rcx
leal 0x1(%rcx), %eax
cmpl %eax, %esi
cmovgl %esi, %eax
leaq (%r12,%r15,8), %rdi
addq $0x18, %rdi
notl %ecx
addl %eax, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %esi, %esi
vzeroupper
callq 0x19e090
movslq 0x1c(%rsp), %r10
xorl %eax, %eax
cmpl $0x0, 0x28(%rbp)
je 0x558d01
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rsi
movq $0x0, 0x18(%rdx,%rax,8)
movq %rbx, 0x18(%rsi,%rax,8)
incq %rax
cmpq %rax, %r15
jne 0x558ce9
jmp 0x558d25
movq %r10, %rcx
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rsi
movq %rcx, 0x18(%rdx,%rax,8)
movq %rbx, 0x18(%rsi,%rax,8)
incq %rax
subq 0x78(%rsp), %rcx
cmpq %rax, %r15
jne 0x558d0e
xorl %eax, %eax
movl 0x160(%rsp), %edi
movq %rbx, (%rdx,%rax,8)
movq %rbx, (%rsi,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x558d2e
leaq 0x3(%r15), %rax
movq 0x20(%rsp), %rcx
movq %rbx, (%rdx,%rax,8)
movq %rbx, (%rsi,%rax,8)
incq %rax
incl %ecx
cmpl %ecx, %edi
jg 0x558d48
movq $0x0, 0x10(%rdx)
vmovdqa 0x80(%rsp), %ymm0
vmovdqa %ymm0, %ymm3
vmovdqa %ymm0, %ymm4
vmovdqa %ymm0, %ymm5
vmovdqa %ymm0, %ymm6
vmovdqa %ymm0, %ymm7
vmovdqa %ymm0, 0x120(%rsp)
vmovdqa 0x180(%rsp), %ymm0
vmovdqa %ymm0, 0x100(%rsp)
cmpl $0x0, 0x10(%rsp)
jle 0x5592ff
movq 0x8(%r13), %rax
movq %rax, 0xa8(%rsp)
movq 0x10(%rsp), %rax
leal -0x1(%rax), %edx
vpxor %xmm0, %xmm0, %xmm0
vmovdqa 0x80(%rsp), %ymm3
vpblendd $0x3, %ymm0, %ymm3, %ymm0 # ymm0 = ymm0[0,1],ymm3[2,3,4,5,6,7]
vpermq $0x39, %ymm0, %ymm0     # ymm0 = ymm0[1,2,3,0]
vmovdqa %ymm0, 0x280(%rsp)
movq 0x20(%rsp), %rax
decl %eax
movq %rax, 0xd8(%rsp)
cmpl $0x2, %edi
movl $0x1, %eax
cmovgel %edi, %eax
movq %rax, 0xd0(%rsp)
leaq 0x1(%r15), %rax
movq %rax, 0xc8(%rsp)
leaq 0x2(%r15), %rax
movq %rax, 0xc0(%rsp)
vmovaps 0xd4d84(%rip), %ymm0    # 0x62dba0
vmovaps %ymm0, 0xe0(%rsp)
vpcmpeqd %ymm12, %ymm12, %ymm12
vbroadcastsd 0xd4d55(%rip), %ymm0 # 0x62db88
vmovaps %ymm0, 0x260(%rsp)
xorl %r9d, %r9d
vmovdqa 0x180(%rsp), %ymm0
vmovdqa %ymm0, 0x100(%rsp)
vmovdqa %ymm3, 0x120(%rsp)
vmovdqa %ymm3, %ymm7
vmovdqa %ymm3, %ymm6
vmovdqa %ymm3, %ymm5
vmovdqa %ymm3, %ymm4
movq %r10, 0xb0(%rsp)
movq %r9, %r11
orq $0x2, %r11
cmpl $0x0, 0x30(%r13)
je 0x558eb0
movq %r9, %rax
orq $0x1, %rax
cmpq %r14, %rax
cmovgel %edx, %eax
cltq
cmpq %r14, %r11
movl %r11d, %ecx
cmovgel %edx, %ecx
movslq %ecx, %rcx
movq %r9, %rsi
orq $0x3, %rsi
cmpq %r14, %rsi
cmovgel %edx, %esi
movslq %esi, %rdi
movq %r9, %rsi
jmp 0x558ec7
movq 0x70(%rsp), %rdi
movq (%rdi,%r9,8), %rsi
movq 0x8(%rdi,%r9,8), %rax
movq (%rdi,%r11,8), %rcx
movq 0x18(%rdi,%r9,8), %rdi
movslq 0x18(%r13), %r8
imulq %r8, %rax
imulq %r8, %rsi
imulq %r8, %rcx
imulq %r8, %rdi
leaq 0x4(%r9), %r8
movq %r8, 0xb8(%rsp)
imulq 0x78(%rsp), %r8
subq %r8, %r10
movl %r9d, %r8d
imull 0x28(%rsp), %r8d
movl 0x1c(%rsp), %ebx
subl %r8d, %ebx
cmpl $0x0, 0x18(%rbp)
movq 0xa8(%rsp), %r8
leaq (%r8,%rax,4), %rax
movq %rax, 0x68(%rsp)
leaq (%r8,%rsi,4), %rax
movq %rax, 0x60(%rsp)
leaq (%r8,%rcx,4), %rax
movq %rax, 0x58(%rsp)
leaq (%r8,%rdi,4), %rax
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rax
vpbroadcastq 0x10(%rax), %ymm0
movq %r10, 0x10(%rax)
movl $0x0, %ecx
cmovnel %ecx, %ebx
movslq %ebx, %rcx
vmovq %rcx, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovdqa 0x280(%rsp), %ymm2
vpblendd $0xc0, %ymm1, %ymm2, %ymm15 # ymm15 = ymm2[0,1,2,3,4,5],ymm1[6,7]
vpblendd $0xc0, %ymm0, %ymm2, %ymm9 # ymm9 = ymm2[0,1,2,3,4,5],ymm0[6,7]
movq %r9, %r10
orq $0x1, %r10
movq %r9, %r8
orq $0x3, %r8
vmovdqa 0xe0(%rsp), %ymm0
vpcmpeqq 0x2a0(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x360(%rsp)
xorl %ebx, %ebx
vpmovsxbq 0xd2f50(%rip), %ymm13 # 0x62beee
vmovdqa 0x80(%rsp), %ymm2
vmovdqa %ymm2, %ymm0
movq 0x38(%rsp), %rcx
vpermq $0xf9, %ymm15, %ymm1    # ymm1 = ymm15[1,2,3,3]
vpbroadcastq 0x18(%rax,%rbx,8), %ymm11
vpblendd $0xc0, %ymm11, %ymm1, %ymm10 # ymm10 = ymm1[0,1,2,3,4,5],ymm11[6,7]
vpermq $0xf9, %ymm0, %ymm0     # ymm0 = ymm0[1,2,3,3]
vpbroadcastq 0x18(%rcx,%rbx,8), %ymm1
vpblendd $0xc0, %ymm1, %ymm0, %ymm0 # ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
vmovdqa 0x300(%rsp), %ymm8
vmovdqa %ymm10, 0x160(%rsp)
vpsubq %ymm8, %ymm10, %ymm1
vmovdqa 0x2e0(%rsp), %ymm10
vpsubq %ymm10, %ymm0, %ymm0
vpsubq %ymm8, %ymm15, %ymm11
vpsubq %ymm10, %ymm2, %ymm2
movq 0x18(%r12,%rbx,8), %rcx
movq 0x60(%rsp), %rax
movslq (%rax,%rcx,4), %rcx
movq 0x10(%r12,%rbx,8), %r13
movq 0x68(%rsp), %rax
movslq (%rax,%r13,4), %r13
movq (%r12,%rbx,8), %rax
movq 0x8(%r12,%rbx,8), %rsi
movq 0x58(%rsp), %rdi
movslq (%rdi,%rsi,4), %rsi
movq 0x50(%rsp), %rdi
movslq (%rdi,%rax,4), %rax
vmovq %rcx, %xmm15
vmovq %r13, %xmm10
vpunpcklqdq %xmm15, %xmm10, %xmm10 # xmm10 = xmm10[0],xmm15[0]
vmovq %rsi, %xmm15
vmovq %rax, %xmm8
vpunpcklqdq %xmm15, %xmm8, %xmm8 # xmm8 = xmm8[0],xmm15[0]
vpcmpgtq %ymm0, %ymm1, %ymm15
vblendvpd %ymm15, %ymm1, %ymm0, %ymm0
vinserti128 $0x1, %xmm10, %ymm8, %ymm1
vpcmpgtq %ymm2, %ymm11, %ymm8
vblendvpd %ymm8, %ymm11, %ymm2, %ymm11
vpaddq %ymm1, %ymm9, %ymm1
vpcmpgtq %ymm11, %ymm1, %ymm2
vblendvpd %ymm2, %ymm1, %ymm11, %ymm1
vpcmpgtq %ymm0, %ymm1, %ymm2
vblendvpd %ymm2, %ymm1, %ymm0, %ymm9
vpcmpeqq %ymm12, %ymm13, %ymm2
vblendvpd %ymm2, 0x140(%rsp), %ymm9, %ymm15
cmpq $0x4, %rbx
jb 0x5590e0
vmovdqa 0x100(%rsp), %ymm8
vpcmpgtq %ymm8, %ymm15, %ymm1
vblendvpd %ymm1, %ymm8, %ymm15, %ymm8
vmovapd %ymm8, 0x100(%rsp)
vmovdqa 0x120(%rsp), %ymm8
vpcmpgtq %ymm15, %ymm8, %ymm1
vblendvpd %ymm1, %ymm8, %ymm15, %ymm8
vmovapd %ymm8, 0x120(%rsp)
cmpq %rdx, %r9
setne %al
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq (%rsi), %rcx
movq 0x8(%rsi), %r13
cmpq %r15, %rbx
setae %sil
orb %al, %sil
vextractf128 $0x1, %ymm15, %xmm1
jne 0x55910f
vextractps $0x2, %xmm1, (%rcx,%rbx,4)
cmpq %rbx, 0xd8(%rsp)
jne 0x559121
vextractps $0x2, %xmm1, (%r13,%r9,4)
cmpq %rdx, %r10
setne %al
leaq -0x1(%rbx), %rsi
cmpq %r15, %rsi
setae %sil
orb %al, %sil
jne 0x55913d
vmovss %xmm1, -0x4(%rcx,%rbx,4)
cmpq %r14, %r10
setge %al
cmpq %rbx, %r15
setne %sil
orb %al, %sil
jne 0x559156
vmovss %xmm1, (%r13,%r10,4)
cmpq %rdx, %r11
jne 0x55917c
leaq -0x2(%rbx), %rax
cmpq $0x2, %rbx
setae %sil
cmpq %r15, %rax
setl %al
andb %sil, %al
cmpb $0x1, %al
jne 0x55917c
vpextrd $0x2, %xmm15, -0x8(%rcx,%rbx,4)
cmpq %r14, %r11
setge %al
cmpq %rbx, 0xc8(%rsp)
setne %sil
orb %al, %sil
jne 0x55919b
vpextrd $0x2, %xmm15, (%r13,%r11,4)
cmpq %rdx, %r8
setne %al
cmpq $0x3, %rbx
setb %sil
orb %al, %sil
jne 0x5591b4
vmovd %xmm15, -0xc(%rcx,%rbx,4)
vblendvpd %ymm2, 0x80(%rsp), %ymm0, %ymm0
cmpq %r14, %r8
setge %al
cmpq %rbx, 0xc0(%rsp)
setne %cl
orb %al, %cl
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rcx
jne 0x5591e5
vmovd %xmm15, (%r13,%r8,4)
vblendvpd %ymm2, 0x80(%rsp), %ymm11, %ymm2
vmovdqa 0x340(%rsp), %ymm1
vmovdqa 0xe0(%rsp), %ymm12
vpcmpgtq %ymm12, %ymm1, %ymm1
vpcmpeqq 0x2c0(%rsp), %ymm13, %ymm8
vpcmpeqd %ymm10, %ymm10, %ymm10
vpcmpgtq %ymm10, %ymm13, %ymm10
vmovdqa 0x320(%rsp), %ymm11
vpcmpgtq %ymm13, %ymm11, %ymm11
vpand %ymm10, %ymm11, %ymm10
vpcmpgtq %ymm7, %ymm15, %ymm11
vmovdqa 0x360(%rsp), %ymm14
vpand %ymm14, %ymm10, %ymm10
vpand %ymm11, %ymm10, %ymm10
vpcmpgtq %ymm6, %ymm15, %ymm11
vpand %ymm1, %ymm8, %ymm1
vpand %ymm1, %ymm11, %ymm1
vblendvpd %ymm10, %ymm9, %ymm7, %ymm7
vpand %ymm14, %ymm8, %ymm8
vblendvpd %ymm8, %ymm15, %ymm5, %ymm5
vblendvpd %ymm1, %ymm15, %ymm6, %ymm6
vblendvpd %ymm1, %ymm12, %ymm4, %ymm4
vpcmpeqd %ymm12, %ymm12, %ymm12
vblendvpd %ymm10, %ymm13, %ymm3, %ymm3
vmovq %xmm15, (%rax,%rbx,8)
vmovlpd %xmm0, (%rcx,%rbx,8)
vpsubq %ymm12, %ymm13, %ymm13
incq %rbx
cmpq %rbx, 0xd0(%rsp)
vmovaps 0x160(%rsp), %ymm9
jne 0x558fb0
vmovdqa 0xe0(%rsp), %ymm0
vpaddq 0x260(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0xe0(%rsp)
vmovdqa 0x140(%rsp), %ymm0
vpsubq 0x1c0(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x140(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, %r9
cmpq %r14, %rax
movq 0x10(%rbp), %r13
movq 0x48(%rsp), %rbx
movq 0xb0(%rsp), %r10
jl 0x558e72
vmovdqa %ymm7, 0x240(%rsp)
vmovdqa %ymm6, 0x220(%rsp)
vmovdqa %ymm5, 0x200(%rsp)
vmovdqa %ymm4, 0x1a0(%rsp)
vmovdqa %ymm3, 0x1e0(%rsp)
xorl %edi, %edi
movq %rbx, %rax
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %edx, %edx
movq 0x20(%rsp), %r11
movl 0x30(%rbp), %r14d
movl 0x20(%rbp), %r15d
movq 0x220(%rsp,%rdi,8), %r8
cmpq %rax, %r8
jle 0x559362
movq 0x1a0(%rsp,%rdi,8), %r9
movl %r9d, %ecx
movq %r8, %rax
jmp 0x559374
jne 0x559374
movq 0x1a0(%rsp,%rdi,8), %r9
movslq %ecx, %r10
cmpq %r10, %r9
jl 0x55935a
movq 0x240(%rsp,%rdi,8), %r8
cmpq %rsi, %r8
jle 0x55938b
movl 0x1e0(%rsp,%rdi,8), %edx
movq %r8, %rsi
movq 0x200(%rsp,%rdi,8), %r8
cmpq %rbx, %r8
cmovgq %r8, %rbx
incq %rdi
cmpl $0x4, %edi
jne 0x559345
testl %r14d, %r14d
sete %dil
testl %r15d, %r15d
sete %r8b
orb %dil, %r8b
jne 0x5593d8
cmpq %rsi, %rax
movq 0x30(%rsp), %rdi
jg 0x5593e2
jne 0x5593c9
decl %r11d
cmpl %r11d, %edx
je 0x559431
movq 0x10(%rsp), %rcx
decl %ecx
movq %rsi, %rax
movl %edx, %r11d
jmp 0x559431
testl %r15d, %r15d
movq 0x30(%rsp), %rdi
je 0x559419
decl %r11d
jmp 0x559431
callq 0x1f0aff
jmp 0x5594b9
callq 0x1f0ad9
jmp 0x5594b9
callq 0x1f0ab3
jmp 0x5594b9
callq 0x1f0a8d
jmp 0x5594b9
callq 0x1f0a67
jmp 0x5594b9
movq 0x10(%rsp), %rcx
decl %ecx
decl %r11d
testl %r14d, %r14d
cmovneq %rsi, %rbx
cmovnel %edx, %r11d
movq %rbx, %rax
vmovdqa 0x80(%rsp), %ymm0
vpcmpgtq 0x100(%rsp), %ymm0, %ymm0
vmovdqa 0x120(%rsp), %ymm1
vpcmpgtq 0x180(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestpd %ymm0, %ymm0
je 0x55946d
orb $0x40, 0xc(%rdi)
xorl %eax, %eax
xorl %r11d, %r11d
xorl %ecx, %ecx
movl %eax, (%rdi)
movl %ecx, 0x4(%rdi)
movl %r11d, 0x8(%rdi)
movq 0x38(%rsp), %rdi
vzeroupper
callq 0x20a60d
movq 0x40(%rsp), %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
cmpl $0x0, 0x30(%r13)
jne 0x5594a6
movq 0x70(%rsp), %rdi
callq 0x20a60d
movq 0x30(%rsp), %rax
jmp 0x5594bb
callq 0x1f0a41
jmp 0x5594b9
callq 0x1f0a1b
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq