// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_trace_striped_sse2_128_64.c
// Function: parasail_nw_trace_striped_profile_sse2_128_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 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;
    __m128i* restrict vProfile = NULL;
    __m128i* restrict pvHStore = NULL;
    __m128i* restrict pvHLoad = NULL;
    __m128i* restrict pvE = NULL;
    __m128i* restrict pvEaStore = NULL;
    __m128i* restrict pvEaLoad = NULL;
    __m128i* restrict pvHT = NULL;
    int64_t* restrict boundary = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int64_t NEG_LIMIT = 0;
    int64_t POS_LIMIT = 0;
    int64_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    parasail_result_t *result = NULL;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;
    __m128i vTMask;
    __m128i 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;
    s1Len = profile->s1Len;
    end_query = s1Len-1;
    end_ref = s2Len-1;
    matrix = profile->matrix;
    segWidth = 2; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    vProfile = (__m128i*)profile->profile64.score;
    vGapO = _mm_set1_epi64x_rpl(open);
    vGapE = _mm_set1_epi64x_rpl(gap);
    NEG_LIMIT = (-open < matrix->min ? INT64_MIN + open : INT64_MIN - matrix->min) + 1;
    POS_LIMIT = INT64_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi64x_rpl(NEG_LIMIT);
    vPosLimit = _mm_set1_epi64x_rpl(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vTIns  = _mm_set1_epi64x_rpl(PARASAIL_INS);
    vTDel  = _mm_set1_epi64x_rpl(PARASAIL_DEL);
    vTDiag = _mm_set1_epi64x_rpl(PARASAIL_DIAG);
    vTDiagE = _mm_set1_epi64x_rpl(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi64x_rpl(PARASAIL_INS_E);
    vTDiagF = _mm_set1_epi64x_rpl(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi64x_rpl(PARASAIL_DEL_F);
    vTMask = _mm_set1_epi64x_rpl(PARASAIL_ZERO_MASK);
    vFTMask = _mm_set1_epi64x_rpl(PARASAIL_F_MASK);

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

    /* set known flags */
    result->flag |= PARASAIL_FLAG_NW | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_2;

    /* initialize heap variables */
    pvHStore = parasail_memalign___m128i(16, segLen);
    pvHLoad = parasail_memalign___m128i(16, segLen);
    pvE = parasail_memalign___m128i(16, segLen);
    pvEaStore = parasail_memalign___m128i(16, segLen);
    pvEaLoad = parasail_memalign___m128i(16, segLen);
    pvHT = parasail_memalign___m128i(16, segLen);
    boundary = parasail_memalign_int64_t(16, 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;
            __m128i_64_t h;
            __m128i_64_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = -open-gap*(segNum*segLen+i);
                h.v[segNum] = tmp < INT64_MIN ? INT64_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT64_MIN ? INT64_MIN : tmp;
            }
            _mm_store_si128(&pvHStore[index], h.m);
            _mm_store_si128(&pvE[index], e.m);
            _mm_store_si128(&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 < INT64_MIN ? INT64_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) {
        __m128i vEF_opn;
        __m128i vE;
        __m128i vE_ext;
        __m128i vF;
        __m128i vF_ext;
        __m128i vFa;
        __m128i vFa_ext;
        __m128i vH;
        __m128i vH_dag;
        const __m128i* 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 8 bytes */
        vH = _mm_load_si128(&pvHStore[segLen - 1]);
        vH = _mm_slli_si128(vH, 8);

        /* insert upper boundary condition */
        vH = _mm_insert_epi64_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 = _mm_load_si128(pvE + i);

            /* Get max from vH, vE and vF. */
            vH_dag = _mm_add_epi64(vH, _mm_load_si128(vP + i));
            vH = _mm_max_epi64_rpl(vH_dag, vE);
            vH = _mm_max_epi64_rpl(vH, vF);
            /* Save vH values. */
            _mm_store_si128(pvHStore + i, vH);
            vSaturationCheckMax = _mm_max_epi64_rpl(vSaturationCheckMax, vH);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vE);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vF);

            {
                __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                __m128i case1 = _mm_cmpeq_epi64_rpl(vH, vH_dag);
                __m128i case2 = _mm_cmpeq_epi64_rpl(vH, vF);
                __m128i vT = _mm_blendv_epi8_rpl(
                        _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                        vTDiag, case1);
                _mm_store_si128(pvHT + i, vT);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i, segLen, j);
            }

            vEF_opn = _mm_sub_epi64(vH, vGapO);

            /* Update vE value. */
            vE_ext = _mm_sub_epi64(vE, vGapE);
            vE = _mm_max_epi64_rpl(vEF_opn, vE_ext);
            _mm_store_si128(pvE + i, vE);
            {
                __m128i vEa = _mm_load_si128(pvEaLoad + i);
                __m128i vEa_ext = _mm_sub_epi64(vEa, vGapE);
                vEa = _mm_max_epi64_rpl(vEF_opn, vEa_ext);
                _mm_store_si128(pvEaStore + i, vEa);
                if (j+1<s2Len) {
                    __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vEa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                    arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                }
            }

            /* Update vF value. */
            vF_ext = _mm_sub_epi64(vF, vGapE);
            vF = _mm_max_epi64_rpl(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m128i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vF_ext);
                __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i+1, segLen, j);
            }

            /* Load the next vH. */
            vH = _mm_load_si128(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;
            int64_t tmp2 = tmp < INT64_MIN ? INT64_MIN : tmp;
            __m128i vHp = _mm_load_si128(&pvHLoad[segLen - 1]);
            vHp = _mm_slli_si128(vHp, 8);
            vHp = _mm_insert_epi64_rpl(vHp, boundary[j], 0);
            vEF_opn = _mm_slli_si128(vEF_opn, 8);
            vEF_opn = _mm_insert_epi64_rpl(vEF_opn, tmp2, 0);
            vF_ext = _mm_slli_si128(vF_ext, 8);
            vF_ext = _mm_insert_epi64_rpl(vF_ext, NEG_LIMIT, 0);
            vF = _mm_slli_si128(vF, 8);
            vF = _mm_insert_epi64_rpl(vF, tmp2, 0);
            vFa_ext = _mm_slli_si128(vFa_ext, 8);
            vFa_ext = _mm_insert_epi64_rpl(vFa_ext, NEG_LIMIT, 0);
            vFa = _mm_slli_si128(vFa, 8);
            vFa = _mm_insert_epi64_rpl(vFa, tmp2, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm_load_si128(pvHStore + i);
                vH = _mm_max_epi64_rpl(vH,vF);
                _mm_store_si128(pvHStore + i, vH);
                vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vH);
                vSaturationCheckMax = _mm_max_epi64_rpl(vSaturationCheckMax, vH);
                {
                    __m128i vTAll;
                    __m128i vT;
                    __m128i case1;
                    __m128i case2;
                    __m128i cond;
                    vHp = _mm_add_epi64(vHp, _mm_load_si128(vP + i));
                    case1 = _mm_cmpeq_epi64_rpl(vH, vHp);
                    case2 = _mm_cmpeq_epi64_rpl(vH, vF);
                    cond = _mm_andnot_si128(case1,case2);
                    vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    vT = _mm_load_si128(pvHT + i);
                    vT = _mm_blendv_epi8_rpl(vT, vTDel, cond);
                    _mm_store_si128(pvHT + i, vT);
                    vTAll = _mm_and_si128(vTAll, vTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                /* Update vF value. */
                {
                    __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vFa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                    vTAll = _mm_and_si128(vTAll, vFTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vEF_opn = _mm_sub_epi64(vH, vGapO);
                vF_ext = _mm_sub_epi64(vF, vGapE);
                {
                    __m128i vEa = _mm_load_si128(pvEaLoad + i);
                    __m128i vEa_ext = _mm_sub_epi64(vEa, vGapE);
                    vEa = _mm_max_epi64_rpl(vEF_opn, vEa_ext);
                    _mm_store_si128(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vEa_ext);
                        __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                        arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                    }
                }
                if (! _mm_movemask_epi8(
                            _mm_or_si128(
                                _mm_cmpgt_epi64_rpl(vF_ext, vEF_opn),
                                _mm_cmpeq_epi64_rpl(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm_max_epi64_rpl(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm_sub_epi64(vFa, vGapE);
                vFa = _mm_max_epi64_rpl(vEF_opn, vFa_ext);
                vHp = _mm_load_si128(pvHLoad + i);
            }
        }
end:
        {
        }
    }

    /* extract last value from the last column */
    {
        __m128i vH = _mm_load_si128(pvHStore + offset);
        for (k=0; k<position; ++k) {
            vH = _mm_slli_si128 (vH, 8);
        }
        score = (int64_t) _mm_extract_epi64_rpl (vH, 1);
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi64_rpl(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi64_rpl(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 $0x108, %rsp            # imm = 0x108
movq %rsi, 0x80(%rsp)
testq %rdi, %rdi
je 0x3b6df2
movq 0x60(%rdi), %rax
movq %rax, 0xb0(%rsp)
testq %rax, %rax
je 0x3b6df9
movq 0x10(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x3b6e00
movl 0x8(%rdi), %r14d
testl %r14d, %r14d
jle 0x3b6e07
cmpq $0x0, 0x80(%rsp)
je 0x3b6e0e
movl %edx, %r12d
testl %edx, %edx
jle 0x3b6e15
movl %ecx, %r13d
testl %ecx, %ecx
js 0x3b6e1c
testl %r8d, %r8d
js 0x3b6e23
movl %r8d, 0x8(%rsp)
leal -0x1(%r14), %eax
incq %r14
shrq %r14
movl %eax, 0x60(%rsp)
xorl %edx, %edx
divl %r14d
movl %eax, 0x64(%rsp)
movl %edx, %ebp
movl %r13d, %ecx
negl %r13d
movq 0x78(%rsp), %rsi
movslq 0x20(%rsi), %rax
movq %rcx, 0x88(%rsp)
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
subq %rax, %r15
cmpl %r13d, %eax
cmovgq %rcx, %r15
movslq 0x1c(%rsi), %rax
movq %rax, 0x50(%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movl %r14d, %edi
movl %r12d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x3b6e28
movq %rax, %rbx
movl %r13d, 0x20(%rsp)
movl %ebp, 0x5c(%rsp)
movq %r15, 0x68(%rsp)
orl $0x2880801, 0xc(%rax)   # imm = 0x2880801
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, 0x48(%rsp)
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, %r15
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %r12, %rbp
movq %rax, %r12
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, (%rsp)
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, 0x18(%rsp)
movl $0x10, %edi
movq %r14, %rsi
callq 0x2f600c
movq %rax, %r13
movq %r14, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
leal 0x1(%rbp), %r14d
movl $0x10, %edi
movq %r14, %rsi
callq 0x20a636
movq 0x48(%rsp), %r10
movq %r10, %xmm0
movq %r15, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %r12, %xmm1
movq (%rsp), %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
pxor %xmm2, %xmm2
cmpq $0x0, 0x18(%rsp)
sete %dil
movq %r13, 0x40(%rsp)
testq %r13, %r13
sete %cl
testq %rax, %rax
sete %dl
pcmpeqd %xmm2, %xmm0
pcmpeqd %xmm2, %xmm1
movdqa %xmm0, %xmm2
shufps $0xdd, %xmm1, %xmm2     # xmm2 = xmm2[1,3],xmm1[1,3]
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
andps %xmm2, %xmm0
movmskps %xmm0, %esi
testl %esi, %esi
setne %sil
orb %dil, %cl
orb %dl, %cl
orb %sil, %cl
jne 0x3b6e28
movq %r14, 0x10(%rsp)
movq %rax, 0x70(%rsp)
movq 0x28(%rsp), %rax
decl %eax
movl %eax, 0x58(%rsp)
movq 0x88(%rsp), %r8
movq %r8, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movl 0x8(%rsp), %edx
movd %edx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movq 0x68(%rsp), %rax
leaq 0x1(%rax), %rcx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
subq 0x50(%rsp), %rax
addq $-0x2, %rax
movq %rcx, 0xb8(%rsp)
movq %rcx, %xmm2
pshufd $0x44, %xmm2, %xmm2     # xmm2 = xmm2[0,1,0,1]
movdqa %xmm2, 0xf0(%rsp)
movq %rax, 0x98(%rsp)
movq %rax, %xmm2
pshufd $0x44, %xmm2, %xmm14    # xmm14 = xmm2[0,1,0,1]
movl %edx, %eax
movslq 0x20(%rsp), %rcx
movq %r8, %rdx
negq %rdx
movq 0x30(%rsp), %r13
movq %r13, %rsi
imulq %rax, %rsi
negq %rsi
movq %rsi, %rdi
subq %r8, %rdi
shlq $0x4, %r13
xorl %r8d, %r8d
movq %rcx, %r9
movq (%rsp), %r14
movq %r10, %rbp
leaq (%rdx,%r9), %r10
leaq (%rsi,%r9), %r11
movq %r11, %xmm2
movq %r9, %xmm3
punpcklqdq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0]
leaq (%rdi,%r9), %r11
movq %r11, %xmm2
movq %r10, %xmm4
movq %rbp, %r10
punpcklqdq %xmm2, %xmm4    # xmm4 = xmm4[0],xmm2[0]
movdqa %xmm3, (%rbp,%r8)
movdqa %xmm4, (%r12,%r8)
movdqa %xmm4, (%r14,%r8)
subq %rax, %r9
addq $0x10, %r8
cmpq %r8, %r13
jne 0x3b635e
movq 0x70(%rsp), %rdi
movq $0x0, (%rdi)
movl 0x28(%rsp), %r9d
movq 0x10(%rsp), %r11
andl $-0x2, %r11d
leaq -0x1(%r9), %rdx
movq %rdx, %xmm2
pshufd $0x44, %xmm2, %xmm2     # xmm2 = xmm2[0,1,0,1]
movq %rax, %rdx
negq %rdx
addq %rax, %rax
xorl %esi, %esi
movdqa 0x272aaa(%rip), %xmm3   # 0x628e90
movdqa 0x272ab2(%rip), %xmm4   # 0x628ea0
pxor %xmm4, %xmm2
pcmpeqd %xmm5, %xmm5
movq %rsi, %xmm6
pshufd $0x44, %xmm6, %xmm6     # xmm6 = xmm6[0,1,0,1]
por %xmm3, %xmm6
pxor %xmm4, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm2, %xmm7
pcmpeqd %xmm2, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %r8d
notl %r8d
testb $0x1, %r8b
je 0x3b643c
movq %rcx, 0x8(%rdi,%rsi,8)
pxor %xmm5, %xmm6
pextrw $0x4, %xmm6, %r8d
testb $0x1, %r8b
je 0x3b6455
leaq (%rdx,%rcx), %r8
movq %r8, 0x10(%rdi,%rsi,8)
addq $0x2, %rsi
subq %rax, %rcx
cmpq %rsi, %r11
jne 0x3b63f6
xorl %eax, %eax
movdqa 0x272a75(%rip), %xmm5   # 0x628ee0
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
movdqa %xmm5, (%rcx,%rax)
addq $0x10, %rax
cmpq %rax, %r13
jne 0x3b646b
movq 0x30(%rsp), %rax
leal -0x1(%rax), %ecx
movq $0x0, 0x8(%rsp)
shlq $0x4, %rcx
movq %rcx, 0xa8(%rsp)
cltq
movq %rax, 0xa0(%rsp)
movdqa 0x273c71(%rip), %xmm4   # 0x62a120
movdqa 0x2729f9(%rip), %xmm7   # 0x628eb0
movdqa 0x2734d1(%rip), %xmm6   # 0x629990
movdqa 0x275208(%rip), %xmm8   # 0x62b6d0
movdqa 0x27520f(%rip), %xmm13  # 0x62b6e0
movq %r13, 0x38(%rsp)
xorl %r11d, %r11d
movdqa 0xf0(%rsp), %xmm9
movq 0x18(%rsp), %r14
movq (%rsp), %rax
movq %rbx, 0x90(%rsp)
movq %r13, 0xd8(%rsp)
movq %r9, 0xd0(%rsp)
movq %r14, %r8
movq %rax, %r14
movq %r15, 0x20(%rsp)
movq %r10, %r15
movq 0xa8(%rsp), %rax
leaq (%r10,%rax), %rcx
movq %rcx, 0xc0(%rsp)
movq (%rdi,%r11,8), %xmm11
punpcklqdq (%r10,%rax), %xmm11 # xmm11 = xmm11[0],mem[0]
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x80(%rsp), %rcx
movzbl (%rcx,%r11), %ecx
movslq (%rax,%rcx,4), %rax
imulq 0xa0(%rsp), %rax
shlq $0x4, %rax
addq 0xb0(%rsp), %rax
movq %rax, (%rsp)
movq %r11, 0xc8(%rsp)
incq %r11
movl $0x1, %ecx
xorl %r10d, %r10d
movdqa 0xf0(%rsp), %xmm10
movq %r15, 0xe8(%rsp)
movq %r14, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %r11, 0xe0(%rsp)
movq %rcx, 0x50(%rsp)
movdqa (%r12,%r10), %xmm2
movq (%rsp), %rax
paddq (%rax,%r10), %xmm11
movq %xmm11, %r8
movq (%r12,%r10), %rbx
cmpq %rbx, %r8
movq %rbx, %r13
cmovgq %r8, %r13
movq 0x8(%r12,%r10), %rdi
pshufd $0xee, %xmm11, %xmm3    # xmm3 = xmm11[2,3,2,3]
movq %xmm3, %r15
cmpq %rdi, %r15
movq %rdi, %rax
cmovgq %r15, %rax
movq %xmm10, %r9
cmpq %r9, %r13
movq %r9, %rcx
cmovgq %r13, %rcx
pshufd $0xee, %xmm10, %xmm3    # xmm3 = xmm10[2,3,2,3]
movq %xmm3, %r14
cmpq %r14, %rax
movq %r12, %r11
movq %r14, %r12
cmovgq %rax, %r12
movq %xmm9, %rdx
cmpq %rcx, %rdx
cmovleq %rcx, %rdx
movq %rdx, 0x28(%rsp)
pshufd $0xee, %xmm9, %xmm3     # xmm3 = xmm9[2,3,2,3]
movq %xmm3, %rdx
cmpq %r12, %rdx
cmovleq %r12, %rdx
movq %rdx, 0x48(%rsp)
movq %xmm14, %rbp
cmpq %rcx, %rbp
cmovgeq %rcx, %rbp
pshufd $0xee, %xmm14, %xmm3    # xmm3 = xmm14[2,3,2,3]
movq %xmm3, %rsi
cmpq %r12, %rsi
cmovgeq %r12, %rsi
movq %rcx, %xmm3
cmpq %rbx, %rbp
cmovgeq %rbx, %rbp
movq %r12, %xmm9
cmpq %rdi, %rsi
cmovgeq %rdi, %rsi
punpcklqdq %xmm9, %xmm3    # xmm3 = xmm3[0],xmm9[0]
cmpq %r9, %rbp
cmovgeq %r9, %rbp
movq 0x20(%rsp), %rdi
movdqa %xmm3, (%rdi,%r10)
cmpq %r14, %rsi
cmovgeq %r14, %rsi
movq 0x90(%rsp), %rdi
movq 0x10(%rdi), %rdi
movq (%rdi), %rbx
movq 0x8(%rsp), %rdx
addq %rdx, %rbx
xorl %edi, %edi
cmpq %r8, %rcx
sete %dil
negq %rdi
xorl %ecx, %ecx
cmpq %r15, %r12
movq %r11, %r12
movq 0xe0(%rsp), %r11
sete %cl
negq %rcx
xorl %r8d, %r8d
cmpq %r13, %r9
setge %r8b
negq %r8
xorl %r9d, %r9d
cmpq %rax, %r14
movq 0x18(%rsp), %r14
movq %rdi, %xmm9
movq %rcx, %xmm11
movq %r8, %xmm12
movq 0x10(%rsp), %r8
setge %r9b
negq %r9
movq %r9, %xmm14
movq 0xd0(%rsp), %r9
punpcklqdq %xmm11, %xmm9   # xmm9 = xmm9[0],xmm11[0]
punpcklqdq %xmm14, %xmm12  # xmm12 = xmm12[0],xmm14[0]
psrlq $0x3e, %xmm12
pxor %xmm4, %xmm12
movdqa %xmm9, %xmm11
pandn %xmm12, %xmm11
pand %xmm7, %xmm9
por %xmm11, %xmm9
movdqa (%r10,%rbx), %xmm11
movq 0x90(%rsp), %rbx
por %xmm9, %xmm11
movq 0x40(%rsp), %rax
movdqa %xmm9, (%rax,%r10)
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %rdx, %rax
movdqa %xmm11, (%r10,%rax)
psubq %xmm0, %xmm3
psubq %xmm1, %xmm2
movdqa %xmm3, %xmm9
pxor %xmm6, %xmm9
movdqa %xmm2, %xmm11
pxor %xmm6, %xmm11
movdqa %xmm9, %xmm12
pcmpgtd %xmm11, %xmm12
pshufd $0xa0, %xmm12, %xmm14   # xmm14 = xmm12[0,0,2,2]
pcmpeqd %xmm9, %xmm11
pshufd $0xf5, %xmm11, %xmm11   # xmm11 = xmm11[1,1,3,3]
pand %xmm14, %xmm11
pshufd $0xf5, %xmm12, %xmm12   # xmm12 = xmm12[1,1,3,3]
por %xmm11, %xmm12
movdqa %xmm3, %xmm11
pand %xmm12, %xmm11
pandn %xmm2, %xmm12
por %xmm11, %xmm12
movdqa %xmm12, (%r12,%r10)
movdqa (%r14,%r10), %xmm11
psubq %xmm1, %xmm11
movdqa %xmm11, %xmm2
pxor %xmm6, %xmm2
movdqa %xmm9, %xmm12
pcmpgtd %xmm2, %xmm12
pshufd $0xa0, %xmm12, %xmm14   # xmm14 = xmm12[0,0,2,2]
pcmpeqd %xmm9, %xmm2
pshufd $0xf5, %xmm2, %xmm15    # xmm15 = xmm2[1,1,3,3]
pand %xmm14, %xmm15
pshufd $0xf5, %xmm12, %xmm2    # xmm2 = xmm12[1,1,3,3]
por %xmm15, %xmm2
movdqa %xmm2, %xmm12
pandn %xmm11, %xmm12
movdqa %xmm3, %xmm11
pand %xmm2, %xmm11
por %xmm12, %xmm11
movdqa %xmm11, (%r8,%r10)
cmpq %r9, %r11
jae 0x3b683e
movdqa %xmm2, %xmm11
pandn 0x274e9d(%rip), %xmm11  # 0x62b6c0
pand %xmm5, %xmm2
por %xmm11, %xmm2
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq 0x38(%rsp), %rax
movdqa %xmm2, (%r10,%rax)
movdqa %xmm10, %xmm15
psubq %xmm1, %xmm15
movdqa %xmm15, %xmm2
pxor %xmm6, %xmm2
movdqa %xmm9, %xmm10
pcmpgtd %xmm2, %xmm10
pshufd $0xa0, %xmm10, %xmm11   # xmm11 = xmm10[0,0,2,2]
pcmpeqd %xmm9, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pand %xmm11, %xmm2
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
por %xmm2, %xmm10
movq 0x50(%rsp), %rcx
cmpq 0x30(%rsp), %rcx
movq 0xe8(%rsp), %r15
movq 0xd8(%rsp), %r13
jae 0x3b68ca
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq 0x8(%rsp), %rax
movdqa %xmm10, %xmm2
pandn %xmm8, %xmm2
movdqa %xmm10, %xmm9
pand %xmm13, %xmm9
por %xmm2, %xmm9
por 0x10(%r10,%rax), %xmm9
movdqa %xmm9, 0x10(%r10,%rax)
movq 0x28(%rsp), %xmm9
movq 0x48(%rsp), %xmm2
punpcklqdq %xmm2, %xmm9    # xmm9 = xmm9[0],xmm2[0]
movq %rbp, %xmm14
movq %rsi, %xmm2
punpcklqdq %xmm2, %xmm14   # xmm14 = xmm14[0],xmm2[0]
movdqa %xmm3, %xmm2
pand %xmm10, %xmm2
pandn %xmm15, %xmm10
por %xmm2, %xmm10
movdqa (%r15,%r10), %xmm11
addq $0x10, %r10
incq %rcx
cmpq %r10, %r13
jne 0x3b659c
movb $0x1, %dl
movdqa %xmm10, %xmm11
movq 0x70(%rsp), %rdi
movq 0x20(%rsp), %rbp
movq (%rdi,%r11,8), %rax
subq 0x88(%rsp), %rax
movq %rax, %xmm2
movq 0xc8(%rsp), %rax
movq (%rdi,%rax,8), %xmm12
movq 0xc0(%rsp), %rax
punpcklqdq (%rax), %xmm12  # xmm12 = xmm12[0],mem[0]
movdqa %xmm2, %xmm13
punpcklqdq %xmm3, %xmm13   # xmm13 = xmm13[0],xmm3[0]
movdqa %xmm2, %xmm3
punpcklqdq %xmm11, %xmm3   # xmm3 = xmm3[0],xmm11[0]
movq 0xb8(%rsp), %xmm11
punpcklqdq %xmm15, %xmm11  # xmm11 = xmm11[0],xmm15[0]
punpcklqdq %xmm10, %xmm2   # xmm2 = xmm2[0],xmm10[0]
xorl %r10d, %r10d
movdqa %xmm11, %xmm15
movdqa %xmm2, %xmm10
movdqa %xmm3, %xmm11
movdqa %xmm13, %xmm3
movdqa (%rbp,%r10), %xmm7
movdqa %xmm11, %xmm2
pxor %xmm6, %xmm2
movdqa %xmm7, %xmm13
pxor %xmm6, %xmm13
movdqa %xmm13, %xmm4
pcmpgtd %xmm2, %xmm4
pcmpeqd %xmm2, %xmm13
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pshufd $0xf5, %xmm13, %xmm13   # xmm13 = xmm13[1,1,3,3]
pand %xmm2, %xmm13
pshufd $0xf5, %xmm4, %xmm2     # xmm2 = xmm4[1,1,3,3]
por %xmm13, %xmm2
pand %xmm2, %xmm7
pandn %xmm11, %xmm2
por %xmm7, %xmm2
movq %xmm11, %rax
xorl %ecx, %ecx
cmpq (%rbp,%r10), %rax
setge %cl
negq %rcx
pshufd $0xee, %xmm11, %xmm4    # xmm4 = xmm11[2,3,2,3]
movq %xmm4, %rax
xorl %esi, %esi
cmpq 0x8(%rbp,%r10), %rax
movdqa %xmm2, (%rbp,%r10)
movq (%rsp), %rax
paddq (%rax,%r10), %xmm12
setge %sil
negq %rsi
movq %rcx, %xmm4
movq %rsi, %xmm7
punpcklqdq %xmm7, %xmm4    # xmm4 = xmm4[0],xmm7[0]
pcmpeqd %xmm2, %xmm12
pshufd $0xb1, %xmm12, %xmm7    # xmm7 = xmm12[1,0,3,2]
pand %xmm12, %xmm7
pandn %xmm4, %xmm7
movq 0x10(%rbx), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
addq %rcx, %rax
movdqa (%r10,%rax), %xmm4
pand 0x275007(%rip), %xmm4   # 0x62ba60
movdqa %xmm7, %xmm12
movq 0x40(%rsp), %rax
pandn (%rax,%r10), %xmm12
pand 0x27247f(%rip), %xmm7   # 0x628ef0
por %xmm12, %xmm7
movdqa %xmm7, (%rax,%r10)
por %xmm4, %xmm7
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %rcx, %rax
movdqa %xmm7, (%r10,%rax)
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq %rcx, %rax
pxor %xmm6, %xmm15
pxor %xmm6, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm15, %xmm4
pcmpeqd %xmm15, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pand %xmm4, %xmm3
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm3, %xmm4
pand 0x274e75(%rip), %xmm4   # 0x62b940
movdqa (%r10,%rax), %xmm3
pand 0x274f97(%rip), %xmm3   # 0x62ba70
por %xmm4, %xmm3
pxor %xmm8, %xmm3
movdqa %xmm3, (%r10,%rax)
movdqa %xmm2, %xmm3
psubq %xmm0, %xmm3
movdqa (%r14,%r10), %xmm4
psubq %xmm1, %xmm4
movdqa %xmm3, %xmm12
pxor %xmm6, %xmm12
movdqa %xmm4, %xmm7
pxor %xmm6, %xmm7
movdqa %xmm12, %xmm13
pcmpgtd %xmm7, %xmm13
pshufd $0xa0, %xmm13, %xmm15   # xmm15 = xmm13[0,0,2,2]
pcmpeqd %xmm12, %xmm7
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
pand %xmm15, %xmm7
pshufd $0xf5, %xmm13, %xmm15   # xmm15 = xmm13[1,1,3,3]
por %xmm7, %xmm15
movdqa %xmm15, %xmm7
pandn %xmm4, %xmm7
movdqa %xmm3, %xmm4
pand %xmm15, %xmm4
por %xmm7, %xmm4
movdqa %xmm4, (%r8,%r10)
cmpq %r9, %r11
jae 0x3b6b80
movdqa %xmm15, %xmm4
pandn 0x274b5c(%rip), %xmm4   # 0x62b6c0
pand %xmm5, %xmm15
por %xmm4, %xmm15
movq 0x10(%rbx), %rax
movq (%rax), %rax
addq 0x38(%rsp), %rax
movdqa %xmm15, (%r10,%rax)
movdqa %xmm14, %xmm4
pxor %xmm6, %xmm14
movdqa %xmm2, %xmm15
pxor %xmm6, %xmm15
movdqa %xmm15, %xmm7
pcmpgtd %xmm14, %xmm7
pshufd $0xa0, %xmm7, %xmm13    # xmm13 = xmm7[0,0,2,2]
pcmpeqd %xmm15, %xmm14
pshufd $0xf5, %xmm14, %xmm14   # xmm14 = xmm14[1,1,3,3]
pand %xmm13, %xmm14
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
por %xmm14, %xmm7
pand %xmm7, %xmm4
pandn %xmm2, %xmm7
movdqa %xmm7, %xmm14
por %xmm4, %xmm14
movdqa %xmm9, %xmm4
pxor %xmm6, %xmm9
movdqa %xmm9, %xmm7
pcmpgtd %xmm15, %xmm7
pshufd $0xa0, %xmm7, %xmm13    # xmm13 = xmm7[0,0,2,2]
pcmpeqd %xmm15, %xmm9
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
pand %xmm13, %xmm9
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
por %xmm9, %xmm7
pand %xmm7, %xmm4
pandn %xmm2, %xmm7
movdqa %xmm7, %xmm9
por %xmm4, %xmm9
psubq %xmm1, %xmm11
movdqa %xmm11, %xmm2
pxor %xmm6, %xmm2
movdqa %xmm12, %xmm4
pcmpgtd %xmm2, %xmm4
pshufd $0xa0, %xmm4, %xmm7     # xmm7 = xmm4[0,0,2,2]
pcmpeqd %xmm12, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pand %xmm7, %xmm2
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm2, %xmm4
movmskps %xmm4, %eax
cmpl $0xf, %eax
je 0x3b6cbf
movdqa %xmm10, %xmm15
psubq %xmm1, %xmm15
movdqa %xmm15, %xmm2
pxor %xmm6, %xmm2
movdqa %xmm12, %xmm4
pcmpgtd %xmm2, %xmm4
pshufd $0xa0, %xmm4, %xmm7     # xmm7 = xmm4[0,0,2,2]
pcmpeqd %xmm12, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pand %xmm7, %xmm2
pshufd $0xf5, %xmm4, %xmm10    # xmm10 = xmm4[1,1,3,3]
por %xmm2, %xmm10
movdqa %xmm3, %xmm2
pand %xmm10, %xmm2
pandn %xmm15, %xmm10
por %xmm2, %xmm10
movdqa (%r15,%r10), %xmm12
addq $0x10, %r10
cmpq %r10, %r13
jne 0x3b698f
testb $0x1, %dl
movl $0x0, %edx
jne 0x3b6925
addq %r13, 0x38(%rsp)
addq %r13, 0x8(%rsp)
movq %rbp, %r10
movq %r8, %rax
cmpq %r9, %r11
movdqa 0x273446(%rip), %xmm4   # 0x62a120
movdqa 0x2721ce(%rip), %xmm7   # 0x628eb0
movdqa 0x2749f5(%rip), %xmm13  # 0x62b6e0
jne 0x3b6504
movl 0x5c(%rsp), %eax
shlq $0x4, %rax
movdqa (%rbp,%rax), %xmm0
movl 0x64(%rsp), %eax
testl %eax, %eax
jg 0x3b6d10
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
testl %eax, %eax
js 0x3b6d07
movq %xmm14, %rax
xorl %ecx, %ecx
movq 0x68(%rsp), %rsi
cmpq %rsi, %rax
setle %cl
negq %rcx
pshufd $0xee, %xmm14, %xmm1    # xmm1 = xmm14[2,3,2,3]
movq %xmm1, %rax
xorl %edx, %edx
cmpq %rsi, %rax
setle %dl
negq %rdx
movq %rcx, %xmm1
movq %rdx, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
movq %xmm9, %rax
xorl %ecx, %ecx
movq 0x98(%rsp), %rsi
cmpq %rsi, %rax
setg %cl
negq %rcx
pshufd $0xee, %xmm9, %xmm2     # xmm2 = xmm9[2,3,2,3]
movq %xmm2, %rax
xorl %edx, %edx
cmpq %rsi, %rax
setg %dl
negq %rdx
movq %rcx, %xmm2
movq %rdx, %xmm3
punpcklqdq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0]
por %xmm1, %xmm2
pmovmskb %xmm2, %eax
testl %eax, %eax
je 0x3b6d9d
orb $0x40, 0xc(%rbx)
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x3b6daf
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rax
movl 0x60(%rsp), %ecx
movl 0x58(%rsp), %edx
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
movl %edx, 0x8(%rbx)
callq 0x20a60d
movq 0x40(%rsp), %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq 0x10(%rsp), %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
jmp 0x3b6e2a
callq 0x1be891
jmp 0x3b6e28
callq 0x1be86b
jmp 0x3b6e28
callq 0x1be845
jmp 0x3b6e28
callq 0x1be81f
jmp 0x3b6e28
callq 0x1be7f9
jmp 0x3b6e28
callq 0x1be7d3
jmp 0x3b6e28
callq 0x1be7ad
jmp 0x3b6e28
callq 0x1be787
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop