// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sg_scan_avx2_256_32.c
// Function: parasail_sg_flags_rowcol_scan_profile_avx2_256_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;
    __m256i* restrict pvP = NULL;
    __m256i* restrict pvE = NULL;
    int32_t* restrict boundary = NULL;
    __m256i* restrict pvHt = NULL;
    __m256i* restrict pvH = NULL;
    __m256i* restrict pvGapper = NULL;
    __m256i vGapO;
    __m256i vGapE;
    int32_t NEG_LIMIT = 0;
    int32_t POS_LIMIT = 0;
    __m256i vZero;
    int32_t score = 0;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    __m256i vMaxH;
    __m256i vPosMask;
    __m256i vNegInfFront;
    __m256i 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 = 8; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    pvP = (__m256i*)profile->profile32.score;
    vGapO = _mm256_set1_epi32(open);
    vGapE = _mm256_set1_epi32(gap);
    NEG_LIMIT = (-open < matrix->min ? INT32_MIN + open : INT32_MIN - matrix->min) + 1;
    POS_LIMIT = INT32_MAX - matrix->max - 1;
    vZero = _mm256_setzero_si256();
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vPosMask = _mm256_cmpeq_epi32(_mm256_set1_epi32(position),
            _mm256_set_epi32(0,1,2,3,4,5,6,7));
    vNegInfFront = vZero;
    vNegInfFront = _mm256_insert_epi32_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm256_add_epi32(vNegInfFront,
            _mm256_slli_si256_rpl(_mm256_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_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 */
    pvE = parasail_memalign___m256i(32, segLen);
    boundary = parasail_memalign_int32_t(32, s2Len+1);
    pvHt= parasail_memalign___m256i(32, segLen);
    pvH = parasail_memalign___m256i(32, segLen);
    pvGapper = parasail_memalign___m256i(32, 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;
            __m256i_32_t h;
            __m256i_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;
            }
            _mm256_store_si256(&pvH[index], h.m);
            _mm256_store_si256(&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;
        }
    }

    {
        __m256i vGapper = _mm256_sub_epi32(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm256_store_si256(pvGapper+i, vGapper);
            vGapper = _mm256_sub_epi32(vGapper, vGapE);
            /* long queries and/or large penalties will break the pseudo prefix scan */
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vGapper);
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m256i vE;
        __m256i vHt;
        __m256i vF;
        __m256i vH;
        __m256i vHp;
        __m256i *pvW;
        __m256i vW;

        /* calculate E */
        /* calculate Ht */
        /* calculate F and H first pass */
        vHp = _mm256_load_si256(pvH+(segLen-1));
        vHp = _mm256_slli_si256_rpl(vHp, 4);
        vHp = _mm256_insert_epi32_rpl(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm256_sub_epi32(vNegLimit, pvGapper[0]);
        vF = vNegLimit;
        for (i=0; i<segLen; ++i) {
            vH = _mm256_load_si256(pvH+i);
            vE = _mm256_load_si256(pvE+i);
            vW = _mm256_load_si256(pvW+i);
            vE = _mm256_max_epi32(
                    _mm256_sub_epi32(vE, vGapE),
                    _mm256_sub_epi32(vH, vGapO));
            vHp = _mm256_add_epi32(vHp, vW);
            vF = _mm256_max_epi32(vF, _mm256_add_epi32(vHt, pvGapper[i]));
            vHt = _mm256_max_epi32(vE, vHp);
            _mm256_store_si256(pvE+i, vE);
            _mm256_store_si256(pvHt+i, vHt);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm256_slli_si256_rpl(vHt, 4);
        vHt = _mm256_insert_epi32_rpl(vHt, boundary[j+1], 0);
        vF = _mm256_max_epi32(vF, _mm256_add_epi32(vHt, pvGapper[0]));
        for (i=0; i<segWidth-2; ++i) {
            __m256i vFt = _mm256_slli_si256_rpl(vF, 4);
            vFt = _mm256_add_epi32(vFt, vSegLenXgap);
            vF = _mm256_max_epi32(vF, vFt);
        }

        /* calculate final H */
        vF = _mm256_slli_si256_rpl(vF, 4);
        vF = _mm256_add_epi32(vF, vNegInfFront);
        vH = _mm256_max_epi32(vHt, vF);
        for (i=0; i<segLen; ++i) {
            vHt = _mm256_load_si256(pvHt+i);
            vF = _mm256_max_epi32(
                    _mm256_sub_epi32(vF, vGapE),
                    _mm256_sub_epi32(vH, vGapO));
            vH = _mm256_max_epi32(vHt, vF);
            _mm256_store_si256(pvH+i, vH);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm256_min_epi32(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm256_max_epi32(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si256(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
        } 

        /* extract vector containing last value from column */
        {
            __m256i vCompare;
            vH = _mm256_load_si256(pvH + offset);
            vCompare = _mm256_and_si256(vPosMask, _mm256_cmpgt_epi32(vH, vMaxH));
            vMaxH = _mm256_max_epi32(vH, vMaxH);
            if (_mm256_movemask_epi8(vCompare)) {
                end_ref = j;
            }
#ifdef PARASAIL_ROWCOL
            for (k=0; k<position; ++k) {
                vH = _mm256_slli_si256_rpl(vH, 4);
            }
            result->rowcols->score_row[j] = (int32_t) _mm256_extract_epi32_rpl (vH, 7);
#endif
        }
    }

#ifdef PARASAIL_ROWCOL
    for (i=0; i<segLen; ++i) {
        __m256i vH = _mm256_load_si256(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 = _mm256_slli_si256_rpl(vMaxH, 4);
        }
        score = (int32_t) _mm256_extract_epi32_rpl(vMaxH, 7);
        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 */
        {
            __m256i vH = _mm256_load_si256(pvH + offset);
            for (k=0; k<position; ++k) {
                vH = _mm256_slli_si256_rpl(vH, 4);
            }
            score = (int32_t) _mm256_extract_epi32_rpl (vH, 7);
            end_ref = s2Len - 1;
            end_query = s1Len - 1;
        }
    }

    if (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi32_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x100, %rsp            # imm = 0x100
movq %rsi, 0x68(%rsp)
testq %rdi, %rdi
je 0x4f2f8b
movq 0x48(%rdi), %rax
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x4f2faf
movq 0x10(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x4f2fd3
movl 0x8(%rdi), %eax
movq %rax, 0x58(%rsp)
testl %eax, %eax
jle 0x4f2ff7
cmpq $0x0, 0x68(%rsp)
je 0x4f301b
movl %edx, %r14d
testl %edx, %edx
jle 0x4f303c
movl %ecx, %r13d
testl %ecx, %ecx
js 0x4f305d
testl %r8d, %r8d
js 0x4f307e
movl %r9d, %r12d
movl %r8d, 0x14(%rsp)
movq 0x58(%rsp), %rcx
leal -0x1(%rcx), %eax
leaq 0x7(%rcx), %rdi
movq %rdi, %rbx
shrq $0x3, %rbx
movl %eax, 0x4c(%rsp)
xorl %edx, %edx
divl %ebx
movl %eax, 0x80(%rsp)
movl %edx, %r15d
movl %r13d, %r8d
negl %r8d
movq 0x60(%rsp), %rsi
movl 0x20(%rsi), %eax
movl $0x80000000, %edx       # imm = 0x80000000
movl %r13d, %ecx
orl %edx, %ecx
subl %eax, %edx
movl %r8d, 0x30(%rsp)
cmpl %r8d, %eax
cmovgl %ecx, %edx
movl %edx, 0x18(%rsp)
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl 0x1c(%rsi), %eax
movl %eax, 0x48(%rsp)
andl $0x7ffffff8, %edi       # imm = 0x7FFFFFF8
movl %r14d, %esi
callq 0x1ab93b
testq %rax, %rax
je 0x4f30a4
movl %r13d, 0x40(%rsp)
movl %r15d, 0x44(%rsp)
xorl %edi, %edi
testl %r12d, %r12d
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x10(%rbp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x18(%rbp)
setne %dl
shll $0xe, %edx
movq %rax, %r8
xorl %esi, %esi
cmpl $0x0, 0x20(%rbp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %eax
orl %edx, %eax
orl %esi, %eax
orl 0xc(%r8), %eax
orl $0x8440402, %eax        # imm = 0x8440402
movq %r8, 0x28(%rsp)
movl %eax, 0xc(%r8)
pushq $0x20
popq %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x496aa4
movq %rax, %r15
leal 0x1(%r14), %esi
movq %r13, %rdi
movq %rsi, 0x70(%rsp)
callq 0x1ab783
movq %rax, %r13
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x496aa4
movq %r14, 0x50(%rsp)
movq %rax, %r14
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x496aa4
movq %rbx, %rsi
movq %rax, %rbx
pushq $0x20
popq %rdi
movq %rsi, 0x20(%rsp)
callq 0x496aa4
testq %r15, %r15
sete %cl
movq %r13, 0x38(%rsp)
testq %r13, %r13
sete %dl
orb %cl, %dl
testq %r14, %r14
sete %cl
testq %rbx, %rbx
sete %dil
orb %cl, %dil
orb %dl, %dil
testq %rax, %rax
sete %cl
xorl %esi, %esi
orb %dil, %cl
jne 0x4f30a4
movq 0x50(%rsp), %rcx
decl %ecx
movl %ecx, 0x1c(%rsp)
pushq $0x7
popq %rdx
subl 0x80(%rsp), %edx
movl 0x40(%rsp), %r8d
vmovd %r8d, %xmm0
vpbroadcastd %xmm0, %ymm4
movl 0x14(%rsp), %r11d
vmovd %r11d, %xmm0
vpbroadcastd %xmm0, %ymm5
movl 0x18(%rsp), %r13d
incl %r13d
movl %r13d, 0x18(%rsp)
vmovd %r13d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovd 0x48(%rsp), %xmm1
vpbroadcastd %xmm1, %ymm1
vmovd %edx, %xmm2
vpbroadcastd %xmm2, %ymm3
vpxor %xmm2, %xmm2, %xmm2
vmovss %xmm0, %xmm2, %xmm6     # xmm6 = xmm0[0],xmm2[1,2,3]
movq 0x20(%rsp), %rcx
movl %ecx, %edi
imull %r11d, %edi
movl %edi, %ecx
negl %ecx
vmovd %ecx, %xmm2
vpbroadcastd %xmm2, %ymm2
vpxor %xmm7, %xmm7, %xmm7
vpblendd $0x1, %ymm7, %ymm2, %ymm2 # ymm2 = ymm7[0],ymm2[1,2,3,4,5,6,7]
vpaddd %ymm2, %ymm6, %ymm7
movl %r8d, %r8d
movq $-0x80000000, %r9       # imm = 0x80000000
movl 0x30(%rsp), %r10d
cmpq 0x20(%rsp), %rsi
je 0x4f2b53
movl %r10d, %ecx
xorl %r11d, %r11d
cmpq $0x8, %r11
je 0x4f2b22
testl %r12d, %r12d
movl $0x0, %r13d
cmovel %ecx, %r13d
movslq %r13d, %r13
movl %r13d, 0xc0(%rsp,%r11,4)
subq %r8, %r13
cmpq $-0x7fffffff, %r13      # imm = 0x80000001
cmovlq %r9, %r13
movl %r13d, 0xa0(%rsp,%r11,4)
incq %r11
subl %edi, %ecx
jmp 0x4f2ae7
movq %rsi, %rcx
shlq $0x5, %rcx
vmovaps 0xc0(%rsp), %ymm2
vmovaps %ymm2, (%rbx,%rcx)
vmovdqa 0xa0(%rsp), %ymm2
vmovdqa %ymm2, (%r15,%rcx)
incq %rsi
movl 0x14(%rsp), %r11d
subl %r11d, %r10d
jmp 0x4f2ada
movq 0x38(%rsp), %rcx
andl $0x0, (%rcx)
pushq $0x1
popq %rcx
movl 0x30(%rsp), %r8d
movl 0x18(%rbp), %r9d
movq 0x70(%rsp), %r10
movq 0x38(%rsp), %rdi
cmpq %rcx, %r10
je 0x4f2b8d
testl %r9d, %r9d
movl $0x0, %esi
cmovel %r8d, %esi
movl %esi, (%rdi,%rcx,4)
incq %rcx
subl %r11d, %r8d
jmp 0x4f2b71
vpxor %xmm2, %xmm2, %xmm2
vpsubd %ymm4, %ymm2, %ymm8
movq 0x20(%rsp), %rcx
decl %ecx
vmovdqa %ymm1, %ymm2
movl %ecx, %esi
testl %esi, %esi
js 0x4f2bbe
movl %esi, %edi
shlq $0x5, %rdi
vmovdqa %ymm8, (%rax,%rdi)
vpsubd %ymm5, %ymm8, %ymm8
vpminsd %ymm8, %ymm2, %ymm2
decl %esi
jmp 0x4f2ba2
vmovdqa %ymm1, 0x80(%rsp)
movl %ecx, %r8d
shlq $0x5, %r8
addq %rbx, %r8
movl 0x44(%rsp), %ecx
shlq $0x5, %rcx
addq %rbx, %rcx
movq %rcx, 0x30(%rsp)
movl 0x50(%rsp), %r9d
movq 0x20(%rsp), %r10
shlq $0x5, %r10
xorl %r11d, %r11d
vpmovsxbd 0xd8c85(%rip), %ymm9 # 0x5cb880
pushq $0x6
popq %r12
vpcmpeqd 0xd8c99(%rip), %ymm3, %ymm10 # 0x5cb8a0
vmovdqa %ymm0, %ymm3
vmovdqa %ymm0, %ymm8
movl 0x1c(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movq 0x28(%rsp), %rsi
cmpq %r9, %r11
je 0x4f2d96
vpermd (%r8), %ymm9, %ymm11
movq 0x38(%rsp), %rcx
vmovd (%rcx,%r11,4), %xmm12
vpblendd $0x1, %ymm12, %ymm11, %ymm13 # ymm13 = ymm12[0],ymm11[1,2,3,4,5,6,7]
movq 0x60(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x68(%rsp), %rdi
movzbl (%rdi,%r11), %edi
movl (%rcx,%rdi,4), %ecx
imull 0x20(%rsp), %ecx
movslq %ecx, %r13
shlq $0x5, %r13
addq 0x78(%rsp), %r13
vpsubd (%rax), %ymm0, %ymm12
xorl %ecx, %ecx
vmovdqa %ymm0, %ymm11
cmpq %rcx, %r10
je 0x4f2cb6
vpaddd (%r13,%rcx), %ymm13, %ymm13
vmovdqa (%rbx,%rcx), %ymm14
vmovdqa (%r15,%rcx), %ymm15
vpsubd %ymm5, %ymm15, %ymm15
vpsubd %ymm4, %ymm14, %ymm1
vpaddd (%rax,%rcx), %ymm12, %ymm12
vpmaxsd %ymm1, %ymm15, %ymm1
vpmaxsd %ymm12, %ymm11, %ymm11
vmovdqa %ymm1, (%r15,%rcx)
vpmaxsd %ymm13, %ymm1, %ymm12
vmovdqa %ymm12, (%r14,%rcx)
addq $0x20, %rcx
vmovdqa %ymm14, %ymm13
jmp 0x4f2c6c
vpermd %ymm12, %ymm9, %ymm1
leaq 0x1(%r11), %r13
movq 0x38(%rsp), %rcx
vmovd 0x4(%rcx,%r11,4), %xmm12
vpblendd $0x1, %ymm12, %ymm1, %ymm12 # ymm12 = ymm12[0],ymm1[1,2,3,4,5,6,7]
vpaddd (%rax), %ymm12, %ymm1
vpmaxsd %ymm1, %ymm11, %ymm11
movl %r12d, %ecx
vperm2i128 $0x8, %ymm11, %ymm11, %ymm1 # ymm1 = zero,zero,ymm11[0,1]
vpalignr $0xc, %ymm1, %ymm11, %ymm13 # ymm13 = ymm1[12,13,14,15],ymm11[0,1,2,3,4,5,6,7,8,9,10,11],ymm1[28,29,30,31],ymm11[16,17,18,19,20,21,22,23,24,25,26,27]
subl $0x1, %ecx
jb 0x4f2cf9
vpaddd %ymm7, %ymm13, %ymm1
vpmaxsd %ymm1, %ymm11, %ymm11
jmp 0x4f2cdd
vpaddd %ymm6, %ymm13, %ymm11
vpmaxsd %ymm11, %ymm12, %ymm12
xorl %ecx, %ecx
cmpq %rcx, %r10
je 0x4f2d36
vpsubd %ymm5, %ymm11, %ymm1
vpsubd %ymm4, %ymm12, %ymm11
vpmaxsd %ymm11, %ymm1, %ymm11
vpmaxsd (%r14,%rcx), %ymm11, %ymm12
vmovdqa %ymm12, (%rbx,%rcx)
vpminsd %ymm11, %ymm2, %ymm1
vpminsd %ymm12, %ymm1, %ymm2
vpmaxsd %ymm12, %ymm3, %ymm3
addq $0x20, %rcx
jmp 0x4f2d04
movq 0x30(%rsp), %rcx
vmovdqa (%rcx), %ymm11
vpcmpgtd %ymm8, %ymm11, %ymm1
vpand %ymm1, %ymm10, %ymm1
vpmovmskb %ymm1, %ecx
xorl %edi, %edi
vmovdqa %ymm11, %ymm12
cmpl %edx, %edi
jge 0x4f2d67
vperm2i128 $0x28, %ymm12, %ymm12, %ymm1 # ymm1 = zero,zero,ymm12[0,1]
vpalignr $0xc, %ymm1, %ymm12, %ymm12 # ymm12 = ymm1[12,13,14,15],ymm12[0,1,2,3,4,5,6,7,8,9,10,11],ymm1[28,29,30,31],ymm12[16,17,18,19,20,21,22,23,24,25,26,27]
incl %edi
jmp 0x4f2d53
testl %ecx, %ecx
vpmaxsd %ymm8, %ymm11, %ymm8
movl 0x14(%rsp), %ecx
cmovnel %r11d, %ecx
movl %ecx, 0x14(%rsp)
vextracti128 $0x1, %ymm12, %xmm1
movq 0x10(%rsi), %rcx
movq (%rcx), %rcx
vpextrd $0x3, %xmm1, (%rcx,%r11,4)
movq %r13, %r11
jmp 0x4f2c1c
movq 0x20(%rsp), %r13
leal (,%r13,4), %r8d
imulq $0x1c, %r13, %rcx
imulq $0x18, %r13, %r9
imulq $0x14, %r13, %r10
movq %r13, %r11
shlq $0x4, %r11
imulq $0xc, %r13, %r12
shlq $0x3, %r13
xorl %edi, %edi
vmovdqa 0x80(%rsp), %ymm5
cmpq %rdi, %r8
je 0x4f2e2a
movq 0x28(%rsp), %rsi
movq 0x10(%rsi), %rsi
movq 0x8(%rsi), %rsi
vmovdqa (%rbx,%rdi,8), %xmm1
vmovdqa 0x10(%rbx,%rdi,8), %xmm4
vmovd %xmm1, (%rsi,%rdi)
addq %rdi, %rsi
vpextrd $0x1, %xmm1, (%r8,%rsi)
vpextrd $0x2, %xmm1, (%r13,%rsi)
vpextrd $0x3, %xmm1, (%r12,%rsi)
vmovd %xmm4, (%r11,%rsi)
vpextrd $0x1, %xmm4, (%r10,%rsi)
vpextrd $0x2, %xmm4, (%r9,%rsi)
vpextrd $0x3, %xmm4, (%rcx,%rsi)
movq 0x28(%rsp), %rsi
addq $0x4, %rdi
jmp 0x4f2dc9
movl 0x20(%rbp), %r13d
testl %r13d, %r13d
movl 0x4c(%rsp), %r11d
movq 0x58(%rsp), %r12
je 0x4f2e61
xorl %ecx, %ecx
cmpl %edx, %ecx
jge 0x4f2e53
vperm2i128 $0x28, %ymm8, %ymm8, %ymm1 # ymm1 = zero,zero,ymm8[0,1]
vpalignr $0xc, %ymm1, %ymm8, %ymm8 # ymm8 = ymm1[12,13,14,15],ymm8[0,1,2,3,4,5,6,7,8,9,10,11],ymm1[28,29,30,31],ymm8[16,17,18,19,20,21,22,23,24,25,26,27]
incl %ecx
jmp 0x4f2e3f
vextracti128 $0x1, %ymm8, %xmm1
vpextrd $0x3, %xmm1, 0x18(%rsp)
cmpl $0x0, 0x10(%rbp)
je 0x4f2ed8
movq 0x20(%rsp), %r9
andl $0xfffffff, %r9d        # imm = 0xFFFFFFF
shll $0x3, %r9d
xorl %r10d, %r10d
movl %r11d, %r8d
cmpl %r10d, %r9d
je 0x4f2edb
movl %r10d, %esi
shrl $0x3, %esi
movl %r10d, %ecx
andl $0x7, %ecx
imull 0x20(%rsp), %ecx
addl %esi, %ecx
cmpl %r12d, %ecx
jge 0x4f2ece
movl (%rbx,%r10,4), %edi
movl 0x18(%rsp), %esi
cmpl %esi, %edi
jle 0x4f2eb7
movl %edi, 0x18(%rsp)
movl 0x1c(%rsp), %esi
movl %esi, 0x14(%rsp)
movl %ecx, %r8d
jmp 0x4f2ece
xorl %esi, %edi
movl 0x14(%rsp), %esi
xorl 0x1c(%rsp), %esi
cmpl %r8d, %ecx
cmovgel %r8d, %ecx
orl %edi, %esi
cmovel %ecx, %r8d
movq 0x28(%rsp), %rsi
incq %r10
jmp 0x4f2e7d
movl %r11d, %r8d
orl 0x10(%rbp), %r13d
jne 0x4f2f19
movq 0x30(%rsp), %rcx
vmovdqa (%rcx), %ymm4
xorl %ecx, %ecx
cmpl %edx, %ecx
jge 0x4f2f00
vperm2i128 $0x28, %ymm4, %ymm4, %ymm1 # ymm1 = zero,zero,ymm4[0,1]
vpalignr $0xc, %ymm1, %ymm4, %ymm4 # ymm4 = ymm1[12,13,14,15],ymm4[0,1,2,3,4,5,6,7,8,9,10,11],ymm1[28,29,30,31],ymm4[16,17,18,19,20,21,22,23,24,25,26,27]
incl %ecx
jmp 0x4f2eec
vextracti128 $0x1, %ymm4, %xmm1
vpextrd $0x3, %xmm1, 0x18(%rsp)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl %r11d, %r8d
vpcmpgtd %ymm2, %ymm0, %ymm0
vpcmpgtd %ymm5, %ymm3, %ymm1
vpor %ymm0, %ymm1, %ymm0
vtestps %ymm0, %ymm0
je 0x4f2f43
orb $0x40, 0xc(%rsi)
movl $0x0, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
xorl %r8d, %r8d
movl 0x18(%rsp), %ecx
movl %ecx, (%rsi)
movl %r8d, 0x4(%rsi)
movl 0x14(%rsp), %ecx
movl %ecx, 0x8(%rsi)
movq %rax, %rdi
vzeroupper
callq 0x1ab763
movq %rbx, %rdi
callq 0x1ab763
movq %r14, %rdi
callq 0x1ab763
movq 0x38(%rsp), %rdi
callq 0x1ab763
movq %r15, %rdi
callq 0x1ab763
movq 0x28(%rsp), %rax
jmp 0x4f30a6
movq 0x248046(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd404f(%rip), %rsi     # 0x5c6feb
leaq 0xd9fb5(%rip), %rdx     # 0x5ccf58
leaq 0xaa533(%rip), %rcx     # 0x59d4dd
jmp 0x4f309d
movq 0x248022(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd402b(%rip), %rsi     # 0x5c6feb
leaq 0xd9f91(%rip), %rdx     # 0x5ccf58
leaq 0xd49d8(%rip), %rcx     # 0x5c79a6
jmp 0x4f309d
movq 0x247ffe(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd4007(%rip), %rsi     # 0x5c6feb
leaq 0xd9f6d(%rip), %rdx     # 0x5ccf58
leaq 0xd4947(%rip), %rcx     # 0x5c7939
jmp 0x4f309d
movq 0x247fda(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd46f9(%rip), %rsi     # 0x5c7701
leaq 0xd9f49(%rip), %rdx     # 0x5ccf58
leaq 0xd4933(%rip), %rcx     # 0x5c7949
jmp 0x4f309d
movq 0x247fb6(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd3fbf(%rip), %rsi     # 0x5c6feb
leaq 0xd9f25(%rip), %rdx     # 0x5ccf58
leaq 0xd46c4(%rip), %rcx     # 0x5c76fe
jmp 0x4f309d
movq 0x247f95(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd46b4(%rip), %rsi     # 0x5c7701
leaq 0xd9f04(%rip), %rdx     # 0x5ccf58
leaq 0xd46ba(%rip), %rcx     # 0x5c7715
jmp 0x4f309d
movq 0x247f74(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd46ad(%rip), %rsi     # 0x5c771b
leaq 0xd9ee3(%rip), %rdx     # 0x5ccf58
leaq 0xd46b4(%rip), %rcx     # 0x5c7730
jmp 0x4f309d
movq 0x247f53(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xd468c(%rip), %rsi     # 0x5c771b
leaq 0xd9ec2(%rip), %rdx     # 0x5ccf58
leaq 0xd4698(%rip), %rcx     # 0x5c7735
xorl %eax, %eax
callq 0x19e180
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq