// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sg_trace_scan_sse2_128_32.c
// Function: parasail_sg_flags_trace_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 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;
    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;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;

    /* 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));
    vTIns  = _mm_set1_epi32(PARASAIL_INS);
    vTDel  = _mm_set1_epi32(PARASAIL_DEL);
    vTDiag = _mm_set1_epi32(PARASAIL_DIAG);
    vTDiagE= _mm_set1_epi32(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi32(PARASAIL_INS_E);
    vTDiagF= _mm_set1_epi32(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi32(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_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;

    /* 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 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, 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);
            vGapper = _mm_load_si128(pvGapper+i);
            vE_opn = _mm_sub_epi32(vH, vGapO);
            vE_ext = _mm_sub_epi32(vE, vGapE);
            case1 = _mm_cmpgt_epi32(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_epi32_rpl(vE_opn, vE_ext);
            vSaturationCheckMin = _mm_min_epi32_rpl(vSaturationCheckMin, vE);
            vGapper = _mm_add_epi32(vHt, vGapper);
            vF = _mm_max_epi32_rpl(vF, vGapper);
            vHp = _mm_add_epi32(vHp, vW);
            vHt = _mm_max_epi32_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, 4);
        vHt = _mm_insert_epi32_rpl(vHt, boundary[j+1], 0);
        vGapper = _mm_load_si128(pvGapper);
        vGapper = _mm_add_epi32(vHt, vGapper);
        vF = _mm_max_epi32_rpl(vF, vGapper);
        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(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_epi32(vH, vGapO);
            vF_ext = _mm_sub_epi32(vF, vGapE);
            vF = _mm_max_epi32_rpl(vF_opn, vF_ext);
            case1 = _mm_cmpgt_epi32(vF_opn, vF_ext);
            vFT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, case1);
            vH = _mm_max_epi32_rpl(vHt, vF);
            case1 = _mm_cmpeq_epi32(vH, vHp);
            case2 = _mm_cmpeq_epi32(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_epi32_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi32_rpl(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm_max_epi32_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_epi32(vH, vMaxH));
            vMaxH = _mm_max_epi32_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, 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 $0x108, %rsp            # imm = 0x108
movq %rsi, 0x68(%rsp)
testq %rdi, %rdi
je 0x38890a
movq 0x48(%rdi), %rax
movq %rax, 0xa8(%rsp)
testq %rax, %rax
je 0x388911
movq 0x10(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x388918
movl %edx, %ebp
movl 0x8(%rdi), %edx
testl %edx, %edx
jle 0x38891f
cmpq $0x0, 0x68(%rsp)
je 0x388926
testl %ebp, %ebp
jle 0x38892d
testl %ecx, %ecx
js 0x388934
testl %r8d, %r8d
js 0x38893b
movl %r9d, %r12d
movl %r8d, 0x70(%rsp)
leal -0x1(%rdx), %eax
movq %rdx, 0xa0(%rsp)
leaq 0x3(%rdx), %r14
movq %r14, %rdi
shrq $0x2, %rdi
movl %eax, 0x4c(%rsp)
cltd
idivl %edi
movl %eax, 0x10(%rsp)
movl %edx, %r15d
movl %ecx, %r13d
negl %r13d
movq 0x60(%rsp), %rsi
movl 0x20(%rsi), %eax
movl $0x80000000, %edx       # imm = 0x80000000
movl %ecx, 0x18(%rsp)
orl %edx, %ecx
subl %eax, %edx
cmpl %r13d, %eax
cmovgl %ecx, %edx
movl %edx, 0x14(%rsp)
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rsi), %eax
movl %eax, 0x50(%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movq %rdi, 0x8(%rsp)
movl %ebp, %esi
callq 0x2097d1
testq %rax, %rax
je 0x388940
movq %rax, %rbx
movl %r15d, 0x38(%rsp)
movq %r14, 0x98(%rsp)
movl 0x150(%rsp), %edi
xorl %eax, %eax
testl %r12d, %r12d
setne %al
xorl %ecx, %ecx
cmpl $0x0, 0x140(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x148(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
movl %edi, 0x48(%rsp)
testl %edi, %edi
setne %sil
shll $0xf, %esi
leal (%rcx,%rax,8), %eax
orl %edx, %eax
orl %esi, %eax
orl 0xc(%rbx), %eax
orl $0x4480402, %eax        # imm = 0x4480402
movl %eax, 0xc(%rbx)
movl $0x10, %edi
movq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2ea474
movq %rax, %r15
leal 0x1(%rbp), %esi
movl $0x10, %edi
movq %rsi, 0x40(%rsp)
callq 0x2094d5
movq %rax, 0x30(%rsp)
movl $0x10, %edi
movq %r14, %rsi
movq %rbp, 0x28(%rsp)
movq %r14, %rbp
callq 0x2ea474
movq %rax, %r14
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2ea474
movq %rax, %rbp
movl $0x10, %edi
movq 0x8(%rsp), %rsi
callq 0x2ea474
movq 0x30(%rsp), %rdx
testq %r15, %r15
sete %cl
testq %rdx, %rdx
sete %dl
orb %cl, %dl
testq %r14, %r14
sete %cl
testq %rbp, %rbp
sete %sil
orb %cl, %sil
orb %dl, %sil
testq %rax, %rax
sete %dl
xorl %ecx, %ecx
orb %sil, %dl
jne 0x388940
movq 0x28(%rsp), %rdx
decl %edx
movl %edx, 0x4(%rsp)
movl $0x3, %esi
subl 0x10(%rsp), %esi
movl 0x18(%rsp), %r8d
movd %r8d, %xmm0
pshufd $0x0, %xmm0, %xmm3      # xmm3 = xmm0[0,0,0,0]
movl 0x70(%rsp), %edi
movd %edi, %xmm0
pshufd $0x0, %xmm0, %xmm4      # xmm4 = xmm0[0,0,0,0]
movl 0x14(%rsp), %edx
incl %edx
movl %edx, 0x14(%rsp)
movd %edx, %xmm1
pshufd $0x0, %xmm1, %xmm0      # xmm0 = xmm1[0,0,0,0]
movdqa %xmm0, 0x80(%rsp)
movd 0x50(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm2      # xmm2 = xmm0[0,0,0,0]
movl %esi, 0x24(%rsp)
movd %esi, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x50(%rsp)
movq 0x8(%rsp), %r9
movl %r9d, %edx
imull %edi, %edx
movl %edx, %esi
negl %esi
movd %esi, %xmm0
pshufd $0x0, %xmm0, %xmm7      # xmm7 = xmm0[0,0,0,0]
pslldq $0x4, %xmm7             # xmm7 = zero,zero,zero,zero,xmm7[0,1,2,3,4,5,6,7,8,9,10,11]
movdqa %xmm1, 0xd0(%rsp)
paddd %xmm1, %xmm7
movl %r8d, %esi
movl %r9d, %edi
movq %rdi, 0x18(%rsp)
movq $-0x80000000, %rdi      # imm = 0x80000000
movl %r13d, %r9d
movl %r9d, %r10d
xorl %r11d, %r11d
testl %r12d, %r12d
movl $0x0, %r8d
cmovel %r10d, %r8d
movslq %r8d, %r8
movl %r8d, 0xf0(%rsp,%r11,4)
subq %rsi, %r8
cmpq $-0x7fffffff, %r8       # imm = 0x80000001
cmovlq %rdi, %r8
movl %r8d, 0xe0(%rsp,%r11,4)
incq %r11
subl %edx, %r10d
cmpq $0x4, %r11
jne 0x3882c3
movq %rcx, %r8
shlq $0x4, %r8
movaps 0xf0(%rsp), %xmm0
movaps %xmm0, (%rbp,%r8)
movdqa 0xe0(%rsp), %xmm0
movdqa %xmm0, (%r15,%r8)
incq %rcx
movl 0x70(%rsp), %r8d
subl %r8d, %r9d
cmpq 0x18(%rsp), %rcx
jne 0x3882bd
movq 0x30(%rsp), %r9
movl $0x0, (%r9)
movl $0x1, %ecx
movl 0x148(%rsp), %esi
movq 0x40(%rsp), %rdi
testl %esi, %esi
movl $0x0, %edx
cmovel %r13d, %edx
movl %edx, (%r9,%rcx,4)
incq %rcx
subl %r8d, %r13d
cmpq %rcx, %rdi
jne 0x388350
pxor %xmm0, %xmm0
psubd %xmm3, %xmm0
movq 0x8(%rsp), %rdi
leal -0x1(%rdi), %ecx
movq %rcx, %rsi
shlq $0x4, %rsi
movq %rax, %rdx
addq %rsi, %rdx
movl %edi, %esi
movdqa %xmm2, 0xb0(%rsp)
movdqa %xmm0, (%rdx)
psubd %xmm4, %xmm0
movdqa %xmm2, %xmm1
pcmpgtd %xmm0, %xmm1
movdqa %xmm0, %xmm5
pand %xmm1, %xmm5
pandn %xmm2, %xmm1
movdqa %xmm1, %xmm2
por %xmm5, %xmm2
addq $-0x10, %rdx
decl %esi
jg 0x388392
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rbp, %rcx
movq %rcx, 0x40(%rsp)
movl 0x38(%rsp), %r10d
movq %r10, 0x38(%rsp)
shlq $0x4, %r10
addq %rbp, %r10
movq 0x8(%rsp), %r11
cmpl $0x1, %r11d
adcl $0x0, %r11d
movq 0x28(%rsp), %rcx
cmpl $0x2, %ecx
movl $0x1, %edx
cmovgel %ecx, %edx
movq %rdx, 0x28(%rsp)
movq 0x18(%rsp), %r13
shlq $0x4, %r13
shlq $0x4, %r11
xorl %esi, %esi
movdqa 0x26f0f9(%rip), %xmm11  # 0x5f7510
movdqa 0x26f100(%rip), %xmm12  # 0x5f7520
movdqa 0x26f127(%rip), %xmm10  # 0x5f7550
movdqa 0x50(%rsp), %xmm0
pcmpeqd 0x26d569(%rip), %xmm0   # 0x5f59a0
movdqa %xmm0, 0x50(%rsp)
xorl %edx, %edx
movl 0x4(%rsp), %edi
movdqa 0x80(%rsp), %xmm0
movdqa %xmm0, %xmm8
movdqa %xmm0, %xmm1
movdqa %xmm7, 0xc0(%rsp)
movdqa %xmm10, %xmm15
movdqa %xmm1, 0x70(%rsp)
movq 0x40(%rsp), %rcx
pshufd $0x90, (%rcx), %xmm1    # xmm1 = mem[0,0,1,2]
movss (%r9,%rdx,4), %xmm0
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
movq 0x60(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x68(%rsp), %r8
movzbl (%r8,%rdx), %r8d
movslq (%rcx,%r8,4), %rcx
imulq 0x18(%rsp), %rcx
shlq $0x4, %rcx
addq 0xa8(%rsp), %rcx
movdqa 0x80(%rsp), %xmm5
movdqa %xmm5, %xmm0
psubd (%rax), %xmm0
xorl %r12d, %r12d
movdqa %xmm11, %xmm13
movdqa %xmm12, %xmm14
movdqa (%rbp,%r12), %xmm11
movdqa (%r15,%r12), %xmm10
movdqa %xmm11, %xmm6
psubd %xmm3, %xmm6
psubd %xmm4, %xmm10
movdqa %xmm6, %xmm9
pcmpgtd %xmm10, %xmm9
movdqa %xmm9, %xmm12
pand %xmm13, %xmm12
pxor %xmm14, %xmm12
movq 0x10(%rbx), %r8
movq (%r8), %r8
addq %rsi, %r8
paddd (%rax,%r12), %xmm0
paddd (%rcx,%r12), %xmm1
movdqa %xmm12, (%r12,%r8)
pand %xmm9, %xmm6
pandn %xmm10, %xmm9
por %xmm6, %xmm9
movdqa %xmm2, %xmm6
pcmpgtd %xmm9, %xmm6
movdqa %xmm5, %xmm10
pcmpgtd %xmm0, %xmm5
pand %xmm5, %xmm10
pandn %xmm0, %xmm5
movdqa %xmm9, %xmm0
movdqa %xmm9, %xmm12
movdqa %xmm9, (%r15,%r12)
pand %xmm6, %xmm9
pandn %xmm2, %xmm6
movdqa %xmm6, %xmm2
por %xmm9, %xmm2
por %xmm10, %xmm5
pcmpgtd %xmm1, %xmm0
pand %xmm0, %xmm12
pandn %xmm1, %xmm0
por %xmm12, %xmm0
movdqa %xmm0, (%r14,%r12)
movdqa %xmm1, (%rbp,%r12)
addq $0x10, %r12
movdqa %xmm11, %xmm1
cmpq %r12, %r11
jne 0x3884c4
leaq 0x1(%rdx), %rcx
pshufd $0x90, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,2]
movss 0x4(%r9,%rdx,4), %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movdqa (%rax), %xmm6
paddd %xmm0, %xmm6
movdqa %xmm5, %xmm1
pcmpgtd %xmm6, %xmm1
pand %xmm1, %xmm5
pandn %xmm6, %xmm1
por %xmm5, %xmm1
movl $0x1, %r9d
movdqa %xmm1, %xmm5
movdqa %xmm1, %xmm6
pslldq $0x4, %xmm1             # xmm1 = zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11]
paddd %xmm7, %xmm1
pcmpgtd %xmm1, %xmm5
pand %xmm5, %xmm6
pandn %xmm1, %xmm5
movdqa %xmm5, %xmm1
por %xmm6, %xmm1
decl %r9d
je 0x3885cc
pslldq $0x4, %xmm1             # xmm1 = zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11]
paddd 0xd0(%rsp), %xmm1
movdqa %xmm1, %xmm5
pcmpgtd %xmm0, %xmm5
movdqa %xmm1, %xmm6
pand %xmm5, %xmm6
pandn %xmm0, %xmm5
por %xmm6, %xmm5
xorl %r12d, %r12d
movdqa %xmm13, %xmm11
movdqa %xmm14, %xmm12
movdqa 0x26eefe(%rip), %xmm13  # 0x5f7530
movdqa 0x26ef05(%rip), %xmm14  # 0x5f7540
movdqa %xmm15, %xmm10
movdqa 0x26d548(%rip), %xmm7   # 0x5f5b90
movq 0x10(%rbx), %r8
movq (%r8), %r9
addq %rsi, %r9
movdqa (%r14,%r12), %xmm0
psubd %xmm3, %xmm5
psubd %xmm4, %xmm1
movdqa %xmm5, %xmm6
pcmpgtd %xmm1, %xmm6
movdqa %xmm6, %xmm9
pandn %xmm1, %xmm9
pand %xmm6, %xmm5
movdqa %xmm5, %xmm1
por %xmm9, %xmm1
pand %xmm13, %xmm6
pxor %xmm14, %xmm6
movdqa %xmm0, %xmm5
pcmpgtd %xmm1, %xmm5
movdqa %xmm5, %xmm9
pandn %xmm1, %xmm9
pand %xmm5, %xmm0
por %xmm9, %xmm0
movdqa (%rbp,%r12), %xmm9
pcmpeqd %xmm0, %xmm9
paddd %xmm10, %xmm5
movdqa %xmm9, %xmm10
pandn %xmm5, %xmm10
pand %xmm7, %xmm9
por %xmm10, %xmm9
movdqa %xmm15, %xmm10
por (%r12,%r9), %xmm6
por %xmm9, %xmm6
movdqa %xmm6, (%r12,%r9)
movdqa %xmm0, (%rbp,%r12)
movdqa %xmm2, %xmm6
pcmpgtd %xmm0, %xmm6
movdqa %xmm8, %xmm9
pcmpgtd %xmm0, %xmm8
pand %xmm8, %xmm9
pandn %xmm0, %xmm8
movdqa %xmm0, %xmm5
pand %xmm6, %xmm0
pandn %xmm2, %xmm6
por %xmm0, %xmm6
movdqa %xmm6, %xmm2
pcmpgtd %xmm1, %xmm2
movdqa %xmm1, %xmm0
pand %xmm2, %xmm0
pandn %xmm6, %xmm2
por %xmm0, %xmm2
por %xmm9, %xmm8
addq $0x10, %r12
cmpq %r12, %r11
jne 0x388648
movdqa (%r10), %xmm0
movdqa %xmm0, %xmm1
movdqa 0x70(%rsp), %xmm6
pcmpgtd %xmm6, %xmm1
movdqa %xmm1, %xmm5
pand 0x50(%rsp), %xmm5
pand %xmm1, %xmm0
pandn %xmm6, %xmm1
movmskps %xmm5, %r8d
testl %r8d, %r8d
cmovnel %edx, %edi
por %xmm0, %xmm1
addq %r13, %rsi
movq %rcx, %rdx
cmpq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r9
movdqa 0xc0(%rsp), %xmm7
jne 0x38845e
cmpl $0x0, 0x150(%rsp)
movl 0x4c(%rsp), %r11d
movq 0xa0(%rsp), %r12
movl 0x14(%rsp), %r13d
movq 0x8(%rsp), %r10
je 0x3887d8
cmpl $0x2, 0x10(%rsp)
jg 0x3887ce
movl 0x24(%rsp), %edx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
pslldq $0x4, %xmm1             # xmm1 = zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11]
decl %ecx
jne 0x3887c5
pshufd $0xff, %xmm1, %xmm0     # xmm0 = xmm1[3,3,3,3]
movd %xmm0, %r13d
cmpl $0x0, 0x140(%rsp)
je 0x388857
testl $0x7ffffffc, 0x98(%rsp) # imm = 0x7FFFFFFC
je 0x388857
movl %r10d, %edx
andl $0x1fffffff, %edx       # imm = 0x1FFFFFFF
shll $0x2, %edx
xorl %esi, %esi
movl %r11d, %ecx
movl %esi, %r9d
shrl $0x2, %r9d
movl %esi, %r8d
andl $0x3, %r8d
imull %r10d, %r8d
addl %r9d, %r8d
cmpl %r12d, %r8d
jge 0x38884e
movl (%rbp,%rsi,4), %r9d
cmpl %r13d, %r9d
jle 0x388830
movl %r9d, %r13d
movl 0x4(%rsp), %edi
movl %r8d, %ecx
jmp 0x38884e
xorl %r13d, %r9d
movl %edi, %r10d
xorl 0x4(%rsp), %r10d
cmpl %ecx, %r8d
cmovgel %ecx, %r8d
orl %r9d, %r10d
movq 0x8(%rsp), %r10
cmovel %r8d, %ecx
incq %rsi
cmpl %esi, %edx
jne 0x388800
jmp 0x38885a
movl %r11d, %ecx
movl 0x140(%rsp), %edx
orl %edx, 0x48(%rsp)
jne 0x3888a6
movq 0x38(%rsp), %rcx
shlq $0x4, %rcx
movdqa (%rbp,%rcx), %xmm0
cmpl $0x2, 0x10(%rsp)
jg 0x388895
movl 0x24(%rsp), %edx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
decl %ecx
jne 0x38888c
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movd %xmm0, %r13d
movl 0x4(%rsp), %edi
movl %r11d, %ecx
movdqa 0x80(%rsp), %xmm0
pcmpgtd %xmm2, %xmm0
pcmpgtd 0xb0(%rsp), %xmm8
por %xmm0, %xmm8
movmskps %xmm8, %edx
testl %edx, %edx
je 0x3888d5
orb $0x40, 0xc(%rbx)
xorl %r13d, %r13d
xorl %edi, %edi
xorl %ecx, %ecx
movl %r13d, (%rbx)
movl %ecx, 0x4(%rbx)
movl %edi, 0x8(%rbx)
movq %rax, %rdi
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq 0x30(%rsp), %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
jmp 0x388942
callq 0x1bca55
jmp 0x388940
callq 0x1bca2f
jmp 0x388940
callq 0x1bca09
jmp 0x388940
callq 0x1bc9e3
jmp 0x388940
callq 0x1bc9bd
jmp 0x388940
callq 0x1bc997
jmp 0x388940
callq 0x1bc971
jmp 0x388940
callq 0x1bc94b
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq