// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/sw_trace_scan_avx2_256_16.c
// Function: parasail_sw_trace_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;
    __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;
    __m256i vTZero;
    __m256i vTIns;
    __m256i vTDel;
    __m256i vTDiag;
    __m256i vTDiagE;
    __m256i vTInsE;
    __m256i vTDiagF;
    __m256i vTDelF;

    /* 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;
    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));
    vTZero = _mm256_set1_epi16(PARASAIL_ZERO);
    vTIns  = _mm256_set1_epi16(PARASAIL_INS);
    vTDel  = _mm256_set1_epi16(PARASAIL_DEL);
    vTDiag = _mm256_set1_epi16(PARASAIL_DIAG);
    vTDiagE = _mm256_set1_epi16(PARASAIL_DIAG_E);
    vTInsE = _mm256_set1_epi16(PARASAIL_INS_E);
    vTDiagF = _mm256_set1_epi16(PARASAIL_DIAG_F);
    vTDelF = _mm256_set1_epi16(PARASAIL_DEL_F);


    /* initialize result */
    result = parasail_result_new_trace(segLen, s2Len, 32, sizeof(__m256i));
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_16 | PARASAIL_FLAG_LANES_16;

    /* 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 vE_ext;
        __m256i vE_opn;
        __m256i vHt;
        __m256i vF;
        __m256i vF_ext;
        __m256i vF_opn;
        __m256i vH;
        __m256i vHp;
        __m256i *pvW;
        __m256i vW;
        __m256i case1;
        __m256i case2;
        __m256i case0;
        __m256i vGapper;
        __m256i vT;
        __m256i vET;
        __m256i vFT;

        /* 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);
            vGapper = _mm256_load_si256(pvGapper+i);
            vE_opn = _mm256_subs_epi16(vH, vGapO);
            vE_ext = _mm256_subs_epi16(vE, vGapE);
            case1 = _mm256_cmpgt_epi16(vE_opn, vE_ext);
            vET = _mm256_blendv_epi8(vTInsE, vTDiagE, case1);
            arr_store(result->trace->trace_table, vET, i, segLen, j);
            vE = _mm256_max_epi16(vE_opn, vE_ext);
            vGapper = _mm256_adds_epi16(vHt, vGapper);
            vF = _mm256_max_epi16(vF, vGapper);
            vHp = _mm256_adds_epi16(vHp, vW);
            vHt = _mm256_max_epi16(vE, vHp);
            _mm256_store_si256(pvE+i, vE);
            _mm256_store_si256(pvHt+i, vHt);
            _mm256_store_si256(pvH+i, vHp);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm256_slli_si256_rpl(vHt, 2);
        vGapper = _mm256_load_si256(pvGapper);
        vGapper = _mm256_adds_epi16(vHt, vGapper);
        vF = _mm256_max_epi16(vF, vGapper);
        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(vF, vHt);
        vH = _mm256_max_epi16(vH, vZero);
        for (i=0; i<segLen; ++i) {
            vET = arr_load(result->trace->trace_table, i, segLen, j);
            vHp = _mm256_load_si256(pvH+i);
            vHt = _mm256_load_si256(pvHt+i);
            vF_opn = _mm256_subs_epi16(vH, vGapO);
            vF_ext = _mm256_subs_epi16(vF, vGapE);
            vF = _mm256_max_epi16(vF_opn, vF_ext);
            case1 = _mm256_cmpgt_epi16(vF_opn, vF_ext);
            vFT = _mm256_blendv_epi8(vTDelF, vTDiagF, case1);
            vH = _mm256_max_epi16(vHt, vF);
            vH = _mm256_max_epi16(vH, vZero);
            case0 = _mm256_cmpeq_epi16(vH, vZero);
            case1 = _mm256_cmpeq_epi16(vH, vHp);
            case2 = _mm256_cmpeq_epi16(vH, vF);
            vT = _mm256_blendv_epi8(
                    _mm256_blendv_epi8(vTIns, vTDel, case2),
                    vTDiag, case1);
            vT = _mm256_blendv_epi8(vT, vTZero, case0);
            vT = _mm256_or_si256(vT, vET);
            vT = _mm256_or_si256(vT, vFT);
            arr_store(result->trace->trace_table, vT, i, segLen, j);
            _mm256_store_si256(pvH+i, vH);
            vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vH);
            vSaturationCheckMax = _mm256_max_epi16(vSaturationCheckMax, vH);
            {
                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);
            }
        }
    }

    /* 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;
                }
            }
        }
    }

    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 $0x278, %rsp            # imm = 0x278
movq %rsi, 0x30(%rsp)
testq %rdi, %rdi
je 0x5acf4b
movq 0x30(%rdi), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x5acf55
movq 0x10(%rdi), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x5acf5f
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x5acf69
cmpq $0x0, 0x30(%rsp)
je 0x5acf73
movl %edx, %r14d
testl %edx, %edx
jle 0x5ad01f
movl %ecx, %r13d
testl %ecx, %ecx
js 0x5ad026
movl %r8d, %r15d
testl %r8d, %r8d
js 0x5ad02d
movq %rax, 0x18(%rsp)
leaq 0xf(%rax), %rbp
movq %rbp, 0x38(%rsp)
shrq $0x4, %rbp
movl %r13d, %eax
negl %eax
movq 0x28(%rsp), %rsi
movl 0x20(%rsi), %ecx
movl %ecx, %edx
negl %edx
cmpl %eax, %ecx
cmovgl %r13d, %edx
movl %edx, 0x4(%rsp)
movw $0x7ffe, %r12w          # imm = 0x7FFE
subw 0x1c(%rsi), %r12w
movl $0x20, %edx
movl $0x20, %ecx
movl %ebp, %edi
movl %r14d, %esi
callq 0x20adf4
testq %rax, %rax
je 0x5ad032
movq %rax, %rbx
movl %r12d, 0xb0(%rsp)
movl %r15d, 0xd0(%rsp)
movl %r14d, 0x70(%rsp)
orl $0x10280404, 0xc(%rax)  # imm = 0x10280404
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, %r14
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, %r15
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rax, %r12
movl $0x20, %edi
movq %rbp, %rsi
callq 0x4f1904
movq %rbp, %rsi
movq %rax, %rbp
movl $0x20, %edi
movq %rsi, 0x8(%rsp)
callq 0x4f1904
testq %r14, %r14
sete %dl
testq %r15, %r15
sete %cl
orb %dl, %cl
testq %r12, %r12
sete %sil
movq %rbp, 0x10(%rsp)
testq %rbp, %rbp
sete %dl
orb %sil, %dl
orb %cl, %dl
testq %rax, %rax
sete %cl
orb %dl, %cl
jne 0x5ad032
vmovd %r13d, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x150(%rsp)
movl 0xd0(%rsp), %edx
vmovd %edx, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x130(%rsp)
movl 0x4(%rsp), %ecx
addl $0xffff8001, %ecx       # imm = 0xFFFF8001
vmovd %ecx, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x90(%rsp)
vmovd 0xb0(%rsp), %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0xf0(%rsp)
movl %ecx, 0x4(%rsp)
movzwl %cx, %ecx
vmovd %ecx, %xmm1
movq 0x8(%rsp), %r13
imull %r13d, %edx
negl %edx
vmovd %edx, %xmm0
vpbroadcastw %xmm0, %ymm0
vpand 0x81348(%rip), %ymm0, %ymm0 # 0x62ddc0
vmovdqu %ymm1, 0x1f0(%rsp)
vpaddsw %ymm0, %ymm1, %ymm0
vmovdqu %ymm0, 0x110(%rsp)
vpxor %xmm0, %xmm0, %xmm0
movq %r12, %rdi
movq %r13, %rsi
movq %rax, 0x20(%rsp)
callq 0x4f190d
movq %r14, %rdi
vmovdqu 0x90(%rsp), %ymm0
movq %r13, %rsi
callq 0x4f190d
vmovdqu 0x130(%rsp), %ymm8
vmovdqu 0x150(%rsp), %ymm7
movq 0x20(%rsp), %rdi
leal -0x1(%r13), %eax
vpxor %xmm0, %xmm0, %xmm0
vpsubsw %ymm7, %ymm0, %ymm0
movq %rax, %rcx
shlq $0x5, %rcx
addq %rdi, %rcx
movl %r13d, %edx
movq %r13, %rsi
vmovdqa %ymm0, (%rcx)
vpsubsw %ymm8, %ymm0, %ymm0
addq $-0x20, %rcx
decl %edx
jg 0x5acae9
movl %eax, %eax
shlq $0x5, %rax
movq %r12, %rcx
addq %rax, %rcx
movq %rcx, 0x58(%rsp)
movq %rsi, %r8
shlq $0x5, %r8
cmpl $0x1, %esi
movl %esi, %r13d
adcl $0x0, %r13d
vpbroadcastw 0x832db(%rip), %ymm0 # 0x62fe00
vmovdqu %ymm0, 0xd0(%rsp)
vpbroadcastw 0x832cb(%rip), %ymm0 # 0x62fe02
vmovdqu %ymm0, 0xb0(%rsp)
vpbroadcastw 0x832bb(%rip), %ymm0 # 0x62fe04
vmovdqu %ymm0, 0x250(%rsp)
movl 0x70(%rsp), %eax
movq %rax, 0x50(%rsp)
vpbroadcastw 0x832a2(%rip), %ymm15 # 0x62fe06
shlq $0x5, %r13
vpbroadcastw 0x83297(%rip), %ymm6 # 0x62fe08
xorl %ebp, %ebp
vpbroadcastw 0x8328e(%rip), %ymm0 # 0x62fe0a
vmovdqu %ymm0, 0x1b0(%rsp)
movl %esi, %eax
movq %rax, 0x48(%rsp)
vpxor %xmm12, %xmm12, %xmm12
xorl %r9d, %r9d
xorl %eax, %eax
vmovdqu 0xf0(%rsp), %ymm9
vmovdqu 0x90(%rsp), %ymm0
vmovdqa %ymm0, %ymm10
vmovdqa %ymm0, %ymm14
vmovdqu %ymm0, 0x170(%rsp)
vmovdqu 0x110(%rsp), %ymm11
movq %r8, 0x40(%rsp)
vmovdqu %ymm15, 0x190(%rsp)
vmovdqu %ymm6, 0x1d0(%rsp)
vmovdqu %ymm14, 0x70(%rsp)
movq 0x28(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x30(%rsp), %rdx
movzbl (%rdx,%r9), %edx
movslq (%rcx,%rdx,4), %rcx
imulq 0x48(%rsp), %rcx
shlq $0x5, %rcx
addq 0x60(%rsp), %rcx
movq 0x58(%rsp), %rdx
vmovdqa (%rdx), %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]
xorl %edx, %edx
vmovdqu 0x90(%rsp), %ymm0
vpxor %xmm1, %xmm1, %xmm1
vpaddsw (%rcx,%rdx), %ymm2, %ymm2
vmovdqa (%r12,%rdx), %ymm3
vmovdqa (%r14,%rdx), %ymm4
vpsubsw %ymm7, %ymm3, %ymm5
vpsubsw %ymm8, %ymm4, %ymm4
vpcmpgtw %ymm4, %ymm5, %ymm6
vmovdqu 0xb0(%rsp), %ymm13
vpblendvb %ymm6, 0xd0(%rsp), %ymm13, %ymm6
movq 0x10(%rbx), %rsi
movq (%rsi), %rsi
addq %rbp, %rsi
vpaddsw (%rdi,%rdx), %ymm1, %ymm1
vpmaxsw %ymm1, %ymm0, %ymm0
vmovdqa %ymm6, (%rdx,%rsi)
vpmaxsw %ymm4, %ymm5, %ymm4
vpmaxsw %ymm2, %ymm4, %ymm1
vmovdqa %ymm4, (%r14,%rdx)
vmovdqa %ymm1, (%r15,%rdx)
vmovdqa %ymm2, (%r12,%rdx)
addq $0x20, %rdx
vmovdqa %ymm3, %ymm2
cmpq %rdx, %r13
jne 0x5acc29
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 (%rdi), %ymm1, %ymm2
vpmaxsw %ymm2, %ymm0, %ymm0
movl $0xe, %ecx
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, %ymm11, %ymm2
vpmaxsw %ymm2, %ymm0, %ymm0
decl %ecx
jne 0x5accb3
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 0x1f0(%rsp), %ymm0, %ymm0
vpmaxsw %ymm1, %ymm12, %ymm1
vpmaxsw %ymm1, %ymm0, %ymm1
xorl %ecx, %ecx
vmovdqu 0x1d0(%rsp), %ymm6
vpxor %xmm13, %xmm13, %xmm13
vmovdqu 0x1b0(%rsp), %ymm12
vmovdqu 0x70(%rsp), %ymm14
movq 0x10(%rbx), %rdx
vpsubsw %ymm7, %ymm1, %ymm1
vpsubsw %ymm8, %ymm0, %ymm2
vpmaxsw %ymm2, %ymm1, %ymm0
vpcmpgtw %ymm2, %ymm1, %ymm1
vpblendvb %ymm1, 0x250(%rsp), %ymm15, %ymm2
vpmaxsw (%r15,%rcx), %ymm0, %ymm3
movq (%rdx), %rdx
vpmaxsw %ymm3, %ymm13, %ymm1
vpcmpeqw (%r12,%rcx), %ymm1, %ymm4
vpcmpeqw %ymm0, %ymm1, %ymm5
vpsubw %ymm5, %ymm6, %ymm5
vpblendvb %ymm4, %ymm12, %ymm5, %ymm4
addq %rbp, %rdx
vpcmpgtw %ymm13, %ymm3, %ymm3
vpor (%rcx,%rdx), %ymm2, %ymm2
vpand %ymm4, %ymm3, %ymm3
vpor %ymm3, %ymm2, %ymm2
vmovdqa %ymm2, (%rcx,%rdx)
vmovdqa %ymm1, (%r12,%rcx)
vpminsw %ymm1, %ymm9, %ymm9
vpmaxsw %ymm1, %ymm10, %ymm10
vpmaxsw %ymm1, %ymm14, %ymm14
addq $0x20, %rcx
cmpq %rcx, %r13
jne 0x5acd07
vpcmpgtw 0x170(%rsp), %ymm14, %ymm0
vpmovmskb %ymm0, %ecx
testl %ecx, %ecx
je 0x5ace60
vpermq $0x44, %ymm14, %ymm0    # ymm0 = ymm14[0,1,0,1]
vpmaxsw %ymm0, %ymm14, %ymm0
vmovdqu %ymm14, 0x70(%rsp)
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, 0x4(%rsp)
vpshufhw $0xff, %ymm0, %ymm0     # ymm0 = ymm0[0,1,2,3,7,7,7,7,8,9,10,11,15,15,15,15]
vpbroadcastd 0x810f6(%rip), %ymm1 # 0x62ded0
vpermd %ymm0, %ymm1, %ymm0
vmovdqu %ymm0, 0x170(%rsp)
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r8, %rdx
vmovdqu %ymm9, 0x230(%rsp)
vmovdqu %ymm10, 0x210(%rsp)
movq %r9, 0x68(%rsp)
vzeroupper
callq 0x19e0c0
vmovdqu 0x70(%rsp), %ymm14
movq 0x68(%rsp), %r9
vmovdqu 0x190(%rsp), %ymm15
movq 0x40(%rsp), %r8
vmovdqu 0x110(%rsp), %ymm11
vmovdqu 0x210(%rsp), %ymm10
vmovdqu 0x230(%rsp), %ymm9
vmovdqu 0x130(%rsp), %ymm8
vmovdqu 0x150(%rsp), %ymm7
movq 0x20(%rsp), %rdi
movl %r9d, %eax
incq %r9
addq %r8, %rbp
cmpq 0x50(%rsp), %r9
vpxor %xmm12, %xmm12, %xmm12
jne 0x5acbd9
movq 0x38(%rsp), %rdx
testl $0x7ffffff0, %edx       # imm = 0x7FFFFFF0
je 0x5acf3a
andl $0x7ffffff0, %edx       # imm = 0x7FFFFFF0
movl 0x4(%rsp), %r8d
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %r13
je 0x5acf7d
vmovd %r9d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovd %r8d, %xmm1
vpbroadcastw %xmm1, %xmm1
vmovd 0x8(%rsp), %xmm2
vpbroadcastd %xmm2, %ymm2
vpmovsxbd 0x80ed6(%rip), %ymm3 # 0x62dda0
xorl %ecx, %ecx
vpbroadcastd 0x80fff(%rip), %ymm4 # 0x62ded4
vpbroadcastd 0x80e02(%rip), %ymm5 # 0x62dce0
vpcmpeqw (%r13,%rcx,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, %rcx
vpaddd %ymm5, %ymm3, %ymm3
cmpq %rcx, %rdx
jne 0x5acede
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, %r9d
jmp 0x5acfb9
movl 0x4(%rsp), %r8d
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %r13
jmp 0x5acfb9
callq 0x1f8a69
jmp 0x5ad032
callq 0x1f8a43
jmp 0x5ad032
callq 0x1f8a1d
jmp 0x5ad032
callq 0x1f89f7
jmp 0x5ad032
callq 0x1f89d1
jmp 0x5ad032
movq 0x8(%rsp), %r11
movl %r11d, %ecx
andl $0x7ffffff, %ecx        # imm = 0x7FFFFFF
shll $0x4, %ecx
xorl %edx, %edx
cmpw %r8w, (%r13,%rdx,2)
jne 0x5acfb2
movl %edx, %esi
shrl $0x4, %esi
movl %edx, %r10d
andl $0xf, %r10d
imull %r11d, %r10d
orl %esi, %r10d
cmpl %r9d, %r10d
cmovll %r10d, %r9d
incq %rdx
cmpl %edx, %ecx
jne 0x5acf90
vmovdqu 0x90(%rsp), %ymm0
vpcmpgtw %ymm9, %ymm0, %ymm0
vpcmpgtw 0xf0(%rsp), %ymm10, %ymm1
vpor %ymm1, %ymm0, %ymm0
vpmovmskb %ymm0, %ecx
testl %ecx, %ecx
je 0x5acfe8
orb $0x40, 0xc(%rbx)
xorl %r8d, %r8d
xorl %eax, %eax
xorl %r9d, %r9d
movswl %r8w, %ecx
movl %ecx, (%rbx)
movl %r9d, 0x4(%rbx)
movl %eax, 0x8(%rbx)
vzeroupper
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
jmp 0x5ad034
callq 0x1f89ab
jmp 0x5ad032
callq 0x1f8985
jmp 0x5ad032
callq 0x1f895f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)