// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_scan_sse2_128_32.c
// Function: parasail_sw_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)
{
    /* 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;
#ifdef PARASAIL_ROWCOL
    int32_t offset = 0;
    int32_t position = 0;
#endif
    __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;
    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 vMaxHUnit;
    __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;
    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;
#ifdef PARASAIL_ROWCOL
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
#endif
    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;
    vMaxHUnit = vNegLimit;
    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_SW | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_4;
#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);
    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_sub_epi32(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm_store_si128(pvGapper+i, vGapper);
            vGapper = _mm_sub_epi32(vGapper, vGapE);
        }
    }

    /* 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);
        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);
            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);
        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);
        vH = _mm_max_epi32_rpl(vH, vZero);
        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);
            vH = _mm_max_epi32_rpl(vH, vZero);
            _mm_store_si128(pvH+i, vH);
            vSaturationCheckMin = _mm_min_epi32_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMax = _mm_max_epi32_rpl(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
            vMaxH = _mm_max_epi32_rpl(vH, vMaxH);
        } 

        {
            __m128i vCompare = _mm_cmpgt_epi32(vMaxH, vMaxHUnit);
            if (_mm_movemask_epi8(vCompare)) {
                score = _mm_hmax_epi32_rpl(vMaxH);
                vMaxHUnit = _mm_set1_epi32(score);
                end_ref = j;
                (void)memcpy(pvHMax, pvH, sizeof(__m128i)*segLen);
            }
        }

#ifdef PARASAIL_ROWCOL
        /* extract last value from the column */
        {
            int32_t k = 0;
            __m128i vH = _mm_load_si128(pvH + offset);
            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
    }

    /* Trace the alignment ending position on read. */
    {
        int32_t *t = (int32_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;
                }
            }
        }
    }

