// File: /workspace/github_c_makefile_star2_O2/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, 0x78(%rsp)
testq %rdi, %rdi
je 0x2f10f0
movq 0x48(%rdi), %rax
movq %rax, 0x88(%rsp)
testq %rax, %rax
je 0x2f1114
movq 0x10(%rdi), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x2f1138
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x2f115c
cmpq $0x0, 0x78(%rsp)
je 0x2f1180
movl %edx, %r13d
testl %edx, %edx
jle 0x2f11a1
testl %ecx, %ecx
js 0x2f11c2
testl %r8d, %r8d
js 0x2f11e3
movl %r9d, %r12d
movl %r8d, 0x40(%rsp)
leal -0x1(%rax), %ebx
movq %rax, 0x60(%rsp)
leaq 0x3(%rax), %rdi
movq %rdi, %r14
shrq $0x2, %r14
movl %ebx, %eax
xorl %edx, %edx
divl %r14d
movl %eax, 0x34(%rsp)
movl %edx, 0x3c(%rsp)
movl %ecx, %r15d
negl %r15d
movq 0x70(%rsp), %rdx
movl 0x20(%rdx), %eax
movl $0x80000000, %ebp       # imm = 0x80000000
movl %ecx, 0x38(%rsp)
orl %ebp, %ecx
subl %eax, %ebp
cmpl %r15d, %eax
cmovgl %ecx, %ebp
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rdx), %eax
movl %eax, 0x30(%rsp)
andl $0x7ffffffc, %edi       # imm = 0x7FFFFFFC
movl %r13d, %esi
callq 0x1ab93b
testq %rax, %rax
je 0x2f0bc5
movl %ebp, 0x8(%rsp)
movl %ebx, 0x1c(%rsp)
movl 0x100(%rsp), %r8d
xorl %edi, %edi
testl %r12d, %r12d
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, 0x2c(%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, 0x68(%rsp)
movl %ecx, 0xc(%rax)
pushq $0x10
popq %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x297cd8
movq %r14, %rbx
movq %rax, %r14
movq %r13, 0x58(%rsp)
leal 0x1(%r13), %esi
movq %rbp, %rdi
movq %rsi, 0x80(%rsp)
callq 0x1ab783
movq %rax, 0x20(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x297cd8
movq %rax, %r13
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x297cd8
movq %rax, %rbp
pushq $0x10
popq %rdi
movq %rbx, 0x10(%rsp)
movq %rbx, %rsi
callq 0x297cd8
movq %r14, %xmm0
movq 0x20(%rsp), %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %r13, %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 0x2f120b
testq %rax, %rax
je 0x2f120b
movq 0x58(%rsp), %rcx
decl %ecx
movl %ecx, 0xc(%rsp)
pushq $0x3
popq %rdx
subl 0x34(%rsp), %edx
movl 0x38(%rsp), %edi
movd %edi, %xmm0
pshufd $0x0, %xmm0, %xmm4      # xmm4 = xmm0[0,0,0,0]
movl 0x40(%rsp), %r11d
movd %r11d, %xmm0
pshufd $0x0, %xmm0, %xmm5      # xmm5 = xmm0[0,0,0,0]
movl 0x8(%rsp), %ecx
incl %ecx
movl %ecx, 0x8(%rsp)
movd %ecx, %xmm6
pshufd $0x0, %xmm6, %xmm0      # xmm0 = xmm6[0,0,0,0]
movd 0x30(%rsp), %xmm1
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movd %edx, %xmm2
pshufd $0x0, %xmm2, %xmm7      # xmm7 = xmm2[0,0,0,0]
movq 0x10(%rsp), %rcx
movl %ecx, %esi
imull %r11d, %esi
movl %esi, %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 %edi, %edi
xorl %r8d, %r8d
movq $-0x80000000, %r9       # imm = 0x80000000
movl %r15d, %r10d
cmpq 0x10(%rsp), %r8
je 0x2f0bcc
movl %r10d, %r11d
xorl %ecx, %ecx
cmpq $0x4, %rcx
je 0x2f0b95
testl %r12d, %r12d
movl $0x0, %ebx
cmovel %r11d, %ebx
movslq %ebx, %rbx
movl %ebx, 0xa0(%rsp,%rcx,4)
subq %rdi, %rbx
cmpq $-0x7fffffff, %rbx      # imm = 0x80000001
cmovlq %r9, %rbx
movl %ebx, 0x90(%rsp,%rcx,4)
incq %rcx
subl %esi, %r11d
jmp 0x2f0b5c
movq %r8, %rcx
shlq $0x4, %rcx
movaps 0xa0(%rsp), %xmm2
movaps %xmm2, (%rbp,%rcx)
movdqa 0x90(%rsp), %xmm2
movdqa %xmm2, (%r14,%rcx)
incq %r8
movl 0x40(%rsp), %r11d
subl %r11d, %r10d
jmp 0x2f0b50
xorl %ebx, %ebx
jmp 0x2f120b
movq 0x20(%rsp), %rcx
andl $0x0, (%rcx)
pushq $0x1
popq %rcx
movq 0x68(%rsp), %r12
movl 0xf8(%rsp), %r8d
movq 0x80(%rsp), %r9
movq 0x20(%rsp), %rdi
cmpq %rcx, %r9
je 0x2f0c0d
testl %r8d, %r8d
movl $0x0, %esi
cmovel %r15d, %esi
movl %esi, (%rdi,%rcx,4)
incq %rcx
subl %r11d, %r15d
jmp 0x2f0bf1
pxor %xmm3, %xmm3
psubd %xmm4, %xmm3
movq 0x10(%rsp), %rcx
leal -0x1(%rcx), %esi
movdqa %xmm1, 0x40(%rsp)
movdqa %xmm1, %xmm2
movl %esi, %edi
testl %edi, %edi
js 0x2f0c63
movl %edi, %ecx
shlq $0x4, %rcx
movdqa %xmm3, (%rax,%rcx)
psubd %xmm5, %xmm3
movdqa %xmm2, %xmm9
pcmpgtd %xmm3, %xmm9
movdqa %xmm3, %xmm10
pand %xmm9, %xmm10
pandn %xmm2, %xmm9
por %xmm10, %xmm9
decl %edi
movdqa %xmm9, %xmm2
jmp 0x2f0c29
movl %esi, %r8d
shlq $0x4, %r8
addq %rbp, %r8
movl 0x3c(%rsp), %edi
shlq $0x4, %rdi
addq %rbp, %rdi
movl 0x58(%rsp), %r9d
movq 0x10(%rsp), %r10
shlq $0x4, %r10
xorl %r11d, %r11d
pcmpeqd 0x2d6d2f(%rip), %xmm7   # 0x5c79c0
pushq $0x2
popq %rbx
movdqa %xmm0, %xmm3
movdqa %xmm0, %xmm9
movl 0xc(%rsp), %esi
cmpq %r9, %r11
je 0x2f0f3d
pshufd $0x90, (%r8), %xmm11    # xmm11 = mem[0,0,1,2]
movq 0x20(%rsp), %rcx
movss (%rcx,%r11,4), %xmm10
movss %xmm10, %xmm11          # xmm11 = xmm10[0],xmm11[1,2,3]
movq 0x70(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x78(%rsp), %r15
movzbl (%r15,%r11), %r15d
movl (%rcx,%r15,4), %ecx
imull 0x10(%rsp), %ecx
movslq %ecx, %r15
shlq $0x4, %r15
addq 0x88(%rsp), %r15
movdqa %xmm0, %xmm12
psubd (%rax), %xmm12
xorl %r12d, %r12d
movdqa %xmm0, %xmm10
cmpq %r12, %r10
je 0x2f0d93
movdqa (%rbp,%r12), %xmm13
movdqa (%r14,%r12), %xmm1
psubd %xmm5, %xmm1
movdqa %xmm13, %xmm15
psubd %xmm4, %xmm15
movdqa %xmm1, %xmm14
pcmpgtd %xmm15, %xmm14
pand %xmm14, %xmm1
pandn %xmm15, %xmm14
paddd (%r15,%r12), %xmm11
paddd (%rax,%r12), %xmm12
por %xmm1, %xmm14
movdqa %xmm10, %xmm1
pcmpgtd %xmm12, %xmm1
pand %xmm1, %xmm10
pandn %xmm12, %xmm1
por %xmm1, %xmm10
movdqa %xmm14, %xmm12
pcmpgtd %xmm11, %xmm12
movdqa %xmm14, (%r14,%r12)
pand %xmm12, %xmm14
pandn %xmm11, %xmm12
por %xmm14, %xmm12
movdqa %xmm12, (%r13,%r12)
addq $0x10, %r12
movdqa %xmm13, %xmm11
jmp 0x2f0cfd
leaq 0x1(%r11), %r15
pshufd $0x90, %xmm12, %xmm12   # xmm12 = xmm12[0,0,1,2]
movq 0x20(%rsp), %rcx
movss 0x4(%rcx,%r11,4), %xmm1
movss %xmm1, %xmm12           # xmm12 = xmm1[0],xmm12[1,2,3]
movdqa (%rax), %xmm1
paddd %xmm12, %xmm1
movdqa %xmm10, %xmm11
pcmpgtd %xmm1, %xmm11
pand %xmm11, %xmm10
pandn %xmm1, %xmm11
por %xmm10, %xmm11
movl %ebx, %ecx
movdqa %xmm11, %xmm10
pslldq $0x4, %xmm10            # xmm10 = zero,zero,zero,zero,xmm10[0,1,2,3,4,5,6,7,8,9,10,11]
subl $0x1, %ecx
jb 0x2f0e02
paddd %xmm8, %xmm10
movdqa %xmm11, %xmm1
pcmpgtd %xmm10, %xmm1
pand %xmm1, %xmm11
pandn %xmm10, %xmm1
por %xmm1, %xmm11
jmp 0x2f0dd2
paddd %xmm6, %xmm10
movdqa %xmm12, %xmm11
pcmpgtd %xmm10, %xmm11
pand %xmm11, %xmm12
pandn %xmm10, %xmm11
por %xmm12, %xmm11
xorl %r12d, %r12d
cmpq %r12, %r10
je 0x2f0ecd
movdqa (%r13,%r12), %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, (%rbp,%r12)
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, %xmm1
pand %xmm1, %xmm3
pandn %xmm11, %xmm1
por %xmm1, %xmm3
addq $0x10, %r12
jmp 0x2f0e23
movdqa (%rdi), %xmm11
movdqa %xmm11, %xmm10
pcmpgtd %xmm9, %xmm10
movdqa %xmm10, %xmm1
pand %xmm7, %xmm1
pmovmskb %xmm1, %ecx
xorl %r12d, %r12d
movdqa %xmm11, %xmm12
cmpl %edx, %r12d
jge 0x2f0f01
pslldq $0x4, %xmm12            # xmm12 = zero,zero,zero,zero,xmm12[0,1,2,3,4,5,6,7,8,9,10,11]
incl %r12d
jmp 0x2f0ef1
testw %cx, %cx
pand %xmm10, %xmm11
pandn %xmm9, %xmm10
por %xmm11, %xmm10
cmovnel %r11d, %esi
pshufd $0xff, %xmm12, %xmm1    # xmm1 = xmm12[3,3,3,3]
movq 0x68(%rsp), %r12
movq 0x10(%r12), %rcx
movq (%rcx), %rcx
movd %xmm1, (%rcx,%r11,4)
movq %r15, %r11
movdqa %xmm10, %xmm9
jmp 0x2f0ca1
movq 0x10(%rsp), %r10
imulq $0xc, %r10, %r8
leaq (,%r10,8), %r9
shlq $0x2, %r10
xorl %ecx, %ecx
movq 0x60(%rsp), %rbx
cmpq %rcx, %r10
je 0x2f0f9d
movdqa (%rbp,%rcx,4), %xmm1
movq 0x10(%r12), %r11
movq 0x8(%r11), %r11
movd %xmm1, (%r11,%rcx)
addq %rcx, %r11
pshufd $0x55, %xmm1, %xmm4     # xmm4 = xmm1[1,1,1,1]
movd %xmm4, (%r10,%r11)
pshufd $0xee, %xmm1, %xmm4     # xmm4 = xmm1[2,3,2,3]
movd %xmm4, (%r9,%r11)
pshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
movd %xmm1, (%r8,%r11)
addq $0x4, %rcx
jmp 0x2f0f59
cmpl $0x0, 0x100(%rsp)
je 0x2f0fc3
xorl %ecx, %ecx
cmpl %edx, %ecx
jge 0x2f0fb7
pslldq $0x4, %xmm9             # xmm9 = zero,zero,zero,zero,xmm9[0,1,2,3,4,5,6,7,8,9,10,11]
incl %ecx
jmp 0x2f0fa9
pshufd $0xff, %xmm9, %xmm1     # xmm1 = xmm9[3,3,3,3]
movd %xmm1, 0x8(%rsp)
cmpl $0x0, 0xf0(%rsp)
je 0x2f1047
movq 0x10(%rsp), %r9
andl $0x1fffffff, %r9d       # imm = 0x1FFFFFFF
shll $0x2, %r9d
xorl %r10d, %r10d
movl 0x1c(%rsp), %r8d
movdqa 0x40(%rsp), %xmm5
cmpl %r10d, %r9d
je 0x2f1052
movl %r10d, %r11d
shrl $0x2, %r11d
movl %r10d, %ecx
andl $0x3, %ecx
imull 0x10(%rsp), %ecx
addl %r11d, %ecx
cmpl %ebx, %ecx
jge 0x2f1042
movl (%rbp,%r10,4), %r11d
movl 0x8(%rsp), %r15d
cmpl %r15d, %r11d
jle 0x2f1026
movl %r11d, 0x8(%rsp)
movl 0xc(%rsp), %esi
movl %ecx, %r8d
jmp 0x2f1042
xorl %r15d, %r11d
movl %esi, %ebx
xorl 0xc(%rsp), %ebx
cmpl %r8d, %ecx
cmovgel %r8d, %ecx
orl %r11d, %ebx
movq 0x60(%rsp), %rbx
cmovel %ecx, %r8d
incq %r10
jmp 0x2f0feb
movl 0x1c(%rsp), %r8d
movdqa 0x40(%rsp), %xmm5
movl 0xf0(%rsp), %ecx
orl %ecx, 0x2c(%rsp)
jne 0x2f1086
movdqa (%rdi), %xmm4
xorl %ecx, %ecx
cmpl %edx, %ecx
jge 0x2f1072
pslldq $0x4, %xmm4             # xmm4 = zero,zero,zero,zero,xmm4[0,1,2,3,4,5,6,7,8,9,10,11]
incl %ecx
jmp 0x2f1065
pshufd $0xff, %xmm4, %xmm1     # xmm1 = xmm4[3,3,3,3]
movd %xmm1, 0x8(%rsp)
movl 0xc(%rsp), %esi
movl 0x1c(%rsp), %r8d
pcmpgtd %xmm2, %xmm0
pcmpgtd %xmm5, %xmm3
por %xmm0, %xmm3
movmskps %xmm3, %ecx
testl %ecx, %ecx
je 0x2f10ac
orb $0x40, 0xc(%r12)
movl $0x0, 0x8(%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl 0x8(%rsp), %ecx
movl %ecx, (%r12)
movl %r8d, 0x4(%r12)
movl %esi, 0x8(%r12)
movq %rax, %rdi
callq 0x1ab763
movq %rbp, %rdi
callq 0x1ab763
movq %r13, %rdi
callq 0x1ab763
movq 0x20(%rsp), %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
movq %r12, %rbx
jmp 0x2f120b
movq 0x449ee1(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d5eea(%rip), %rsi    # 0x5c6feb
leaq 0x2d7d38(%rip), %rdx    # 0x5c8e40
leaq 0x2ac3ce(%rip), %rcx    # 0x59d4dd
jmp 0x2f1202
movq 0x449ebd(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d5ec6(%rip), %rsi    # 0x5c6feb
leaq 0x2d7d14(%rip), %rdx    # 0x5c8e40
leaq 0x2d6873(%rip), %rcx    # 0x5c79a6
jmp 0x2f1202
movq 0x449e99(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d5ea2(%rip), %rsi    # 0x5c6feb
leaq 0x2d7cf0(%rip), %rdx    # 0x5c8e40
leaq 0x2d67e2(%rip), %rcx    # 0x5c7939
jmp 0x2f1202
movq 0x449e75(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d6594(%rip), %rsi    # 0x5c7701
leaq 0x2d7ccc(%rip), %rdx    # 0x5c8e40
leaq 0x2d67ce(%rip), %rcx    # 0x5c7949
jmp 0x2f1202
movq 0x449e51(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d5e5a(%rip), %rsi    # 0x5c6feb
leaq 0x2d7ca8(%rip), %rdx    # 0x5c8e40
leaq 0x2d655f(%rip), %rcx    # 0x5c76fe
jmp 0x2f1202
movq 0x449e30(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d654f(%rip), %rsi    # 0x5c7701
leaq 0x2d7c87(%rip), %rdx    # 0x5c8e40
leaq 0x2d6555(%rip), %rcx    # 0x5c7715
jmp 0x2f1202
movq 0x449e0f(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d6548(%rip), %rsi    # 0x5c771b
leaq 0x2d7c66(%rip), %rdx    # 0x5c8e40
leaq 0x2d654f(%rip), %rcx    # 0x5c7730
jmp 0x2f1202
movq 0x449dee(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2d6527(%rip), %rsi    # 0x5c771b
leaq 0x2d7c45(%rip), %rdx    # 0x5c8e40
leaq 0x2d6533(%rip), %rcx    # 0x5c7735
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq