// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sg_striped_sse41_128_16.c
// Function: parasail_sg_flags_rowcol_striped_profile_sse41_128_16
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 vProfile = NULL;
    __m128i* restrict pvHStore = NULL;
    __m128i* restrict pvHLoad = NULL;
    __m128i* restrict pvE = NULL;
    int16_t* restrict boundary = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int16_t NEG_LIMIT = 0;
    int16_t POS_LIMIT = 0;
    int16_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vMaxH;
    __m128i vPosMask;
    parasail_result_t *result = NULL;

    /* validate inputs */
    PARASAIL_CHECK_NULL(profile);
    PARASAIL_CHECK_NULL(profile->profile16.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 = 8; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    vProfile = (__m128i*)profile->profile16.score;
    vGapO = _mm_set1_epi16(open);
    vGapE = _mm_set1_epi16(gap);
    NEG_LIMIT = (-open < matrix->min ? INT16_MIN + open : INT16_MIN - matrix->min) + 1;
    POS_LIMIT = INT16_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi16(NEG_LIMIT);
    vPosLimit = _mm_set1_epi16(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vPosMask = _mm_cmpeq_epi16(_mm_set1_epi16(position),
            _mm_set_epi16(0,1,2,3,4,5,6,7));

    /* 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_STRIPED
        | PARASAIL_FLAG_BITS_16 | PARASAIL_FLAG_LANES_8;
    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 */
    pvHStore = parasail_memalign___m128i(16, segLen);
    pvHLoad =  parasail_memalign___m128i(16, segLen);
    pvE      = parasail_memalign___m128i(16, segLen);
    boundary = parasail_memalign_int16_t(16, s2Len+1);

    /* validate heap variables */
    if (!pvHStore) return NULL;
    if (!pvHLoad) return NULL;
    if (!pvE) return NULL;
    if (!boundary) return NULL;

    /* initialize H and E */
    {
        int32_t index = 0;
        for (i=0; i<segLen; ++i) {
            int32_t segNum = 0;
            __m128i_16_t h;
            __m128i_16_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = s1_beg ? 0 : (-open-gap*(segNum*segLen+i));
                h.v[segNum] = tmp < INT16_MIN ? INT16_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT16_MIN ? INT16_MIN : tmp;
            }
            _mm_store_si128(&pvHStore[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 < INT16_MIN ? INT16_MIN : tmp;
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vE;
        /* Initialize F value to -inf.  Any errors to vH values will be
         * corrected in the Lazy_F loop.  */
        __m128i vF = vNegLimit;

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

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

        /* Swap the 2 H buffers. */
        __m128i* pv = pvHLoad;
        pvHLoad = pvHStore;
        pvHStore = pv;

        /* insert upper boundary condition */
        vH = _mm_insert_epi16(vH, boundary[j], 0);

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

            /* Get max from vH, vE and vF. */
            vH = _mm_max_epi16(vH, vE);
            vH = _mm_max_epi16(vH, vF);
            /* Save vH values. */
            _mm_store_si128(pvHStore + i, vH);
            vSaturationCheckMax = _mm_max_epi16(vSaturationCheckMax, vH);
            vSaturationCheckMin = _mm_min_epi16(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi16(vSaturationCheckMin, vE);
            vSaturationCheckMin = _mm_min_epi16(vSaturationCheckMin, vF);
#ifdef PARASAIL_TABLE
            arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif

            /* Update vE value. */
            vH = _mm_subs_epi16(vH, vGapO);
            vE = _mm_subs_epi16(vE, vGapE);
            vE = _mm_max_epi16(vE, vH);
            _mm_store_si128(pvE + i, vE);

            /* Update vF value. */
            vF = _mm_subs_epi16(vF, vGapE);
            vF = _mm_max_epi16(vF, vH);

            /* 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 */
        for (k=0; k<segWidth; ++k) {
            int64_t tmp = s2_beg ? -open : (boundary[j+1]-open);
            int16_t tmp2 = tmp < INT16_MIN ? INT16_MIN : tmp;
            vF = _mm_slli_si128(vF, 2);
            vF = _mm_insert_epi16(vF, tmp2, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm_load_si128(pvHStore + i);
                vH = _mm_max_epi16(vH,vF);
                _mm_store_si128(pvHStore + i, vH);
                vSaturationCheckMin = _mm_min_epi16(vSaturationCheckMin, vH);
                vSaturationCheckMax = _mm_max_epi16(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
                arr_store_si128(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
                vH = _mm_subs_epi16(vH, vGapO);
                vF = _mm_subs_epi16(vF, vGapE);
                if (! _mm_movemask_epi8(_mm_cmpgt_epi16(vF, vH))) goto end;
                /*vF = _mm_max_epi16(vF, vH);*/
            }
        }
end:
        {
            /* extract vector containing last value from the column */
            __m128i vCompare;
            vH = _mm_load_si128(pvHStore + offset);
            vCompare = _mm_and_si128(vPosMask, _mm_cmpgt_epi16(vH, vMaxH));
            vMaxH = _mm_max_epi16(vH, vMaxH);
            if (_mm_movemask_epi8(vCompare)) {
                end_ref = j;
            }
#ifdef PARASAIL_ROWCOL
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 2);
            }
            result->rowcols->score_row[j] = (int16_t) _mm_extract_epi16 (vH, 7);
#endif
        }
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m128i vH = _mm_load_si128(pvHStore + 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, 2);
        }
        score = (int16_t) _mm_extract_epi16(vMaxH, 7);
        end_query = s1Len-1;
    }

    /* max of last column */
    if (s1_end)
    {
        /* Trace the alignment ending position on read. */
        int16_t *t = (int16_t*)pvHStore;
        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(pvHStore + offset);
            for (k=0; k<position; ++k) {
                vH = _mm_slli_si128(vH, 2);
            }
            score = (int16_t) _mm_extract_epi16 (vH, 7);
            end_ref = s2Len - 1;
            end_query = s1Len - 1;
        }
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi16(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi16(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(boundary);
    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 $0xa8, %rsp
movl %ecx, 0x18(%rsp)
movq %rsi, 0x50(%rsp)
testq %rdi, %rdi
je 0x4035ea
movq 0x30(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x40360e
movq 0x10(%rdi), %rax
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0x403632
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x403656
cmpq $0x0, 0x50(%rsp)
je 0x40367a
movl %edx, %r12d
testl %edx, %edx
jle 0x40369b
cmpl $0x0, 0x18(%rsp)
js 0x4036bc
testl %r8d, %r8d
js 0x4036dd
movl %r9d, %ebp
movl %r8d, 0x20(%rsp)
leal -0x1(%rax), %ebx
movq %rax, 0x70(%rsp)
leaq 0x7(%rax), %rdi
movq %rdi, %r15
shrq $0x3, %r15
movl %ebx, %eax
xorl %edx, %edx
divl %r15d
movl %eax, 0x8(%rsp)
movl %edx, %r14d
movl 0x18(%rsp), %edx
movl %edx, %r8d
negl %r8d
movq 0x48(%rsp), %rsi
movl 0x20(%rsi), %eax
movl %eax, %ecx
negl %ecx
movl %r8d, 0x4(%rsp)
cmpl %r8d, %eax
cmovgl %edx, %ecx
movl %ecx, 0x1c(%rsp)
movw $0x7ffe, %r13w          # imm = 0x7FFE
subw 0x1c(%rsi), %r13w
andl $0x7ffffff8, %edi       # imm = 0x7FFFFFF8
movl %r12d, %esi
callq 0x1ab93b
testq %rax, %rax
je 0x403703
movl %r13d, 0x38(%rsp)
movl %ebx, 0x44(%rsp)
movl %r14d, 0x3c(%rsp)
movl 0xf0(%rsp), %r9d
xorl %edi, %edi
testl %ebp, %ebp
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0xe0(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0xe8(%rsp)
setne %dl
shll $0xe, %edx
movq %rax, %r8
xorl %esi, %esi
movl %r9d, 0x40(%rsp)
testl %r9d, %r9d
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %eax
orl %edx, %eax
orl %esi, %eax
orl 0xc(%r8), %eax
orl $0x8240802, %eax        # imm = 0x8240802
movq %r8, 0x30(%rsp)
movl %eax, 0xc(%r8)
pushq $0x10
popq %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x297cd8
movq %rax, %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x297cd8
movq %rax, %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x297cd8
movq %r12, %r14
movq %rax, %r12
leal 0x1(%r14), %esi
pushq $0x10
popq %rdi
movq %rsi, 0x60(%rsp)
callq 0x1ab77b
testq %r13, %r13
sete %cl
movq %rbx, 0x68(%rsp)
testq %rbx, %rbx
sete %dl
orb %cl, %dl
testq %r12, %r12
sete %cl
movq %rax, 0x28(%rsp)
testq %rax, %rax
sete %sil
orb %cl, %sil
orb %dl, %sil
jne 0x403703
movq %r14, 0x58(%rsp)
leal -0x1(%r14), %eax
movl %eax, 0x14(%rsp)
pushq $0x7
popq %rdx
subl 0x8(%rsp), %edx
movl 0x18(%rsp), %eax
movd %eax, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm4      # xmm4 = xmm0[0,0,0,0]
movl 0x20(%rsp), %esi
movd %esi, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm5      # xmm5 = xmm0[0,0,0,0]
movl 0x1c(%rsp), %r14d
addl $0xffff8001, %r14d      # imm = 0xFFFF8001
movl %r14d, 0x1c(%rsp)
movd %r14d, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movd 0x38(%rsp), %xmm1
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movd %edx, %xmm2
pshuflw $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm2, %xmm6      # xmm6 = xmm2[0,0,0,0]
movl %eax, %ecx
movl %esi, %eax
movslq 0x4(%rsp), %rbx
movq %r15, 0x8(%rsp)
movq %r15, %r8
imulq %rax, %r8
xorl %r9d, %r9d
movq $-0x7fff, %r10          # imm = 0x8001
movq $-0x8000, %r11          # imm = 0x8000
cmpq 0x8(%rsp), %r9
je 0x4031d6
movq %rbx, %rdi
xorl %r14d, %r14d
cmpq $0x8, %r14
je 0x4031aa
testl %ebp, %ebp
je 0x403175
xorl %r15d, %r15d
jmp 0x403178
movq %rdi, %r15
cmpq %r10, %r15
movq $-0x8000, %rsi          # imm = 0x8000
cmovgeq %r15, %rsi
subq %rcx, %r15
cmpq %r10, %r15
cmovlq %r11, %r15
movw %si, 0x90(%rsp,%r14,2)
movw %r15w, 0x80(%rsp,%r14,2)
incq %r14
subq %r8, %rdi
jmp 0x403166
movq %r9, %rsi
shlq $0x4, %rsi
movaps 0x90(%rsp), %xmm2
movaps %xmm2, (%r13,%rsi)
movdqa 0x80(%rsp), %xmm2
movdqa %xmm2, (%r12,%rsi)
incq %r9
subq %rax, %rbx
jmp 0x403159
movq 0x28(%rsp), %rax
andw $0x0, (%rax)
pushq $0x1
popq %rcx
xorl %esi, %esi
movl 0x4(%rsp), %edi
movq 0x8(%rsp), %r8
movl 0x20(%rsp), %r10d
movl 0x3c(%rsp), %r11d
movq 0x60(%rsp), %rbx
movq 0x28(%rsp), %r9
cmpq %rcx, %rbx
je 0x40322c
cmpl $0xffff8001, %edi       # imm = 0xFFFF8001
movl $0xffff8000, %eax       # imm = 0xFFFF8000
cmovgel %edi, %eax
cmpl $0x0, 0xe8(%rsp)
cmovnel %esi, %eax
movw %ax, (%r9,%rcx,2)
incq %rcx
subl %r10d, %edi
jmp 0x403201
leal -0x1(%r8), %r9d
movl %r11d, %eax
movl 0x58(%rsp), %r10d
shlq $0x4, %r8
leaq 0x10(%r8), %r11
xorl %ebp, %ebp
shlq $0x4, %r9
pcmpeqw 0x1c47f2(%rip), %xmm6   # 0x5c7a40
shlq $0x4, %rax
movq %rax, 0x20(%rsp)
movdqa %xmm1, %xmm3
movdqa %xmm0, %xmm2
movdqa %xmm0, %xmm7
movl 0x14(%rsp), %ecx
movq 0x30(%rsp), %rsi
movq 0x68(%rsp), %rax
movq %rax, %r14
cmpq %r10, %rbp
je 0x403412
movdqa (%r13,%r9), %xmm9
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x50(%rsp), %rdi
movzbl (%rdi,%rbp), %edi
movl (%rax,%rdi,4), %eax
imull 0x8(%rsp), %eax
movslq %eax, %rbx
shlq $0x4, %rbx
addq 0x78(%rsp), %rbx
pslldq $0x2, %xmm9             # xmm9 = zero,zero,xmm9[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movq 0x28(%rsp), %rax
pinsrw $0x0, (%rax,%rbp,2), %xmm9
xorl %edi, %edi
movdqa %xmm0, %xmm8
cmpq %rdi, %r8
je 0x403329
paddsw (%rbx,%rdi), %xmm9
movdqa (%r12,%rdi), %xmm10
movdqa %xmm10, %xmm11
pmaxsw %xmm8, %xmm11
pmaxsw %xmm9, %xmm11
movdqa %xmm11, (%r14,%rdi)
pmaxsw %xmm11, %xmm2
pminsw %xmm10, %xmm3
pminsw %xmm8, %xmm3
pminsw %xmm11, %xmm3
psubsw %xmm4, %xmm11
psubsw %xmm5, %xmm10
pmaxsw %xmm11, %xmm10
movdqa %xmm10, (%r12,%rdi)
psubsw %xmm5, %xmm8
pmaxsw %xmm11, %xmm8
movdqa (%r13,%rdi), %xmm9
addq $0x10, %rdi
jmp 0x4032c3
xorl %ebx, %ebx
cmpl $0x8, %ebx
je 0x4033b9
movl 0x4(%rsp), %edi
cmpl $0x0, 0xe8(%rsp)
jne 0x403350
movq 0x28(%rsp), %rax
movswl 0x2(%rax,%rbp,2), %edi
subl 0x18(%rsp), %edi
cmpl $0xffff8001, %edi       # imm = 0xFFFF8001
movl $0xffff8000, %eax       # imm = 0xFFFF8000
cmovll %eax, %edi
pslldq $0x2, %xmm8             # xmm8 = zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
pinsrw $0x0, %edi, %xmm8
xorl %edi, %edi
leaq 0x10(%rdi), %r15
cmpq %r15, %r11
je 0x4033b2
movdqa (%r14,%rdi), %xmm9
pmaxsw %xmm8, %xmm9
movdqa %xmm9, (%r14,%rdi)
pminsw %xmm9, %xmm3
pmaxsw %xmm9, %xmm2
psubsw %xmm4, %xmm9
psubsw %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtw %xmm9, %xmm10
pmovmskb %xmm10, %eax
movq %r15, %rdi
testl %eax, %eax
jne 0x40336c
jmp 0x4033b9
incl %ebx
jmp 0x40332b
movq 0x20(%rsp), %rax
movdqa (%r14,%rax), %xmm8
movdqa %xmm8, %xmm9
pcmpgtw %xmm7, %xmm9
pand %xmm6, %xmm9
pmaxsw %xmm8, %xmm7
pmovmskb %xmm9, %edi
xorl %ebx, %ebx
cmpl %edx, %ebx
jge 0x4033ed
pslldq $0x2, %xmm8             # xmm8 = zero,zero,xmm8[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
incl %ebx
jmp 0x4033df
testw %di, %di
cmovnel %ebp, %ecx
pextrw $0x7, %xmm8, %eax
cwtl
movq 0x10(%rsi), %rdi
movq (%rdi), %rdi
movl %eax, (%rdi,%rbp,4)
incq %rbp
movq %r13, %rax
movq %r14, %r13
jmp 0x403271
movl %ecx, 0x4(%rsp)
movq 0x8(%rsp), %rbp
leal (,%rbp,4), %ecx
imulq $0x1c, %rbp, %r9
imulq $0x18, %rbp, %r10
imulq $0x14, %rbp, %r11
imulq $0xc, %rbp, %rbx
shlq $0x3, %rbp
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x4034b6
movdqa (%r13,%rdi,4), %xmm4
movq 0x10(%rsi), %rax
movq 0x8(%rax), %r15
movd %xmm4, %eax
cwtl
movl %eax, (%r15,%rdi)
pextrw $0x1, %xmm4, %eax
addq %rdi, %r15
cwtl
pextrw $0x2, %xmm4, %esi
movl %eax, (%rcx,%r15)
movswl %si, %eax
pextrw $0x3, %xmm4, %esi
movl %eax, (%rbp,%r15)
movswl %si, %eax
pextrw $0x4, %xmm4, %esi
movl %eax, (%rbx,%r15)
movswl %si, %eax
pextrw $0x5, %xmm4, %esi
movl %eax, (%r8,%r15)
movswl %si, %eax
pextrw $0x6, %xmm4, %esi
movl %eax, (%r11,%r15)
movswl %si, %eax
pextrw $0x7, %xmm4, %esi
movl %eax, (%r10,%r15)
movswl %si, %eax
movq 0x30(%rsp), %rsi
movl %eax, (%r9,%r15)
addq $0x4, %rdi
jmp 0x403438
cmpl $0x0, 0xf0(%rsp)
movl 0x44(%rsp), %r11d
movq 0x70(%rsp), %rbx
movl 0x1c(%rsp), %ebp
movq 0x8(%rsp), %r10
movl 0x4(%rsp), %r15d
je 0x4034ec
xorl %ecx, %ecx
cmpl %edx, %ecx
jge 0x4034e7
pslldq $0x2, %xmm7             # xmm7 = zero,zero,xmm7[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
incl %ecx
jmp 0x4034da
pextrw $0x7, %xmm7, %ebp
cmpl $0x0, 0xe0(%rsp)
je 0x40355b
movl %r10d, %r8d
andl $0xfffffff, %r8d        # imm = 0xFFFFFFF
shll $0x3, %r8d
xorl %r9d, %r9d
movl %r11d, %ecx
cmpl %r9d, %r8d
je 0x40355e
movl %r9d, %eax
shrl $0x3, %eax
movl %r9d, %edi
andl $0x7, %edi
imull %r10d, %edi
addl %eax, %edi
cmpl %ebx, %edi
jge 0x403556
movzwl (%r13,%r9,2), %r10d
cmpw %bp, %r10w
jle 0x40353d
movl %r10d, %ebp
movl 0x14(%rsp), %r15d
movl %edi, %ecx
jmp 0x403551
cmpl %ecx, %edi
cmovgel %ecx, %edi
cmpl 0x14(%rsp), %r15d
cmovnel %ecx, %edi
cmpw %bp, %r10w
cmovel %edi, %ecx
movq 0x8(%rsp), %r10
incq %r9
jmp 0x40350a
movl %r11d, %ecx
movl 0xe0(%rsp), %eax
orl %eax, 0x40(%rsp)
jne 0x403593
movq 0x20(%rsp), %rax
movdqa (%r13,%rax), %xmm4
xorl %ecx, %ecx
cmpl %edx, %ecx
jge 0x403586
pslldq $0x2, %xmm4             # xmm4 = zero,zero,xmm4[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
incl %ecx
jmp 0x403579
pextrw $0x7, %xmm4, %ebp
movl 0x14(%rsp), %r15d
movl %r11d, %ecx
pcmpgtw %xmm3, %xmm0
pcmpgtw %xmm1, %xmm2
por %xmm0, %xmm2
pmovmskb %xmm2, %eax
testl %eax, %eax
je 0x4035b2
orb $0x40, 0xc(%rsi)
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %ecx, %ecx
movswl %bp, %eax
movl %eax, (%rsi)
movl %ecx, 0x4(%rsi)
movl %r15d, 0x8(%rsi)
movq 0x28(%rsp), %rdi
callq 0x1ab763
movq %r12, %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
movq %r13, %rdi
callq 0x1ab763
movq 0x30(%rsp), %rax
jmp 0x403705
movq 0x3379e7(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c39f0(%rip), %rsi    # 0x5c6feb
leaq 0x1c78a3(%rip), %rdx    # 0x5caea5
leaq 0x199ed4(%rip), %rcx    # 0x59d4dd
jmp 0x4036fc
movq 0x3379c3(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c39cc(%rip), %rsi    # 0x5c6feb
leaq 0x1c787f(%rip), %rdx    # 0x5caea5
leaq 0x1c43f1(%rip), %rcx    # 0x5c7a1e
jmp 0x4036fc
movq 0x33799f(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c39a8(%rip), %rsi    # 0x5c6feb
leaq 0x1c785b(%rip), %rdx    # 0x5caea5
leaq 0x1c42e8(%rip), %rcx    # 0x5c7939
jmp 0x4036fc
movq 0x33797b(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c409a(%rip), %rsi    # 0x5c7701
leaq 0x1c7837(%rip), %rdx    # 0x5caea5
leaq 0x1c42d4(%rip), %rcx    # 0x5c7949
jmp 0x4036fc
movq 0x337957(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c3960(%rip), %rsi    # 0x5c6feb
leaq 0x1c7813(%rip), %rdx    # 0x5caea5
leaq 0x1c4065(%rip), %rcx    # 0x5c76fe
jmp 0x4036fc
movq 0x337936(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c4055(%rip), %rsi    # 0x5c7701
leaq 0x1c77f2(%rip), %rdx    # 0x5caea5
leaq 0x1c405b(%rip), %rcx    # 0x5c7715
jmp 0x4036fc
movq 0x337915(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c404e(%rip), %rsi    # 0x5c771b
leaq 0x1c77d1(%rip), %rdx    # 0x5caea5
leaq 0x1c4055(%rip), %rcx    # 0x5c7730
jmp 0x4036fc
movq 0x3378f4(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x1c402d(%rip), %rsi    # 0x5c771b
leaq 0x1c77b0(%rip), %rdx    # 0x5caea5
leaq 0x1c4039(%rip), %rcx    # 0x5c7735
xorl %eax, %eax
callq 0x19e180
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq