// File: /workspace/github_c_makefile_star2_O1/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 $0x138, %rsp            # imm = 0x138
movq %rsi, 0x50(%rsp)
testq %rdi, %rdi
je 0x594e14
movq 0x18(%rdi), %rax
movq %rax, 0xa8(%rsp)
testq %rax, %rax
je 0x594e1b
movq 0x10(%rdi), %rax
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0x594e22
movl 0x8(%rdi), %r14d
testl %r14d, %r14d
jle 0x594e29
cmpq $0x0, 0x50(%rsp)
je 0x594e30
movl %edx, %ebp
testl %edx, %edx
jle 0x594e37
testl %ecx, %ecx
js 0x594e3e
testl %r8d, %r8d
js 0x594e45
movl %r8d, 0x60(%rsp)
movl %ecx, 0xc(%rsp)
leaq 0x1f(%r14), %r15
movq %r15, %r12
shrq $0x5, %r12
movq 0x48(%rsp), %rax
movl 0x1c(%rax), %r13d
movl $0x20, %edx
movl $0x20, %ecx
movl %r12d, %edi
movl %ebp, %esi
callq 0x2097d1
testq %rax, %rax
je 0x594e4a
movq %rax, %rbx
movl %r13d, 0x10(%rsp)
movl %ebp, 0x4(%rsp)
movq %r15, 0x88(%rsp)
movq %r14, 0x90(%rsp)
orl $0x20180804, 0xc(%rax)  # imm = 0x20180804
movl $0x20, %edi
movq %r12, %rsi
callq 0x4c5e3c
movq %rax, %r15
movl $0x20, %edi
movq %r12, %rsi
callq 0x4c5e3c
movq %r12, %r13
movq %rax, %r12
movl $0x20, %edi
movq %r13, %rsi
callq 0x4c5e3c
movq %rax, 0x30(%rsp)
movl $0x20, %edi
movq %r13, %rsi
callq 0x4c5e3c
movq %rax, 0x18(%rsp)
movl $0x20, %edi
movq %r13, %rsi
callq 0x4c5e3c
movq %rax, %r14
movl $0x20, %edi
movq %r13, %rsi
callq 0x4c5e3c
movq %rax, %rbp
movl $0x20, %edi
movq %r13, 0x20(%rsp)
movq %r13, %rsi
callq 0x4c5e3c
movq %rax, %rcx
xorl %eax, %eax
testq %r15, %r15
je 0x594e9b
testq %r12, %r12
je 0x594e9b
cmpq $0x0, 0x30(%rsp)
je 0x594e9b
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
je 0x594e9b
testq %r14, %r14
je 0x594e9b
testq %rbp, %rbp
je 0x594e9b
testq %rcx, %rcx
je 0x594e9b
movq %rcx, 0x28(%rsp)
movl 0xc(%rsp), %r13d
vmovd %r13d, %xmm0
vpbroadcastb %xmm0, %ymm0
vmovdqu %ymm0, 0xd0(%rsp)
vmovd 0x60(%rsp), %xmm0
vpbroadcastb %xmm0, %ymm0
vmovdqu %ymm0, 0xb0(%rsp)
vpxor %xmm0, %xmm0, %xmm0
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x4c5e45
negb %r13b
movl %r13d, 0xc(%rsp)
vmovd %r13d, %xmm0
vpbroadcastb %xmm0, %ymm0
vmovdqu %ymm0, 0x60(%rsp)
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %r13
movq %r13, %rsi
callq 0x4c5e45
movq 0x18(%rsp), %rdi
vmovups 0x60(%rsp), %ymm0
movq %r13, %rsi
callq 0x4c5e45
movl %r13d, %eax
movq %rax, 0x58(%rsp)
movq %rax, %rdx
shlq $0x5, %rdx
xorl %eax, %eax
vpbroadcastq 0x66fbd(%rip), %ymm0 # 0x5fb7d0
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
vmovdqa %ymm0, (%rcx,%rax)
addq $0x20, %rax
cmpq %rax, %rdx
jne 0x594813
vpxor %xmm0, %xmm0, %xmm0
vpsubsb 0xd0(%rsp), %ymm0, %ymm1
vmovdqu %ymm1, 0x110(%rsp)
movq 0x20(%rsp), %rdi
leal -0x1(%rdi), %ecx
movb $0x7e, %al
subb 0x10(%rsp), %al
movsbl %al, %eax
movl %eax, 0x44(%rsp)
cmpl $0x1, %edi
adcl $0x0, %edi
movl 0x4(%rsp), %esi
cmpl $0x2, %esi
movl $0x1, %eax
cmovgel %esi, %eax
movq %rax, 0x38(%rsp)
movl %esi, %r8d
shlq $0x5, %rdi
movb $-0x80, %al
movl %eax, 0x8(%rsp)
xorl %r9d, %r9d
shlq $0x5, %rcx
movq %rcx, 0xa0(%rsp)
vpbroadcastb 0x66fc0(%rip), %ymm2 # 0x5fb852
vpbroadcastb 0x66fb8(%rip), %ymm3 # 0x5fb853
vpbroadcastq 0x66f34(%rip), %ymm4 # 0x5fb7d8
vpbroadcastb 0x66fa9(%rip), %ymm5 # 0x5fb856
vpbroadcastb 0x66fa1(%rip), %ymm6 # 0x5fb857
vpbroadcastq 0x66f21(%rip), %ymm7 # 0x5fb7e0
movq %rdx, 0x98(%rsp)
movq %rdx, 0x60(%rsp)
xorl %ecx, %ecx
xorl %r10d, %r10d
vpxor %xmm8, %xmm8, %xmm8
vpxor %xmm1, %xmm1, %xmm1
vmovdqu %ymm1, 0xf0(%rsp)
vmovdqu 0xb0(%rsp), %ymm1
movq 0x18(%rsp), %rdx
movl %r10d, 0x4(%rsp)
movq 0x28(%rsp), %r10
movq %r10, 0x10(%rsp)
movq %r14, %r13
movq %rdx, %r14
movq %r12, %rdx
movq %r15, %r12
movq 0xa0(%rsp), %r11
leaq (%r15,%r11), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x50(%rsp), %rsi
movzbl (%rsi,%rcx), %esi
movslq (%rax,%rsi,4), %rsi
movq 0x58(%rsp), %rax
imulq %rsi, %rax
shlq $0x5, %rax
addq 0xa8(%rsp), %rax
leal -0x2(%rcx), %esi
cmpl %esi, 0x4(%rsp)
cmoveq %rdx, %r10
movq %r10, 0x28(%rsp)
movq %rdx, %r15
cmoveq 0x10(%rsp), %r15
vmovdqa (%r12,%r11), %ymm10
vperm2i128 $0x28, %ymm10, %ymm10, %ymm11 # ymm11 = zero,zero,ymm10[0,1]
vpalignr $0xf, %ymm11, %ymm10, %ymm13 # ymm13 = ymm11[15],ymm10[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm11[31],ymm10[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
movq %rcx, 0x10(%rsp)
leaq 0x1(%rcx), %rsi
movl $0x1, %ecx
xorl %edx, %edx
vmovdqu 0x110(%rsp), %ymm10
movq 0x30(%rsp), %r11
vmovdqa (%r11,%rdx), %ymm12
vpaddsb (%rax,%rdx), %ymm13, %ymm11
vpmaxsb %ymm0, %ymm11, %ymm11
vpmaxsb %ymm12, %ymm11, %ymm14
vpmaxsb %ymm10, %ymm14, %ymm13
vmovdqa %ymm13, (%r15,%rdx)
movq 0x10(%rbx), %r10
movq (%r10), %r10
addq %r9, %r10
vpcmpeqb %ymm11, %ymm13, %ymm11
vpcmpgtb %ymm10, %ymm14, %ymm14
vpaddb %ymm2, %ymm14, %ymm14
vpcmpgtb %ymm0, %ymm13, %ymm15
vpand %ymm3, %ymm15, %ymm15
vpblendvb %ymm11, %ymm15, %ymm14, %ymm11
vpor (%rdx,%r10), %ymm11, %ymm14
vmovdqa %ymm11, (%rbp,%rdx)
movq 0x10(%rbx), %r10
movq (%r10), %r10
addq %r9, %r10
vmovdqa %ymm14, (%rdx,%r10)
vpsubsb 0xd0(%rsp), %ymm13, %ymm11
vpsubsb %ymm1, %ymm12, %ymm12
vpmaxsb %ymm12, %ymm11, %ymm12
vmovdqa %ymm12, (%r11,%rdx)
vmovdqa (%r14,%rdx), %ymm12
vpsubsb %ymm1, %ymm12, %ymm12
vpmaxsb %ymm12, %ymm11, %ymm14
vmovdqa %ymm14, (%r13,%rdx)
cmpq %r8, %rsi
jae 0x594a55
vpbroadcastb 0x66e25(%rip), %ymm14 # 0x5fb854
vpbroadcastb 0x66e1d(%rip), %ymm15 # 0x5fb855
vpcmpgtb %ymm12, %ymm11, %ymm12
vpblendvb %ymm12, %ymm14, %ymm15, %ymm12
movq 0x10(%rbx), %r10
movq (%r10), %r10
addq 0x60(%rsp), %r10
vmovdqa %ymm12, (%rdx,%r10)
vpsubsb %ymm1, %ymm10, %ymm12
cmpq 0x58(%rsp), %rcx
jae 0x594a83
movq 0x10(%rbx), %r10
movq (%r10), %r10
addq %r9, %r10
vpcmpgtb %ymm12, %ymm11, %ymm10
vpblendvb %ymm10, %ymm5, %ymm6, %ymm10
vpor 0x20(%rdx,%r10), %ymm10, %ymm10
vmovdqa %ymm10, 0x20(%rdx,%r10)
vpmaxsb %ymm8, %ymm13, %ymm8
vpmaxsb %ymm12, %ymm11, %ymm10
vmovdqa (%r12,%rdx), %ymm13
addq $0x20, %rdx
incq %rcx
cmpq %rdx, %rdi
jne 0x59498c
xorl %edx, %edx
vmovdqa %ymm10, %ymm13
movl 0xc(%rsp), %r11d
vinserti128 $0x1, %xmm13, %ymm0, %ymm14
vpalignr $0xf, %ymm14, %ymm13, %ymm13 # ymm13 = ymm14[15],ymm13[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm14[31],ymm13[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpinsrb $0x0, %r11d, %xmm13, %xmm14
vinserti128 $0x1, %xmm12, %ymm0, %ymm15
vpalignr $0xf, %ymm15, %ymm12, %ymm12 # ymm12 = ymm15[15],ymm12[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm15[31],ymm12[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
movl $0x80, %ecx
vpinsrb $0x0, %ecx, %xmm12, %xmm15
vpblendd $0xf, %ymm14, %ymm13, %ymm13 # ymm13 = ymm14[0,1,2,3],ymm13[4,5,6,7]
vpblendd $0xf, %ymm15, %ymm12, %ymm12 # ymm12 = ymm15[0,1,2,3],ymm12[4,5,6,7]
vinserti128 $0x1, %xmm10, %ymm0, %ymm14
vpalignr $0xf, %ymm14, %ymm10, %ymm10 # ymm10 = ymm14[15],ymm10[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm14[31],ymm10[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpinsrb $0x0, %r11d, %xmm10, %xmm14
vpblendd $0xf, %ymm14, %ymm10, %ymm10 # ymm10 = ymm14[0,1,2,3],ymm10[4,5,6,7]
vinserti128 $0x1, %xmm11, %ymm0, %ymm14
vpalignr $0xf, %ymm14, %ymm11, %ymm11 # ymm11 = ymm14[15],ymm11[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm14[31],ymm11[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpinsrb $0x0, %r11d, %xmm11, %xmm14
vpblendd $0xf, %ymm14, %ymm11, %ymm11 # ymm11 = ymm14[0,1,2,3],ymm11[4,5,6,7]
movq 0x18(%rsp), %rcx
vmovdqa (%rcx), %ymm14
vperm2i128 $0x28, %ymm14, %ymm14, %ymm15 # ymm15 = zero,zero,ymm14[0,1]
vpalignr $0xf, %ymm15, %ymm14, %ymm15 # ymm15 = ymm15[15],ymm14[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm15[31],ymm14[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
xorl %r10d, %r10d
vmovdqa (%r15,%r10), %ymm9
vpmaxsb %ymm10, %ymm9, %ymm14
vmovdqa %ymm14, (%r15,%r10)
vpaddsb (%rax,%r10), %ymm15, %ymm15
vpmaxsb %ymm0, %ymm15, %ymm15
vpcmpeqb %ymm15, %ymm14, %ymm15
vpcmpgtb %ymm10, %ymm9, %ymm9
vpor %ymm9, %ymm15, %ymm9
movq 0x10(%rbx), %rcx
vpblendvb %ymm9, (%rbp,%r10), %ymm2, %ymm9
movq (%rcx), %rcx
addq %r9, %rcx
vpand (%r10,%rcx), %ymm4, %ymm15
vmovdqa %ymm9, (%rbp,%r10)
vpor %ymm9, %ymm15, %ymm9
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r9, %rcx
vmovdqa %ymm9, (%r10,%rcx)
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r9, %rcx
vpcmpgtb %ymm12, %ymm11, %ymm9
vpblendvb %ymm9, %ymm5, %ymm6, %ymm9
vpand (%r10,%rcx), %ymm7, %ymm11
vpor %ymm9, %ymm11, %ymm9
vmovdqa %ymm9, (%r10,%rcx)
vpsubsb 0xd0(%rsp), %ymm14, %ymm11
vmovdqa (%r14,%r10), %ymm9
vpsubsb %ymm1, %ymm9, %ymm15
vpmaxsb %ymm15, %ymm11, %ymm9
vmovdqa %ymm9, (%r13,%r10)
cmpq %r8, %rsi
jae 0x594c0d
vpbroadcastb 0x66c76(%rip), %ymm9 # 0x5fb854
vpbroadcastb 0x66c6e(%rip), %ymm1 # 0x5fb855
vpcmpgtb %ymm15, %ymm11, %ymm15
vpblendvb %ymm15, %ymm9, %ymm1, %ymm1
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq 0x60(%rsp), %rcx
vmovdqa %ymm1, (%r10,%rcx)
vmovdqu 0xb0(%rsp), %ymm1
vpmaxsb %ymm8, %ymm14, %ymm8
vpsubsb %ymm1, %ymm10, %ymm14
vmovdqa %ymm1, %ymm9
vpcmpgtb %ymm14, %ymm11, %ymm1
vpmovmskb %ymm1, %ecx
xorl $-0x1, %ecx
setne %cl
je 0x594c5b
vpsubsb %ymm9, %ymm13, %ymm12
vpmaxsb %ymm12, %ymm11, %ymm13
vmovdqa (%r12,%r10), %ymm15
addq $0x20, %r10
vmovdqa %ymm14, %ymm10
cmpq %r10, %rdi
vmovdqa %ymm9, %ymm1
jne 0x594b2c
xorl %r10d, %r10d
vmovdqa %ymm14, %ymm10
jmp 0x594c65
movl $0x21, %r10d
vmovdqa %ymm9, %ymm1
testl %r10d, %r10d
jne 0x594c77
incl %edx
cmpl $0x20, %edx
jne 0x594aaf
jmp 0x594c7d
cmpl $0x21, %r10d
jne 0x594ce9
vpcmpgtb 0xf0(%rsp), %ymm8, %ymm1
vpmovmskb %ymm1, %eax
movb $0x1, %cl
testl %eax, %eax
je 0x594cf0
vpermq $0x44, %ymm8, %ymm1     # ymm1 = ymm8[0,1,0,1]
vpmaxsb %ymm1, %ymm8, %ymm1
vpslldq $0x8, %ymm1, %ymm9      # ymm9 = zero,zero,zero,zero,zero,zero,zero,zero,ymm1[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm1[16,17,18,19,20,21,22,23]
vpmaxsb %ymm9, %ymm1, %ymm1
vpslldq $0x4, %ymm1, %ymm9      # ymm9 = zero,zero,zero,zero,ymm1[0,1,2,3,4,5,6,7,8,9,10,11],zero,zero,zero,zero,ymm1[16,17,18,19,20,21,22,23,24,25,26,27]
vpmaxsb %ymm9, %ymm1, %ymm1
vpslldq $0x2, %ymm1, %ymm9      # ymm9 = zero,zero,ymm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13],zero,zero,ymm1[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpmaxsb %ymm9, %ymm1, %ymm1
vpslldq $0x1, %ymm1, %ymm9      # ymm9 = zero,ymm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],zero,ymm1[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpmaxsb %ymm9, %ymm1, %ymm10
vextracti128 $0x1, %ymm10, %xmm1
vpextrb $0xf, %xmm1, %eax
movl %eax, 0x8(%rsp)
movsbl %al, %eax
cmpl %eax, 0x44(%rsp)
movl 0x4(%rsp), %r10d
jge 0x594cf7
orb $0x40, 0xc(%rbx)
xorl %ecx, %ecx
jmp 0x594d1c
movl 0x4(%rsp), %r10d
jmp 0x594d25
movl 0x4(%rsp), %r10d
jmp 0x594d1c
vpbroadcastb 0x66b58(%rip), %ymm1 # 0x5fb858
vpshufb %ymm1, %ymm10, %ymm1
vpermq $0xaa, %ymm1, %ymm1     # ymm1 = ymm1[2,2,2,2]
vmovdqu %ymm1, 0xf0(%rsp)
movq 0x10(%rsp), %rax
movl %eax, %r10d
vmovdqu 0xb0(%rsp), %ymm1
testb %cl, %cl
je 0x594d4c
movq 0x98(%rsp), %rax
addq %rax, 0x60(%rsp)
addq %rax, %r9
movq %rsi, %rcx
movq %r13, %rdx
cmpq 0x38(%rsp), %rsi
jne 0x5948f1
jmp 0x594d56
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
movl %r10d, 0x4(%rsp)
cmpb $0x7f, 0x8(%rsp)
jne 0x594d66
orb $0x40, 0xc(%rbx)
movq %rbx, %rdi
vzeroupper
callq 0x20a805
xorl %ecx, %ecx
testl %eax, %eax
je 0x594d87
movq 0x28(%rsp), %rdi
xorl %r10d, %r10d
xorl %r8d, %r8d
jmp 0x594e57
movq 0x38(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movl 0x4(%rsp), %r10d
cmpl %ecx, %r10d
movq 0x28(%rsp), %rcx
movq %rcx, %rdi
cmoveq %r12, %rdi
movq %r12, %rdx
cmoveq %rcx, %rdx
cmpl %eax, %r10d
cmoveq %r15, %rdi
cmoveq %r12, %rdx
movq %rdx, %r12
cmoveq %rcx, %r15
movq 0x90(%rsp), %r8
decl %r8d
testl $0x7fffffe0, 0x88(%rsp) # imm = 0x7FFFFFE0
je 0x594e4e
movq 0x20(%rsp), %r9
movl %r9d, %eax
andl $0x3ffffff, %eax        # imm = 0x3FFFFFF
shll $0x5, %eax
xorl %ecx, %ecx
movl 0x8(%rsp), %r11d
cmpb %r11b, (%rdi,%rcx)
jne 0x594e0b
movl %ecx, %edx
shrl $0x5, %edx
movl %ecx, %esi
andl $0x1f, %esi
imull %r9d, %esi
addl %edx, %esi
cmpl %r8d, %esi
cmovll %esi, %r8d
incq %rcx
cmpl %ecx, %eax
jne 0x594dee
jmp 0x594e53
callq 0x1fb853
jmp 0x594e4a
callq 0x1fb82d
jmp 0x594e4a
callq 0x1fb807
jmp 0x594e4a
callq 0x1fb7e1
jmp 0x594e4a
callq 0x1fb7bb
jmp 0x594e4a
callq 0x1fb795
jmp 0x594e4a
callq 0x1fb76f
jmp 0x594e4a
callq 0x1fb749
xorl %eax, %eax
jmp 0x594e9b
movl 0x8(%rsp), %r11d
movsbl %r11b, %ecx
movl %ecx, (%rbx)
movl %r8d, 0x4(%rbx)
movl %r10d, 0x8(%rbx)
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
movq 0x30(%rsp), %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)