// File: /workspace/github_c_makefile_star2_O2/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 $0x320, %rsp            # imm = 0x320
testq %rdx, %rdx
je 0x552b10
movl %ecx, %r13d
testl %ecx, %ecx
jle 0x552b34
testl %r8d, %r8d
js 0x552b58
testl %r9d, %r9d
js 0x552b96
movl %esi, %r12d
movq 0x10(%rbp), %rsi
testq %rsi, %rsi
je 0x552bb7
cmpl $0x0, 0x30(%rsi)
je 0x551f9e
movl 0x34(%rsi), %r12d
jmp 0x551fb0
testq %rdi, %rdi
je 0x552bd8
testl %r12d, %r12d
jle 0x552bf9
movq %rdi, 0x48(%rsp)
movl %r9d, 0x140(%rsp)
movq %rdx, 0x80(%rsp)
movl %r8d, %eax
negl %eax
movl 0x20(%rsi), %ecx
movl $0x80000000, %r14d      # imm = 0x80000000
movl %r8d, 0x120(%rsp)
movl %r8d, %edx
orl %r14d, %edx
subl %ecx, %r14d
cmpl %eax, %ecx
cmovgl %edx, %r14d
incl %r14d
movl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
subl 0x1c(%rsi), %ebx
vmovd %r14d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x200(%rsp)
vmovdqa %ymm0, 0x1c0(%rsp)
vmovdqa %ymm0, 0x160(%rsp)
pushq $0x20
popq %rdx
pushq $0x1
popq %rcx
movl %r12d, %edi
movl %r13d, %esi
vzeroupper
callq 0x1abb59
testq %rax, %rax
je 0x55209d
movq %rax, %r15
movq %r12, 0x20(%rsp)
movl %r14d, 0x14(%rsp)
orl $0x8481004, 0xc(%rax)   # imm = 0x8481004
movq %r13, 0x40(%rsp)
leal 0xe(%r13), %r12d
pushq $0x20
popq %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1ab783
movq %rax, %r14
movq %r13, %rdi
movq %r12, %rsi
callq 0x1ab783
movq %rax, %r13
pushq $0x20
popq %rdi
movq %r12, %rsi
callq 0x1ab783
testq %r14, %r14
sete %dl
movq %r13, 0x38(%rsp)
testq %r13, %r13
sete %cl
orb %dl, %cl
movq %rax, 0x18(%rsp)
testq %rax, %rax
sete %al
orb %cl, %al
je 0x5520a4
xorl %ebx, %ebx
jmp 0x552c21
movq %r15, 0x78(%rsp)
movq 0x10(%rbp), %r8
cmpl $0x0, 0x30(%r8)
movq 0x20(%rsp), %r15
movslq %r15d, %r13
je 0x552aa3
movq $0x0, 0x28(%rsp)
movl 0x14(%rsp), %r9d
vmovdqa 0x1c0(%rsp), %ymm15
movq 0x80(%rsp), %r10
movq 0x40(%rsp), %rax
leal 0x7(%rax), %ecx
vmovd %ebx, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x220(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x80, %ymm0, %ymm15, %ymm0 # ymm0 = ymm15[0,1,2,3,4,5,6],ymm0[7]
vmovdqa %ymm0, 0x260(%rsp)
vmovss 0x120(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x2c0(%rsp)
vmovss 0x140(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x2a0(%rsp)
vmovss 0x20(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovaps %ymm0, 0x240(%rsp)
vmovd %eax, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqa %ymm0, 0x280(%rsp)
movl %eax, %eax
movq 0x10(%r8), %rdx
xorl %esi, %esi
movq 0x38(%rsp), %rbx
cmpq %rsi, %rax
je 0x552184
movzbl (%r10,%rsi), %edi
movl (%rdx,%rdi,4), %edi
movl %edi, 0x1c(%r14,%rsi,4)
incq %rsi
jmp 0x55216d
xorl %edx, %edx
cmpq $0x7, %rdx
je 0x552196
andl $0x0, (%r14,%rdx,4)
incq %rdx
jmp 0x552186
movq %rax, %rdx
cmpl %edx, %ecx
jle 0x5521a8
andl $0x0, 0x1c(%r14,%rdx,4)
incq %rdx
jmp 0x552199
xorl %edx, %edx
movq 0x18(%rsp), %rsi
cmpq %rdx, %rax
je 0x5521c3
andl $0x0, 0x1c(%rbx,%rdx,4)
movl %r9d, 0x1c(%rsi,%rdx,4)
incq %rdx
jmp 0x5521af
xorl %edx, %edx
movq 0x18(%rsp), %rsi
cmpq $0x7, %rdx
je 0x5521dd
movl %r9d, (%rbx,%rdx,4)
movl %r9d, (%rsi,%rdx,4)
incq %rdx
jmp 0x5521ca
movq %rax, %rdx
movq 0x18(%rsp), %rsi
cmpl %edx, %ecx
jle 0x5521f8
movl %r9d, 0x1c(%rbx,%rdx,4)
movl %r9d, 0x1c(%rsi,%rdx,4)
incq %rdx
jmp 0x5521e5
movq 0x20(%rsp), %rdx
decl %edx
movq %rdx, 0x20(%rsp)
movl %ecx, %edx
sarl $0x1f, %edx
andnl %ecx, %edx, %ecx
movq %rcx, 0x48(%rsp)
vmovdqa 0x200(%rsp), %ymm14
vmovaps 0x160(%rsp), %ymm13
leaq (%rax,%rax,2), %rcx
addq $-0x3, %rcx
movq %rcx, 0x68(%rsp)
leaq (,%rax,8), %rcx
movq %rcx, 0xa0(%rsp)
vmovaps 0x79656(%rip), %ymm0    # 0x5cb8a0
vmovaps %ymm0, 0x120(%rsp)
movq $0x0, 0x70(%rsp)
xorl %r10d, %r10d
vmovdqa %ymm15, %ymm9
vmovdqa %ymm15, 0x1a0(%rsp)
vmovdqa 0x220(%rsp), %ymm0
vmovdqa %ymm0, 0x180(%rsp)
cmpq %r13, %r10
jge 0x5529b0
movq %r10, %rdi
orq $0x3, %rdi
cmpl $0x0, 0x30(%r8)
movq %r10, 0xa8(%rsp)
movq %rdi, 0x40(%rsp)
je 0x55233a
movq %r10, %rcx
orq $0x1, %rcx
cmpq %r13, %rcx
movq 0x20(%rsp), %rsi
movl %esi, %r9d
movq %rcx, 0x30(%rsp)
cmovll %ecx, %r9d
movq %r10, %rcx
orq $0x2, %rcx
cmpq %r13, %rcx
movq %rcx, 0x80(%rsp)
movl %ecx, %r15d
cmovgel %esi, %r15d
cmpq %r13, %rdi
movl %edi, %ecx
cmovgel %esi, %ecx
movq %r10, %rdx
orq $0x4, %rdx
cmpq %r13, %rdx
movq %rdx, 0x140(%rsp)
movl %edx, %r11d
cmovgel %esi, %r11d
movq %r10, %rdx
orq $0x5, %rdx
cmpq %r13, %rdx
movq %rdx, 0x60(%rsp)
movl %edx, %edi
cmovgel %esi, %edi
movq %r10, %rdx
orq $0x6, %rdx
cmpq %r13, %rdx
movq %rdx, 0x58(%rsp)
movl %edx, %r12d
cmovgel %esi, %r12d
movq %r10, %rdx
orq $0x7, %rdx
cmpq %r13, %rdx
movq %rdx, 0x50(%rsp)
cmovgel %esi, %edx
jmp 0x5523b7
movq 0x28(%rsp), %rdx
movq %r10, %rsi
movl (%rdx,%r10,4), %r10d
movl 0x4(%rdx,%rsi,4), %r9d
movq %rsi, %rcx
orq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movq %rsi, %rcx
orq $0x2, %rcx
movq %rcx, 0x80(%rsp)
movl 0x8(%rdx,%rsi,4), %r15d
movl (%rdx,%rdi,4), %ecx
movq %rsi, %rdi
orq $0x4, %rdi
movq %rdi, 0x140(%rsp)
movl 0x10(%rdx,%rsi,4), %r11d
movq %rsi, %rdi
orq $0x5, %rdi
movq %rdi, 0x60(%rsp)
movl 0x14(%rdx,%rsi,4), %edi
movq %rsi, %r12
orq $0x6, %r12
movq %r12, 0x58(%rsp)
movl 0x18(%rdx,%rsi,4), %r12d
movq %rsi, %r8
orq $0x7, %r8
movq %r8, 0x50(%rsp)
movq 0x10(%rbp), %r8
movl 0x1c(%rdx,%rsi,4), %edx
movq 0x8(%r8), %rsi
movl 0x18(%r8), %r8d
imull %r8d, %edi
movslq %edi, %rdi
leaq (%rsi,%rdi,4), %rdi
movq %rdi, 0x118(%rsp)
imull %r8d, %ecx
movslq %ecx, %rcx
leaq (%rsi,%rcx,4), %rcx
movq %rcx, 0x110(%rsp)
imull %r8d, %r9d
movslq %r9d, %r9
leaq (%rsi,%r9,4), %rcx
movq %rcx, 0x108(%rsp)
imull %r8d, %r10d
movslq %r10d, %r10
leaq (%rsi,%r10,4), %rcx
movq %rcx, 0x100(%rsp)
imull %r8d, %r15d
movslq %r15d, %r15
leaq (%rsi,%r15,4), %rcx
movq %rcx, 0xf8(%rsp)
imull %r8d, %r11d
movslq %r11d, %r11
leaq (%rsi,%r11,4), %rcx
movq %rcx, 0xf0(%rsp)
imull %r8d, %r12d
movslq %r12d, %r12
leaq (%rsi,%r12,4), %rcx
movq %rcx, 0xe8(%rsp)
imull %r8d, %edx
movslq %edx, %rdx
leaq (%rsi,%rdx,4), %rcx
movq %rcx, 0xe0(%rsp)
movq 0x30(%rsp), %rcx
imulq %rax, %rcx
movq 0x80(%rsp), %rdx
imulq %rax, %rdx
movq 0x140(%rsp), %r10
movq %r10, %rsi
imulq %rax, %rsi
movq 0x60(%rsp), %r15
movq %r15, %rdi
imulq %rax, %rdi
movq 0x58(%rsp), %r11
movq %r11, %r8
imulq %rax, %r8
movq 0x50(%rsp), %r12
movq %r12, %r9
imulq %rax, %r9
addq $-0x7, %r9
movq %r9, 0xd0(%rsp)
addq $-0x2, %rdx
movq %rdx, 0xc8(%rsp)
addq $-0x4, %rsi
movq %rsi, 0xc0(%rsp)
addq $-0x5, %rdi
movq %rdi, 0xb8(%rsp)
addq $-0x6, %r8
movq %r8, 0xb0(%rsp)
decq %rcx
movq %rcx, 0xd8(%rsp)
vmovdqa 0x240(%rsp), %ymm0
vpcmpgtd 0x120(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x2e0(%rsp)
vmovdqa 0x260(%rsp), %ymm1
vmovdqa %ymm1, %ymm7
vmovdqa %ymm15, %ymm6
vmovdqa %ymm15, %ymm4
vpmovsxbd 0x777df(%rip), %ymm11 # 0x5c9cfe
xorl %esi, %esi
movq 0x30(%rsp), %rdi
movq %rdi, %rcx
movq 0x80(%rsp), %r9
cmpq %rsi, 0x48(%rsp)
je 0x552965
vmovdqa %ymm9, 0x140(%rsp)
vmovdqa %ymm14, %ymm9
vmovaps %ymm13, 0x80(%rsp)
movslq 0x10(%r14,%rsi,4), %rdx
movq 0x110(%rsp), %r8
vmovd (%r8,%rdx,4), %xmm2
movslq 0x14(%r14,%rsi,4), %rdx
movq 0xf8(%rsp), %r8
vpinsrd $0x1, (%r8,%rdx,4), %xmm2, %xmm2
movslq 0x18(%r14,%rsi,4), %rdx
movq 0x108(%rsp), %r8
vpinsrd $0x2, (%r8,%rdx,4), %xmm2, %xmm2
movslq 0x1c(%r14,%rsi,4), %rdx
movq 0x100(%rsp), %r8
vpinsrd $0x3, (%r8,%rdx,4), %xmm2, %xmm3
movslq (%r14,%rsi,4), %rdx
movq 0xe0(%rsp), %r8
vmovd (%r8,%rdx,4), %xmm2
movslq 0x4(%r14,%rsi,4), %rdx
movq 0xe8(%rsp), %r8
vpinsrd $0x1, (%r8,%rdx,4), %xmm2, %xmm2
movslq 0x8(%r14,%rsi,4), %rdx
movq 0x118(%rsp), %r8
vpinsrd $0x2, (%r8,%rdx,4), %xmm2, %xmm2
movslq 0xc(%r14,%rsi,4), %rdx
movq 0xf0(%rsp), %r8
vpinsrd $0x3, (%r8,%rdx,4), %xmm2, %xmm12
vpmovsxbd 0x79547(%rip), %ymm0 # 0x5cbb40
vpermd %ymm1, %ymm0, %ymm2
vpbroadcastd 0x1c(%rbx,%rsi,4), %ymm5
vpblendd $0x80, %ymm5, %ymm2, %ymm5 # ymm5 = ymm2[0,1,2,3,4,5,6],ymm5[7]
vpermd %ymm4, %ymm0, %ymm2
movq 0x18(%rsp), %rdx
vpbroadcastd 0x1c(%rdx,%rsi,4), %ymm4
vpblendd $0x80, %ymm4, %ymm2, %ymm2 # ymm2 = ymm2[0,1,2,3,4,5,6],ymm4[7]
vmovdqa 0x2c0(%rsp), %ymm0
vpsubd %ymm0, %ymm5, %ymm13
vmovdqa 0x2a0(%rsp), %ymm8
vpsubd %ymm8, %ymm2, %ymm14
vpmaxsd %ymm14, %ymm13, %ymm4
vpsubd %ymm0, %ymm1, %ymm10
vpsubd %ymm8, %ymm6, %ymm2
vpmaxsd %ymm2, %ymm10, %ymm6
vinserti128 $0x1, %xmm3, %ymm12, %ymm1
vpaddd %ymm7, %ymm1, %ymm1
vpmaxsd 0x791dd(%rip), %ymm1, %ymm3 # 0x5cb840
vpmaxsd %ymm4, %ymm6, %ymm1
vpmaxsd %ymm1, %ymm3, %ymm12
vpcmpeqd 0x7940b(%rip), %ymm11, %ymm7 # 0x5cba80
vpandn %ymm12, %ymm7, %ymm1
cmpq $0x8, %rsi
jb 0x5526ae
vmovdqa 0x180(%rsp), %ymm0
vpminsd %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x180(%rsp)
vmovdqa 0x1a0(%rsp), %ymm0
vpmaxsd %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x1a0(%rsp)
vblendvps %ymm7, %ymm15, %ymm4, %ymm4
vpcmpeqd %ymm1, %ymm3, %ymm3
vpcmpeqd %ymm1, %ymm4, %ymm0
vpbroadcastd 0x754ab(%rip), %ymm15 # 0x5c7b70
vpsubd %ymm0, %ymm15, %ymm0
vpcmpgtd 0x7916f(%rip), %ymm1, %ymm15 # 0x5cb840
vpbroadcastd 0x7b082(%rip), %ymm8 # 0x5cd75c
vpand %ymm8, %ymm15, %ymm8
vblendvps %ymm3, %ymm8, %ymm0, %ymm0
vpcmpgtd %ymm2, %ymm10, %ymm2
vpcmpgtd %ymm14, %ymm13, %ymm3
vbroadcastss 0x793e9(%rip), %ymm8 # 0x5cbae0
vbroadcastss 0x7b04c(%rip), %ymm10 # 0x5cd74c
vblendvps %ymm2, %ymm8, %ymm10, %ymm2
vbroadcastss 0x7b041(%rip), %ymm8 # 0x5cd750
vbroadcastss 0x7b03c(%rip), %ymm10 # 0x5cd754
vblendvps %ymm3, %ymm8, %ymm10, %ymm3
vorps %ymm2, %ymm3, %ymm2
vorps %ymm0, %ymm2, %ymm13
movq 0x78(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq (%rdx), %rdx
vextractf128 $0x1, %ymm13, %xmm14
cmpq %rax, %rsi
jae 0x552750
movq 0x70(%rsp), %rdi
leaq (%rdx,%rdi), %rbx
movq %rcx, %rdi
vpextrb $0xc, %xmm14, (%rsi,%rbx)
cmpq %r13, %rdi
setge %bl
leaq -0x1(%rsi), %rdi
cmpq %rax, %rdi
setae %dil
orb %bl, %dil
jne 0x552778
movq 0xd8(%rsp), %rdi
addq %rdx, %rdi
vpextrb $0x8, %xmm14, (%rsi,%rdi)
cmpq %r13, %r9
vmovaps 0x1c0(%rsp), %ymm15
jge 0x5527b3
leaq -0x2(%rsi), %rdi
cmpq $0x2, %rsi
setae %bl
cmpq %rax, %rdi
setl %dil
andb %bl, %dil
cmpb $0x1, %dil
jne 0x5527b3
movq 0xc8(%rsp), %rdi
addq %rdx, %rdi
vpextrb $0x4, %xmm14, (%rsi,%rdi)
cmpq %r13, 0x40(%rsp)
jge 0x5527e4
leaq -0x3(%rsi), %rdi
cmpq $0x3, %rsi
setae %bl
cmpq %rax, %rdi
setl %dil
andb %bl, %dil
cmpb $0x1, %dil
jne 0x5527e4
movq 0x68(%rsp), %rdi
addq %rdx, %rdi
vpextrb $0x0, %xmm14, (%rsi,%rdi)
cmpq %r13, %r10
jge 0x552816
leaq -0x4(%rsi), %rdi
cmpq $0x4, %rsi
setae %bl
cmpq %rax, %rdi
setl %dil
andb %bl, %dil
cmpb $0x1, %dil
jne 0x552816
movq 0xc0(%rsp), %rdi
addq %rdx, %rdi
vpextrb $0xc, %xmm13, (%rsi,%rdi)
cmpq %r13, %r15
vmovdqa %ymm9, %ymm14
jge 0x55284d
leaq -0x5(%rsi), %rdi
cmpq $0x5, %rsi
setae %bl
cmpq %rax, %rdi
setl %dil
andb %bl, %dil
cmpb $0x1, %dil
jne 0x55284d
movq 0xb8(%rsp), %rdi
addq %rdx, %rdi
vpextrb $0x8, %xmm13, (%rsi,%rdi)
cmpq %r13, %r11
vmovaps 0x140(%rsp), %ymm9
jge 0x552888
leaq -0x6(%rsi), %rdi
cmpq $0x6, %rsi
setae %bl
cmpq %rax, %rdi
setl %dil
andb %bl, %dil
cmpb $0x1, %dil
jne 0x552888
movq 0xb0(%rsp), %rdi
addq %rdx, %rdi
vpextrb $0x4, %xmm13, (%rsi,%rdi)
cmpq %r13, %r12
setge %dil
cmpq $0x7, %rsi
setb %bl
orb %dil, %bl
jne 0x5528aa
addq 0xd0(%rsp), %rdx
vpextrb $0x0, %xmm13, (%rsi,%rdx)
vmovdqa 0x280(%rsp), %ymm0
vpcmpgtd %ymm11, %ymm0, %ymm0
vpand 0x2e0(%rsp), %ymm0, %ymm0
vpsrad $0x1f, %ymm11, %ymm2
vpandn %ymm0, %ymm2, %ymm0
vextracti128 $0x1, %ymm0, %xmm2
vpackssdw %xmm2, %xmm0, %xmm2
vpcmpeqd %ymm1, %ymm14, %ymm3
vpcmpgtd %ymm14, %ymm1, %ymm8
vpand %ymm0, %ymm8, %ymm10
vblendvps %ymm10, %ymm12, %ymm14, %ymm14
vextracti128 $0x1, %ymm10, %xmm12
vpackssdw %xmm12, %xmm10, %xmm10
vmovdqa 0x80(%rsp), %ymm13
vpcmpgtd %ymm11, %ymm13, %ymm12
vpand %ymm3, %ymm12, %ymm3
vextracti128 $0x1, %ymm3, %xmm12
vpackssdw %xmm12, %xmm3, %xmm12
vpblendvb %xmm12, %xmm2, %xmm10, %xmm2
vblendvps %ymm7, %ymm15, %ymm6, %ymm6
vpmovsxwd %xmm2, %ymm2
vblendvps %ymm2, 0x120(%rsp), %ymm9, %ymm9
vpor %ymm3, %ymm8, %ymm2
vpand %ymm2, %ymm0, %ymm0
vblendvps %ymm0, %ymm11, %ymm13, %ymm13
movq 0x38(%rsp), %rbx
vmovd %xmm1, (%rbx,%rsi,4)
movq 0x18(%rsp), %rdx
vmovd %xmm4, (%rdx,%rsi,4)
vpsubd 0x7912a(%rip), %ymm11, %ymm11 # 0x5cba80
incq %rsi
vmovdqa %ymm5, %ymm7
movq %rcx, %rdi
jmp 0x552531
vpbroadcastd 0x79172(%rip), %ymm0 # 0x5cbae0
vmovdqa 0x120(%rsp), %ymm1
vpaddd %ymm0, %ymm1, %ymm1
vmovdqa %ymm1, 0x120(%rsp)
movq 0xa8(%rsp), %r10
addq $0x8, %r10
movq 0xa0(%rsp), %rcx
addq %rcx, 0x68(%rsp)
addq %rcx, 0x70(%rsp)
movq 0x10(%rbp), %r8
movl 0x14(%rsp), %r9d
jmp 0x55227f
vmovdqa %ymm14, 0x200(%rsp)
vmovaps %ymm13, 0x160(%rsp)
vmovdqa %ymm9, 0x1e0(%rsp)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
movq 0x78(%rsp), %rbx
cmpl $0x8, %ecx
je 0x552a2d
movl 0x200(%rsp,%rcx,4), %esi
cmpl %r9d, %esi
jle 0x5529f7
movl 0x1e0(%rsp,%rcx,4), %eax
movl 0x160(%rsp,%rcx,4), %edi
jmp 0x552a23
jne 0x552a1e
movl 0x160(%rsp,%rcx,4), %edi
cmpl %edx, %edi
jge 0x552a10
movl 0x1e0(%rsp,%rcx,4), %eax
movl %r9d, %esi
jmp 0x552a23
jne 0x552a1e
movl 0x1e0(%rsp,%rcx,4), %esi
cmpl %eax, %esi
cmovll %esi, %eax
movl %r9d, %esi
movl %edx, %edi
incq %rcx
movl %esi, %r9d
movl %edi, %edx
jmp 0x5529d6
vpcmpgtd 0x180(%rsp), %ymm15, %ymm0
vmovdqa 0x1a0(%rsp), %ymm1
vpcmpgtd 0x220(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestps %ymm0, %ymm0
je 0x552a5e
orb $0x40, 0xc(%rbx)
xorl %r9d, %r9d
xorl %edx, %edx
xorl %eax, %eax
movl %r9d, (%rbx)
movl %eax, 0x4(%rbx)
movl %edx, 0x8(%rbx)
movq 0x18(%rsp), %rdi
vzeroupper
callq 0x1ab763
movq 0x38(%rsp), %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x552c21
movq 0x28(%rsp), %rdi
callq 0x1ab763
jmp 0x552c21
leal 0x7(%r15), %eax
movslq %eax, %r12
pushq $0x20
popq %rdi
movq %r12, %rsi
callq 0x1ab783
movq %rax, 0x28(%rsp)
testq %rax, %rax
movl 0x14(%rsp), %r9d
je 0x55209d
movl %r15d, %eax
sarl $0x1f, %eax
andnl %r15d, %eax, %eax
xorl %ecx, %ecx
movq 0x10(%rbp), %r8
vmovdqa 0x1c0(%rsp), %ymm15
movq 0x80(%rsp), %r10
movq 0x48(%rsp), %rdi
cmpq %rcx, %rax
je 0x552b7c
movq 0x10(%r8), %rdx
movzbl (%rdi,%rcx), %esi
movl (%rdx,%rsi,4), %edx
movq 0x28(%rsp), %rsi
movl %edx, (%rsi,%rcx,4)
incq %rcx
jmp 0x552aef
movq 0x1e84c1(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x744ca(%rip), %rsi     # 0x5c6feb
leaq 0x44b23(%rip), %rdx     # 0x59764b
leaq 0x74bce(%rip), %rcx     # 0x5c76fd
jmp 0x552c18
movq 0x1e849d(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x74bbc(%rip), %rsi     # 0x5c7701
leaq 0x44aff(%rip), %rdx     # 0x59764b
leaq 0x74bc2(%rip), %rcx     # 0x5c7715
jmp 0x552c18
movq 0x1e8479(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x74bb2(%rip), %rsi     # 0x5c771b
leaq 0x44adb(%rip), %rdx     # 0x59764b
leaq 0x74bb9(%rip), %rcx     # 0x5c7730
jmp 0x552c18
movq %r13, %rax
movq 0x28(%rsp), %rcx
cmpq %r12, %rax
jge 0x5520df
andl $0x0, (%rcx,%rax,4)
incq %rax
jmp 0x552b84
movq 0x1e843b(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x74b74(%rip), %rsi     # 0x5c771b
leaq 0x44a9d(%rip), %rdx     # 0x59764b
leaq 0x74b80(%rip), %rcx     # 0x5c7735
jmp 0x552c18
movq 0x1e841a(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x74423(%rip), %rsi     # 0x5c6feb
leaq 0x44a7c(%rip), %rdx     # 0x59764b
leaq 0x74d6c(%rip), %rcx     # 0x5c7942
jmp 0x552c18
movq 0x1e83f9(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x74402(%rip), %rsi     # 0x5c6feb
leaq 0x44a5b(%rip), %rdx     # 0x59764b
leaq 0x74b42(%rip), %rcx     # 0x5c7739
jmp 0x552c18
movq 0x1e83d8(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x74af7(%rip), %rsi     # 0x5c7701
leaq 0x44a3a(%rip), %rdx     # 0x59764b
leaq 0x74b25(%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
nop