#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

    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(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 $0x128, %rsp            # imm = 0x128
movq %rsi, 0x58(%rsp)
testq %rdi, %rdi
je 0x33c92e
movq 0x48(%rdi), %rax
movq %rax, 0xc8(%rsp)
testq %rax, %rax
je 0x33c935
movq 0x10(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x33c93c
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x33c943
cmpq $0x0, 0x58(%rsp)
je 0x33c94a
movl %edx, %ebp
testl %edx, %edx
jle 0x33c951
movl %ecx, %r13d
testl %ecx, %ecx
js 0x33c958
movl %r8d, %r12d
testl %r8d, %r8d
js 0x33c95f
leaq 0x3(%rax), %rbx
movq %rbx, %r14
shrq $0x2, %r14
movq %rax, 0x48(%rsp)
decl %eax
cltd
idivl %r14d
movl %eax, 0xc(%rsp)
movl %edx, %r15d
movl %r13d, %eax
negl %eax
movq 0x50(%rsp), %rdi
movl 0x20(%rdi), %ecx
movl $0x80000000, %esi       # imm = 0x80000000
movl %r13d, %edx
orl %esi, %edx
subl %ecx, %esi
cmpl %eax, %ecx
cmovgl %edx, %esi
movl %esi, 0x8(%rsp)
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rdi), %eax
movl %eax, 0x90(%rsp)
andl $0x7ffffffc, %ebx       # imm = 0x7FFFFFFC
movl %ebx, %edi
movl %ebp, %esi
callq 0x209630
testq %rax, %rax
je 0x33c964
movl %r13d, 0x30(%rsp)
movl %r12d, 0x60(%rsp)
movl %r15d, 0x70(%rsp)
movl %ebp, 0x80(%rsp)
movq %rbx, 0xa0(%rsp)
movq %rax, 0x10(%rsp)
orl $0x4440404, 0xc(%rax)   # imm = 0x4440404
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %r15
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %r12
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %r13
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %rbx
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %rbp
testq %r15, %r15
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
testq %r13, %r13
sete %al
movq %rbx, 0x20(%rsp)
testq %rbx, %rbx
sete %dl
orb %al, %dl
orb %cl, %dl
testq %rbp, %rbp
sete %al
orb %dl, %al
jne 0x33c964
movl $0x3, %ebx
subl 0xc(%rsp), %ebx
movd 0x30(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x100(%rsp)
movl 0x60(%rsp), %ecx
movd %ecx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xf0(%rsp)
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
movd %eax, %xmm1
pshufd $0x0, %xmm1, %xmm0      # xmm0 = xmm1[0,0,0,0]
movdqa %xmm0, 0x30(%rsp)
movd 0x90(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xd0(%rsp)
imull %r14d, %ecx
negl %ecx
movd %ecx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
movdqa %xmm1, 0x110(%rsp)
paddd %xmm1, %xmm0
movdqa %xmm0, 0xe0(%rsp)
pxor %xmm0, %xmm0
movq %r13, %rdi
movq %r14, %rsi
callq 0x2ea47d
movq %r15, %rdi
movdqa 0x30(%rsp), %xmm0
movq %r14, %rsi
callq 0x2ea47d
pxor %xmm0, %xmm0
movdqa 0xf0(%rsp), %xmm8
movdqa 0x100(%rsp), %xmm7
psubd %xmm7, %xmm0
leal -0x1(%r14), %eax
movq %rax, %rcx
shlq $0x4, %rcx
addq %rbp, %rcx
movl %r14d, %edx
movdqa %xmm0, (%rcx)
psubd %xmm8, %xmm0
addq $-0x10, %rcx
decl %edx
jg 0x33c432
movl %eax, %eax
shlq $0x4, %rax
addq %r13, %rax
movq %rax, 0xc0(%rsp)
movq %r14, %rax
shlq $0x4, %rax
movq %rax, 0xa8(%rsp)
movl 0x70(%rsp), %eax
shlq $0x4, %rax
addq %r13, %rax
movq %rax, 0xb8(%rsp)
cmpl $0x2, %ebx
movl $0x1, %eax
cmovgel %ebx, %eax
movl %eax, 0x2c(%rsp)
movl 0x80(%rsp), %eax
movq %rax, 0xb0(%rsp)
movq %r14, 0x40(%rsp)
movl %r14d, %r14d
movq %r14, 0x18(%rsp)
shlq $0x4, %r14
xorl %ebx, %ebx
pxor %xmm12, %xmm12
xorl %eax, %eax
movdqa 0x30(%rsp), %xmm0
movdqa %xmm0, %xmm14
movdqa %xmm0, %xmm13
movdqa %xmm0, %xmm9
movdqa 0xd0(%rsp), %xmm10
movq 0x10(%rsp), %r8
movdqa 0xe0(%rsp), %xmm11
movq 0xc0(%rsp), %rcx
movdqa (%rcx), %xmm0
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
movq 0x50(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x58(%rsp), %rdx
movzbl (%rdx,%rbx), %edx
movslq (%rcx,%rdx,4), %rdx
movq 0x18(%rsp), %rcx
imulq %rdx, %rcx
shlq $0x4, %rcx
addq 0xc8(%rsp), %rcx
xorl %edx, %edx
movdqa 0x30(%rsp), %xmm2
pxor %xmm1, %xmm1
movdqa (%r13,%rdx), %xmm3
movdqa (%r15,%rdx), %xmm4
psubd %xmm8, %xmm4
movdqa %xmm3, %xmm5
psubd %xmm7, %xmm5
movdqa %xmm4, %xmm6
pcmpgtd %xmm5, %xmm6
pand %xmm6, %xmm4
pandn %xmm5, %xmm6
por %xmm4, %xmm6
paddd (%rcx,%rdx), %xmm0
paddd (%rbp,%rdx), %xmm1
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm2
pand %xmm2, %xmm4
pandn %xmm1, %xmm2
por %xmm4, %xmm2
movdqa %xmm6, %xmm1
pcmpgtd %xmm0, %xmm1
movdqa %xmm6, (%r15,%rdx)
pand %xmm1, %xmm6
pandn %xmm0, %xmm1
por %xmm6, %xmm1
movdqa %xmm1, (%r12,%rdx)
addq $0x10, %rdx
movdqa %xmm3, %xmm0
cmpq %rdx, %r14
jne 0x33c524
pslldq $0x4, %xmm1             # xmm1 = zero,zero,zero,zero,xmm1[0,1,2,3,4,5,6,7,8,9,10,11]
movdqa (%rbp), %xmm3
paddd %xmm1, %xmm3
movdqa %xmm2, %xmm0
pcmpgtd %xmm3, %xmm0
pand %xmm0, %xmm2
pandn %xmm3, %xmm0
por %xmm2, %xmm0
movl $0x1, %ecx
movdqa %xmm0, %xmm2
movdqa %xmm0, %xmm3
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
paddd %xmm11, %xmm0
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm3
pandn %xmm0, %xmm2
movdqa %xmm2, %xmm0
por %xmm3, %xmm0
decl %ecx
je 0x33c5c5
pslldq $0x4, %xmm0             # xmm0 = zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11]
paddd 0x110(%rsp), %xmm0
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm1
pandn %xmm0, %xmm2
por %xmm1, %xmm2
movdqa %xmm2, %xmm1
pcmpgtd %xmm12, %xmm1
pand %xmm2, %xmm1
xorl %ecx, %ecx
movdqa (%r12,%rcx), %xmm2
psubd %xmm8, %xmm0
psubd %xmm7, %xmm1
movdqa %xmm0, %xmm3
pcmpgtd %xmm1, %xmm3
pand %xmm3, %xmm0
pandn %xmm1, %xmm3
por %xmm3, %xmm0
movdqa %xmm2, %xmm3
pcmpgtd %xmm0, %xmm3
pand %xmm3, %xmm2
pandn %xmm0, %xmm3
por %xmm2, %xmm3
movdqa %xmm3, %xmm1
pcmpgtd %xmm12, %xmm1
pand %xmm3, %xmm1
movdqa %xmm1, (%r13,%rcx)
movdqa %xmm10, %xmm2
pcmpgtd %xmm1, %xmm2
movdqa %xmm1, %xmm3
pand %xmm2, %xmm3
pandn %xmm10, %xmm2
movdqa %xmm2, %xmm10
por %xmm3, %xmm10
movdqa %xmm9, %xmm2
movdqa %xmm9, %xmm3
pcmpgtd %xmm1, %xmm3
pand %xmm3, %xmm2
pandn %xmm1, %xmm3
movdqa %xmm3, %xmm9
por %xmm2, %xmm9
movdqa %xmm1, %xmm2
pcmpgtd %xmm13, %xmm2
movdqa %xmm1, %xmm3
pand %xmm2, %xmm3
pandn %xmm13, %xmm2
movdqa %xmm2, %xmm13
por %xmm3, %xmm13
addq $0x10, %rcx
cmpq %rcx, %r14
jne 0x33c620
movdqa %xmm13, %xmm0
pcmpgtd %xmm14, %xmm0
movmskps %xmm0, %ecx
testl %ecx, %ecx
je 0x33c7ba
movdqa %xmm13, %xmm0
psrldq $0x8, %xmm0             # xmm0 = xmm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movdqa %xmm13, %xmm1
pcmpgtd %xmm0, %xmm1
movdqa %xmm13, %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
pcmpgtd %xmm0, %xmm2
pand %xmm2, %xmm1
pandn %xmm0, %xmm2
por %xmm1, %xmm2
movd %xmm2, 0x8(%rsp)
pshufd $0x0, %xmm2, %xmm0      # xmm0 = xmm2[0,0,0,0]
movdqa %xmm0, 0x60(%rsp)
movq 0x20(%rsp), %rdi
movq %r13, %rsi
movq 0xa8(%rsp), %rdx
movdqa %xmm9, 0x90(%rsp)
movdqa %xmm10, 0x80(%rsp)
movdqa %xmm13, 0x70(%rsp)
callq 0x19e0c0
movdqa 0x60(%rsp), %xmm14
movdqa 0x70(%rsp), %xmm13
pxor %xmm12, %xmm12
movdqa 0xe0(%rsp), %xmm11
movdqa 0x80(%rsp), %xmm10
movdqa 0x90(%rsp), %xmm9
movdqa 0xf0(%rsp), %xmm8
movdqa 0x100(%rsp), %xmm7
movq 0x10(%rsp), %r8
movl %ebx, %eax
movq 0xb8(%rsp), %rcx
movdqa (%rcx), %xmm0
cmpl $0x2, 0xc(%rsp)
jg 0x33c7da
movl 0x2c(%rsp), %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 0x33c7d1
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movq 0x10(%r8), %rcx
movq (%rcx), %rcx
movd %xmm0, (%rcx,%rbx,4)
incq %rbx
cmpq 0xb0(%rsp), %rbx
jne 0x33c4dc
cmpl $0x0, 0xa0(%rsp)
je 0x33c853
movq 0x40(%rsp), %r10
movl %r10d, %ecx
andl $0x1fffffff, %ecx       # imm = 0x1FFFFFFF
shll $0x2, %ecx
xorl %edx, %edx
movq 0x48(%rsp), %r9
movl 0x8(%rsp), %r11d
movq 0x18(%rsp), %rbx
movq 0x20(%rsp), %rsi
cmpl %r11d, (%rsi,%rdx,4)
jne 0x33c84a
movl %edx, %esi
shrl $0x2, %esi
movl %edx, %edi
andl $0x3, %edi
imull %r10d, %edi
addl %esi, %edi
cmpl %r9d, %edi
cmovll %edi, %r9d
incq %rdx
cmpl %edx, %ecx
jne 0x33c828
jmp 0x33c867
movq 0x48(%rsp), %r9
movq 0x40(%rsp), %r10
movl 0x8(%rsp), %r11d
movq 0x18(%rsp), %rbx
cmpl $0x1, %r10d
adcl $0x0, %r10d
leaq (,%rbx,4), %rcx
leaq (%rcx,%rcx,2), %rdx
shlq $0x3, %rbx
shlq $0x2, %r10
xorl %esi, %esi
movdqa (%r13,%rsi,4), %xmm0
movq 0x10(%r8), %rdi
movq 0x8(%rdi), %rdi
movd %xmm0, (%rdi,%rsi)
addq %rsi, %rdi
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movd %xmm1, (%rcx,%rdi)
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
movd %xmm1, (%rbx,%rdi)
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movd %xmm0, (%rdx,%rdi)
addq $0x4, %rsi
cmpq %rsi, %r10
jne 0x33c885
movdqa 0x30(%rsp), %xmm0
pcmpgtd %xmm10, %xmm0
pcmpgtd 0xd0(%rsp), %xmm9
por %xmm0, %xmm9
movmskps %xmm9, %ecx
testl %ecx, %ecx
je 0x33c8f2
orb $0x40, 0xc(%r8)
xorl %r11d, %r11d
xorl %eax, %eax
xorl %r9d, %r9d
movl %r11d, (%r8)
movl %r9d, 0x4(%r8)
movl %eax, 0x8(%r8)
movq %rbp, %rdi
callq 0x2094b5
movq 0x20(%rsp), %rdi
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
movq 0x10(%rsp), %rax
jmp 0x33c966
callq 0x1b4463
jmp 0x33c964
callq 0x1b443d
jmp 0x33c964
callq 0x1b4417
jmp 0x33c964
callq 0x1b43f1
jmp 0x33c964
callq 0x1b43cb
jmp 0x33c964
callq 0x1b43a5
jmp 0x33c964
callq 0x1b437f
jmp 0x33c964
callq 0x1b4359
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq