// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_trace_diag_avx2_256_32.c
// Function: parasail_sw_trace_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_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 s1Len = 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;
    __m256i vTDiag;
    __m256i vTIns;
    __m256i vTDel;
    __m256i vTZero;
    __m256i vTDiagE;
    __m256i vTInsE;
    __m256i vTDiagF;
    __m256i vTDelF;

    /* 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);
    vTDiag = _mm256_set1_epi32(PARASAIL_DIAG);
    vTIns = _mm256_set1_epi32(PARASAIL_INS);
    vTDel = _mm256_set1_epi32(PARASAIL_DEL);
    vTZero = _mm256_set1_epi32(PARASAIL_ZERO);
    vTDiagE = _mm256_set1_epi32(PARASAIL_DIAG_E);
    vTInsE = _mm256_set1_epi32(PARASAIL_INS_E);
    vTDiagF = _mm256_set1_epi32(PARASAIL_DIAG_F);
    vTDelF = _mm256_set1_epi32(PARASAIL_DEL_F);

    /* initialize result */
    result = parasail_result_new_trace(s1Len, s2Len, 32, sizeof(int8_t));
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_DIAG
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_8;

    /* 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 vE_opn = vNegInf;
        __m256i vE_ext = vNegInf;
        __m256i vF = vNegInf;
        __m256i vF_opn = vNegInf;
        __m256i vF_ext = 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_opn = _mm256_sub_epi32(vNH, vOpen);
            vF_ext = _mm256_sub_epi32(vF, vGap);
            vF = _mm256_max_epi32(vF_opn, vF_ext);
            vE_opn = _mm256_sub_epi32(vWH, vOpen);
            vE_ext = _mm256_sub_epi32(vE, vGap);
            vE = _mm256_max_epi32(vE_opn, vE_ext);
            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);
            vNWH = _mm256_max_epi32(vNWH, vZero);
            vWH = _mm256_max_epi32(vNWH, vE);
            vWH = _mm256_max_epi32(vWH, vF);
            /* 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);
            }
            /* trace table */
            {
                __m256i cond_zero = _mm256_cmpeq_epi32(vWH, vZero);
                __m256i case1 = _mm256_cmpeq_epi32(vWH, vNWH);
                __m256i case2 = _mm256_cmpeq_epi32(vWH, vF);
                __m256i vT = _mm256_blendv_epi8(
                        _mm256_blendv_epi8(vTIns, vTDel, case2),
                        _mm256_blendv_epi8(vTDiag, vTZero, cond_zero),
                        case1);
                __m256i condE = _mm256_cmpgt_epi32(vE_opn, vE_ext);
                __m256i condF = _mm256_cmpgt_epi32(vF_opn, vF_ext);
                __m256i vET = _mm256_blendv_epi8(vTInsE, vTDiagE, condE);
                __m256i vFT = _mm256_blendv_epi8(vTDelF, vTDiagF, condF);
                vT = _mm256_or_si256(vT, vET);
                vT = _mm256_or_si256(vT, vFT);
                arr_store_si256(result->trace->trace_table, vT, i, s1Len, j, s2Len);
            }
            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 $0x380, %rsp            # imm = 0x380
testq %rdx, %rdx
je 0x581a5c
movl %ecx, %r13d
testl %ecx, %ecx
jle 0x581a63
testl %r8d, %r8d
js 0x581a6a
movl %r9d, %r12d
testl %r9d, %r9d
js 0x581a71
movl %esi, %r14d
movq 0x10(%rbp), %rsi
testq %rsi, %rsi
je 0x581a78
movq %rdx, %r15
movl 0x30(%rsi), %eax
testl %eax, %eax
jne 0x580ec5
testq %rdi, %rdi
je 0x581a7f
testl %r14d, %r14d
jle 0x581a86
testl %eax, %eax
je 0x580ec9
movl 0x34(%rsi), %r14d
movq %rdi, 0x50(%rsp)
movl %r8d, %eax
negl %eax
movl 0x20(%rsi), %ecx
movl $0x80000000, %edi       # imm = 0x80000000
movl %r8d, 0xa0(%rsp)
movl %r8d, %edx
orl %edi, %edx
subl %ecx, %edi
cmpl %eax, %ecx
cmovgl %edx, %edi
incl %edi
movl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
subl 0x1c(%rsi), %ebx
movl %edi, 0x10(%rsp)
vmovd %edi, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x200(%rsp)
vmovdqa %ymm0, 0x120(%rsp)
vmovdqa %ymm0, 0x1e0(%rsp)
vmovdqa %ymm0, 0x1a0(%rsp)
movl $0x20, %edx
movl $0x1, %ecx
movl %r14d, %edi
movl %r13d, %esi
vzeroupper
callq 0x2097d1
testq %rax, %rax
je 0x581a8b
movl %r12d, 0x40(%rsp)
movq %r15, 0x48(%rsp)
movq %r14, 0x100(%rsp)
movq %rax, 0x18(%rsp)
orl $0x8481004, 0xc(%rax)   # imm = 0x8481004
leal 0xe(%r13), %r12d
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094d5
movq %rax, %r14
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094d5
movq %rax, %r15
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094d5
movq %rax, %rdx
testq %r14, %r14
sete %al
movq %r15, 0x30(%rsp)
testq %r15, %r15
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
orb %cl, %al
jne 0x581a8b
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
movq %rdx, 0x28(%rsp)
je 0x580fe3
movq $0x0, 0x8(%rsp)
movq 0x100(%rsp), %r12
jmp 0x581065
movq 0x100(%rsp), %r12
leal 0x7(%r12), %r15d
movslq %r15d, %rsi
movl $0x20, %edi
callq 0x2094d5
testq %rax, %rax
je 0x581a8b
testl %r12d, %r12d
movq %rax, %rdi
movq 0x50(%rsp), %r8
jle 0x581033
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %r12d, %ecx
xorl %edx, %edx
movzbl (%r8,%rdx), %esi
movl (%rax,%rsi,4), %esi
movl %esi, (%rdi,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x581020
movslq %r12d, %rax
leal 0x1(%r12), %ecx
cmpl %ecx, %r15d
cmovgl %r15d, %ecx
movq %rdi, 0x8(%rsp)
leaq (%rdi,%rax,4), %rdi
movl %r12d, %eax
notl %eax
addl %ecx, %eax
leaq 0x4(,%rax,4), %rdx
xorl %esi, %esi
callq 0x19e090
movq 0x10(%rbp), %rax
leal 0x7(%r13), %edi
vmovd %ebx, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x1c0(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x7f, 0x1e0(%rsp), %ymm0, %ymm0 # ymm0 = mem[0,1,2,3,4,5,6],ymm0[7]
vmovdqa %ymm0, 0x240(%rsp)
vmovss 0xa0(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x340(%rsp)
vmovss 0x40(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x320(%rsp)
vmovd %r12d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x220(%rsp)
vmovd %r13d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x300(%rsp)
movq 0x10(%rax), %rax
cmpl $0x2, %r13d
movl $0x1, %r12d
cmovgel %r13d, %r12d
xorl %ecx, %ecx
movq 0x48(%rsp), %rsi
movzbl (%rsi,%rcx), %edx
movl (%rax,%rdx,4), %edx
movl %edx, 0x1c(%r14,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x5810fd
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, 0xc(%r14)
vmovdqu %xmm0, (%r14)
movl %r13d, %ebx
leal 0x1(%r13), %eax
cmpl %eax, %edi
movl %edi, 0xa0(%rsp)
cmovgl %edi, %eax
leaq (%r14,%rbx,4), %rdi
addq $0x1c, %rdi
movl %r13d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %r15d, %r15d
xorl %esi, %esi
vzeroupper
callq 0x19e090
movl 0x10(%rsp), %r8d
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rdx
movl $0x0, 0x1c(%rcx,%r15,4)
movl %r8d, 0x1c(%rdx,%r15,4)
incq %r15
cmpq %r15, %r12
jne 0x581166
xorl %eax, %eax
movl %r8d, (%rcx,%rax,4)
movl %r8d, (%rdx,%rax,4)
incq %rax
cmpq $0x7, %rax
jne 0x58117e
leaq 0x7(%rbx), %rax
movq 0x10(%rbp), %r9
vmovdqa 0x1e0(%rsp), %ymm3
movq 0x100(%rsp), %rsi
movl 0xa0(%rsp), %r10d
movl %r8d, (%rcx,%rax,4)
movl %r8d, (%rdx,%rax,4)
incq %rax
incl %r13d
cmpl %r13d, %r10d
jg 0x5811b0
vmovaps 0x120(%rsp), %ymm2
testl %esi, %esi
jle 0x581969
leal -0x1(%rsi), %edi
cmpl $0x2, %r10d
movl $0x1, %eax
cmovgel %r10d, %eax
movq %rax, 0xd8(%rsp)
movl %esi, %edx
leaq (,%rbx,8), %rax
leaq -0x1(%rbx), %rcx
movq %rcx, 0x98(%rsp)
movq %rax, 0xd0(%rsp)
subq %rbx, %rax
addq $-0x7, %rax
movq %rax, 0x88(%rsp)
leaq (%rbx,%rbx,2), %rax
leaq -0x6(,%rax,2), %rax
movq %rax, 0x80(%rsp)
leaq -0x5(%rbx,%rbx,4), %rax
movq %rax, 0x78(%rsp)
leaq -0x4(,%rbx,4), %rax
movq %rax, 0x70(%rsp)
leaq -0x3(%rbx,%rbx,2), %rax
movq %rax, 0x68(%rsp)
leaq -0x2(%rbx,%rbx), %rax
movq %rax, 0x60(%rsp)
vmovaps 0x78540(%rip), %ymm0    # 0x5f97a0
vmovaps %ymm0, 0xa0(%rsp)
movq $0x0, 0x90(%rsp)
vbroadcastss 0x748c2(%rip), %ymm0 # 0x5f5b40
vmovaps %ymm0, 0x2e0(%rsp)
vbroadcastss 0x7a184(%rip), %ymm0 # 0x5fb414
vmovaps %ymm0, 0x2c0(%rsp)
vbroadcastss 0x7875e(%rip), %ymm0 # 0x5f9a00
vmovaps %ymm0, 0x100(%rsp)
vbroadcastss 0x7a150(%rip), %ymm0 # 0x5fb404
vmovaps %ymm0, 0x2a0(%rsp)
vbroadcastss 0x7a142(%rip), %ymm0 # 0x5fb408
vmovaps %ymm0, 0x280(%rsp)
vbroadcastss 0x7a134(%rip), %ymm0 # 0x5fb40c
vmovaps %ymm0, 0x260(%rsp)
xorl %r11d, %r11d
vmovdqa 0x1c0(%rsp), %ymm0
vmovdqa %ymm0, 0x140(%rsp)
vmovdqa %ymm3, 0x160(%rsp)
movl %edi, 0x14(%rsp)
vpcmpeqd %ymm14, %ymm14, %ymm14
movl 0x30(%r9), %ecx
movl %r11d, %esi
testl %ecx, %ecx
movq 0x8(%rsp), %rax
jne 0x58131c
movl (%rax,%r11,4), %esi
movq %r11, %r9
orq $0x1, %r9
testl %ecx, %ecx
movq 0x28(%rsp), %r8
je 0x581338
cmpq %rdx, %r9
movl %edi, %r10d
cmovbl %r9d, %r10d
jmp 0x58133c
movl (%rax,%r9,4), %r10d
movl %r10d, 0x20(%rsp)
movq %r11, %r10
orq $0x2, %r10
testl %ecx, %ecx
je 0x581358
cmpq %rdx, %r10
movl %edi, %r15d
cmovbl %r10d, %r15d
jmp 0x58135c
movl (%rax,%r10,4), %r15d
movq %r11, %r13
orq $0x3, %r13
testl %ecx, %ecx
movq %rax, 0x8(%rsp)
je 0x581378
cmpq %rdx, %r13
movl %edi, %r12d
cmovbl %r13d, %r12d
jmp 0x58137c
movl (%rax,%r13,4), %r12d
movl %esi, %eax
movq %r9, 0x50(%rsp)
movq %r11, %r9
orq $0x4, %r9
testl %ecx, %ecx
movq %r9, 0xf8(%rsp)
je 0x5813a1
cmpq %rdx, %r9
movl %edi, %esi
cmovbl %r9d, %edi
jmp 0x5813ac
movl %edi, %esi
movq 0x8(%rsp), %rdi
movl (%rdi,%r9,4), %edi
movl %edi, 0x180(%rsp)
movq %r10, 0x48(%rsp)
movq %r11, %r9
orq $0x5, %r9
testl %ecx, %ecx
movl %eax, 0x38(%rsp)
je 0x5813da
cmpq %rdx, %r9
movl %esi, %edi
movl %esi, %r10d
cmovbl %r9d, %r10d
movq 0x8(%rsp), %rax
jmp 0x5813e5
movq 0x8(%rsp), %rax
movl (%rax,%r9,4), %r10d
movl %esi, %edi
movq %r11, %rsi
orq $0x6, %rsi
testl %ecx, %ecx
movq %r11, 0x58(%rsp)
movq %r13, 0x40(%rsp)
movq %rsi, 0xe8(%rsp)
je 0x58140e
cmpq %rdx, %rsi
movl %edi, %r11d
cmovbl %esi, %r11d
jmp 0x581412
movl (%rax,%rsi,4), %r11d
movq 0x10(%rbp), %rdi
movq 0x8(%rdi), %rsi
movl 0x18(%rdi), %r13d
movq 0x58(%rsp), %rdi
orq $0x7, %rdi
testl %ecx, %ecx
movq %r9, 0xf0(%rsp)
je 0x58143f
cmpq %rdx, %rdi
movl 0x14(%rsp), %eax
cmovbl %edi, %eax
jmp 0x581442
movl (%rax,%rdi,4), %eax
movl 0x38(%rsp), %ecx
imull %r13d, %ecx
movslq %ecx, %rcx
leaq (%rsi,%rcx,4), %rcx
movq %rcx, 0x38(%rsp)
movl 0x20(%rsp), %ecx
imull %r13d, %ecx
movslq %ecx, %rcx
leaq (%rsi,%rcx,4), %rcx
movq %rcx, 0x20(%rsp)
imull %r13d, %r15d
movslq %r15d, %r15
leaq (%rsi,%r15,4), %rcx
movq %rcx, 0xe0(%rsp)
imull %r13d, %r12d
movslq %r12d, %r12
leaq (%rsi,%r12,4), %r12
movl 0x180(%rsp), %ecx
imull %r13d, %ecx
movslq %ecx, %r9
leaq (%rsi,%r9,4), %r9
imull %r13d, %r10d
movslq %r10d, %r10
leaq (%rsi,%r10,4), %r10
imull %r13d, %r11d
movslq %r11d, %r11
leaq (%rsi,%r11,4), %r11
imull %r13d, %eax
cltq
leaq (%rsi,%rax,4), %r13
vmovdqa 0x220(%rsp), %ymm0
vpcmpgtd 0xa0(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x180(%rsp)
xorl %eax, %eax
vpmovsxbd 0x7670a(%rip), %ymm15 # 0x5f7bea
vmovdqa %ymm3, %ymm1
vmovdqa %ymm3, %ymm5
vmovdqa 0x240(%rsp), %ymm0
vmovdqa %ymm0, %ymm4
movq 0x30(%rsp), %rcx
movslq 0x10(%r14,%rax,4), %rsi
vmovd (%r12,%rsi,4), %xmm6
movslq 0x14(%r14,%rax,4), %rsi
movq 0xe0(%rsp), %r15
vpinsrd $0x1, (%r15,%rsi,4), %xmm6, %xmm6
movslq 0x18(%r14,%rax,4), %rsi
movq 0x20(%rsp), %r15
vpinsrd $0x2, (%r15,%rsi,4), %xmm6, %xmm6
movslq 0x1c(%r14,%rax,4), %rsi
movq 0x38(%rsp), %r15
vpinsrd $0x3, (%r15,%rsi,4), %xmm6, %xmm6
movslq (%r14,%rax,4), %rsi
vmovd (%r13,%rsi,4), %xmm7
movslq 0x4(%r14,%rax,4), %rsi
vpinsrd $0x1, (%r11,%rsi,4), %xmm7, %xmm7
movslq 0x8(%r14,%rax,4), %rsi
vpinsrd $0x2, (%r10,%rsi,4), %xmm7, %xmm7
movslq 0xc(%r14,%rax,4), %rsi
vpinsrd $0x3, (%r9,%rsi,4), %xmm7, %xmm7
vpmovsxbd 0x78491(%rip), %ymm10 # 0x5f9a04
vpermd %ymm4, %ymm10, %ymm8
vpbroadcastd 0x1c(%rcx,%rax,4), %ymm9
vinserti128 $0x1, %xmm6, %ymm7, %ymm6
vpaddd %ymm0, %ymm6, %ymm6
vpblendd $0x80, %ymm9, %ymm8, %ymm0 # ymm0 = ymm8[0,1,2,3,4,5,6],ymm9[7]
vpermd %ymm1, %ymm10, %ymm1
vpbroadcastd 0x1c(%r8,%rax,4), %ymm7
vpblendd $0x80, %ymm7, %ymm1, %ymm1 # ymm1 = ymm1[0,1,2,3,4,5,6],ymm7[7]
vmovdqa 0x340(%rsp), %ymm7
vpsubd %ymm7, %ymm0, %ymm8
vmovdqa 0x320(%rsp), %ymm10
vpsubd %ymm10, %ymm1, %ymm9
vpmaxsd %ymm9, %ymm8, %ymm1
vpsubd %ymm7, %ymm4, %ymm11
vpsubd %ymm10, %ymm5, %ymm12
vpmaxsd %ymm12, %ymm11, %ymm5
vpmaxsd 0x78108(%rip), %ymm6, %ymm13 # 0x5f96e0
vpmaxsd %ymm1, %ymm5, %ymm4
vpmaxsd %ymm4, %ymm13, %ymm7
vpcmpeqd %ymm14, %ymm15, %ymm6
vpandn %ymm7, %ymm6, %ymm4
vblendvps %ymm6, %ymm3, %ymm1, %ymm1
cmpq $0x8, %rax
jb 0x581625
vmovdqa 0x140(%rsp), %ymm3
vpminsd %ymm4, %ymm3, %ymm3
vmovdqa %ymm3, 0x140(%rsp)
vmovdqa 0x160(%rsp), %ymm3
vpmaxsd %ymm4, %ymm3, %ymm3
vmovdqa %ymm3, 0x160(%rsp)
vpcmpeqd %ymm4, %ymm13, %ymm13
vpcmpeqd %ymm4, %ymm1, %ymm10
vmovdqa 0x2e0(%rsp), %ymm3
vpsubd %ymm10, %ymm3, %ymm10
vpcmpgtd 0x7809d(%rip), %ymm4, %ymm3 # 0x5f96e0
vpand 0x2c0(%rsp), %ymm3, %ymm3
vblendvps %ymm13, %ymm3, %ymm10, %ymm3
vpcmpgtd %ymm12, %ymm11, %ymm10
vpcmpgtd %ymm9, %ymm8, %ymm8
vmovaps 0x260(%rsp), %ymm9
vblendvps %ymm8, 0x280(%rsp), %ymm9, %ymm8
vmovaps 0x2a0(%rsp), %ymm9
vblendvps %ymm10, 0x100(%rsp), %ymm9, %ymm9
vorps %ymm9, %ymm8, %ymm8
vorps %ymm3, %ymm8, %ymm8
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq (%rsi), %rsi
vextractf128 $0x1, %ymm8, %xmm9
cmpq %rbx, %rax
jae 0x5816b7
movq 0x90(%rsp), %rcx
leaq (%rsi,%rcx), %r8
vpextrb $0xc, %xmm9, (%rax,%r8)
cmpq %rdx, 0x50(%rsp)
setae %r8b
leaq -0x1(%rax), %rcx
cmpq %rbx, %rcx
setae %cl
orb %r8b, %cl
jne 0x5816e1
movq 0x98(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x8, %xmm9, (%rax,%rcx)
cmpq %rdx, 0x48(%rsp)
jae 0x581711
leaq -0x2(%rax), %rcx
cmpq $0x2, %rax
setae %r8b
cmpq %rbx, %rcx
setl %cl
andb %r8b, %cl
cmpb $0x1, %cl
jne 0x581711
movq 0x60(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x4, %xmm9, (%rax,%rcx)
cmpq %rdx, 0x40(%rsp)
jae 0x581741
leaq -0x3(%rax), %rcx
cmpq $0x3, %rax
setae %r8b
cmpq %rbx, %rcx
setl %cl
andb %r8b, %cl
cmpb $0x1, %cl
jne 0x581741
movq 0x68(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x0, %xmm9, (%rax,%rcx)
cmpq %rdx, 0xf8(%rsp)
jae 0x581774
leaq -0x4(%rax), %rcx
cmpq $0x4, %rax
setae %r8b
cmpq %rbx, %rcx
setl %cl
andb %r8b, %cl
cmpb $0x1, %cl
jne 0x581774
movq 0x70(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0xc, %xmm8, (%rax,%rcx)
cmpq %rdx, 0xf0(%rsp)
jae 0x5817a7
leaq -0x5(%rax), %rcx
cmpq $0x5, %rax
setae %r8b
cmpq %rbx, %rcx
setl %cl
andb %r8b, %cl
cmpb $0x1, %cl
jne 0x5817a7
movq 0x78(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x8, %xmm8, (%rax,%rcx)
cmpq %rdx, 0xe8(%rsp)
jae 0x5817dd
leaq -0x6(%rax), %rcx
cmpq $0x6, %rax
setae %r8b
cmpq %rbx, %rcx
setl %cl
andb %r8b, %cl
cmpb $0x1, %cl
jne 0x5817dd
movq 0x80(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x4, %xmm8, (%rax,%rcx)
cmpq %rdx, %rdi
jae 0x581808
leaq -0x7(%rax), %rcx
cmpq $0x7, %rax
setb %r8b
cmpq %rbx, %rcx
setge %cl
orb %r8b, %cl
jne 0x581808
addq 0x88(%rsp), %rsi
vpextrb $0x0, %xmm8, (%rax,%rsi)
movq 0x30(%rsp), %rcx
vmovd %xmm4, (%rcx,%rax,4)
movq 0x28(%rsp), %r8
vmovd %xmm1, (%r8,%rax,4)
vmovdqa 0x300(%rsp), %ymm3
vpcmpgtd %ymm15, %ymm3, %ymm3
vpand 0x180(%rsp), %ymm3, %ymm3
vpsrad $0x1f, %ymm15, %ymm8
vpandn %ymm3, %ymm8, %ymm3
vextracti128 $0x1, %ymm3, %xmm8
vpackssdw %xmm8, %xmm3, %xmm8
vmovdqa 0x200(%rsp), %ymm9
vpcmpeqd %ymm4, %ymm9, %ymm10
vpcmpgtd %ymm9, %ymm4, %ymm11
vpand %ymm3, %ymm11, %ymm12
vextracti128 $0x1, %ymm12, %xmm13
vpackssdw %xmm13, %xmm12, %xmm13
vblendvps %ymm12, %ymm7, %ymm9, %ymm7
vmovdqa 0x1a0(%rsp), %ymm9
vpcmpgtd %ymm15, %ymm9, %ymm12
vpand %ymm12, %ymm10, %ymm10
vextracti128 $0x1, %ymm10, %xmm12
vpackssdw %xmm12, %xmm10, %xmm12
vpblendvb %xmm12, %xmm8, %xmm13, %xmm8
vmovaps 0x1e0(%rsp), %ymm12
vblendvps %ymm6, %ymm12, %ymm5, %ymm5
vmovaps %ymm7, 0x200(%rsp)
vpmovsxwd %xmm8, %ymm6
vblendvps %ymm6, 0xa0(%rsp), %ymm2, %ymm2
vpor %ymm11, %ymm10, %ymm6
vpand %ymm6, %ymm3, %ymm3
vblendvps %ymm3, %ymm15, %ymm9, %ymm3
vmovaps %ymm3, 0x1a0(%rsp)
vmovaps %ymm12, %ymm3
vpcmpeqd %ymm6, %ymm6, %ymm6
vpsubd %ymm6, %ymm15, %ymm15
incq %rax
cmpq %rax, 0xd8(%rsp)
jne 0x5814fa
vmovdqa 0xa0(%rsp), %ymm0
vpaddd 0x100(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0xa0(%rsp)
movq 0x58(%rsp), %r11
addq $0x8, %r11
movq 0xd0(%rsp), %rax
addq %rax, 0x90(%rsp)
addq %rax, 0x98(%rsp)
addq %rax, 0x88(%rsp)
addq %rax, 0x80(%rsp)
addq %rax, 0x78(%rsp)
addq %rax, 0x70(%rsp)
addq %rax, 0x68(%rsp)
addq %rax, 0x60(%rsp)
cmpq %rdx, %r11
movq 0x10(%rbp), %r9
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %edi
jb 0x581308
jmp 0x581984
vmovdqa %ymm3, 0x160(%rsp)
vmovdqa 0x1c0(%rsp), %ymm0
vmovdqa %ymm0, 0x140(%rsp)
vmovaps %ymm2, 0x120(%rsp)
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
movl 0x200(%rsp,%rdx,4), %esi
cmpl %r8d, %esi
jle 0x5819b2
movl 0x120(%rsp,%rdx,4), %eax
movl 0x1a0(%rsp,%rdx,4), %ecx
movl %esi, %r8d
jmp 0x5819db
jne 0x5819db
movl 0x1a0(%rsp,%rdx,4), %esi
cmpl %ecx, %esi
jge 0x5819ca
movl 0x120(%rsp,%rdx,4), %eax
movl %esi, %ecx
jmp 0x5819db
jne 0x5819db
movl 0x120(%rsp,%rdx,4), %edi
cmpl %eax, %edi
cmovll %esi, %ecx
cmovll %edi, %eax
incq %rdx
cmpl $0x8, %edx
jne 0x581993
vpcmpgtd 0x140(%rsp), %ymm3, %ymm0
vmovdqa 0x160(%rsp), %ymm1
vpcmpgtd 0x1c0(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestps %ymm0, %ymm0
movq 0x18(%rsp), %rdx
je 0x581a19
orb $0x40, 0xc(%rdx)
xorl %r8d, %r8d
xorl %ecx, %ecx
xorl %eax, %eax
movl %r8d, (%rdx)
movl %eax, 0x4(%rdx)
movl %ecx, 0x8(%rdx)
movq 0x28(%rsp), %rdi
vzeroupper
callq 0x2094b5
movq 0x30(%rsp), %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x581a55
movq 0x8(%rsp), %rdi
callq 0x2094b5
movq 0x18(%rsp), %rax
jmp 0x581a8d
callq 0x1f975f
jmp 0x581a8b
callq 0x1f9739
jmp 0x581a8b
callq 0x1f9713
jmp 0x581a8b
callq 0x1f96ed
jmp 0x581a8b
callq 0x1f96c7
jmp 0x581a8b
callq 0x1f96a1
jmp 0x581a8b
callq 0x1f967b
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq