// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/sw_trace_scan_sse2_128_8.c
// Function: parasail_sw_trace_scan_profile_sse2_128_8
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;
    int8_t NEG_LIMIT = 0;
    int8_t POS_LIMIT = 0;
    __m128i vZero;
    int8_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->profile8.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 = 16; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    pvP = (__m128i*)profile->profile8.score;
    vGapO = _mm_set1_epi8(open);
    vGapE = _mm_set1_epi8(gap);
    NEG_LIMIT = (-open < matrix->min ? INT8_MIN + open : INT8_MIN - matrix->min) + 1;
    POS_LIMIT = INT8_MAX - matrix->max - 1;
    vZero = _mm_setzero_si128();
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi8(NEG_LIMIT);
    vPosLimit = _mm_set1_epi8(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vMaxHUnit = vNegLimit;
    vNegInfFront = vZero;
    vNegInfFront = _mm_insert_epi8_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm_adds_epi8(vNegInfFront,
            _mm_slli_si128(_mm_set1_epi8(-segLen*gap), 1));
    vTZero = _mm_set1_epi8(PARASAIL_ZERO);
    vTIns  = _mm_set1_epi8(PARASAIL_INS);
    vTDel  = _mm_set1_epi8(PARASAIL_DEL);
    vTDiag = _mm_set1_epi8(PARASAIL_DIAG);
    vTDiagE = _mm_set1_epi8(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi8(PARASAIL_INS_E);
    vTDiagF = _mm_set1_epi8(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi8(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_8 | PARASAIL_FLAG_LANES_16;

    /* 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_subs_epi8(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm_store_si128(pvGapper+i, vGapper);
            vGapper = _mm_subs_epi8(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, 1);
        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_subs_epi8(vH, vGapO);
            vE_ext = _mm_subs_epi8(vE, vGapE);
            case1 = _mm_cmpgt_epi8(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_epi8_rpl(vE_opn, vE_ext);
            vGapper = _mm_adds_epi8(vHt, vGapper);
            vF = _mm_max_epi8_rpl(vF, vGapper);
            vHp = _mm_adds_epi8(vHp, vW);
            vHt = _mm_max_epi8_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, 1);
        vGapper = _mm_load_si128(pvGapper);
        vGapper = _mm_adds_epi8(vHt, vGapper);
        vF = _mm_max_epi8_rpl(vF, vGapper);
        for (i=0; i<segWidth-2; ++i) {
            __m128i vFt = _mm_slli_si128(vF, 1);
            vFt = _mm_adds_epi8(vFt, vSegLenXgap);
            vF = _mm_max_epi8_rpl(vF, vFt);
        }

        /* calculate final H */
        vF = _mm_slli_si128(vF, 1);
        vF = _mm_adds_epi8(vF, vNegInfFront);
        vH = _mm_max_epi8_rpl(vF, vHt);
        vH = _mm_max_epi8_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_subs_epi8(vH, vGapO);
            vF_ext = _mm_subs_epi8(vF, vGapE);
            vF = _mm_max_epi8_rpl(vF_opn, vF_ext);
            case1 = _mm_cmpgt_epi8(vF_opn, vF_ext);
            vFT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, case1);
            vH = _mm_max_epi8_rpl(vHt, vF);
            vH = _mm_max_epi8_rpl(vH, vZero);
            case0 = _mm_cmpeq_epi8(vH, vZero);
            case1 = _mm_cmpeq_epi8(vH, vHp);
            case2 = _mm_cmpeq_epi8(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_epi8_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMax = _mm_max_epi8_rpl(vSaturationCheckMax, vH);
            {
                vMaxH = _mm_max_epi8_rpl(vH, vMaxH);
            }
        } 

        {
            __m128i vCompare = _mm_cmpgt_epi8(vMaxH, vMaxHUnit);
            if (_mm_movemask_epi8(vCompare)) {
                score = _mm_hmax_epi8_rpl(vMaxH);
                vMaxHUnit = _mm_set1_epi8(score);
                end_ref = j;
                (void)memcpy(pvHMax, pvH, sizeof(__m128i)*segLen);
            }
        }
    }

    /* Trace the alignment ending position on read. */
    {
        int8_t *t = (int8_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_epi8(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi8(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 $0x138, %rsp            # imm = 0x138
movq %rsi, 0x48(%rsp)
testq %rdi, %rdi
je 0x3aac85
movq 0x18(%rdi), %rax
movq %rax, 0xc0(%rsp)
testq %rax, %rax
je 0x3aac8f
movq 0x10(%rdi), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x3aac99
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x3aaca3
cmpq $0x0, 0x48(%rsp)
je 0x3aacad
movl %edx, %r14d
testl %edx, %edx
jle 0x3aad58
movl %ecx, %r12d
testl %ecx, %ecx
js 0x3aad5f
movl %r8d, %r15d
testl %r8d, %r8d
js 0x3aad66
movq %rax, 0x30(%rsp)
leaq 0xf(%rax), %r13
movq %r13, 0x98(%rsp)
shrq $0x4, %r13
movl %r12d, %eax
negl %eax
movq 0x40(%rsp), %rsi
movl 0x20(%rsi), %ecx
movl %ecx, %edx
negb %dl
cmpl %eax, %ecx
movzbl %dl, %ebp
cmovgl %r12d, %ebp
movb $0x7e, %al
subb 0x1c(%rsi), %al
movb %al, 0x70(%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movl %r13d, %edi
movl %r14d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x3aad6b
movq %rax, %rbx
movl %r12d, 0x80(%rsp)
movl %r15d, 0x20(%rsp)
movl %r14d, 0x60(%rsp)
movl %ebp, 0xc(%rsp)
orl $0x10180404, 0xc(%rax)  # imm = 0x10180404
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %r14
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %r15
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %r12
movl $0x10, %edi
movq %r13, %rsi
callq 0x2f600c
movq %rax, %rbp
movl $0x10, %edi
movq %r13, 0x10(%rsp)
movq %r13, %rsi
callq 0x2f600c
movq %rax, %rdx
movq %r14, %xmm0
movq %r15, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %r12, %xmm1
movq %rbp, 0x18(%rsp)
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 %eax, %eax
testl %ecx, %ecx
jne 0x3aad6d
testq %rdx, %rdx
je 0x3aad6d
movd 0x80(%rsp), %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xf0(%rsp)
movl 0x20(%rsp), %ecx
movd %ecx, %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xe0(%rsp)
movl 0xc(%rsp), %eax
addb $-0x7f, %al
movl %eax, 0xc(%rsp)
movzbl %al, %eax
movd %eax, %xmm1
movdqa %xmm1, %xmm0
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x50(%rsp)
movzbl 0x70(%rsp), %eax
movd %eax, %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xd0(%rsp)
movq 0x10(%rsp), %rbp
imull %ebp, %ecx
negb %cl
movzbl %cl, %eax
movd %eax, %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
movdqa %xmm1, 0x100(%rsp)
paddsb %xmm1, %xmm0
movdqa %xmm0, 0x20(%rsp)
pxor %xmm0, %xmm0
movq %r12, %rdi
movq %rbp, %rsi
movq %rdx, 0x38(%rsp)
callq 0x2f6015
movq %r14, %rdi
movdqa 0x50(%rsp), %xmm0
movq %rbp, %rsi
callq 0x2f6015
pxor %xmm0, %xmm0
movdqa 0xe0(%rsp), %xmm9
movdqa 0xf0(%rsp), %xmm8
movq 0x38(%rsp), %rdi
leal -0x1(%rbp), %eax
psubsb %xmm8, %xmm0
movq %rax, %rcx
shlq $0x4, %rcx
addq %rdi, %rcx
movl %ebp, %edx
movdqa %xmm0, (%rcx)
psubsb %xmm9, %xmm0
addq $-0x10, %rcx
decl %edx
jg 0x3aa6af
movl %eax, %eax
shlq $0x4, %rax
movq %r12, %rcx
addq %rax, %rcx
movq %rcx, 0xb8(%rsp)
movq %rbp, %r8
shlq $0x4, %r8
cmpl $0x1, %ebp
movl %ebp, %r13d
adcl $0x0, %r13d
movl 0x60(%rsp), %eax
movq %rax, 0xb0(%rsp)
shlq $0x4, %r13
movq %rbp, %rax
xorl %ebp, %ebp
movl %eax, %eax
movq %rax, 0xa8(%rsp)
xorl %r9d, %r9d
xorl %eax, %eax
movdqa 0xd0(%rsp), %xmm11
movdqa 0x50(%rsp), %xmm0
movdqa %xmm0, %xmm12
movdqa %xmm0, %xmm10
movdqa %xmm0, 0x60(%rsp)
movdqa 0x20(%rsp), %xmm13
movq %r8, 0xa0(%rsp)
movq 0x40(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x48(%rsp), %rdx
movzbl (%rdx,%r9), %edx
movslq (%rcx,%rdx,4), %rcx
imulq 0xa8(%rsp), %rcx
shlq $0x4, %rcx
addq 0xc0(%rsp), %rcx
movq 0xb8(%rsp), %rdx
movdqa (%rdx), %xmm0
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
xorl %edx, %edx
movdqa 0x50(%rsp), %xmm2
pxor %xmm1, %xmm1
movdqa (%r12,%rdx), %xmm3
movdqa (%r14,%rdx), %xmm5
movdqa %xmm3, %xmm6
psubsb %xmm8, %xmm6
psubsb %xmm9, %xmm5
movdqa %xmm6, %xmm4
pcmpgtb %xmm5, %xmm4
movdqa %xmm4, %xmm7
pand 0x281101(%rip), %xmm7   # 0x62b8b0
pxor 0x21fa09(%rip), %xmm7   # 0x5ca1c0
movq 0x10(%rbx), %rsi
movq (%rsi), %rsi
paddsb (%rdi,%rdx), %xmm1
paddsb (%rcx,%rdx), %xmm0
addq %rbp, %rsi
movdqa %xmm7, (%rdx,%rsi)
pand %xmm4, %xmm6
pandn %xmm5, %xmm4
por %xmm6, %xmm4
movdqa %xmm2, %xmm5
pcmpgtb %xmm1, %xmm2
pand %xmm2, %xmm5
pandn %xmm1, %xmm2
por %xmm5, %xmm2
movdqa %xmm4, %xmm1
pcmpgtb %xmm0, %xmm1
movdqa %xmm4, (%r14,%rdx)
pand %xmm1, %xmm4
pandn %xmm0, %xmm1
por %xmm4, %xmm1
movdqa %xmm1, (%r15,%rdx)
movdqa %xmm0, (%r12,%rdx)
addq $0x10, %rdx
movdqa %xmm3, %xmm0
cmpq %rdx, %r13
jne 0x3aa781
pslldq $0x1, %xmm1             # xmm1 = zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
movdqa (%rdi), %xmm3
paddsb %xmm1, %xmm3
movdqa %xmm2, %xmm0
pcmpgtb %xmm3, %xmm0
pand %xmm0, %xmm2
pandn %xmm3, %xmm0
por %xmm2, %xmm0
movl $0xe, %ecx
movdqa %xmm0, %xmm2
movdqa %xmm0, %xmm3
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
paddsb %xmm13, %xmm0
pcmpgtb %xmm0, %xmm2
pand %xmm2, %xmm3
pandn %xmm0, %xmm2
movdqa %xmm2, %xmm0
por %xmm3, %xmm0
decl %ecx
jne 0x3aa84d
pslldq $0x1, %xmm0             # xmm0 = zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
paddsb 0x100(%rsp), %xmm0
movdqa %xmm0, %xmm2
pcmpgtb %xmm1, %xmm2
movdqa %xmm0, %xmm3
pand %xmm2, %xmm3
pandn %xmm1, %xmm2
por %xmm3, %xmm2
movdqa %xmm2, %xmm1
pcmpgtb 0x27f4b7(%rip), %xmm1   # 0x629d60
pand %xmm2, %xmm1
xorl %ecx, %ecx
movdqa 0x281009(%rip), %xmm7   # 0x62b8c0
movdqa 0x21f920(%rip), %xmm13  # 0x5ca1e0
movdqa 0x21fa97(%rip), %xmm14  # 0x5ca360
movdqa 0x21f8ce(%rip), %xmm15  # 0x5ca1a0
movdqa (%r15,%rcx), %xmm3
psubsb %xmm8, %xmm1
psubsb %xmm9, %xmm0
movdqa %xmm1, %xmm2
pcmpgtb %xmm0, %xmm2
movdqa %xmm2, %xmm4
pandn %xmm0, %xmm4
pand %xmm2, %xmm1
movdqa %xmm1, %xmm0
por %xmm4, %xmm0
movdqa %xmm3, %xmm1
pcmpgtb %xmm0, %xmm1
pand %xmm1, %xmm3
pandn %xmm0, %xmm1
por %xmm3, %xmm1
movdqa %xmm1, %xmm3
pcmpgtb 0x27f442(%rip), %xmm3   # 0x629d60
pand %xmm3, %xmm1
movdqa (%r12,%rcx), %xmm4
pcmpeqb %xmm1, %xmm4
movdqa %xmm1, %xmm5
pcmpeqb %xmm0, %xmm5
movdqa %xmm14, %xmm6
psubb %xmm5, %xmm6
movdqa %xmm4, %xmm5
pandn %xmm6, %xmm5
pand %xmm15, %xmm4
por %xmm5, %xmm4
pand %xmm3, %xmm4
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %rbp, %rdx
pand %xmm7, %xmm2
pxor %xmm13, %xmm2
por (%rcx,%rdx), %xmm2
por %xmm4, %xmm2
movdqa %xmm2, (%rcx,%rdx)
movdqa %xmm11, %xmm2
pcmpgtb %xmm1, %xmm2
movdqa %xmm1, %xmm3
pand %xmm2, %xmm3
pandn %xmm11, %xmm2
movdqa %xmm2, %xmm11
por %xmm3, %xmm11
movdqa %xmm12, %xmm2
movdqa %xmm12, %xmm3
pcmpgtb %xmm1, %xmm3
pand %xmm3, %xmm2
pandn %xmm1, %xmm3
movdqa %xmm3, %xmm12
por %xmm2, %xmm12
movdqa %xmm1, %xmm2
pcmpgtb %xmm10, %xmm2
movdqa %xmm1, %xmm3
pand %xmm2, %xmm3
pandn %xmm10, %xmm2
movdqa %xmm2, %xmm10
por %xmm3, %xmm10
movdqa %xmm1, (%r12,%rcx)
addq $0x10, %rcx
cmpq %rcx, %r13
jne 0x3aa8d2
movdqa %xmm10, %xmm0
pcmpgtb 0x60(%rsp), %xmm0
pmovmskb %xmm0, %ecx
testl %ecx, %ecx
movdqa 0x20(%rsp), %xmm13
je 0x3aab29
movdqa %xmm10, %xmm0
psrldq $0x8, %xmm0             # xmm0 = xmm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movdqa %xmm10, %xmm1
pcmpgtb %xmm0, %xmm1
movdqa %xmm10, 0x70(%rsp)
movdqa 0x70(%rsp), %xmm2
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movdqa %xmm1, %xmm0
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movdqa %xmm1, %xmm2
pcmpgtb %xmm0, %xmm2
pand %xmm2, %xmm1
pandn %xmm0, %xmm2
por %xmm1, %xmm2
movdqa %xmm2, %xmm0
psrldq $0x2, %xmm0             # xmm0 = xmm0[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
movdqa %xmm2, %xmm1
pcmpgtb %xmm0, %xmm1
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movdqa %xmm1, %xmm0
psrldq $0x1, %xmm0             # xmm0 = xmm0[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero
movdqa %xmm1, %xmm2
pcmpgtb %xmm0, %xmm2
pand %xmm2, %xmm1
pandn %xmm0, %xmm2
por %xmm1, %xmm2
movdqa %xmm2, 0x120(%rsp)
movb 0x120(%rsp), %al
movl %eax, 0xc(%rsp)
punpcklbw %xmm2, %xmm2    # xmm2 = xmm2[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm2, %xmm0      # xmm0 = xmm2[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x60(%rsp)
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r8, %rdx
movdqa %xmm11, 0x80(%rsp)
movdqa %xmm12, 0x110(%rsp)
movq %r9, 0xc8(%rsp)
callq 0x19e0c0
movdqa 0x70(%rsp), %xmm10
movq 0xc8(%rsp), %r9
movq 0xa0(%rsp), %r8
movdqa 0x20(%rsp), %xmm13
movdqa 0xe0(%rsp), %xmm9
movdqa 0xf0(%rsp), %xmm8
movdqa 0x110(%rsp), %xmm12
movdqa 0x80(%rsp), %xmm11
movq 0x38(%rsp), %rdi
movl %r9d, %eax
incq %r9
addq %r8, %rbp
cmpq 0xb0(%rsp), %r9
jne 0x3aa738
movq 0x98(%rsp), %rdx
testl $0x7ffffff0, %edx       # imm = 0x7FFFFFF0
je 0x3aac74
andl $0x7ffffff0, %edx       # imm = 0x7FFFFFF0
movq 0x18(%rsp), %r13
movl 0xc(%rsp), %r8d
movq 0x30(%rsp), %r10
je 0x3aacb7
movd %r10d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movzbl %r8b, %ecx
movd %ecx, %xmm1
punpcklbw %xmm1, %xmm1    # xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
movd 0x10(%rsp), %xmm2
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
movdqa 0x27ef36(%rip), %xmm3   # 0x629ad0
xorl %ecx, %ecx
movdqa 0x27f10c(%rip), %xmm4   # 0x629cb0
pshufd $0xf5, %xmm2, %xmm5     # xmm5 = xmm2[1,1,3,3]
movdqa 0x27ef3f(%rip), %xmm6   # 0x629af0
movd (%r13,%rcx), %xmm7
pcmpeqb %xmm1, %xmm7
punpcklbw %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
movdqa %xmm3, %xmm8
psrld $0x4, %xmm8
movdqa %xmm3, %xmm9
pand %xmm4, %xmm9
pshufd $0xf5, %xmm9, %xmm10    # xmm10 = xmm9[1,1,3,3]
pmuludq %xmm2, %xmm9
pshufd $0xe8, %xmm9, %xmm9     # xmm9 = xmm9[0,2,2,3]
pmuludq %xmm5, %xmm10
pshufd $0xe8, %xmm10, %xmm10   # xmm10 = xmm10[0,2,2,3]
punpckldq %xmm10, %xmm9   # xmm9 = xmm9[0],xmm10[0],xmm9[1],xmm10[1]
paddd %xmm8, %xmm9
movdqa %xmm0, %xmm8
pcmpgtd %xmm9, %xmm8
pand %xmm8, %xmm9
pandn %xmm0, %xmm8
por %xmm9, %xmm8
pand %xmm7, %xmm8
pandn %xmm0, %xmm7
movdqa %xmm7, %xmm0
por %xmm8, %xmm0
addq $0x4, %rcx
paddd %xmm6, %xmm3
cmpq %rcx, %rdx
jne 0x3aabb1
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm0, %xmm2
pshufd $0x55, %xmm2, %xmm0     # xmm0 = xmm2[1,1,1,1]
movdqa %xmm0, %xmm1
pcmpgtd %xmm2, %xmm1
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movd %xmm1, %r10d
jmp 0x3aacf2
movq 0x18(%rsp), %r13
movl 0xc(%rsp), %r8d
movq 0x30(%rsp), %r10
jmp 0x3aacf2
callq 0x1bd9df
jmp 0x3aad6b
callq 0x1bd9b9
jmp 0x3aad6b
callq 0x1bd993
jmp 0x3aad6b
callq 0x1bd96d
jmp 0x3aad6b
callq 0x1bd947
jmp 0x3aad6b
movq 0x10(%rsp), %r11
movl %r11d, %ecx
andl $0x7ffffff, %ecx        # imm = 0x7FFFFFF
shll $0x4, %ecx
xorl %edx, %edx
cmpb %r8b, (%r13,%rdx)
jne 0x3aaceb
movl %edx, %esi
shrl $0x4, %esi
movl %edx, %r9d
andl $0xf, %r9d
imull %r11d, %r9d
orl %esi, %r9d
cmpl %r10d, %r9d
cmovll %r9d, %r10d
incq %rdx
cmpl %edx, %ecx
jne 0x3aacca
movdqa 0x50(%rsp), %xmm0
pcmpgtb %xmm11, %xmm0
pcmpgtb 0xd0(%rsp), %xmm12
por %xmm0, %xmm12
pmovmskb %xmm12, %ecx
testl %ecx, %ecx
je 0x3aad21
orb $0x40, 0xc(%rbx)
xorl %r8d, %r8d
xorl %eax, %eax
xorl %r10d, %r10d
movsbl %r8b, %ecx
movl %ecx, (%rbx)
movl %r10d, 0x4(%rbx)
movl %eax, 0x8(%rbx)
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq %rbx, %rax
jmp 0x3aad6d
callq 0x1bd921
jmp 0x3aad6b
callq 0x1bd8fb
jmp 0x3aad6b
callq 0x1bd8d5
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop