// File: /workspace/github_c_makefile_star2_O1/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 $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, 0x90(%rsp)
testq %rdi, %rdi
je 0x58ea39
movq 0x60(%rdi), %rax
movq %rax, 0xd0(%rsp)
testq %rax, %rax
je 0x58ea40
movq 0x10(%rdi), %rax
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x58ea47
movl 0x8(%rdi), %ebx
testl %ebx, %ebx
jle 0x58ea4e
cmpq $0x0, 0x90(%rsp)
je 0x58ea55
movl %edx, %ebp
testl %edx, %edx
jle 0x58ea5c
movl %ecx, %r13d
testl %ecx, %ecx
js 0x58ea63
movl %r8d, %r15d
testl %r8d, %r8d
js 0x58ea6a
leaq 0x3(%rbx), %r12
movq %r12, %r14
shrq $0x2, %r14
movq 0x88(%rsp), %rax
movslq 0x1c(%rax), %rax
movq %rax, 0x50(%rsp)
movl $0x20, %edx
movl $0x20, %ecx
movl %r14d, %edi
movl %ebp, %esi
callq 0x2097d1
testq %rax, %rax
je 0x58ea6f
movl %r15d, 0xe0(%rsp)
movl %ebp, 0x28(%rsp)
movq %rax, 0x70(%rsp)
orl $0x4880804, 0xc(%rax)   # imm = 0x4880804
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, %r15
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, %rbp
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, 0x40(%rsp)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, 0x8(%rsp)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, 0x20(%rsp)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, 0x48(%rsp)
movl $0x20, %edi
movq %r14, %rsi
callq 0x4c5e3c
movq %rax, %rcx
xorl %eax, %eax
testq %r15, %r15
je 0x58eaca
testq %rbp, %rbp
je 0x58eaca
cmpq $0x0, 0x40(%rsp)
je 0x58eaca
cmpq $0x0, 0x8(%rsp)
je 0x58eaca
cmpq $0x0, 0x20(%rsp)
je 0x58eaca
cmpq $0x0, 0x48(%rsp)
je 0x58eaca
testq %rcx, %rcx
je 0x58eaca
movq %rcx, 0x38(%rsp)
movq %rbp, 0x18(%rsp)
movq %r12, 0xb0(%rsp)
movq %rbx, 0xb8(%rsp)
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movl %r13d, %eax
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x120(%rsp)
movl 0xe0(%rsp), %eax
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0xe0(%rsp)
movq 0x50(%rsp), %rax
notq %rax
addq %rcx, %rax
movq %rax, 0x50(%rsp)
vpxor %xmm0, %xmm0, %xmm0
movq %r15, %rdi
movq %r14, %rsi
callq 0x4c5e45
negl %r13d
movslq %r13d, %rax
vmovq %rax, %xmm0
vmovdqu %ymm0, 0x180(%rsp)
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x100(%rsp)
movq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x4c5e45
movq 0x8(%rsp), %r12
movq %r12, %rdi
vmovups 0x100(%rsp), %ymm0
movq %r14, %rsi
callq 0x4c5e45
movl %r14d, %eax
movq %rax, 0x98(%rsp)
movq %rax, %rdx
shlq $0x5, %rdx
xorl %eax, %eax
vpbroadcastq 0x6d409(%rip), %ymm0 # 0x5fb388
movq 0x70(%rsp), %r13
movq 0x10(%r13), %rcx
movq (%rcx), %rcx
vmovdqa %ymm0, (%rcx,%rax)
addq $0x20, %rax
cmpq %rax, %rdx
jne 0x58df84
vpxor %xmm3, %xmm3, %xmm3
vpsubq 0x120(%rsp), %ymm3, %ymm1
vmovdqu %ymm1, 0x160(%rsp)
leal -0x1(%r14), %ecx
cmpl $0x1, %r14d
movq %r14, 0x78(%rsp)
adcl $0x0, %r14d
movl 0x28(%rsp), %esi
cmpl $0x2, %esi
movl $0x1, %eax
cmovgel %esi, %eax
movq %rax, 0x58(%rsp)
movl %esi, %eax
movq %rax, 0xa8(%rsp)
shlq $0x5, %r14
movq %r14, 0xa0(%rsp)
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
xorl %r9d, %r9d
shlq $0x5, %rcx
movq %rcx, 0xc8(%rsp)
vbroadcastsd 0x680f4(%rip), %ymm1 # 0x5f6100
vmovups %ymm1, 0x1a0(%rsp)
vpbroadcastq 0x6b962(%rip), %ymm4 # 0x5f9980
vbroadcastsd 0x6d619(%rip), %ymm5 # 0x5fb640
vbroadcastsd 0x6d618(%rip), %ymm6 # 0x5fb648
vbroadcastsd 0x6d35f(%rip), %ymm7 # 0x5fb398
vbroadcastsd 0x6d35e(%rip), %ymm8 # 0x5fb3a0
vbroadcastsd 0x6d605(%rip), %ymm9 # 0x5fb650
movq %rdx, 0x68(%rsp)
xorl %ebx, %ebx
xorl %r10d, %r10d
movq %rax, 0x30(%rsp)
vpxor %xmm11, %xmm11, %xmm11
vxorps %xmm1, %xmm1, %xmm1
vmovups %ymm1, 0x140(%rsp)
vmovdqu 0xe0(%rsp), %ymm1
movq %rdx, 0xc0(%rsp)
movq 0x38(%rsp), %r8
movq %r8, %rax
movq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq %r12, 0x20(%rsp)
movq 0x18(%rsp), %rcx
movq %r15, %rdi
movq 0xc8(%rsp), %r11
leaq (%r15,%r11), %rdx
movq %rdx, 0xd8(%rsp)
movq 0x88(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0x90(%rsp), %rsi
movzbl (%rsi,%rbx), %esi
movslq (%rdx,%rsi,4), %rdx
movq 0x98(%rsp), %rsi
imulq %rdx, %rsi
shlq $0x5, %rsi
addq 0xd0(%rsp), %rsi
movq %rsi, 0x100(%rsp)
leal -0x2(%rbx), %edx
movl %r10d, 0x14(%rsp)
cmpl %edx, %r10d
cmoveq %rcx, %r8
movq %r8, 0x38(%rsp)
movq %rcx, %r15
cmoveq %rax, %r15
movq %rdi, 0x18(%rsp)
vmovdqa (%rdi,%r11), %ymm2
vperm2i128 $0x8, %ymm2, %ymm2, %ymm10 # ymm10 = zero,zero,ymm2[0,1]
vpalignr $0x8, %ymm10, %ymm2, %ymm2 # ymm2 = ymm10[8,9,10,11,12,13,14,15],ymm2[0,1,2,3,4,5,6,7],ymm10[24,25,26,27,28,29,30,31],ymm2[16,17,18,19,20,21,22,23]
movq %rbx, 0x80(%rsp)
leaq 0x1(%rbx), %rax
movq %rax, 0x28(%rsp)
movl $0x1, %ecx
xorl %edx, %edx
vmovdqu 0x160(%rsp), %ymm12
movq %rcx, 0x60(%rsp)
movq 0x40(%rsp), %rcx
vmovdqa (%rcx,%rdx), %ymm14
movq 0x100(%rsp), %rax
vpaddq (%rax,%rdx), %ymm2, %ymm2
vmovq %xmm2, %rax
movq %rax, %rsi
sarq $0x3f, %rsi
vpextrq $0x1, %xmm2, %rdi
andnq %rax, %rsi, %rax
movq %rdi, %rsi
sarq $0x3f, %rsi
andnq %rdi, %rsi, %rsi
vextracti128 $0x1, %ymm2, %xmm2
vmovq %xmm2, %rdi
movq %rdi, %r8
sarq $0x3f, %r8
vpextrq $0x1, %xmm2, %r10
andnq %rdi, %r8, %rdi
movq %r10, %r8
sarq $0x3f, %r8
andnq %r10, %r8, %r11
vmovq %r11, %xmm2
vmovq %rdi, %xmm10
vpunpcklqdq %xmm2, %xmm10, %xmm2 # xmm2 = xmm10[0],xmm2[0]
movq (%rcx,%rdx), %r8
movq 0x8(%rcx,%rdx), %r10
cmpq %r8, %rax
cmovgq %rax, %r8
cmpq %r10, %rsi
cmovgq %rsi, %r10
movq 0x18(%rcx,%rdx), %r12
movq 0x10(%rcx,%rdx), %r14
cmpq %r14, %rdi
cmovgq %rdi, %r14
cmpq %r12, %r11
cmovgq %r11, %r12
vmovq %xmm12, %rdi
cmpq %rdi, %r8
cmovleq %rdi, %r8
vpextrq $0x1, %xmm12, %rdi
vmovq %rsi, %xmm10
cmpq %rdi, %r10
cmovleq %rdi, %r10
vmovq %rax, %xmm13
vextracti128 $0x1, %ymm12, %xmm15
vmovq %xmm15, %rax
cmpq %rax, %r14
cmovleq %rax, %r14
vpextrq $0x1, %xmm15, %rax
vpunpcklqdq %xmm10, %xmm13, %xmm10 # xmm10 = xmm13[0],xmm10[0]
cmpq %rax, %r12
cmovleq %rax, %r12
vinserti128 $0x1, %xmm2, %ymm10, %ymm10
vmovq %r12, %xmm2
vmovq %r14, %xmm13
vpunpcklqdq %xmm2, %xmm13, %xmm2 # xmm2 = xmm13[0],xmm2[0]
vmovq %r10, %xmm13
vmovq %r8, %xmm15
vpunpcklqdq %xmm13, %xmm15, %xmm13 # xmm13 = xmm15[0],xmm13[0]
vinserti128 $0x1, %xmm2, %ymm13, %ymm2
vmovdqa %ymm2, (%r15,%rdx)
movq 0x10(%r13), %rax
movq (%rax), %rax
addq %r9, %rax
vpcmpeqq %ymm10, %ymm2, %ymm10
vpcmpeqq %ymm12, %ymm2, %ymm13
vmovdqu 0x1a0(%rsp), %ymm15
vpsubq %ymm13, %ymm15, %ymm13
vpcmpgtq %ymm3, %ymm2, %ymm15
vpand %ymm4, %ymm15, %ymm15
vblendvpd %ymm10, %ymm15, %ymm13, %ymm10
vorpd (%rdx,%rax), %ymm10, %ymm13
movq 0x48(%rsp), %rax
vmovapd %ymm10, (%rax,%rdx)
movq 0x10(%r13), %rax
movq (%rax), %rax
addq %r9, %rax
vmovapd %ymm13, (%rdx,%rax)
vmovq %xmm11, %rax
cmpq %rax, %r8
cmovleq %rax, %r8
vpextrq $0x1, %xmm11, %rax
cmpq %rax, %r10
cmovleq %rax, %r10
vextracti128 $0x1, %ymm11, %xmm10
vmovq %xmm10, %rax
cmpq %rax, %r14
cmovleq %rax, %r14
vpextrq $0x1, %xmm10, %rax
cmpq %rax, %r12
cmovleq %rax, %r12
vpsubq 0x120(%rsp), %ymm2, %ymm13
vpsubq %ymm1, %ymm14, %ymm2
vmovq %xmm13, %rsi
vmovq %xmm2, %rbp
cmpq %rbp, %rsi
cmovgq %rsi, %rbp
vpextrq $0x1, %xmm13, %rdi
vpextrq $0x1, %xmm2, %r13
cmpq %r13, %rdi
cmovgq %rdi, %r13
vextracti128 $0x1, %ymm13, %xmm10
vmovq %xmm10, %r11
vextracti128 $0x1, %ymm2, %xmm2
vmovq %xmm2, %rbx
cmpq %rbx, %r11
cmovgq %r11, %rbx
vpextrq $0x1, %xmm10, %rax
vmovq %r13, %xmm10
vpextrq $0x1, %xmm2, %r13
cmpq %r13, %rax
cmovgq %rax, %r13
vmovq %rbp, %xmm2
vpunpcklqdq %xmm10, %xmm2, %xmm2 # xmm2 = xmm2[0],xmm10[0]
vmovq %r13, %xmm10
vmovq %rbx, %xmm11
vpunpcklqdq %xmm10, %xmm11, %xmm10 # xmm10 = xmm11[0],xmm10[0]
vmovdqa %xmm10, 0x10(%rcx,%rdx)
vmovdqa %xmm2, (%rcx,%rdx)
movq 0x20(%rsp), %rcx
vmovdqa (%rcx,%rdx), %ymm2
vpsubq %ymm1, %ymm2, %ymm2
vmovq %xmm2, %rbx
cmpq %rbx, %rsi
cmovgq %rsi, %rbx
vpextrq $0x1, %xmm2, %r13
cmpq %r13, %rdi
cmovgq %rdi, %r13
vextracti128 $0x1, %ymm2, %xmm10
vmovq %xmm10, %rbp
cmpq %rbp, %r11
cmovgq %r11, %rbp
vmovq %r13, %xmm11
movq 0x70(%rsp), %r13
vmovq %rbx, %xmm14
vpextrq $0x1, %xmm10, %rbx
cmpq %rbx, %rax
cmovgq %rax, %rbx
vmovq %rbx, %xmm10
vmovq %rbp, %xmm15
vpunpcklqdq %xmm10, %xmm15, %xmm10 # xmm10 = xmm15[0],xmm10[0]
movq 0x8(%rsp), %rcx
vmovdqa %xmm10, 0x10(%rcx,%rdx)
vpunpcklqdq %xmm11, %xmm14, %xmm10 # xmm10 = xmm14[0],xmm11[0]
vmovdqa %xmm10, (%rcx,%rdx)
movq 0x28(%rsp), %rcx
cmpq 0xa8(%rsp), %rcx
jae 0x58e418
vpcmpgtq %ymm2, %ymm13, %ymm2
vbroadcastsd 0x6cf8f(%rip), %ymm10 # 0x5fb390
vblendvpd %ymm2, %ymm0, %ymm10, %ymm2
movq 0x10(%r13), %rbx
movq (%rbx), %rbx
addq 0x68(%rsp), %rbx
vmovapd %ymm2, (%rdx,%rbx)
vpsubq %ymm1, %ymm12, %ymm14
vmovq %xmm14, %rbp
cmpq %rbp, %rsi
cmovgq %rsi, %rbp
vpextrq $0x1, %xmm14, %rsi
cmpq %rsi, %rdi
cmovgq %rdi, %rsi
vextracti128 $0x1, %ymm14, %xmm2
vmovq %xmm2, %rdi
cmpq %rdi, %r11
cmovgq %r11, %rdi
vpextrq $0x1, %xmm2, %r11
cmpq %r11, %rax
cmovgq %rax, %r11
movq 0x60(%rsp), %rcx
cmpq 0x98(%rsp), %rcx
jae 0x58e484
movq 0x10(%r13), %rax
movq (%rax), %rax
addq %r9, %rax
vpcmpgtq %ymm14, %ymm13, %ymm2
vblendvpd %ymm2, %ymm7, %ymm8, %ymm2
vorpd 0x20(%rdx,%rax), %ymm2, %ymm2
vmovapd %ymm2, 0x20(%rdx,%rax)
vmovq %r12, %xmm2
vmovq %r14, %xmm10
vpunpcklqdq %xmm2, %xmm10, %xmm2 # xmm2 = xmm10[0],xmm2[0]
vmovq %r10, %xmm10
vmovq %r8, %xmm11
vpunpcklqdq %xmm10, %xmm11, %xmm10 # xmm10 = xmm11[0],xmm10[0]
vinserti128 $0x1, %xmm2, %ymm10, %ymm11
vmovq %r11, %xmm2
vmovq %rdi, %xmm10
vpunpcklqdq %xmm2, %xmm10, %xmm2 # xmm2 = xmm10[0],xmm2[0]
vmovq %rsi, %xmm10
vmovq %rbp, %xmm12
vpunpcklqdq %xmm10, %xmm12, %xmm10 # xmm10 = xmm12[0],xmm10[0]
vinserti128 $0x1, %xmm2, %ymm10, %ymm12
movq 0x18(%rsp), %rax
vmovdqa (%rax,%rdx), %ymm2
addq $0x20, %rdx
incq %rcx
cmpq %rdx, 0xa0(%rsp)
jne 0x58e13f
xorl %esi, %esi
vmovdqa %ymm12, %ymm15
movl %esi, 0x60(%rsp)
vpermq $0x90, %ymm15, %ymm2    # ymm2 = ymm15[0,0,1,2]
vmovdqu 0x180(%rsp), %ymm1
vpblendd $0x3, %ymm1, %ymm2, %ymm15 # ymm15 = ymm1[0,1],ymm2[2,3,4,5,6,7]
vpermq $0x90, %ymm14, %ymm2    # ymm2 = ymm14[0,0,1,2]
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
vmovq %rax, %xmm10
vpblendd $0x3, %ymm10, %ymm2, %ymm14 # ymm14 = ymm10[0,1],ymm2[2,3,4,5,6,7]
vpermq $0x90, %ymm12, %ymm2    # ymm2 = ymm12[0,0,1,2]
vpblendd $0x3, %ymm1, %ymm2, %ymm12 # ymm12 = ymm1[0,1],ymm2[2,3,4,5,6,7]
vpermq $0x90, %ymm13, %ymm2    # ymm2 = ymm13[0,0,1,2]
vpblendd $0x3, %ymm1, %ymm2, %ymm13 # ymm13 = ymm1[0,1],ymm2[2,3,4,5,6,7]
movq 0xd8(%rsp), %rax
vmovdqa (%rax), %ymm2
vperm2i128 $0x8, %ymm2, %ymm2, %ymm10 # ymm10 = zero,zero,ymm2[0,1]
vpalignr $0x8, %ymm10, %ymm2, %ymm2 # ymm2 = ymm10[8,9,10,11,12,13,14,15],ymm2[0,1,2,3,4,5,6,7],ymm10[24,25,26,27,28,29,30,31],ymm2[16,17,18,19,20,21,22,23]
xorl %r14d, %r14d
vmovq %xmm12, %rcx
movq (%r15,%r14), %rax
cmpq %rcx, %rax
cmovgq %rax, %rcx
vpextrq $0x1, %xmm12, %r8
movq 0x8(%r15,%r14), %rax
cmpq %r8, %rax
cmovgq %rax, %r8
movq 0x10(%r15,%r14), %rax
vextracti128 $0x1, %ymm12, %xmm10
vmovq %xmm10, %r10
cmpq %r10, %rax
cmovgq %rax, %r10
vpextrq $0x1, %xmm10, %rdx
movq 0x18(%r15,%r14), %rax
cmpq %rdx, %rax
cmovgq %rax, %rdx
vmovq %rdx, %xmm10
vmovq %r10, %xmm1
vpunpcklqdq %xmm10, %xmm1, %xmm1 # xmm1 = xmm1[0],xmm10[0]
vmovq %r8, %xmm10
vmovq %rcx, %xmm3
vpunpcklqdq %xmm10, %xmm3, %xmm3 # xmm3 = xmm3[0],xmm10[0]
vinserti128 $0x1, %xmm1, %ymm3, %ymm10
vmovdqa %ymm10, (%r15,%r14)
movq 0x100(%rsp), %rax
vpaddq (%rax,%r14), %ymm2, %ymm1
vmovq %xmm1, %rax
movq %rax, %rsi
sarq $0x3f, %rsi
andnq %rax, %rsi, %rax
vpextrq $0x1, %xmm1, %rsi
movq %rsi, %rdi
sarq $0x3f, %rdi
andnq %rsi, %rdi, %rsi
vextracti128 $0x1, %ymm1, %xmm1
vmovq %xmm1, %rdi
movq %rdi, %r11
sarq $0x3f, %r11
andnq %rdi, %r11, %rdi
vpextrq $0x1, %xmm1, %r11
movq %r11, %rbx
sarq $0x3f, %rbx
andnq %r11, %rbx, %r11
vmovq %r11, %xmm1
vmovq %rdi, %xmm2
vpunpcklqdq %xmm1, %xmm2, %xmm1 # xmm1 = xmm2[0],xmm1[0]
vmovq %rsi, %xmm2
vmovq %rax, %xmm3
vpunpcklqdq %xmm2, %xmm3, %xmm2 # xmm2 = xmm3[0],xmm2[0]
vinserti128 $0x1, %xmm1, %ymm2, %ymm1
vpcmpeqq %ymm12, %ymm10, %ymm2
vpcmpeqq %ymm1, %ymm10, %ymm1
vpandn %ymm2, %ymm1, %ymm1
movq 0x10(%r13), %rax
movq (%rax), %rax
addq %r9, %rax
movq 0x48(%rsp), %rsi
vmovapd (%rsi,%r14), %ymm2
vblendvpd %ymm1, %ymm5, %ymm2, %ymm1
vandpd (%r14,%rax), %ymm6, %ymm2
vmovapd %ymm1, (%rsi,%r14)
vorpd %ymm2, %ymm1, %ymm1
movq 0x10(%r13), %rax
movq (%rax), %rax
addq %r9, %rax
vmovapd %ymm1, (%r14,%rax)
vmovq %xmm11, %rax
cmpq %rax, %rcx
cmovleq %rax, %rcx
vpextrq $0x1, %xmm11, %rax
cmpq %rax, %r8
cmovleq %rax, %r8
vextracti128 $0x1, %ymm11, %xmm1
vmovq %xmm1, %rax
cmpq %rax, %r10
cmovleq %rax, %r10
vpextrq $0x1, %xmm1, %rax
cmpq %rax, %rdx
jg 0x58e6ca
movq %rax, %rdx
movq 0x10(%r13), %rax
movq (%rax), %rax
addq %r9, %rax
vpcmpgtq %ymm14, %ymm13, %ymm1
vblendvpd %ymm1, %ymm7, %ymm8, %ymm1
vandpd (%r14,%rax), %ymm9, %ymm2
vorpd %ymm1, %ymm2, %ymm1
vmovapd %ymm1, (%r14,%rax)
vpsubq 0x120(%rsp), %ymm10, %ymm13
movq 0x20(%rsp), %rax
vmovdqa (%rax,%r14), %ymm1
vpsubq 0xe0(%rsp), %ymm1, %ymm2
vmovq %xmm13, %rsi
vmovq %xmm2, %rbx
cmpq %rbx, %rsi
cmovgq %rsi, %rbx
vpextrq $0x1, %xmm13, %rdi
vpextrq $0x1, %xmm2, %r12
cmpq %r12, %rdi
cmovgq %rdi, %r12
vextracti128 $0x1, %ymm13, %xmm1
vmovq %xmm1, %r11
vextracti128 $0x1, %ymm2, %xmm3
vmovq %xmm3, %r13
cmpq %r13, %r11
cmovgq %r11, %r13
vpextrq $0x1, %xmm1, %rax
vpextrq $0x1, %xmm3, %rbp
cmpq %rbp, %rax
cmovgq %rax, %rbp
vmovq %r12, %xmm1
vmovq %rbp, %xmm3
vmovq %r13, %xmm10
movq 0x70(%rsp), %r13
vpunpcklqdq %xmm3, %xmm10, %xmm3 # xmm3 = xmm10[0],xmm3[0]
vmovq %rbx, %xmm10
movq 0x8(%rsp), %rbx
vmovdqa %xmm3, 0x10(%rbx,%r14)
vpunpcklqdq %xmm1, %xmm10, %xmm1 # xmm1 = xmm10[0],xmm1[0]
vmovdqa %xmm1, (%rbx,%r14)
movq 0x28(%rsp), %rbx
cmpq 0xa8(%rsp), %rbx
jae 0x58e7c8
vpcmpgtq %ymm2, %ymm13, %ymm1
vbroadcastsd 0x6cbe0(%rip), %ymm2 # 0x5fb390
vblendvpd %ymm1, %ymm0, %ymm2, %ymm1
movq 0x10(%r13), %rbx
movq (%rbx), %rbx
addq 0x68(%rsp), %rbx
vmovapd %ymm1, (%r14,%rbx)
vmovq %rdx, %xmm1
vmovq %r10, %xmm2
vpunpcklqdq %xmm1, %xmm2, %xmm1 # xmm1 = xmm2[0],xmm1[0]
vmovq %r8, %xmm2
vmovq %rcx, %xmm3
vpunpcklqdq %xmm2, %xmm3, %xmm2 # xmm2 = xmm3[0],xmm2[0]
vinserti128 $0x1, %xmm1, %ymm2, %ymm11
vmovdqu 0xe0(%rsp), %ymm2
vpsubq %ymm2, %ymm12, %ymm10
vpcmpgtq %ymm10, %ymm13, %ymm1
vpmovmskb %ymm1, %ebx
xorl $-0x1, %ebx
setne %r12b
je 0x58e89a
vpsubq %ymm2, %ymm15, %ymm14
vmovq %xmm14, %rbp
cmpq %rbp, %rsi
jg 0x58e81e
movq %rbp, %rsi
vpextrq $0x1, %xmm14, %rbp
cmpq %rbp, %rdi
jg 0x58e82c
movq %rbp, %rdi
vextracti128 $0x1, %ymm14, %xmm2
vmovq %xmm2, %rbp
cmpq %rbp, %r11
jg 0x58e83f
movq %rbp, %r11
vpextrq $0x1, %xmm2, %rbp
cmpq %rbp, %rax
jg 0x58e84d
movq %rbp, %rax
vmovq %rax, %xmm1
vmovq %r11, %xmm2
vpunpcklqdq %xmm1, %xmm2, %xmm1 # xmm1 = xmm2[0],xmm1[0]
vmovq %rdi, %xmm2
vmovq %rsi, %xmm3
vpunpcklqdq %xmm2, %xmm3, %xmm2 # xmm2 = xmm3[0],xmm2[0]
vinserti128 $0x1, %xmm1, %ymm2, %ymm15
movq 0x18(%rsp), %rax
vmovdqa (%rax,%r14), %ymm2
addq $0x20, %r14
vmovdqa %ymm10, %ymm12
cmpq %r14, 0xa0(%rsp)
jne 0x58e557
xorl %eax, %eax
vmovdqa %ymm10, %ymm12
jmp 0x58e89f
movl $0x21, %eax
vpxor %xmm3, %xmm3, %xmm3
testl %eax, %eax
movl 0x60(%rsp), %esi
jne 0x58e8b8
incl %esi
cmpl $0x4, %esi
jne 0x58e4f0
jmp 0x58e8bd
cmpl $0x21, %eax
jne 0x58e8fa
vpcmpgtq 0x140(%rsp), %ymm11, %ymm1
movb $0x1, %r12b
vtestpd %ymm1, %ymm1
je 0x58e8fa
cmpq %rcx, %r10
cmovgq %r10, %rcx
cmpq %r8, %rdx
cmovgq %rdx, %r8
cmpq %rcx, %r8
cmovleq %rcx, %r8
cmpq 0x50(%rsp), %r8
movq %r8, 0x30(%rsp)
jle 0x58e901
orb $0x40, 0xc(%r13)
xorl %r12d, %r12d
movl 0x14(%rsp), %r10d
jmp 0x58e91f
vmovq %r8, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovdqu %ymm1, 0x140(%rsp)
movq 0x80(%rsp), %rax
movl %eax, %r10d
testb %r12b, %r12b
je 0x58e957
movq 0xc0(%rsp), %rdx
addq %rdx, 0x68(%rsp)
addq %rdx, %r9
movq 0x28(%rsp), %rax
movq %rax, %rbx
movq 0x8(%rsp), %r12
cmpq 0x58(%rsp), %rax
vmovdqu 0xe0(%rsp), %ymm1
jne 0x58e07d
jmp 0x58e964
movq 0x80(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x78(%rsp), %r14
movl %r10d, %ebp
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, 0x30(%rsp)
movq 0xb8(%rsp), %rbx
movq 0xb0(%rsp), %r12
jne 0x58e992
orb $0x40, 0xc(%r13)
movq %r13, %rdi
vzeroupper
callq 0x20a805
xorl %ecx, %ecx
testl %eax, %eax
je 0x58e9bc
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rbp
xorl %r8d, %r8d
xorl %ebx, %ebx
movq 0x8(%rsp), %r12
jmp 0x58ea80
movq 0x58(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movl %ebp, %r8d
cmpl %ecx, %ebp
movq 0x38(%rsp), %rdx
movq %rdx, %rdi
movq 0x18(%rsp), %rcx
cmoveq %rcx, %rdi
movq %rcx, %rbp
cmoveq %rdx, %rbp
cmpl %eax, %r8d
cmoveq %r15, %rdi
cmoveq %rcx, %rbp
cmoveq %rdx, %r15
decl %ebx
testl $0x7ffffffc, %r12d      # imm = 0x7FFFFFFC
je 0x58ea73
movl %r14d, %eax
andl $0x1fffffff, %eax       # imm = 0x1FFFFFFF
shll $0x2, %eax
xorl %ecx, %ecx
movq 0x8(%rsp), %r12
movq 0x30(%rsp), %r9
cmpq %r9, (%rdi,%rcx,8)
jne 0x58ea30
movl %ecx, %edx
shrl $0x2, %edx
movl %ecx, %esi
andl $0x3, %esi
imull %r14d, %esi
addl %edx, %esi
cmpl %ebx, %esi
cmovll %esi, %ebx
incq %rcx
cmpl %ecx, %eax
jne 0x58ea15
jmp 0x58ea7d
callq 0x1fa449
jmp 0x58ea6f
callq 0x1fa423
jmp 0x58ea6f
callq 0x1fa3fd
jmp 0x58ea6f
callq 0x1fa3d7
jmp 0x58ea6f
callq 0x1fa3b1
jmp 0x58ea6f
callq 0x1fa38b
jmp 0x58ea6f
callq 0x1fa365
jmp 0x58ea6f
callq 0x1fa33f
xorl %eax, %eax
jmp 0x58eaca
movq 0x8(%rsp), %r12
movq 0x30(%rsp), %r9
movl %r9d, %ecx
movl %ecx, (%r13)
movl %ebx, 0x4(%r13)
movl %r8d, 0x8(%r13)
callq 0x2094b5
movq 0x48(%rsp), %rdi
callq 0x2094b5
movq 0x20(%rsp), %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq 0x40(%rsp), %rdi
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
movq %r13, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq