// File: /workspace/github_c_makefile_star2_O1/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 $0x2c0, %rsp            # imm = 0x2C0
testq %rdx, %rdx
je 0x52c186
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x52c18d
movl %r8d, %r13d
testl %r8d, %r8d
js 0x52c194
movl %r9d, %r12d
testl %r9d, %r9d
js 0x52c19b
movq 0x10(%rbp), %r8
testq %r8, %r8
je 0x52c1a2
movl 0x30(%r8), %eax
testl %eax, %eax
jne 0x52b636
testq %rdi, %rdi
je 0x52c1a9
testl %esi, %esi
jle 0x52c1b0
testl %eax, %eax
je 0x52b63a
movl 0x34(%r8), %esi
movq %rdi, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movl %r13d, %eax
negl %eax
movl 0x20(%r8), %ecx
movl $0x80000000, %edi       # imm = 0x80000000
movl %r13d, %edx
orl %edi, %edx
subl %ecx, %edi
cmpl %eax, %ecx
cmovgl %edx, %edi
incl %edi
movl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
subl 0x1c(%r8), %ebx
movl %edi, 0x34(%rsp)
vmovd %edi, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x1c0(%rsp)
vmovdqa %ymm0, 0x120(%rsp)
vmovdqa %ymm0, 0x80(%rsp)
vmovdqa %ymm0, 0x180(%rsp)
movq %rsi, (%rsp)
movl %esi, %edi
movl %r14d, %esi
vzeroupper
callq 0x209630
testq %rax, %rax
je 0x52c1b5
movq %rax, %r15
movl %r13d, 0x18(%rsp)
movl %r12d, 0x100(%rsp)
orl $0x8441004, 0xc(%rax)   # imm = 0x8441004
movq %r14, 0x8(%rsp)
leal 0xe(%r14), %r12d
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094d5
movq %rax, %r14
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094d5
movq %rax, %r13
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094d5
testq %r14, %r14
sete %dl
testq %r13, %r13
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x52c1b5
movq %r15, 0x68(%rsp)
movq 0x10(%rbp), %rcx
cmpl $0x0, 0x30(%rcx)
movq %r13, 0x70(%rsp)
movq %rax, 0x60(%rsp)
je 0x52b747
xorl %r12d, %r12d
movq 0x8(%rsp), %r13
movq (%rsp), %rax
jmp 0x52b7cd
movq (%rsp), %r15
leal 0x7(%r15), %eax
movl %eax, 0x10(%rsp)
movslq %eax, %rsi
movl $0x20, %edi
callq 0x2094d5
testq %rax, %rax
movq 0x8(%rsp), %r13
je 0x52c1b5
movq %rax, %r12
testl %r15d, %r15d
movq 0x20(%rsp), %rdi
jle 0x52b79b
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %r15d, %ecx
xorl %edx, %edx
movzbl (%rdi,%rdx), %esi
movl (%rax,%rsi,4), %esi
movl %esi, (%r12,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x52b788
movslq %r15d, %rax
leal 0x1(%r15), %ecx
movl 0x10(%rsp), %edx
cmpl %ecx, %edx
cmovgl %edx, %ecx
leaq (%r12,%rax,4), %rdi
movl %r15d, %eax
notl %eax
addl %ecx, %eax
leaq 0x4(,%rax,4), %rdx
xorl %esi, %esi
callq 0x19e090
movq (%rsp), %rax
movq 0x10(%rbp), %rcx
movq %r12, 0x78(%rsp)
leal 0x7(%r13), %r15d
vmovd %ebx, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x1a0(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x7f, 0x80(%rsp), %ymm0, %ymm0 # ymm0 = mem[0,1,2,3,4,5,6],ymm0[7]
vmovdqa %ymm0, 0x220(%rsp)
vmovss 0x18(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x280(%rsp)
vmovss 0x100(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x260(%rsp)
vmovd %eax, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x200(%rsp)
vmovd %r13d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x240(%rsp)
movq 0x10(%rcx), %rax
cmpl $0x2, %r13d
movl $0x1, %r12d
cmovgel %r13d, %r12d
xorl %ecx, %ecx
movq 0x28(%rsp), %rsi
movzbl (%rsi,%rcx), %edx
movl (%rax,%rdx,4), %edx
movl %edx, 0x1c(%r14,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x52b869
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, 0xc(%r14)
vmovdqu %xmm0, (%r14)
movl %r13d, %ebx
leal 0x1(%r13), %eax
cmpl %eax, %r15d
cmovgl %r15d, %eax
leaq (%r14,%rbx,4), %rdi
addq $0x1c, %rdi
movl %r13d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %r13d, %r13d
xorl %esi, %esi
vzeroupper
callq 0x19e090
movl 0x34(%rsp), %r8d
movq 0x70(%rsp), %rdx
movq 0x60(%rsp), %rcx
movl $0x0, 0x1c(%rdx,%r13,4)
movl %r8d, 0x1c(%rcx,%r13,4)
incq %r13
cmpq %r13, %r12
jne 0x52b8cd
xorl %eax, %eax
movq %rcx, %rsi
movl %r8d, (%rdx,%rax,4)
movl %r8d, (%rsi,%rax,4)
incq %rax
cmpq $0x7, %rax
jne 0x52b8e8
leaq 0x7(%rbx), %rax
movq 0x8(%rsp), %rcx
movq 0x10(%rbp), %r12
movq 0x78(%rsp), %r13
movq (%rsp), %rdi
movl %r8d, (%rdx,%rax,4)
movl %r8d, (%rsi,%rax,4)
incq %rax
incl %ecx
cmpl %ecx, %r15d
jg 0x52b90f
vmovaps 0x120(%rsp), %ymm2
testl %edi, %edi
jle 0x52c08a
movq 0x8(%r12), %rax
movq %rax, 0xb8(%rsp)
leal -0x1(%rdi), %ecx
movq 0x8(%rsp), %rax
decl %eax
movq %rax, 0x8(%rsp)
cmpl $0x2, %r15d
movl $0x1, %eax
cmovgel %r15d, %eax
movq %rax, 0xf0(%rsp)
movl %edi, %esi
leaq 0x1(%rbx), %rax
movq %rax, 0xe8(%rsp)
leaq 0x2(%rbx), %rax
movq %rax, 0xe0(%rsp)
leaq 0x3(%rbx), %rax
movq %rax, 0xd8(%rsp)
leaq 0x4(%rbx), %rax
movq %rax, 0xd0(%rsp)
leaq 0x5(%rbx), %rax
movq %rax, 0xc8(%rsp)
leaq 0x6(%rbx), %rax
movq %rax, 0xc0(%rsp)
vmovaps 0xcddeb(%rip), %ymm0    # 0x5f97a0
vmovaps %ymm0, 0x100(%rsp)
xorl %r11d, %r11d
vpcmpeqd %ymm3, %ymm3, %ymm3
vbroadcastss 0xce032(%rip), %ymm0 # 0x5f9a00
vmovaps %ymm0, 0x1e0(%rsp)
vmovaps 0x1a0(%rsp), %ymm0
vmovaps %ymm0, 0x140(%rsp)
vmovdqa 0x80(%rsp), %ymm0
vmovdqa %ymm0, 0x160(%rsp)
movl 0x30(%r12), %r15d
movl %r11d, %eax
testl %r15d, %r15d
jne 0x52ba0d
movl (%r13,%r11,4), %eax
movl %eax, 0x18(%rsp)
movq %r11, %rax
orq $0x1, %rax
testl %r15d, %r15d
je 0x52ba27
cmpq %rsi, %rax
movl %ecx, %edi
cmovbl %eax, %edi
jmp 0x52ba2c
movl (%r13,%rax,4), %edi
movl %edi, 0x10(%rsp)
movq %r11, %rdi
orq $0x2, %rdi
testl %r15d, %r15d
movq %rdi, (%rsp)
je 0x52ba51
cmpq %rsi, %rdi
movl %ecx, %r8d
cmovbl %edi, %r8d
movl %r8d, 0x58(%rsp)
jmp 0x52ba5a
movl (%r13,%rdi,4), %edi
movl %edi, 0x58(%rsp)
movq %r11, %rdi
orq $0x3, %rdi
testl %r15d, %r15d
movq %rdi, 0x28(%rsp)
je 0x52ba7c
cmpq %rsi, %rdi
movl %ecx, %r8d
cmovbl %edi, %r8d
movl %r8d, 0x50(%rsp)
jmp 0x52ba85
movl (%r13,%rdi,4), %edi
movl %edi, 0x50(%rsp)
movq %r11, %r8
orq $0x4, %r8
testl %r15d, %r15d
je 0x52ba9c
cmpq %rsi, %r8
movl %ecx, %edi
cmovbl %r8d, %edi
jmp 0x52baa1
movl (%r13,%r8,4), %edi
movl %edi, 0x48(%rsp)
movq %r11, %r9
orq $0x5, %r9
testl %r15d, %r15d
je 0x52babc
cmpq %rsi, %r9
movl %ecx, %edi
cmovbl %r9d, %edi
jmp 0x52bac1
movl (%r13,%r9,4), %edi
movl %edi, 0x40(%rsp)
movq %rax, %rdi
movq %r11, %r10
orq $0x6, %r10
testl %r15d, %r15d
je 0x52badf
cmpq %rsi, %r10
movl %ecx, %eax
cmovbl %r10d, %eax
jmp 0x52bae4
movl (%r13,%r10,4), %eax
movl 0x18(%r12), %r12d
movq %r11, 0x20(%rsp)
orq $0x7, %r11
testl %r15d, %r15d
je 0x52bb03
cmpq %rsi, %r11
movl %ecx, %r15d
cmovbl %r11d, %r15d
jmp 0x52bb08
movl (%r13,%r11,4), %r15d
movl %r15d, 0x38(%rsp)
movl 0x18(%rsp), %r15d
imull %r12d, %r15d
movslq %r15d, %r13
movq 0xb8(%rsp), %r15
leaq (%r15,%r13,4), %r13
movq %r13, 0x18(%rsp)
movl 0x10(%rsp), %r13d
imull %r12d, %r13d
movslq %r13d, %r13
leaq (%r15,%r13,4), %r13
movq %r13, 0x10(%rsp)
movl 0x58(%rsp), %r13d
imull %r12d, %r13d
movslq %r13d, %r13
leaq (%r15,%r13,4), %r13
movq %r13, 0x58(%rsp)
movl 0x50(%rsp), %r13d
imull %r12d, %r13d
movslq %r13d, %r13
leaq (%r15,%r13,4), %r13
movq %r13, 0x50(%rsp)
movl 0x48(%rsp), %r13d
imull %r12d, %r13d
movslq %r13d, %r13
leaq (%r15,%r13,4), %r13
movq %r13, 0x48(%rsp)
movl 0x40(%rsp), %r13d
imull %r12d, %r13d
movslq %r13d, %r13
leaq (%r15,%r13,4), %r13
movq %r13, 0x40(%rsp)
imull %r12d, %eax
cltq
leaq (%r15,%rax,4), %rax
movq %rax, 0xf8(%rsp)
movl 0x38(%rsp), %eax
imull %r12d, %eax
cltq
leaq (%r15,%rax,4), %rax
movq %rax, 0x38(%rsp)
vmovdqa 0x200(%rsp), %ymm0
vpcmpgtd 0x100(%rsp), %ymm0, %ymm9
xorl %r15d, %r15d
vpmovsxbd 0xcc014(%rip), %ymm10 # 0x5f7bea
vmovdqa 0x80(%rsp), %ymm13
vmovdqa %ymm13, %ymm4
vmovdqa 0x220(%rsp), %ymm12
vmovdqa %ymm12, %ymm11
movq 0x60(%rsp), %r12
movslq 0x10(%r14,%r15,4), %rax
movq 0x50(%rsp), %r13
vmovd (%r13,%rax,4), %xmm8
movslq 0x14(%r14,%r15,4), %rax
movq 0x58(%rsp), %r13
vpinsrd $0x1, (%r13,%rax,4), %xmm8, %xmm8
movslq 0x18(%r14,%r15,4), %rax
movq 0x10(%rsp), %r13
vpinsrd $0x2, (%r13,%rax,4), %xmm8, %xmm8
movslq 0x1c(%r14,%r15,4), %rax
movq 0x18(%rsp), %r13
vpinsrd $0x3, (%r13,%rax,4), %xmm8, %xmm8
movslq (%r14,%r15,4), %rax
movq 0x38(%rsp), %r13
vmovd (%r13,%rax,4), %xmm14
movslq 0x4(%r14,%r15,4), %rax
movq 0xf8(%rsp), %r13
vpinsrd $0x1, (%r13,%rax,4), %xmm14, %xmm14
movslq 0x8(%r14,%r15,4), %rax
movq 0x40(%rsp), %r13
vpinsrd $0x2, (%r13,%rax,4), %xmm14, %xmm14
movslq 0xc(%r14,%r15,4), %rax
movq 0x48(%rsp), %r13
vpinsrd $0x3, (%r13,%rax,4), %xmm14, %xmm14
cmpq %rcx, 0x20(%rsp)
setne %r13b
vinserti128 $0x1, %xmm8, %ymm14, %ymm8
vpmovsxbd 0xcdd66(%rip), %ymm0 # 0x5f9a04
vpermd %ymm11, %ymm0, %ymm14
vpaddd %ymm12, %ymm8, %ymm8
vpbroadcastd 0x1c(%rdx,%r15,4), %ymm12
vpblendd $0x80, %ymm12, %ymm14, %ymm12 # ymm12 = ymm14[0,1,2,3,4,5,6],ymm12[7]
vpermd %ymm4, %ymm0, %ymm4
vpbroadcastd 0x1c(%r12,%r15,4), %ymm14
vpblendd $0x80, %ymm14, %ymm4, %ymm4 # ymm4 = ymm4[0,1,2,3,4,5,6],ymm14[7]
vmovdqa 0x280(%rsp), %ymm0
vpsubd %ymm0, %ymm12, %ymm14
vmovdqa 0x260(%rsp), %ymm1
vpsubd %ymm1, %ymm4, %ymm4
vpmaxsd %ymm4, %ymm14, %ymm4
vpsubd %ymm0, %ymm11, %ymm11
vpsubd %ymm1, %ymm13, %ymm13
vpmaxsd %ymm13, %ymm11, %ymm13
vpmaxsd %ymm4, %ymm13, %ymm11
vpmaxsd 0xcd9df(%rip), %ymm11, %ymm11 # 0x5f96e0
vpmaxsd %ymm11, %ymm8, %ymm15
vpcmpeqd %ymm3, %ymm10, %ymm14
vpandn %ymm15, %ymm14, %ymm11
cmpq $0x8, %r15
jb 0x52bd43
vmovdqa 0x140(%rsp), %ymm0
vpminsd %ymm11, %ymm0, %ymm0
vmovdqa %ymm0, 0x140(%rsp)
vmovdqa 0x160(%rsp), %ymm0
vpmaxsd %ymm11, %ymm0, %ymm0
vmovdqa %ymm0, 0x160(%rsp)
movq 0x68(%rsp), %rax
movq 0x10(%rax), %r12
movq (%r12), %rax
movq 0x8(%r12), %r12
cmpq %rbx, %r15
setae %dl
orb %dl, %r13b
vextracti128 $0x1, %ymm11, %xmm8
jne 0x52bd6d
vpextrd $0x3, %xmm8, (%rax,%r15,4)
cmpq %r15, 0x8(%rsp)
jne 0x52bd80
movq 0x20(%rsp), %rdx
vpextrd $0x3, %xmm8, (%r12,%rdx,4)
cmpq %rcx, %rdi
setne %dl
leaq -0x1(%r15), %r13
cmpq %rbx, %r13
setae %r13b
orb %dl, %r13b
jne 0x52bd9e
vpextrd $0x2, %xmm8, -0x4(%rax,%r15,4)
cmpq %rsi, %rdi
setae %dl
cmpq %r15, %rbx
setne %r13b
orb %dl, %r13b
jne 0x52bdb7
vpextrd $0x2, %xmm8, (%r12,%rdi,4)
movq (%rsp), %rdx
cmpq %rcx, %rdx
jne 0x52bde6
leaq -0x2(%r15), %rdx
cmpq $0x2, %r15
setae %r13b
cmpq %rbx, %rdx
setl %dl
andb %r13b, %dl
cmpb $0x1, %dl
movq (%rsp), %rdx
jne 0x52bde6
vpextrd $0x1, %xmm8, -0x8(%rax,%r15,4)
cmpq %rsi, %rdx
setae %dl
cmpq %r15, 0xe8(%rsp)
setne %r13b
orb %dl, %r13b
jne 0x52be08
movq (%rsp), %rdx
vpextrd $0x1, %xmm8, (%r12,%rdx,4)
movq 0x28(%rsp), %rdx
cmpq %rcx, %rdx
jne 0x52be38
leaq -0x3(%r15), %rdx
cmpq $0x3, %r15
setae %r13b
cmpq %rbx, %rdx
setl %dl
andb %r13b, %dl
cmpb $0x1, %dl
movq 0x28(%rsp), %rdx
jne 0x52be38
vmovd %xmm8, -0xc(%rax,%r15,4)
cmpq %rsi, %rdx
setae %dl
cmpq %r15, 0xe0(%rsp)
setne %r13b
orb %dl, %r13b
jne 0x52be5a
movq 0x28(%rsp), %rdx
vmovd %xmm8, (%r12,%rdx,4)
cmpq %rcx, %r8
jne 0x52be81
leaq -0x4(%r15), %rdx
cmpq $0x4, %r15
setae %r13b
cmpq %rbx, %rdx
setl %dl
andb %r13b, %dl
cmpb $0x1, %dl
jne 0x52be81
vpextrd $0x3, %xmm11, -0x10(%rax,%r15,4)
cmpq %rsi, %r8
setae %dl
cmpq %r15, 0xd8(%rsp)
setne %r13b
orb %dl, %r13b
jne 0x52be9f
vpextrd $0x3, %xmm11, (%r12,%r8,4)
cmpq %rcx, %r9
jne 0x52bec6
leaq -0x5(%r15), %rdx
cmpq $0x5, %r15
setae %r13b
cmpq %rbx, %rdx
setl %dl
andb %r13b, %dl
cmpb $0x1, %dl
jne 0x52bec6
vpextrd $0x2, %xmm11, -0x14(%rax,%r15,4)
cmpq %rsi, %r9
setae %dl
cmpq %r15, 0xd0(%rsp)
setne %r13b
orb %dl, %r13b
jne 0x52bee4
vpextrd $0x2, %xmm11, (%r12,%r9,4)
cmpq %rcx, %r10
jne 0x52bf0b
leaq -0x6(%r15), %rdx
cmpq $0x6, %r15
setae %r13b
cmpq %rbx, %rdx
setl %dl
andb %r13b, %dl
cmpb $0x1, %dl
jne 0x52bf0b
vpextrd $0x1, %xmm11, -0x18(%rax,%r15,4)
cmpq %rsi, %r10
setae %dl
cmpq %r15, 0xc8(%rsp)
setne %r13b
orb %dl, %r13b
jne 0x52bf29
vpextrd $0x1, %xmm11, (%r12,%r10,4)
cmpq %rcx, %r11
jne 0x52bf4c
leaq -0x7(%r15), %rdx
cmpq $0x7, %r15
setb %r13b
cmpq %rbx, %rdx
setge %dl
orb %r13b, %dl
jne 0x52bf4c
vmovd %xmm11, -0x1c(%rax,%r15,4)
vblendvps %ymm14, 0x80(%rsp), %ymm4, %ymm4
cmpq %rsi, %r11
setae %al
cmpq %r15, 0xc0(%rsp)
setne %dl
orb %al, %dl
jne 0x52bf72
vmovd %xmm11, (%r12,%r11,4)
movq 0x70(%rsp), %rdx
vmovd %xmm11, (%rdx,%r15,4)
movq 0x60(%rsp), %r12
vmovss %xmm4, (%r12,%r15,4)
vmovdqa 0x240(%rsp), %ymm0
vpcmpgtd %ymm10, %ymm0, %ymm8
vpand %ymm9, %ymm8, %ymm8
vpsrad $0x1f, %ymm10, %ymm6
vpandn %ymm8, %ymm6, %ymm6
vextracti128 $0x1, %ymm6, %xmm8
vpackssdw %xmm8, %xmm6, %xmm8
vmovdqa 0x1c0(%rsp), %ymm0
vpcmpeqd %ymm0, %ymm11, %ymm1
vpcmpgtd %ymm0, %ymm11, %ymm5
vpand %ymm6, %ymm5, %ymm7
vextracti128 $0x1, %ymm7, %xmm3
vpackssdw %xmm3, %xmm7, %xmm3
vblendvps %ymm7, %ymm15, %ymm0, %ymm0
vmovdqa 0x180(%rsp), %ymm7
vpcmpgtd %ymm10, %ymm7, %ymm15
vpand %ymm1, %ymm15, %ymm1
vextracti128 $0x1, %ymm1, %xmm15
vpackssdw %xmm15, %xmm1, %xmm15
vpblendvb %xmm15, %xmm8, %xmm3, %xmm3
vblendvps %ymm14, 0x80(%rsp), %ymm13, %ymm13
vmovaps %ymm0, 0x1c0(%rsp)
vpmovsxwd %xmm3, %ymm0
vblendvps %ymm0, 0x100(%rsp), %ymm2, %ymm2
vpor %ymm5, %ymm1, %ymm0
vpand %ymm0, %ymm6, %ymm0
vblendvps %ymm0, %ymm10, %ymm7, %ymm0
vmovaps %ymm0, 0x180(%rsp)
vpcmpeqd %ymm3, %ymm3, %ymm3
vpsubd %ymm3, %ymm10, %ymm10
incq %r15
cmpq %r15, 0xf0(%rsp)
jne 0x52bbf6
vmovdqa 0x100(%rsp), %ymm0
vpaddd 0x1e0(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x100(%rsp)
movq 0x20(%rsp), %r11
addq $0x8, %r11
cmpq %rsi, %r11
movq 0x10(%rbp), %r12
movl 0x34(%rsp), %r8d
movq 0x78(%rsp), %r13
jb 0x52b9fb
jmp 0x52c0ae
vmovaps 0x80(%rsp), %ymm0
vmovaps %ymm0, 0x160(%rsp)
vmovaps 0x1a0(%rsp), %ymm0
vmovaps %ymm0, 0x140(%rsp)
movq 0x68(%rsp), %rbx
vmovaps %ymm2, 0x120(%rsp)
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
movl 0x1c0(%rsp,%rdx,4), %esi
cmpl %r8d, %esi
jle 0x52c0e1
movl 0x120(%rsp,%rdx,4), %eax
movl 0x180(%rsp,%rdx,4), %ecx
movl %esi, %r8d
jmp 0x52c10a
jne 0x52c10a
movl 0x180(%rsp,%rdx,4), %esi
cmpl %ecx, %esi
jge 0x52c0f9
movl 0x120(%rsp,%rdx,4), %eax
movl %esi, %ecx
jmp 0x52c10a
jne 0x52c10a
movl 0x120(%rsp,%rdx,4), %edi
cmpl %eax, %edi
cmovll %esi, %ecx
cmovll %edi, %eax
incq %rdx
cmpl $0x8, %edx
jne 0x52c0c2
vmovdqa 0x80(%rsp), %ymm0
vpcmpgtd 0x140(%rsp), %ymm0, %ymm0
vmovdqa 0x160(%rsp), %ymm1
vpcmpgtd 0x1a0(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestps %ymm0, %ymm0
je 0x52c14c
orb $0x40, 0xc(%rbx)
xorl %r8d, %r8d
xorl %ecx, %ecx
xorl %eax, %eax
movl %r8d, (%rbx)
movl %eax, 0x4(%rbx)
movl %ecx, 0x8(%rbx)
movq 0x60(%rsp), %rdi
vzeroupper
callq 0x2094b5
movq 0x70(%rsp), %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%r12)
jne 0x52c1b7
movq %r13, %rdi
callq 0x2094b5
jmp 0x52c1b7
callq 0x1f0f33
jmp 0x52c1b5
callq 0x1f0f0d
jmp 0x52c1b5
callq 0x1f0ee7
jmp 0x52c1b5
callq 0x1f0ec1
jmp 0x52c1b5
callq 0x1f0e9b
jmp 0x52c1b5
callq 0x1f0e75
jmp 0x52c1b5
callq 0x1f0e4f
xorl %ebx, %ebx
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)