// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/sw_scan_avx2_256_16.c
// Function: parasail_sw_rowcol_scan_profile_avx2_256_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)
{
    /* 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
    __m256i* restrict pvP = NULL;
    __m256i* restrict pvE = NULL;
    __m256i* restrict pvHt = NULL;
    __m256i* restrict pvH = NULL;
    __m256i* restrict pvHMax = NULL;
    __m256i* restrict pvGapper = NULL;
    __m256i vGapO;
    __m256i vGapE;
    int16_t NEG_LIMIT = 0;
    int16_t POS_LIMIT = 0;
    __m256i vZero;
    int16_t score = 0;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    __m256i vMaxH;
    __m256i vMaxHUnit;
    __m256i vNegInfFront;
    __m256i vSegLenXgap;
    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;
    end_query = 0;
    end_ref = 0;
    s1Len = profile->s1Len;
    matrix = profile->matrix;
    segWidth = 16; /* 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 = (__m256i*)profile->profile16.score;
    vGapO = _mm256_set1_epi16(open);
    vGapE = _mm256_set1_epi16(gap);
    NEG_LIMIT = (-open < matrix->min ? INT16_MIN + open : INT16_MIN - matrix->min) + 1;
    POS_LIMIT = INT16_MAX - matrix->max - 1;
    vZero = _mm256_setzero_si256();
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi16(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi16(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vMaxHUnit = vNegLimit;
    vNegInfFront = vZero;
    vNegInfFront = _mm256_insert_epi16_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm256_adds_epi16(vNegInfFront,
            _mm256_slli_si256_rpl(_mm256_set1_epi16(-segLen*gap), 2));

    /* 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_16 | PARASAIL_FLAG_LANES_16;
#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);
    pvHt= parasail_memalign___m256i(32, segLen);
    pvH = parasail_memalign___m256i(32, segLen);
    pvHMax = parasail_memalign___m256i(32, segLen);
    pvGapper = parasail_memalign___m256i(32, 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___m256i(pvH, vZero, segLen);
    parasail_memset___m256i(pvE, vNegLimit, segLen);
    {
        __m256i vGapper = _mm256_subs_epi16(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm256_store_si256(pvGapper+i, vGapper);
            vGapper = _mm256_subs_epi16(vGapper, vGapE);
        }
    }

    /* 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, 2);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = vZero;
        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_epi16(
                    _mm256_subs_epi16(vE, vGapE),
                    _mm256_subs_epi16(vH, vGapO));
            vHp = _mm256_adds_epi16(vHp, vW);
            vF = _mm256_max_epi16(vF, _mm256_adds_epi16(vHt, pvGapper[i]));
            vHt = _mm256_max_epi16(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, 2);
        vF = _mm256_max_epi16(vF, _mm256_adds_epi16(vHt, pvGapper[0]));
        for (i=0; i<segWidth-2; ++i) {
            __m256i vFt = _mm256_slli_si256_rpl(vF, 2);
            vFt = _mm256_adds_epi16(vFt, vSegLenXgap);
            vF = _mm256_max_epi16(vF, vFt);
        }

        /* calculate final H */
        vF = _mm256_slli_si256_rpl(vF, 2);
        vF = _mm256_adds_epi16(vF, vNegInfFront);
        vH = _mm256_max_epi16(vHt, vF);
        vH = _mm256_max_epi16(vH, vZero);
        for (i=0; i<segLen; ++i) {
            vHt = _mm256_load_si256(pvHt+i);
            vF = _mm256_max_epi16(
                    _mm256_subs_epi16(vF, vGapE),
                    _mm256_subs_epi16(vH, vGapO));
            vH = _mm256_max_epi16(vHt, vF);
            vH = _mm256_max_epi16(vH, vZero);
            _mm256_store_si256(pvH+i, vH);
            vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vH);
            vSaturationCheckMax = _mm256_max_epi16(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si256(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
            vMaxH = _mm256_max_epi16(vH, vMaxH);
        } 

        {
            __m256i vCompare = _mm256_cmpgt_epi16(vMaxH, vMaxHUnit);
            if (_mm256_movemask_epi8(vCompare)) {
                score = _mm256_hmax_epi16_rpl(vMaxH);
                vMaxHUnit = _mm256_set1_epi16(score);
                end_ref = j;
                (void)memcpy(pvHMax, pvH, sizeof(__m256i)*segLen);
            }
        }

#ifdef PARASAIL_ROWCOL
        /* extract last value from the column */
        {
            int32_t k = 0;
            __m256i vH = _mm256_load_si256(pvH + offset);
            for (k=0; k<position; ++k) {
                vH = _mm256_slli_si256_rpl(vH, 2);
            }
            result->rowcols->score_row[j] = (int16_t) _mm256_extract_epi16_rpl (vH, 15);
        }
#endif
    }

    /* Trace the alignment ending position on read. */
    {
        int16_t *t = (int16_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) {
        __m256i vH = _mm256_load_si256(pvH+i);
        arr_store_col(result->rowcols->score_col, vH, i, segLen);
    }
#endif

    if (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi16_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_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(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 $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, 0x38(%rsp)
testq %rdi, %rdi
je 0x553dd5
movq 0x30(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x553ddf
movq 0x10(%rdi), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x553de9
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x553df3
cmpq $0x0, 0x38(%rsp)
je 0x553dfd
movl %edx, %ebp
testl %edx, %edx
jle 0x554062
movl %ecx, %r12d
testl %ecx, %ecx
js 0x554069
movl %r8d, %r15d
testl %r8d, %r8d
js 0x554070
leaq 0xf(%rax), %rdi
movq %rdi, %r13
shrq $0x4, %r13
movq %rax, 0x70(%rsp)
decl %eax
xorl %edx, %edx
divl %r13d
movl %eax, 0x28(%rsp)
movl %edx, %r14d
movl %r12d, %eax
negl %eax
movq 0x30(%rsp), %rdx
movl 0x20(%rdx), %ecx
movl %ecx, %ebx
negl %ebx
cmpl %eax, %ecx
cmovgl %r12d, %ebx
movw $0x7ffe, %ax            # imm = 0x7FFE
subw 0x1c(%rdx), %ax
movl %eax, 0xe0(%rsp)
andl $0x7ffffff0, %edi       # imm = 0x7FFFFFF0
movq %rdi, 0x78(%rsp)
movl %ebp, %esi
callq 0x20ac53
testq %rax, %rax
je 0x554075
movl %r12d, 0x80(%rsp)
movl %r15d, 0xa0(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebp, 0xc0(%rsp)
movq %rax, 0x18(%rsp)
orl $0x10240404, 0xc(%rax)  # imm = 0x10240404
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r14
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r15
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r12
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %r13, %rsi
movq %rax, %r13
movl $0x20, %edi
movq %rsi, 0x40(%rsp)
callq 0x4f1904
movq %rax, %rbp
testq %r14, %r14
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
testq %r12, %r12
sete %al
movq %r13, 0x48(%rsp)
testq %r13, %r13
sete %dl
orb %al, %dl
orb %cl, %dl
testq %rbp, %rbp
sete %al
orb %dl, %al
jne 0x554075
movl %ebx, %eax
movl $0xf, %ebx
subl 0x28(%rsp), %ebx
vmovd 0x80(%rsp), %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x1a0(%rsp)
movl 0xa0(%rsp), %ecx
vmovd %ecx, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x180(%rsp)
addl $0xffff8001, %eax       # imm = 0xFFFF8001
vmovd %eax, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x100(%rsp)
vmovd 0xe0(%rsp), %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x140(%rsp)
movl %eax, 0xc(%rsp)
movzwl %ax, %eax
vmovd %eax, %xmm1
movq 0x40(%rsp), %r13
imull %r13d, %ecx
negl %ecx
vmovd %ecx, %xmm0
vpbroadcastw %xmm0, %ymm0
vpand 0xda3d6(%rip), %ymm0, %ymm0 # 0x62ddc0
vmovdqu %ymm1, 0x120(%rsp)
vpaddsw %ymm0, %ymm1, %ymm0
vmovdqu %ymm0, 0x160(%rsp)
vpxor %xmm0, %xmm0, %xmm0
movq %r12, %rdi
movq %r13, %rsi
callq 0x4f190d
movq %r14, %rdi
vmovdqu 0x100(%rsp), %ymm0
movq %r13, %rsi
callq 0x4f190d
vmovdqu 0x180(%rsp), %ymm7
vmovdqu 0x1a0(%rsp), %ymm6
vpxor %xmm0, %xmm0, %xmm0
vpsubsw %ymm6, %ymm0, %ymm0
leal -0x1(%r13), %ecx
shlq $0x5, %rcx
movq %rbp, %rax
movq %rcx, 0x20(%rsp)
addq %rcx, %rax
movl %r13d, %ecx
vmovdqa %ymm0, (%rax)
vpsubsw %ymm7, %ymm0, %ymm0
addq $-0x20, %rax
decl %ecx
jg 0x553a53
addq %r12, 0x20(%rsp)
movq %r13, %rax
shlq $0x5, %r13
movl 0x10(%rsp), %ecx
shlq $0x5, %rcx
addq %r12, %rcx
movq %rcx, 0x58(%rsp)
movl 0xc0(%rsp), %ecx
movq %rcx, 0x50(%rsp)
xorl %edi, %edi
movl %eax, %r10d
vpxor %xmm11, %xmm11, %xmm11
xorl %esi, %esi
vmovdqu 0x100(%rsp), %ymm0
vmovdqa %ymm0, %ymm13
vmovdqa %ymm0, %ymm12
vmovdqa %ymm0, %ymm9
vmovdqu 0x140(%rsp), %ymm10
movq 0x18(%rsp), %rdx
vmovdqu 0x160(%rsp), %ymm8
movl %ebx, 0x6c(%rsp)
movq 0x20(%rsp), %rax
vmovdqa (%rax), %ymm0
vperm2i128 $0x28, %ymm0, %ymm0, %ymm1 # ymm1 = zero,zero,ymm0[0,1]
vpalignr $0xe, %ymm1, %ymm0, %ymm2 # ymm2 = ymm1[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm1[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x38(%rsp), %rcx
movzbl (%rcx,%rdi), %ecx
movslq (%rax,%rcx,4), %rax
imulq %r10, %rax
shlq $0x5, %rax
addq 0x60(%rsp), %rax
xorl %ecx, %ecx
vmovdqu 0x100(%rsp), %ymm0
vpxor %xmm1, %xmm1, %xmm1
vpaddsw (%rax,%rcx), %ymm2, %ymm2
vmovdqa (%r12,%rcx), %ymm3
vmovdqa (%r14,%rcx), %ymm4
vpsubsw %ymm7, %ymm4, %ymm4
vpsubsw %ymm6, %ymm3, %ymm5
vpmaxsw %ymm5, %ymm4, %ymm4
vpaddsw (%rbp,%rcx), %ymm1, %ymm1
vpmaxsw %ymm1, %ymm0, %ymm0
vpmaxsw %ymm2, %ymm4, %ymm1
vmovdqa %ymm4, (%r14,%rcx)
vmovdqa %ymm1, (%r15,%rcx)
addq $0x20, %rcx
vmovdqa %ymm3, %ymm2
cmpq %rcx, %r13
jne 0x553b0e
vperm2i128 $0x8, %ymm1, %ymm1, %ymm2 # ymm2 = zero,zero,ymm1[0,1]
vpalignr $0xe, %ymm2, %ymm1, %ymm1 # ymm1 = ymm2[14,15],ymm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm2[30,31],ymm1[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpaddsw (%rbp), %ymm1, %ymm2
vpmaxsw %ymm2, %ymm0, %ymm0
movl $0xe, %eax
vperm2i128 $0x28, %ymm0, %ymm0, %ymm2 # ymm2 = zero,zero,ymm0[0,1]
vpalignr $0xe, %ymm2, %ymm0, %ymm2 # ymm2 = ymm2[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm2[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpaddsw %ymm2, %ymm8, %ymm2
vpmaxsw %ymm2, %ymm0, %ymm0
decl %eax
jne 0x553b6c
vperm2i128 $0x28, %ymm0, %ymm0, %ymm2 # ymm2 = zero,zero,ymm0[0,1]
vpalignr $0xe, %ymm2, %ymm0, %ymm0 # ymm0 = ymm2[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm2[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpaddsw 0x120(%rsp), %ymm0, %ymm0
vpmaxsw %ymm1, %ymm11, %ymm1
vpmaxsw %ymm0, %ymm1, %ymm1
xorl %eax, %eax
vpsubsw %ymm7, %ymm0, %ymm0
vpsubsw %ymm6, %ymm1, %ymm1
vpmaxsw %ymm1, %ymm0, %ymm0
vpmaxsw (%r15,%rax), %ymm0, %ymm1
vpmaxsw %ymm1, %ymm11, %ymm1
vmovdqa %ymm1, (%r12,%rax)
vpminsw %ymm1, %ymm10, %ymm10
vpmaxsw %ymm1, %ymm9, %ymm9
vpmaxsw %ymm1, %ymm12, %ymm12
addq $0x20, %rax
cmpq %rax, %r13
jne 0x553ba3
vpcmpgtw %ymm13, %ymm12, %ymm0
vpmovmskb %ymm0, %eax
testl %eax, %eax
je 0x553cc2
vpermq $0x44, %ymm12, %ymm0    # ymm0 = ymm12[0,1,0,1]
vpmaxsw %ymm0, %ymm12, %ymm0
vpslldq $0x8, %ymm0, %ymm1      # ymm1 = zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23]
vpmaxsw %ymm1, %ymm0, %ymm0
vpslldq $0x4, %ymm0, %ymm1      # ymm1 = zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7,8,9,10,11],zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23,24,25,26,27]
vpmaxsw %ymm1, %ymm0, %ymm0
vpslldq $0x2, %ymm0, %ymm1      # ymm1 = zero,zero,ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],zero,zero,ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpmaxsw %ymm1, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm1
vpextrw $0x7, %xmm1, %eax
movl %eax, 0xc(%rsp)
vpshufhw $0xff, %ymm0, %ymm0     # ymm0 = ymm0[0,1,2,3,7,7,7,7,8,9,10,11,15,15,15,15]
vpbroadcastd 0xda2a9(%rip), %ymm1 # 0x62ded0
vpermd %ymm0, %ymm1, %ymm0
vmovdqu %ymm0, 0x80(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r10, %rbx
vmovdqu %ymm9, 0xe0(%rsp)
vmovdqu %ymm10, 0xc0(%rsp)
vmovdqu %ymm12, 0xa0(%rsp)
vzeroupper
callq 0x19e0c0
vmovdqu 0x80(%rsp), %ymm13
vmovdqu 0xa0(%rsp), %ymm12
vpxor %xmm11, %xmm11, %xmm11
movq 0x10(%rsp), %rdi
vmovdqu 0x160(%rsp), %ymm8
vmovdqu 0x180(%rsp), %ymm7
vmovdqu 0x1a0(%rsp), %ymm6
vmovdqu 0xc0(%rsp), %ymm10
vmovdqu 0xe0(%rsp), %ymm9
movq %rbx, %r10
movl 0x6c(%rsp), %ebx
movq 0x18(%rsp), %rdx
movl %edi, %esi
movq 0x58(%rsp), %rax
vmovdqa (%rax), %ymm0
cmpl $0xe, 0x28(%rsp)
jg 0x553ce6
xorl %eax, %eax
vperm2i128 $0x28, %ymm0, %ymm0, %ymm1 # ymm1 = zero,zero,ymm0[0,1]
vpalignr $0xe, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[14,15],ymm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm1[30,31],ymm0[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
incl %eax
cmpl %ebx, %eax
jl 0x553cd4
vextracti128 $0x1, %ymm0, %xmm0
vpextrw $0x7, %xmm0, %eax
cwtl
movq 0x10(%rdx), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx,%rdi,4)
incq %rdi
cmpq 0x50(%rsp), %rdi
jne 0x553ac7
movl %esi, 0x50(%rsp)
movq 0x78(%rsp), %rcx
testl %ecx, %ecx
je 0x553dc7
movl 0xc(%rsp), %esi
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %r8
movq 0x70(%rsp), %r9
je 0x553e07
vmovd %r9d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovd %esi, %xmm1
vpbroadcastw %xmm1, %xmm1
vmovd %r8d, %xmm2
vpbroadcastd %xmm2, %ymm2
vpmovsxbd 0xda046(%rip), %ymm3 # 0x62dda0
xorl %eax, %eax
vpbroadcastd 0xda16f(%rip), %ymm4 # 0x62ded4
vpbroadcastd 0xd9f72(%rip), %ymm5 # 0x62dce0
vpcmpeqw (%rdi,%rax,2), %xmm1, %xmm6
vpmovsxwd %xmm6, %ymm6
vpsrld $0x4, %ymm3, %ymm7
vpand %ymm4, %ymm3, %ymm8
vpmulld %ymm2, %ymm8, %ymm8
vpaddd %ymm7, %ymm8, %ymm7
vpminsd %ymm0, %ymm7, %ymm7
vblendvps %ymm6, %ymm7, %ymm0, %ymm0
addq $0x8, %rax
vpaddd %ymm5, %ymm3, %ymm3
cmpq %rax, %rcx
jne 0x553d6e
vextracti128 $0x1, %ymm0, %xmm1
vpminsd %xmm1, %xmm0, %xmm0
vpshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
vpminsd %xmm1, %xmm0, %xmm0
vpshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
vpminsd %xmm1, %xmm0, %xmm0
vmovd %xmm0, %ecx
jmp 0x553e32
movq 0x70(%rsp), %rax
movl %eax, %ecx
movq 0x40(%rsp), %r8
jmp 0x553e32
callq 0x1f023d
jmp 0x554075
callq 0x1f0217
jmp 0x554075
callq 0x1f01f1
jmp 0x554075
callq 0x1f01cb
jmp 0x554075
callq 0x1f01a5
jmp 0x554075
movl %r8d, %eax
andl $0x7ffffff, %eax        # imm = 0x7FFFFFF
shll $0x4, %eax
xorl %edx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
cmpl %r9d, %ecx
cmovgel %r9d, %ecx
cmpw %si, (%rdi,%rdx,2)
cmovnel %r9d, %ecx
incq %rdx
movl %ecx, %r9d
cmpl %edx, %eax
jne 0x553e14
leal (,%r8,4), %eax
leal (,%r8,8), %esi
leaq (%rax,%rax,2), %rdx
movq %rdx, 0xe0(%rsp)
imulq $0x3c, %r10, %rdx
movq %rdx, 0xc0(%rsp)
imulq $0x38, %r10, %rdx
movq %rdx, 0x10(%rsp)
imulq $0x34, %r10, %rdx
movq %rdx, 0xa0(%rsp)
movq %r10, %rdx
shlq $0x4, %rdx
movq %rdx, 0x80(%rsp)
leaq (%rdx,%rdx,2), %rdx
movq %rdx, 0x30(%rsp)
imulq $0x2c, %r10, %rdx
movq %rdx, 0x60(%rsp)
leaq (%rsi,%rsi,4), %rdx
movq %rdx, 0x28(%rsp)
leaq (%rax,%rax,8), %rdx
movq %rdx, 0x20(%rsp)
movq %r10, %r8
shlq $0x5, %r8
leaq (%r10,%r10,8), %rdx
leaq (%rdx,%rdx,2), %r9
addq %r10, %r9
movq %rsi, 0x38(%rsp)
leaq (%rsi,%rsi,2), %rdx
movq %rdx, 0x120(%rsp)
movq %rax, %r11
leaq (%rax,%rax,4), %rax
movq %rax, 0x58(%rsp)
xorl %edx, %edx
movq 0x18(%rsp), %rdi
movq 0x10(%rdi), %rbx
movq 0x8(%rbx), %rbx
vmovdqa (%r12,%rdx,8), %xmm1
vmovdqa 0x10(%r12,%rdx,8), %xmm0
vmovd %xmm1, %r13d
movswl %r13w, %r13d
movl %r13d, (%rbx,%rdx)
vpextrw $0x1, %xmm1, %r13d
addq %rdx, %rbx
movswl %r13w, %r13d
vpextrw $0x2, %xmm1, %eax
movl %r13d, (%r11,%rbx)
cwtl
vpextrw $0x3, %xmm1, %r13d
movq 0x38(%rsp), %rsi
movl %eax, (%rsi,%rbx)
movswl %r13w, %eax
vpextrw $0x4, %xmm1, %r13d
movq 0xe0(%rsp), %rsi
movl %eax, (%rsi,%rbx)
movswl %r13w, %eax
vpextrw $0x5, %xmm1, %r13d
movq 0x80(%rsp), %rsi
movl %eax, (%rsi,%rbx)
movswl %r13w, %eax
vpextrw $0x6, %xmm1, %r13d
movq 0x58(%rsp), %rsi
movl %eax, (%rsi,%rbx)
movswl %r13w, %eax
vpextrw $0x7, %xmm1, %r13d
movq 0x120(%rsp), %rsi
movl %eax, (%rsi,%rbx)
movswl %r13w, %eax
movl %eax, (%r9,%rbx)
vmovd %xmm0, %eax
cwtl
movl %eax, (%r8,%rbx)
vpextrw $0x1, %xmm0, %eax
cwtl
movq 0x20(%rsp), %rsi
movl %eax, (%rsi,%rbx)
vpextrw $0x2, %xmm0, %eax
cwtl
movq 0x28(%rsp), %rsi
movl %eax, (%rsi,%rbx)
vpextrw $0x3, %xmm0, %eax
cwtl
movq 0x60(%rsp), %rsi
movl %eax, (%rsi,%rbx)
vpextrw $0x4, %xmm0, %eax
cwtl
movq 0x30(%rsp), %rsi
movl %eax, (%rsi,%rbx)
vpextrw $0x5, %xmm0, %eax
cwtl
movq 0xa0(%rsp), %rsi
movl %eax, (%rsi,%rbx)
vpextrw $0x6, %xmm0, %eax
cwtl
movq 0x10(%rsp), %rsi
movl %eax, (%rsi,%rbx)
vpextrw $0x7, %xmm0, %eax
cwtl
movq 0xc0(%rsp), %rsi
movl %eax, (%rsi,%rbx)
addq $0x4, %rdx
decq %r10
jne 0x553ed8
vmovdqu 0x100(%rsp), %ymm0
vpcmpgtw %ymm10, %ymm0, %ymm0
vpcmpgtw 0x140(%rsp), %ymm9, %ymm1
vpor %ymm0, %ymm1, %ymm0
vpmovmskb %ymm0, %eax
testl %eax, %eax
movl 0xc(%rsp), %eax
movl 0x50(%rsp), %edx
je 0x554025
orb $0x40, 0xc(%rdi)
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
cwtl
movl %eax, (%rdi)
movl %ecx, 0x4(%rdi)
movl %edx, 0x8(%rdi)
movq %rbp, %rdi
vzeroupper
callq 0x20a60d
movq 0x48(%rsp), %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq 0x18(%rsp), %rax
jmp 0x554077
callq 0x1f017f
jmp 0x554075
callq 0x1f0159
jmp 0x554075
callq 0x1f0133
xorl %eax, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)