// File: /workspace/github_c_makefile_star2_O2/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 $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, 0xe0(%rsp)
testq %rdi, %rdi
je 0x34237f
movq 0x60(%rdi), %rax
movq %rax, 0x148(%rsp)
testq %rax, %rax
je 0x3423a3
movq 0x10(%rdi), %rax
movq %rax, 0xd8(%rsp)
testq %rax, %rax
je 0x3423c7
movl %edx, %r13d
movl 0x8(%rdi), %edx
testl %edx, %edx
jle 0x3423eb
cmpq $0x0, 0xe0(%rsp)
je 0x34240f
testl %r13d, %r13d
jle 0x342430
testl %ecx, %ecx
js 0x342451
testl %r8d, %r8d
js 0x342472
movl %r9d, %r12d
movl %r8d, 0x10(%rsp)
leal -0x1(%rdx), %eax
movq %rdx, 0x130(%rsp)
leaq 0x1(%rdx), %rbx
shrq %rbx
movl %eax, 0x8c(%rsp)
xorl %edx, %edx
divl %ebx
movl %edx, %ebp
pushq $0x1
popq %rdx
subl %eax, %edx
movl %ecx, %r15d
negl %ecx
movq 0xd8(%rsp), %rsi
movslq 0x20(%rsi), %rax
movq %r15, %rdi
btsq $0x3f, %rdi
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
subq %rax, %r14
movl %ecx, 0x30(%rsp)
cmpl %ecx, %eax
cmovgq %rdi, %r14
movslq 0x1c(%rsi), %rax
movq %rax, 0x50(%rsp)
movl %edx, 0x88(%rsp)
movslq %edx, %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movss 0x28637d(%rip), %xmm1   # 0x5c7b70
callq 0x3424af
movdqa %xmm0, 0x190(%rsp)
pushq $0x10
popq %rcx
movl %ebx, %edi
movl %r13d, %esi
movq %rcx, %rdx
callq 0x1abb59
testq %rax, %rax
je 0x341a49
movl %ebp, 0xb0(%rsp)
movq %r14, 0xc0(%rsp)
xorl %edi, %edi
testl %r12d, %r12d
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x200(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x208(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x210(%rsp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x2880402, %ecx        # imm = 0x2880402
movq %rax, 0x80(%rsp)
movl %ecx, 0xc(%rax)
pushq $0x10
popq %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x297cd8
movq %rax, 0x48(%rsp)
movq %r13, 0x90(%rsp)
leal 0x1(%r13), %esi
movq %rbp, %rdi
movq %rsi, 0x60(%rsp)
callq 0x1ab78c
movq %rax, %r13
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x297cd8
movq %rax, %r14
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x297cd8
movq %rax, %rbp
pushq $0x10
popq %rdi
movq %rbx, 0xd0(%rsp)
movq %rbx, %rsi
callq 0x297cd8
movq 0x48(%rsp), %xmm0
movq %r13, 0x20(%rsp)
movq %r13, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %r14, 0x78(%rsp)
movq %r14, %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 %ebx, %ebx
testl %ecx, %ecx
jne 0x34249a
testq %rax, %rax
je 0x34249a
movq %rax, %r13
movq 0x90(%rsp), %rax
decl %eax
movl %eax, 0x2c(%rsp)
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x100(%rsp)
movl 0x10(%rsp), %r11d
movd %r11d, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x110(%rsp)
movq 0xc0(%rsp), %rax
incq %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
subq 0x50(%rsp), %rcx
addq $-0x2, %rcx
movq %rax, 0x128(%rsp)
movq %rax, %xmm0
movdqa %xmm0, 0x180(%rsp)
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x160(%rsp)
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x150(%rsp)
movl %r11d, %eax
movl 0x30(%rsp), %ebx
movslq %ebx, %rcx
movq 0xd0(%rsp), %r10
movq %r10, %rdx
imulq %rax, %rdx
xorl %esi, %esi
cmpq %r10, %rsi
je 0x341a50
movq %rcx, %rdi
xorl %r8d, %r8d
cmpq $0x2, %r8
je 0x341a19
testl %r12d, %r12d
je 0x3419fb
xorl %r9d, %r9d
jmp 0x3419fe
movq %rdi, %r9
movq %r9, 0x1b0(%rsp,%r8,8)
subq %r15, %r9
movq %r9, 0x1a0(%rsp,%r8,8)
incq %r8
subq %rdx, %rdi
jmp 0x3419eb
movq %rsi, %rdi
shlq $0x4, %rdi
movaps 0x1b0(%rsp), %xmm0
movaps %xmm0, (%rbp,%rdi)
movdqa 0x1a0(%rsp), %xmm0
movq 0x48(%rsp), %r8
movdqa %xmm0, (%r8,%rdi)
incq %rsi
subq %rax, %rcx
jmp 0x3419e0
xorl %ebx, %ebx
jmp 0x34249a
movq 0x20(%rsp), %rax
andq $0x0, (%rax)
pushq $0x1
popq %rax
movl 0x208(%rsp), %esi
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rdx
cmpq %rax, %rdi
je 0x341a8b
testl %esi, %esi
movl $0x0, %ecx
cmovel %ebx, %ecx
movslq %ecx, %rcx
movq %rcx, (%rdx,%rax,8)
incq %rax
subl %r11d, %ebx
jmp 0x341a6d
pxor %xmm0, %xmm0
psubq 0x100(%rsp), %xmm0
leal -0x1(%r10), %eax
movdqa 0x150(%rsp), %xmm1
movdqa %xmm1, 0x30(%rsp)
movl %eax, %ecx
testl %ecx, %ecx
js 0x341b1e
movl %ecx, %edx
shlq $0x4, %rdx
movdqa %xmm0, (%r13,%rdx)
psubq 0x110(%rsp), %xmm0
movdqa 0x30(%rsp), %xmm5
movdqa %xmm5, %xmm1
movdqa 0x285e37(%rip), %xmm3   # 0x5c7910
pxor %xmm3, %xmm1
movdqa %xmm0, %xmm2
pxor %xmm3, %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, %xmm5
pandn %xmm0, %xmm2
por %xmm2, %xmm5
movdqa %xmm5, 0x30(%rsp)
decl %ecx
jmp 0x341aad
movl %eax, %eax
shlq $0x4, %rax
addq %rbp, %rax
movq %rax, 0x138(%rsp)
movl 0xb0(%rsp), %eax
shlq $0x4, %rax
addq %rbp, %rax
movq %rax, 0xc8(%rsp)
movl 0x90(%rsp), %eax
movq %rax, 0x140(%rsp)
movq %r10, %r12
shlq $0x4, %r12
xorl %r15d, %r15d
xorl %edx, %edx
movdqa 0x160(%rsp), %xmm0
movdqa %xmm0, %xmm2
movdqa %xmm0, 0x90(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq %r13, 0x70(%rsp)
cmpq 0x140(%rsp), %rdx
je 0x3421be
movdqa %xmm2, 0x170(%rsp)
movq 0x20(%rsp), %rax
movq (%rax,%rdx,8), %xmm3
movq 0x138(%rsp), %rax
punpcklqdq (%rax), %xmm3   # xmm3 = xmm3[0],mem[0]
movq 0xd8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xe0(%rsp), %rcx
movq %rdx, 0xe8(%rsp)
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %eax
imull %r10d, %eax
movslq %eax, %rbx
shlq $0x4, %rbx
addq 0x148(%rsp), %rbx
movdqa 0x160(%rsp), %xmm0
movdqa %xmm0, %xmm2
psubq (%r13), %xmm2
xorl %r14d, %r14d
movdqa %xmm0, %xmm7
cmpq %r14, %r12
je 0x341df4
movdqa (%rbp,%r14), %xmm0
movdqa %xmm0, 0x50(%rsp)
movq 0x48(%rsp), %r13
movdqa (%r13,%r14), %xmm1
psubq 0x100(%rsp), %xmm0
movdqa %xmm0, 0x60(%rsp)
psubq 0x110(%rsp), %xmm1
movdqa %xmm1, 0xa0(%rsp)
movq 0x70(%rsp), %rax
paddq (%rax,%r14), %xmm2
movdqa %xmm2, 0xf0(%rsp)
paddq (%rbx,%r14), %xmm3
movdqa %xmm3, 0xb0(%rsp)
movdqa %xmm7, 0x10(%rsp)
callq 0x3424bd
movdqa 0x10(%rsp), %xmm7
pand 0x2878f1(%rip), %xmm0   # 0x5c9570
pxor 0x2878f9(%rip), %xmm0   # 0x5c9580
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
addq %r15, %rax
movdqa %xmm0, (%r14,%rax)
movdqa 0xf0(%rsp), %xmm4
movdqa %xmm4, %xmm0
movdqa 0x285c5c(%rip), %xmm5   # 0x5c7910
pxor %xmm5, %xmm0
movdqa %xmm7, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
pand %xmm3, %xmm0
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm0, %xmm1
pand %xmm1, %xmm7
pandn %xmm4, %xmm1
por %xmm1, %xmm7
movdqa 0xa0(%rsp), %xmm4
movdqa %xmm4, %xmm0
pxor %xmm5, %xmm0
movdqa 0x60(%rsp), %xmm6
movdqa %xmm6, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm3, %xmm1
pshufd $0xf5, %xmm2, %xmm0     # xmm0 = xmm2[1,1,3,3]
por %xmm1, %xmm0
movdqa %xmm6, %xmm1
pand %xmm0, %xmm1
pandn %xmm4, %xmm0
por %xmm1, %xmm0
movdqa 0x30(%rsp), %xmm6
movdqa %xmm6, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm0, %xmm2
pxor %xmm5, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm2, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
por %xmm1, %xmm3
pand %xmm3, %xmm6
pandn %xmm0, %xmm3
por %xmm3, %xmm6
movdqa %xmm6, 0x30(%rsp)
movdqa 0xb0(%rsp), %xmm6
movdqa %xmm6, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm2, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm2, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm1, %xmm2
movdqa %xmm0, (%r13,%r14)
pand %xmm2, %xmm0
pandn %xmm6, %xmm2
por %xmm0, %xmm2
movq 0x78(%rsp), %rax
movdqa %xmm2, (%rax,%r14)
movdqa %xmm6, (%rbp,%r14)
addq $0x10, %r14
movdqa 0x50(%rsp), %xmm3
jmp 0x341c00
movq 0xe8(%rsp), %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0xf0(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax,%rcx,8), %rax
movq %rax, %xmm5
movq %xmm7, %rcx
movq 0x70(%rsp), %r13
addq (%r13), %rax
cmpq %rax, %rcx
cmovgq %rcx, %rax
movq %rax, %xmm6
pslldq $0x8, %xmm6             # xmm6 = zero,zero,zero,zero,zero,zero,zero,zero,xmm6[0,1,2,3,4,5,6,7]
paddq 0x180(%rsp), %xmm6
punpcklqdq %xmm2, %xmm5    # xmm5 = xmm5[0],xmm2[0]
movdqa %xmm6, %xmm1
movdqa 0x285ac1(%rip), %xmm3   # 0x5c7910
pxor %xmm3, %xmm1
movdqa %xmm5, %xmm2
pxor %xmm3, %xmm2
movdqa %xmm1, %xmm3
pcmpgtd %xmm2, %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, %xmm0     # xmm0 = xmm3[1,1,3,3]
por %xmm1, %xmm0
movdqa %xmm6, %xmm1
pand %xmm0, %xmm1
pandn %xmm5, %xmm0
por %xmm1, %xmm0
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x342112
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %r14
addq %r15, %r14
movaps (%rbx,%r14), %xmm1
movaps %xmm1, 0x50(%rsp)
movaps (%rbp,%rbx), %xmm1
movaps %xmm1, 0x60(%rsp)
psubq 0x100(%rsp), %xmm0
movdqa %xmm0, 0x10(%rsp)
psubq 0x110(%rsp), %xmm6
movdqa %xmm6, 0xa0(%rsp)
movdqa %xmm6, %xmm1
callq 0x3424bd
pand 0x28769f(%rip), %xmm0   # 0x5c9590
pxor 0x2876a7(%rip), %xmm0   # 0x5c95a0
por 0x50(%rsp), %xmm0
movdqa %xmm0, 0xb0(%rsp)
movdqa 0xa0(%rsp), %xmm4
movdqa %xmm4, %xmm0
movdqa 0x2859f3(%rip), %xmm2   # 0x5c7910
pxor %xmm2, %xmm0
movdqa 0x10(%rsp), %xmm5
movdqa %xmm5, %xmm1
pxor %xmm2, %xmm1
movdqa %xmm2, %xmm6
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
pand %xmm3, %xmm0
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm0, %xmm1
movdqa %xmm5, %xmm0
pand %xmm1, %xmm0
pandn %xmm4, %xmm1
por %xmm0, %xmm1
movq 0x78(%rsp), %rax
movdqa (%rax,%rbx), %xmm5
movdqa %xmm1, %xmm0
movdqa %xmm1, %xmm4
movdqa %xmm1, 0x50(%rsp)
pxor %xmm6, %xmm0
movdqa %xmm0, 0xa0(%rsp)
movdqa %xmm5, %xmm1
pxor %xmm6, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm3, %xmm1
pshufd $0xf5, %xmm2, %xmm0     # xmm0 = xmm2[1,1,3,3]
por %xmm1, %xmm0
pand %xmm0, %xmm5
pandn %xmm4, %xmm0
por %xmm5, %xmm0
movdqa %xmm0, 0x10(%rsp)
movaps 0x60(%rsp), %xmm1
callq 0x3424af
movdqa %xmm0, 0x60(%rsp)
movaps 0x10(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
callq 0x3424af
andps 0x2875c2(%rip), %xmm0   # 0x5c95b0
xorps 0x285fdb(%rip), %xmm0   # 0x5c7fd0
movaps 0x60(%rsp), %xmm2
movaps %xmm2, %xmm1
andnps %xmm0, %xmm1
andps 0x2875b9(%rip), %xmm2   # 0x5c95c0
orps 0xb0(%rsp), %xmm2
orps %xmm1, %xmm2
movaps %xmm2, (%rbx,%r14)
movdqa 0x10(%rsp), %xmm7
movdqa %xmm7, (%rbp,%rbx)
movdqa 0x30(%rsp), %xmm4
movdqa %xmm4, %xmm1
movdqa 0x2858db(%rip), %xmm5   # 0x5c7910
pxor %xmm5, %xmm1
movdqa %xmm7, %xmm0
pxor %xmm5, %xmm0
movdqa %xmm0, %xmm2
pcmpgtd %xmm1, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %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
pand %xmm2, %xmm4
pandn %xmm7, %xmm2
por %xmm4, %xmm2
movdqa %xmm2, %xmm1
pxor %xmm5, %xmm1
movdqa 0xa0(%rsp), %xmm6
movdqa %xmm6, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm6, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
por %xmm1, %xmm3
pand %xmm3, %xmm2
movdqa 0x50(%rsp), %xmm6
pandn %xmm6, %xmm3
por %xmm2, %xmm3
movdqa %xmm3, 0x30(%rsp)
movdqa 0x90(%rsp), %xmm4
movdqa %xmm4, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm5     # xmm5 = xmm1[1,1,3,3]
pand %xmm3, %xmm5
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
movdqa %xmm7, %xmm0
por %xmm5, %xmm1
pand %xmm1, %xmm4
pandn %xmm7, %xmm1
por %xmm1, %xmm4
movdqa %xmm4, 0x90(%rsp)
addq $0x10, %rbx
jmp 0x341e90
movq 0xc8(%rsp), %rax
movdqa (%rax), %xmm0
movdqa %xmm0, 0x10(%rsp)
movaps 0x170(%rsp), %xmm1
callq 0x3424bd
pand 0x190(%rsp), %xmm0
movdqa 0x170(%rsp), %xmm6
movdqa %xmm6, %xmm1
movdqa 0x2857c1(%rip), %xmm3   # 0x5c7910
pxor %xmm3, %xmm1
movdqa 0x10(%rsp), %xmm5
movdqa %xmm5, %xmm2
pxor %xmm3, %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, %xmm5
pandn %xmm6, %xmm2
pmovmskb %xmm0, %eax
testl %eax, %eax
movl 0xc(%rsp), %eax
cmovnel 0xe8(%rsp), %eax
movl %eax, 0xc(%rsp)
por %xmm5, %xmm2
addq %r12, %r15
movq 0xf0(%rsp), %rdx
movq 0xd0(%rsp), %r10
jmp 0x341b83
movl 0x210(%rsp), %r11d
testl %r11d, %r11d
movl 0x8c(%rsp), %edi
movq 0x130(%rsp), %r8
movl 0x88(%rsp), %r9d
movl 0x200(%rsp), %r14d
movq 0x128(%rsp), %r15
movl 0x2c(%rsp), %r12d
movl 0xc(%rsp), %r13d
je 0x342219
xorl %eax, %eax
pushq $0x1
popq %rcx
cmpl %r9d, %eax
jge 0x34220f
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
movl %ecx, %eax
jmp 0x342201
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
movq %xmm0, %r15
testl %r14d, %r14d
je 0x342271
movl %r10d, %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addl %eax, %eax
xorl %ecx, %ecx
movl %edi, %ebx
cmpl %ecx, %eax
je 0x342273
movl %ecx, %esi
shrl %esi
testb $0x1, %cl
movl $0x0, %edx
cmovnel %r10d, %edx
addl %esi, %edx
cmpl %r8d, %edx
jge 0x34226c
movq (%rbp,%rcx,8), %rsi
cmpq %r15, %rsi
jle 0x34225b
movq %rsi, %r15
movl %r12d, %r13d
movl %edx, %ebx
jmp 0x34226c
cmpl %ebx, %edx
cmovgel %ebx, %edx
cmpl %r12d, %r13d
cmovnel %ebx, %edx
cmpq %r15, %rsi
cmovel %edx, %ebx
incq %rcx
jmp 0x34222c
movl %edi, %ebx
orl %r14d, %r11d
jne 0x3422a6
movq 0xc8(%rsp), %rax
movdqa (%rax), %xmm0
xorl %ecx, %ecx
pushq $0x1
popq %rax
cmpl %r9d, %ecx
jge 0x342297
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
movl %eax, %ecx
jmp 0x342289
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %r15
movl %r12d, %r13d
movl %edi, %ebx
movl %r13d, %r14d
movq 0xc0(%rsp), %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x10(%rsp)
movdqa 0x90(%rsp), %xmm0
movaps 0x150(%rsp), %xmm1
callq 0x3424bd
movdqa 0x285635(%rip), %xmm1   # 0x5c7910
movdqa 0x30(%rsp), %xmm3
pxor %xmm1, %xmm3
movdqa 0x10(%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 0x80(%rsp), %r13
je 0x34233b
orb $0x40, 0xc(%r13)
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %ebx, %ebx
movl %r15d, (%r13)
movl %ebx, 0x4(%r13)
movl %r14d, 0x8(%r13)
movq 0x70(%rsp), %rdi
callq 0x1ab763
movq %rbp, %rdi
callq 0x1ab763
movq 0x78(%rsp), %rdi
callq 0x1ab763
movq 0x20(%rsp), %rdi
callq 0x1ab763
movq 0x48(%rsp), %rdi
callq 0x1ab763
movq %r13, %rbx
jmp 0x34249a
movq 0x3f8c52(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x284c5b(%rip), %rsi    # 0x5c6feb
leaq 0x287262(%rip), %rdx    # 0x5c95f9
leaq 0x25b13f(%rip), %rcx    # 0x59d4dd
jmp 0x342491
movq 0x3f8c2e(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x284c37(%rip), %rsi    # 0x5c6feb
leaq 0x28723e(%rip), %rdx    # 0x5c95f9
leaq 0x28555e(%rip), %rcx    # 0x5c7920
jmp 0x342491
movq 0x3f8c0a(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x284c13(%rip), %rsi    # 0x5c6feb
leaq 0x28721a(%rip), %rdx    # 0x5c95f9
leaq 0x285553(%rip), %rcx    # 0x5c7939
jmp 0x342491
movq 0x3f8be6(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x285305(%rip), %rsi    # 0x5c7701
leaq 0x2871f6(%rip), %rdx    # 0x5c95f9
leaq 0x28553f(%rip), %rcx    # 0x5c7949
jmp 0x342491
movq 0x3f8bc2(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x284bcb(%rip), %rsi    # 0x5c6feb
leaq 0x2871d2(%rip), %rdx    # 0x5c95f9
leaq 0x2852d0(%rip), %rcx    # 0x5c76fe
jmp 0x342491
movq 0x3f8ba1(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2852c0(%rip), %rsi    # 0x5c7701
leaq 0x2871b1(%rip), %rdx    # 0x5c95f9
leaq 0x2852c6(%rip), %rcx    # 0x5c7715
jmp 0x342491
movq 0x3f8b80(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2852b9(%rip), %rsi    # 0x5c771b
leaq 0x287190(%rip), %rdx    # 0x5c95f9
leaq 0x2852c0(%rip), %rcx    # 0x5c7730
jmp 0x342491
movq 0x3f8b5f(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x285298(%rip), %rsi    # 0x5c771b
leaq 0x28716f(%rip), %rdx    # 0x5c95f9
leaq 0x2852a4(%rip), %rcx    # 0x5c7735
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq