// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sw_trace_scan_sse2_128_64.c
// Function: parasail_sw_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)
{
    /* declare local variables */
    int32_t i = 0;
    int32_t j = 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;
    __m128i* restrict pvP = NULL;
    __m128i* restrict pvE = NULL;
    __m128i* restrict pvHt = NULL;
    __m128i* restrict pvH = NULL;
    __m128i* restrict pvHMax = 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 vMaxHUnit;
    __m128i vNegInfFront;
    __m128i vSegLenXgap;
    parasail_result_t *result = NULL;
    __m128i vTZero;
    __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;
    end_query = 0;
    end_ref = 0;
    s1Len = profile->s1Len;
    matrix = profile->matrix;
    segWidth = 2; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    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;
    vMaxHUnit = vNegLimit;
    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));
    vTZero = _mm_set1_epi64x_rpl(PARASAIL_ZERO);
    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_SW | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_2;

    /* initialize heap variables */
    pvE    = parasail_memalign___m128i(16, segLen);
    pvHt   = parasail_memalign___m128i(16, segLen);
    pvH    = parasail_memalign___m128i(16, segLen);
    pvHMax = parasail_memalign___m128i(16, segLen);
    pvGapper = parasail_memalign___m128i(16, segLen);

    /* validate heap variables */
    if (!pvE) return NULL;
    if (!pvHt) return NULL;
    if (!pvH) return NULL;
    if (!pvHMax) return NULL;
    if (!pvGapper) return NULL;

    parasail_memset___m128i(pvH, vZero, segLen);
    parasail_memset___m128i(pvE, vNegLimit, segLen);
    {
        __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);
        }
    }

    /* 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 case0;
        __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);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = vZero;
        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);
            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);
        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);
        vH = _mm_max_epi64_rpl(vH, vZero);
        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);
            vH = _mm_max_epi64_rpl(vH, vZero);
            case0 = _mm_cmpeq_epi64_rpl(vH, vZero);
            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_blendv_epi8_rpl(vT, vTZero, case0);
            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);
            vSaturationCheckMax = _mm_max_epi64_rpl(vSaturationCheckMax, vH);
            {
                vMaxH = _mm_max_epi64_rpl(vH, vMaxH);
            }
        } 

        {
            __m128i vCompare = _mm_cmpgt_epi64_rpl(vMaxH, vMaxHUnit);
            if (_mm_movemask_epi8(vCompare)) {
                score = _mm_hmax_epi64_rpl(vMaxH);
                vMaxHUnit = _mm_set1_epi64x_rpl(score);
                end_ref = j;
                (void)memcpy(pvHMax, pvH, sizeof(__m128i)*segLen);
            }
        }
    }

    /* Trace the alignment ending position on read. */
    {
        int64_t *t = (int64_t*)pvHMax;
        int32_t column_len = segLen * segWidth;
        end_query = s1Len;
        for (i = 0; i<column_len; ++i, ++t) {
            if (*t == score) {
                int32_t temp = i / segWidth + i % segWidth * segLen;
                if (temp < end_query) {
                    end_query = temp;
                }
            }
        }
    }

    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(pvHMax);
    parasail_free(pvH);
    parasail_free(pvHt);
    parasail_free(pvE);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, 0xc0(%rsp)
testq %rdi, %rdi
je 0x343301
movq 0x60(%rdi), %rax
movq %rax, 0x140(%rsp)
testq %rax, %rax
je 0x343325
movq 0x10(%rdi), %rax
movq %rax, 0xb8(%rsp)
testq %rax, %rax
je 0x343349
movl 0x8(%rdi), %r15d
testl %r15d, %r15d
jle 0x34336d
cmpq $0x0, 0xc0(%rsp)
je 0x343391
movl %edx, %ebp
testl %edx, %edx
jle 0x3433b2
testl %ecx, %ecx
js 0x3433d3
movl %r8d, %r14d
testl %r8d, %r8d
js 0x3433f4
leaq 0x1(%r15), %r12
shrq %r12
movl %ecx, %r13d
negl %ecx
movq 0xb8(%rsp), %rsi
movslq 0x20(%rsi), %rax
movq %r13, %rdx
btsq $0x3f, %rdx
movabsq $-0x8000000000000000, %rbx # imm = 0x8000000000000000
subq %rax, %rbx
cmpl %ecx, %eax
cmovgq %rdx, %rbx
movslq 0x1c(%rsi), %rax
movq %rax, 0x10(%rsp)
pushq $0x10
popq %rcx
movl %r12d, %edi
movl %ebp, %esi
movq %rcx, %rdx
callq 0x1abb59
testq %rax, %rax
je 0x342b94
movq %r13, 0x90(%rsp)
movl %r14d, 0x30(%rsp)
movl %ebp, 0x20(%rsp)
movq %rbx, 0xa8(%rsp)
movq %r15, 0x128(%rsp)
movq %rax, 0x68(%rsp)
orl $0x2880404, 0xc(%rax)   # imm = 0x2880404
pushq $0x10
popq %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x297cd8
movq %r12, %r14
movq %rax, %rbp
movq %r13, %rdi
movq %r12, %rsi
callq 0x297cd8
movq %rax, %r15
movq %r13, %rdi
movq %r12, %rsi
callq 0x297cd8
movq %rax, %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x297cd8
movq %rax, %rbx
movq %r13, %rdi
movq %r14, 0x50(%rsp)
movq %r14, %rsi
callq 0x297cd8
movq %rbp, 0x58(%rsp)
movq %rbp, %xmm0
movq %r15, 0x60(%rsp)
movq %r15, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %r12, %xmm1
movq %rbx, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
pxor %xmm2, %xmm2
pcmpeqd %xmm2, %xmm0
pcmpeqd %xmm2, %xmm1
movdqa %xmm0, %xmm2
shufps $0xdd, %xmm1, %xmm2     # xmm2 = xmm2[1,3],xmm1[1,3]
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
andps %xmm2, %xmm0
movmskps %xmm0, %ecx
xorl %r13d, %r13d
testl %ecx, %ecx
jne 0x34341d
testq %rax, %rax
je 0x34341d
movq %rax, %r15
movq 0x90(%rsp), %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xf0(%rsp)
movd 0x30(%rsp), %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x90(%rsp)
movq 0xa8(%rsp), %rax
incq %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
subq 0x10(%rsp), %rcx
addq $-0x2, %rcx
movq %rax, 0x48(%rsp)
movq %rax, %xmm0
movdqa %xmm0, 0x170(%rsp)
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xd0(%rsp)
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x150(%rsp)
pxor %xmm0, %xmm0
movq %r12, %rdi
movq 0x50(%rsp), %r13
movq %r13, %rsi
callq 0x297ce1
movq 0x58(%rsp), %rdi
movdqa 0xd0(%rsp), %xmm0
movq %r13, %rsi
callq 0x297ce1
pxor %xmm0, %xmm0
psubq 0xf0(%rsp), %xmm0
leal -0x1(%r13), %eax
movl %eax, %ecx
movl 0x20(%rsp), %esi
testl %ecx, %ecx
js 0x342b9c
movl %ecx, %edx
shlq $0x4, %rdx
movdqa %xmm0, (%r15,%rdx)
psubq 0x90(%rsp), %xmm0
decl %ecx
jmp 0x342b77
xorl %r13d, %r13d
jmp 0x34341d
movq %rbx, 0xb0(%rsp)
movl %eax, %eax
shlq $0x4, %rax
movq %r12, %rcx
addq %rax, %rcx
movq %rcx, 0x130(%rsp)
shlq $0x4, %r13
movl %esi, %eax
movq %rax, 0x138(%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
movaps 0xd0(%rsp), %xmm0
movaps %xmm0, 0x160(%rsp)
movaps %xmm0, %xmm1
movaps %xmm0, 0x100(%rsp)
movdqa 0x150(%rsp), %xmm0
movdqa %xmm0, 0x110(%rsp)
movl $0x0, 0xc(%rsp)
cmpq 0x138(%rsp), %rbx
je 0x3431db
movaps %xmm1, 0x30(%rsp)
movq %rbp, 0xc8(%rsp)
movq %r15, %rbp
movq 0x130(%rsp), %rax
movdqa (%rax), %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
movq 0xb8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xc0(%rsp), %rcx
movq %rbx, 0x148(%rsp)
movzbl (%rcx,%rbx), %ecx
movl (%rax,%rcx,4), %eax
imull 0x50(%rsp), %eax
movslq %eax, %rbx
shlq $0x4, %rbx
addq 0x140(%rsp), %rbx
pxor %xmm3, %xmm3
xorl %r14d, %r14d
movdqa 0xd0(%rsp), %xmm5
cmpq %r14, %r13
je 0x342e1f
movdqa (%r12,%r14), %xmm0
movdqa %xmm0, 0x20(%rsp)
movq 0x58(%rsp), %r15
movdqa (%r15,%r14), %xmm1
psubq 0xf0(%rsp), %xmm0
movdqa %xmm0, 0x80(%rsp)
psubq 0x90(%rsp), %xmm1
movdqa %xmm1, 0x70(%rsp)
paddq (%rbp,%r14), %xmm3
movdqa %xmm3, 0x180(%rsp)
paddq (%rbx,%r14), %xmm2
movdqa %xmm2, 0xe0(%rsp)
movdqa %xmm5, 0x10(%rsp)
callq 0x343432
movdqa 0x10(%rsp), %xmm5
pand 0x286882(%rip), %xmm0   # 0x5c9570
pxor 0x28688a(%rip), %xmm0   # 0x5c9580
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
addq 0xc8(%rsp), %rax
movdqa %xmm0, (%r14,%rax)
movdqa 0x180(%rsp), %xmm6
movdqa %xmm6, %xmm0
movdqa 0x284beb(%rip), %xmm4   # 0x5c7910
pxor %xmm4, %xmm0
movdqa %xmm5, %xmm1
pxor %xmm4, %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, %xmm5
pandn %xmm6, %xmm1
por %xmm1, %xmm5
movdqa 0x70(%rsp), %xmm6
movdqa %xmm6, %xmm0
pxor %xmm4, %xmm0
movdqa 0x80(%rsp), %xmm7
movdqa %xmm7, %xmm1
pxor %xmm4, %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
movdqa %xmm7, %xmm0
pand %xmm1, %xmm0
pandn %xmm6, %xmm1
por %xmm0, %xmm1
movdqa %xmm1, %xmm0
movdqa %xmm1, (%r15,%r14)
pxor %xmm4, %xmm1
movdqa 0xe0(%rsp), %xmm6
movdqa %xmm6, %xmm2
pxor %xmm4, %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, %xmm3     # xmm3 = xmm3[1,1,3,3]
por %xmm1, %xmm3
pand %xmm3, %xmm0
pandn %xmm6, %xmm3
por %xmm0, %xmm3
movq 0x60(%rsp), %rax
movdqa %xmm3, (%rax,%r14)
movdqa %xmm6, (%r12,%r14)
addq $0x10, %r14
movaps 0x20(%rsp), %xmm2
jmp 0x342c75
movq %xmm5, %rax
movq %rbp, %r15
movq (%rbp), %rcx
cmpq %rcx, %rax
cmovgq %rax, %rcx
movq %rcx, %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
paddq 0x170(%rsp), %xmm2
movq %xmm2, %rax
testq %rax, %rax
movl $0x0, %esi
cmovleq %rsi, %rax
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
movq %xmm0, %rcx
movq %xmm3, %rdx
cmpq %rdx, %rcx
cmovgq %rcx, %rdx
testq %rdx, %rdx
cmovleq %rsi, %rdx
movq %rdx, %xmm1
movq %rax, %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
xorl %ebx, %ebx
movq 0xc8(%rsp), %rbp
cmpq %rbx, %r13
je 0x34315d
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %r14
addq %rbp, %r14
movaps (%rbx,%r14), %xmm1
movaps %xmm1, 0x20(%rsp)
movaps (%r12,%rbx), %xmm1
movaps %xmm1, 0x80(%rsp)
psubq 0xf0(%rsp), %xmm0
movdqa %xmm0, 0x10(%rsp)
psubq 0x90(%rsp), %xmm2
movdqa %xmm2, 0x70(%rsp)
movdqa %xmm2, %xmm1
callq 0x343432
pand 0x2866a7(%rip), %xmm0   # 0x5c9590
pxor 0x2866af(%rip), %xmm0   # 0x5c95a0
por 0x20(%rsp), %xmm0
movdqa %xmm0, 0xe0(%rsp)
movdqa 0x70(%rsp), %xmm4
movdqa %xmm4, %xmm0
movdqa 0x2849fe(%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, %xmm2     # xmm2 = xmm2[1,1,3,3]
por %xmm0, %xmm2
movdqa %xmm5, %xmm0
pand %xmm2, %xmm0
pandn %xmm4, %xmm2
por %xmm0, %xmm2
movq 0x60(%rsp), %rax
movdqa (%rax,%rbx), %xmm0
movdqa %xmm2, %xmm1
movdqa %xmm2, %xmm5
movdqa %xmm2, 0x20(%rsp)
pxor %xmm6, %xmm1
movdqa %xmm0, %xmm2
pxor %xmm6, %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, %xmm0
pandn %xmm5, %xmm2
por %xmm0, %xmm2
movdqa %xmm2, %xmm0
pxor %xmm6, %xmm0
movdqa %xmm0, %xmm1
pcmpgtd %xmm6, %xmm1
pshufd $0xa0, %xmm1, %xmm3     # xmm3 = xmm1[0,0,2,2]
pcmpeqd %xmm6, %xmm0
pshufd $0xf5, %xmm0, %xmm4     # xmm4 = xmm0[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
por %xmm4, %xmm0
pand %xmm2, %xmm0
movdqa %xmm0, 0x10(%rsp)
pxor %xmm1, %xmm1
callq 0x343466
movdqa %xmm0, 0x70(%rsp)
movaps 0x10(%rsp), %xmm0
movaps 0x80(%rsp), %xmm1
callq 0x343466
movaps %xmm0, 0x80(%rsp)
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
callq 0x343466
andps 0x28658e(%rip), %xmm0   # 0x5c95b0
xorps 0x284fa7(%rip), %xmm0   # 0x5c7fd0
movaps 0x80(%rsp), %xmm2
movaps %xmm2, %xmm1
andnps %xmm0, %xmm1
andps 0x286582(%rip), %xmm2   # 0x5c95c0
orps %xmm1, %xmm2
movaps 0x70(%rsp), %xmm0
andnps %xmm2, %xmm0
orps 0xe0(%rsp), %xmm0
movaps %xmm0, (%rbx,%r14)
movdqa 0x10(%rsp), %xmm6
movdqa %xmm6, (%r12,%rbx)
movdqa 0x110(%rsp), %xmm4
movdqa %xmm4, %xmm1
movdqa 0x284899(%rip), %xmm5   # 0x5c7910
pxor %xmm5, %xmm1
movdqa %xmm6, %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 %xmm6, %xmm2
por %xmm2, %xmm4
movdqa %xmm4, 0x110(%rsp)
movdqa 0x100(%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, %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 %xmm6, %xmm2
por %xmm2, %xmm4
movdqa %xmm4, 0x100(%rsp)
movdqa 0x30(%rsp), %xmm4
movdqa %xmm4, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm0, %xmm2
pcmpgtd %xmm1, %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 %xmm6, %xmm0
por %xmm5, %xmm1
movdqa %xmm6, %xmm2
pand %xmm1, %xmm2
pandn %xmm4, %xmm1
por %xmm2, %xmm1
addq $0x10, %rbx
movdqa %xmm1, 0x30(%rsp)
movaps 0x20(%rsp), %xmm2
jmp 0x342e8b
movdqa 0x30(%rsp), %xmm0
movaps 0x160(%rsp), %xmm1
callq 0x343432
pmovmskb %xmm0, %eax
testl %eax, %eax
movq 0x148(%rsp), %rbx
je 0x3431cb
movdqa 0x30(%rsp), %xmm0
movq %xmm0, %rax
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rcx
cmpq %rcx, %rax
cmovgq %rax, %rcx
movq %rcx, 0x48(%rsp)
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x160(%rsp)
movq 0xb0(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19e0c0
movl %ebx, 0xc(%rsp)
incq %rbx
addq %r13, %rbp
movaps 0x30(%rsp), %xmm1
jmp 0x342bff
movq 0x50(%rsp), %rdi
movl %edi, %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addl %eax, %eax
xorl %ecx, %ecx
movq 0x128(%rsp), %rbx
movq 0x68(%rsp), %r13
movq 0xb0(%rsp), %r14
movq 0x48(%rsp), %r8
cmpl %ecx, %eax
je 0x34322a
cmpq %r8, (%r14,%rcx,8)
jne 0x343225
movl %ecx, %edx
shrl %edx
testb $0x1, %cl
movl $0x0, %esi
cmovnel %edi, %esi
addl %edx, %esi
cmpl %ebx, %esi
cmovll %esi, %ebx
incq %rcx
jmp 0x343205
movq 0xa8(%rsp), %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x10(%rsp)
movdqa 0x100(%rsp), %xmm0
movaps 0x150(%rsp), %xmm1
callq 0x343432
movq 0x48(%rsp), %rcx
movdqa 0x2846af(%rip), %xmm1   # 0x5c7910
movdqa 0x110(%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
je 0x3432c0
orb $0x40, 0xc(%r13)
xorl %ecx, %ecx
movl $0x0, 0xc(%rsp)
xorl %ebx, %ebx
movl %ecx, (%r13)
movl %ebx, 0x4(%r13)
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r13)
movq %r15, %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
movq %r12, %rdi
callq 0x1ab763
movq 0x60(%rsp), %rdi
callq 0x1ab763
movq 0x58(%rsp), %rdi
callq 0x1ab763
jmp 0x34341d
movq 0x3f7cd0(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x283cd9(%rip), %rsi    # 0x5c6feb
leaq 0x27ebcb(%rip), %rdx    # 0x5c1ee4
leaq 0x25a1bd(%rip), %rcx    # 0x59d4dd
jmp 0x343413
movq 0x3f7cac(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x283cb5(%rip), %rsi    # 0x5c6feb
leaq 0x27eba7(%rip), %rdx    # 0x5c1ee4
leaq 0x2845dc(%rip), %rcx    # 0x5c7920
jmp 0x343413
movq 0x3f7c88(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x283c91(%rip), %rsi    # 0x5c6feb
leaq 0x27eb83(%rip), %rdx    # 0x5c1ee4
leaq 0x2845d1(%rip), %rcx    # 0x5c7939
jmp 0x343413
movq 0x3f7c64(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x284383(%rip), %rsi    # 0x5c7701
leaq 0x27eb5f(%rip), %rdx    # 0x5c1ee4
leaq 0x2845bd(%rip), %rcx    # 0x5c7949
jmp 0x343413
movq 0x3f7c40(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x283c49(%rip), %rsi    # 0x5c6feb
leaq 0x27eb3b(%rip), %rdx    # 0x5c1ee4
leaq 0x28434e(%rip), %rcx    # 0x5c76fe
jmp 0x343413
movq 0x3f7c1f(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x28433e(%rip), %rsi    # 0x5c7701
leaq 0x27eb1a(%rip), %rdx    # 0x5c1ee4
leaq 0x284344(%rip), %rcx    # 0x5c7715
jmp 0x343413
movq 0x3f7bfe(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x284337(%rip), %rsi    # 0x5c771b
leaq 0x27eaf9(%rip), %rdx    # 0x5c1ee4
leaq 0x28433e(%rip), %rcx    # 0x5c7730
jmp 0x343413
movq 0x3f7bdd(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x284316(%rip), %rsi    # 0x5c771b
leaq 0x27ead8(%rip), %rdx    # 0x5c1ee4
leaq 0x284322(%rip), %rcx    # 0x5c7735
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x19e180
movq %r13, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq