// File: /workspace/github_c_makefile_star2_O3/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 $0x108, %rsp            # imm = 0x108
movq %rsi, 0x68(%rsp)
testq %rdi, %rdi
je 0x34e903
movq 0x60(%rdi), %rax
movq %rax, 0xb8(%rsp)
testq %rax, %rax
je 0x34e90a
movq 0x10(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x34e911
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x34e918
cmpq $0x0, 0x68(%rsp)
je 0x34e91f
movl %edx, %r13d
testl %edx, %edx
jle 0x34e926
movl %ecx, %r14d
testl %ecx, %ecx
js 0x34e92d
movl %r8d, %ebp
testl %r8d, %r8d
js 0x34e934
movl %r9d, %ebx
leal -0x1(%rax), %r9d
movq %rax, 0xb0(%rsp)
leaq 0x1(%rax), %rdi
movq %rdi, %r12
shrq %r12
movl %r9d, %eax
xorl %edx, %edx
divl %r12d
movl %edx, 0x40(%rsp)
movl %r14d, %r15d
negl %r14d
movq 0x60(%rsp), %r8
movslq 0x20(%r8), %rsi
movq %r15, %rcx
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
subq %rsi, %rdx
cmpl %r14d, %esi
cmovgq %rcx, %rdx
movq %rdx, 0x58(%rsp)
movslq 0x1c(%r8), %rcx
movq %rcx, 0x70(%rsp)
movl %r9d, 0xc(%rsp)
cmpl %r12d, %r9d
movl $0x0, %ecx
sbbq %rcx, %rcx
movq %rcx, 0x80(%rsp)
movl %eax, 0x44(%rsp)
cmpl $0x1, %eax
sete 0x7(%rsp)
andl $0x7ffffffe, %edi       # imm = 0x7FFFFFFE
movq %rdi, 0xa8(%rsp)
movl %r13d, %esi
callq 0x20ac53
xorl %esi, %esi
testq %rax, %rax
je 0x34ea23
movq %r14, 0x50(%rsp)
movl %ebp, 0x18(%rsp)
xorl %edi, %edi
testl %ebx, %ebx
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x140(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x148(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x150(%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, 0xa0(%rsp)
movl %ecx, 0xc(%rax)
movl $0x10, %edi
movq %r12, %rsi
callq 0x2f600c
movq %rax, 0x30(%rsp)
movq %r13, 0x48(%rsp)
leal 0x1(%r13), %esi
movl $0x10, %edi
movq %rsi, 0x98(%rsp)
callq 0x20a636
movq %rax, %r14
movl $0x10, %edi
movq %r12, %rsi
callq 0x2f600c
movq %rax, %r13
movl $0x10, %edi
movq %r12, %rsi
callq 0x2f600c
movq %rax, %rbp
movl $0x10, %edi
movq %r12, 0x28(%rsp)
movq %r12, %rsi
callq 0x2f600c
movq 0x30(%rsp), %rcx
movq %rcx, %xmm0
movq %r14, 0x10(%rsp)
movq %r14, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %r13, 0x38(%rsp)
movq %r13, %xmm1
movq %rbp, %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, %ecx
xorl %esi, %esi
testl %ecx, %ecx
jne 0x34ea23
testq %rax, %rax
movq 0x28(%rsp), %rdx
movl 0x18(%rsp), %edi
movq 0x50(%rsp), %r10
movq 0x48(%rsp), %r8
je 0x34ea23
leaq 0xc8(%rsp), %rcx
movq %rdx, %rsi
leaq 0xd8(%rsp), %r12
leal -0x1(%r8), %edx
movl %edx, 0x8(%rsp)
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm3     # xmm3 = xmm0[0,1,0,1]
movd %edi, %xmm0
pshufd $0x44, %xmm0, %xmm4     # xmm4 = xmm0[0,1,0,1]
movq 0x58(%rsp), %rdx
incq %rdx
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
subq 0x70(%rsp), %r8
addq $-0x2, %r8
movq %rdx, 0x20(%rsp)
movq %rdx, %xmm0
movdqa %xmm0, 0xf0(%rsp)
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x70(%rsp)
movq %r8, %xmm0
movdqa %xmm0, 0xe0(%rsp)
pshufd $0x44, %xmm0, %xmm1     # xmm1 = xmm0[0,1,0,1]
xorl %edx, %edx
movb 0x7(%rsp), %r8b
movb %r8b, %dl
negq %rdx
movq %rdx, %xmm2
movq 0x80(%rsp), %xmm0
punpcklqdq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0]
movdqa %xmm0, 0x80(%rsp)
movl %esi, %r8d
movl %edi, %r9d
movslq %r10d, %r13
xorl %r11d, %r11d
movb $0x1, %dl
leaq 0xc0(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
xorl %r14d, %r14d
testl %ebx, %ebx
je 0x34e1ce
xorl %r10d, %r10d
jmp 0x34e1df
imulq %r8, %r14
addq %r11, %r14
imulq %r9, %r14
movq %r13, %r10
subq %r14, %r10
movq %r10, (%rdi)
subq %r15, %r10
movq %r10, (%rsi)
movl $0x1, %r14d
movq %rcx, %rsi
movq %r12, %rdi
testb $0x1, %dl
movl $0x0, %edx
jne 0x34e1c5
movq %r11, %rdx
shlq $0x4, %rdx
movaps 0xd0(%rsp), %xmm2
movaps %xmm2, (%rbp,%rdx)
movdqa 0xc0(%rsp), %xmm2
movq 0x30(%rsp), %rsi
movdqa %xmm2, (%rsi,%rdx)
incq %r11
cmpq 0x28(%rsp), %r11
jne 0x34e1b0
movq 0x10(%rsp), %rcx
movq $0x0, (%rcx)
movl 0x48(%rsp), %r8d
movq 0x98(%rsp), %r15
andl $-0x2, %r15d
leaq -0x1(%r8), %rcx
movq %rcx, %xmm2
pshufd $0x44, %xmm2, %xmm2     # xmm2 = xmm2[0,1,0,1]
movl 0x18(%rsp), %r10d
movl %r10d, %esi
negl %esi
addl %r10d, %r10d
xorl %edi, %edi
movdqa 0x2dac1e(%rip), %xmm8   # 0x628e90
movdqa 0x2dac25(%rip), %xmm9   # 0x628ea0
pxor %xmm9, %xmm2
pcmpeqd %xmm10, %xmm10
xorl %ecx, %ecx
movq 0x30(%rsp), %r13
movq 0x28(%rsp), %rbx
movq 0x50(%rsp), %r11
movl 0x148(%rsp), %r14d
movq %rcx, %xmm11
pshufd $0x44, %xmm11, %xmm11   # xmm11 = xmm11[0,1,0,1]
por %xmm8, %xmm11
pxor %xmm9, %xmm11
movdqa %xmm11, %xmm12
pcmpgtd %xmm2, %xmm12
pcmpeqd %xmm2, %xmm11
pshufd $0xf5, %xmm11, %xmm13   # xmm13 = xmm11[1,1,3,3]
pand %xmm12, %xmm13
pshufd $0xf5, %xmm12, %xmm11   # xmm11 = xmm12[1,1,3,3]
por %xmm13, %xmm11
movd %xmm11, %edx
notl %edx
testb $0x1, %dl
je 0x34e2fd
testl %r14d, %r14d
movl $0x0, %edx
cmovel %r11d, %edx
movslq %edx, %rdx
movq 0x10(%rsp), %r9
movq %rdx, 0x8(%r9,%rcx,8)
pxor %xmm10, %xmm11
pextrw $0x4, %xmm11, %edx
testb $0x1, %dl
je 0x34e324
leal (%rsi,%r11), %edx
testl %r14d, %r14d
cmovnel %edi, %edx
movslq %edx, %rdx
movq 0x10(%rsp), %r9
movq %rdx, 0x10(%r9,%rcx,8)
addq $0x2, %rcx
subl %r10d, %r11d
cmpq %rcx, %r15
jne 0x34e29e
pxor %xmm8, %xmm8
psubq %xmm3, %xmm8
leal -0x1(%rbx), %r9d
shlq $0x4, %r9
movq %rax, %rcx
addq %r9, %rcx
movdqa 0x2db63c(%rip), %xmm2   # 0x629990
movl %ebx, %edx
movq 0xa0(%rsp), %r14
movdqa %xmm8, (%rcx)
psubq %xmm4, %xmm8
movdqa %xmm1, %xmm9
pxor %xmm2, %xmm1
movdqa %xmm8, %xmm10
pxor %xmm2, %xmm10
movdqa %xmm10, %xmm11
pcmpgtd %xmm1, %xmm11
pshufd $0xa0, %xmm11, %xmm12   # xmm12 = xmm11[0,0,2,2]
pcmpeqd %xmm1, %xmm10
pshufd $0xf5, %xmm10, %xmm1    # xmm1 = xmm10[1,1,3,3]
pand %xmm12, %xmm1
pshufd $0xf5, %xmm11, %xmm10   # xmm10 = xmm11[1,1,3,3]
por %xmm1, %xmm10
pand %xmm10, %xmm9
pandn %xmm8, %xmm10
movdqa %xmm10, %xmm1
por %xmm9, %xmm1
addq $-0x10, %rcx
decl %edx
jg 0x34e35e
addq %rbp, %r9
movl 0x40(%rsp), %r10d
movq %r10, 0x18(%rsp)
shlq $0x4, %r10
addq %rbp, %r10
movq %rbx, %r11
shlq $0x4, %r11
xorl %edi, %edi
movslq %ebx, %rbx
movl 0x8(%rsp), %esi
movdqa 0x70(%rsp), %xmm8
movdqa %xmm8, %xmm9
movq %rdi, %r12
movq 0x10(%rsp), %rcx
movq (%rcx,%rdi,8), %xmm10
punpcklqdq (%r9), %xmm10   # xmm10 = xmm10[0],mem[0]
movq 0x60(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x68(%rsp), %rdx
movzbl (%rdx,%rdi), %edx
movslq (%rcx,%rdx,4), %rdi
imulq %rbx, %rdi
shlq $0x4, %rdi
addq 0xb8(%rsp), %rdi
movdqa 0x70(%rsp), %xmm6
movdqa %xmm6, %xmm13
psubq (%rax), %xmm13
xorl %r15d, %r15d
movq 0x38(%rsp), %rcx
movdqa (%rbp,%r15), %xmm12
movdqa (%r13,%r15), %xmm14
psubq %xmm4, %xmm14
movdqa %xmm12, %xmm15
paddq (%rdi,%r15), %xmm10
psubq %xmm3, %xmm15
paddq (%rax,%r15), %xmm13
movdqa %xmm13, %xmm0
pxor %xmm2, %xmm0
movdqa %xmm6, %xmm11
pxor %xmm2, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pshufd $0xa0, %xmm7, %xmm5     # xmm5 = xmm7[0,0,2,2]
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm0     # xmm0 = xmm6[1,1,3,3]
pand %xmm5, %xmm0
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm0, %xmm6
pand %xmm6, %xmm11
pandn %xmm13, %xmm6
por %xmm11, %xmm6
movdqa %xmm15, %xmm0
pxor %xmm2, %xmm0
movdqa %xmm14, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm7
pcmpgtd %xmm0, %xmm7
pshufd $0xa0, %xmm7, %xmm11    # xmm11 = xmm7[0,0,2,2]
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm0     # xmm0 = xmm5[1,1,3,3]
pand %xmm11, %xmm0
pshufd $0xf5, %xmm7, %xmm5     # xmm5 = xmm7[1,1,3,3]
por %xmm0, %xmm5
pand %xmm5, %xmm14
pandn %xmm15, %xmm5
por %xmm14, %xmm5
movdqa %xmm5, %xmm0
movdqa %xmm5, (%r13,%r15)
pxor %xmm2, %xmm5
movdqa %xmm10, %xmm7
pxor %xmm2, %xmm7
movdqa %xmm5, %xmm11
pcmpgtd %xmm7, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm5, %xmm7
pshufd $0xf5, %xmm7, %xmm5     # xmm5 = xmm7[1,1,3,3]
pand %xmm13, %xmm5
pshufd $0xf5, %xmm11, %xmm13   # xmm13 = xmm11[1,1,3,3]
por %xmm5, %xmm13
pand %xmm13, %xmm0
pandn %xmm10, %xmm13
por %xmm0, %xmm13
movdqa %xmm13, (%rcx,%r15)
addq $0x10, %r15
movdqa %xmm12, %xmm10
cmpq %r15, %r11
jne 0x34e443
leaq 0x1(%r12), %rdi
movq 0x10(%rsp), %rcx
movq 0x8(%rcx,%r12,8), %rcx
movq %rcx, %xmm12
addq (%rax), %rcx
movq %xmm6, %rdx
cmpq %rcx, %rdx
cmovgq %rdx, %rcx
movq %rcx, %xmm10
movq 0x38(%rsp), %rcx
pslldq $0x8, %xmm10            # xmm10 = zero,zero,zero,zero,zero,zero,zero,zero,xmm10[0,1,2,3,4,5,6,7]
paddq 0xf0(%rsp), %xmm10
punpcklqdq %xmm13, %xmm12  # xmm12 = xmm12[0],xmm13[0]
movdqa %xmm10, %xmm0
pxor %xmm2, %xmm0
movdqa %xmm12, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pshufd $0xa0, %xmm6, %xmm7     # xmm7 = xmm6[0,0,2,2]
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm0     # xmm0 = xmm5[1,1,3,3]
pand %xmm7, %xmm0
pshufd $0xf5, %xmm6, %xmm11    # xmm11 = xmm6[1,1,3,3]
por %xmm0, %xmm11
pand %xmm11, %xmm12
pandn %xmm10, %xmm11
por %xmm12, %xmm11
xorl %r15d, %r15d
psubq %xmm4, %xmm10
psubq %xmm3, %xmm11
movdqa %xmm11, %xmm0
pxor %xmm2, %xmm0
movdqa %xmm10, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pshufd $0xa0, %xmm6, %xmm7     # xmm7 = xmm6[0,0,2,2]
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm0     # xmm0 = xmm5[1,1,3,3]
pand %xmm7, %xmm0
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm0, %xmm5
pand %xmm5, %xmm10
pandn %xmm11, %xmm5
por %xmm5, %xmm10
movdqa (%rcx,%r15), %xmm0
movdqa %xmm10, %xmm13
pxor %xmm2, %xmm13
movdqa %xmm0, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm13, %xmm6
pshufd $0xa0, %xmm6, %xmm7     # xmm7 = xmm6[0,0,2,2]
pcmpeqd %xmm13, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm7, %xmm5
pshufd $0xf5, %xmm6, %xmm11    # xmm11 = xmm6[1,1,3,3]
por %xmm5, %xmm11
pand %xmm11, %xmm0
pandn %xmm10, %xmm11
por %xmm0, %xmm11
movdqa %xmm11, (%rbp,%r15)
movdqa %xmm1, %xmm0
pxor %xmm2, %xmm0
movdqa %xmm11, %xmm12
pxor %xmm2, %xmm12
movdqa %xmm12, %xmm5
pcmpgtd %xmm0, %xmm5
pshufd $0xa0, %xmm5, %xmm6     # xmm6 = xmm5[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pand %xmm6, %xmm0
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
por %xmm0, %xmm5
pand %xmm5, %xmm1
pandn %xmm11, %xmm5
por %xmm1, %xmm5
movdqa %xmm5, %xmm0
pxor %xmm2, %xmm0
movdqa %xmm13, %xmm1
pcmpgtd %xmm0, %xmm1
pshufd $0xa0, %xmm1, %xmm6     # xmm6 = xmm1[0,0,2,2]
pcmpeqd %xmm13, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pand %xmm6, %xmm0
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
por %xmm0, %xmm1
pand %xmm1, %xmm5
pandn %xmm10, %xmm1
por %xmm5, %xmm1
movdqa %xmm8, %xmm0
pxor %xmm2, %xmm8
movdqa %xmm8, %xmm5
pcmpgtd %xmm12, %xmm5
pshufd $0xa0, %xmm5, %xmm6     # xmm6 = xmm5[0,0,2,2]
pcmpeqd %xmm12, %xmm8
pshufd $0xf5, %xmm8, %xmm7     # xmm7 = xmm8[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm5, %xmm8     # xmm8 = xmm5[1,1,3,3]
por %xmm7, %xmm8
pand %xmm8, %xmm0
pandn %xmm11, %xmm8
por %xmm0, %xmm8
addq $0x10, %r15
cmpq %r15, %r11
jne 0x34e5e9
movdqa (%r10), %xmm10
movdqa %xmm9, %xmm0
pxor %xmm2, %xmm0
movdqa %xmm10, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pshufd $0xa0, %xmm6, %xmm7     # xmm7 = xmm6[0,0,2,2]
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm0     # xmm0 = xmm5[1,1,3,3]
pand %xmm7, %xmm0
pshufd $0xf5, %xmm6, %xmm11    # xmm11 = xmm6[1,1,3,3]
por %xmm0, %xmm11
movdqa %xmm11, %xmm0
pand 0x80(%rsp), %xmm0
pmovmskb %xmm0, %ecx
testl %ecx, %ecx
cmovnel %r12d, %esi
movdqa %xmm10, %xmm12
movl 0x44(%rsp), %r15d
testl %r15d, %r15d
jg 0x34e7cc
movdqa %xmm10, %xmm12
pslldq $0x8, %xmm12            # xmm12 = zero,zero,zero,zero,zero,zero,zero,zero,xmm12[0,1,2,3,4,5,6,7]
testl %r15d, %r15d
js 0x34e7c1
pand %xmm11, %xmm10
pandn %xmm9, %xmm11
movdqa %xmm11, %xmm9
por %xmm10, %xmm9
pshufd $0xee, %xmm12, %xmm0    # xmm0 = xmm12[2,3,2,3]
movq 0x10(%r14), %rcx
movq (%rcx), %rcx
movd %xmm0, (%rcx,%r12,4)
cmpq %r8, %rdi
jne 0x34e3f2
movq 0x28(%rsp), %rbx
movq %rbx, %rcx
shlq $0x2, %rcx
xorl %edx, %edx
movdqa (%rbp,%rdx,4), %xmm0
movq 0x10(%r14), %rdi
movq 0x8(%rdi), %rdi
movd %xmm0, (%rdi,%rdx)
addq %rdx, %rdi
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movd %xmm0, (%rcx,%rdi)
addq $0x4, %rdx
cmpq %rdx, %rcx
jne 0x34e80a
movl 0x150(%rsp), %r12d
testl %r12d, %r12d
movl 0xc(%rsp), %edi
movq 0xb0(%rsp), %r11
je 0x34e868
testl %r15d, %r15d
jg 0x34e85c
pslldq $0x8, %xmm9             # xmm9 = zero,zero,zero,zero,zero,zero,zero,zero,xmm9[0,1,2,3,4,5,6,7]
testl %r15d, %r15d
js 0x34e851
pshufd $0xee, %xmm9, %xmm0     # xmm0 = xmm9[2,3,2,3]
movq %xmm0, 0x20(%rsp)
cmpl $0x0, 0x140(%rsp)
je 0x34e8da
cmpl $0x0, 0xa8(%rsp)
je 0x34e8da
movl %ebx, %r8d
andl $0x3fffffff, %r8d       # imm = 0x3FFFFFFF
addl %r8d, %r8d
xorl %r9d, %r9d
movl %r9d, %edx
shrl %edx
testb $0x1, %r9b
movl $0x0, %ecx
cmovnel %ebx, %ecx
addl %edx, %ecx
cmpl %r11d, %ecx
jge 0x34e8d2
movq (%rbp,%r9,8), %rdx
movq 0x20(%rsp), %r10
cmpq %r10, %rdx
jle 0x34e8c0
movq %rdx, 0x20(%rsp)
movl 0x8(%rsp), %esi
movl %ecx, %edi
jmp 0x34e8d2
cmpl %edi, %ecx
cmovgel %edi, %ecx
cmpl 0x8(%rsp), %esi
cmovnel %edi, %ecx
cmpq %r10, %rdx
cmovel %ecx, %edi
incq %r9
cmpl %r9d, %r8d
jne 0x34e88c
orl 0x140(%rsp), %r12d
movq 0x20(%rsp), %rdx
jne 0x34e95c
movq 0x18(%rsp), %rcx
shlq $0x4, %rcx
movdqa (%rbp,%rcx), %xmm3
testl %r15d, %r15d
jle 0x34e940
movl 0xc(%rsp), %edi
jmp 0x34e94e
callq 0x1b3b6f
jmp 0x34e939
callq 0x1b3b49
jmp 0x34e939
callq 0x1b3b23
jmp 0x34e939
callq 0x1b3afd
jmp 0x34e939
callq 0x1b3ad7
jmp 0x34e939
callq 0x1b3ab1
jmp 0x34e939
callq 0x1b3a8b
jmp 0x34e939
callq 0x1b3a65
xorl %esi, %esi
jmp 0x34ea23
movl 0xc(%rsp), %edi
pslldq $0x8, %xmm3             # xmm3 = zero,zero,zero,zero,zero,zero,zero,zero,xmm3[0,1,2,3,4,5,6,7]
testl %r15d, %r15d
js 0x34e944
pshufd $0xee, %xmm3, %xmm0     # xmm0 = xmm3[2,3,2,3]
movq %xmm0, %rdx
movl 0x8(%rsp), %esi
movq 0x58(%rsp), %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm2, %xmm1
pxor %xmm2, %xmm0
movdqa %xmm1, %xmm3
pcmpgtd %xmm0, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm1, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pand %xmm4, %xmm0
pshufd $0xf5, %xmm3, %xmm1     # xmm1 = xmm3[1,1,3,3]
por %xmm0, %xmm1
pcmpeqd %xmm0, %xmm0
pxor %xmm1, %xmm0
pshufd $0x44, 0xe0(%rsp), %xmm1 # xmm1 = mem[0,1,0,1]
pxor %xmm2, %xmm8
pxor %xmm2, %xmm1
movdqa %xmm8, %xmm2
pcmpgtd %xmm1, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm8, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm3, %xmm1
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
por %xmm1, %xmm2
por %xmm0, %xmm2
pmovmskb %xmm2, %ecx
testl %ecx, %ecx
je 0x34e9e9
orb $0x40, 0xc(%r14)
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
movl %edx, (%r14)
movl %edi, 0x4(%r14)
movl %esi, 0x8(%r14)
movq %rax, %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq 0x38(%rsp), %rdi
callq 0x20a60d
movq 0x10(%rsp), %rdi
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
movq %r14, %rsi
movq %rsi, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq