// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_trace_scan_avx2_256_16.c
// Function: parasail_nw_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 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;
    __m256i* restrict pvP = NULL;
    __m256i* restrict pvE = NULL;
    int16_t* restrict boundary = NULL;
    __m256i* restrict pvHt = NULL;
    __m256i* restrict pvH = 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 vNegInfFront;
    __m256i vSegLenXgap;
    parasail_result_t *result = NULL;
    __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;
    k = 0;
    s1Len = profile->s1Len;
    end_query = s1Len-1;
    end_ref = s2Len-1;
    matrix = profile->matrix;
    segWidth = 16; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    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;
    vNegInfFront = vZero;
    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);
    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 */
    result = parasail_result_new_trace(segLen, s2Len, 32, sizeof(__m256i));
    if (!result) return NULL;

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

    /* initialize heap variables */
    pvE = parasail_memalign___m256i(32, segLen);
    boundary = parasail_memalign_int16_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_16_t h;
            __m256i_16_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = -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;
            }
            _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 = -open-gap*(i-1);
            boundary[i] = tmp < INT16_MIN ? INT16_MIN : tmp;
        }
    }

    {
        __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 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);
        vHp = _mm256_insert_epi16_rpl(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm256_subs_epi16(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);
            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);
            vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vE);
            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);
        vHt = _mm256_insert_epi16_rpl(vHt, boundary[j+1], 0);
        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);
        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);
            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_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);
            vSaturationCheckMin = _mm256_min_epi16(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm256_max_epi16(vSaturationCheckMax, vH);
        }
    }

    /* 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, 2);
        }
        score = (int16_t) _mm256_extract_epi16_rpl (vH, 15);
    }

    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(pvH);
    parasail_free(pvHt);
    parasail_free(boundary);
    parasail_free(pvE);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, 0x28(%rsp)
testq %rdi, %rdi
je 0x5ab591
movq 0x30(%rdi), %rax
movq %rax, 0x58(%rsp)
testq %rax, %rax
je 0x5ab598
movq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x5ab59f
movl 0x8(%rdi), %r12d
testl %r12d, %r12d
jle 0x5ab5a6
cmpq $0x0, 0x28(%rsp)
je 0x5ab5ad
movl %edx, %r9d
testl %edx, %edx
jle 0x5ab5b4
testl %ecx, %ecx
js 0x5ab5bb
testl %r8d, %r8d
js 0x5ab5c2
movl %r8d, 0xa0(%rsp)
leal -0x1(%r12), %ebp
addq $0xf, %r12
shrq $0x4, %r12
movl %ebp, %eax
xorl %edx, %edx
divl %r12d
movl %eax, %r14d
movl %edx, %r15d
movl %ecx, %r13d
negl %r13d
movq 0x20(%rsp), %rdx
movl 0x20(%rdx), %eax
movl %eax, %esi
negl %esi
cmpl %r13d, %eax
movl %ecx, 0x30(%rsp)
cmovgl %ecx, %esi
movl %esi, 0x80(%rsp)
movw $0x7ffe, %ax            # imm = 0x7FFE
subw 0x1c(%rdx), %ax
movl %eax, 0xc0(%rsp)
movl $0x20, %edx
movl $0x20, %ecx
movl %r12d, %edi
movl %r9d, %esi
movq %r9, 0x60(%rsp)
callq 0x20adf4
testq %rax, %rax
je 0x5ab5c7
movq %rax, %rbx
movl %r13d, 0x10(%rsp)
movl %r15d, 0x1c(%rsp)
movl %r14d, 0x14(%rsp)
movl %ebp, 0x18(%rsp)
orl $0x10280401, 0xc(%rax)  # imm = 0x10280401
movl $0x20, %edi
movq %r12, %rsi
callq 0x4f1904
movq %rax, %r15
movq 0x60(%rsp), %rax
leal 0x1(%rax), %esi
movl $0x20, %edi
callq 0x20a625
movq %rax, %r13
movl $0x20, %edi
movq %r12, %rsi
callq 0x4f1904
movq %rax, %rbp
movl $0x20, %edi
movq %r12, %rsi
callq 0x4f1904
movq %rax, %r14
movl $0x20, %edi
movq %r12, %rsi
callq 0x4f1904
testq %r15, %r15
sete %cl
testq %r13, %r13
sete %dl
orb %cl, %dl
testq %rbp, %rbp
sete %cl
testq %r14, %r14
sete %sil
orb %cl, %sil
orb %dl, %sil
testq %rax, %rax
sete %cl
orb %sil, %cl
jne 0x5ab5c7
movq 0x60(%rsp), %r10
leal -0x1(%r10), %ecx
movl %ecx, 0xc(%rsp)
movl $0xf, %edx
subl 0x14(%rsp), %edx
movl 0x30(%rsp), %esi
vmovd %esi, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x100(%rsp)
movl 0xa0(%rsp), %r11d
vmovd %r11d, %xmm0
vpbroadcastw %xmm0, %ymm3
movl 0x80(%rsp), %ecx
addl $0xffff8001, %ecx       # imm = 0xFFFF8001
vmovd %ecx, %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0x80(%rsp)
vmovd 0xc0(%rsp), %xmm0
vpbroadcastw %xmm0, %ymm0
vmovdqu %ymm0, 0xe0(%rsp)
movzwl %cx, %ecx
vmovd %ecx, %xmm1
movl %r12d, %ecx
imull %r11d, %ecx
negl %ecx
vmovd %ecx, %xmm0
vpbroadcastw %xmm0, %ymm0
vpand 0x831a3(%rip), %ymm0, %ymm0 # 0x62ddc0
vmovdqu %ymm1, 0xc0(%rsp)
vpaddsw %ymm0, %ymm1, %ymm0
vmovdqu %ymm0, 0x120(%rsp)
movl %esi, %ecx
movl %r12d, %esi
movl %r11d, %edi
movslq 0x10(%rsp), %r8
vmovq %rdi, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovq %r8, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovq %rcx, %xmm9
vmovq %rsi, %xmm4
vpbroadcastq %xmm4, %ymm8
vpmuldq 0x83174(%rip), %ymm8, %ymm2 # 0x62dde0
vpmuldq 0x8318b(%rip), %ymm8, %ymm5 # 0x62de00
vpmuldq 0x82fc2(%rip), %ymm8, %ymm4 # 0x62dc40
vmovdqu %ymm4, 0x30(%rsp)
vpmuldq 0x82eb3(%rip), %ymm8, %ymm8 # 0x62db40
vpbroadcastq %xmm9, %ymm9
xorl %edi, %edi
vpbroadcastq 0x831a3(%rip), %ymm10 # 0x62de40
vpxor %xmm11, %xmm11, %xmm11
movq %r14, %r8
movq %r15, %r9
vmovq %rdi, %xmm12
vpbroadcastq %xmm12, %ymm12
vpaddq 0x30(%rsp), %ymm12, %ymm13
vpaddq %ymm12, %ymm8, %ymm14
vpaddq %ymm5, %ymm12, %ymm15
vpaddq %ymm2, %ymm12, %ymm12
vpmuludq %ymm0, %ymm12, %ymm4
vpsrlq $0x20, %ymm12, %ymm12
vpmuludq %ymm0, %ymm12, %ymm12
vpsllq $0x20, %ymm12, %ymm12
vpaddq %ymm4, %ymm12, %ymm4
vpmuludq %ymm0, %ymm15, %ymm12
vpsrlq $0x20, %ymm15, %ymm15
vpmuludq %ymm0, %ymm15, %ymm15
vpsllq $0x20, %ymm15, %ymm15
vpaddq %ymm15, %ymm12, %ymm12
vpmuludq %ymm0, %ymm14, %ymm15
vpsrlq $0x20, %ymm14, %ymm14
vpmuludq %ymm0, %ymm14, %ymm14
vpsllq $0x20, %ymm14, %ymm14
vpaddq %ymm14, %ymm15, %ymm14
vpmuludq %ymm0, %ymm13, %ymm15
vpsrlq $0x20, %ymm13, %ymm13
vpmuludq %ymm0, %ymm13, %ymm13
vpsllq $0x20, %ymm13, %ymm13
vpaddq %ymm13, %ymm15, %ymm13
vpsubq %ymm4, %ymm1, %ymm4
vpcmpgtq %ymm10, %ymm4, %ymm15
vblendvpd %ymm15, %ymm4, %ymm10, %ymm15
vpsubq %ymm14, %ymm1, %ymm14
vpcmpgtq %ymm10, %ymm14, %ymm6
vblendvpd %ymm6, %ymm14, %ymm10, %ymm6
vpsubq %ymm13, %ymm1, %ymm13
vpcmpgtq %ymm10, %ymm13, %ymm7
vblendvpd %ymm7, %ymm13, %ymm10, %ymm7
vpsubq %ymm12, %ymm1, %ymm12
vpblendw $0x11, %ymm7, %ymm11, %ymm7 # ymm7 = ymm7[0],ymm11[1,2,3],ymm7[4],ymm11[5,6,7],ymm7[8],ymm11[9,10,11],ymm7[12],ymm11[13,14,15]
vpblendw $0x11, %ymm6, %ymm11, %ymm6 # ymm6 = ymm6[0],ymm11[1,2,3],ymm6[4],ymm11[5,6,7],ymm6[8],ymm11[9,10,11],ymm6[12],ymm11[13,14,15]
vpackusdw %ymm7, %ymm6, %ymm6
vpcmpgtq %ymm10, %ymm12, %ymm7
vblendvpd %ymm7, %ymm12, %ymm10, %ymm7
vpblendw $0x11, %ymm7, %ymm11, %ymm7 # ymm7 = ymm7[0],ymm11[1,2,3],ymm7[4],ymm11[5,6,7],ymm7[8],ymm11[9,10,11],ymm7[12],ymm11[13,14,15]
vpblendw $0x11, %ymm15, %ymm11, %ymm15 # ymm15 = ymm15[0],ymm11[1,2,3],ymm15[4],ymm11[5,6,7],ymm15[8],ymm11[9,10,11],ymm15[12],ymm11[13,14,15]
vpackusdw %ymm15, %ymm7, %ymm7
vpsubq %ymm9, %ymm13, %ymm13
vpsubq %ymm9, %ymm14, %ymm14
vpsubq %ymm9, %ymm4, %ymm4
vpcmpgtq %ymm10, %ymm4, %ymm15
vblendvpd %ymm15, %ymm4, %ymm10, %ymm4
vpsubq %ymm9, %ymm12, %ymm12
vpcmpgtq %ymm10, %ymm12, %ymm15
vblendvpd %ymm15, %ymm12, %ymm10, %ymm12
vpcmpgtq %ymm10, %ymm14, %ymm15
vblendvpd %ymm15, %ymm14, %ymm10, %ymm14
vpcmpgtq %ymm10, %ymm13, %ymm15
vblendvpd %ymm15, %ymm13, %ymm10, %ymm13
vpermq $0xd8, %ymm6, %ymm6     # ymm6 = ymm6[0,2,1,3]
vpermq $0xd8, %ymm7, %ymm7     # ymm7 = ymm7[0,2,1,3]
vpackusdw %ymm7, %ymm6, %ymm6
vpblendw $0x11, %ymm13, %ymm11, %ymm7 # ymm7 = ymm13[0],ymm11[1,2,3],ymm13[4],ymm11[5,6,7],ymm13[8],ymm11[9,10,11],ymm13[12],ymm11[13,14,15]
vpblendw $0x11, %ymm14, %ymm11, %ymm13 # ymm13 = ymm14[0],ymm11[1,2,3],ymm14[4],ymm11[5,6,7],ymm14[8],ymm11[9,10,11],ymm14[12],ymm11[13,14,15]
vpackusdw %ymm7, %ymm13, %ymm7
vpblendw $0x11, %ymm12, %ymm11, %ymm12 # ymm12 = ymm12[0],ymm11[1,2,3],ymm12[4],ymm11[5,6,7],ymm12[8],ymm11[9,10,11],ymm12[12],ymm11[13,14,15]
vpblendw $0x11, %ymm4, %ymm11, %ymm4 # ymm4 = ymm4[0],ymm11[1,2,3],ymm4[4],ymm11[5,6,7],ymm4[8],ymm11[9,10,11],ymm4[12],ymm11[13,14,15]
vpackusdw %ymm4, %ymm12, %ymm4
vpermq $0xd8, %ymm6, %ymm6     # ymm6 = ymm6[0,2,1,3]
vmovdqa %ymm6, (%r8)
vpermq $0xd8, %ymm7, %ymm6     # ymm6 = ymm7[0,2,1,3]
vpermq $0xd8, %ymm4, %ymm4     # ymm4 = ymm4[0,2,1,3]
vpackusdw %ymm4, %ymm6, %ymm4
vpermq $0xd8, %ymm4, %ymm4     # ymm4 = ymm4[0,2,1,3]
vmovdqa %ymm4, (%r9)
incq %rdi
addq $0x20, %r9
addq $0x20, %r8
cmpq %rdi, %r12
jne 0x5aaca8
movw $0x0, (%r13)
movl %r10d, %edi
addl $0xf, %r10d
andl $-0x10, %r10d
leaq -0x1(%rdi), %rcx
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm6
vmovd %r11d, %xmm0
vpbroadcastd %xmm0, %ymm5
vmovss 0x10(%rsp), %xmm0
vbroadcastss %xmm0, %ymm0
vmovups %ymm0, 0x60(%rsp)
vpmovsxbd 0x82fcd(%rip), %ymm9 # 0x62de48
vpmovsxbd 0x82e4c(%rip), %ymm10 # 0x62dcd0
xorl %r8d, %r8d
vpbroadcastq 0x82cf0(%rip), %xmm15 # 0x62db80
vpcmpeqd %xmm1, %xmm1, %xmm1
vpcmpeqd %ymm4, %ymm4, %ymm4
vbroadcastss 0x82faf(%rip), %ymm0 # 0x62de50
vmovups %ymm0, 0xa0(%rsp)
vpbroadcastq 0x82ccd(%rip), %ymm13 # 0x62db80
vpbroadcastd 0x82d04(%rip), %xmm0 # 0x62dbc0
vmovdqu %ymm0, 0x30(%rsp)
vpbroadcastd 0x82f89(%rip), %ymm2 # 0x62de54
vmovq %r8, %xmm7
vpbroadcastq %xmm7, %ymm12
vpor 0x82c63(%rip), %ymm12, %ymm11 # 0x62db40
vpxor %xmm6, %xmm15, %xmm7
vpxor %xmm15, %xmm11, %xmm8
vpcmpgtq %xmm7, %xmm8, %xmm7
vpackssdw %xmm7, %xmm7, %xmm7
vpxor %xmm1, %xmm7, %xmm7
vpackssdw %xmm7, %xmm7, %xmm7
vpacksswb %xmm7, %xmm7, %xmm7
vpaddd %ymm4, %ymm10, %ymm8
vpaddd %ymm4, %ymm9, %ymm14
vpmulld %ymm5, %ymm14, %ymm14
vpmulld %ymm5, %ymm8, %ymm8
vmovdqu 0x60(%rsp), %ymm0
vpsubd %ymm8, %ymm0, %ymm8
vpsubd %ymm14, %ymm0, %ymm14
vmovdqu 0xa0(%rsp), %ymm0
vpmaxsd %ymm0, %ymm14, %ymm14
vpmaxsd %ymm0, %ymm8, %ymm8
vpxor %xmm0, %xmm0, %xmm0
vpblendw $0xaa, %ymm0, %ymm8, %ymm8 # ymm8 = ymm8[0],ymm0[1],ymm8[2],ymm0[3],ymm8[4],ymm0[5],ymm8[6],ymm0[7],ymm8[8],ymm0[9],ymm8[10],ymm0[11],ymm8[12],ymm0[13],ymm8[14],ymm0[15]
vpblendw $0xaa, %ymm0, %ymm14, %ymm14 # ymm14 = ymm14[0],ymm0[1],ymm14[2],ymm0[3],ymm14[4],ymm0[5],ymm14[6],ymm0[7],ymm14[8],ymm0[9],ymm14[10],ymm0[11],ymm14[12],ymm0[13],ymm14[14],ymm0[15]
vpackusdw %ymm14, %ymm8, %ymm8
vpermq $0xd8, %ymm8, %ymm8     # ymm8 = ymm8[0,2,1,3]
vmovd %xmm7, %ecx
testb $0x1, %cl
je 0x5aaf5c
vpextrw $0x0, %xmm8, 0x2(%r13,%r8,2)
vpxor %xmm6, %xmm15, %xmm7
vpxor %xmm15, %xmm11, %xmm14
vpcmpgtq %xmm7, %xmm14, %xmm7
vpackssdw %xmm7, %xmm7, %xmm7
vpxor %xmm1, %xmm7, %xmm7
vpackssdw %xmm7, %xmm7, %xmm7
vpacksswb %xmm7, %xmm7, %xmm7
vpextrb $0x1, %xmm7, %ecx
testb $0x1, %cl
je 0x5aaf8d
vpextrw $0x1, %xmm8, 0x4(%r13,%r8,2)
vpxor %ymm6, %ymm13, %ymm7
vpxor %ymm13, %ymm11, %ymm11
vpcmpgtq %ymm7, %ymm11, %ymm11
vpshuflw $0xe8, %ymm11, %ymm14   # ymm14 = ymm11[0,2,2,3,4,5,6,7,8,10,10,11,12,13,14,15]
vpxor %ymm4, %ymm14, %ymm14
vmovdqu 0x30(%rsp), %ymm0
vpermd %ymm14, %ymm0, %ymm14
vpackssdw %xmm14, %xmm14, %xmm14
vpacksswb %xmm14, %xmm14, %xmm14
vpextrb $0x2, %xmm14, %ecx
testb $0x1, %cl
je 0x5aafcd
vpextrw $0x2, %xmm8, 0x6(%r13,%r8,2)
vextracti128 $0x1, %ymm11, %xmm11
vpackssdw %xmm11, %xmm11, %xmm11
vpxor %xmm1, %xmm11, %xmm11
vpackssdw %xmm11, %xmm11, %xmm11
vpacksswb %xmm11, %xmm11, %xmm11
vpextrb $0x3, %xmm11, %ecx
testb $0x1, %cl
je 0x5aaff9
vpextrw $0x3, %xmm8, 0x8(%r13,%r8,2)
vpor 0x82c3f(%rip), %ymm12, %ymm11 # 0x62dc40
vpxor %xmm6, %xmm15, %xmm14
vpxor %xmm15, %xmm11, %xmm0
vpcmpgtq %xmm14, %xmm0, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm0
vpermq $0x55, %ymm0, %ymm0     # ymm0 = ymm0[1,1,1,1]
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0x8, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab03e
vpextrw $0x4, %xmm8, 0xa(%r13,%r8,2)
vpxor %xmm6, %xmm15, %xmm0
vpxor %xmm15, %xmm11, %xmm14
vpcmpgtq %xmm0, %xmm14, %xmm0
vpshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
vpxor %xmm1, %xmm0, %xmm0
vpermq $0x55, %ymm0, %ymm0     # ymm0 = ymm0[1,1,1,1]
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0x9, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab07c
vpextrw $0x5, %xmm8, 0xc(%r13,%r8,2)
vpxor %ymm13, %ymm11, %ymm0
vpcmpgtq %ymm7, %ymm0, %ymm11
vpackssdw %ymm11, %ymm0, %ymm0
vpxor %ymm4, %ymm0, %ymm0
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0xa, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab0b0
vpextrw $0x6, %xmm8, 0xe(%r13,%r8,2)
vpackssdw %ymm11, %ymm0, %ymm0
vpxor %ymm4, %ymm0, %ymm0
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0xb, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab0da
vpextrw $0x7, %xmm8, 0x10(%r13,%r8,2)
vpor 0x82d1e(%rip), %ymm12, %ymm11 # 0x62de00
vpxor %xmm6, %xmm15, %xmm0
vpxor %xmm15, %xmm11, %xmm14
vpcmpgtq %xmm0, %xmm14, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0x4, %xmm0, %ecx
vextracti128 $0x1, %ymm8, %xmm8
testb $0x1, %cl
je 0x5ab119
vpextrw $0x0, %xmm8, 0x12(%r13,%r8,2)
vpxor %xmm6, %xmm15, %xmm0
vpxor %xmm15, %xmm11, %xmm14
vpcmpgtq %xmm0, %xmm14, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0x5, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab14a
vpextrw $0x1, %xmm8, 0x14(%r13,%r8,2)
vpxor %ymm13, %ymm11, %ymm0
vpcmpgtq %ymm7, %ymm0, %ymm11
vpshuflw $0xe8, %ymm11, %ymm0    # ymm0 = ymm11[0,2,2,3,4,5,6,7,8,10,10,11,12,13,14,15]
vpxor %ymm4, %ymm0, %ymm0
vmovdqu 0x30(%rsp), %ymm14
vpermd %ymm0, %ymm14, %ymm0
vpackssdw %xmm0, %xmm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0x6, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab184
vpextrw $0x2, %xmm8, 0x16(%r13,%r8,2)
vextracti128 $0x1, %ymm11, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0x7, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab1ad
vpextrw $0x3, %xmm8, 0x18(%r13,%r8,2)
vpor 0x82c2b(%rip), %ymm12, %ymm11 # 0x62dde0
vpxor %xmm6, %xmm15, %xmm0
vpxor %xmm15, %xmm11, %xmm12
vpcmpgtq %xmm0, %xmm12, %xmm0
vpackssdw %xmm0, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm0
vpermq $0x55, %ymm0, %ymm0     # ymm0 = ymm0[1,1,1,1]
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0xc, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab1f2
vpextrw $0x4, %xmm8, 0x1a(%r13,%r8,2)
vpxor %xmm6, %xmm15, %xmm0
vpxor %xmm15, %xmm11, %xmm12
vpcmpgtq %xmm0, %xmm12, %xmm0
vpshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
vpxor %xmm1, %xmm0, %xmm0
vpermq $0x55, %ymm0, %ymm0     # ymm0 = ymm0[1,1,1,1]
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0xd, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab230
vpextrw $0x5, %xmm8, 0x1c(%r13,%r8,2)
vpxor %ymm13, %ymm11, %ymm0
vpcmpgtq %ymm7, %ymm0, %ymm7
vpackssdw %ymm7, %ymm0, %ymm0
vpxor %ymm4, %ymm0, %ymm0
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0xe, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab263
vpextrw $0x6, %xmm8, 0x1e(%r13,%r8,2)
vpackssdw %ymm7, %ymm0, %ymm0
vpxor %ymm4, %ymm0, %ymm0
vpackssdw %ymm0, %ymm0, %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpacksswb %xmm0, %xmm0, %xmm0
vpextrb $0xf, %xmm0, %ecx
testb $0x1, %cl
je 0x5ab28c
vpextrw $0x7, %xmm8, 0x20(%r13,%r8,2)
addq $0x10, %r8
vpaddd %ymm2, %ymm10, %ymm10
vpaddd %ymm2, %ymm9, %ymm9
cmpq %r8, %r10
jne 0x5aaecb
movl %edx, 0x60(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vmovdqu 0x100(%rsp), %ymm14
vpsubsw %ymm14, %ymm0, %ymm0
leal -0x1(%r12), %ecx
shlq $0x5, %rcx
movq %rax, %r8
addq %rcx, %r8
movl %r12d, %r9d
vmovdqa %ymm0, (%r8)
vpsubsw %ymm3, %ymm0, %ymm0
addq $-0x20, %r8
decl %r9d
jg 0x5ab2c9
vpbroadcastw 0x84aaa(%rip), %ymm7 # 0x62fd8e
movq %r14, %r8
vpbroadcastw 0x84aa0(%rip), %ymm6 # 0x62fd90
addq %rcx, %r8
vpbroadcastw 0x84a96(%rip), %ymm4 # 0x62fd92
shlq $0x5, %r12
vpbroadcastw 0x84a8b(%rip), %ymm8 # 0x62fd94
xorl %r9d, %r9d
vpbroadcastw 0x84a81(%rip), %ymm9 # 0x62fd96
vpbroadcastw 0x84a7a(%rip), %ymm10 # 0x62fd98
xorl %r10d, %r10d
vmovdqu 0x80(%rsp), %ymm0
vmovdqu 0xe0(%rsp), %ymm1
vmovdqu %ymm4, 0x30(%rsp)
vmovdqa (%r8), %ymm11
vinserti128 $0x1, %xmm11, %ymm0, %ymm12
vpalignr $0xe, %ymm12, %ymm11, %ymm11 # ymm11 = ymm12[14,15],ymm11[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm12[30,31],ymm11[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpinsrw $0x0, (%r13,%r10,2), %xmm11, %xmm12
vpblendd $0xf, %ymm12, %ymm11, %ymm13 # ymm13 = ymm12[0,1,2,3],ymm11[4,5,6,7]
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x28(%rsp), %rdx
movzbl (%rdx,%r10), %r11d
movslq (%rcx,%r11,4), %r11
imulq %rsi, %r11
shlq $0x5, %r11
addq 0x58(%rsp), %r11
vmovdqu 0x80(%rsp), %ymm11
vpsubsw (%rax), %ymm11, %ymm12
xorl %ecx, %ecx
vmovdqa %ymm14, %ymm4
vpaddsw (%r11,%rcx), %ymm13, %ymm13
vmovdqa (%r14,%rcx), %ymm14
vmovdqa (%r15,%rcx), %ymm15
vpsubsw %ymm4, %ymm14, %ymm5
vpsubsw %ymm3, %ymm15, %ymm15
vpcmpgtw %ymm15, %ymm5, %ymm2
vpblendvb %ymm2, %ymm7, %ymm6, %ymm2
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r9, %rdx
vpaddsw (%rax,%rcx), %ymm12, %ymm12
vmovdqa %ymm2, (%rcx,%rdx)
vpmaxsw %ymm12, %ymm11, %ymm11
vpmaxsw %ymm5, %ymm15, %ymm2
vpminsw %ymm2, %ymm1, %ymm1
vpmaxsw %ymm2, %ymm13, %ymm12
vmovdqa %ymm2, (%r15,%rcx)
vmovdqa %ymm12, (%rbp,%rcx)
vmovdqa %ymm13, (%r14,%rcx)
addq $0x20, %rcx
vmovdqa %ymm14, %ymm13
cmpq %rcx, %r12
jne 0x5ab38f
vinserti128 $0x1, %xmm12, %ymm0, %ymm2
vpalignr $0xe, %ymm2, %ymm12, %ymm2 # ymm2 = ymm2[14,15],ymm12[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm2[30,31],ymm12[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpinsrw $0x0, 0x2(%r13,%r10,2), %xmm2, %xmm5
incq %r10
vpblendd $0xf, %ymm5, %ymm2, %ymm12 # ymm12 = ymm5[0,1,2,3],ymm2[4,5,6,7]
vpaddsw (%rax), %ymm12, %ymm2
vpmaxsw %ymm2, %ymm11, %ymm11
movl $0xe, %ecx
vmovdqu 0x120(%rsp), %ymm4
vperm2i128 $0x28, %ymm11, %ymm11, %ymm2 # ymm2 = zero,zero,ymm11[0,1]
vpalignr $0xe, %ymm2, %ymm11, %ymm2 # ymm2 = ymm2[14,15],ymm11[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm2[30,31],ymm11[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpaddsw %ymm4, %ymm2, %ymm2
vpmaxsw %ymm2, %ymm11, %ymm11
decl %ecx
jne 0x5ab42c
vperm2i128 $0x28, %ymm11, %ymm11, %ymm2 # ymm2 = zero,zero,ymm11[0,1]
vpalignr $0xe, %ymm2, %ymm11, %ymm2 # ymm2 = ymm2[14,15],ymm11[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm2[30,31],ymm11[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
vpaddsw 0xc0(%rsp), %ymm2, %ymm11
vpmaxsw %ymm12, %ymm11, %ymm12
xorl %ecx, %ecx
vmovdqu 0x100(%rsp), %ymm14
vmovdqu 0x30(%rsp), %ymm4
movq 0x10(%rbx), %rdx
movq (%rdx), %rdx
addq %r9, %rdx
vmovdqa (%rbp,%rcx), %ymm2
vpsubsw %ymm14, %ymm12, %ymm5
vpsubsw %ymm3, %ymm11, %ymm12
vpmaxsw %ymm5, %ymm12, %ymm11
vpcmpgtw %ymm12, %ymm5, %ymm5
vpblendvb %ymm5, %ymm4, %ymm8, %ymm5
vpmaxsw %ymm2, %ymm11, %ymm12
vpcmpeqw (%r14,%rcx), %ymm12, %ymm13
vpcmpgtw %ymm11, %ymm2, %ymm2
vpaddw %ymm2, %ymm9, %ymm2
vpblendvb %ymm13, %ymm10, %ymm2, %ymm2
vpor (%rcx,%rdx), %ymm5, %ymm5
vpor %ymm2, %ymm5, %ymm2
vmovdqa %ymm2, (%rcx,%rdx)
vmovdqa %ymm12, (%r14,%rcx)
vpminsw %ymm1, %ymm11, %ymm1
vpminsw %ymm1, %ymm12, %ymm1
vpmaxsw %ymm0, %ymm12, %ymm0
addq $0x20, %rcx
cmpq %rcx, %r12
jne 0x5ab46f
addq %r12, %r9
cmpq %rdi, %r10
jne 0x5ab339
movl 0x1c(%rsp), %ecx
shlq $0x5, %rcx
vmovdqa (%r14,%rcx), %ymm2
cmpl $0xe, 0x14(%rsp)
jg 0x5ab518
xorl %ecx, %ecx
movl 0xc(%rsp), %esi
movl 0x60(%rsp), %edx
vperm2i128 $0x28, %ymm2, %ymm2, %ymm3 # ymm3 = zero,zero,ymm2[0,1]
vpalignr $0xe, %ymm3, %ymm2, %ymm2 # ymm2 = ymm3[14,15],ymm2[0,1,2,3,4,5,6,7,8,9,10,11,12,13],ymm3[30,31],ymm2[16,17,18,19,20,21,22,23,24,25,26,27,28,29]
incl %ecx
cmpl %edx, %ecx
jl 0x5ab504
jmp 0x5ab51c
movl 0xc(%rsp), %esi
vmovdqu 0x80(%rsp), %ymm3
vpcmpgtw %ymm1, %ymm3, %ymm1
vpcmpgtw 0xe0(%rsp), %ymm0, %ymm0
vpor %ymm1, %ymm0, %ymm0
vpmovmskb %ymm0, %ecx
testl %ecx, %ecx
je 0x5ab54a
orb $0x40, 0xc(%rbx)
xorl %ecx, %ecx
xorl %esi, %esi
xorl %edx, %edx
jmp 0x5ab559
vextracti128 $0x1, %ymm2, %xmm0
vpextrw $0x7, %xmm0, %ecx
movl 0x18(%rsp), %edx
movswl %cx, %ecx
movl %ecx, (%rbx)
movl %edx, 0x4(%rbx)
movl %esi, 0x8(%rbx)
movq %rax, %rdi
vzeroupper
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq %r13, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
jmp 0x5ab5c9
callq 0x1f85f5
jmp 0x5ab5c7
callq 0x1f85cf
jmp 0x5ab5c7
callq 0x1f85a9
jmp 0x5ab5c7
callq 0x1f8583
jmp 0x5ab5c7
callq 0x1f855d
jmp 0x5ab5c7
callq 0x1f8537
jmp 0x5ab5c7
callq 0x1f8511
jmp 0x5ab5c7
callq 0x1f84eb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop