// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sg_trace_scan_sse2_128_64.c
// Function: parasail_sg_flags_trace_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 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 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;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;

    /* 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));
    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);

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

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SG | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_TRACE
        | 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;

    /* 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 vE_ext;
        __m128i vE_opn;
        __m128i vHt;
        __m128i vF;
        __m128i vF_ext;
        __m128i vF_opn;
        __m128i vH;
        __m128i vHp;
        __m128i *pvW;
        __m128i vW;
        __m128i case1;
        __m128i case2;
        __m128i vGapper;
        __m128i vT;
        __m128i vET;
        __m128i vFT;

        /* 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);
            vGapper = _mm_load_si128(pvGapper+i);
            vE_opn = _mm_sub_epi64(vH, vGapO);
            vE_ext = _mm_sub_epi64(vE, vGapE);
            case1 = _mm_cmpgt_epi64_rpl(vE_opn, vE_ext);
            vET = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, case1);
            arr_store(result->trace->trace_table, vET, i, segLen, j);
            vE = _mm_max_epi64_rpl(vE_opn, vE_ext);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vE);
            vGapper = _mm_add_epi64(vHt, vGapper);
            vF = _mm_max_epi64_rpl(vF, vGapper);
            vHp = _mm_add_epi64(vHp, vW);
            vHt = _mm_max_epi64_rpl(vE, vHp);
            _mm_store_si128(pvE+i, vE);
            _mm_store_si128(pvHt+i, vHt);
            _mm_store_si128(pvH+i, vHp);
            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);
        vGapper = _mm_load_si128(pvGapper);
        vGapper = _mm_add_epi64(vHt, vGapper);
        vF = _mm_max_epi64_rpl(vF, vGapper);
        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(vF, vHt);
        for (i=0; i<segLen; ++i) {
            vET = arr_load(result->trace->trace_table, i, segLen, j);
            vHp = _mm_load_si128(pvH+i);
            vHt = _mm_load_si128(pvHt+i);
            vF_opn = _mm_sub_epi64(vH, vGapO);
            vF_ext = _mm_sub_epi64(vF, vGapE);
            vF = _mm_max_epi64_rpl(vF_opn, vF_ext);
            case1 = _mm_cmpgt_epi64_rpl(vF_opn, vF_ext);
            vFT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, case1);
            vH = _mm_max_epi64_rpl(vHt, vF);
            case1 = _mm_cmpeq_epi64_rpl(vH, vHp);
            case2 = _mm_cmpeq_epi64_rpl(vH, vF);
            vT = _mm_blendv_epi8_rpl(
                    _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                    vTDiag, case1);
            vT = _mm_or_si128(vT, vET);
            vT = _mm_or_si128(vT, vFT);
            arr_store(result->trace->trace_table, vT, i, segLen, j);
            _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);
        }

        /* 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;
            }
        }
    } 

    /* 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 $0x138, %rsp            # imm = 0x138
movq %rsi, 0x78(%rsp)
testq %rdi, %rdi
je 0x38698a
movq 0x60(%rdi), %rax
movq %rax, 0xf8(%rsp)
testq %rax, %rax
je 0x386991
movq 0x10(%rdi), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x386998
movl 0x8(%rdi), %eax
movq %rax, 0x68(%rsp)
testl %eax, %eax
jle 0x38699f
cmpq $0x0, 0x78(%rsp)
je 0x3869a6
movl %r9d, %r15d
movl %edx, %r9d
testl %edx, %edx
jle 0x3869ad
testl %ecx, %ecx
js 0x3869b4
testl %r8d, %r8d
js 0x3869bb
movl %r8d, 0x4(%rsp)
movq 0x68(%rsp), %rdx
leal -0x1(%rdx), %eax
leaq 0x1(%rdx), %r13
movq %r13, %rbx
shrq %rbx
movl %eax, 0xc(%rsp)
cltd
idivl %ebx
movl %edx, 0x50(%rsp)
xorl %r14d, %r14d
cmpl $0x1, %eax
movl $0x0, %edx
sbbq %rdx, %rdx
movq %rdx, 0x18(%rsp)
movl %eax, 0x24(%rsp)
cmpl $0x1, %eax
sete 0xa0(%rsp)
movl %ecx, %r12d
negl %ecx
movq 0x70(%rsp), %rdx
movslq 0x20(%rdx), %rax
movq %r12, %rsi
btsq $0x3f, %rsi
movabsq $-0x8000000000000000, %rbp # imm = 0x8000000000000000
subq %rax, %rbp
movl %ecx, 0x90(%rsp)
cmpl %ecx, %eax
cmovgq %rsi, %rbp
movslq 0x1c(%rdx), %rax
movq %rax, 0x80(%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movl %ebx, %edi
movl %r9d, %esi
movq %r9, 0x10(%rsp)
callq 0x2097d1
testq %rax, %rax
je 0x386a98
movq %r13, 0xc8(%rsp)
movq %rbp, 0x60(%rsp)
movl 0x180(%rsp), %edi
xorl %r8d, %r8d
testl %r15d, %r15d
setne %r8b
xorl %ecx, %ecx
cmpl $0x0, 0x170(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x178(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
movl %edi, 0x5c(%rsp)
testl %edi, %edi
setne %sil
shll $0xf, %esi
leal (%rcx,%r8,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x2880402, %ecx        # imm = 0x2880402
movl %ecx, 0xc(%rax)
movl $0x10, %edi
movq %rbx, %rsi
movq %rax, 0xd8(%rsp)
callq 0x2ea474
movq %rax, %r14
movq 0x10(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x10, %edi
movq %rsi, 0x30(%rsp)
callq 0x2094de
movq %rax, %r13
movl $0x10, %edi
movq %rbx, %rsi
callq 0x2ea474
movq %rax, 0xd0(%rsp)
movl $0x10, %edi
movq %rbx, %rsi
callq 0x2ea474
movq %rax, %rbp
movl $0x10, %edi
movq %rbx, %rsi
callq 0x2ea474
movq %r14, 0x48(%rsp)
testq %r14, %r14
sete %cl
movq %r13, 0x40(%rsp)
testq %r13, %r13
movq 0xd0(%rsp), %r13
sete %dl
orb %cl, %dl
testq %r13, %r13
sete %cl
testq %rbp, %rbp
sete %sil
orb %cl, %sil
orb %dl, %sil
movq %rax, 0x38(%rsp)
testq %rax, %rax
sete %cl
orb %sil, %cl
movq 0xd8(%rsp), %r14
jne 0x3869c0
movq 0x10(%rsp), %rax
decl %eax
movl %eax, 0x8(%rsp)
movq %r12, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movl 0x4(%rsp), %edx
movd %edx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movq 0x60(%rsp), %rcx
leaq 0x1(%rcx), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
subq 0x80(%rsp), %rcx
addq $-0x2, %rcx
movq %rax, %xmm2
movdqa %xmm2, 0x100(%rsp)
pshufd $0x44, %xmm2, %xmm2     # xmm2 = xmm2[0,1,0,1]
movdqa %xmm2, 0x80(%rsp)
movq %rcx, 0xc0(%rsp)
movq %rcx, %xmm2
pshufd $0x44, %xmm2, %xmm5     # xmm5 = xmm2[0,1,0,1]
xorl %ecx, %ecx
movb 0xa0(%rsp), %sil
movb %sil, %cl
negq %rcx
movq 0x18(%rsp), %xmm3
movq %rcx, %xmm2
punpcklqdq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0]
movdqa %xmm3, 0xa0(%rsp)
movl %edx, %ecx
movslq 0x90(%rsp), %rdx
movl %ebx, %esi
movq %rsi, 0x18(%rsp)
imulq %rcx, %rsi
xorl %edi, %edi
movq 0x48(%rsp), %r11
movq %rdx, %r8
xorl %r9d, %r9d
testl %r15d, %r15d
je 0x386270
xorl %r10d, %r10d
jmp 0x386273
movq %r8, %r10
movq %r10, 0x120(%rsp,%r9,8)
subq %r12, %r10
movq %r10, 0x110(%rsp,%r9,8)
incq %r9
subq %rsi, %r8
cmpq $0x1, %r9
je 0x386266
movq %rdi, %r8
shlq $0x4, %r8
movaps 0x120(%rsp), %xmm2
movaps %xmm2, (%rbp,%r8)
movdqa 0x110(%rsp), %xmm2
movdqa %xmm2, (%r11,%r8)
incq %rdi
subq %rcx, %rdx
cmpq 0x18(%rsp), %rdi
jne 0x386260
movq 0x40(%rsp), %rsi
movq $0x0, (%rsi)
movl $0x1, %ecx
movl 0x4(%rsp), %edi
movl 0x90(%rsp), %r8d
movl 0x178(%rsp), %r9d
movq 0x30(%rsp), %r10
testl %r9d, %r9d
movl $0x0, %edx
cmovel %r8d, %edx
movslq %edx, %rdx
movq %rdx, (%rsi,%rcx,8)
incq %rcx
subl %edi, %r8d
cmpq %rcx, %r10
jne 0x3862ed
movq %rax, 0x28(%rsp)
pxor %xmm2, %xmm2
psubq %xmm0, %xmm2
leal -0x1(%rbx), %ecx
movq %rcx, %rsi
shlq $0x4, %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movl %ebx, %esi
movdqa %xmm2, (%rdx)
psubq %xmm1, %xmm2
movq %xmm5, %rdi
movq %xmm2, %r8
cmpq %r8, %rdi
cmovlq %rdi, %r8
pshufd $0xee, %xmm5, %xmm3     # xmm3 = xmm5[2,3,2,3]
movq %xmm3, %rdi
pshufd $0xee, %xmm2, %xmm3     # xmm3 = xmm2[2,3,2,3]
movq %xmm3, %r9
cmpq %r9, %rdi
cmovlq %rdi, %r9
movq %r8, %xmm5
movq %r9, %xmm3
punpcklqdq %xmm3, %xmm5    # xmm5 = xmm5[0],xmm3[0]
addq $-0x10, %rdx
decl %esi
jg 0x38632c
movl %ecx, %eax
shlq $0x4, %rax
addq %rbp, %rax
movq %rax, 0x30(%rsp)
movl 0x50(%rsp), %eax
movq %rax, 0xb0(%rsp)
shlq $0x4, %rax
addq %rbp, %rax
movq %rax, 0xf0(%rsp)
cmpl $0x1, %ebx
movl %ebx, %eax
adcl $0x0, %eax
movq 0x10(%rsp), %rsi
cmpl $0x2, %esi
movl $0x1, %edx
cmovgel %esi, %edx
movq %rdx, 0xe8(%rsp)
shlq $0x4, 0x18(%rsp)
shlq $0x4, %rax
xorl %r11d, %r11d
movq %rbx, 0xb8(%rsp)
movslq %ebx, %rcx
movq %rcx, 0xe0(%rsp)
movdqa 0x271098(%rip), %xmm9   # 0x5f7480
movdqa 0x27109f(%rip), %xmm10  # 0x5f7490
movdqa 0x26fad6(%rip), %xmm11  # 0x5f5ed0
movdqa 0x27109d(%rip), %xmm12  # 0x5f74a0
xorl %edi, %edi
movl 0x8(%rsp), %ecx
movl %ecx, 0x4(%rsp)
movdqa 0x80(%rsp), %xmm2
movdqa %xmm2, %xmm14
movdqa %xmm2, %xmm4
movdqa 0x271038(%rip), %xmm8   # 0x5f7460
movdqa %xmm4, 0x90(%rsp)
movq 0x40(%rsp), %r15
movq (%r15,%rdi,8), %xmm2
movq 0x30(%rsp), %rcx
punpcklqdq (%rcx), %xmm2   # xmm2 = xmm2[0],mem[0]
movq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x78(%rsp), %rdx
movq %rdi, 0x10(%rsp)
movzbl (%rdx,%rdi), %edx
movslq (%rcx,%rdx,4), %rcx
imulq 0xe0(%rsp), %rcx
shlq $0x4, %rcx
addq 0xf8(%rsp), %rcx
movdqa 0x80(%rsp), %xmm15
movdqa %xmm15, %xmm3
movq 0x38(%rsp), %r12
psubq (%r12), %xmm3
xorl %r8d, %r8d
movq 0x48(%rsp), %rbx
movdqa 0x270fb1(%rip), %xmm7   # 0x5f7450
movdqa (%rbp,%r8), %xmm6
movdqa (%rbx,%r8), %xmm13
movdqa %xmm6, %xmm4
psubq %xmm0, %xmm4
psubq %xmm1, %xmm13
movq %xmm4, %rdx
movq %xmm13, %rdi
pshufd $0xee, %xmm4, %xmm4     # xmm4 = xmm4[2,3,2,3]
movq %xmm4, %r9
pshufd $0xee, %xmm13, %xmm4    # xmm4 = xmm13[2,3,2,3]
movq %xmm4, %rsi
xorl %r10d, %r10d
cmpq %rsi, %r9
setg %r10b
cmovgq %r9, %rsi
xorl %r9d, %r9d
cmpq %rdi, %rdx
cmovgq %rdx, %rdi
setg %r9b
negq %r9
negq %r10
movq %r9, %xmm4
movq %r10, %xmm13
punpcklqdq %xmm13, %xmm4   # xmm4 = xmm4[0],xmm13[0]
pand %xmm7, %xmm4
pxor %xmm8, %xmm4
movq 0x10(%r14), %rdx
movq (%rdx), %rdx
paddq (%r12,%r8), %xmm3
addq %r11, %rdx
paddq (%rcx,%r8), %xmm2
movdqa %xmm4, (%r8,%rdx)
movq %rdi, %xmm13
movq %rsi, %xmm4
punpcklqdq %xmm4, %xmm13   # xmm13 = xmm13[0],xmm4[0]
movq %xmm5, %rdx
cmpq %rdi, %rdx
cmovgeq %rdi, %rdx
pshufd $0xee, %xmm5, %xmm4     # xmm4 = xmm5[2,3,2,3]
movq %xmm4, %r9
cmpq %rsi, %r9
cmovgeq %rsi, %r9
movq %rdx, %xmm5
movq %r9, %xmm4
punpcklqdq %xmm4, %xmm5    # xmm5 = xmm5[0],xmm4[0]
movq %xmm15, %rdx
movq %xmm3, %r9
cmpq %r9, %rdx
cmovgq %rdx, %r9
pshufd $0xee, %xmm15, %xmm4    # xmm4 = xmm15[2,3,2,3]
movq %xmm4, %rdx
pshufd $0xee, %xmm3, %xmm3     # xmm3 = xmm3[2,3,2,3]
movq %xmm3, %r10
cmpq %r10, %rdx
cmovgq %rdx, %r10
movq %r9, %xmm15
movq %r10, %xmm3
punpcklqdq %xmm3, %xmm15   # xmm15 = xmm15[0],xmm3[0]
movq %xmm2, %rdx
cmpq %rdx, %rdi
cmovleq %rdx, %rdi
pshufd $0xee, %xmm2, %xmm3     # xmm3 = xmm2[2,3,2,3]
movq %xmm3, %rdx
cmpq %rdx, %rsi
cmovleq %rdx, %rsi
movq %rdi, %xmm3
movq %rsi, %xmm4
punpcklqdq %xmm4, %xmm3    # xmm3 = xmm3[0],xmm4[0]
movdqa %xmm13, (%rbx,%r8)
movdqa %xmm3, (%r13,%r8)
movdqa %xmm2, (%rbp,%r8)
addq $0x10, %r8
movdqa %xmm6, %xmm2
cmpq %r8, %rax
jne 0x38649f
movq 0x10(%rsp), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x50(%rsp)
movq 0x8(%r15,%rcx,8), %rcx
movq (%r12), %rdx
addq %rcx, %rdx
cmpq %rdx, %r9
cmovgq %r9, %rdx
movq %rdx, %xmm15
pslldq $0x8, %xmm15            # xmm15 = zero,zero,zero,zero,zero,zero,zero,zero,xmm15[0,1,2,3,4,5,6,7]
paddq 0x100(%rsp), %xmm15
movq %xmm15, %rdx
cmpq %rcx, %rdx
cmovgq %rdx, %rcx
pshufd $0xee, %xmm15, %xmm2    # xmm2 = xmm15[2,3,2,3]
movq %xmm2, %rdx
cmpq %rdi, %rdx
cmovgq %rdx, %rdi
movq %rcx, %xmm2
movq %rdi, %xmm3
punpcklqdq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0]
xorl %r10d, %r10d
movdqa 0x270e0f(%rip), %xmm7   # 0x5f7470
movq 0x10(%r14), %rcx
movq (%rcx), %r9
addq %r11, %r9
psubq %xmm0, %xmm2
psubq %xmm1, %xmm15
movq %xmm2, %rcx
movq %xmm15, %rdi
xorl %edx, %edx
cmpq %rdi, %rcx
cmovgq %rcx, %rdi
pshufd $0xee, %xmm2, %xmm2     # xmm2 = xmm2[2,3,2,3]
movq %xmm2, %rsi
pshufd $0xee, %xmm15, %xmm2    # xmm2 = xmm15[2,3,2,3]
movq %xmm2, %rcx
setg %dl
negq %rdx
xorl %r8d, %r8d
cmpq %rcx, %rsi
cmovgq %rsi, %rcx
movq %rdi, %xmm15
movq %rcx, %xmm2
punpcklqdq %xmm2, %xmm15   # xmm15 = xmm15[0],xmm2[0]
setg %r8b
negq %r8
movq %rdx, %xmm3
movq %r8, %xmm2
punpcklqdq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0]
pand %xmm7, %xmm3
pxor %xmm9, %xmm3
movq (%r13,%r10), %rdx
movq 0x8(%r13,%r10), %r15
cmpq %rdi, %rdx
movq %rdi, %rsi
cmovgq %rdx, %rsi
cmpq %rcx, %r15
movq %rcx, %r8
cmovgq %r15, %r8
movq %rsi, %xmm2
movq %r8, %xmm4
xorl %ebx, %ebx
cmpq (%rbp,%r10), %rsi
sete %bl
negq %rbx
movq %r13, %r12
movq %r14, %r13
xorl %r14d, %r14d
cmpq 0x8(%rbp,%r10), %r8
punpcklqdq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0]
sete %r14b
negq %r14
movq %rbx, %xmm4
movq %r14, %xmm6
movq %r13, %r14
movq %r12, %r13
punpcklqdq %xmm6, %xmm4    # xmm4 = xmm4[0],xmm6[0]
xorl %ebx, %ebx
cmpq %rdx, %rdi
setge %bl
negq %rbx
xorl %edx, %edx
cmpq %r15, %rcx
setge %dl
negq %rdx
movq %rbx, %xmm6
movq %rdx, %xmm13
punpcklqdq %xmm13, %xmm6   # xmm6 = xmm6[0],xmm13[0]
pand %xmm10, %xmm6
pxor %xmm11, %xmm6
movdqa %xmm4, %xmm13
pandn %xmm6, %xmm13
pand %xmm12, %xmm4
por (%r10,%r9), %xmm3
por %xmm13, %xmm3
por %xmm4, %xmm3
movdqa %xmm3, (%r10,%r9)
movq %xmm5, %r9
cmpq %rsi, %r9
cmovgeq %rsi, %r9
pshufd $0xee, %xmm5, %xmm3     # xmm3 = xmm5[2,3,2,3]
movq %xmm3, %r15
cmpq %r8, %r15
cmovgeq %r8, %r15
movdqa %xmm2, (%rbp,%r10)
cmpq %rdi, %r9
cmovgeq %rdi, %r9
cmpq %rcx, %r15
cmovgeq %rcx, %r15
movq %r9, %xmm5
movq %r15, %xmm3
punpcklqdq %xmm3, %xmm5    # xmm5 = xmm5[0],xmm3[0]
movq %xmm14, %rcx
cmpq %rsi, %rcx
cmovgq %rcx, %rsi
pshufd $0xee, %xmm14, %xmm3    # xmm3 = xmm14[2,3,2,3]
movq %xmm3, %rcx
cmpq %r8, %rcx
cmovgq %rcx, %r8
movq %rsi, %xmm14
movq %r8, %xmm3
punpcklqdq %xmm3, %xmm14   # xmm14 = xmm14[0],xmm3[0]
addq $0x10, %r10
cmpq %r10, %rax
jne 0x386661
movdqa 0x90(%rsp), %xmm2
movq %xmm2, %rcx
movq 0xf0(%rsp), %rdi
movq (%rdi), %rdx
movq 0x8(%rdi), %rdi
pshufd $0xee, %xmm2, %xmm2     # xmm2 = xmm2[2,3,2,3]
movq %xmm2, %r10
xorl %ebx, %ebx
cmpq %r10, %rdi
setg %bl
cmovgq %rdi, %r10
xorl %edi, %edi
cmpq %rcx, %rdx
setg %dil
cmovgq %rdx, %rcx
negq %rdi
negq %rbx
movq %rdi, %xmm2
movq %rbx, %xmm3
punpcklqdq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0]
pand 0xa0(%rsp), %xmm2
movq %rcx, %xmm4
movq %r10, %xmm3
pmovmskb %xmm2, %ecx
testl %ecx, %ecx
movl 0x4(%rsp), %ecx
cmovnel 0x10(%rsp), %ecx
movl %ecx, 0x4(%rsp)
punpcklqdq %xmm3, %xmm4    # xmm4 = xmm4[0],xmm3[0]
addq 0x18(%rsp), %r11
movq 0x50(%rsp), %rcx
movq %rcx, %rdi
cmpq 0xe8(%rsp), %rcx
jne 0x386428
cmpl $0x0, 0x180(%rsp)
movl 0xc(%rsp), %edx
movl 0x24(%rsp), %ecx
movq 0xb8(%rsp), %rax
je 0x3868d3
testl %ecx, %ecx
jg 0x3868c8
pslldq $0x8, %xmm4             # xmm4 = zero,zero,zero,zero,zero,zero,zero,zero,xmm4[0,1,2,3,4,5,6,7]
testl %ecx, %ecx
js 0x3868bf
pshufd $0xee, %xmm4, %xmm0     # xmm0 = xmm4[2,3,2,3]
movq %xmm0, 0x28(%rsp)
cmpl $0x0, 0x170(%rsp)
je 0x386958
testl $0x7ffffffe, 0xc8(%rsp) # imm = 0x7FFFFFFE
je 0x386958
movl %eax, %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
addl %ecx, %ecx
xorl %edi, %edi
movl %edi, %r11d
shrl %r11d
testb $0x1, %dil
movl $0x0, %r10d
cmovnel %eax, %r10d
addl %r11d, %r10d
cmpl 0x68(%rsp), %r10d
jge 0x386951
movq (%rbp,%rdi,8), %r11
movq 0x28(%rsp), %rbx
cmpq %rbx, %r11
jle 0x386935
movq %r11, 0x28(%rsp)
movl 0x8(%rsp), %edx
movl %edx, 0x4(%rsp)
movl %r10d, %edx
jmp 0x386951
cmpl %edx, %r10d
cmovgel %edx, %r10d
movl 0x4(%rsp), %r13d
cmpl 0x8(%rsp), %r13d
cmovnel %edx, %r10d
cmpq %rbx, %r11
cmovel %r10d, %edx
incq %rdi
cmpl %edi, %ecx
jne 0x3868f6
movl 0x170(%rsp), %eax
orl %eax, 0x5c(%rsp)
movq 0x28(%rsp), %rax
jne 0x3869e7
movq 0xb0(%rsp), %rax
shlq $0x4, %rax
movdqa (%rbp,%rax), %xmm0
movl 0x24(%rsp), %eax
testl %eax, %eax
jle 0x3869c8
movl 0xc(%rsp), %edx
jmp 0x3869d5
callq 0x1bc3a7
jmp 0x3869c0
callq 0x1bc381
jmp 0x3869c0
callq 0x1bc35b
jmp 0x3869c0
callq 0x1bc335
jmp 0x3869c0
callq 0x1bc30f
jmp 0x3869c0
callq 0x1bc2e9
jmp 0x3869c0
callq 0x1bc2c3
jmp 0x3869c0
callq 0x1bc29d
xorl %r14d, %r14d
jmp 0x386a98
movl 0xc(%rsp), %edx
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 0x3869cc
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rax
movl 0x8(%rsp), %ecx
movl %ecx, 0x4(%rsp)
xorl %ecx, %ecx
movq 0x60(%rsp), %r10
cmpq %r10, %r9
setle %cl
negq %rcx
xorl %edi, %edi
cmpq %r10, %r15
setle %dil
negq %rdi
movq %rdi, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
xorl %ecx, %ecx
movq 0xc0(%rsp), %rdi
cmpq %rdi, %rsi
setg %cl
negq %rcx
xorl %esi, %esi
cmpq %rdi, %r8
setg %sil
negq %rsi
movq %rsi, %xmm0
movq %rcx, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
por %xmm1, %xmm2
pmovmskb %xmm2, %ecx
testl %ecx, %ecx
je 0x386a5b
orb $0x40, 0xc(%r14)
xorl %eax, %eax
movl $0x0, 0x4(%rsp)
xorl %edx, %edx
movl %eax, (%r14)
movl %edx, 0x4(%r14)
movl 0x4(%rsp), %eax
movl %eax, 0x8(%r14)
movq 0x38(%rsp), %rdi
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq 0x40(%rsp), %rdi
callq 0x2094b5
movq 0x48(%rsp), %rdi
callq 0x2094b5
movq %r14, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq