// File: /workspace/github_c_makefile_star2_O1/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 $0xd8, %rsp
movq %rsi, 0x80(%rsp)
testq %rdi, %rdi
je 0x33a0dd
movq 0x60(%rdi), %rax
movq %rax, 0xa8(%rsp)
testq %rax, %rax
je 0x33a0e4
movq 0x10(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x33a0eb
movl 0x8(%rdi), %eax
movq %rax, 0x68(%rsp)
testl %eax, %eax
jle 0x33a0f2
cmpq $0x0, 0x80(%rsp)
je 0x33a0f9
movl %r9d, %ebx
movl %edx, %r9d
testl %edx, %edx
jle 0x33a100
movl %ecx, %r12d
testl %ecx, %ecx
js 0x33a107
testl %r8d, %r8d
js 0x33a10e
movl %r8d, (%rsp)
movq 0x68(%rsp), %rcx
leal -0x1(%rcx), %eax
leaq 0x1(%rcx), %rdi
movq %rdi, %rbp
shrq %rbp
movl %eax, 0x10(%rsp)
cltd
idivl %ebp
movl %edx, 0x50(%rsp)
xorl %r14d, %r14d
cmpl $0x1, %eax
movl $0x0, %ecx
sbbq %rcx, %rcx
movq %rcx, 0x30(%rsp)
movl %eax, 0x14(%rsp)
cmpl $0x1, %eax
sete 0x48(%rsp)
movl %r12d, %r15d
negl %r12d
movq 0x78(%rsp), %rsi
movslq 0x20(%rsi), %rax
movq %r15, %rcx
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
subq %rax, %r13
cmpl %r12d, %eax
cmovgq %rcx, %r13
movslq 0x1c(%rsi), %rax
movq %rax, 0x40(%rsp)
andl $0x7ffffffe, %edi       # imm = 0x7FFFFFFE
movq %rdi, 0x98(%rsp)
movl %r9d, %esi
movq %r9, 0x8(%rsp)
callq 0x209630
testq %rax, %rax
je 0x33a1e4
movq %r13, 0x60(%rsp)
movl 0x120(%rsp), %r8d
xorl %edi, %edi
testl %ebx, %ebx
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x110(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x118(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
movl %r8d, 0x5c(%rsp)
testl %r8d, %r8d
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, 0x70(%rsp)
movl %ecx, 0xc(%rax)
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2ea474
movq %rax, %r14
movq 0x8(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x10, %edi
movq %rsi, 0x38(%rsp)
callq 0x2094de
movq %rax, 0x20(%rsp)
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2ea474
movq %rax, %r13
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2ea474
movq %rbp, %rsi
movq %rax, %rbp
movl $0x10, %edi
movq %rsi, 0x18(%rsp)
callq 0x2ea474
testq %r14, %r14
sete %cl
cmpq $0x0, 0x20(%rsp)
sete %dl
orb %cl, %dl
testq %r13, %r13
sete %cl
testq %rbp, %rbp
sete %sil
orb %cl, %sil
orb %dl, %sil
testq %rax, %rax
sete %cl
orb %sil, %cl
jne 0x33a113
movq 0x8(%rsp), %r11
leal -0x1(%r11), %ecx
movl %ecx, 0x4(%rsp)
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movl (%rsp), %esi
movd %esi, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movq 0x60(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
subq 0x40(%rsp), %rcx
addq $-0x2, %rcx
movq %rdx, 0x28(%rsp)
movq %rdx, %xmm2
pshufd $0x44, %xmm2, %xmm3     # xmm3 = xmm2[0,1,0,1]
movq %rcx, 0x90(%rsp)
movq %rcx, %xmm4
pshufd $0x44, %xmm4, %xmm5     # xmm5 = xmm4[0,1,0,1]
xorl %ecx, %ecx
movb 0x48(%rsp), %dl
movb %dl, %cl
negq %rcx
movq 0x30(%rsp), %xmm4
movq %rcx, %xmm6
punpcklqdq %xmm6, %xmm4    # xmm4 = xmm4[0],xmm6[0]
movl %esi, %ecx
movslq %r12d, %rdx
movl 0x18(%rsp), %esi
movq %rsi, 0x30(%rsp)
imulq %rcx, %rsi
xorl %edi, %edi
movq %rdx, %r8
xorl %r9d, %r9d
testl %ebx, %ebx
je 0x339af4
xorl %r10d, %r10d
jmp 0x339af7
movq %r8, %r10
movq %r10, 0xc0(%rsp,%r9,8)
subq %r15, %r10
movq %r10, 0xb0(%rsp,%r9,8)
incq %r9
subq %rsi, %r8
cmpq $0x1, %r9
je 0x339aeb
movq %rdi, %r8
shlq $0x4, %r8
movaps 0xc0(%rsp), %xmm6
movaps %xmm6, (%rbp,%r8)
movdqa 0xb0(%rsp), %xmm6
movdqa %xmm6, (%r14,%r8)
incq %rdi
subq %rcx, %rdx
cmpq 0x30(%rsp), %rdi
jne 0x339ae5
movq 0x20(%rsp), %rbx
movq $0x0, (%rbx)
movl $0x1, %ecx
movl (%rsp), %esi
movl 0x118(%rsp), %edi
movq 0x38(%rsp), %r8
testl %edi, %edi
movl $0x0, %edx
cmovel %r12d, %edx
movslq %edx, %rdx
movq %rdx, (%rbx,%rcx,8)
incq %rcx
subl %esi, %r12d
cmpq %rcx, %r8
jne 0x339b67
pxor %xmm6, %xmm6
psubq %xmm0, %xmm6
movq 0x18(%rsp), %rdi
leal -0x1(%rdi), %ecx
movq %rcx, %rsi
shlq $0x4, %rsi
movq %rax, %rdx
addq %rsi, %rdx
movl %edi, %esi
movdqa %xmm6, (%rdx)
psubq %xmm1, %xmm6
movq %xmm5, %rdi
movq %xmm6, %r8
cmpq %r8, %rdi
cmovlq %rdi, %r8
pshufd $0xee, %xmm5, %xmm5     # xmm5 = xmm5[2,3,2,3]
movq %xmm5, %rdi
pshufd $0xee, %xmm6, %xmm5     # xmm5 = xmm6[2,3,2,3]
movq %xmm5, %r9
cmpq %r9, %rdi
cmovlq %rdi, %r9
movq %r8, %xmm5
movq %r9, %xmm7
punpcklqdq %xmm7, %xmm5    # xmm5 = xmm5[0],xmm7[0]
addq $-0x10, %rdx
decl %esi
jg 0x339ba3
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rbp, %rcx
movq %rcx, 0x48(%rsp)
movl 0x50(%rsp), %ecx
movq %rcx, 0x88(%rsp)
shlq $0x4, %rcx
addq %rbp, %rcx
movq %rcx, 0x40(%rsp)
movq 0x18(%rsp), %rcx
cmpl $0x1, %ecx
movl %ecx, %r12d
adcl $0x0, %r12d
cmpl $0x2, %r11d
movl $0x1, %edx
cmovgel %r11d, %edx
movq %rdx, 0x38(%rsp)
shlq $0x4, %r12
xorl %esi, %esi
movslq %ecx, %rcx
movq %rcx, 0xa0(%rsp)
movl 0x4(%rsp), %ecx
movl %ecx, (%rsp)
movdqa %xmm3, %xmm6
movdqa %xmm3, %xmm7
movq (%rbx,%rsi,8), %xmm8
movq 0x48(%rsp), %rcx
punpcklqdq (%rcx), %xmm8   # xmm8 = xmm8[0],mem[0]
movq 0x78(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x80(%rsp), %rdx
movq %rsi, 0x8(%rsp)
movzbl (%rdx,%rsi), %edx
movslq (%rcx,%rdx,4), %rcx
imulq 0xa0(%rsp), %rcx
shlq $0x4, %rcx
addq 0xa8(%rsp), %rcx
movdqa %xmm3, %xmm10
psubq (%rax), %xmm10
xorl %r9d, %r9d
movdqa %xmm3, %xmm9
movdqa (%rbp,%r9), %xmm11
movdqa (%r14,%r9), %xmm12
psubq %xmm1, %xmm12
movdqa %xmm11, %xmm13
psubq %xmm0, %xmm13
movq %xmm12, %rsi
movq %xmm13, %rdx
cmpq %rdx, %rsi
cmovgq %rsi, %rdx
pshufd $0xee, %xmm12, %xmm12   # xmm12 = xmm12[2,3,2,3]
movq %xmm12, %rsi
pshufd $0xee, %xmm13, %xmm12   # xmm12 = xmm13[2,3,2,3]
movq %xmm12, %r11
cmpq %r11, %rsi
cmovgq %rsi, %r11
paddq (%rcx,%r9), %xmm8
paddq (%rax,%r9), %xmm10
movq %xmm9, %rsi
movq %xmm10, %r10
cmpq %r10, %rsi
cmovgq %rsi, %r10
movq %xmm8, %rsi
pshufd $0xee, %xmm8, %xmm12    # xmm12 = xmm8[2,3,2,3]
movdqa %xmm11, %xmm8
pshufd $0xee, %xmm9, %xmm9     # xmm9 = xmm9[2,3,2,3]
movq %xmm9, %r8
pshufd $0xee, %xmm10, %xmm9    # xmm9 = xmm10[2,3,2,3]
movq %xmm9, %r15
cmpq %r15, %r8
cmovgq %r8, %r15
movq %rdx, %xmm11
movq %r11, %xmm9
punpcklqdq %xmm9, %xmm11   # xmm11 = xmm11[0],xmm9[0]
movq %r10, %xmm9
movq %r15, %xmm10
cmpq %rsi, %rdx
cmovleq %rsi, %rdx
movq %xmm12, %rsi
cmpq %rsi, %r11
cmovleq %rsi, %r11
punpcklqdq %xmm10, %xmm9   # xmm9 = xmm9[0],xmm10[0]
movq %rdx, %xmm10
movq %r11, %xmm12
punpcklqdq %xmm12, %xmm10  # xmm10 = xmm10[0],xmm12[0]
movdqa %xmm11, (%r14,%r9)
movdqa %xmm10, (%r13,%r9)
addq $0x10, %r9
cmpq %r9, %r12
jne 0x339ca9
movq 0x8(%rsp), %rcx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x50(%rsp)
movq 0x8(%rbx,%rcx,8), %rcx
movq (%rax), %rsi
addq %rcx, %rsi
cmpq %rsi, %r10
cmovgq %r10, %rsi
movq %rsi, %xmm8
pslldq $0x8, %xmm8             # xmm8 = zero,zero,zero,zero,zero,zero,zero,zero,xmm8[0,1,2,3,4,5,6,7]
paddq %xmm2, %xmm8
movq %xmm8, %rsi
cmpq %rsi, %rcx
cmovgq %rcx, %rsi
pshufd $0xee, %xmm8, %xmm9     # xmm9 = xmm8[2,3,2,3]
movq %xmm9, %rcx
cmpq %rcx, %rdx
cmovgq %rdx, %rcx
movq %rsi, %xmm9
movq %rcx, %xmm10
punpcklqdq %xmm10, %xmm9   # xmm9 = xmm9[0],xmm10[0]
xorl %r11d, %r11d
psubq %xmm1, %xmm8
psubq %xmm0, %xmm9
movq %xmm8, %rcx
movq %xmm9, %r8
cmpq %r8, %rcx
cmovgq %rcx, %r8
pshufd $0xee, %xmm8, %xmm8     # xmm8 = xmm8[2,3,2,3]
movq %xmm8, %rcx
pshufd $0xee, %xmm9, %xmm8     # xmm8 = xmm9[2,3,2,3]
movq %xmm8, %rsi
cmpq %rsi, %rcx
cmovgq %rcx, %rsi
movq %r8, %xmm8
movq %rsi, %xmm9
punpcklqdq %xmm9, %xmm8    # xmm8 = xmm8[0],xmm9[0]
movq (%r13,%r11), %r10
cmpq %r8, %r10
cmovleq %r8, %r10
movq 0x8(%r13,%r11), %r9
cmpq %rsi, %r9
cmovleq %rsi, %r9
movq %r10, %xmm9
movq %r9, %xmm10
punpcklqdq %xmm10, %xmm9   # xmm9 = xmm9[0],xmm10[0]
movq %xmm5, %rcx
cmpq %r10, %rcx
cmovgeq %r10, %rcx
pshufd $0xee, %xmm5, %xmm5     # xmm5 = xmm5[2,3,2,3]
movq %xmm5, %rdx
cmpq %r9, %rdx
cmovgeq %r9, %rdx
movdqa %xmm9, (%rbp,%r11)
cmpq %r8, %rcx
cmovgeq %r8, %rcx
cmpq %rsi, %rdx
cmovgeq %rsi, %rdx
movq %rcx, %xmm5
movq %rdx, %xmm10
punpcklqdq %xmm10, %xmm5   # xmm5 = xmm5[0],xmm10[0]
movq %xmm7, %rsi
cmpq %r10, %rsi
cmovgq %rsi, %r10
pshufd $0xee, %xmm7, %xmm7     # xmm7 = xmm7[2,3,2,3]
movq %xmm7, %rsi
cmpq %r9, %rsi
cmovgq %rsi, %r9
movq %r10, %xmm7
movq %r9, %xmm10
punpcklqdq %xmm10, %xmm7   # xmm7 = xmm7[0],xmm10[0]
addq $0x10, %r11
cmpq %r11, %r12
jne 0x339df7
movq %xmm6, %r11
movq 0x40(%rsp), %rdi
movq (%rdi), %rsi
movq 0x8(%rdi), %rbx
pshufd $0xee, %xmm6, %xmm6     # xmm6 = xmm6[2,3,2,3]
movq %xmm6, %r8
xorl %r15d, %r15d
cmpq %r8, %rbx
setg %r15b
cmovgq %rbx, %r8
xorl %ebx, %ebx
cmpq %r11, %rsi
setg %bl
cmovgq %rsi, %r11
negq %rbx
negq %r15
movq %rbx, %xmm6
movq %r15, %xmm8
punpcklqdq %xmm8, %xmm6    # xmm6 = xmm6[0],xmm8[0]
pand %xmm4, %xmm6
pmovmskb %xmm6, %esi
testl %esi, %esi
movl (%rsp), %esi
cmovnel 0x8(%rsp), %esi
movl %esi, (%rsp)
movdqa (%rdi), %xmm8
movl 0x14(%rsp), %esi
testl %esi, %esi
jg 0x339f55
pslldq $0x8, %xmm8             # xmm8 = zero,zero,zero,zero,zero,zero,zero,zero,xmm8[0,1,2,3,4,5,6,7]
testl %esi, %esi
js 0x339f4b
movq 0x20(%rsp), %rbx
movq %r11, %xmm6
movq %r8, %xmm9
punpcklqdq %xmm9, %xmm6    # xmm6 = xmm6[0],xmm9[0]
pshufd $0xee, %xmm8, %xmm8     # xmm8 = xmm8[2,3,2,3]
movq 0x70(%rsp), %r11
movq 0x10(%r11), %rsi
movq (%rsi), %rsi
movq 0x8(%rsp), %rdi
movd %xmm8, (%rsi,%rdi,4)
movq 0x50(%rsp), %rsi
cmpq 0x38(%rsp), %rsi
jne 0x339c54
movq 0x18(%rsp), %rsi
cmpl $0x1, %esi
adcl $0x0, %esi
movq 0x30(%rsp), %rbx
shlq $0x2, %rbx
shlq $0x2, %rsi
xorl %edi, %edi
movdqa (%rbp,%rdi,4), %xmm0
movq 0x10(%r11), %r8
movq 0x8(%r8), %r8
movd %xmm0, (%r8,%rdi)
addq %rdi, %r8
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movd %xmm0, (%rbx,%r8)
addq $0x4, %rdi
cmpq %rdi, %rsi
jne 0x339fb0
cmpl $0x0, 0x120(%rsp)
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
movq 0x68(%rsp), %r12
je 0x33a00a
testl %esi, %esi
jg 0x339fff
pslldq $0x8, %xmm6             # xmm6 = zero,zero,zero,zero,zero,zero,zero,zero,xmm6[0,1,2,3,4,5,6,7]
testl %esi, %esi
js 0x339ff6
pshufd $0xee, %xmm6, %xmm0     # xmm0 = xmm6[2,3,2,3]
movq %xmm0, 0x28(%rsp)
cmpl $0x0, 0x110(%rsp)
je 0x33a0a6
cmpl $0x0, 0x98(%rsp)
je 0x33a0a6
movq 0x18(%rsp), %r8
andl $0x3fffffff, %r8d       # imm = 0x3FFFFFFF
addl %r8d, %r8d
xorl %r11d, %r11d
movq %r8, 0x8(%rsp)
movl %r11d, %ebx
shrl %ebx
testb $0x1, %r11b
movl $0x0, %esi
cmovnel 0x18(%rsp), %esi
addl %ebx, %esi
cmpl %r12d, %esi
jge 0x33a09e
movq (%rbp,%r11,8), %rbx
movq 0x28(%rsp), %r15
cmpq %r15, %rbx
jle 0x33a076
movq %rbx, 0x28(%rsp)
movl 0x4(%rsp), %edi
movl %edi, (%rsp)
movl %esi, %edi
jmp 0x33a09e
cmpl %edi, %esi
cmovgel %edi, %esi
movl %edi, %r8d
movq %r12, %rdi
movl (%rsp), %r12d
cmpl 0x4(%rsp), %r12d
movq %rdi, %r12
movl %r8d, %edi
movq 0x8(%rsp), %r8
cmovnel %edi, %esi
cmpq %r15, %rbx
cmovel %esi, %edi
incq %r11
cmpl %r11d, %r8d
jne 0x33a03d
movl 0x110(%rsp), %esi
orl %esi, 0x5c(%rsp)
movq 0x70(%rsp), %rbx
movq 0x28(%rsp), %r11
jne 0x33a139
movq 0x88(%rsp), %rsi
shlq $0x4, %rsi
movdqa (%rbp,%rsi), %xmm0
movl 0x14(%rsp), %esi
testl %esi, %esi
jle 0x33a11b
movl 0x10(%rsp), %edi
jmp 0x33a128
callq 0x1b3b7b
jmp 0x33a113
callq 0x1b3b55
jmp 0x33a113
callq 0x1b3b2f
jmp 0x33a113
callq 0x1b3b09
jmp 0x33a113
callq 0x1b3ae3
jmp 0x33a113
callq 0x1b3abd
jmp 0x33a113
callq 0x1b3a97
jmp 0x33a113
callq 0x1b3a71
xorl %r14d, %r14d
jmp 0x33a1e4
movl 0x10(%rsp), %edi
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
testl %esi, %esi
js 0x33a11f
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %r11
movl 0x4(%rsp), %esi
movl %esi, (%rsp)
xorl %esi, %esi
movq 0x60(%rsp), %r8
cmpq %r8, %rcx
setle %sil
negq %rsi
xorl %ecx, %ecx
cmpq %r8, %rdx
setle %cl
negq %rcx
movq %rcx, %xmm0
movq %rsi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
xorl %ecx, %ecx
movq 0x90(%rsp), %rsi
cmpq %rsi, %r10
setg %cl
negq %rcx
xorl %edx, %edx
cmpq %rsi, %r9
setg %dl
negq %rdx
movq %rdx, %xmm0
movq %rcx, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
por %xmm1, %xmm2
pmovmskb %xmm2, %ecx
testl %ecx, %ecx
je 0x33a1ab
orb $0x40, 0xc(%rbx)
xorl %r11d, %r11d
movl $0x0, (%rsp)
xorl %edi, %edi
movl %r11d, (%rbx)
movl %edi, 0x4(%rbx)
movl (%rsp), %ecx
movl %ecx, 0x8(%rbx)
movq %rax, %rdi
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
movq 0x20(%rsp), %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq %rbx, %r14
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq