// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sg_scan_sse2_128_32.c
// Function: parasail_sg_flags_rowcol_scan_profile_sse2_128_32
parasail_result_t* PNAME(
        const parasail_profile_t * const restrict profile,
        const char * const restrict s2, const int s2Len,
        const int open, const int gap,
        int s1_beg, int s1_end, int s2_beg, int s2_end)
{
    /* declare local variables */
    int32_t i = 0;
    int32_t j = 0;
    int32_t k = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    int32_t s1Len = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
    int32_t offset = 0;
    int32_t position = 0;
    __m128i* restrict pvP = NULL;
    __m128i* restrict pvE = NULL;
    int32_t* restrict boundary = NULL;
    __m128i* restrict pvHt = NULL;
    __m128i* restrict pvH = NULL;
    __m128i* restrict pvGapper = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int32_t NEG_LIMIT = 0;
    int32_t POS_LIMIT = 0;
    __m128i vZero;
    int32_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vMaxH;
    __m128i vPosMask;
    __m128i vNegInfFront;
    __m128i vSegLenXgap;
    parasail_result_t *result = NULL;

    /* validate inputs */
    PARASAIL_CHECK_NULL(profile);
    PARASAIL_CHECK_NULL(profile->profile32.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 = 4; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    pvP = (__m128i*)profile->profile32.score;
    vGapO = _mm_set1_epi32(open);
    vGapE = _mm_set1_epi32(gap);
    NEG_LIMIT = (-open < matrix->min ? INT32_MIN + open : INT32_MIN - matrix->min) + 1;
    POS_LIMIT = INT32_MAX - matrix->max - 1;
    vZero = _mm_setzero_si128();
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vPosMask = _mm_cmpeq_epi32(_mm_set1_epi32(position),
            _mm_set_epi32(0,1,2,3));
    vNegInfFront = vZero;
    vNegInfFront = _mm_insert_epi32_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm_add_epi32(vNegInfFront,
            _mm_slli_si128(_mm_set1_epi32(-segLen*gap), 4));

    /* initialize result */
#ifdef PARASAIL_TABLE
    result = parasail_result_new_table1(segLen*segWidth, s2Len);
#else
#ifdef PARASAIL_ROWCOL
    result = parasail_result_new_rowcol1(segLen*segWidth, s2Len);
#else
    result = parasail_result_new();
#endif
#endif
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SG | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_4;
    result->flag |= s1_beg ? PARASAIL_FLAG_SG_S1_BEG : 0;
    result->flag |= s1_end ? PARASAIL_FLAG_SG_S1_END : 0;
    result->flag |= s2_beg ? PARASAIL_FLAG_SG_S2_BEG : 0;
    result->flag |= s2_end ? PARASAIL_FLAG_SG_S2_END : 0;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    pvE = parasail_memalign___m128i(16, segLen);
    boundary = parasail_memalign_int32_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_32_t h;
            __m128i_32_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = s1_beg ? 0 : (-open-gap*(segNum*segLen+i));
                h.v[segNum] = tmp < INT32_MIN ? INT32_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT32_MIN ? INT32_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 < INT32_MIN ? INT32_MIN : tmp;
        }
    }

    {
        __m128i vGapper = _mm_sub_epi32(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm_store_si128(pvGapper+i, vGapper);
            vGapper = _mm_sub_epi32(vGapper, vGapE);
            /* long queries and/or large penalties will break the pseudo prefix scan */
            vSaturationCheckMin = _mm_min_epi32_rpl(vSaturationCheckMin, vGapper);
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vE;
        __m128i vHt;
        __m128i vF;
        __m128i vH;
        __m128i vHp;
        __m128i *pvW;
        __m128i vW;

        /* calculate E */
        /* calculate Ht */
        /* calculate F and H first pass */
        vHp = _mm_load_si128(pvH+(segLen-1));
        vHp = _mm_slli_si128(vHp, 4);
        vHp = _mm_insert_epi32_rpl(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm_sub_epi32(vNegLimit, pvGapper[0]);
        vF = vNegLimit;
        for (i=0; i<segLen; ++i) {
            vH = _mm_load_si128(pvH+i);
            vE = _mm_load_si128(pvE+i);
            vW = _mm_load_si128(pvW+i);
            vE = _mm_max_epi32_rpl(
                    _mm_sub_epi32(vE, vGapE),
                    _mm_sub_epi32(vH, vGapO));
            vHp = _mm_add_epi32(vHp, vW);
            vF = _mm_max_epi32_rpl(vF, _mm_add_epi32(vHt, pvGapper[i]));
            vHt = _mm_max_epi32_rpl(vE, vHp);
            _mm_store_si128(pvE+i, vE);
            _mm_store_si128(pvHt+i, vHt);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm_slli_si128(vHt, 4);
        vHt = _mm_insert_epi32_rpl(vHt, boundary[j+1], 0);
        vF = _mm_max_epi32_rpl(vF, _mm_add_epi32(vHt, pvGapper[0]));
        for (i=0; i<segWidth-2; ++i) {
            __m128i vFt = _mm_slli_si128(vF, 4);
            vFt = _mm_add_epi32(vFt, vSegLenXgap);
            vF = _mm_max_epi32_rpl(vF, vFt);
        }

        /* calculate final H */
        vF = _mm_slli_si128(vF, 4);
        vF = _mm_add_epi32(vF, vNegInfFront);
        vH = _mm_max_epi32_rpl(vHt, vF);
        for (i=0; i<segLen; ++i) {
            vHt = _mm_load_si128(pvHt+i);
            vF = _mm_max_epi32_rpl(
                    _mm_sub_epi32(vF, vGapE),
                    _mm_sub_epi32(vH, vGapO));
            vH = _mm_max_epi32_rpl(vHt, vF);
            _mm_store_si128(pvH+i, vH);
            vSaturationCheckMin = _mm_min_epi32_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi32_rpl(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm_max_epi32_rpl(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
        } 

        /* extract vector containing last value from column */
        {
            __m128i vCompare;
            vH = _mm_load_si128(pvH + offset);
            vCompare = _mm_and_si128(vPosMask, _mm_cmpgt_epi32(vH, vMaxH));
            vMaxH = _mm_max_epi32_rpl(vH, vMaxH);
            if (_mm_movemask_epi8(vCompare)) {
                end_ref = j;
            }
#ifdef PARASAIL_ROWCOL
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 4);
            }
            result->rowcols->score_row[j] = (int32_t) _mm_extract_epi32_rpl (vH, 3);
#endif
        }
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m128i vH = _mm_load_si128(pvH + i);
        arr_store_col(result->rowcols->score_col, vH, i, segLen);
    }
#endif

    /* max last value from all columns */
    if (s2_end)
    {
        for (k=0; k<position; ++k) {
            vMaxH = _mm_slli_si128(vMaxH, 4);
        }
        score = (int32_t) _mm_extract_epi32_rpl(vMaxH, 3);
        end_query = s1Len-1;
    }

    /* max of last column */
    if (s1_end)
    {
        /* Trace the alignment ending position on read. */
        int32_t *t = (int32_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, 4);
            }
            score = (int32_t) _mm_extract_epi32_rpl (vH, 3);
            end_ref = s2Len - 1;
            end_query = s1Len - 1;
        }
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi32(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi32(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 $0xb8, %rsp
movq %rsi, 0x58(%rsp)
testq %rdi, %rdi
je 0x33bd96
movq 0x48(%rdi), %rax
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x33bda0
movq 0x10(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x33bdaa
movl %edx, %r15d
movl 0x8(%rdi), %edx
testl %edx, %edx
jle 0x33bdb4
cmpq $0x0, 0x58(%rsp)
je 0x33be70
testl %r15d, %r15d
jle 0x33be77
testl %ecx, %ecx
js 0x33be7e
movl %r8d, %r13d
testl %r8d, %r8d
js 0x33be85
movl %r9d, %ebx
leal -0x1(%rdx), %eax
movq %rdx, 0x80(%rsp)
leaq 0x3(%rdx), %r14
movq %r14, %rsi
shrq $0x2, %rsi
movl %eax, 0x44(%rsp)
cltd
movq %rsi, 0x10(%rsp)
idivl %esi
movl %eax, 0x8(%rsp)
movl %edx, %ebp
movl %ecx, %r12d
negl %r12d
movq 0x50(%rsp), %rsi
movl 0x20(%rsi), %eax
movl $0x80000000, %edx       # imm = 0x80000000
movl %ecx, 0x20(%rsp)
orl %edx, %ecx
subl %eax, %edx
cmpl %r12d, %eax
cmovgl %ecx, %edx
movl %edx, 0x1c(%rsp)
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rsi), %eax
movl %eax, 0x4(%rsp)
andl $0x7ffffffc, %r14d      # imm = 0x7FFFFFFC
movl %r14d, %edi
movl %r15d, %esi
callq 0x209630
testq %rax, %rax
je 0x33be8a
movl %ebp, 0x30(%rsp)
movq %r14, 0x78(%rsp)
movl 0x100(%rsp), %r8d
xorl %edi, %edi
testl %ebx, %ebx
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0xf0(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0xf8(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
movl %r8d, 0x40(%rsp)
testl %r8d, %r8d
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x4440402, %ecx        # imm = 0x4440402
movq %rax, 0x38(%rsp)
movl %ecx, 0xc(%rax)
movl $0x10, %edi
movq 0x10(%rsp), %rbp
movq %rbp, %rsi
callq 0x2ea474
movq %rax, %r14
leal 0x1(%r15), %esi
movl $0x10, %edi
movq %rsi, 0x60(%rsp)
callq 0x2094d5
movq %rax, 0x28(%rsp)
movl $0x10, %edi
movq %rbp, %rsi
movq %r15, 0x48(%rsp)
movq %rbp, %r15
callq 0x2ea474
movq %rax, %rbp
movl $0x10, %edi
movq %r15, %rsi
callq 0x2ea474
movq %rax, %r15
movl $0x10, %edi
movq 0x10(%rsp), %rsi
callq 0x2ea474
testq %r14, %r14
sete %cl
cmpq $0x0, 0x28(%rsp)
sete %dl
orb %cl, %dl
testq %rbp, %rbp
sete %cl
testq %r15, %r15
sete %dil
orb %cl, %dil
orb %dl, %dil
testq %rax, %rax
sete %cl
xorl %esi, %esi
orb %dil, %cl
jne 0x33be8a
movq 0x48(%rsp), %rcx
decl %ecx
movl %ecx, 0xc(%rsp)
movl $0x3, %edx
subl 0x8(%rsp), %edx
movl 0x20(%rsp), %r8d
movd %r8d, %xmm0
pshufd $0x0, %xmm0, %xmm4      # xmm4 = xmm0[0,0,0,0]
movd %r13d, %xmm0
pshufd $0x0, %xmm0, %xmm5      # xmm5 = xmm0[0,0,0,0]
movl 0x1c(%rsp), %ecx
incl %ecx
movl %ecx, 0x1c(%rsp)
movd %ecx, %xmm6
pshufd $0x0, %xmm6, %xmm0      # xmm0 = xmm6[0,0,0,0]
movd 0x4(%rsp), %xmm1
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movl %edx, 0x4(%rsp)
movd %edx, %xmm2
pshufd $0x0, %xmm2, %xmm7      # xmm7 = xmm2[0,0,0,0]
movq 0x10(%rsp), %r9
movl %r9d, %edi
imull %r13d, %edi
movl %edi, %ecx
negl %ecx
movd %ecx, %xmm2
pshufd $0x0, %xmm2, %xmm8      # xmm8 = xmm2[0,0,0,0]
pslldq $0x4, %xmm8             # xmm8 = zero,zero,zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11]
paddd %xmm6, %xmm8
movl %r8d, %edx
movl %r9d, %ecx
movq %rcx, 0x20(%rsp)
movq $-0x80000000, %r9       # imm = 0x80000000
movl %r12d, %r10d
movl %r10d, %r11d
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %r8d
cmovel %r11d, %r8d
movslq %r8d, %r8
movl %r8d, 0xa0(%rsp,%rcx,4)
subq %rdx, %r8
cmpq $-0x7fffffff, %r8       # imm = 0x80000001
cmovlq %r9, %r8
movl %r8d, 0x90(%rsp,%rcx,4)
incq %rcx
subl %edi, %r11d
cmpq $0x4, %rcx
jne 0x33b864
movq %rsi, %rcx
shlq $0x4, %rcx
movaps 0xa0(%rsp), %xmm2
movaps %xmm2, (%r15,%rcx)
movdqa 0x90(%rsp), %xmm2
movdqa %xmm2, (%r14,%rcx)
incq %rsi
subl %r13d, %r10d
cmpq 0x20(%rsp), %rsi
jne 0x33b85f
movq 0x28(%rsp), %rsi
movl $0x0, (%rsi)
movl $0x1, %ecx
movl 0xf8(%rsp), %edi
movq 0x60(%rsp), %r8
testl %edi, %edi
movl $0x0, %edx
cmovel %r12d, %edx
movl %edx, (%rsi,%rcx,4)
incq %rcx
subl %r13d, %r12d
cmpq %rcx, %r8
jne 0x33b8e9
pxor %xmm3, %xmm3
psubd %xmm4, %xmm3
movq 0x10(%rsp), %rdi
leal -0x1(%rdi), %edx
movq %rdx, %rcx
shlq $0x4, %rcx
movq %rax, %rsi
addq %rcx, %rsi
movdqa %xmm1, 0x60(%rsp)
movdqa %xmm1, %xmm2
movdqa %xmm3, (%rsi)
psubd %xmm5, %xmm3
movdqa %xmm2, %xmm9
pcmpgtd %xmm3, %xmm9
movdqa %xmm3, %xmm10
pand %xmm9, %xmm10
pandn %xmm2, %xmm9
movdqa %xmm9, %xmm2
por %xmm10, %xmm2
addq $-0x10, %rsi
decl %edi
jg 0x33b929
movl %edx, %r9d
shlq $0x4, %r9
addq %r15, %r9
movl 0x30(%rsp), %r10d
movq %r10, 0x30(%rsp)
shlq $0x4, %r10
addq %r15, %r10
movl $0x1, %r11d
movq 0x10(%rsp), %rbx
cmpl %r11d, %ebx
adcl $0x0, %ebx
movl 0x4(%rsp), %ecx
cmpl $0x2, %ecx
movl $0x1, %r12d
cmovgel %ecx, %r12d
movq 0x48(%rsp), %rcx
cmpl $0x2, %ecx
cmovgel %ecx, %r11d
shlq $0x4, %rbx
pcmpeqd 0x2b9fef(%rip), %xmm7   # 0x5f59a0
xorl %esi, %esi
movl 0xc(%rsp), %edi
movdqa %xmm0, %xmm9
movdqa %xmm0, %xmm3
movl 0x8(%rsp), %r8d
movq %rsi, %r13
pshufd $0x90, (%r9), %xmm10    # xmm10 = mem[0,0,1,2]
movq 0x28(%rsp), %rcx
movss (%rcx,%rsi,4), %xmm11
movss %xmm11, %xmm10          # xmm10 = xmm11[0],xmm10[1,2,3]
movq 0x50(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x58(%rsp), %rdx
movzbl (%rdx,%rsi), %edx
movslq (%rcx,%rdx,4), %rsi
imulq 0x20(%rsp), %rsi
shlq $0x4, %rsi
addq 0x88(%rsp), %rsi
movdqa %xmm0, %xmm12
psubd (%rax), %xmm12
xorl %edx, %edx
movdqa %xmm0, %xmm11
movdqa (%r15,%rdx), %xmm13
movdqa (%r14,%rdx), %xmm1
psubd %xmm5, %xmm1
movdqa %xmm13, %xmm15
psubd %xmm4, %xmm15
movdqa %xmm1, %xmm14
pcmpgtd %xmm15, %xmm14
pand %xmm14, %xmm1
pandn %xmm15, %xmm14
por %xmm1, %xmm14
paddd (%rsi,%rdx), %xmm10
paddd (%rax,%rdx), %xmm12
movdqa %xmm11, %xmm1
pcmpgtd %xmm12, %xmm11
pand %xmm11, %xmm1
pandn %xmm12, %xmm11
por %xmm1, %xmm11
movdqa %xmm14, %xmm12
pcmpgtd %xmm10, %xmm12
movdqa %xmm14, (%r14,%rdx)
pand %xmm12, %xmm14
pandn %xmm10, %xmm12
por %xmm14, %xmm12
movdqa %xmm12, (%rbp,%rdx)
addq $0x10, %rdx
movdqa %xmm13, %xmm10
cmpq %rdx, %rbx
jne 0x33ba17
leaq 0x1(%r13), %rsi
pshufd $0x90, %xmm12, %xmm12   # xmm12 = xmm12[0,0,1,2]
movq 0x28(%rsp), %rcx
movss 0x4(%rcx,%r13,4), %xmm1
movss %xmm1, %xmm12           # xmm12 = xmm1[0],xmm12[1,2,3]
movdqa (%rax), %xmm1
paddd %xmm12, %xmm1
movdqa %xmm11, %xmm10
pcmpgtd %xmm1, %xmm10
pand %xmm10, %xmm11
pandn %xmm1, %xmm10
por %xmm11, %xmm10
movl $0x1, %edx
movdqa %xmm10, %xmm1
movdqa %xmm10, %xmm11
pslldq $0x4, %xmm10            # xmm10 = zero,zero,zero,zero,xmm10[0,1,2,3,4,5,6,7,8,9,10,11]
paddd %xmm8, %xmm10
pcmpgtd %xmm10, %xmm1
pand %xmm1, %xmm11
pandn %xmm10, %xmm1
movdqa %xmm1, %xmm10
por %xmm11, %xmm10
decl %edx
je 0x33bae9
pslldq $0x4, %xmm10            # xmm10 = zero,zero,zero,zero,xmm10[0,1,2,3,4,5,6,7,8,9,10,11]
paddd %xmm6, %xmm10
movdqa %xmm12, %xmm11
pcmpgtd %xmm10, %xmm11
pand %xmm11, %xmm12
pandn %xmm10, %xmm11
por %xmm12, %xmm11
xorl %edx, %edx
movdqa (%rbp,%rdx), %xmm1
psubd %xmm5, %xmm10
psubd %xmm4, %xmm11
movdqa %xmm10, %xmm12
pcmpgtd %xmm11, %xmm12
pand %xmm12, %xmm10
pandn %xmm11, %xmm12
por %xmm12, %xmm10
movdqa %xmm1, %xmm11
pcmpgtd %xmm10, %xmm11
pand %xmm11, %xmm1
pandn %xmm10, %xmm11
por %xmm1, %xmm11
movdqa %xmm11, (%r15,%rdx)
movdqa %xmm2, %xmm1
pcmpgtd %xmm11, %xmm1
movdqa %xmm11, %xmm12
pand %xmm1, %xmm12
pandn %xmm2, %xmm1
por %xmm12, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm10, %xmm2
movdqa %xmm10, %xmm12
pand %xmm2, %xmm12
pandn %xmm1, %xmm2
por %xmm12, %xmm2
movdqa %xmm3, %xmm1
pcmpgtd %xmm11, %xmm3
pand %xmm3, %xmm1
pandn %xmm11, %xmm3
por %xmm1, %xmm3
addq $0x10, %rdx
cmpq %rdx, %rbx
jne 0x33bb41
movdqa (%r10), %xmm10
movdqa %xmm10, %xmm11
pcmpgtd %xmm9, %xmm11
movdqa %xmm11, %xmm1
pand %xmm7, %xmm1
movmskps %xmm1, %ecx
testl %ecx, %ecx
cmovnel %r13d, %edi
movdqa %xmm10, %xmm12
cmpl $0x2, %r8d
jg 0x33bc22
movl %r12d, %ecx
movdqa %xmm10, %xmm12
pslldq $0x4, %xmm12            # xmm12 = zero,zero,zero,zero,xmm12[0,1,2,3,4,5,6,7,8,9,10,11]
decl %ecx
jne 0x33bc18
pand %xmm11, %xmm10
pandn %xmm9, %xmm11
movdqa %xmm11, %xmm9
por %xmm10, %xmm9
pshufd $0xff, %xmm12, %xmm1    # xmm1 = xmm12[3,3,3,3]
movq 0x38(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx), %rcx
movd %xmm1, (%rcx,%r13,4)
cmpq %r11, %rsi
jne 0x33b9c5
movq 0x10(%rsp), %rdx
cmpl $0x1, %edx
adcl $0x0, %edx
movq 0x20(%rsp), %rcx
leaq (,%rcx,4), %rsi
leaq (%rsi,%rsi,2), %r9
leaq (,%rcx,8), %r8
shlq $0x2, %rdx
xorl %ecx, %ecx
movq 0x38(%rsp), %r11
movdqa (%r15,%rcx,4), %xmm1
movq 0x10(%r11), %r10
movq 0x8(%r10), %r10
movd %xmm1, (%r10,%rcx)
addq %rcx, %r10
pshufd $0x55, %xmm1, %xmm4     # xmm4 = xmm1[1,1,1,1]
movd %xmm4, (%rsi,%r10)
pshufd $0xee, %xmm1, %xmm4     # xmm4 = xmm1[2,3,2,3]
movd %xmm4, (%r8,%r10)
pshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
movd %xmm1, (%r9,%r10)
addq $0x4, %rcx
cmpq %rcx, %rdx
jne 0x33bc86
cmpl $0x0, 0x100(%rsp)
movl 0x44(%rsp), %ebx
movq 0x80(%rsp), %r12
movl 0x8(%rsp), %ecx
movl 0x1c(%rsp), %r13d
je 0x33bd0f
cmpl $0x2, %ecx
jg 0x33bd04
movl 0x4(%rsp), %edx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
pslldq $0x4, %xmm9             # xmm9 = zero,zero,zero,zero,xmm9[0,1,2,3,4,5,6,7,8,9,10,11]
decl %ecx
jne 0x33bcfa
pshufd $0xff, %xmm9, %xmm1     # xmm1 = xmm9[3,3,3,3]
movd %xmm1, %r13d
cmpl $0x0, 0xf0(%rsp)
je 0x33bdc2
cmpl $0x0, 0x78(%rsp)
movdqa 0x60(%rsp), %xmm5
je 0x33bdbe
movq 0x10(%rsp), %r10
movl %r10d, %r8d
andl $0x1fffffff, %r8d       # imm = 0x1FFFFFFF
shll $0x2, %r8d
xorl %r9d, %r9d
movl %ebx, %esi
movl %r9d, %ecx
shrl $0x2, %ecx
movl %r9d, %edx
andl $0x3, %edx
imull %r10d, %edx
addl %ecx, %edx
cmpl %r12d, %edx
jge 0x33bd8c
movl (%r15,%r9,4), %ecx
cmpl %r13d, %ecx
jle 0x33bd71
movl %ecx, %r13d
movl 0xc(%rsp), %edi
movl %edx, %esi
jmp 0x33bd8c
xorl %r13d, %ecx
movl %edi, %r10d
xorl 0xc(%rsp), %r10d
cmpl %esi, %edx
cmovgel %esi, %edx
orl %ecx, %r10d
movq 0x10(%rsp), %r10
cmovel %edx, %esi
incq %r9
cmpl %r9d, %r8d
jne 0x33bd46
jmp 0x33bdca
callq 0x1b4229
jmp 0x33be8a
callq 0x1b4203
jmp 0x33be8a
callq 0x1b41dd
jmp 0x33be8a
callq 0x1b41b7
jmp 0x33be8a
movl %ebx, %esi
jmp 0x33bdca
movl %ebx, %esi
movdqa 0x60(%rsp), %xmm5
movl 0xf0(%rsp), %ecx
orl %ecx, 0x40(%rsp)
jne 0x33be15
movq 0x30(%rsp), %rcx
shlq $0x4, %rcx
movdqa (%r15,%rcx), %xmm4
cmpl $0x2, 0x8(%rsp)
jg 0x33be05
movl 0x4(%rsp), %edx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
pslldq $0x4, %xmm4             # xmm4 = zero,zero,zero,zero,xmm4[0,1,2,3,4,5,6,7,8,9,10,11]
decl %ecx
jne 0x33bdfc
pshufd $0xff, %xmm4, %xmm1     # xmm1 = xmm4[3,3,3,3]
movd %xmm1, %r13d
movl 0xc(%rsp), %edi
movl %ebx, %esi
pcmpgtd %xmm2, %xmm0
pcmpgtd %xmm5, %xmm3
por %xmm0, %xmm3
movmskps %xmm3, %ecx
testl %ecx, %ecx
je 0x33be34
orb $0x40, 0xc(%r11)
xorl %r13d, %r13d
xorl %edi, %edi
xorl %esi, %esi
movl %r13d, (%r11)
movl %esi, 0x4(%r11)
movl %edi, 0x8(%r11)
movq %rax, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq 0x28(%rsp), %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq 0x38(%rsp), %rax
jmp 0x33be8c
callq 0x1b4191
jmp 0x33be8a
callq 0x1b416b
jmp 0x33be8a
callq 0x1b4145
jmp 0x33be8a
callq 0x1b411f
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq