// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/sw_trace_striped_avx2_256_64.c
// Function: parasail_sw_trace_striped_profile_avx2_256_64
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;
    int64_t score = 0;
    __m256i vMaxH;
    __m256i vMaxHUnit;
    int64_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->profile64.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 = 4; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    vProfile = (__m256i*)profile->profile64.score;
    vGapO = _mm256_set1_epi64x_rpl(open);
    vGapE = _mm256_set1_epi64x_rpl(gap);
    vZero = _mm256_setzero_si256();
    score = NEG_INF;
    vMaxH = vZero;
    vMaxHUnit = vZero;
    maxp = INT64_MAX - (int64_t)(matrix->max+1);
    vTZero = _mm256_set1_epi64x_rpl(PARASAIL_ZERO);
    vTIns  = _mm256_set1_epi64x_rpl(PARASAIL_INS);
    vTDel  = _mm256_set1_epi64x_rpl(PARASAIL_DEL);
    vTDiag = _mm256_set1_epi64x_rpl(PARASAIL_DIAG);
    vTDiagE= _mm256_set1_epi64x_rpl(PARASAIL_DIAG_E);
    vTInsE = _mm256_set1_epi64x_rpl(PARASAIL_INS_E);
    vTDiagF= _mm256_set1_epi64x_rpl(PARASAIL_DIAG_F);
    vTDelF = _mm256_set1_epi64x_rpl(PARASAIL_DEL_F);
    vTMask = _mm256_set1_epi64x_rpl(PARASAIL_ZERO_MASK);
    vFTMask= _mm256_set1_epi64x_rpl(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_64 | PARASAIL_FLAG_LANES_4;

    /* 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_epi64x_rpl(-open), segLen);
    parasail_memset___m256i(pvEaStore, _mm256_set1_epi64x_rpl(-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_sub_epi64(vZero,vGapO);

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

        /* 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_add_epi64(vH, _mm256_load_si256(vP + i));
            vH_dag = _mm256_max_epi64_rpl(vH_dag, vZero);
            vH = _mm256_max_epi64_rpl(vH_dag, vE);
            vH = _mm256_max_epi64_rpl(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_epi64(vH, vZero);
                __m256i case1 = _mm256_cmpeq_epi64(vH, vH_dag);
                __m256i case2 = _mm256_cmpeq_epi64(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_epi64_rpl(vH, vMaxH);
            vEF_opn = _mm256_sub_epi64(vH, vGapO);

            /* Update vE value. */
            vE_ext = _mm256_sub_epi64(vE, vGapE);
            vE = _mm256_max_epi64_rpl(vEF_opn, vE_ext);
            _mm256_store_si256(pvE + i, vE);
            {
                __m256i vEa = _mm256_load_si256(pvEaLoad + i);
                __m256i vEa_ext = _mm256_sub_epi64(vEa, vGapE);
                vEa = _mm256_max_epi64_rpl(vEF_opn, vEa_ext);
                _mm256_store_si256(pvEaStore + i, vEa);
                if (j+1<s2Len) {
                    __m256i cond = _mm256_cmpgt_epi64(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_epi64(vF, vGapE);
            vF = _mm256_max_epi64_rpl(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m256i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m256i cond = _mm256_cmpgt_epi64(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, 8);
            vEF_opn = _mm256_slli_si256_rpl(vEF_opn, 8);
            vEF_opn = _mm256_insert_epi64_rpl(vEF_opn, -open, 0);
            vF_ext = _mm256_slli_si256_rpl(vF_ext, 8);
            vF_ext = _mm256_insert_epi64_rpl(vF_ext, NEG_INF, 0);
            vF = _mm256_slli_si256_rpl(vF, 8);
            vF = _mm256_insert_epi64_rpl(vF, -open, 0);
            vFa_ext = _mm256_slli_si256_rpl(vFa_ext, 8);
            vFa_ext = _mm256_insert_epi64_rpl(vFa_ext, NEG_INF, 0);
            vFa = _mm256_slli_si256_rpl(vFa, 8);
            vFa = _mm256_insert_epi64_rpl(vFa, -open, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm256_load_si256(pvHStore + i);
                vH = _mm256_max_epi64_rpl(vH,vF);
                _mm256_store_si256(pvHStore + i, vH);
                {
                    __m256i vTAll;
                    __m256i vT;
                    __m256i case1;
                    __m256i case2;
                    __m256i cond;
                    vHp = _mm256_add_epi64(vHp, _mm256_load_si256(vP + i));
                    vHp = _mm256_max_epi64_rpl(vHp, vZero);
                    case1 = _mm256_cmpeq_epi64(vH, vHp);
                    case2 = _mm256_cmpeq_epi64(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_epi64_rpl(vH, vMaxH);
                /* Update vF value. */
                {
                    __m256i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m256i cond = _mm256_cmpgt_epi64(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_epi64(vH, vGapO);
                vF_ext = _mm256_sub_epi64(vF, vGapE);
                {
                    __m256i vEa = _mm256_load_si256(pvEaLoad + i);
                    __m256i vEa_ext = _mm256_sub_epi64(vEa, vGapE);
                    vEa = _mm256_max_epi64_rpl(vEF_opn, vEa_ext);
                    _mm256_store_si256(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m256i cond = _mm256_cmpgt_epi64(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_epi64(vF_ext, vEF_opn),
                                _mm256_cmpeq_epi64(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm256_max_epi64_rpl(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm256_sub_epi64(vFa, vGapE);
                vFa = _mm256_max_epi64_rpl(vEF_opn, vFa_ext);
                vHp = _mm256_load_si256(pvHLoad + i);
            }
        }
end:
        {
        }

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

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

    if (score == INT64_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. */
        {
            int64_t *t = (int64_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 $0x168, %rsp            # imm = 0x168
movq %rsi, 0x48(%rsp)
testq %rdi, %rdi
je 0x5c0606
movq 0x60(%rdi), %rax
movq %rax, 0xb0(%rsp)
testq %rax, %rax
je 0x5c060d
movq 0x10(%rdi), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x5c0614
movl 0x8(%rdi), %ebp
testl %ebp, %ebp
jle 0x5c061b
cmpq $0x0, 0x48(%rsp)
je 0x5c0622
movl %edx, %r13d
testl %edx, %edx
jle 0x5c0629
movl %ecx, %r12d
testl %ecx, %ecx
js 0x5c0630
testl %r8d, %r8d
js 0x5c0637
movl %r8d, 0x70(%rsp)
leaq 0x3(%rbp), %r15
movq %r15, %r14
shrq $0x2, %r14
movq 0x40(%rsp), %rax
movslq 0x1c(%rax), %rax
movq %rax, 0x38(%rsp)
movl $0x20, %edx
movl $0x20, %ecx
movl %r14d, %edi
movl %r13d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x5c063c
movq %rax, %rbx
movq %r13, 0x30(%rsp)
movq %r15, 0x90(%rsp)
movq %rbp, 0x98(%rsp)
orl $0x4880804, 0xc(%rax)   # imm = 0x4880804
movl $0x20, %edi
movq %r14, %rsi
callq 0x4f1904
movq %rax, %r15
movl $0x20, %edi
movq %r14, %rsi
callq 0x4f1904
movq %rax, %rbp
movl $0x20, %edi
movq %r14, %rsi
callq 0x4f1904
movq %rax, 0x28(%rsp)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4f1904
movq %rax, 0x50(%rsp)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4f1904
movq %rax, 0x10(%rsp)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4f1904
movq %rax, %r13
movl $0x20, %edi
movq %r14, %rsi
callq 0x4f1904
movq %rax, %rcx
xorl %eax, %eax
testq %r15, %r15
je 0x5c06aa
testq %rbp, %rbp
je 0x5c06aa
cmpq $0x0, 0x28(%rsp)
je 0x5c06aa
movq 0x50(%rsp), %rdx
testq %rdx, %rdx
je 0x5c06aa
cmpq $0x0, 0x10(%rsp)
je 0x5c06aa
testq %r13, %r13
je 0x5c06aa
testq %rcx, %rcx
je 0x5c06aa
movq %rcx, 0x20(%rsp)
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movl %r12d, %eax
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0xc0(%rsp)
movl 0x70(%rsp), %eax
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0xe0(%rsp)
movq 0x38(%rsp), %rax
notq %rax
addq %rcx, %rax
movq %rax, 0x38(%rsp)
vpxor %xmm0, %xmm0, %xmm0
movq %r15, %rdi
movq %r14, %rsi
callq 0x4f190d
negl %r12d
movslq %r12d, %rax
vmovq %rax, %xmm0
vmovdqu %ymm0, 0x140(%rsp)
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x70(%rsp)
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x4f190d
movq 0x50(%rsp), %rdi
vmovups 0x70(%rsp), %ymm0
movq %r14, %rsi
callq 0x4f190d
movq %r14, %rax
shlq $0x5, %rax
xorl %ecx, %ecx
vbroadcastsd 0x6fca1(%rip), %ymm0 # 0x62fca8
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
vmovaps %ymm0, (%rdx,%rcx)
addq $0x20, %rcx
cmpq %rcx, %rax
jne 0x5c0007
vmovups %ymm0, 0x100(%rsp)
vpxor %xmm1, %xmm1, %xmm1
vpsubq 0xc0(%rsp), %ymm1, %ymm0
vmovdqu %ymm0, 0x120(%rsp)
leal -0x1(%r14), %eax
movl 0x30(%rsp), %ecx
movl %r14d, %esi
movq %rsi, 0xa0(%rsp)
shlq $0x5, %rsi
movabsq $-0x4000000000000000, %rdx # imm = 0xC000000000000000
xorl %r8d, %r8d
shlq $0x5, %rax
movq %rax, 0xa8(%rsp)
vpbroadcastq 0x6fc54(%rip), %ymm3 # 0x62fcc8
vpbroadcastq 0x6db0b(%rip), %ymm4 # 0x62db88
vbroadcastsd 0x6fed2(%rip), %ymm5 # 0x62ff58
vbroadcastsd 0x6fc29(%rip), %ymm6 # 0x62fcb8
vbroadcastsd 0x6fc28(%rip), %ymm7 # 0x62fcc0
vbroadcastsd 0x6febf(%rip), %ymm8 # 0x62ff60
movq %rsi, 0x70(%rsp)
xorl %r10d, %r10d
movl $0x0, 0x4(%rsp)
movq %rdx, 0x8(%rsp)
vpxor %xmm10, %xmm10, %xmm10
vpxor %xmm0, %xmm0, %xmm0
vmovdqu 0xe0(%rsp), %ymm9
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %r11
movq %r11, 0x50(%rsp)
movq 0x10(%rsp), %r12
movq %rax, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
movq %r15, %rbp
movq %r10, %rax
movq 0xa8(%rsp), %rdi
leaq (%r15,%rdi), %rdx
movq %rdx, 0xb8(%rsp)
movq 0x40(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0x48(%rsp), %r9
movzbl (%r9,%r10), %r10d
movslq (%rdx,%r10,4), %r10
movq 0xa0(%rsp), %rdx
imulq %r10, %rdx
shlq $0x5, %rdx
addq 0xb0(%rsp), %rdx
leal -0x2(%rax), %r10d
cmpl %r10d, 0x4(%rsp)
movq 0x18(%rsp), %r15
cmoveq %r15, %r11
movq %r11, 0x20(%rsp)
cmoveq 0x50(%rsp), %r15
vmovdqa (%rbp,%rdi), %ymm2
vperm2i128 $0x8, %ymm2, %ymm2, %ymm12 # ymm12 = zero,zero,ymm2[0,1]
vpalignr $0x8, %ymm12, %ymm2, %ymm2 # ymm2 = ymm12[8,9,10,11,12,13,14,15],ymm2[0,1,2,3,4,5,6,7],ymm12[24,25,26,27,28,29,30,31],ymm2[16,17,18,19,20,21,22,23]
movq %rax, 0x18(%rsp)
leaq 0x1(%rax), %r10
movl $0x1, %eax
xorl %edi, %edi
vmovdqu 0x120(%rsp), %ymm12
movq %r14, %r9
movq 0x28(%rsp), %r14
vmovdqa (%r14,%rdi), %ymm15
vpaddq (%rdx,%rdi), %ymm2, %ymm2
vpcmpgtq %ymm1, %ymm2, %ymm13
vpand %ymm2, %ymm13, %ymm2
vpcmpgtq %ymm15, %ymm2, %ymm13
vblendvpd %ymm13, %ymm2, %ymm15, %ymm13
vpcmpgtq %ymm12, %ymm13, %ymm11
vblendvpd %ymm11, %ymm13, %ymm12, %ymm14
vmovapd %ymm14, (%r15,%rdi)
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq %r8, %r11
vpcmpeqq %ymm2, %ymm14, %ymm2
vpaddq %ymm3, %ymm11, %ymm11
vpcmpeqq %ymm1, %ymm14, %ymm13
vpandn %ymm4, %ymm13, %ymm13
vblendvpd %ymm2, %ymm13, %ymm11, %ymm2
vorpd (%rdi,%r11), %ymm2, %ymm11
vmovapd %ymm2, (%r13,%rdi)
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq %r8, %r11
vmovapd %ymm11, (%rdi,%r11)
vpsubq 0xc0(%rsp), %ymm14, %ymm13
vpsubq %ymm9, %ymm15, %ymm2
vpcmpgtq %ymm2, %ymm13, %ymm11
vblendvpd %ymm11, %ymm13, %ymm2, %ymm2
vmovapd %ymm2, (%r14,%rdi)
movq 0x10(%rsp), %r11
vmovdqa (%r11,%rdi), %ymm2
vpsubq %ymm9, %ymm2, %ymm11
vpcmpgtq %ymm11, %ymm13, %ymm2
vblendvpd %ymm2, %ymm13, %ymm11, %ymm11
vmovapd %ymm11, (%r12,%rdi)
cmpq %rcx, %r10
jae 0x5c0259
vbroadcastsd 0x6fa74(%rip), %ymm11 # 0x62fcb0
vblendvpd %ymm2, 0x100(%rsp), %ymm11, %ymm2
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq 0x70(%rsp), %r11
vmovapd %ymm2, (%rdi,%r11)
vpsubq %ymm9, %ymm12, %ymm15
vpcmpgtq %ymm15, %ymm13, %ymm2
movq %r9, %r14
cmpq %r9, %rax
jae 0x5c0289
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq %r8, %r11
vblendvpd %ymm2, %ymm6, %ymm7, %ymm11
vorpd 0x20(%rdi,%r11), %ymm11, %ymm11
vmovapd %ymm11, 0x20(%rdi,%r11)
vpcmpgtq %ymm10, %ymm14, %ymm11
vblendvpd %ymm11, %ymm14, %ymm10, %ymm10
vblendvpd %ymm2, %ymm13, %ymm15, %ymm12
vmovdqa (%rbp,%rdi), %ymm2
addq $0x20, %rdi
incq %rax
cmpq %rdi, %rsi
jne 0x5c0177
vmovdqu %ymm0, 0x50(%rsp)
xorl %eax, %eax
vmovapd %ymm12, %ymm14
movq 0xb8(%rsp), %r9
vpermpd $0x90, %ymm14, %ymm2    # ymm2 = ymm14[0,0,1,2]
vmovupd 0x140(%rsp), %ymm0
vblendpd $0x1, %ymm0, %ymm2, %ymm14 # ymm14 = ymm0[0],ymm2[1,2,3]
vpermq $0x90, %ymm15, %ymm2    # ymm2 = ymm15[0,0,1,2]
movabsq $-0x4000000000000000, %rdi # imm = 0xC000000000000000
vmovq %rdi, %xmm11
vpblendd $0x3, %ymm11, %ymm2, %ymm15 # ymm15 = ymm11[0,1],ymm2[2,3,4,5,6,7]
vpermpd $0x90, %ymm12, %ymm2    # ymm2 = ymm12[0,0,1,2]
vblendpd $0x1, %ymm0, %ymm2, %ymm12 # ymm12 = ymm0[0],ymm2[1,2,3]
vpermpd $0x90, %ymm13, %ymm2    # ymm2 = ymm13[0,0,1,2]
vblendpd $0x1, %ymm0, %ymm2, %ymm13 # ymm13 = ymm0[0],ymm2[1,2,3]
vmovapd (%r9), %ymm2
vperm2f128 $0x8, %ymm2, %ymm2, %ymm11 # ymm11 = zero,zero,ymm2[0,1]
vpalignr $0x8, %ymm11, %ymm2, %ymm2 # ymm2 = ymm11[8,9,10,11,12,13,14,15],ymm2[0,1,2,3,4,5,6,7],ymm11[24,25,26,27,28,29,30,31],ymm2[16,17,18,19,20,21,22,23]
xorl %edi, %edi
vpcmpgtq %ymm15, %ymm13, %ymm11
vmovdqa (%r15,%rdi), %ymm13
vmovdqa %ymm9, %ymm0
vpcmpgtq %ymm12, %ymm13, %ymm9
vblendvpd %ymm9, %ymm13, %ymm12, %ymm15
vmovapd %ymm15, (%r15,%rdi)
vpaddq (%rdx,%rdi), %ymm2, %ymm2
vpcmpgtq %ymm1, %ymm2, %ymm13
vpand %ymm2, %ymm13, %ymm2
vpcmpeqq %ymm2, %ymm15, %ymm2
vpor %ymm2, %ymm9, %ymm2
movq 0x10(%rbx), %r11
vblendvpd %ymm2, (%r13,%rdi), %ymm3, %ymm2
movq (%r11), %r11
addq %r8, %r11
vandpd (%rdi,%r11), %ymm5, %ymm9
vmovapd %ymm2, (%r13,%rdi)
vorpd %ymm2, %ymm9, %ymm2
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq %r8, %r11
vmovapd %ymm2, (%rdi,%r11)
movq 0x10(%rbx), %r11
movq (%r11), %r11
vblendvpd %ymm11, %ymm6, %ymm7, %ymm2
addq %r8, %r11
vandpd (%rdi,%r11), %ymm8, %ymm9
vorpd %ymm2, %ymm9, %ymm2
vmovapd %ymm2, (%rdi,%r11)
vpsubq 0xc0(%rsp), %ymm15, %ymm13
movq 0x10(%rsp), %r11
vmovdqa (%r11,%rdi), %ymm2
vpsubq %ymm0, %ymm2, %ymm9
vpcmpgtq %ymm9, %ymm13, %ymm2
vblendvpd %ymm2, %ymm13, %ymm9, %ymm9
vmovapd %ymm9, (%r12,%rdi)
cmpq %rcx, %r10
jae 0x5c03fe
vbroadcastsd 0x6f8cf(%rip), %ymm9 # 0x62fcb0
vblendvpd %ymm2, 0x100(%rsp), %ymm9, %ymm2
movq 0x10(%rbx), %r11
movq (%r11), %r11
addq 0x70(%rsp), %r11
vmovapd %ymm2, (%rdi,%r11)
vpcmpgtq %ymm10, %ymm15, %ymm2
vblendvpd %ymm2, %ymm15, %ymm10, %ymm10
vmovdqu 0xe0(%rsp), %ymm9
vpsubq %ymm9, %ymm12, %ymm12
vpcmpgtq %ymm12, %ymm13, %ymm2
vtestpd 0x6de3b(%rip), %ymm2    # 0x62e260
jb 0x5c0455
vpsubq %ymm9, %ymm14, %ymm15
vpcmpgtq %ymm15, %ymm13, %ymm2
vblendvpd %ymm2, %ymm13, %ymm15, %ymm14
vmovapd (%rbp,%rdi), %ymm2
addq $0x20, %rdi
cmpq %rdi, %rsi
jne 0x5c0320
incl %eax
cmpl $0x4, %eax
jne 0x5c02c5
vmovdqu 0x50(%rsp), %ymm0
vpcmpgtq %ymm0, %ymm10, %ymm2
vtestpd %ymm2, %ymm2
je 0x5c04b7
vmovq %xmm10, %rax
vextracti128 $0x1, %ymm10, %xmm2
vmovq %xmm2, %rdx
cmpq %rax, %rdx
cmovgq %rdx, %rax
vpextrq $0x1, %xmm10, %rdi
vpextrq $0x1, %xmm2, %rdx
cmpq %rdi, %rdx
cmovgq %rdx, %rdi
cmpq %rax, %rdi
cmovleq %rax, %rdi
cmpq 0x38(%rsp), %rdi
movq %rdi, 0x8(%rsp)
jg 0x5c04cd
vmovq %rdi, %xmm2
vpbroadcastq %xmm2, %ymm0
movq 0x18(%rsp), %rax
movl %eax, 0x4(%rsp)
addq %rsi, 0x70(%rsp)
addq %rsi, %r8
movq %r12, %rax
cmpq %rcx, %r10
jne 0x5c00cd
jmp 0x5c04db
orb $0x40, 0xc(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, 0x8(%rsp)
jne 0x5c04f0
orb $0x40, 0xc(%rbx)
movq %rbx, %rdi
vzeroupper
callq 0x20be2e
xorl %ecx, %ecx
testl %eax, %eax
je 0x5c0510
movq 0x20(%rsp), %rdi
xorl %r8d, %r8d
xorl %edx, %edx
jmp 0x5c0662
movq 0x30(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movl 0x4(%rsp), %r8d
cmpl %ecx, %r8d
movq 0x20(%rsp), %rcx
movq %rcx, %rdi
cmoveq %rbp, %rdi
movq %rbp, %rdx
cmoveq %rcx, %rdx
cmpl %eax, %r8d
cmoveq %r15, %rdi
cmoveq %rbp, %rdx
movq %rdx, %rbp
cmoveq %rcx, %r15
movq 0x98(%rsp), %rdx
decl %edx
movq 0x90(%rsp), %rsi
testl $0x7ffffffc, %esi       # imm = 0x7FFFFFFC
je 0x5c05ff
andl $0x7ffffffc, %esi       # imm = 0x7FFFFFFC
je 0x5c0640
vmovd %edx, %xmm0
vpbroadcastd %xmm0, %xmm0
vmovq 0x8(%rsp), %xmm1
vpbroadcastq %xmm1, %ymm1
vmovd %r14d, %xmm2
vpbroadcastd %xmm2, %xmm2
vpmovsxbd 0x6d62f(%rip), %xmm3 # 0x62dbc8
xorl %eax, %eax
vpbroadcastd 0x6d678(%rip), %xmm4 # 0x62dc1c
vpbroadcastd 0x6d613(%rip), %xmm5 # 0x62dbc0
vpcmpeqq (%rdi,%rax,8), %ymm1, %ymm6
vextracti128 $0x1, %ymm6, %xmm7
vpackssdw %xmm7, %xmm6, %xmm6
vpsrld $0x2, %xmm3, %xmm7
vpand %xmm4, %xmm3, %xmm8
vpmulld %xmm2, %xmm8, %xmm8
vpaddd %xmm7, %xmm8, %xmm7
vpminsd %xmm0, %xmm7, %xmm7
vblendvps %xmm6, %xmm7, %xmm0, %xmm0
addq $0x4, %rax
vpaddd %xmm5, %xmm3, %xmm3
cmpq %rax, %rsi
jne 0x5c05ad
vpshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
vpminsd %xmm1, %xmm0, %xmm0
vpshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
vpminsd %xmm1, %xmm0, %xmm0
vmovd %xmm0, %edx
movq 0x8(%rsp), %r9
jmp 0x5c065f
callq 0x1fa43d
jmp 0x5c063c
callq 0x1fa417
jmp 0x5c063c
callq 0x1fa3f1
jmp 0x5c063c
callq 0x1fa3cb
jmp 0x5c063c
callq 0x1fa3a5
jmp 0x5c063c
callq 0x1fa37f
jmp 0x5c063c
callq 0x1fa359
jmp 0x5c063c
callq 0x1fa333
xorl %eax, %eax
jmp 0x5c06aa
xorl %eax, %eax
movq 0x8(%rsp), %r9
movl %eax, %ecx
shrl $0x2, %ecx
cmpl %edx, %ecx
cmovgel %edx, %ecx
cmpq %r9, (%rdi,%rax,8)
cmovel %ecx, %edx
incq %rax
cmpl %eax, %esi
jne 0x5c0647
movl %r9d, %ecx
movl %ecx, (%rbx)
movl %edx, 0x4(%rbx)
movl %r8d, 0x8(%rbx)
vzeroupper
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
movq 0x10(%rsp), %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq 0x28(%rsp), %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq %rbx, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq