// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_trace_striped_avx2_256_32.c
// Function: parasail_nw_trace_striped_profile_avx2_256_32
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 s1Len = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
    int32_t offset = 0;
    int32_t position = 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;
    int32_t* restrict boundary = NULL;
    __m256i vGapO;
    __m256i vGapE;
    int32_t NEG_LIMIT = 0;
    int32_t POS_LIMIT = 0;
    int32_t score = 0;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    parasail_result_t *result = NULL;
    __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->profile32.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;
    s1Len = profile->s1Len;
    end_query = s1Len-1;
    end_ref = s2Len-1;
    matrix = profile->matrix;
    segWidth = 8; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    vProfile = (__m256i*)profile->profile32.score;
    vGapO = _mm256_set1_epi32(open);
    vGapE = _mm256_set1_epi32(gap);
    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;
    vTIns  = _mm256_set1_epi32(PARASAIL_INS);
    vTDel  = _mm256_set1_epi32(PARASAIL_DEL);
    vTDiag = _mm256_set1_epi32(PARASAIL_DIAG);
    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);
    vTMask = _mm256_set1_epi32(PARASAIL_ZERO_MASK);
    vFTMask = _mm256_set1_epi32(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_NW | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_8;

    /* 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);
    boundary = parasail_memalign_int32_t(32, s2Len+1);

    /* 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 (!boundary) return NULL;

    /* initialize H and E */
    {
        int32_t index = 0;
        for (i=0; i<segLen; ++i) {
            int32_t segNum = 0;
            __m256i_32_t h;
            __m256i_32_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = -open-gap*(segNum*segLen+i);
                h.v[segNum] = tmp < INT32_MIN ? INT32_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT32_MIN ? INT32_MIN : tmp;
            }
            _mm256_store_si256(&pvHStore[index], h.m);
            _mm256_store_si256(&pvE[index], e.m);
            _mm256_store_si256(&pvEaStore[index], e.m);
            ++index;
        }
    }

    /* initialize uppder boundary */
    {
        boundary[0] = 0;
        for (i=1; i<=s2Len; ++i) {
            int64_t tmp = -open-gap*(i-1);
            boundary[i] = tmp < INT32_MIN ? INT32_MIN : tmp;
        }
    }

    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 -inf.  Any errors to vH values will be
         * corrected in the Lazy_F loop.  */
        vF = vNegLimit;

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

        /* insert upper boundary condition */
        vH = _mm256_insert_epi32_rpl(vH, boundary[j], 0);

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

        /* 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_add_epi32(vH, _mm256_load_si256(vP + i));
            vH = _mm256_max_epi32(vH_dag, vE);
            vH = _mm256_max_epi32(vH, vF);
            /* Save vH values. */
            _mm256_store_si256(pvHStore + i, vH);
            vSaturationCheckMax = _mm256_max_epi32(vSaturationCheckMax, vH);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vE);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vF);

            {
                __m256i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                __m256i case1 = _mm256_cmpeq_epi32(vH, vH_dag);
                __m256i case2 = _mm256_cmpeq_epi32(vH, vF);
                __m256i vT = _mm256_blendv_epi8(
                        _mm256_blendv_epi8(vTIns, vTDel, case2),
                        vTDiag, case1);
                _mm256_store_si256(pvHT + i, vT);
                vT = _mm256_or_si256(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i, segLen, j);
            }

            vEF_opn = _mm256_sub_epi32(vH, vGapO);

            /* Update vE value. */
            vE_ext = _mm256_sub_epi32(vE, vGapE);
            vE = _mm256_max_epi32(vEF_opn, vE_ext);
            _mm256_store_si256(pvE + i, vE);
            {
                __m256i vEa = _mm256_load_si256(pvEaLoad + i);
                __m256i vEa_ext = _mm256_sub_epi32(vEa, vGapE);
                vEa = _mm256_max_epi32(vEF_opn, vEa_ext);
                _mm256_store_si256(pvEaStore + i, vEa);
                if (j+1<s2Len) {
                    __m256i cond = _mm256_cmpgt_epi32(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_sub_epi32(vF, vGapE);
            vF = _mm256_max_epi32(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m256i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m256i cond = _mm256_cmpgt_epi32(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) {
            int64_t tmp = boundary[j+1]-open;
            int32_t tmp2 = tmp < INT32_MIN ? INT32_MIN : tmp;
            __m256i vHp = _mm256_load_si256(&pvHLoad[segLen - 1]);
            vHp = _mm256_slli_si256_rpl(vHp, 4);
            vHp = _mm256_insert_epi32_rpl(vHp, boundary[j], 0);
            vEF_opn = _mm256_slli_si256_rpl(vEF_opn, 4);
            vEF_opn = _mm256_insert_epi32_rpl(vEF_opn, tmp2, 0);
            vF_ext = _mm256_slli_si256_rpl(vF_ext, 4);
            vF_ext = _mm256_insert_epi32_rpl(vF_ext, NEG_LIMIT, 0);
            vF = _mm256_slli_si256_rpl(vF, 4);
            vF = _mm256_insert_epi32_rpl(vF, tmp2, 0);
            vFa_ext = _mm256_slli_si256_rpl(vFa_ext, 4);
            vFa_ext = _mm256_insert_epi32_rpl(vFa_ext, NEG_LIMIT, 0);
            vFa = _mm256_slli_si256_rpl(vFa, 4);
            vFa = _mm256_insert_epi32_rpl(vFa, tmp2, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm256_load_si256(pvHStore + i);
                vH = _mm256_max_epi32(vH,vF);
                _mm256_store_si256(pvHStore + i, vH);
                vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vH);
                vSaturationCheckMax = _mm256_max_epi32(vSaturationCheckMax, vH);
                {
                    __m256i vTAll;
                    __m256i vT;
                    __m256i case1;
                    __m256i case2;
                    __m256i cond;
                    vHp = _mm256_add_epi32(vHp, _mm256_load_si256(vP + i));
                    case1 = _mm256_cmpeq_epi32(vH, vHp);
                    case2 = _mm256_cmpeq_epi32(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);
                }
                /* Update vF value. */
                {
                    __m256i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m256i cond = _mm256_cmpgt_epi32(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_sub_epi32(vH, vGapO);
                vF_ext = _mm256_sub_epi32(vF, vGapE);
                {
                    __m256i vEa = _mm256_load_si256(pvEaLoad + i);
                    __m256i vEa_ext = _mm256_sub_epi32(vEa, vGapE);
                    vEa = _mm256_max_epi32(vEF_opn, vEa_ext);
                    _mm256_store_si256(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m256i cond = _mm256_cmpgt_epi32(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_epi32(vF_ext, vEF_opn),
                                _mm256_cmpeq_epi32(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm256_max_epi32(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm256_sub_epi32(vFa, vGapE);
                vFa = _mm256_max_epi32(vEF_opn, vFa_ext);
                vHp = _mm256_load_si256(pvHLoad + i);
            }
        }
end:
        {
        }
    }

    /* extract last value from the last column */
    {
        __m256i vH = _mm256_load_si256(pvHStore + offset);
        for (k=0; k<position; ++k) {
            vH = _mm256_slli_si256_rpl (vH, 4);
        }
        score = (int32_t) _mm256_extract_epi32_rpl (vH, 7);
    }

    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(boundary);
    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 $0x148, %rsp            # imm = 0x148
movl %ecx, 0x4(%rsp)
movq %rsi, 0x58(%rsp)
testq %rdi, %rdi
je 0x5c0ff7
movq 0x48(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x5c0ffe
movq 0x10(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x5c1005
movl 0x8(%rdi), %edi
testl %edi, %edi
jle 0x5c100c
cmpq $0x0, 0x58(%rsp)
je 0x5c1013
movl %edx, %r14d
testl %edx, %edx
jle 0x5c101a
cmpl $0x0, 0x4(%rsp)
js 0x5c1021
testl %r8d, %r8d
js 0x5c1028
movl %r8d, 0x8(%rsp)
leal -0x1(%rdi), %ebp
addq $0x7, %rdi
shrq $0x3, %rdi
movq %rdi, 0x38(%rsp)
movl %ebp, %eax
xorl %edx, %edx
divl %edi
movl %eax, %r15d
movl %edx, %r12d
movl 0x4(%rsp), %ecx
movl %ecx, %esi
negl %esi
movq 0x50(%rsp), %rdx
movl 0x20(%rdx), %eax
movl $0x80000000, %r13d      # imm = 0x80000000
orl %r13d, %ecx
subl %eax, %r13d
movl %esi, 0x80(%rsp)
cmpl %esi, %eax
cmovgl %ecx, %r13d
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rdx), %eax
movl %eax, 0xc0(%rsp)
movl $0x20, %edx
movl $0x20, %ecx
movl %r14d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x5c102d
movq %rax, %rbx
movl %r12d, 0x4c(%rsp)
movl %r15d, 0x1c(%rsp)
movl %ebp, 0x48(%rsp)
orl $0x8480801, 0xc(%rax)   # imm = 0x8480801
movl $0x20, %edi
movq 0x38(%rsp), %rbp
movq %rbp, %rsi
callq 0x4f1904
movq %rax, 0x28(%rsp)
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, %r12
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, 0x30(%rsp)
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, 0x20(%rsp)
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, %r15
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, %rbp
leal 0x1(%r14), %esi
movl $0x20, %edi
callq 0x20a62d
movq 0x28(%rsp), %r10
movq 0x20(%rsp), %r8
movq 0x30(%rsp), %rsi
movq %rax, %rdi
testq %r10, %r10
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
testq %rsi, %rsi
sete %al
testq %r8, %r8
sete %dl
orb %al, %dl
orb %cl, %dl
movq %r15, 0x10(%rsp)
testq %r15, %r15
sete %al
testq %rbp, %rbp
sete %cl
orb %al, %cl
testq %rdi, %rdi
sete %al
orb %cl, %al
orb %dl, %al
testb $0x1, %al
jne 0x5c102d
leal -0x1(%r14), %eax
movl %eax, 0x40(%rsp)
movl $0x7, %eax
subl 0x1c(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x4(%rsp), %eax
vmovd %eax, %xmm0
vpbroadcastd %xmm0, %ymm2
vmovd 0x8(%rsp), %xmm0
vpbroadcastd %xmm0, %ymm3
incl %r13d
vmovd %r13d, %xmm0
vmovdqu %ymm0, 0x100(%rsp)
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0xa0(%rsp)
vmovd 0xc0(%rsp), %xmm0
vpbroadcastd %xmm0, %ymm12
movl %eax, %eax
movq 0x38(%rsp), %r9
movl %r9d, %ecx
vmovd 0x80(%rsp), %xmm0
vpbroadcastd %xmm0, %ymm0
vmovq %rax, %xmm5
movq %rcx, 0x68(%rsp)
vmovq %rcx, %xmm1
vpbroadcastq %xmm1, %ymm4
vpmuldq 0x6d274(%rip), %ymm4, %ymm1 # 0x62dc40
vpmuldq 0x6d16b(%rip), %ymm4, %ymm4 # 0x62db40
vpbroadcastq %xmm5, %ymm5
xorl %eax, %eax
vpmovsxbd 0x6d2e3(%rip), %ymm6 # 0x62dcc8
vpbroadcastq 0x6d2d2(%rip), %ymm7 # 0x62dcc0
movq %r10, %rcx
movq %rsi, %rdx
movq %r8, %r13
movq %r8, %rsi
movq %r10, %r15
vmovq %rax, %xmm8
vpbroadcastq %xmm8, %ymm8
vpaddq %ymm1, %ymm8, %ymm9
vpaddq %ymm4, %ymm8, %ymm8
vpermd %ymm8, %ymm6, %ymm8
vpermd %ymm9, %ymm6, %ymm9
vinserti128 $0x1, %xmm9, %ymm8, %ymm8
vpmulld %ymm8, %ymm3, %ymm8
vpsubd %ymm8, %ymm0, %ymm8
vextracti128 $0x1, %ymm8, %xmm9
vpmovsxdq %xmm9, %ymm9
vpmovsxdq %xmm8, %ymm10
vpsubq %ymm5, %ymm9, %ymm9
vpcmpgtq %ymm7, %ymm9, %ymm11
vblendvpd %ymm11, %ymm9, %ymm7, %ymm9
vpsubq %ymm5, %ymm10, %ymm10
vpcmpgtq %ymm7, %ymm10, %ymm11
vblendvpd %ymm11, %ymm10, %ymm7, %ymm10
vpermd %ymm10, %ymm6, %ymm10
vpermd %ymm9, %ymm6, %ymm9
vinserti128 $0x1, %xmm9, %ymm10, %ymm9
vmovdqa %ymm8, (%rcx)
vmovdqa %ymm9, (%rdx)
vmovdqa %ymm9, (%rsi)
incq %rax
addq $0x20, %rsi
addq $0x20, %rdx
addq $0x20, %rcx
cmpq %rax, %r9
jne 0x5c09fd
movl $0x0, (%rdi)
movl %r14d, %r11d
addl $0x7, %r14d
andl $-0x8, %r14d
leaq -0x1(%r11), %rax
vmovq %rax, %xmm1
vpbroadcastq %xmm1, %ymm7
vpmovsxbd 0x6d21d(%rip), %ymm1 # 0x62dcd0
xorl %eax, %eax
vpmovsxbq 0x6d10a(%rip), %ymm4 # 0x62dbc8
vpmovsxbq 0x6d21d(%rip), %ymm5 # 0x62dce4
vpbroadcastq 0x6d0b0(%rip), %ymm6 # 0x62db80
vpxor %ymm6, %ymm7, %ymm7
vpcmpeqd %ymm8, %ymm8, %ymm8
vpbroadcastd 0x6d1fe(%rip), %ymm15 # 0x62dce0
vmovq %rax, %xmm9
vpbroadcastq %xmm9, %ymm9
vpor %ymm4, %ymm9, %ymm10
vpor %ymm5, %ymm9, %ymm9
vpxor %ymm6, %ymm9, %ymm9
vpcmpgtq %ymm7, %ymm9, %ymm9
vpxor %ymm6, %ymm10, %ymm10
vpcmpgtq %ymm7, %ymm10, %ymm10
vpackssdw %ymm9, %ymm10, %ymm9
vpxor %ymm8, %ymm9, %ymm9
vextracti128 $0x1, %ymm9, %xmm10
vpackssdw %xmm10, %xmm9, %xmm9
vpshufd $0xd8, %xmm9, %xmm9     # xmm9 = xmm9[0,2,1,3]
vpmovzxwd %xmm9, %ymm9    # ymm9 = xmm9[0],zero,xmm9[1],zero,xmm9[2],zero,xmm9[3],zero,xmm9[4],zero,xmm9[5],zero,xmm9[6],zero,xmm9[7],zero
vpslld $0x1f, %ymm9, %ymm9
vpaddd %ymm1, %ymm8, %ymm10
vpmulld %ymm3, %ymm10, %ymm10
vpsubd %ymm10, %ymm0, %ymm10
vpmaskmovd %ymm10, %ymm9, 0x4(%rdi,%rax,4)
addq $0x8, %rax
vpaddd %ymm1, %ymm15, %ymm1
cmpq %rax, %r14
jne 0x5c0ae2
movq %r9, %r8
shlq $0x5, %r8
xorl %eax, %eax
vbroadcastsd 0x6f468(%rip), %ymm0 # 0x62ffc8
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
vmovaps %ymm0, (%rcx,%rax)
addq $0x20, %rax
cmpq %rax, %r8
jne 0x5c0b60
leal -0x1(%r9), %eax
xorl %r10d, %r10d
shlq $0x5, %rax
movq %rax, 0x60(%rsp)
vpbroadcastd 0x6f1a2(%rip), %ymm9 # 0x62fd30
vbroadcastss 0x6d029(%rip), %ymm10 # 0x62dbc0
vbroadcastss 0x6d2b4(%rip), %ymm0 # 0x62de54
vmovups %ymm0, 0x80(%rsp)
vbroadcastsd 0x6f41e(%rip), %ymm0 # 0x62ffd0
vmovups %ymm0, 0xc0(%rsp)
vbroadcastss 0x6d41c(%rip), %ymm13 # 0x62dfe0
vbroadcastss 0x6f15f(%rip), %ymm14 # 0x62fd2c
vpbroadcastq 0x6f402(%rip), %ymm0 # 0x62ffd8
vmovdqu %ymm0, 0x120(%rsp)
movq %r8, 0x8(%rsp)
xorl %ecx, %ecx
vmovdqu %ymm12, 0xe0(%rsp)
vmovdqa %ymm12, %ymm7
vmovdqu 0xa0(%rsp), %ymm6
movq %r13, %rax
movq %rdi, 0x70(%rsp)
movq 0x10(%rsp), %r14
movq %rax, 0x10(%rsp)
movq %r12, %r13
movq %r15, %r12
movq %rcx, %rdx
movq 0x60(%rsp), %rax
vpmovsxbd 0x6d0b3(%rip), %ymm0 # 0x62dcd8
vpermd (%r15,%rax), %ymm0, %ymm0
addq %r15, %rax
movq %rax, 0x28(%rsp)
vmovd (%rdi,%rcx,4), %xmm1
vpblendd $0x1, %ymm1, %ymm0, %ymm5 # ymm5 = ymm1[0],ymm0[1,2,3,4,5,6,7]
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
movzbl (%rcx,%rdx), %ecx
movslq (%rax,%rcx,4), %r9
imulq 0x68(%rsp), %r9
shlq $0x5, %r9
addq 0x78(%rsp), %r9
movq %rdx, 0x20(%rsp)
leaq 0x1(%rdx), %rcx
movl $0x1, %eax
xorl %esi, %esi
vmovdqu 0xa0(%rsp), %ymm1
movq %r12, %r15
movq 0x30(%rsp), %r12
vmovdqa (%r12,%rsi), %ymm0
vpaddd (%r9,%rsi), %ymm5, %ymm4
vpmaxsd %ymm0, %ymm4, %ymm8
vpmaxsd %ymm1, %ymm8, %ymm5
vmovdqa %ymm5, (%r13,%rsi)
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r10, %rdx
vpcmpeqd %ymm4, %ymm5, %ymm4
vpcmpgtd %ymm1, %ymm8, %ymm8
vpaddd %ymm9, %ymm8, %ymm8
vblendvps %ymm4, %ymm10, %ymm8, %ymm4
vorps (%rsi,%rdx), %ymm4, %ymm8
vmovaps %ymm4, (%rbp,%rsi)
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r10, %rdx
vmovaps %ymm8, (%rsi,%rdx)
vpsubd %ymm2, %ymm5, %ymm4
vpsubd %ymm3, %ymm0, %ymm8
vpmaxsd %ymm8, %ymm4, %ymm8
vmovdqa %ymm8, (%r12,%rsi)
movq 0x10(%rsp), %rdx
vmovdqa (%rdx,%rsi), %ymm8
vpsubd %ymm3, %ymm8, %ymm8
vpmaxsd %ymm8, %ymm4, %ymm12
vmovdqa %ymm12, (%r14,%rsi)
cmpq %r11, %rcx
jae 0x5c0d2e
vpcmpgtd %ymm8, %ymm4, %ymm8
vmovups 0x80(%rsp), %ymm11
vblendvps %ymm8, %ymm15, %ymm11, %ymm8
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq 0x8(%rsp), %rdx
vmovaps %ymm8, (%rsi,%rdx)
vpsubd %ymm3, %ymm1, %ymm8
cmpq 0x38(%rsp), %rax
movq %r15, %r12
jae 0x5c0d5d
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r10, %rdx
vpcmpgtd %ymm8, %ymm4, %ymm12
vblendvps %ymm12, %ymm13, %ymm14, %ymm12
vorps 0x20(%rsi,%rdx), %ymm12, %ymm12
vmovaps %ymm12, 0x20(%rsi,%rdx)
vpmaxsd %ymm5, %ymm6, %ymm6
vpminsd %ymm0, %ymm7, %ymm0
vpminsd %ymm1, %ymm0, %ymm0
vpminsd %ymm5, %ymm0, %ymm7
vpmaxsd %ymm8, %ymm4, %ymm1
vmovdqa (%r12,%rsi), %ymm5
addq $0x20, %rsi
incq %rax
cmpq %rsi, %r8
jne 0x5c0c7c
xorl %esi, %esi
vmovdqa %ymm1, %ymm0
movq 0x70(%rsp), %rdi
movq 0x20(%rsp), %r15
movl (%rdi,%rcx,4), %eax
subl 0x4(%rsp), %eax
vpmovsxbd 0x6cf2c(%rip), %ymm11 # 0x62dcd8
movq 0x28(%rsp), %rdx
vpermd (%rdx), %ymm11, %ymm5
vmovd (%rdi,%r15,4), %xmm12
vpblendd $0x1, %ymm12, %ymm5, %ymm12 # ymm12 = ymm12[0],ymm5[1,2,3,4,5,6,7]
vpermd %ymm4, %ymm11, %ymm4
vmovd %eax, %xmm5
vpblendd $0x1, %ymm5, %ymm4, %ymm4 # ymm4 = ymm5[0],ymm4[1,2,3,4,5,6,7]
vpermd %ymm0, %ymm11, %ymm0
vpblendd $0x1, %ymm5, %ymm0, %ymm0 # ymm0 = ymm5[0],ymm0[1,2,3,4,5,6,7]
vpermd %ymm8, %ymm11, %ymm8
vpblendd $0x1, 0x100(%rsp), %ymm8, %ymm8 # ymm8 = mem[0],ymm8[1,2,3,4,5,6,7]
vpermd %ymm1, %ymm11, %ymm1
vpblendd $0x1, %ymm5, %ymm1, %ymm1 # ymm1 = ymm5[0],ymm1[1,2,3,4,5,6,7]
xorl %eax, %eax
vmovaps %ymm15, %ymm11
vmovdqa (%r13,%rax), %ymm15
vpmaxsd %ymm0, %ymm15, %ymm5
vmovdqa %ymm5, (%r13,%rax)
vpaddd (%r9,%rax), %ymm12, %ymm12
vpcmpeqd %ymm5, %ymm12, %ymm12
vpcmpgtd %ymm0, %ymm15, %ymm15
vpor %ymm15, %ymm12, %ymm12
movq 0x10(%rbx), %rdx
vblendvps %ymm12, (%rbp,%rax), %ymm9, %ymm12
movq (%rdx), %rdx
addq %r10, %rdx
vmovups 0xc0(%rsp), %ymm15
vandps (%rax,%rdx), %ymm15, %ymm15
vmovaps %ymm12, (%rbp,%rax)
vorps %ymm12, %ymm15, %ymm12
vmovaps %ymm11, %ymm15
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r10, %rdx
vmovaps %ymm12, (%rax,%rdx)
vpcmpgtd %ymm8, %ymm4, %ymm4
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r10, %rdx
vblendvps %ymm4, %ymm13, %ymm14, %ymm4
vmovups 0x120(%rsp), %ymm8
vandps (%rax,%rdx), %ymm8, %ymm8
vorps %ymm4, %ymm8, %ymm4
vmovaps %ymm4, (%rax,%rdx)
vpsubd %ymm2, %ymm5, %ymm4
movq 0x10(%rsp), %rdx
vmovdqa (%rdx,%rax), %ymm8
vpsubd %ymm3, %ymm8, %ymm8
vpmaxsd %ymm8, %ymm4, %ymm12
vmovdqa %ymm12, (%r14,%rax)
cmpq %r11, %rcx
jae 0x5c0ed6
vpcmpgtd %ymm8, %ymm4, %ymm8
vmovups 0x80(%rsp), %ymm11
vblendvps %ymm8, %ymm15, %ymm11, %ymm8
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq 0x8(%rsp), %rdx
vmovaps %ymm8, (%rax,%rdx)
vpminsd %ymm5, %ymm7, %ymm7
vpmaxsd %ymm5, %ymm6, %ymm6
vpsubd %ymm3, %ymm0, %ymm0
vpcmpgtd %ymm0, %ymm4, %ymm5
vtestps 0x6d36f(%rip), %ymm5    # 0x62e260
jb 0x5c0f1a
vpsubd %ymm3, %ymm1, %ymm8
vpmaxsd %ymm8, %ymm4, %ymm1
vmovdqa (%r12,%rax), %ymm12
addq $0x20, %rax
cmpq %rax, %r8
jne 0x5c0df9
incl %esi
cmpl $0x8, %esi
jne 0x5c0d9c
addq %r8, 0x8(%rsp)
addq %r8, %r10
movq %r13, %r15
movq %r14, %rax
cmpq %r11, %rcx
jne 0x5c0c04
movl 0x4c(%rsp), %eax
shlq $0x5, %rax
vmovdqa (%r13,%rax), %ymm0
cmpl $0x6, 0x1c(%rsp)
jg 0x5c0f6a
xorl %eax, %eax
movl 0x44(%rsp), %ecx
vmovdqu 0xe0(%rsp), %ymm2
vperm2i128 $0x28, %ymm0, %ymm0, %ymm1 # ymm1 = zero,zero,ymm0[0,1]
vpalignr $0xc, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[12,13,14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11],ymm1[28,29,30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27]
incl %eax
cmpl %ecx, %eax
jl 0x5c0f56
jmp 0x5c0f73
vmovdqu 0xe0(%rsp), %ymm2
vmovdqu 0xa0(%rsp), %ymm1
vpcmpgtd %ymm7, %ymm1, %ymm1
vpcmpgtd %ymm2, %ymm6, %ymm2
vpor %ymm2, %ymm1, %ymm1
vtestps %ymm1, %ymm1
je 0x5c0f9b
orb $0x40, 0xc(%rbx)
vpxor %xmm0, %xmm0, %xmm0
xorl %eax, %eax
jmp 0x5c0fb2
vpermq $0xff, %ymm0, %ymm0     # ymm0 = ymm0[3,3,3,3]
vpshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
vpinsrd $0x1, 0x48(%rsp), %xmm0, %xmm0
movl 0x40(%rsp), %eax
vmovq %xmm0, (%rbx)
movl %eax, 0x8(%rbx)
vzeroupper
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq 0x10(%rsp), %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq 0x30(%rsp), %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
jmp 0x5c102f
callq 0x1fa677
jmp 0x5c102d
callq 0x1fa651
jmp 0x5c102d
callq 0x1fa62b
jmp 0x5c102d
callq 0x1fa605
jmp 0x5c102d
callq 0x1fa5df
jmp 0x5c102d
callq 0x1fa5b9
jmp 0x5c102d
callq 0x1fa593
jmp 0x5c102d
callq 0x1fa56d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq