// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_trace_striped_sse2_128_32.c
// Function: parasail_sw_trace_striped_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)
{
    /* 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;
    __m128i* restrict vProfile = NULL;
    __m128i* restrict pvHStore = NULL;
    __m128i* restrict pvHLoad = NULL;
    __m128i* restrict pvE = NULL;
    __m128i* restrict pvEaStore = NULL;
    __m128i* restrict pvEaLoad = NULL;
    __m128i* restrict pvHT = NULL;
    __m128i* restrict pvHMax = NULL;
    __m128i vGapO;
    __m128i vGapE;
    __m128i vZero;
    int32_t score = 0;
    __m128i vMaxH;
    __m128i vMaxHUnit;
    int32_t maxp = 0;
    parasail_result_t *result = NULL;
    __m128i vTZero;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;
    __m128i vTMask;
    __m128i vFTMask;

    /* 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;
    end_query = 0;
    end_ref = 0;
    s1Len = profile->s1Len;
    matrix = profile->matrix;
    segWidth = 4; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    vProfile = (__m128i*)profile->profile32.score;
    vGapO = _mm_set1_epi32(open);
    vGapE = _mm_set1_epi32(gap);
    vZero = _mm_setzero_si128();
    score = NEG_INF;
    vMaxH = vZero;
    vMaxHUnit = vZero;
    maxp = INT32_MAX - (int32_t)(matrix->max+1);
    vTZero = _mm_set1_epi32(PARASAIL_ZERO);
    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);
    vTMask = _mm_set1_epi32(PARASAIL_ZERO_MASK);
    vFTMask= _mm_set1_epi32(PARASAIL_F_MASK);

    /* 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_STRIPED
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_4;

    /* initialize heap variables */
    pvHStore = parasail_memalign___m128i(16, segLen);
    pvHLoad =  parasail_memalign___m128i(16, segLen);
    pvE = parasail_memalign___m128i(16, segLen);
    pvEaStore = parasail_memalign___m128i(16, segLen);
    pvEaLoad = parasail_memalign___m128i(16, segLen);
    pvHT = parasail_memalign___m128i(16, segLen);
    pvHMax = parasail_memalign___m128i(16, segLen);

    /* validate heap variables */
    if (!pvHStore) return NULL;
    if (!pvHLoad) return NULL;
    if (!pvE) return NULL;
    if (!pvEaStore) return NULL;
    if (!pvEaLoad) return NULL;
    if (!pvHT) return NULL;
    if (!pvHMax) return NULL;

    /* initialize H and E */
    parasail_memset___m128i(pvHStore, vZero, segLen);
    parasail_memset___m128i(pvE, _mm_set1_epi32(-open), segLen);
    parasail_memset___m128i(pvEaStore, _mm_set1_epi32(-open), segLen);

    for (i=0; i<segLen; ++i) {
        arr_store(result->trace->trace_table, vTDiagE, i, segLen, 0);
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vEF_opn;
        __m128i vE;
        __m128i vE_ext;
        __m128i vF;
        __m128i vF_ext;
        __m128i vFa;
        __m128i vFa_ext;
        __m128i vH;
        __m128i vH_dag;
        const __m128i* vP = NULL;

        /* Initialize F value to 0.  Any errors to vH values will be
         * corrected in the Lazy_F loop. */
        vF = _mm_sub_epi32(vZero,vGapO);

        /* load final segment of pvHStore and shift left by 4 bytes */
        vH = _mm_load_si128(&pvHStore[segLen - 1]);
        vH = _mm_slli_si128(vH, 4);

        /* Correct part of the vProfile */
        vP = vProfile + matrix->mapper[(unsigned char)s2[j]] * segLen;

        if (end_ref == j-2) {
            /* Swap in the max buffer. */
            SWAP3(pvHMax,  pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }
        else {
            /* Swap the 2 H buffers. */
            SWAP(pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }

        /* inner loop to process the query sequence */
        for (i=0; i<segLen; ++i) {
            vE = _mm_load_si128(pvE + i);

            /* Get max from vH, vE and vF. */
            vH_dag = _mm_add_epi32(vH, _mm_load_si128(vP + i));
            vH_dag = _mm_max_epi32_rpl(vH_dag, vZero);
            vH = _mm_max_epi32_rpl(vH_dag, vE);
            vH = _mm_max_epi32_rpl(vH, vF);
            /* Save vH values. */
            _mm_store_si128(pvHStore + i, vH);

            {
                __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                __m128i cond_zero = _mm_cmpeq_epi32(vH, vZero);
                __m128i case1 = _mm_cmpeq_epi32(vH, vH_dag);
                __m128i case2 = _mm_cmpeq_epi32(vH, vF);
                __m128i vT = _mm_blendv_epi8_rpl(
                        _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                        _mm_blendv_epi8_rpl(vTDiag, vTZero, cond_zero),
                        case1);
                _mm_store_si128(pvHT + i, vT);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i, segLen, j);
            }
            vMaxH = _mm_max_epi32_rpl(vH, vMaxH);
            vEF_opn = _mm_sub_epi32(vH, vGapO);

            /* Update vE value. */
            vE_ext = _mm_sub_epi32(vE, vGapE);
            vE = _mm_max_epi32_rpl(vEF_opn, vE_ext);
            _mm_store_si128(pvE + i, vE);
            {
                __m128i vEa = _mm_load_si128(pvEaLoad + i);
                __m128i vEa_ext = _mm_sub_epi32(vEa, vGapE);
                vEa = _mm_max_epi32_rpl(vEF_opn, vEa_ext);
                _mm_store_si128(pvEaStore + i, vEa);
                if (j+1<s2Len) {
                    __m128i cond = _mm_cmpgt_epi32(vEF_opn, vEa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                    arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                }
            }

            /* Update vF value. */
            vF_ext = _mm_sub_epi32(vF, vGapE);
            vF = _mm_max_epi32_rpl(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m128i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m128i cond = _mm_cmpgt_epi32(vEF_opn, vF_ext);
                __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i+1, segLen, j);
            }

            /* Load the next vH. */
            vH = _mm_load_si128(pvHLoad + i);
        }

        /* Lazy_F loop: has been revised to disallow adjecent insertion and
         * then deletion, so don't update E(i, i), learn from SWPS3 */
        vFa_ext = vF_ext;
        vFa = vF;
        for (k=0; k<segWidth; ++k) {
            __m128i vHp = _mm_load_si128(&pvHLoad[segLen - 1]);
            vHp = _mm_slli_si128(vHp, 4);
            vEF_opn = _mm_slli_si128(vEF_opn, 4);
            vEF_opn = _mm_insert_epi32_rpl(vEF_opn, -open, 0);
            vF_ext = _mm_slli_si128(vF_ext, 4);
            vF_ext = _mm_insert_epi32_rpl(vF_ext, NEG_INF, 0);
            vF = _mm_slli_si128(vF, 4);
            vF = _mm_insert_epi32_rpl(vF, -open, 0);
            vFa_ext = _mm_slli_si128(vFa_ext, 4);
            vFa_ext = _mm_insert_epi32_rpl(vFa_ext, NEG_INF, 0);
            vFa = _mm_slli_si128(vFa, 4);
            vFa = _mm_insert_epi32_rpl(vFa, -open, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm_load_si128(pvHStore + i);
                vH = _mm_max_epi32_rpl(vH,vF);
                _mm_store_si128(pvHStore + i, vH);
                {
                    __m128i vTAll;
                    __m128i vT;
                    __m128i case1;
                    __m128i case2;
                    __m128i cond;
                    vHp = _mm_add_epi32(vHp, _mm_load_si128(vP + i));
                    vHp = _mm_max_epi32_rpl(vHp, vZero);
                    case1 = _mm_cmpeq_epi32(vH, vHp);
                    case2 = _mm_cmpeq_epi32(vH, vF);
                    cond = _mm_andnot_si128(case1,case2);
                    vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    vT = _mm_load_si128(pvHT + i);
                    vT = _mm_blendv_epi8_rpl(vT, vTDel, cond);
                    _mm_store_si128(pvHT + i, vT);
                    vTAll = _mm_and_si128(vTAll, vTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vMaxH = _mm_max_epi32_rpl(vH, vMaxH);
                /* Update vF value. */
                {
                    __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m128i cond = _mm_cmpgt_epi32(vEF_opn, vFa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                    vTAll = _mm_and_si128(vTAll, vFTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vEF_opn = _mm_sub_epi32(vH, vGapO);
                vF_ext = _mm_sub_epi32(vF, vGapE);
                {
                    __m128i vEa = _mm_load_si128(pvEaLoad + i);
                    __m128i vEa_ext = _mm_sub_epi32(vEa, vGapE);
                    vEa = _mm_max_epi32_rpl(vEF_opn, vEa_ext);
                    _mm_store_si128(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m128i cond = _mm_cmpgt_epi32(vEF_opn, vEa_ext);
                        __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                        arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                    }
                }
                if (! _mm_movemask_epi8(
                            _mm_or_si128(
                                _mm_cmpgt_epi32(vF_ext, vEF_opn),
                                _mm_cmpeq_epi32(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm_max_epi32_rpl(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm_sub_epi32(vFa, vGapE);
                vFa = _mm_max_epi32_rpl(vEF_opn, vFa_ext);
                vHp = _mm_load_si128(pvHLoad + i);
            }
        }
end:
        {
        }

        {
            __m128i vCompare = _mm_cmpgt_epi32(vMaxH, vMaxHUnit);
            if (_mm_movemask_epi8(vCompare)) {
                score = _mm_hmax_epi32_rpl(vMaxH);
                /* if score has potential to overflow, abort early */
                if (score > maxp) {
                    result->flag |= PARASAIL_FLAG_SATURATED;
                    break;
                }
                vMaxHUnit = _mm_set1_epi32(score);
                end_ref = j;
            }
        }

        /*if (score == stop) break;*/
    }

    if (score == INT32_MAX) {
        result->flag |= PARASAIL_FLAG_SATURATED;
    }

    if (parasail_result_is_saturated(result)) {
        score = 0;
        end_query = 0;
        end_ref = 0;
    }
    else {
        if (end_ref == j-1) {
            /* end_ref was the last store column */
            SWAP(pvHMax,  pvHStore)
        }
        else if (end_ref == j-2) {
            /* end_ref was the last load column */
            SWAP(pvHMax,  pvHLoad)
        }
        /* Trace the alignment ending position on read. */
        {
            int32_t *t = (int32_t*)pvHMax;
            int32_t column_len = segLen * segWidth;
            end_query = s1Len - 1;
            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;
                    }
                }
            }
        }
    }

    result->score = score;
    result->end_query = end_query;
    result->end_ref = end_ref;

    parasail_free(pvHMax);
    parasail_free(pvHT);
    parasail_free(pvEaLoad);
    parasail_free(pvEaStore);
    parasail_free(pvE);
    parasail_free(pvHLoad);
    parasail_free(pvHStore);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, 0x68(%rsp)
testq %rdi, %rdi
je 0x39d4b1
movq 0x48(%rdi), %rax
movq %rax, 0xb0(%rsp)
testq %rax, %rax
je 0x39d4b8
movq 0x10(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x39d4bf
movl 0x8(%rdi), %r15d
testl %r15d, %r15d
jle 0x39d4c6
cmpq $0x0, 0x68(%rsp)
je 0x39d4cd
movl %edx, %ebp
testl %edx, %edx
jle 0x39d4d4
testl %ecx, %ecx
js 0x39d4db
movl %r8d, %r13d
testl %r8d, %r8d
js 0x39d4e2
movl %ecx, 0xc(%rsp)
leaq 0x3(%r15), %r12
movq %r12, %r14
shrq $0x2, %r14
movl $0x7ffffffe, %ecx       # imm = 0x7FFFFFFE
movq 0x60(%rsp), %rax
subl 0x1c(%rax), %ecx
movl %ecx, 0x4c(%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movl %r14d, %edi
movl %ebp, %esi
callq 0x2097d1
testq %rax, %rax
je 0x39d4e7
movq %rax, %rbx
movl %r13d, 0x50(%rsp)
movl %ebp, 0x20(%rsp)
movq %r12, 0x90(%rsp)
movq %r15, 0x98(%rsp)
orl $0x4480804, 0xc(%rax)   # imm = 0x4480804
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %r15
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %r14, %r13
movq %rax, %r12
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, 0x38(%rsp)
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, 0x18(%rsp)
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %r14
movl $0x10, %edi
movq %r13, %rsi
callq 0x2ea474
movq %rax, %rbp
movl $0x10, %edi
movq %r13, 0x28(%rsp)
movq %r13, %rsi
callq 0x2ea474
movq %rax, %rcx
xorl %eax, %eax
testq %r15, %r15
je 0x39d534
testq %r12, %r12
je 0x39d534
cmpq $0x0, 0x38(%rsp)
je 0x39d534
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
je 0x39d534
testq %r14, %r14
je 0x39d534
testq %rbp, %rbp
je 0x39d534
testq %rcx, %rcx
je 0x39d534
movq %rcx, 0x30(%rsp)
movl 0xc(%rsp), %r13d
movd %r13d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x80(%rsp)
movd 0x50(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x50(%rsp)
pxor %xmm0, %xmm0
movq %r15, %rdi
movq 0x28(%rsp), %rsi
callq 0x2ea47d
negl %r13d
movl %r13d, 0xc(%rsp)
movd %r13d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x70(%rsp)
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %r13
movq %r13, %rsi
callq 0x2ea47d
movq 0x18(%rsp), %rdi
movaps 0x70(%rsp), %xmm0
movq %r13, %rsi
callq 0x2ea47d
movl %r13d, %eax
movq %rax, 0x70(%rsp)
movq %rax, %rsi
shlq $0x4, %rsi
xorl %eax, %eax
movdqa 0x25aab0(%rip), %xmm0   # 0x5f7890
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
movdqa %xmm0, (%rcx,%rax)
addq $0x10, %rax
cmpq %rax, %rsi
jne 0x39cde0
pxor %xmm0, %xmm0
pxor %xmm1, %xmm1
psubd 0x80(%rsp), %xmm1
movdqa %xmm1, 0xd0(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x1, %eax
movl %eax, %edx
adcl $0x0, %edx
leal -0x1(%rax), %ecx
movl 0x20(%rsp), %r8d
movl %r8d, %edi
cmpl $0x2, %r8d
movl $0x1, %eax
cmovgel %r8d, %eax
movq %rax, 0x40(%rsp)
shlq $0x4, %rdx
movl $0xc0000000, 0x4(%rsp)  # imm = 0xC0000000
xorl %r8d, %r8d
shlq $0x4, %rcx
movq %rcx, 0xa8(%rsp)
movdqa 0x25a6f4(%rip), %xmm2   # 0x5f7550
movdqa 0x25a6cc(%rip), %xmm6   # 0x5f7530
movdqa 0x25a6d4(%rip), %xmm7   # 0x5f7540
movdqa 0x25aa2b(%rip), %xmm9   # 0x5f78a0
movdqa 0x25aa32(%rip), %xmm10  # 0x5f78b0
movq %rsi, 0xa0(%rsp)
movq %rsi, 0x20(%rsp)
xorl %ecx, %ecx
movl $0x0, 0x8(%rsp)
pxor %xmm11, %xmm11
pxor %xmm1, %xmm1
movdqa %xmm1, 0xc0(%rsp)
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %r11
movq %r11, 0x10(%rsp)
movq %r14, %r13
movq %rax, %r14
movq %r12, 0xb8(%rsp)
movq %r15, %r12
movq 0xa8(%rsp), %rsi
leaq (%r15,%rsi), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x68(%rsp), %r9
movzbl (%r9,%rcx), %r10d
movslq (%rax,%r10,4), %r10
movq 0x70(%rsp), %rax
imulq %r10, %rax
shlq $0x4, %rax
addq 0xb0(%rsp), %rax
leal -0x2(%rcx), %r10d
cmpl %r10d, 0x8(%rsp)
movq 0xb8(%rsp), %r15
cmoveq %r15, %r11
movq %r11, 0x30(%rsp)
cmoveq 0x10(%rsp), %r15
movdqa (%r12,%rsi), %xmm8
pslldq $0x4, %xmm8             # xmm8 = zero,zero,zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11]
movq %rcx, 0x10(%rsp)
leaq 0x1(%rcx), %r11
movl $0x1, %r10d
xorl %esi, %esi
movdqa 0xd0(%rsp), %xmm5
paddd (%rax,%rsi), %xmm8
movq 0x38(%rsp), %r9
movdqa (%r9,%rsi), %xmm13
movdqa %xmm8, %xmm1
pcmpgtd %xmm0, %xmm1
pand %xmm8, %xmm1
movdqa %xmm1, %xmm8
pcmpgtd %xmm13, %xmm8
movdqa %xmm1, %xmm14
pand %xmm8, %xmm14
pandn %xmm13, %xmm8
por %xmm14, %xmm8
movdqa %xmm8, %xmm15
pcmpgtd %xmm5, %xmm15
pand %xmm15, %xmm8
movdqa %xmm15, %xmm14
pandn %xmm5, %xmm14
por %xmm8, %xmm14
movdqa %xmm14, (%r15,%rsi)
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
pcmpeqd %xmm14, %xmm1
movdqa %xmm14, %xmm8
pcmpeqd %xmm0, %xmm8
pandn %xmm1, %xmm8
pand 0x258bbe(%rip), %xmm8   # 0x5f5b90
paddd %xmm2, %xmm15
pandn %xmm15, %xmm1
por %xmm8, %xmm1
movdqa (%rsi,%rcx), %xmm8
por %xmm1, %xmm8
movdqa %xmm1, (%rbp,%rsi)
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa %xmm8, (%rsi,%rcx)
movdqa %xmm14, %xmm4
psubd 0x80(%rsp), %xmm4
movdqa 0x50(%rsp), %xmm15
psubd %xmm15, %xmm13
movdqa %xmm4, %xmm8
pcmpgtd %xmm13, %xmm8
movdqa %xmm4, %xmm1
pand %xmm8, %xmm1
pandn %xmm13, %xmm8
por %xmm1, %xmm8
movdqa %xmm8, (%r9,%rsi)
movdqa (%r14,%rsi), %xmm13
psubd %xmm15, %xmm13
movdqa %xmm4, %xmm3
pcmpgtd %xmm13, %xmm3
movdqa %xmm4, %xmm1
pand %xmm3, %xmm1
movdqa %xmm3, %xmm8
pandn %xmm13, %xmm8
por %xmm1, %xmm8
movdqa %xmm8, (%r13,%rsi)
cmpq %rdi, %r11
jae 0x39d097
pand 0x25a492(%rip), %xmm3   # 0x5f7510
pxor 0x25a49a(%rip), %xmm3   # 0x5f7520
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq 0x20(%rsp), %rcx
movdqa %xmm3, (%rsi,%rcx)
movdqa %xmm5, %xmm12
psubd %xmm15, %xmm12
movdqa %xmm4, %xmm5
pcmpgtd %xmm12, %xmm5
cmpq 0x70(%rsp), %r10
jae 0x39d0d3
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa %xmm5, %xmm3
pand %xmm6, %xmm3
pxor %xmm7, %xmm3
por 0x10(%rsi,%rcx), %xmm3
movdqa %xmm3, 0x10(%rsi,%rcx)
movdqa %xmm14, %xmm3
pcmpgtd %xmm11, %xmm3
pand %xmm3, %xmm14
pandn %xmm11, %xmm3
movdqa %xmm3, %xmm11
por %xmm14, %xmm11
movdqa %xmm4, %xmm3
pand %xmm5, %xmm3
pandn %xmm12, %xmm5
por %xmm3, %xmm5
movdqa (%r12,%rsi), %xmm8
addq $0x10, %rsi
incq %r10
cmpq %rsi, %rdx
jne 0x39cf4a
xorl %r10d, %r10d
movdqa %xmm5, %xmm14
movl 0xc(%rsp), %r9d
movdqa 0x50(%rsp), %xmm15
pshufd $0x90, %xmm14, %xmm14   # xmm14 = xmm14[0,0,1,2]
movd %r9d, %xmm3
movss %xmm3, %xmm14           # xmm14 = xmm3[0],xmm14[1,2,3]
pshufd $0x90, %xmm12, %xmm12   # xmm12 = xmm12[0,0,1,2]
movss 0x25a7d6(%rip), %xmm1   # 0x5f7920
movss %xmm1, %xmm12           # xmm12 = xmm1[0],xmm12[1,2,3]
pshufd $0x90, %xmm5, %xmm5     # xmm5 = xmm5[0,0,1,2]
movss %xmm3, %xmm5            # xmm5 = xmm3[0],xmm5[1,2,3]
pshufd $0x90, %xmm4, %xmm4     # xmm4 = xmm4[0,0,1,2]
movss %xmm3, %xmm4            # xmm4 = xmm3[0],xmm4[1,2,3]
movq 0x18(%rsp), %rcx
movdqa (%rcx), %xmm8
pslldq $0x4, %xmm8             # xmm8 = zero,zero,zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11]
xorl %esi, %esi
movdqa (%r15,%rsi), %xmm3
movdqa %xmm3, %xmm13
pcmpgtd %xmm5, %xmm13
pand %xmm13, %xmm3
movdqa %xmm13, %xmm1
pandn %xmm5, %xmm1
por %xmm3, %xmm1
movdqa %xmm1, (%r15,%rsi)
paddd (%rax,%rsi), %xmm8
movdqa %xmm8, %xmm3
pcmpgtd %xmm0, %xmm3
pand %xmm8, %xmm3
pcmpeqd %xmm1, %xmm3
por %xmm13, %xmm3
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa (%rsi,%rcx), %xmm8
pand %xmm9, %xmm8
movdqa (%rbp,%rsi), %xmm13
pand %xmm3, %xmm13
pandn %xmm2, %xmm3
por %xmm13, %xmm3
movdqa %xmm3, (%rbp,%rsi)
por %xmm8, %xmm3
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
movdqa %xmm3, (%rsi,%rcx)
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq %r8, %rcx
pcmpgtd %xmm12, %xmm4
pand %xmm6, %xmm4
movdqa (%rsi,%rcx), %xmm3
pand %xmm10, %xmm3
por %xmm4, %xmm3
pxor %xmm7, %xmm3
movdqa %xmm3, (%rsi,%rcx)
movdqa %xmm1, %xmm4
psubd 0x80(%rsp), %xmm4
movdqa (%r14,%rsi), %xmm3
psubd %xmm15, %xmm3
movdqa %xmm4, %xmm15
pcmpgtd %xmm3, %xmm15
movdqa %xmm4, %xmm13
pand %xmm15, %xmm13
movdqa %xmm15, %xmm8
pandn %xmm3, %xmm8
por %xmm13, %xmm8
movdqa %xmm8, (%r13,%rsi)
cmpq %rdi, %r11
jae 0x39d291
pand 0x25a29a(%rip), %xmm15  # 0x5f7510
pxor 0x25a2a1(%rip), %xmm15  # 0x5f7520
movq 0x10(%rbx), %rcx
movq (%rcx), %rcx
addq 0x20(%rsp), %rcx
movdqa %xmm15, (%rsi,%rcx)
movdqa %xmm1, %xmm3
pcmpgtd %xmm11, %xmm3
pand %xmm3, %xmm1
pandn %xmm11, %xmm3
movdqa %xmm3, %xmm11
por %xmm1, %xmm11
movdqa %xmm5, %xmm13
movdqa 0x50(%rsp), %xmm15
psubd %xmm15, %xmm13
movdqa %xmm4, %xmm1
pcmpgtd %xmm13, %xmm1
pmovmskb %xmm1, %ecx
xorl $0xffff, %ecx           # imm = 0xFFFF
setne %cl
je 0x39d31d
movaps %xmm14, %xmm12
psubd %xmm15, %xmm12
movdqa %xmm4, %xmm14
pcmpgtd %xmm12, %xmm14
movdqa %xmm4, %xmm1
pand %xmm14, %xmm1
pandn %xmm12, %xmm14
por %xmm1, %xmm14
movdqa (%r12,%rsi), %xmm8
addq $0x10, %rsi
movdqa %xmm13, %xmm5
cmpq %rsi, %rdx
jne 0x39d173
xorl %esi, %esi
movdqa %xmm13, %xmm5
jmp 0x39d322
movl $0x21, %esi
testl %esi, %esi
jne 0x39d335
incl %r10d
cmpl $0x4, %r10d
jne 0x39d12c
jmp 0x39d33a
cmpl $0x21, %esi
jne 0x39d3ad
movdqa %xmm11, %xmm1
pcmpgtd 0xc0(%rsp), %xmm1
movmskps %xmm1, %eax
movb $0x1, %cl
testl %eax, %eax
je 0x39d3ad
movdqa %xmm11, %xmm1
psrldq $0x8, %xmm1             # xmm1 = xmm1[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movdqa %xmm11, %xmm3
pcmpgtd %xmm1, %xmm3
movdqa %xmm11, %xmm4
pand %xmm3, %xmm4
pandn %xmm1, %xmm3
por %xmm4, %xmm3
movdqa %xmm3, %xmm4
psrldq $0x4, %xmm4             # xmm4 = xmm4[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movdqa %xmm3, %xmm1
pcmpgtd %xmm4, %xmm1
pand %xmm1, %xmm3
pandn %xmm4, %xmm1
por %xmm3, %xmm1
movd %xmm1, %eax
movl %eax, 0x4(%rsp)
cmpl 0x4c(%rsp), %eax
movq 0x10(%rsp), %rsi
jle 0x39d3b4
orb $0x40, 0xc(%rbx)
xorl %ecx, %ecx
jmp 0x39d3c6
movq 0x10(%rsp), %rsi
jmp 0x39d3c6
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movdqa %xmm1, 0xc0(%rsp)
movl %esi, 0x8(%rsp)
testb %cl, %cl
je 0x39d3ed
movq 0xa0(%rsp), %rax
addq %rax, 0x20(%rsp)
addq %rax, %r8
movq %r11, %rcx
movq %r13, %rax
cmpq 0x40(%rsp), %r11
jne 0x39ceac
jmp 0x39d3f4
movl %esi, %eax
movq %rax, 0x40(%rsp)
cmpl $0x7fffffff, 0x4(%rsp)  # imm = 0x7FFFFFFF
jne 0x39d402
orb $0x40, 0xc(%rbx)
movq %rbx, %rdi
callq 0x20a805
xorl %ecx, %ecx
testl %eax, %eax
je 0x39d420
xorl %r10d, %r10d
movq 0x30(%rsp), %rdi
xorl %r11d, %r11d
jmp 0x39d4f0
movq 0x40(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movl 0x8(%rsp), %r11d
cmpl %ecx, %r11d
movq 0x30(%rsp), %rcx
movq %rcx, %rdi
cmoveq %r12, %rdi
movq %r12, %rdx
cmoveq %rcx, %rdx
cmpl %eax, %r11d
cmoveq %r15, %rdi
cmoveq %r12, %rdx
movq %rdx, %r12
cmoveq %rcx, %r15
movq 0x98(%rsp), %rax
movl %eax, %ecx
decl %ecx
testl $0x7ffffffc, 0x90(%rsp) # imm = 0x7FFFFFFC
je 0x39d4eb
movq 0x28(%rsp), %r9
movl %r9d, %eax
andl $0x1fffffff, %eax       # imm = 0x1FFFFFFF
shll $0x2, %eax
xorl %edx, %edx
movl 0x4(%rsp), %r10d
cmpl %r10d, (%rdi,%rdx,4)
jne 0x39d4a8
movl %edx, %esi
shrl $0x2, %esi
movl %edx, %r8d
andl $0x3, %r8d
imull %r9d, %r8d
addl %esi, %r8d
cmpl %ecx, %r8d
cmovll %r8d, %ecx
incq %rdx
cmpl %edx, %eax
jne 0x39d488
jmp 0x39d4f0
callq 0x1bf3bf
jmp 0x39d4e7
callq 0x1bf399
jmp 0x39d4e7
callq 0x1bf373
jmp 0x39d4e7
callq 0x1bf34d
jmp 0x39d4e7
callq 0x1bf327
jmp 0x39d4e7
callq 0x1bf301
jmp 0x39d4e7
callq 0x1bf2db
jmp 0x39d4e7
callq 0x1bf2b5
xorl %eax, %eax
jmp 0x39d534
movl 0x4(%rsp), %r10d
movl %r10d, (%rbx)
movl %ecx, 0x4(%rbx)
movl %r11d, 0x8(%rbx)
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
movq 0x38(%rsp), %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop