// File: /workspace/github_c_makefile_star2_O2/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 $0x4e0, %rsp            # imm = 0x4E0
movq %r9, 0x28(%rsp)
testq %rdx, %rdx
je 0x4f9f08
movl %ecx, %ebx
testl %ecx, %ecx
jle 0x4f9f2c
testl %r8d, %r8d
js 0x4f9f50
cmpl $0x0, 0x28(%rsp)
js 0x4f9f8f
movq %rdx, %r14
movq 0x10(%rbp), %rdx
testq %rdx, %rdx
je 0x4f9fb0
movq %rdi, %r15
cmpl $0x0, 0x30(%rdx)
je 0x4f930a
movl 0x34(%rdx), %esi
jmp 0x4f931b
testq %r15, %r15
je 0x4f9fd1
testl %esi, %esi
jle 0x4f9ff2
leal 0x3(%rsi), %eax
movl %eax, 0x160(%rsp)
movl %r8d, %r9d
negl %r9d
movslq 0x20(%rdx), %rax
movl %r8d, %ecx
movq %rcx, 0x180(%rsp)
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
movq %r13, %rdi
subq %rax, %rdi
movl %r9d, 0x1c(%rsp)
cmpl %r9d, %eax
leal 0x3(%rbx), %r12d
cmovgq %rcx, %rdi
incq %rdi
movslq 0x1c(%rdx), %rax
subq %rax, %r13
addq $-0x2, %r13
movq %rdi, 0x50(%rsp)
vmovq %rdi, %xmm0
vpbroadcastq %xmm0, %ymm1
movq 0x28(%rsp), %rax
leal (,%rax,4), %eax
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %ymm0, 0x100(%rsp)
cmpl $0x0, 0x18(%rbp)
jne 0x4f93a5
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x280(%rsp)
vmovdqa %ymm1, 0x2e0(%rsp)
vmovdqa %ymm1, 0x2c0(%rsp)
vmovdqa %ymm1, 0x2a0(%rsp)
vmovdqa %ymm1, 0x1e0(%rsp)
vmovdqa %ymm1, 0x240(%rsp)
jne 0x4f941d
movl 0x1c(%rsp), %r9d
movl %r9d, %eax
movq 0x28(%rsp), %rdi
subl %edi, %eax
movl %r9d, %edx
subl %edi, %edx
subl %edi, %edx
imull $-0x3, %edi, %ecx
subl %r8d, %ecx
vmovd %ecx, %xmm0
vpinsrd $0x1, %edx, %xmm0, %xmm0
vpinsrd $0x2, %eax, %xmm0, %xmm0
vpinsrd $0x3, %r9d, %xmm0, %xmm0
vpmovsxdq %xmm0, %ymm0
vmovdqa %ymm0, 0x100(%rsp)
movq %rsi, 0xc0(%rsp)
movl %esi, %edi
movl %ebx, %esi
vzeroupper
callq 0x1ab93b
testq %rax, %rax
je 0x4f94e4
movq %r15, 0x140(%rsp)
movq %r14, 0xe0(%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, 0x68(%rsp)
movl %ecx, 0xc(%rax)
movq %rbx, 0x10(%rsp)
addl $0x6, %ebx
pushq $0x20
popq %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1ab78c
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1ab78c
movq %rax, %r15
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x1ab78c
movq %rax, %r8
movq %r14, 0x38(%rsp)
testq %r14, %r14
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
testq %r8, %r8
sete %al
orb %cl, %al
je 0x4f94eb
xorl %ebx, %ebx
jmp 0x4fa01a
movq %r15, %r10
movq 0xc0(%rsp), %r11
movslq %r11d, %rbx
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
movq %r15, 0x40(%rsp)
movq %r8, 0x30(%rsp)
je 0x4f9651
movq $0x0, 0x20(%rsp)
movq 0x10(%rsp), %rdi
vmovdqa 0x1e0(%rsp), %ymm5
movq 0xe0(%rsp), %r9
movl %edi, %edi
movl 0x28(%rsp), %eax
vmovq %rbx, %xmm0
vmovq %rdi, %xmm1
vmovq %r13, %xmm2
vmovq 0x180(%rsp), %xmm3
movq %rax, 0x58(%rsp)
vmovq %rax, %xmm4
vpbroadcastq %xmm0, %ymm6
vpcmpeqd %ymm0, %ymm0, %ymm0
vpbroadcastq %xmm1, %ymm7
vpbroadcastq %xmm2, %ymm1
vmovdqa %ymm1, 0x260(%rsp)
vpbroadcastq %xmm3, %ymm1
vmovdqa %ymm1, 0xe0(%rsp)
vpbroadcastq %xmm4, %ymm1
vmovdqa %ymm1, 0x140(%rsp)
vmovdqa %ymm6, 0x3a0(%rsp)
vpaddq %ymm0, %ymm6, %ymm1
vmovdqa %ymm1, 0x320(%rsp)
vmovdqa %ymm7, 0x380(%rsp)
vpaddq %ymm0, %ymm7, %ymm0
vmovdqa %ymm0, 0x360(%rsp)
movq 0x10(%rbp), %r13
movq 0x10(%r13), %rax
xorl %ecx, %ecx
movq 0x50(%rsp), %r14
movq 0x38(%rsp), %rsi
cmpq %rcx, %rdi
je 0x4f95e8
movzbl (%r9,%rcx), %edx
movslq (%rax,%rdx,4), %rdx
movq %rdx, 0x18(%rsi,%rcx,8)
incq %rcx
jmp 0x4f95d0
xorl %eax, %eax
movq 0x38(%rsp), %rcx
cmpq $0x3, %rax
je 0x4f95ff
andq $0x0, (%rcx,%rax,8)
incq %rax
jmp 0x4f95ef
movq 0x38(%rsp), %rax
leaq (%rax,%rdi,8), %rax
addq $0x18, %rax
movq 0x10(%rsp), %rcx
cmpl %ecx, %r12d
jle 0x4f9622
andq $0x0, (%rax)
addq $0x8, %rax
incl %ecx
jmp 0x4f9611
movslq 0x1c(%rsp), %rcx
cmpl $0x0, 0x28(%rbp)
movq %rcx, 0x70(%rsp)
je 0x4f96d7
xorl %eax, %eax
cmpq %rax, %rdi
je 0x4f96f2
andq $0x0, 0x18(%r10,%rax,8)
movq %r14, 0x18(%r8,%rax,8)
incq %rax
jmp 0x4f9638
movslq 0x160(%rsp), %r15
pushq $0x20
popq %rdi
movq %r15, %rsi
callq 0x1ab78c
movq %rax, 0x20(%rsp)
testq %rax, %rax
movq 0x10(%rsp), %rdi
movq 0xe0(%rsp), %r9
je 0x4f94e4
movq 0xc0(%rsp), %r11
movl %r11d, %eax
sarl $0x1f, %eax
andnl %r11d, %eax, %eax
xorl %ecx, %ecx
vmovdqa 0x1e0(%rsp), %ymm5
movq 0x40(%rsp), %r10
movq 0x30(%rsp), %r8
movq 0x140(%rsp), %r14
cmpq %rcx, %rax
je 0x4f9f74
movq 0x10(%rbp), %rdx
movq 0x10(%rdx), %rdx
movzbl (%r14,%rcx), %esi
movslq (%rdx,%rsi,4), %rdx
movq 0x20(%rsp), %rsi
movq %rdx, (%rsi,%rcx,8)
incq %rcx
jmp 0x4f96af
xorl %eax, %eax
cmpq %rax, %rdi
je 0x4f96f2
movq %rcx, 0x18(%r10,%rax,8)
movq %r14, 0x18(%r8,%rax,8)
incq %rax
subq 0x58(%rsp), %rcx
jmp 0x4f96d9
xorl %eax, %eax
cmpq $0x3, %rax
je 0x4f9707
movq %r14, (%r10,%rax,8)
movq %r14, (%r8,%rax,8)
incq %rax
jmp 0x4f96f4
movq %rdi, %rax
cmpl %eax, %r12d
jle 0x4f971e
movq %r14, 0x18(%r10,%rax,8)
movq %r14, 0x18(%r8,%rax,8)
incq %rax
jmp 0x4f970a
andq $0x0, 0x10(%r10)
decl %r11d
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x3, %ymm0, %ymm5, %ymm0 # ymm0 = ymm0[0,1],ymm5[2,3,4,5,6,7]
vpermq $0x39, %ymm0, %ymm0     # ymm0 = ymm0[1,2,3,0]
vmovdqa %ymm0, 0x300(%rsp)
movq 0x10(%rsp), %rax
decl %eax
movq %rax, 0x10(%rsp)
movl %r12d, %eax
sarl $0x1f, %eax
andnl %r12d, %eax, %eax
movq %rax, 0xb8(%rsp)
leaq 0x2(%rdi), %rax
movq %rax, 0x88(%rsp)
leaq 0x1(%rdi), %rax
movq %rax, 0x80(%rsp)
vmovaps 0xd2042(%rip), %ymm0    # 0x5cb7c0
vmovaps %ymm0, 0x120(%rsp)
xorl %r9d, %r9d
vmovdqa %ymm5, %ymm3
vmovdqa %ymm5, %ymm4
vmovdqa %ymm5, %ymm8
vmovdqa %ymm5, %ymm9
vmovdqa %ymm5, %ymm10
vmovdqa %ymm5, 0x1a0(%rsp)
vmovdqa 0x260(%rsp), %ymm0
vmovdqa %ymm0, 0x1c0(%rsp)
movq %rdi, 0x60(%rsp)
cmpq %rbx, %r9
jge 0x4f9d92
movq %r9, %r12
orq $0x2, %r12
cmpl $0x0, 0x30(%r13)
je 0x4f980e
movq %r9, %r15
orq $0x1, %r15
cmpq %rbx, %r15
movl %r11d, %eax
cmovll %r15d, %eax
cltq
cmpq %rbx, %r12
movl %r12d, %ecx
cmovgel %r11d, %ecx
movslq %ecx, %rcx
movq %r9, %r14
orq $0x3, %r14
cmpq %rbx, %r14
movl %r14d, %edx
cmovgel %r11d, %edx
movslq %edx, %rsi
movq %r9, %rdx
jmp 0x4f9833
movq 0x20(%rsp), %rsi
movq (%rsi,%r9,8), %rdx
movq 0x8(%rsi,%r9,8), %rax
movq %r9, %r15
orq $0x1, %r15
movq (%rsi,%r12,8), %rcx
movq %r9, %r14
orq $0x3, %r14
movq 0x18(%rsi,%r9,8), %rsi
movq 0x8(%r13), %rdi
movslq 0x18(%r13), %r8
imulq %r8, %rax
imulq %r8, %rdx
imulq %r8, %rcx
imulq %r8, %rsi
movl %r9d, %r8d
imull 0x28(%rsp), %r8d
movq %r9, 0x48(%rsp)
movl 0x1c(%rsp), %r9d
subl %r8d, %r9d
cmpl $0x0, 0x18(%rbp)
leaq (%rdi,%rax,4), %rax
movq %rax, 0xa8(%rsp)
leaq (%rdi,%rdx,4), %rax
movq %rax, 0xa0(%rsp)
leaq (%rdi,%rcx,4), %rax
movq %rax, 0x98(%rsp)
leaq (%rdi,%rsi,4), %rax
movq %rax, 0x90(%rsp)
movl $0x0, %eax
cmovnel %eax, %r9d
movslq %r9d, %rax
vmovq %rax, %xmm0
movq 0x48(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x78(%rsp)
imulq 0x58(%rsp), %rax
movq 0x70(%rsp), %rcx
subq %rax, %rcx
vpbroadcastq 0x10(%r10), %ymm1
vmovdqa 0x300(%rsp), %ymm2
vpblendd $0xc0, %ymm1, %ymm2, %ymm6 # ymm6 = ymm2[0,1,2,3,4,5],ymm1[6,7]
vpbroadcastq %xmm0, %ymm0
vpblendd $0xc0, %ymm0, %ymm2, %ymm13 # ymm13 = ymm2[0,1,2,3,4,5],ymm0[6,7]
movq %rcx, 0x10(%r10)
vmovdqa 0x120(%rsp), %ymm0
vpcmpeqq 0x320(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x3c0(%rsp)
xorl %r13d, %r13d
vmovdqa %ymm5, %ymm14
vmovdqa %ymm5, %ymm0
vpmovsxbq 0xd03b8(%rip), %ymm12 # 0x5c9cce
movq 0x30(%rsp), %rdi
movq %r14, 0xb0(%rsp)
cmpq %r13, 0xb8(%rsp)
je 0x4f9d45
movq %r15, %r14
movq %r12, %r15
vmovdqa %ymm10, 0x400(%rsp)
vmovdqa %ymm9, 0x420(%rsp)
vmovdqa %ymm8, 0x440(%rsp)
vmovdqa %ymm4, 0x460(%rsp)
vmovdqa %ymm3, 0x480(%rsp)
movq %rbx, %r12
movq %r11, %rbx
vpermq $0xf9, %ymm13, %ymm1    # ymm1 = ymm13[1,2,3,3]
vpbroadcastq 0x18(%r10,%r13,8), %ymm2
vpblendd $0xc0, %ymm2, %ymm1, %ymm2 # ymm2 = ymm1[0,1,2,3,4,5],ymm2[6,7]
vpermq $0xf9, %ymm0, %ymm0     # ymm0 = ymm0[1,2,3,3]
vpbroadcastq 0x18(%rdi,%r13,8), %ymm1
vpblendd $0xc0, %ymm1, %ymm0, %ymm1 # ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
vmovdqa %ymm2, 0x3e0(%rsp)
vpsubq 0xe0(%rsp), %ymm2, %ymm0
vpsubq 0x140(%rsp), %ymm1, %ymm1
vmovdqa %ymm12, 0x160(%rsp)
vmovdqa %ymm13, 0xc0(%rsp)
vmovdqa %ymm14, 0x200(%rsp)
vmovdqa %ymm6, 0x220(%rsp)
callq 0x4fa02c
vmovdqa %ymm0, 0x180(%rsp)
vmovdqa 0xc0(%rsp), %ymm0
vpsubq 0xe0(%rsp), %ymm0, %ymm0
vmovdqa 0x200(%rsp), %ymm1
vpsubq 0x140(%rsp), %ymm1, %ymm1
callq 0x4fa02c
vmovdqa %ymm0, %ymm3
movq 0x38(%rsp), %rsi
movq 0x18(%rsi,%r13,8), %rax
movq 0xa0(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
movq 0x10(%rsi,%r13,8), %rcx
movq 0xa8(%rsp), %rdx
movslq (%rdx,%rcx,4), %rcx
movq (%rsi,%r13,8), %rdx
movq 0x8(%rsi,%r13,8), %rsi
movq 0x98(%rsp), %rdi
movslq (%rdi,%rsi,4), %rsi
movq 0x90(%rsp), %rdi
movslq (%rdi,%rdx,4), %rdx
vmovq %rax, %xmm0
vmovq %rcx, %xmm1
vpunpcklqdq %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0]
vmovq %rsi, %xmm1
vmovq %rdx, %xmm2
vpunpcklqdq %xmm1, %xmm2, %xmm1 # xmm1 = xmm2[0],xmm1[0]
vinserti128 $0x1, %xmm0, %ymm1, %ymm0
vpaddq 0x220(%rsp), %ymm0, %ymm0
vmovdqa %ymm3, 0x220(%rsp)
vmovdqa %ymm3, %ymm1
callq 0x4fa02c
vmovapd 0x180(%rsp), %ymm1
callq 0x4fa02c
vmovdqa 0x160(%rsp), %ymm12
vmovdqa %ymm0, %ymm4
vpcmpeqq 0xd1fcd(%rip), %ymm12, %ymm2 # 0x5cba80
vblendvpd %ymm2, 0x100(%rsp), %ymm0, %ymm13
cmpq $0x4, %r13
jb 0x4f9b3b
vmovdqa 0x1c0(%rsp), %ymm1
vpcmpgtq %ymm1, %ymm13, %ymm0
vblendvpd %ymm0, %ymm1, %ymm13, %ymm1
vmovapd %ymm1, 0x1c0(%rsp)
vmovapd 0x1a0(%rsp), %ymm0
vmovapd %ymm13, %ymm1
vmovaps %ymm13, 0xc0(%rsp)
vmovdqa %ymm4, 0x200(%rsp)
vmovaps %ymm2, 0x340(%rsp)
callq 0x4fa02c
vmovapd 0x340(%rsp), %ymm2
vmovdqa 0x200(%rsp), %ymm4
vmovapd 0xc0(%rsp), %ymm13
vmovdqa 0x160(%rsp), %ymm12
vmovapd %ymm0, 0x1a0(%rsp)
movq %rbx, %r11
movq 0x60(%rsp), %r8
movq 0x48(%rsp), %r9
cmpq %rbx, %r9
setne %dl
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
cmpq %r8, %r13
setae %sil
orb %dl, %sil
vextractf128 $0x1, %ymm13, %xmm0
vmovapd 0x1e0(%rsp), %ymm5
movq 0x40(%rsp), %r10
movq 0x30(%rsp), %rdi
movq %r12, %rbx
vmovapd 0x440(%rsp), %ymm8
vmovdqa 0x420(%rsp), %ymm9
vmovdqa 0x400(%rsp), %ymm10
jne 0x4f9ba8
vextractps $0x2, %xmm0, (%rcx,%r13,4)
cmpq %r13, 0x10(%rsp)
movq %r15, %r12
jne 0x4f9bb9
vextractps $0x2, %xmm0, (%rax,%r9,4)
movq %r14, %r15
cmpq %r11, %r14
setne %dl
leaq -0x1(%r13), %rsi
cmpq %r8, %rsi
setae %sil
orb %dl, %sil
jne 0x4f9bd9
vmovss %xmm0, -0x4(%rcx,%r13,4)
cmpq %rbx, %r15
setge %dl
cmpq %r13, %r8
setne %sil
orb %dl, %sil
movq 0xb0(%rsp), %r14
jne 0x4f9bf9
vmovss %xmm0, (%rax,%r15,4)
cmpq %r11, %r12
jne 0x4f9c20
leaq -0x2(%r13), %rdx
cmpq $0x2, %r13
setae %sil
cmpq %r8, %rdx
setl %dl
andb %sil, %dl
cmpb $0x1, %dl
jne 0x4f9c20
vextractps $0x2, %xmm13, -0x8(%rcx,%r13,4)
cmpq %rbx, %r12
setge %dl
cmpq %r13, 0x80(%rsp)
setne %sil
orb %dl, %sil
jne 0x4f9c3e
vextractps $0x2, %xmm13, (%rax,%r12,4)
cmpq %r11, %r14
setne %dl
cmpq $0x3, %r13
setb %sil
orb %dl, %sil
jne 0x4f9c58
vmovss %xmm13, -0xc(%rcx,%r13,4)
vmovapd 0x180(%rsp), %ymm0
vblendvpd %ymm2, %ymm5, %ymm0, %ymm0
cmpq %rbx, %r14
setge %cl
cmpq %r13, 0x88(%rsp)
setne %dl
orb %cl, %dl
jne 0x4f9c82
vmovss %xmm13, (%rax,%r14,4)
vmovapd 0x220(%rsp), %ymm1
vblendvpd %ymm2, %ymm5, %ymm1, %ymm14
vmovdqa 0x3a0(%rsp), %ymm1
vmovdqa 0x120(%rsp), %ymm6
vpcmpgtq %ymm6, %ymm1, %ymm1
vpcmpeqd %ymm7, %ymm7, %ymm7
vpcmpgtq %ymm7, %ymm12, %ymm2
vmovdqa 0x380(%rsp), %ymm3
vpcmpgtq %ymm12, %ymm3, %ymm3
vpand %ymm2, %ymm3, %ymm2
vpcmpgtq %ymm10, %ymm13, %ymm3
vmovdqa 0x3c0(%rsp), %ymm11
vpand %ymm2, %ymm11, %ymm2
vpand %ymm3, %ymm2, %ymm2
vpcmpeqq 0x360(%rsp), %ymm12, %ymm3
vblendvpd %ymm2, %ymm4, %ymm10, %ymm10
vpcmpgtq %ymm9, %ymm13, %ymm4
vpand %ymm3, %ymm1, %ymm1
vpand %ymm4, %ymm1, %ymm1
vpand %ymm3, %ymm11, %ymm3
vblendvpd %ymm3, %ymm13, %ymm8, %ymm8
vblendvpd %ymm1, %ymm13, %ymm9, %ymm9
vmovapd 0x460(%rsp), %ymm4
vblendvpd %ymm1, %ymm6, %ymm4, %ymm4
vmovapd 0x480(%rsp), %ymm3
vblendvpd %ymm2, %ymm12, %ymm3, %ymm3
vmovq %xmm13, (%r10,%r13,8)
vmovlpd %xmm0, (%rdi,%r13,8)
vpsubq %ymm7, %ymm12, %ymm12
incq %r13
vmovdqa 0x3e0(%rsp), %ymm6
jmp 0x4f9923
vpbroadcastq 0xd1d52(%rip), %ymm0 # 0x5cbaa0
vmovdqa 0x120(%rsp), %ymm1
vpaddq %ymm0, %ymm1, %ymm1
vmovdqa %ymm1, 0x120(%rsp)
vmovdqa 0x100(%rsp), %ymm0
vpsubq 0x280(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x100(%rsp)
movq 0x78(%rsp), %r9
movq 0x10(%rbp), %r13
movq 0x50(%rsp), %r14
jmp 0x4f97be
vmovdqa %ymm10, 0x2e0(%rsp)
vmovdqa %ymm9, 0x2c0(%rsp)
vmovdqa %ymm8, 0x2a0(%rsp)
vmovdqa %ymm4, 0x240(%rsp)
vmovdqa %ymm3, 0x4a0(%rsp)
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %rax
movq %r14, %rsi
movq 0x68(%rsp), %rbx
movl 0x30(%rbp), %r15d
movl 0x20(%rbp), %r12d
cmpl $0x4, %edi
je 0x4f9e37
movq 0x2c0(%rsp,%rdi,8), %r8
cmpq %rax, %r8
jle 0x4f9dfa
movq 0x240(%rsp,%rdi,8), %r9
movl %r9d, %ecx
movq %r8, %rax
jmp 0x4f9e0c
jne 0x4f9e0c
movq 0x240(%rsp,%rdi,8), %r9
movslq %ecx, %r10
cmpq %r10, %r9
jl 0x4f9df2
movq 0x2e0(%rsp,%rdi,8), %r8
cmpq %r14, %r8
jle 0x4f9e23
movl 0x4a0(%rsp,%rdi,8), %edx
movq %r8, %r14
movq 0x2a0(%rsp,%rdi,8), %r8
cmpq %rsi, %r8
cmovgq %r8, %rsi
incq %rdi
jmp 0x4f9dd8
testl %r15d, %r15d
sete %dil
testl %r12d, %r12d
sete %r8b
orb %dil, %r8b
jne 0x4f9e68
cmpq %r14, %rax
movq 0x30(%rsp), %rdi
jg 0x4f9e8c
jne 0x4f9e5c
cmpl 0x10(%rsp), %edx
je 0x4f9e8c
movq %r14, %rax
movl %edx, %ecx
movq %rcx, 0x10(%rsp)
jmp 0x4f9e89
testl %r12d, %r12d
movq 0x30(%rsp), %rdi
jne 0x4f9e8c
testl %r15d, %r15d
cmovneq %r14, %rsi
movq 0x10(%rsp), %rax
cmovnel %edx, %eax
movq %rax, 0x10(%rsp)
movq %rsi, %rax
movl %r11d, %ecx
vpcmpgtq 0x1c0(%rsp), %ymm5, %ymm0
vmovdqa 0x1a0(%rsp), %ymm1
vpcmpgtq 0x260(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestpd %ymm0, %ymm0
je 0x4f9ec5
orb $0x40, 0xc(%rbx)
xorl %eax, %eax
movq $0x0, 0x10(%rsp)
xorl %ecx, %ecx
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
movq 0x10(%rsp), %rax
movl %eax, 0x8(%rbx)
vzeroupper
callq 0x1ab763
movq 0x40(%rsp), %rdi
callq 0x1ab763
movq 0x38(%rsp), %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%r13)
jne 0x4fa01a
movq 0x20(%rsp), %rdi
callq 0x1ab763
jmp 0x4fa01a
movq 0x2410c9(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcd0d2(%rip), %rsi     # 0x5c6feb
leaq 0xd3121(%rip), %rdx     # 0x5cd041
leaq 0xcd7d6(%rip), %rcx     # 0x5c76fd
jmp 0x4fa011
movq 0x2410a5(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcd7c4(%rip), %rsi     # 0x5c7701
leaq 0xd30fd(%rip), %rdx     # 0x5cd041
leaq 0xcd7ca(%rip), %rcx     # 0x5c7715
jmp 0x4fa011
movq 0x241081(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcd7ba(%rip), %rsi     # 0x5c771b
leaq 0xd30d9(%rip), %rdx     # 0x5cd041
leaq 0xcd7c1(%rip), %rcx     # 0x5c7730
jmp 0x4fa011
movq %rbx, %rax
movq 0x20(%rsp), %rcx
cmpq %r15, %rax
jge 0x4f9530
andq $0x0, (%rcx,%rax,8)
incq %rax
jmp 0x4f9f7c
movq 0x241042(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcd77b(%rip), %rsi     # 0x5c771b
leaq 0xd309a(%rip), %rdx     # 0x5cd041
leaq 0xcd787(%rip), %rcx     # 0x5c7735
jmp 0x4fa011
movq 0x241021(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcd02a(%rip), %rsi     # 0x5c6feb
leaq 0xd3079(%rip), %rdx     # 0x5cd041
leaq 0xcd973(%rip), %rcx     # 0x5c7942
jmp 0x4fa011
movq 0x241000(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcd009(%rip), %rsi     # 0x5c6feb
leaq 0xd3058(%rip), %rdx     # 0x5cd041
leaq 0xcd749(%rip), %rcx     # 0x5c7739
jmp 0x4fa011
movq 0x240fdf(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcd6fe(%rip), %rsi     # 0x5c7701
leaq 0xd3037(%rip), %rdx     # 0x5cd041
leaq 0xcd72c(%rip), %rcx     # 0x5c773d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq