// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sw_diag_avx2_256_32.c
// Function: parasail_sw_rowcol_diag_avx2_256_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)
{
    /* 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;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    __m256i vNegInf;
    __m256i vNegInf0;
    __m256i vOpen;
    __m256i vGap;
    __m256i vZero;
    __m256i vOne;
    __m256i vN;
    __m256i vNegOne;
    __m256i vI;
    __m256i vJreset;
    __m256i vMaxH;
    __m256i vEndI;
    __m256i vEndJ;
    __m256i vILimit;
    __m256i vJLimit;

    /* validate inputs */
    PARASAIL_CHECK_NULL(_s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);
    PARASAIL_CHECK_NULL(matrix);
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        PARASAIL_CHECK_NULL(_s1);
        PARASAIL_CHECK_GT0(_s1Len);
    }

    /* initialize stack variables */
    N = 8; /* number of values in vector */
    PAD = N-1;
    PAD2 = PAD*2;
    s1Len = matrix->type == PARASAIL_MATRIX_TYPE_SQUARE ? _s1Len : matrix->length;
    s1Len_PAD = s1Len+PAD;
    s2Len_PAD = s2Len+PAD;
    i = 0;
    j = 0;
    end_query = 0;
    end_ref = 0;
    NEG_LIMIT = (-open < matrix->min ? INT32_MIN + open : INT32_MIN - matrix->min) + 1;
    POS_LIMIT = INT32_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm256_set1_epi32(NEG_LIMIT);
    vNegInf0 = _mm256_srli_si256_rpl(vNegInf, 4); /* shift in a 0 */
    vOpen = _mm256_set1_epi32(open);
    vGap  = _mm256_set1_epi32(gap);
    vZero = _mm256_set1_epi32(0);
    vOne = _mm256_set1_epi32(1);
    vN = _mm256_set1_epi32(N);
    vNegOne = _mm256_set1_epi32(-1);
    vI = _mm256_set_epi32(0,1,2,3,4,5,6,7);
    vJreset = _mm256_set_epi32(0,-1,-2,-3,-4,-5,-6,-7);
    vMaxH = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm256_set1_epi32(s1Len);
    vJLimit = _mm256_set1_epi32(s2Len);

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

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_DIAG
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_8;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    s2B= parasail_memalign_int32_t(32, s2Len+PAD2);
    _H_pr = parasail_memalign_int32_t(32, s2Len+PAD2);
    _F_pr = parasail_memalign_int32_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_int32_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 */
    for (j=0; j<s2Len; ++j) {
        H_pr[j] = 0;
        F_pr[j] = NEG_LIMIT;
    }
    /* pad front of stored row values */
    for (j=-PAD; j<0; ++j) {
        H_pr[j] = NEG_LIMIT;
        F_pr[j] = NEG_LIMIT;
    }
    /* pad back of stored row values */
    for (j=s2Len; j<s2Len+PAD; ++j) {
        H_pr[j] = NEG_LIMIT;
        F_pr[j] = NEG_LIMIT;
    }

    /* iterate over query sequence */
    for (i=0; i<s1Len; i+=N) {
        __m256i vNH = vNegInf0;
        __m256i vWH = vNegInf0;
        __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))];
        const int * const restrict matrow4 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+4] : ((i+4 >= s1Len) ? s1Len-1 : i+4))];
        const int * const restrict matrow5 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+5] : ((i+5 >= s1Len) ? s1Len-1 : i+5))];
        const int * const restrict matrow6 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+6] : ((i+6 >= s1Len) ? s1Len-1 : i+6))];
        const int * const restrict matrow7 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+7] : ((i+7 >= s1Len) ? s1Len-1 : i+7))];
        __m256i vIltLimit = _mm256_cmplt_epi32_rpl(vI, vILimit);
        /* iterate over database sequence */
        for (j=0; j<s2Len+PAD; ++j) {
            __m256i vMat;
            __m256i vNWH = vNH;
            vNH = _mm256_srli_si256_rpl(vWH, 4);
            vNH = _mm256_insert_epi32_rpl(vNH, H_pr[j], 7);
            vF = _mm256_srli_si256_rpl(vF, 4);
            vF = _mm256_insert_epi32_rpl(vF, F_pr[j], 7);
            vF = _mm256_max_epi32(
                    _mm256_sub_epi32(vNH, vOpen),
                    _mm256_sub_epi32(vF, vGap));
            vE = _mm256_max_epi32(
                    _mm256_sub_epi32(vWH, vOpen),
                    _mm256_sub_epi32(vE, vGap));
            vMat = _mm256_set_epi32(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]],
                    matrow2[s2[j-2]],
                    matrow3[s2[j-3]],
                    matrow4[s2[j-4]],
                    matrow5[s2[j-5]],
                    matrow6[s2[j-6]],
                    matrow7[s2[j-7]]
                    );
            vNWH = _mm256_add_epi32(vNWH, vMat);
            vWH = _mm256_max_epi32(vNWH, vE);
            vWH = _mm256_max_epi32(vWH, vF);
            vWH = _mm256_max_epi32(vWH, vZero);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m256i cond = _mm256_cmpeq_epi32(vJ,vNegOne);
                vWH = _mm256_andnot_si256(cond, vWH);
                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_epi32(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm256_max_epi32(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-7] = (int32_t)_mm256_extract_epi32_rpl(vWH,0);
            F_pr[j-7] = (int32_t)_mm256_extract_epi32_rpl(vF,0);
            /* as minor diagonal vector passes across table, extract
             * max values within the i,j bounds */
            {
                __m256i cond_valid_J = _mm256_and_si256(
                        _mm256_cmpgt_epi32(vJ, vNegOne),
                        _mm256_cmplt_epi32_rpl(vJ, vJLimit));
                __m256i cond_valid_IJ = _mm256_and_si256(cond_valid_J, vIltLimit);
                __m256i cond_eq = _mm256_cmpeq_epi32(vWH, vMaxH);
                __m256i cond_max = _mm256_cmpgt_epi32(vWH, vMaxH);
                __m256i cond_all = _mm256_and_si256(cond_max, cond_valid_IJ);
                __m256i cond_Jlt = _mm256_cmplt_epi32_rpl(vJ, vEndJ);
                vMaxH = _mm256_blendv_epi8(vMaxH, vWH, cond_all);
                vEndI = _mm256_blendv_epi8(vEndI, vI, cond_all);
                vEndJ = _mm256_blendv_epi8(vEndJ, vJ, cond_all);
                cond_all = _mm256_and_si256(cond_Jlt, cond_eq);
                cond_all = _mm256_and_si256(cond_all, cond_valid_IJ);
                vEndI = _mm256_blendv_epi8(vEndI, vI, cond_all);
                vEndJ = _mm256_blendv_epi8(vEndJ, vJ, cond_all);
            }
            vJ = _mm256_add_epi32(vJ, vOne);
        }
        vI = _mm256_add_epi32(vI, vN);
    }

    /* alignment ending position */
    {
        int32_t *t = (int32_t*)&vMaxH;
        int32_t *i = (int32_t*)&vEndI;
        int32_t *j = (int32_t*)&vEndJ;
        int32_t k;
        for (k=0; k<N; ++k, ++t, ++i, ++j) {
            if (*t > score) {
                score = *t;
                end_query = *i;
                end_ref = *j;
            }
            else if (*t == score) {
                if (*j < end_ref) {
                    end_query = *i;
                    end_ref = *j;
                }
                else if (*j == end_ref && *i < end_query) {
                    end_query = *i;
                    end_ref = *j;
                }
            }
        }
    }

    if (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi32_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x2a0, %rsp            # imm = 0x2A0
testq %rdx, %rdx
je 0x4fd4d1
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x4fd4f5
testl %r8d, %r8d
js 0x4fd519
movl %r9d, %r12d
testl %r9d, %r9d
js 0x4fd557
movl %esi, %ebx
movq 0x10(%rbp), %rsi
testq %rsi, %rsi
je 0x4fd578
movq %rdx, %r15
cmpl $0x0, 0x30(%rsi)
je 0x4fc9ce
movl 0x34(%rsi), %ebx
jmp 0x4fc9df
testq %rdi, %rdi
je 0x4fd599
testl %ebx, %ebx
jle 0x4fd5ba
movq %rdi, 0x18(%rsp)
movl %r8d, %eax
negl %eax
movl 0x20(%rsi), %ecx
movl $0x80000000, %edi       # imm = 0x80000000
movl %r8d, 0x30(%rsp)
movl %r8d, %edx
orl %edi, %edx
subl %ecx, %edi
cmpl %eax, %ecx
cmovgl %edx, %edi
incl %edi
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rsi), %eax
movl %eax, 0x40(%rsp)
movl %edi, 0x24(%rsp)
vmovd %edi, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x1a0(%rsp)
vmovdqa %ymm0, 0x160(%rsp)
vmovdqa %ymm0, 0x100(%rsp)
movl %ebx, %edi
movl %r14d, %esi
vzeroupper
callq 0x1ab93b
testq %rax, %rax
je 0x4fcab5
movq %rax, %r13
movl %r12d, 0x90(%rsp)
movq %r15, 0xa0(%rsp)
orl $0x8441004, 0xc(%rax)   # imm = 0x8441004
movq %r14, 0x48(%rsp)
leal 0xe(%r14), %r12d
pushq $0x20
popq %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ab783
movq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ab783
movq %rax, %r15
pushq $0x20
popq %rdi
movq %r12, %rsi
callq 0x1ab783
testq %r14, %r14
sete %dl
testq %r15, %r15
sete %cl
orb %dl, %cl
movq %rax, 0x28(%rsp)
testq %rax, %rax
sete %al
orb %cl, %al
je 0x4fcabc
xorl %ebx, %ebx
jmp 0x4fd5e2
movq %r15, %r11
movq %r13, 0x98(%rsp)
movq 0x10(%rbp), %r12
cmpl $0x0, 0x30(%r12)
movslq %ebx, %r13
movq %r15, 0x88(%rsp)
je 0x4fd461
movq $0x0, 0x38(%rsp)
movl 0x24(%rsp), %r8d
vmovdqa 0x160(%rsp), %ymm10
movq 0xa0(%rsp), %r9
movq 0x48(%rsp), %rax
leal 0x7(%rax), %ecx
vmovd 0x40(%rsp), %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x1c0(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x80, %ymm0, %ymm10, %ymm0 # ymm0 = ymm10[0,1,2,3,4,5,6],ymm0[7]
vmovdqa %ymm0, 0x200(%rsp)
vmovss 0x30(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x240(%rsp)
vmovd 0x90(%rsp), %xmm0
vpbroadcastd %xmm0, %ymm3
vmovd %ebx, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x1e0(%rsp)
vmovd %eax, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x220(%rsp)
movl %eax, %eax
movq 0x10(%r12), %rdx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x4fcb96
movzbl (%r9,%rsi), %edi
movl (%rdx,%rdi,4), %edi
movl %edi, 0x1c(%r14,%rsi,4)
incq %rsi
jmp 0x4fcb7f
xorl %edx, %edx
cmpq $0x7, %rdx
je 0x4fcba8
andl $0x0, (%r14,%rdx,4)
incq %rdx
jmp 0x4fcb98
movq %rax, %rdx
cmpl %edx, %ecx
jle 0x4fcbba
andl $0x0, 0x1c(%r14,%rdx,4)
incq %rdx
jmp 0x4fcbab
xorl %edx, %edx
movq 0x28(%rsp), %rsi
cmpq %rdx, %rax
je 0x4fcbd6
andl $0x0, 0x1c(%r11,%rdx,4)
movl %r8d, 0x1c(%rsi,%rdx,4)
incq %rdx
jmp 0x4fcbc1
xorl %edx, %edx
movq 0x28(%rsp), %rsi
cmpq $0x7, %rdx
je 0x4fcbf0
movl %r8d, (%r11,%rdx,4)
movl %r8d, (%rsi,%rdx,4)
incq %rdx
jmp 0x4fcbdd
movq %rax, %rdx
movq 0x28(%rsp), %rsi
cmpl %edx, %ecx
jle 0x4fcc0b
movl %r8d, 0x1c(%r11,%rdx,4)
movl %r8d, 0x1c(%rsi,%rdx,4)
incq %rdx
jmp 0x4fcbf8
decl %ebx
movq 0x48(%rsp), %rdx
decl %edx
movq %rdx, 0x48(%rsp)
movl %ecx, %edx
sarl $0x1f, %edx
andnl %ecx, %edx, %ecx
movq %rcx, 0x90(%rsp)
vmovdqa 0x1a0(%rsp), %ymm9
vmovdqa 0x100(%rsp), %ymm8
leaq 0x6(%rax), %rcx
movq %rcx, 0xf0(%rsp)
leaq 0x5(%rax), %rcx
movq %rcx, 0xe8(%rsp)
leaq 0x4(%rax), %rcx
movq %rcx, 0xe0(%rsp)
leaq 0x3(%rax), %rcx
movq %rcx, 0xd8(%rsp)
leaq 0x2(%rax), %rcx
movq %rcx, 0xd0(%rsp)
leaq 0x1(%rax), %rcx
movq %rcx, 0xc8(%rsp)
vmovaps 0xcec13(%rip), %ymm0    # 0x5cb8a0
vmovaps %ymm0, 0xa0(%rsp)
xorl %edx, %edx
vpcmpeqd %ymm2, %ymm2, %ymm2
vmovdqa %ymm10, %ymm15
vmovdqa %ymm10, 0x140(%rsp)
vmovdqa 0x1c0(%rsp), %ymm0
vmovdqa %ymm0, 0x120(%rsp)
cmpq %r13, %rdx
jge 0x4fd36a
movq %rdx, %rdi
orq $0x3, %rdi
cmpl $0x0, 0x30(%r12)
movq %rdx, 0x18(%rsp)
movq %rdi, 0x40(%rsp)
je 0x4fcd72
movq %rdx, %rcx
orq $0x1, %rcx
cmpq %r13, %rcx
movq %rcx, 0x30(%rsp)
cmovgel %ebx, %ecx
movl %ecx, 0x78(%rsp)
movq %rdx, %rsi
orq $0x2, %rsi
cmpq %r13, %rsi
movl %esi, %ecx
cmovgel %ebx, %ecx
movl %ecx, 0x68(%rsp)
cmpq %r13, %rdi
movl %edi, %ecx
cmovgel %ebx, %ecx
movl %ecx, 0x80(%rsp)
movq %rdx, %rdi
orq $0x4, %rdi
cmpq %r13, %rdi
movl %edi, %ecx
cmovgel %ebx, %ecx
movl %ecx, 0x60(%rsp)
movq %rdx, %r8
orq $0x5, %r8
cmpq %r13, %r8
movl %r8d, %ecx
cmovgel %ebx, %ecx
movq %rdx, %r9
orq $0x6, %r9
cmpq %r13, %r9
movl %r9d, %r10d
cmovgel %ebx, %r10d
movl %r10d, 0x58(%rsp)
movq %rdx, %r10
orq $0x7, %r10
cmpq %r13, %r10
movl %r10d, %r15d
cmovgel %ebx, %r15d
movl %r15d, 0x50(%rsp)
movl %edx, 0x70(%rsp)
jmp 0x4fce1a
movq 0x38(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl (%rdx,%rcx,4), %ecx
movl %ecx, 0x70(%rsp)
movq 0x18(%rsp), %rcx
movl 0x4(%rdx,%rcx,4), %ecx
movl %ecx, 0x78(%rsp)
movq 0x18(%rsp), %rcx
orq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movq 0x18(%rsp), %rsi
orq $0x2, %rsi
movq 0x18(%rsp), %rcx
movl 0x8(%rdx,%rcx,4), %ecx
movl %ecx, 0x68(%rsp)
movl (%rdx,%rdi,4), %ecx
movl %ecx, 0x80(%rsp)
movq 0x18(%rsp), %rdi
orq $0x4, %rdi
movq 0x18(%rsp), %rcx
movl 0x10(%rdx,%rcx,4), %ecx
movl %ecx, 0x60(%rsp)
movq 0x18(%rsp), %r8
orq $0x5, %r8
movq 0x18(%rsp), %rcx
movl 0x14(%rdx,%rcx,4), %ecx
movq 0x18(%rsp), %r9
orq $0x6, %r9
movq 0x18(%rsp), %r10
movl 0x18(%rdx,%r10,4), %r10d
movl %r10d, 0x58(%rsp)
movq 0x18(%rsp), %r10
orq $0x7, %r10
movq 0x18(%rsp), %r15
movl 0x1c(%rdx,%r15,4), %edx
movl %edx, 0x50(%rsp)
movq 0x18(%rsp), %rdx
movq 0x8(%r12), %r15
movl 0x18(%r12), %r12d
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0xf8(%rsp)
movl 0x80(%rsp), %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0x80(%rsp)
movl 0x78(%rsp), %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0x78(%rsp)
movl 0x70(%rsp), %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0x70(%rsp)
movl 0x68(%rsp), %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0x68(%rsp)
movl 0x60(%rsp), %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0x60(%rsp)
movl 0x58(%rsp), %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0x58(%rsp)
movl 0x50(%rsp), %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
leaq (%r15,%rcx,4), %rcx
movq %rcx, 0x50(%rsp)
vmovdqa 0x1e0(%rsp), %ymm0
vpcmpgtd 0xa0(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x260(%rsp)
xorl %r15d, %r15d
vmovdqa 0x200(%rsp), %ymm1
vmovdqa %ymm1, %ymm6
vmovdqa %ymm10, %ymm5
vmovdqa %ymm10, %ymm7
vpmovsxbd 0xccdf9(%rip), %ymm11 # 0x5c9cfe
cmpq %r15, 0x90(%rsp)
je 0x4fd339
movslq 0x10(%r14,%r15,4), %rcx
movq 0x80(%rsp), %r12
vmovd (%r12,%rcx,4), %xmm4
movslq 0x14(%r14,%r15,4), %rcx
movq 0x68(%rsp), %r12
vpinsrd $0x1, (%r12,%rcx,4), %xmm4, %xmm4
movslq 0x18(%r14,%r15,4), %rcx
movq 0x78(%rsp), %r12
vpinsrd $0x2, (%r12,%rcx,4), %xmm4, %xmm4
movslq 0x1c(%r14,%r15,4), %rcx
movq 0x70(%rsp), %r12
vpinsrd $0x3, (%r12,%rcx,4), %xmm4, %xmm12
movslq (%r14,%r15,4), %rcx
movq 0x50(%rsp), %r12
vmovd (%r12,%rcx,4), %xmm4
movslq 0x4(%r14,%r15,4), %rcx
movq 0x58(%rsp), %r12
vpinsrd $0x1, (%r12,%rcx,4), %xmm4, %xmm4
movslq 0x8(%r14,%r15,4), %rcx
movq 0xf8(%rsp), %r12
vpinsrd $0x2, (%r12,%rcx,4), %xmm4, %xmm4
movslq 0xc(%r14,%r15,4), %rcx
movq 0x60(%rsp), %r12
vpinsrd $0x3, (%r12,%rcx,4), %xmm4, %xmm14
vpmovsxbd 0xceb99(%rip), %ymm0 # 0x5cbb40
vpermd %ymm1, %ymm0, %ymm4
vpbroadcastd 0x1c(%r11,%r15,4), %ymm13
vpblendd $0x80, %ymm13, %ymm4, %ymm4 # ymm4 = ymm4[0,1,2,3,4,5,6],ymm13[7]
vpermd %ymm7, %ymm0, %ymm7
movq 0x28(%rsp), %rcx
vpbroadcastd 0x1c(%rcx,%r15,4), %ymm13
vpblendd $0x80, %ymm13, %ymm7, %ymm7 # ymm7 = ymm7[0,1,2,3,4,5,6],ymm13[7]
vmovdqa 0x240(%rsp), %ymm0
vpsubd %ymm0, %ymm4, %ymm13
vpsubd %ymm3, %ymm7, %ymm7
vpmaxsd %ymm7, %ymm13, %ymm7
vpsubd %ymm0, %ymm1, %ymm1
vpsubd %ymm3, %ymm5, %ymm5
vpmaxsd %ymm5, %ymm1, %ymm13
cmpq %rbx, %rdx
setne %r11b
vinserti128 $0x1, %xmm12, %ymm14, %ymm1
vpaddd %ymm6, %ymm1, %ymm1
vpmaxsd %ymm7, %ymm13, %ymm5
vpmaxsd 0xce82e(%rip), %ymm5, %ymm5 # 0x5cb840
vpmaxsd %ymm5, %ymm1, %ymm6
vpcmpeqd %ymm2, %ymm11, %ymm5
vpandn %ymm6, %ymm5, %ymm1
cmpq $0x8, %r15
jb 0x4fd053
vmovdqa 0x120(%rsp), %ymm0
vpminsd %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x120(%rsp)
vmovdqa 0x140(%rsp), %ymm0
vpmaxsd %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x140(%rsp)
movq 0x98(%rsp), %rcx
movq 0x10(%rcx), %r12
movq (%r12), %rcx
movq 0x8(%r12), %r12
cmpq %rax, %r15
setae %dl
orb %dl, %r11b
vextracti128 $0x1, %ymm1, %xmm12
jne 0x4fd080
vpextrd $0x3, %xmm12, (%rcx,%r15,4)
cmpq %r15, 0x48(%rsp)
jne 0x4fd093
movq 0x18(%rsp), %rdx
vpextrd $0x3, %xmm12, (%r12,%rdx,4)
cmpq %rbx, 0x30(%rsp)
setne %dl
leaq -0x1(%r15), %r11
cmpq %rax, %r11
setae %r11b
orb %dl, %r11b
jne 0x4fd0b3
vpextrd $0x2, %xmm12, -0x4(%rcx,%r15,4)
cmpq %r13, 0x30(%rsp)
setge %dl
cmpq %r15, %rax
setne %r11b
orb %dl, %r11b
jne 0x4fd0d3
movq 0x30(%rsp), %rdx
vpextrd $0x2, %xmm12, (%r12,%rdx,4)
cmpq %rbx, %rsi
jne 0x4fd0fa
leaq -0x2(%r15), %rdx
cmpq $0x2, %r15
setae %r11b
cmpq %rax, %rdx
setl %dl
andb %r11b, %dl
cmpb $0x1, %dl
jne 0x4fd0fa
vpextrd $0x1, %xmm12, -0x8(%rcx,%r15,4)
cmpq %r13, %rsi
setge %dl
cmpq %r15, 0xc8(%rsp)
setne %r11b
orb %dl, %r11b
jne 0x4fd118
vpextrd $0x1, %xmm12, (%r12,%rsi,4)
movq 0x40(%rsp), %rdx
cmpq %rbx, %rdx
jne 0x4fd148
leaq -0x3(%r15), %rdx
cmpq $0x3, %r15
setae %r11b
cmpq %rax, %rdx
setl %dl
andb %r11b, %dl
cmpb $0x1, %dl
movq 0x40(%rsp), %rdx
jne 0x4fd148
vmovd %xmm12, -0xc(%rcx,%r15,4)
cmpq %r13, %rdx
setge %dl
cmpq %r15, 0xd0(%rsp)
setne %r11b
orb %dl, %r11b
jne 0x4fd16a
movq 0x40(%rsp), %rdx
vmovd %xmm12, (%r12,%rdx,4)
cmpq %rbx, %rdi
jne 0x4fd191
leaq -0x4(%r15), %rdx
cmpq $0x4, %r15
setae %r11b
cmpq %rax, %rdx
setl %dl
andb %r11b, %dl
cmpb $0x1, %dl
jne 0x4fd191
vpextrd $0x3, %xmm1, -0x10(%rcx,%r15,4)
cmpq %r13, %rdi
setge %dl
cmpq %r15, 0xd8(%rsp)
setne %r11b
orb %dl, %r11b
jne 0x4fd1af
vpextrd $0x3, %xmm1, (%r12,%rdi,4)
cmpq %rbx, %r8
jne 0x4fd1d6
leaq -0x5(%r15), %rdx
cmpq $0x5, %r15
setae %r11b
cmpq %rax, %rdx
setl %dl
andb %r11b, %dl
cmpb $0x1, %dl
jne 0x4fd1d6
vpextrd $0x2, %xmm1, -0x14(%rcx,%r15,4)
cmpq %r13, %r8
setge %dl
cmpq %r15, 0xe0(%rsp)
setne %r11b
orb %dl, %r11b
jne 0x4fd1f4
vpextrd $0x2, %xmm1, (%r12,%r8,4)
cmpq %rbx, %r9
jne 0x4fd21b
leaq -0x6(%r15), %rdx
cmpq $0x6, %r15
setae %r11b
cmpq %rax, %rdx
setl %dl
andb %r11b, %dl
cmpb $0x1, %dl
jne 0x4fd21b
vpextrd $0x1, %xmm1, -0x18(%rcx,%r15,4)
cmpq %r13, %r9
setge %dl
cmpq %r15, 0xe8(%rsp)
setne %r11b
orb %dl, %r11b
jne 0x4fd239
vpextrd $0x1, %xmm1, (%r12,%r9,4)
cmpq %rbx, %r10
setne %dl
cmpq $0x7, %r15
setb %r11b
orb %dl, %r11b
jne 0x4fd253
vmovd %xmm1, -0x1c(%rcx,%r15,4)
vblendvps %ymm5, %ymm10, %ymm7, %ymm7
cmpq %r13, %r10
setge %dl
cmpq %r15, 0xf0(%rsp)
setne %r11b
vmovd %xmm1, %ecx
orb %dl, %r11b
jne 0x4fd278
movl %ecx, (%r12,%r10,4)
vmovdqa 0x220(%rsp), %ymm0
vpcmpgtd %ymm11, %ymm0, %ymm12
vpand 0x260(%rsp), %ymm12, %ymm12
vpsrad $0x1f, %ymm11, %ymm14
vpandn %ymm12, %ymm14, %ymm12
vextracti128 $0x1, %ymm12, %xmm14
vpackssdw %xmm14, %xmm12, %xmm14
vpcmpeqd %ymm1, %ymm9, %ymm10
vpcmpgtd %ymm9, %ymm1, %ymm0
vpand %ymm0, %ymm12, %ymm2
vblendvps %ymm2, %ymm6, %ymm9, %ymm9
vextracti128 $0x1, %ymm2, %xmm6
vpackssdw %xmm6, %xmm2, %xmm2
vpcmpgtd %ymm11, %ymm8, %ymm6
vpand %ymm6, %ymm10, %ymm6
vextracti128 $0x1, %ymm6, %xmm10
vpackssdw %xmm10, %xmm6, %xmm10
vpblendvb %xmm10, %xmm14, %xmm2, %xmm2
vmovaps 0x160(%rsp), %ymm10
vblendvps %ymm5, %ymm10, %ymm13, %ymm5
vpmovsxwd %xmm2, %ymm2
vblendvps %ymm2, 0xa0(%rsp), %ymm15, %ymm15
vpor %ymm0, %ymm6, %ymm0
vpand %ymm0, %ymm12, %ymm0
vblendvps %ymm0, %ymm11, %ymm8, %ymm8
movq 0x88(%rsp), %r11
movl %ecx, (%r11,%r15,4)
movq 0x28(%rsp), %rcx
vmovss %xmm7, (%rcx,%r15,4)
vpcmpeqd %ymm2, %ymm2, %ymm2
vpsubd %ymm2, %ymm11, %ymm11
incq %r15
vmovdqa %ymm4, %ymm6
movq 0x18(%rsp), %rdx
jmp 0x4fcf05
vpbroadcastd 0xce79e(%rip), %ymm0 # 0x5cbae0
vmovdqa 0xa0(%rsp), %ymm1
vpaddd %ymm0, %ymm1, %ymm1
vmovdqa %ymm1, 0xa0(%rsp)
addq $0x8, %rdx
movq 0x10(%rbp), %r12
movl 0x24(%rsp), %r8d
jmp 0x4fccbc
vmovdqa %ymm9, 0x1a0(%rsp)
vmovdqa %ymm8, 0x100(%rsp)
vmovdqa %ymm15, 0x180(%rsp)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
movq 0x98(%rsp), %rbx
cmpl $0x8, %ecx
je 0x4fd3ea
movl 0x1a0(%rsp,%rcx,4), %esi
cmpl %r8d, %esi
jle 0x4fd3b4
movl 0x180(%rsp,%rcx,4), %eax
movl 0x100(%rsp,%rcx,4), %edi
jmp 0x4fd3e0
jne 0x4fd3db
movl 0x100(%rsp,%rcx,4), %edi
cmpl %edx, %edi
jge 0x4fd3cd
movl 0x180(%rsp,%rcx,4), %eax
movl %r8d, %esi
jmp 0x4fd3e0
jne 0x4fd3db
movl 0x180(%rsp,%rcx,4), %esi
cmpl %eax, %esi
cmovll %esi, %eax
movl %r8d, %esi
movl %edx, %edi
incq %rcx
movl %esi, %r8d
movl %edi, %edx
jmp 0x4fd393
vpcmpgtd 0x120(%rsp), %ymm10, %ymm0
vmovdqa 0x140(%rsp), %ymm1
vpcmpgtd 0x1c0(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestps %ymm0, %ymm0
je 0x4fd41b
orb $0x40, 0xc(%rbx)
xorl %r8d, %r8d
xorl %edx, %edx
xorl %eax, %eax
movl %r8d, (%rbx)
movl %eax, 0x4(%rbx)
movl %edx, 0x8(%rbx)
movq 0x28(%rsp), %rdi
vzeroupper
callq 0x1ab763
movq 0x88(%rsp), %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%r12)
jne 0x4fd5e2
movq 0x38(%rsp), %rdi
callq 0x1ab763
jmp 0x4fd5e2
leal 0x7(%rbx), %eax
movslq %eax, %r15
pushq $0x20
popq %rdi
movq %r15, %rsi
callq 0x1ab783
movq %rax, 0x38(%rsp)
testq %rax, %rax
movq 0xa0(%rsp), %r9
je 0x4fcab5
movl %ebx, %eax
sarl $0x1f, %eax
andnl %ebx, %eax, %eax
xorl %ecx, %ecx
movl 0x24(%rsp), %r8d
vmovdqa 0x160(%rsp), %ymm10
movq 0x88(%rsp), %r11
movq 0x18(%rsp), %rdi
cmpq %rcx, %rax
je 0x4fd53d
movq 0x10(%r12), %rdx
movzbl (%rdi,%rcx), %esi
movl (%rdx,%rsi,4), %edx
movq 0x38(%rsp), %rsi
movl %edx, (%rsi,%rcx,4)
incq %rcx
jmp 0x4fd4af
movq 0x23db00(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xc9b09(%rip), %rsi     # 0x5c6feb
leaq 0x8a127(%rip), %rdx     # 0x587610
leaq 0xca20d(%rip), %rcx     # 0x5c76fd
jmp 0x4fd5d9
movq 0x23dadc(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xca1fb(%rip), %rsi     # 0x5c7701
leaq 0x8a103(%rip), %rdx     # 0x587610
leaq 0xca201(%rip), %rcx     # 0x5c7715
jmp 0x4fd5d9
movq 0x23dab8(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xca1f1(%rip), %rsi     # 0x5c771b
leaq 0x8a0df(%rip), %rdx     # 0x587610
leaq 0xca1f8(%rip), %rcx     # 0x5c7730
jmp 0x4fd5d9
movq %r13, %rax
movq 0x38(%rsp), %rcx
cmpq %r15, %rax
jge 0x4fcb01
andl $0x0, (%rcx,%rax,4)
incq %rax
jmp 0x4fd545
movq 0x23da7a(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xca1b3(%rip), %rsi     # 0x5c771b
leaq 0x8a0a1(%rip), %rdx     # 0x587610
leaq 0xca1bf(%rip), %rcx     # 0x5c7735
jmp 0x4fd5d9
movq 0x23da59(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xc9a62(%rip), %rsi     # 0x5c6feb
leaq 0x8a080(%rip), %rdx     # 0x587610
leaq 0xca3ab(%rip), %rcx     # 0x5c7942
jmp 0x4fd5d9
movq 0x23da38(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xc9a41(%rip), %rsi     # 0x5c6feb
leaq 0x8a05f(%rip), %rdx     # 0x587610
leaq 0xca181(%rip), %rcx     # 0x5c7739
jmp 0x4fd5d9
movq 0x23da17(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xca136(%rip), %rsi     # 0x5c7701
leaq 0x8a03e(%rip), %rdx     # 0x587610
leaq 0xca164(%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