// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sw_trace_striped_avx2_256_8.c
// Function: parasail_sw_trace_striped_profile_avx2_256_8
parasail_result_t* PNAME(
        const parasail_profile_t * const restrict profile,
        const char * const restrict s2, const int s2Len,
        const int open, const int gap)
{
    /* declare local variables */
    int32_t i = 0;
    int32_t j = 0;
    int32_t k = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    int32_t s1Len = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
    __m256i* restrict vProfile = NULL;
    __m256i* restrict pvHStore = NULL;
    __m256i* restrict pvHLoad = NULL;
    __m256i* restrict pvE = NULL;
    __m256i* restrict pvEaStore = NULL;
    __m256i* restrict pvEaLoad = NULL;
    __m256i* restrict pvHT = NULL;
    __m256i* restrict pvHMax = NULL;
    __m256i vGapO;
    __m256i vGapE;
    __m256i vZero;
    int8_t score = 0;
    __m256i vMaxH;
    __m256i vMaxHUnit;
    int8_t maxp = 0;
    parasail_result_t *result = NULL;
    __m256i vTZero;
    __m256i vTIns;
    __m256i vTDel;
    __m256i vTDiag;
    __m256i vTDiagE;
    __m256i vTInsE;
    __m256i vTDiagF;
    __m256i vTDelF;
    __m256i vTMask;
    __m256i vFTMask;

    /* validate inputs */
    PARASAIL_CHECK_NULL(profile);
    PARASAIL_CHECK_NULL(profile->profile8.score);
    PARASAIL_CHECK_NULL(profile->matrix);
    PARASAIL_CHECK_GT0(profile->s1Len);
    PARASAIL_CHECK_NULL(s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);

    /* initialize stack variables */
    i = 0;
    j = 0;
    k = 0;
    end_query = 0;
    end_ref = 0;
    s1Len = profile->s1Len;
    matrix = profile->matrix;
    segWidth = 32; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    vProfile = (__m256i*)profile->profile8.score;
    vGapO = _mm256_set1_epi8(open);
    vGapE = _mm256_set1_epi8(gap);
    vZero = _mm256_setzero_si256();
    score = NEG_INF;
    vMaxH = vZero;
    vMaxHUnit = vZero;
    maxp = INT8_MAX - (int8_t)(matrix->max+1);
    vTZero = _mm256_set1_epi8(PARASAIL_ZERO);
    vTIns  = _mm256_set1_epi8(PARASAIL_INS);
    vTDel  = _mm256_set1_epi8(PARASAIL_DEL);
    vTDiag = _mm256_set1_epi8(PARASAIL_DIAG);
    vTDiagE= _mm256_set1_epi8(PARASAIL_DIAG_E);
    vTInsE = _mm256_set1_epi8(PARASAIL_INS_E);
    vTDiagF= _mm256_set1_epi8(PARASAIL_DIAG_F);
    vTDelF = _mm256_set1_epi8(PARASAIL_DEL_F);
    vTMask = _mm256_set1_epi8(PARASAIL_ZERO_MASK);
    vFTMask= _mm256_set1_epi8(PARASAIL_F_MASK);

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

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_8 | PARASAIL_FLAG_LANES_32;

    /* initialize heap variables */
    pvHStore = parasail_memalign___m256i(32, segLen);
    pvHLoad =  parasail_memalign___m256i(32, segLen);
    pvE = parasail_memalign___m256i(32, segLen);
    pvEaStore = parasail_memalign___m256i(32, segLen);
    pvEaLoad = parasail_memalign___m256i(32, segLen);
    pvHT = parasail_memalign___m256i(32, segLen);
    pvHMax = parasail_memalign___m256i(32, segLen);

    /* validate heap variables */
    if (!pvHStore) return NULL;
    if (!pvHLoad) return NULL;
    if (!pvE) return NULL;
    if (!pvEaStore) return NULL;
    if (!pvEaLoad) return NULL;
    if (!pvHT) return NULL;
    if (!pvHMax) return NULL;

    /* initialize H and E */
    parasail_memset___m256i(pvHStore, vZero, segLen);
    parasail_memset___m256i(pvE, _mm256_set1_epi8(-open), segLen);
    parasail_memset___m256i(pvEaStore, _mm256_set1_epi8(-open), segLen);

    for (i=0; i<segLen; ++i) {
        arr_store(result->trace->trace_table, vTDiagE, i, segLen, 0);
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m256i vEF_opn;
        __m256i vE;
        __m256i vE_ext;
        __m256i vF;
        __m256i vF_ext;
        __m256i vFa;
        __m256i vFa_ext;
        __m256i vH;
        __m256i vH_dag;
        const __m256i* vP = NULL;

        /* Initialize F value to 0.  Any errors to vH values will be
         * corrected in the Lazy_F loop. */
        vF = _mm256_subs_epi8(vZero,vGapO);

        /* load final segment of pvHStore and shift left by 1 bytes */
        vH = _mm256_load_si256(&pvHStore[segLen - 1]);
        vH = _mm256_slli_si256_rpl(vH, 1);

        /* Correct part of the vProfile */
        vP = vProfile + matrix->mapper[(unsigned char)s2[j]] * segLen;

        if (end_ref == j-2) {
            /* Swap in the max buffer. */
            SWAP3(pvHMax,  pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }
        else {
            /* Swap the 2 H buffers. */
            SWAP(pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }

        /* inner loop to process the query sequence */
        for (i=0; i<segLen; ++i) {
            vE = _mm256_load_si256(pvE + i);

            /* Get max from vH, vE and vF. */
            vH_dag = _mm256_adds_epi8(vH, _mm256_load_si256(vP + i));
            vH_dag = _mm256_max_epi8(vH_dag, vZero);
            vH = _mm256_max_epi8(vH_dag, vE);
            vH = _mm256_max_epi8(vH, vF);
            /* Save vH values. */
            _mm256_store_si256(pvHStore + i, vH);

            {
                __m256i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                __m256i cond_zero = _mm256_cmpeq_epi8(vH, vZero);
                __m256i case1 = _mm256_cmpeq_epi8(vH, vH_dag);
                __m256i case2 = _mm256_cmpeq_epi8(vH, vF);
                __m256i vT = _mm256_blendv_epi8(
                        _mm256_blendv_epi8(vTIns, vTDel, case2),
                        _mm256_blendv_epi8(vTDiag, vTZero, cond_zero),
                        case1);
                _mm256_store_si256(pvHT + i, vT);
                vT = _mm256_or_si256(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i, segLen, j);
            }
            vMaxH = _mm256_max_epi8(vH, vMaxH);
            vEF_opn = _mm256_subs_epi8(vH, vGapO);

            /* Update vE value. */
            vE_ext = _mm256_subs_epi8(vE, vGapE);
            vE = _mm256_max_epi8(vEF_opn, vE_ext);
            _mm256_store_si256(pvE + i, vE);
            {
                __m256i vEa = _mm256_load_si256(pvEaLoad + i);
                __m256i vEa_ext = _mm256_subs_epi8(vEa, vGapE);
                vEa = _mm256_max_epi8(vEF_opn, vEa_ext);
                _mm256_store_si256(pvEaStore + i, vEa);
                if (j+1<s2Len) {
                    __m256i cond = _mm256_cmpgt_epi8(vEF_opn, vEa_ext);
                    __m256i vT = _mm256_blendv_epi8(vTInsE, vTDiagE, cond);
                    arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                }
            }

            /* Update vF value. */
            vF_ext = _mm256_subs_epi8(vF, vGapE);
            vF = _mm256_max_epi8(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m256i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m256i cond = _mm256_cmpgt_epi8(vEF_opn, vF_ext);
                __m256i vT = _mm256_blendv_epi8(vTDelF, vTDiagF, cond);
                vT = _mm256_or_si256(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i+1, segLen, j);
            }

            /* Load the next vH. */
            vH = _mm256_load_si256(pvHLoad + i);
        }

        /* Lazy_F loop: has been revised to disallow adjecent insertion and
         * then deletion, so don't update E(i, i), learn from SWPS3 */
        vFa_ext = vF_ext;
        vFa = vF;
        for (k=0; k<segWidth; ++k) {
            __m256i vHp = _mm256_load_si256(&pvHLoad[segLen - 1]);
            vHp = _mm256_slli_si256_rpl(vHp, 1);
            vEF_opn = _mm256_slli_si256_rpl(vEF_opn, 1);
            vEF_opn = _mm256_insert_epi8_rpl(vEF_opn, -open, 0);
            vF_ext = _mm256_slli_si256_rpl(vF_ext, 1);
            vF_ext = _mm256_insert_epi8_rpl(vF_ext, NEG_INF, 0);
            vF = _mm256_slli_si256_rpl(vF, 1);
            vF = _mm256_insert_epi8_rpl(vF, -open, 0);
            vFa_ext = _mm256_slli_si256_rpl(vFa_ext, 1);
            vFa_ext = _mm256_insert_epi8_rpl(vFa_ext, NEG_INF, 0);
            vFa = _mm256_slli_si256_rpl(vFa, 1);
            vFa = _mm256_insert_epi8_rpl(vFa, -open, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm256_load_si256(pvHStore + i);
                vH = _mm256_max_epi8(vH,vF);
                _mm256_store_si256(pvHStore + i, vH);
                {
                    __m256i vTAll;
                    __m256i vT;
                    __m256i case1;
                    __m256i case2;
                    __m256i cond;
                    vHp = _mm256_adds_epi8(vHp, _mm256_load_si256(vP + i));
                    vHp = _mm256_max_epi8(vHp, vZero);
                    case1 = _mm256_cmpeq_epi8(vH, vHp);
                    case2 = _mm256_cmpeq_epi8(vH, vF);
                    cond = _mm256_andnot_si256(case1,case2);
                    vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    vT = _mm256_load_si256(pvHT + i);
                    vT = _mm256_blendv_epi8(vT, vTDel, cond);
                    _mm256_store_si256(pvHT + i, vT);
                    vTAll = _mm256_and_si256(vTAll, vTMask);
                    vTAll = _mm256_or_si256(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vMaxH = _mm256_max_epi8(vH, vMaxH);
                /* Update vF value. */
                {
                    __m256i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m256i cond = _mm256_cmpgt_epi8(vEF_opn, vFa_ext);
                    __m256i vT = _mm256_blendv_epi8(vTDelF, vTDiagF, cond);
                    vTAll = _mm256_and_si256(vTAll, vFTMask);
                    vTAll = _mm256_or_si256(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vEF_opn = _mm256_subs_epi8(vH, vGapO);
                vF_ext = _mm256_subs_epi8(vF, vGapE);
                {
                    __m256i vEa = _mm256_load_si256(pvEaLoad + i);
                    __m256i vEa_ext = _mm256_subs_epi8(vEa, vGapE);
                    vEa = _mm256_max_epi8(vEF_opn, vEa_ext);
                    _mm256_store_si256(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m256i cond = _mm256_cmpgt_epi8(vEF_opn, vEa_ext);
                        __m256i vT = _mm256_blendv_epi8(vTInsE, vTDiagE, cond);
                        arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                    }
                }
                if (! _mm256_movemask_epi8(
                            _mm256_or_si256(
                                _mm256_cmpgt_epi8(vF_ext, vEF_opn),
                                _mm256_cmpeq_epi8(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm256_max_epi8(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm256_subs_epi8(vFa, vGapE);
                vFa = _mm256_max_epi8(vEF_opn, vFa_ext);
                vHp = _mm256_load_si256(pvHLoad + i);
            }
        }
end:
        {
        }

        {
            __m256i vCompare = _mm256_cmpgt_epi8(vMaxH, vMaxHUnit);
            if (_mm256_movemask_epi8(vCompare)) {
                score = _mm256_hmax_epi8_rpl(vMaxH);
                /* if score has potential to overflow, abort early */
                if (score > maxp) {
                    result->flag |= PARASAIL_FLAG_SATURATED;
                    break;
                }
                vMaxHUnit = _mm256_set1_epi8(score);
                end_ref = j;
            }
        }

        /*if (score == stop) break;*/
    }

    if (score == INT8_MAX) {
        result->flag |= PARASAIL_FLAG_SATURATED;
    }

    if (parasail_result_is_saturated(result)) {
        score = 0;
        end_query = 0;
        end_ref = 0;
    }
    else {
        if (end_ref == j-1) {
            /* end_ref was the last store column */
            SWAP(pvHMax,  pvHStore)
        }
        else if (end_ref == j-2) {
            /* end_ref was the last load column */
            SWAP(pvHMax,  pvHLoad)
        }
        /* Trace the alignment ending position on read. */
        {
            int8_t *t = (int8_t*)pvHMax;
            int32_t column_len = segLen * segWidth;
            end_query = s1Len - 1;
            for (i = 0; i<column_len; ++i, ++t) {
                if (*t == score) {
                    int32_t temp = i / segWidth + i % segWidth * segLen;
                    if (temp < end_query) {
                        end_query = temp;
                    }
                }
            }
        }
    }

    result->score = score;
    result->end_query = end_query;
    result->end_ref = end_ref;

    parasail_free(pvHMax);
    parasail_free(pvHT);
    parasail_free(pvEaLoad);
    parasail_free(pvEaStore);
    parasail_free(pvE);
    parasail_free(pvHLoad);
    parasail_free(pvHStore);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %ecx, 0x4(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x70(%rsp)
testq %rdi, %rdi
je 0x5670a0
movq 0x18(%rdi), %rax
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0x5670c4
movq 0x10(%rdi), %rax
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x5670e8
movl 0x8(%rdi), %r14d
testl %r14d, %r14d
jle 0x56710c
cmpq $0x0, 0x70(%rsp)
je 0x567130
cmpl $0x0, 0x28(%rsp)
jle 0x567151
cmpl $0x0, 0x4(%rsp)
js 0x567172
movl %r8d, %r15d
testl %r8d, %r8d
js 0x567193
leaq 0x1f(%r14), %r12
shrq $0x5, %r12
movq 0x68(%rsp), %rax
movl 0x1c(%rax), %ebp
pushq $0x20
popq %rcx
movl %r12d, %edi
movq 0x28(%rsp), %rsi
movq %rcx, %rdx
callq 0x1abb59
testq %rax, %rax
je 0x5671b9
movq %rax, %rbx
movl %r15d, 0x40(%rsp)
movl %ebp, 0x18(%rsp)
movq %r14, 0x78(%rsp)
orl $0x20180804, 0xc(%rax)  # imm = 0x20180804
pushq $0x20
popq %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x496aa4
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x496aa4
movq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0x496aa4
movq %rax, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x496aa4
movq %rax, %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x496aa4
movq %r12, %rsi
movq %r12, 0x8(%rsp)
movq %rax, %r12
movq %r15, %rdi
callq 0x496aa4
movq %rax, %r15
pushq $0x20
popq %rdi
movq 0x8(%rsp), %rsi
callq 0x496aa4
movq %rax, 0x20(%rsp)
xorl %eax, %eax
testq %r13, %r13
je 0x5671bb
testq %r14, %r14
je 0x5671bb
cmpq $0x0, 0x30(%rsp)
je 0x5671bb
testq %rbp, %rbp
je 0x5671bb
testq %r12, %r12
je 0x5671bb
testq %r15, %r15
je 0x5671bb
cmpq $0x0, 0x20(%rsp)
je 0x5671bb
vmovd 0x4(%rsp), %xmm0
vpbroadcastb %xmm0, %ymm0
vmovdqu %ymm0, 0xc0(%rsp)
vmovd 0x40(%rsp), %xmm0
vpbroadcastb %xmm0, %ymm0
vmovdqu %ymm0, 0xa0(%rsp)
vpxor %xmm0, %xmm0, %xmm0
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq 0x496aad
movl 0x4(%rsp), %eax
negb %al
movl %eax, 0x4(%rsp)
vmovd %eax, %xmm0
vpbroadcastb %xmm0, %ymm0
vmovdqu %ymm0, 0x40(%rsp)
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x496aad
movq %rbp, %rdi
vmovups 0x40(%rsp), %ymm0
movq 0x8(%rsp), %rsi
callq 0x496aad
movq 0x8(%rsp), %rdx
movq %rdx, %rdi
shlq $0x5, %rdi
xorl %eax, %eax
vpbroadcastq 0x6708c(%rip), %ymm0 # 0x5cdb18
cmpq %rax, %rdi
je 0x566aa3
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
vmovdqa %ymm0, (%rcx,%rax)
addq $0x20, %rax
jmp 0x566a8c
vpxor %xmm0, %xmm0, %xmm0
vmovdqu 0xc0(%rsp), %ymm12
vpsubsb %ymm12, %ymm0, %ymm1
leal -0x1(%rdx), %ecx
movb $0x7e, %al
subb 0x18(%rsp), %al
movsbl %al, %eax
movl %eax, 0x3c(%rsp)
movl 0x28(%rsp), %eax
movq %rax, 0x88(%rsp)
xorl %r9d, %r9d
movb $-0x80, %al
movl %eax, 0x14(%rsp)
shlq $0x5, %rcx
movq %rcx, 0x80(%rsp)
vpxor %xmm3, %xmm3, %xmm3
vpxor %xmm2, %xmm2, %xmm2
movl $0x0, (%rsp)
vmovdqu 0xa0(%rsp), %ymm13
leaq 0x1(%r9), %rax
imulq %rdi, %rax
movq %rax, 0x18(%rsp)
movq %rdi, %rdx
imulq %r9, %rdx
movq %r12, %rax
movq %r14, 0x40(%rsp)
movq %r13, %r14
movq %rbp, %r12
movq %rax, %rbp
cmpq 0x88(%rsp), %r9
je 0x566f8f
movq 0x80(%rsp), %rax
leaq (%r14,%rax), %rcx
movq %rcx, 0x98(%rsp)
vmovdqa (%r14,%rax), %ymm6
vperm2i128 $0x28, %ymm6, %ymm6, %ymm7 # ymm7 = zero,zero,ymm6[0,1]
vpalignr $0xf, %ymm7, %ymm6, %ymm7 # ymm7 = ymm7[15],ymm6[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm7[31],ymm6[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x70(%rsp), %rcx
movzbl (%rcx,%r9), %ecx
movl (%rax,%rcx,4), %eax
imull 0x8(%rsp), %eax
movslq %eax, %rsi
shlq $0x5, %rsi
addq 0x90(%rsp), %rsi
leal -0x2(%r9), %r8d
cmpl %r8d, (%rsp)
movq 0x40(%rsp), %r13
cmoveq 0x20(%rsp), %r13
movq %r9, 0x60(%rsp)
incq %r9
pushq $0x1
popq %rax
xorl %ecx, %ecx
vmovdqa %ymm1, %ymm6
cmpq %rcx, %rdi
je 0x566ce4
vpaddsb (%rsi,%rcx), %ymm7, %ymm4
movq 0x30(%rsp), %r10
vmovdqa (%r10,%rcx), %ymm5
vpmaxsb %ymm0, %ymm4, %ymm4
vpmaxsb %ymm5, %ymm4, %ymm8
vpmaxsb %ymm6, %ymm8, %ymm7
vmovdqa %ymm7, (%r13,%rcx)
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq %rdx, %r11
vpbroadcastb 0x66fb3(%rip), %ymm9 # 0x5cdb9a
vpcmpeqb %ymm4, %ymm7, %ymm4
vpcmpgtb %ymm6, %ymm8, %ymm8
vpaddb %ymm9, %ymm8, %ymm8
vpcmpgtb %ymm0, %ymm7, %ymm9
vpbroadcastb 0x66f9a(%rip), %ymm10 # 0x5cdb9b
vpand %ymm10, %ymm9, %ymm9
vpblendvb %ymm4, %ymm9, %ymm8, %ymm4
vpor (%rcx,%r11), %ymm4, %ymm8
vmovdqa %ymm4, (%r15,%rcx)
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq %rdx, %r11
vmovdqa %ymm8, (%rcx,%r11)
vpsubsb %ymm12, %ymm7, %ymm4
vpsubsb %ymm13, %ymm5, %ymm5
vpmaxsb %ymm5, %ymm4, %ymm5
vmovdqa %ymm5, (%r10,%rcx)
vmovdqa (%r12,%rcx), %ymm5
vpsubsb %ymm13, %ymm5, %ymm5
vpmaxsb %ymm5, %ymm4, %ymm8
vmovdqa %ymm8, (%rbp,%rcx)
cmpl 0x28(%rsp), %r9d
jge 0x566c88
vpbroadcastb 0x66f39(%rip), %ymm8 # 0x5cdb9c
vpbroadcastb 0x66f31(%rip), %ymm9 # 0x5cdb9d
vpcmpgtb %ymm5, %ymm4, %ymm5
vpblendvb %ymm5, %ymm8, %ymm9, %ymm5
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq 0x18(%rsp), %r11
vmovdqa %ymm5, (%rcx,%r11)
vpsubsb %ymm13, %ymm6, %ymm5
cmpq 0x8(%rsp), %rax
jae 0x566cc8
movq 0x10(%rbx), %r11
vpbroadcastb 0x66efd(%rip), %ymm6 # 0x5cdb9e
movq (%r11), %r11
vpbroadcastb 0x66ef2(%rip), %ymm8 # 0x5cdb9f
addq %rdx, %r11
vpcmpgtb %ymm5, %ymm4, %ymm9
vpblendvb %ymm9, %ymm6, %ymm8, %ymm6
vpor 0x20(%rcx,%r11), %ymm6, %ymm6
vmovdqa %ymm6, 0x20(%rcx,%r11)
vpmaxsb %ymm2, %ymm7, %ymm2
vpmaxsb %ymm5, %ymm4, %ymm6
vmovdqa (%r14,%rcx), %ymm7
addq $0x20, %rcx
incq %rax
jmp 0x566ba5
cmpl %r8d, (%rsp)
movq 0x20(%rsp), %rax
cmoveq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
vmovdqa %ymm5, %ymm8
vmovdqa %ymm6, %ymm7
cmpl $0x20, %eax
je 0x566efa
movl %eax, 0x40(%rsp)
movq 0x98(%rsp), %rax
vmovdqa (%rax), %ymm9
vperm2i128 $0x28, %ymm9, %ymm9, %ymm10 # ymm10 = zero,zero,ymm9[0,1]
vpalignr $0xf, %ymm10, %ymm9, %ymm9 # ymm9 = ymm10[15],ymm9[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm10[31],ymm9[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vinserti128 $0x1, %xmm4, %ymm0, %ymm10
vpalignr $0xf, %ymm10, %ymm4, %ymm4 # ymm4 = ymm10[15],ymm4[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm10[31],ymm4[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
movl 0x4(%rsp), %eax
vpinsrb $0x0, %eax, %xmm4, %xmm10
vpblendd $0xf, %ymm10, %ymm4, %ymm4 # ymm4 = ymm10[0,1,2,3],ymm4[4,5,6,7]
vinserti128 $0x1, %xmm8, %ymm0, %ymm10
vpalignr $0xf, %ymm10, %ymm8, %ymm8 # ymm8 = ymm10[15],ymm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm10[31],ymm8[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
movl $0x80, %ecx
vpinsrb $0x0, %ecx, %xmm8, %xmm10
vpblendd $0xf, %ymm10, %ymm8, %ymm8 # ymm8 = ymm10[0,1,2,3],ymm8[4,5,6,7]
vinserti128 $0x1, %xmm7, %ymm0, %ymm10
vpalignr $0xf, %ymm10, %ymm7, %ymm7 # ymm7 = ymm10[15],ymm7[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm10[31],ymm7[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpinsrb $0x0, %eax, %xmm7, %xmm10
vinserti128 $0x1, %xmm5, %ymm0, %ymm11
vpalignr $0xf, %ymm11, %ymm5, %ymm5 # ymm5 = ymm11[15],ymm5[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm11[31],ymm5[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpinsrb $0x0, %ecx, %xmm5, %xmm11
vpblendd $0xf, %ymm10, %ymm7, %ymm7 # ymm7 = ymm10[0,1,2,3],ymm7[4,5,6,7]
vpblendd $0xf, %ymm11, %ymm5, %ymm5 # ymm5 = ymm11[0,1,2,3],ymm5[4,5,6,7]
vinserti128 $0x1, %xmm6, %ymm0, %ymm10
vpalignr $0xf, %ymm10, %ymm6, %ymm6 # ymm6 = ymm10[15],ymm6[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm10[31],ymm6[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpinsrb $0x0, %eax, %xmm6, %xmm10
vpblendd $0xf, %ymm10, %ymm6, %ymm6 # ymm6 = ymm10[0,1,2,3],ymm6[4,5,6,7]
xorl %ecx, %ecx
movq %rdx, %rax
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %r8
subq $0x1, %r8
jb 0x566eef
vmovdqa (%r13,%rcx), %ymm10
vpmaxsb %ymm7, %ymm10, %ymm8
vmovdqa %ymm8, (%r13,%rcx)
vpaddsb (%rsi,%rcx), %ymm9, %ymm9
vpmaxsb %ymm0, %ymm9, %ymm9
vpcmpeqb %ymm9, %ymm8, %ymm9
vpcmpgtb %ymm7, %ymm10, %ymm10
vpor %ymm10, %ymm9, %ymm9
vpbroadcastb 0x66da5(%rip), %ymm10 # 0x5cdb9a
movq 0x10(%rbx), %r10
vpblendvb %ymm9, (%r15,%rcx), %ymm10, %ymm9
movq (%r10), %r10
vpbroadcastq 0x66d14(%rip), %ymm10 # 0x5cdb20
vpand (%r10,%rax), %ymm10, %ymm10
vmovdqa %ymm9, (%r15,%rcx)
vpor %ymm9, %ymm10, %ymm9
movq 0x10(%rbx), %r10
movq (%r10), %r10
vmovdqa %ymm9, (%r10,%rax)
vpbroadcastb 0x66d6b(%rip), %ymm9 # 0x5cdb9e
vpbroadcastb 0x66d63(%rip), %ymm10 # 0x5cdb9f
movq 0x10(%rbx), %r10
vpcmpgtb %ymm5, %ymm4, %ymm4
vpblendvb %ymm4, %ymm9, %ymm10, %ymm4
movq (%r10), %r10
vpbroadcastq 0x66cd2(%rip), %ymm5 # 0x5cdb28
vpand (%r10,%rax), %ymm5, %ymm5
vpor %ymm4, %ymm5, %ymm4
vmovdqa %ymm4, (%r10,%rax)
vpsubsb %ymm12, %ymm8, %ymm4
vmovdqa (%r12,%rcx), %ymm5
vpsubsb %ymm13, %ymm5, %ymm5
vpmaxsb %ymm5, %ymm4, %ymm9
vmovdqa %ymm9, (%rbp,%rcx)
cmpl 0x28(%rsp), %r9d
jge 0x566eb1
vpbroadcastb 0x66d0b(%rip), %ymm9 # 0x5cdb9c
vpbroadcastb 0x66d03(%rip), %ymm10 # 0x5cdb9d
vpcmpgtb %ymm5, %ymm4, %ymm5
vpblendvb %ymm5, %ymm9, %ymm10, %ymm5
movq 0x10(%rbx), %r10
movq (%r10), %r10
vmovdqa %ymm5, (%r10,%r11)
vpmaxsb %ymm2, %ymm8, %ymm2
vpsubsb %ymm13, %ymm7, %ymm8
vpcmpgtb %ymm8, %ymm4, %ymm5
vpmovmskb %ymm5, %r10d
cmpl $-0x1, %r10d
je 0x566efa
vpsubsb %ymm13, %ymm6, %ymm5
vpmaxsb %ymm5, %ymm4, %ymm6
vmovdqa (%r14,%rcx), %ymm9
addq $0x20, %r11
addq $0x20, %rax
addq $0x20, %rcx
vmovdqa %ymm8, %ymm7
jmp 0x566db7
movl 0x40(%rsp), %eax
incl %eax
jmp 0x566d02
vmovdqa %ymm8, %ymm5
vpcmpgtb %ymm3, %ymm2, %ymm6
vpmovmskb %ymm6, %ecx
addq %rdi, 0x18(%rsp)
addq %rdi, %rdx
movq %r12, %rax
movq %r14, 0x40(%rsp)
testl %ecx, %ecx
je 0x566b1a
vpermq $0x44, %ymm2, %ymm3     # ymm3 = ymm2[0,1,0,1]
vpmaxsb %ymm3, %ymm2, %ymm3
vpslldq $0x8, %ymm3, %ymm6      # ymm6 = zero,zero,zero,zero,zero,zero,zero,zero,ymm3[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm3[16,17,18,19,20,21,22,23]
vpmaxsb %ymm6, %ymm3, %ymm3
vpslldq $0x4, %ymm3, %ymm6      # ymm6 = zero,zero,zero,zero,ymm3[0,1,2,3,4,5,6,7,8,9,10,11],zero,zero,zero,zero,ymm3[16,17,18,19,20,21,22,23,24,25,26,27]
vpmaxsb %ymm6, %ymm3, %ymm3
vpslldq $0x2, %ymm3, %ymm6      # ymm6 = zero,zero,ymm3[0,1,2,3,4,5,6,7,8,9,10,11,12,13],zero,zero,ymm3[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpmaxsb %ymm6, %ymm3, %ymm3
vpslldq $0x1, %ymm3, %ymm6      # ymm6 = zero,ymm3[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],zero,ymm3[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpmaxsb %ymm6, %ymm3, %ymm3
vextracti128 $0x1, %ymm3, %xmm6
vpextrb $0xf, %xmm6, %eax
movl %eax, 0x14(%rsp)
movsbl %al, %eax
cmpl %eax, 0x3c(%rsp)
jl 0x5671cd
vpbroadcastb 0x66c29(%rip), %ymm6 # 0x5cdba0
vpshufb %ymm6, %ymm3, %ymm3
vpermq $0xaa, %ymm3, %ymm3     # ymm3 = ymm3[2,2,2,2]
movq 0x60(%rsp), %rax
movl %eax, (%rsp)
jmp 0x566afe
movq %rbp, 0x18(%rsp)
movq %r12, %rbp
movq %r14, %r13
cmpb $0x7f, 0x14(%rsp)
movq 0x78(%rsp), %r12
jne 0x566faa
orb $0x40, 0xc(%rbx)
movq %rbx, %rdi
vzeroupper
callq 0x1ace42
xorl %ecx, %ecx
testl %eax, %eax
je 0x566fcf
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %r14
xorl %eax, %eax
xorl %r12d, %r12d
jmp 0x567056
movq 0x28(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movl (%rsp), %edx
cmpl %ecx, %edx
movq 0x20(%rsp), %rcx
movq %rcx, %rdi
movq 0x40(%rsp), %rsi
cmoveq %rsi, %rdi
movq %rsi, %r14
cmoveq %rcx, %r14
cmpl %eax, %edx
cmoveq %r13, %rdi
cmoveq %rsi, %r14
decl %r12d
movq 0x8(%rsp), %r9
movl %r9d, %ecx
andl $0x3ffffff, %ecx        # imm = 0x3FFFFFF
shll $0x5, %ecx
xorl %edx, %edx
cmpl %edx, %ecx
je 0x567044
movl 0x14(%rsp), %esi
cmpb %sil, (%rdi,%rdx)
jne 0x56703f
movl %edx, %esi
shrl $0x5, %esi
movl %edx, %r8d
andl $0x1f, %r8d
imull %r9d, %r8d
addl %esi, %r8d
cmpl %r12d, %r8d
cmovll %r8d, %r12d
incq %rdx
jmp 0x567017
movl (%rsp), %ecx
cmpl %eax, %ecx
movl %ecx, %eax
cmoveq 0x20(%rsp), %r13
movsbl 0x14(%rsp), %ecx
movl %ecx, (%rbx)
movl %r12d, 0x4(%rbx)
movl %eax, 0x8(%rbx)
callq 0x1ab763
movq %r15, %rdi
callq 0x1ab763
movq 0x18(%rsp), %rdi
callq 0x1ab763
movq %rbp, %rdi
callq 0x1ab763
movq 0x30(%rsp), %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
movq %r13, %rdi
callq 0x1ab763
movq %rbx, %rax
jmp 0x5671bb
movq 0x1d3f31(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x5ff3a(%rip), %rsi     # 0x5c6feb
leaq 0x5b311(%rip), %rdx     # 0x5c23c9
leaq 0x3641e(%rip), %rcx     # 0x59d4dd
jmp 0x5671b2
movq 0x1d3f0d(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x5ff16(%rip), %rsi     # 0x5c6feb
leaq 0x5b2ed(%rip), %rdx     # 0x5c23c9
leaq 0x609cd(%rip), %rcx     # 0x5c7ab0
jmp 0x5671b2
movq 0x1d3ee9(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x5fef2(%rip), %rsi     # 0x5c6feb
leaq 0x5b2c9(%rip), %rdx     # 0x5c23c9
leaq 0x60832(%rip), %rcx     # 0x5c7939
jmp 0x5671b2
movq 0x1d3ec5(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x605e4(%rip), %rsi     # 0x5c7701
leaq 0x5b2a5(%rip), %rdx     # 0x5c23c9
leaq 0x6081e(%rip), %rcx     # 0x5c7949
jmp 0x5671b2
movq 0x1d3ea1(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x5feaa(%rip), %rsi     # 0x5c6feb
leaq 0x5b281(%rip), %rdx     # 0x5c23c9
leaq 0x605af(%rip), %rcx     # 0x5c76fe
jmp 0x5671b2
movq 0x1d3e80(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x6059f(%rip), %rsi     # 0x5c7701
leaq 0x5b260(%rip), %rdx     # 0x5c23c9
leaq 0x605a5(%rip), %rcx     # 0x5c7715
jmp 0x5671b2
movq 0x1d3e5f(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x60598(%rip), %rsi     # 0x5c771b
leaq 0x5b23f(%rip), %rdx     # 0x5c23c9
leaq 0x6059f(%rip), %rcx     # 0x5c7730
jmp 0x5671b2
movq 0x1d3e3e(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x60577(%rip), %rsi     # 0x5c771b
leaq 0x5b21e(%rip), %rdx     # 0x5c23c9
leaq 0x60583(%rip), %rcx     # 0x5c7735
xorl %eax, %eax
callq 0x19e180
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
orb $0x40, 0xc(%rbx)
movq 0x60(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r12, 0x18(%rsp)
movq %r14, 0x40(%rsp)
jmp 0x566f9a
nop