// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sg_scan_sse2_128_64.c
// Function: parasail_sg_flags_rowcol_scan_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,
        int s1_beg, int s1_end, int s2_beg, int s2_end)
{
    /* 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;
    int32_t offset = 0;
    int32_t position = 0;
    __m128i* restrict pvP = NULL;
    __m128i* restrict pvE = NULL;
    int64_t* restrict boundary = NULL;
    __m128i* restrict pvHt = NULL;
    __m128i* restrict pvH = NULL;
    __m128i* restrict pvGapper = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int64_t NEG_LIMIT = 0;
    int64_t POS_LIMIT = 0;
    __m128i vZero;
    int64_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vMaxH;
    __m128i vPosMask;
    __m128i vNegInfFront;
    __m128i vSegLenXgap;
    parasail_result_t *result = NULL;

    /* 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;
    pvP = (__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;
    vZero = _mm_setzero_si128();
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi64x_rpl(NEG_LIMIT);
    vPosLimit = _mm_set1_epi64x_rpl(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vPosMask = _mm_cmpeq_epi64_rpl(_mm_set1_epi64x_rpl(position),
            _mm_set_epi64x_rpl(0,1));
    vNegInfFront = vZero;
    vNegInfFront = _mm_insert_epi64_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm_add_epi64(vNegInfFront,
            _mm_slli_si128(_mm_set1_epi64x_rpl(-segLen*gap), 8));

    /* initialize result */
#ifdef PARASAIL_TABLE
    result = parasail_result_new_table1(segLen*segWidth, s2Len);
#else
#ifdef PARASAIL_ROWCOL
    result = parasail_result_new_rowcol1(segLen*segWidth, s2Len);
#else
    result = parasail_result_new();
#endif
#endif
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SG | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_2;
    result->flag |= s1_beg ? PARASAIL_FLAG_SG_S1_BEG : 0;
    result->flag |= s1_end ? PARASAIL_FLAG_SG_S1_END : 0;
    result->flag |= s2_beg ? PARASAIL_FLAG_SG_S2_BEG : 0;
    result->flag |= s2_end ? PARASAIL_FLAG_SG_S2_END : 0;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    pvE = parasail_memalign___m128i(16, segLen);
    boundary = parasail_memalign_int64_t(16, s2Len+1);
    pvHt= parasail_memalign___m128i(16, segLen);
    pvH = parasail_memalign___m128i(16, segLen);
    pvGapper = parasail_memalign___m128i(16, segLen);

    /* validate heap variables */
    if (!pvE) return NULL;
    if (!boundary) return NULL;
    if (!pvHt) return NULL;
    if (!pvH) return NULL;
    if (!pvGapper) 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 = s1_beg ? 0 : (-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(&pvH[index], h.m);
            _mm_store_si128(&pvE[index], e.m);
            ++index;
        }
    }

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

    {
        __m128i vGapper = _mm_sub_epi64(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm_store_si128(pvGapper+i, vGapper);
            vGapper = _mm_sub_epi64(vGapper, vGapE);
            /* long queries and/or large penalties will break the pseudo prefix scan */
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vGapper);
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vE;
        __m128i vHt;
        __m128i vF;
        __m128i vH;
        __m128i vHp;
        __m128i *pvW;
        __m128i vW;

        /* calculate E */
        /* calculate Ht */
        /* calculate F and H first pass */
        vHp = _mm_load_si128(pvH+(segLen-1));
        vHp = _mm_slli_si128(vHp, 8);
        vHp = _mm_insert_epi64_rpl(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm_sub_epi64(vNegLimit, pvGapper[0]);
        vF = vNegLimit;
        for (i=0; i<segLen; ++i) {
            vH = _mm_load_si128(pvH+i);
            vE = _mm_load_si128(pvE+i);
            vW = _mm_load_si128(pvW+i);
            vE = _mm_max_epi64_rpl(
                    _mm_sub_epi64(vE, vGapE),
                    _mm_sub_epi64(vH, vGapO));
            vHp = _mm_add_epi64(vHp, vW);
            vF = _mm_max_epi64_rpl(vF, _mm_add_epi64(vHt, pvGapper[i]));
            vHt = _mm_max_epi64_rpl(vE, vHp);
            _mm_store_si128(pvE+i, vE);
            _mm_store_si128(pvHt+i, vHt);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm_slli_si128(vHt, 8);
        vHt = _mm_insert_epi64_rpl(vHt, boundary[j+1], 0);
        vF = _mm_max_epi64_rpl(vF, _mm_add_epi64(vHt, pvGapper[0]));
        for (i=0; i<segWidth-2; ++i) {
            __m128i vFt = _mm_slli_si128(vF, 8);
            vFt = _mm_add_epi64(vFt, vSegLenXgap);
            vF = _mm_max_epi64_rpl(vF, vFt);
        }

        /* calculate final H */
        vF = _mm_slli_si128(vF, 8);
        vF = _mm_add_epi64(vF, vNegInfFront);
        vH = _mm_max_epi64_rpl(vHt, vF);
        for (i=0; i<segLen; ++i) {
            vHt = _mm_load_si128(pvHt+i);
            vF = _mm_max_epi64_rpl(
                    _mm_sub_epi64(vF, vGapE),
                    _mm_sub_epi64(vH, vGapO));
            vH = _mm_max_epi64_rpl(vHt, vF);
            _mm_store_si128(pvH+i, vH);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm_max_epi64_rpl(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
        } 

        /* extract vector containing last value from column */
        {
            __m128i vCompare;
            vH = _mm_load_si128(pvH + offset);
            vCompare = _mm_and_si128(vPosMask, _mm_cmpgt_epi64_rpl(vH, vMaxH));
            vMaxH = _mm_max_epi64_rpl(vH, vMaxH);
            if (_mm_movemask_epi8(vCompare)) {
                end_ref = j;
            }
#ifdef PARASAIL_ROWCOL
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 8);
            }
            result->rowcols->score_row[j] = (int64_t) _mm_extract_epi64_rpl (vH, 1);
#endif
        }
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m128i vH = _mm_load_si128(pvH + i);
        arr_store_col(result->rowcols->score_col, vH, i, segLen);
    }
#endif

    /* max last value from all columns */
    if (s2_end)
    {
        for (k=0; k<position; ++k) {
            vMaxH = _mm_slli_si128(vMaxH, 8);
        }
        score = (int64_t) _mm_extract_epi64_rpl(vMaxH, 1);
        end_query = s1Len-1;
    }

    /* max of last column */
    if (s1_end)
    {
        /* Trace the alignment ending position on read. */
        int64_t *t = (int64_t*)pvH;
        int32_t column_len = segLen * segWidth;
        for (i = 0; i<column_len; ++i, ++t) {
            int32_t temp = i / segWidth + i % segWidth * segLen;
            if (temp >= s1Len) continue;
            if (*t > score) {
                score = *t;
                end_query = temp;
                end_ref = s2Len-1;
            }
            else if (*t == score && end_ref == s2Len-1 && temp < end_query) {
                end_query = temp;
            }
        }
    }

    if (!s1_end && !s2_end) {
        /* extract last value from the last column */
        {
            __m128i vH = _mm_load_si128(pvH + offset);
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 8);
            }
            score = (int64_t) _mm_extract_epi64_rpl (vH, 1);
            end_ref = s2Len - 1;
            end_query = s1Len - 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(pvGapper);
    parasail_free(pvH);
    parasail_free(pvHt);
    parasail_free(boundary);
    parasail_free(pvE);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, 0x88(%rsp)
testq %rdi, %rdi
je 0x2eeea0
movq 0x60(%rdi), %rax
movq %rax, 0xf8(%rsp)
testq %rax, %rax
je 0x2eeec4
movq 0x10(%rdi), %rax
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x2eeee8
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x2eef0c
cmpq $0x0, 0x88(%rsp)
je 0x2eef30
movl %r9d, %r13d
movl %edx, %r9d
testl %edx, %edx
jle 0x2eef51
testl %ecx, %ecx
js 0x2eef72
testl %r8d, %r8d
js 0x2eef93
movl %r8d, 0xc(%rsp)
leal -0x1(%rax), %esi
movq %rax, 0xd8(%rsp)
leaq 0x1(%rax), %rdi
movq %rdi, %r12
shrq %r12
movl %esi, %eax
xorl %edx, %edx
divl %r12d
movl %edx, 0xc0(%rsp)
decl %eax
movl %eax, 0x58(%rsp)
sete 0xb0(%rsp)
movl %ecx, %r10d
movl %ecx, %r14d
negl %r10d
movq 0x80(%rsp), %r8
movslq 0x20(%r8), %rax
movq %r14, %rcx
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
subq %rax, %rdx
movl %r10d, 0x60(%rsp)
cmpl %r10d, %eax
cmovgq %rcx, %rdx
movq %rdx, 0x78(%rsp)
movslq 0x1c(%r8), %rax
movq %rax, 0x90(%rsp)
movl %esi, 0x14(%rsp)
cmpl %r12d, %esi
movl $0x0, %eax
sbbq %rax, %rax
movq %rax, 0x48(%rsp)
andl $0x7ffffffe, %edi       # imm = 0x7FFFFFFE
movl %r9d, %esi
movq %r9, %rbx
callq 0x1ab93b
xorl %ecx, %ecx
testq %rax, %rax
je 0x2eefbb
xorl %edi, %edi
testl %r13d, %r13d
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x1b0(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x1b8(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x1c0(%rsp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x2840402, %ecx        # imm = 0x2840402
movq %rax, 0x50(%rsp)
movl %ecx, 0xc(%rax)
pushq $0x10
popq %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x297cd8
movq %rax, %r15
movq %rbx, 0xa0(%rsp)
leal 0x1(%rbx), %esi
movq %rbp, %rdi
movq %rsi, 0x20(%rsp)
callq 0x1ab78c
movq %rax, 0x28(%rsp)
movq %rbp, %rdi
movq %rbp, %rbx
movq %r12, %rsi
callq 0x297cd8
movq %rax, %rbp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x297cd8
movq %rax, %rbx
pushq $0x10
popq %rdi
movq %r12, 0x30(%rsp)
movq %r12, %rsi
callq 0x297cd8
movq %rax, %r12
movq %r15, %xmm0
movq 0x28(%rsp), %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %rbp, %xmm1
movq %rbx, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
pxor %xmm2, %xmm2
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, %eax
xorl %ecx, %ecx
testl %eax, %eax
jne 0x2eefbb
testq %r12, %r12
movq 0x50(%rsp), %r10
movq 0x30(%rsp), %rdx
movq 0xa0(%rsp), %rax
je 0x2eefbb
decl %eax
movl %eax, 0x10(%rsp)
movl 0x58(%rsp), %r11d
negl %r11d
movq %r14, %xmm0
pshufd $0x44, %xmm0, %xmm12    # xmm12 = xmm0[0,1,0,1]
movl 0xc(%rsp), %ecx
movd %ecx, %xmm0
pshufd $0x44, %xmm0, %xmm13    # xmm13 = xmm0[0,1,0,1]
movq 0x78(%rsp), %rax
incq %rax
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
subq 0x90(%rsp), %rsi
addq $-0x2, %rsi
movq %rax, 0x18(%rsp)
movq %rax, %xmm0
movdqa %xmm0, 0x120(%rsp)
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x90(%rsp)
movq %rsi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x100(%rsp)
xorl %eax, %eax
movb 0xb0(%rsp), %sil
movb %sil, %al
negq %rax
movq %rax, %xmm0
movq 0x48(%rsp), %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movdqa %xmm1, 0x110(%rsp)
movl %ecx, %eax
movslq 0x60(%rsp), %rcx
imulq %rax, %rdx
xorl %esi, %esi
cmpq 0x30(%rsp), %rsi
je 0x2ee6da
movq %rcx, %rdi
xorl %r8d, %r8d
cmpq $0x2, %r8
je 0x2ee6b0
testl %r13d, %r13d
je 0x2ee692
xorl %r9d, %r9d
jmp 0x2ee695
movq %rdi, %r9
movq %r9, 0x160(%rsp,%r8,8)
subq %r14, %r9
movq %r9, 0x150(%rsp,%r8,8)
incq %r8
subq %rdx, %rdi
jmp 0x2ee682
movq %rsi, %rdi
shlq $0x4, %rdi
movaps 0x160(%rsp), %xmm0
movaps %xmm0, (%rbx,%rdi)
movdqa 0x150(%rsp), %xmm0
movdqa %xmm0, (%r15,%rdi)
incq %rsi
subq %rax, %rcx
jmp 0x2ee675
movq 0x28(%rsp), %rsi
andq $0x0, (%rsi)
pushq $0x1
popq %rax
movq 0x30(%rsp), %r13
movl 0xc(%rsp), %edx
movl 0x60(%rsp), %edi
movl 0x1b8(%rsp), %r8d
movq 0x20(%rsp), %r9
cmpq %rax, %r9
je 0x2ee71e
testl %r8d, %r8d
movl $0x0, %ecx
cmovel %edi, %ecx
movslq %ecx, %rcx
movq %rcx, (%rsi,%rax,8)
incq %rax
subl %edx, %edi
jmp 0x2ee700
pxor %xmm0, %xmm0
psubq %xmm12, %xmm0
leal -0x1(%r13), %eax
movdqa 0x2d91dc(%rip), %xmm10  # 0x5c7910
movdqa 0x100(%rsp), %xmm11
movl %eax, %ecx
testl %ecx, %ecx
js 0x2ee79d
movl %ecx, %edx
shlq $0x4, %rdx
movdqa %xmm0, (%r12,%rdx)
psubq %xmm13, %xmm0
movdqa %xmm11, %xmm1
pxor %xmm10, %xmm1
movdqa %xmm0, %xmm2
pxor %xmm10, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm1, %xmm2
pand %xmm2, %xmm11
pandn %xmm0, %xmm2
por %xmm2, %xmm11
decl %ecx
jmp 0x2ee740
movl %eax, %eax
shlq $0x4, %rax
addq %rbx, %rax
movq %rax, 0xf0(%rsp)
movl 0xc0(%rsp), %eax
shlq $0x4, %rax
addq %rbx, %rax
movq %rax, 0x20(%rsp)
movl 0xa0(%rsp), %eax
movq %rax, 0x48(%rsp)
shlq $0x4, %r13
xorl %edx, %edx
pushq $0x1
popq %rdi
movdqa 0x90(%rsp), %xmm1
movdqa %xmm1, %xmm0
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movdqa %xmm12, 0x140(%rsp)
movdqa %xmm13, 0x130(%rsp)
movq %r12, 0xe8(%rsp)
movq %r15, 0xe0(%rsp)
cmpq 0x48(%rsp), %rdx
je 0x2eecac
movq (%rsi,%rdx,8), %xmm14
movq 0xf0(%rsp), %rax
punpcklqdq (%rax), %xmm14  # xmm14 = xmm14[0],mem[0]
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x88(%rsp), %rcx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %eax
imull 0x30(%rsp), %eax
cltq
shlq $0x4, %rax
addq 0xf8(%rsp), %rax
movdqa 0x90(%rsp), %xmm15
movdqa %xmm15, %xmm3
psubq (%r12), %xmm3
xorl %ecx, %ecx
cmpq %rcx, %r13
je 0x2ee989
movdqa (%rbx,%rcx), %xmm2
movdqa (%r15,%rcx), %xmm4
psubq %xmm13, %xmm4
movdqa %xmm2, %xmm5
psubq %xmm12, %xmm5
paddq (%rax,%rcx), %xmm14
paddq (%r12,%rcx), %xmm3
movdqa %xmm3, %xmm6
pxor %xmm10, %xmm6
movdqa %xmm15, %xmm7
pxor %xmm10, %xmm7
movdqa %xmm7, %xmm8
pcmpgtd %xmm6, %xmm8
pshufd $0xa0, %xmm8, %xmm9     # xmm9 = xmm8[0,0,2,2]
pcmpeqd %xmm6, %xmm7
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
pand %xmm9, %xmm6
pshufd $0xf5, %xmm8, %xmm7     # xmm7 = xmm8[1,1,3,3]
por %xmm6, %xmm7
pand %xmm7, %xmm15
pandn %xmm3, %xmm7
por %xmm7, %xmm15
movdqa %xmm5, %xmm3
pxor %xmm10, %xmm3
movdqa %xmm4, %xmm6
pxor %xmm10, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm3, %xmm7
pshufd $0xa0, %xmm7, %xmm8     # xmm8 = xmm7[0,0,2,2]
pcmpeqd %xmm3, %xmm6
pshufd $0xf5, %xmm6, %xmm3     # xmm3 = xmm6[1,1,3,3]
pand %xmm8, %xmm3
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm3, %xmm6
pand %xmm6, %xmm4
pandn %xmm5, %xmm6
por %xmm4, %xmm6
movdqa %xmm6, %xmm4
movdqa %xmm6, (%r15,%rcx)
pxor %xmm10, %xmm6
movdqa %xmm14, %xmm3
pxor %xmm10, %xmm3
movdqa %xmm6, %xmm5
pcmpgtd %xmm3, %xmm5
pshufd $0xa0, %xmm5, %xmm7     # xmm7 = xmm5[0,0,2,2]
pcmpeqd %xmm6, %xmm3
pshufd $0xf5, %xmm3, %xmm6     # xmm6 = xmm3[1,1,3,3]
pand %xmm7, %xmm6
pshufd $0xf5, %xmm5, %xmm3     # xmm3 = xmm5[1,1,3,3]
por %xmm6, %xmm3
pand %xmm3, %xmm4
pandn %xmm14, %xmm3
por %xmm4, %xmm3
movdqa %xmm3, (%rbp,%rcx)
addq $0x10, %rcx
movdqa %xmm2, %xmm14
jmp 0x2ee872
leaq 0x1(%rdx), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%rsi,%rdx,8), %rax
movq %rax, %xmm2
addq (%r12), %rax
movq %xmm15, %rcx
cmpq %rax, %rcx
cmovgq %rcx, %rax
movq %rax, %xmm8
pslldq $0x8, %xmm8             # xmm8 = zero,zero,zero,zero,zero,zero,zero,zero,xmm8[0,1,2,3,4,5,6,7]
paddq 0x120(%rsp), %xmm8
punpcklqdq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0]
movdqa %xmm8, %xmm6
pxor %xmm10, %xmm6
movdqa %xmm2, %xmm3
pxor %xmm10, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm6, %xmm4
pshufd $0xa0, %xmm4, %xmm5     # xmm5 = xmm4[0,0,2,2]
pcmpeqd %xmm6, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pand %xmm5, %xmm3
pshufd $0xf5, %xmm4, %xmm9     # xmm9 = xmm4[1,1,3,3]
por %xmm3, %xmm9
pand %xmm9, %xmm2
pandn %xmm8, %xmm9
por %xmm2, %xmm9
xorl %eax, %eax
cmpq %rax, %r13
je 0x2eeb7f
psubq %xmm13, %xmm8
psubq %xmm12, %xmm9
movdqa %xmm9, %xmm2
pxor %xmm10, %xmm2
movdqa %xmm8, %xmm3
pxor %xmm10, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm2, %xmm4
pshufd $0xa0, %xmm4, %xmm5     # xmm5 = xmm4[0,0,2,2]
pcmpeqd %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
pand %xmm5, %xmm2
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm2, %xmm3
pand %xmm3, %xmm8
pandn %xmm9, %xmm3
por %xmm3, %xmm8
movdqa (%rbp,%rax), %xmm3
movdqa %xmm8, %xmm2
pxor %xmm10, %xmm2
movdqa %xmm3, %xmm6
pxor %xmm10, %xmm6
movdqa %xmm6, %xmm4
pcmpgtd %xmm2, %xmm4
pshufd $0xa0, %xmm4, %xmm5     # xmm5 = xmm4[0,0,2,2]
pcmpeqd %xmm2, %xmm6
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm9     # xmm9 = xmm4[1,1,3,3]
por %xmm6, %xmm9
pand %xmm9, %xmm3
pandn %xmm8, %xmm9
por %xmm3, %xmm9
movdqa %xmm9, (%rbx,%rax)
movdqa %xmm11, %xmm4
pxor %xmm10, %xmm4
movdqa %xmm9, %xmm3
pxor %xmm10, %xmm3
movdqa %xmm3, %xmm5
pcmpgtd %xmm4, %xmm5
pshufd $0xa0, %xmm5, %xmm6     # xmm6 = xmm5[0,0,2,2]
pcmpeqd %xmm3, %xmm4
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pand %xmm6, %xmm4
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
por %xmm4, %xmm5
pand %xmm5, %xmm11
pandn %xmm9, %xmm5
por %xmm11, %xmm5
movdqa %xmm5, %xmm4
pxor %xmm10, %xmm4
movdqa %xmm2, %xmm6
pcmpgtd %xmm4, %xmm6
pshufd $0xa0, %xmm6, %xmm7     # xmm7 = xmm6[0,0,2,2]
pcmpeqd %xmm2, %xmm4
pshufd $0xf5, %xmm4, %xmm2     # xmm2 = xmm4[1,1,3,3]
pand %xmm7, %xmm2
pshufd $0xf5, %xmm6, %xmm11    # xmm11 = xmm6[1,1,3,3]
por %xmm2, %xmm11
pand %xmm11, %xmm5
pandn %xmm8, %xmm11
por %xmm5, %xmm11
movdqa %xmm0, %xmm2
pxor %xmm10, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm3, %xmm4
pshufd $0xa0, %xmm4, %xmm5     # xmm5 = xmm4[0,0,2,2]
pcmpeqd %xmm3, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pand %xmm5, %xmm2
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm2, %xmm3
pand %xmm3, %xmm0
pandn %xmm9, %xmm3
por %xmm3, %xmm0
addq $0x10, %rax
jmp 0x2eea0e
movdqa %xmm0, 0xa0(%rsp)
movdqa %xmm11, 0x60(%rsp)
movq 0x20(%rsp), %rax
movdqa (%rax), %xmm0
movdqa %xmm0, 0xc0(%rsp)
movl %r11d, %r14d
movdqa %xmm1, 0xb0(%rsp)
movq %rdx, %r12
movl %edi, %r15d
callq 0x2eefd0
movl %r15d, %edi
movdqa 0x2d8d4c(%rip), %xmm10  # 0x5c7910
movl %r14d, %r11d
movq 0x50(%rsp), %r10
pand 0x110(%rsp), %xmm0
movdqa 0xb0(%rsp), %xmm5
movdqa %xmm5, %xmm1
pxor %xmm10, %xmm1
movdqa 0xc0(%rsp), %xmm6
movdqa %xmm6, %xmm2
pxor %xmm10, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
pand %xmm4, %xmm1
movdqa %xmm6, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm1, %xmm2
movdqa %xmm6, %xmm3
pand %xmm2, %xmm3
pandn %xmm5, %xmm2
movdqa %xmm2, %xmm1
por %xmm3, %xmm1
pmovmskb %xmm0, %eax
xorl %ecx, %ecx
cmpl %r11d, %ecx
jge 0x2eec48
pslldq $0x8, %xmm4             # xmm4 = zero,zero,zero,zero,zero,zero,zero,zero,xmm4[0,1,2,3,4,5,6,7]
movl %edi, %ecx
jmp 0x2eec3a
testw %ax, %ax
movl 0xc(%rsp), %eax
cmovnel %r12d, %eax
movl %eax, 0xc(%rsp)
pshufd $0xee, %xmm4, %xmm0     # xmm0 = xmm4[2,3,2,3]
movq 0x10(%r10), %rax
movq (%rax), %rax
movd %xmm0, (%rax,%r12,4)
movq 0x58(%rsp), %rdx
movq 0x28(%rsp), %rsi
movdqa 0x60(%rsp), %xmm11
movdqa 0x140(%rsp), %xmm12
movdqa 0x130(%rsp), %xmm13
movdqa 0xa0(%rsp), %xmm0
movq 0xe8(%rsp), %r12
movq 0xe0(%rsp), %r15
jmp 0x2ee80f
movq 0x30(%rsp), %r9
movq %r9, %rax
shlq $0x2, %rax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x2eece4
movdqa (%rbx,%rcx,4), %xmm2
movq 0x10(%r10), %rdx
movq 0x8(%rdx), %rdx
movd %xmm2, (%rdx,%rcx)
addq %rcx, %rdx
pshufd $0xee, %xmm2, %xmm2     # xmm2 = xmm2[2,3,2,3]
movd %xmm2, (%rax,%rdx)
addq $0x4, %rcx
jmp 0x2eecba
movl 0x1c0(%rsp), %r10d
testl %r10d, %r10d
movl 0x14(%rsp), %r14d
movq 0xd8(%rsp), %r8
je 0x2eed1c
xorl %ecx, %ecx
pushq $0x1
popq %rax
cmpl %r11d, %ecx
jge 0x2eed11
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
movl %eax, %ecx
jmp 0x2eed03
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, 0x18(%rsp)
cmpl $0x0, 0x1b0(%rsp)
je 0x2eed8c
movl %r9d, %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addl %eax, %eax
xorl %ecx, %ecx
cmpl %ecx, %eax
je 0x2eed8c
movl %ecx, %esi
shrl %esi
testb $0x1, %cl
movl $0x0, %edx
cmovnel %r9d, %edx
addl %esi, %edx
cmpl %r8d, %edx
jge 0x2eed87
movq (%rbx,%rcx,8), %rsi
movq 0x18(%rsp), %r13
cmpq %r13, %rsi
jle 0x2eed6d
movq %rsi, 0x18(%rsp)
movl 0x10(%rsp), %esi
movl %esi, 0xc(%rsp)
movl %edx, %r14d
jmp 0x2eed87
cmpl %r14d, %edx
cmovgel %r14d, %edx
movl 0xc(%rsp), %edi
cmpl 0x10(%rsp), %edi
cmovnel %r14d, %edx
cmpq %r13, %rsi
cmovel %edx, %r14d
incq %rcx
jmp 0x2eed32
movdqa %xmm11, 0x60(%rsp)
orl 0x1b0(%rsp), %r10d
movq 0x18(%rsp), %r13
jne 0x2eedd5
movq 0x20(%rsp), %rax
movdqa (%rax), %xmm1
xorl %ecx, %ecx
pushq $0x1
popq %rax
movl 0x14(%rsp), %r14d
cmpl %r11d, %ecx
jge 0x2eedc3
pslldq $0x8, %xmm1             # xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7]
movl %eax, %ecx
jmp 0x2eedb5
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, %r13
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x78(%rsp), %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa %xmm1, 0x30(%rsp)
movaps 0x100(%rsp), %xmm1
callq 0x2eefd0
movdqa 0x2d8b15(%rip), %xmm1   # 0x5c7910
movdqa 0x60(%rsp), %xmm3
pxor %xmm1, %xmm3
movdqa 0x30(%rsp), %xmm4
pxor %xmm1, %xmm4
movdqa %xmm3, %xmm1
pcmpgtd %xmm4, %xmm1
pshufd $0xa0, %xmm1, %xmm2     # xmm2 = xmm1[0,0,2,2]
pcmpeqd %xmm3, %xmm4
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
por %xmm3, %xmm1
pcmpeqd %xmm2, %xmm2
pxor %xmm1, %xmm2
por %xmm0, %xmm2
pmovmskb %xmm2, %eax
testl %eax, %eax
movq 0x50(%rsp), %rax
je 0x2eee5d
orb $0x40, 0xc(%rax)
xorl %r13d, %r13d
movl $0x0, 0xc(%rsp)
xorl %r14d, %r14d
movl %r13d, (%rax)
movl %r14d, 0x4(%rax)
movl 0xc(%rsp), %ecx
movl %ecx, 0x8(%rax)
movq %r12, %rdi
movq %rax, %r14
callq 0x1ab763
movq %rbx, %rdi
callq 0x1ab763
movq %rbp, %rdi
callq 0x1ab763
movq 0x28(%rsp), %rdi
callq 0x1ab763
movq %r15, %rdi
callq 0x1ab763
movq %r14, %rcx
jmp 0x2eefbb
movq 0x44c131(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d813a(%rip), %rsi    # 0x5c6feb
leaq 0x2d9f2c(%rip), %rdx    # 0x5c8de4
leaq 0x2ae61e(%rip), %rcx    # 0x59d4dd
jmp 0x2eefb2
movq 0x44c10d(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d8116(%rip), %rsi    # 0x5c6feb
leaq 0x2d9f08(%rip), %rdx    # 0x5c8de4
leaq 0x2d8a3d(%rip), %rcx    # 0x5c7920
jmp 0x2eefb2
movq 0x44c0e9(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d80f2(%rip), %rsi    # 0x5c6feb
leaq 0x2d9ee4(%rip), %rdx    # 0x5c8de4
leaq 0x2d8a32(%rip), %rcx    # 0x5c7939
jmp 0x2eefb2
movq 0x44c0c5(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d87e4(%rip), %rsi    # 0x5c7701
leaq 0x2d9ec0(%rip), %rdx    # 0x5c8de4
leaq 0x2d8a1e(%rip), %rcx    # 0x5c7949
jmp 0x2eefb2
movq 0x44c0a1(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d80aa(%rip), %rsi    # 0x5c6feb
leaq 0x2d9e9c(%rip), %rdx    # 0x5c8de4
leaq 0x2d87af(%rip), %rcx    # 0x5c76fe
jmp 0x2eefb2
movq 0x44c080(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d879f(%rip), %rsi    # 0x5c7701
leaq 0x2d9e7b(%rip), %rdx    # 0x5c8de4
leaq 0x2d87a5(%rip), %rcx    # 0x5c7715
jmp 0x2eefb2
movq 0x44c05f(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d8798(%rip), %rsi    # 0x5c771b
leaq 0x2d9e5a(%rip), %rdx    # 0x5c8de4
leaq 0x2d879f(%rip), %rcx    # 0x5c7730
jmp 0x2eefb2
movq 0x44c03e(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d8777(%rip), %rsi    # 0x5c771b
leaq 0x2d9e39(%rip), %rdx    # 0x5c8de4
leaq 0x2d8783(%rip), %rcx    # 0x5c7735
xorl %eax, %eax
callq 0x19e180
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq