// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/sg_scan_avx2_256_64.c
// Function: parasail_sg_flags_rowcol_scan_profile_avx2_256_64
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;
    int64_t* restrict boundary = NULL;
    __m256i* restrict pvHt = NULL;
    __m256i* restrict pvH = NULL;
    __m256i* restrict pvGapper = NULL;
    __m256i vGapO;
    __m256i vGapE;
    int64_t NEG_LIMIT = 0;
    int64_t POS_LIMIT = 0;
    __m256i vZero;
    int64_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->profile64.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 = 4; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    pvP = (__m256i*)profile->profile64.score;
    vGapO = _mm256_set1_epi64x_rpl(open);
    vGapE = _mm256_set1_epi64x_rpl(gap);
    NEG_LIMIT = (-open < matrix->min ? INT64_MIN + open : INT64_MIN - matrix->min) + 1;
    POS_LIMIT = INT64_MAX - matrix->max - 1;
    vZero = _mm256_setzero_si256();
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi64x_rpl(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi64x_rpl(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vMaxH = vNegLimit;
    vPosMask = _mm256_cmpeq_epi64(_mm256_set1_epi64x_rpl(position),
            _mm256_set_epi64x_rpl(0,1,2,3));
    vNegInfFront = vZero;
    vNegInfFront = _mm256_insert_epi64_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm256_add_epi64(vNegInfFront,
            _mm256_slli_si256_rpl(_mm256_set1_epi64x_rpl(-segLen*gap), 8));

    /* 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_64 | PARASAIL_FLAG_LANES_4;
    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_int64_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_64_t h;
            __m256i_64_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = s1_beg ? 0 : (-open-gap*(segNum*segLen+i));
                h.v[segNum] = tmp < INT64_MIN ? INT64_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT64_MIN ? INT64_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 < INT64_MIN ? INT64_MIN : tmp;
        }
    }

    {
        __m256i vGapper = _mm256_sub_epi64(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm256_store_si256(pvGapper+i, vGapper);
            vGapper = _mm256_sub_epi64(vGapper, vGapE);
            /* long queries and/or large penalties will break the pseudo prefix scan */
            vSaturationCheckMin = _mm256_min_epi64_rpl(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, 8);
        vHp = _mm256_insert_epi64_rpl(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm256_sub_epi64(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_epi64_rpl(
                    _mm256_sub_epi64(vE, vGapE),
                    _mm256_sub_epi64(vH, vGapO));
            vHp = _mm256_add_epi64(vHp, vW);
            vF = _mm256_max_epi64_rpl(vF, _mm256_add_epi64(vHt, pvGapper[i]));
            vHt = _mm256_max_epi64_rpl(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, 8);
        vHt = _mm256_insert_epi64_rpl(vHt, boundary[j+1], 0);
        vF = _mm256_max_epi64_rpl(vF, _mm256_add_epi64(vHt, pvGapper[0]));
        for (i=0; i<segWidth-2; ++i) {
            __m256i vFt = _mm256_slli_si256_rpl(vF, 8);
            vFt = _mm256_add_epi64(vFt, vSegLenXgap);
            vF = _mm256_max_epi64_rpl(vF, vFt);
        }

        /* calculate final H */
        vF = _mm256_slli_si256_rpl(vF, 8);
        vF = _mm256_add_epi64(vF, vNegInfFront);
        vH = _mm256_max_epi64_rpl(vHt, vF);
        for (i=0; i<segLen; ++i) {
            vHt = _mm256_load_si256(pvHt+i);
            vF = _mm256_max_epi64_rpl(
                    _mm256_sub_epi64(vF, vGapE),
                    _mm256_sub_epi64(vH, vGapO));
            vH = _mm256_max_epi64_rpl(vHt, vF);
            _mm256_store_si256(pvH+i, vH);
            vSaturationCheckMin = _mm256_min_epi64_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm256_min_epi64_rpl(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm256_max_epi64_rpl(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_epi64(vH, vMaxH));
            vMaxH = _mm256_max_epi64_rpl(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, 8);
            }
            result->rowcols->score_row[j] = (int64_t) _mm256_extract_epi64_rpl (vH, 3);
#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, 8);
        }
        score = (int64_t) _mm256_extract_epi64_rpl(vMaxH, 3);
        end_query = s1Len-1;
    }

    /* max of last column */
    if (s1_end)
    {
        /* Trace the alignment ending position on read. */
        int64_t *t = (int64_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, 8);
            }
            score = (int64_t) _mm256_extract_epi64_rpl (vH, 3);
            end_ref = s2Len - 1;
            end_query = s1Len - 1;
        }
    }

    if (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi64_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_cmpgt_epi64(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 $0xb8, %rsp
movq %rsi, 0x58(%rsp)
testq %rdi, %rdi
je 0x54ee68
movq 0x60(%rdi), %rax
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0x54ee6f
movq 0x10(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x54ee76
movl 0x8(%rdi), %eax
movq %rax, 0x48(%rsp)
testl %eax, %eax
jle 0x54ee7d
cmpq $0x0, 0x58(%rsp)
je 0x54ee84
movl %edx, %ebx
testl %edx, %edx
jle 0x54ee8b
testl %ecx, %ecx
js 0x54ee92
testl %r8d, %r8d
js 0x54ee99
movl %r9d, %r12d
movl %r8d, 0x44(%rsp)
movq 0x48(%rsp), %rdx
leal -0x1(%rdx), %eax
leaq 0x3(%rdx), %r15
movq %r15, %r13
shrq $0x2, %r13
movl %eax, 0x1c(%rsp)
xorl %edx, %edx
divl %r13d
movl %eax, 0xc(%rsp)
movl %edx, %ebp
movl %ecx, %esi
negl %ecx
movq 0x50(%rsp), %rdx
movslq 0x20(%rdx), %rax
movq %rsi, 0x28(%rsp)
btsq $0x3f, %rsi
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
subq %rax, %r14
movl %ecx, 0x20(%rsp)
cmpl %ecx, %eax
cmovgq %rsi, %r14
movslq 0x1c(%rdx), %rax
movq %rax, 0x70(%rsp)
andl $0x7ffffffc, %r15d      # imm = 0x7FFFFFFC
movl %r15d, %edi
movl %ebx, %esi
callq 0x20ac53
testq %rax, %rax
je 0x54ee9e
movl %ebp, 0x3c(%rsp)
movq %r15, 0x60(%rsp)
movq %r14, 0x10(%rsp)
movl 0x100(%rsp), %r8d
xorl %edi, %edi
testl %r12d, %r12d
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0xf0(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0xf8(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
movl %r8d, 0x40(%rsp)
testl %r8d, %r8d
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x4840402, %ecx        # imm = 0x4840402
movq %rax, 0x30(%rsp)
movl %ecx, 0xc(%rax)
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r15
leal 0x1(%rbx), %esi
movl $0x20, %edi
callq 0x20a636
movl %r12d, 0x38(%rsp)
movq %rax, %r12
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %rbp
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
movq %rax, %r14
movl $0x20, %edi
movq %r13, %rsi
callq 0x4f1904
testq %r15, %r15
sete %cl
testq %r12, %r12
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 0x54ee9e
leal -0x1(%rbx), %ecx
movl %ecx, 0x8(%rsp)
movl $0x3, %edx
subl 0xc(%rsp), %edx
vmovq 0x28(%rsp), %xmm0
vpbroadcastq %xmm0, %ymm4
movl 0x44(%rsp), %r9d
movl %r9d, %ecx
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm5
movq 0x10(%rsp), %rdi
incq %rdi
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
subq 0x70(%rsp), %r8
addq $-0x2, %r8
movq %rdi, 0x10(%rsp)
vmovq %rdi, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovq %r8, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovdqu %ymm1, 0x70(%rsp)
movslq %edx, %rsi
vmovq %rsi, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovdqu %ymm1, 0x90(%rsp)
vmovq %xmm0, %xmm6            # xmm6 = xmm0[0],zero
movl %r13d, %esi
imull %r9d, %esi
negl %esi
movslq %esi, %rsi
vmovq %rsi, %xmm1
vpbroadcastq %xmm1, %ymm1
vpxor %xmm2, %xmm2, %xmm2
vpblendd $0x3, %ymm2, %ymm1, %ymm1 # ymm1 = ymm2[0,1],ymm1[2,3,4,5,6,7]
vpaddq %ymm1, %ymm6, %ymm7
cmpl $0x0, 0x38(%rsp)
setne %sil
movl 0x20(%rsp), %r8d
movslq %r8d, %rdi
vmovd %r13d, %xmm1
vpbroadcastd %xmm1, %ymm1
vmovq %rcx, %xmm2
vpbroadcastq %xmm2, %ymm2
vmovq %rdi, %xmm8
vpbroadcastq %xmm8, %ymm8
vpmuldq 0xdf196(%rip), %ymm1, %ymm9 # 0x62db40
vmovd %esi, %xmm1
vpbroadcastb %xmm1, %xmm1
xorl %ecx, %ecx
vpslld $0x1f, %xmm1, %xmm1
vpsrad $0x1f, %xmm1, %xmm1
vpmovsxdq %xmm1, %ymm10
movq %r14, %rsi
movq %r15, %rdi
vmovq %rcx, %xmm1
vpbroadcastq %xmm1, %ymm1
vpaddq %ymm1, %ymm9, %ymm1
vpmuludq %ymm2, %ymm1, %ymm11
vpsrlq $0x20, %ymm1, %ymm1
vpmuludq %ymm2, %ymm1, %ymm1
vpsllq $0x20, %ymm1, %ymm1
vpaddq %ymm1, %ymm11, %ymm1
vpsubq %ymm1, %ymm8, %ymm1
vpandn %ymm1, %ymm10, %ymm1
vpsubq %ymm4, %ymm1, %ymm11
vmovdqa %ymm1, (%rsi)
vmovdqa %ymm11, (%rdi)
incq %rcx
addq $0x20, %rdi
addq $0x20, %rsi
cmpq %rcx, %r13
jne 0x54e9ca
movq $0x0, (%r12)
movl %ebx, %ecx
addl $0x3, %ebx
andl $-0x4, %ebx
movq %rcx, 0x28(%rsp)
decq %rcx
vmovq %rcx, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovd %r9d, %xmm2
vpbroadcastd %xmm2, %xmm2
vmovd %r8d, %xmm8
vpbroadcastd %xmm8, %xmm8
vpmovsxbd 0xdf173(%rip), %xmm9 # 0x62dbc4
xorl %ecx, %ecx
vpmovsxbq 0xdf16c(%rip), %ymm10 # 0x62dbc8
vpbroadcastq 0xdf11b(%rip), %ymm11 # 0x62db80
vpxor %ymm1, %ymm11, %ymm12
vpcmpeqd %ymm13, %ymm13, %ymm13
vpcmpeqd %xmm14, %xmm14, %xmm14
vpbroadcastd 0xdf144(%rip), %xmm15 # 0x62dbc0
movl 0xf8(%rsp), %esi
testl %esi, %esi
je 0x54ea8d
vpxor %xmm1, %xmm1, %xmm1
jmp 0x54eaa0
vpaddd %xmm14, %xmm9, %xmm1
vpmulld %xmm2, %xmm1, %xmm1
vpsubd %xmm1, %xmm8, %xmm1
vpmovsxdq %xmm1, %ymm1
vmovq %rcx, %xmm3
vpbroadcastq %xmm3, %ymm3
vpor %ymm3, %ymm10, %ymm3
vpxor %ymm3, %ymm11, %ymm3
vpcmpgtq %ymm12, %ymm3, %ymm3
vpxor %ymm3, %ymm13, %ymm3
vpmaskmovq %ymm1, %ymm3, 0x8(%r12,%rcx,8)
addq $0x4, %rcx
vpaddd %xmm15, %xmm9, %xmm9
cmpq %rcx, %rbx
jne 0x54ea83
vpxor %xmm1, %xmm1, %xmm1
vpsubq %ymm4, %ymm1, %ymm8
leal -0x1(%r13), %r9d
shlq $0x5, %r9
movq %rax, %rcx
addq %r9, %rcx
movl %r13d, %esi
vmovdqu 0x70(%rsp), %ymm2
vmovdqa %ymm8, (%rcx)
vpsubq %ymm5, %ymm8, %ymm8
vpcmpgtq %ymm2, %ymm8, %ymm1
vblendvpd %ymm1, %ymm2, %ymm8, %ymm2
addq $-0x20, %rcx
decl %esi
jg 0x54eaef
addq %r14, %r9
movl 0x3c(%rsp), %r10d
movq %r10, 0x20(%rsp)
shlq $0x5, %r10
addq %r14, %r10
movq %r13, %r11
shlq $0x5, %r11
xorl %ecx, %ecx
movl %r13d, %ebx
vmovdqu 0x90(%rsp), %ymm1
vpcmpeqq 0xdf064(%rip), %ymm1, %ymm9 # 0x62dba0
movl 0x8(%rsp), %esi
vmovdqa %ymm0, %ymm8
vmovdqa %ymm0, %ymm3
movq %rcx, %rdi
vmovdqa (%r9), %ymm1
vinserti128 $0x1, %xmm1, %ymm0, %ymm10
vpalignr $0x8, %ymm10, %ymm1, %ymm1 # ymm1 = ymm10[8,9,10,11,12,13,14,15],ymm1[0,1,2,3,4,5,6,7],ymm10[24,25,26,27,28,29,30,31],ymm1[16,17,18,19,20,21,22,23]
vmovq (%r12,%rcx,8), %xmm10
vpblendd $0x3, %ymm10, %ymm1, %ymm12 # ymm12 = ymm10[0,1],ymm1[2,3,4,5,6,7]
movq 0x50(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x58(%rsp), %r8
movzbl (%r8,%rdi), %r8d
movslq (%rcx,%r8,4), %rcx
imulq %rbx, %rcx
shlq $0x5, %rcx
addq 0x68(%rsp), %rcx
vpsubq (%rax), %ymm0, %ymm11
xorl %r8d, %r8d
vmovdqa %ymm0, %ymm10
vpaddq (%rcx,%r8), %ymm12, %ymm1
vmovdqa (%r14,%r8), %ymm12
vmovdqa (%r15,%r8), %ymm13
vpsubq %ymm5, %ymm13, %ymm13
vpaddq (%rax,%r8), %ymm11, %ymm11
vpsubq %ymm4, %ymm12, %ymm14
vpcmpgtq %ymm11, %ymm10, %ymm15
vblendvpd %ymm15, %ymm10, %ymm11, %ymm10
vpcmpgtq %ymm14, %ymm13, %ymm11
vblendvpd %ymm11, %ymm13, %ymm14, %ymm13
vpcmpgtq %ymm1, %ymm13, %ymm11
vblendvpd %ymm11, %ymm13, %ymm1, %ymm11
vmovaps %ymm13, (%r15,%r8)
vmovapd %ymm11, (%rbp,%r8)
addq $0x20, %r8
cmpq %r8, %r11
jne 0x54eb97
vpermpd $0x90, %ymm11, %ymm11   # ymm11 = ymm11[0,0,1,2]
leaq 0x1(%rdi), %rcx
vmovsd 0x8(%r12,%rdi,8), %xmm12
vblendpd $0x1, %ymm12, %ymm11, %ymm1 # ymm1 = ymm12[0],ymm11[1,2,3]
vpaddq (%rax), %ymm1, %ymm1
vpcmpgtq %ymm1, %ymm10, %ymm13
vblendvpd %ymm13, %ymm10, %ymm1, %ymm10
movb $0x1, %r8b
vperm2f128 $0x8, %ymm10, %ymm10, %ymm1 # ymm1 = zero,zero,ymm10[0,1]
vpalignr $0x8, %ymm1, %ymm10, %ymm1 # ymm1 = ymm1[8,9,10,11,12,13,14,15],ymm10[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm10[16,17,18,19,20,21,22,23]
vpaddq %ymm1, %ymm7, %ymm1
vpcmpgtq %ymm1, %ymm10, %ymm13
vblendvpd %ymm13, %ymm10, %ymm1, %ymm10
testb $0x1, %r8b
movl $0x0, %r8d
jne 0x54ec17
vperm2f128 $0x8, %ymm10, %ymm10, %ymm1 # ymm1 = zero,zero,ymm10[0,1]
vpalignr $0x8, %ymm1, %ymm10, %ymm1 # ymm1 = ymm1[8,9,10,11,12,13,14,15],ymm10[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm10[16,17,18,19,20,21,22,23]
vpaddq %ymm1, %ymm6, %ymm10
vblendpd $0x1, %ymm12, %ymm11, %ymm1 # ymm1 = ymm12[0],ymm11[1,2,3]
vpcmpgtq %ymm10, %ymm1, %ymm11
vblendvpd %ymm11, %ymm1, %ymm10, %ymm11
xorl %r8d, %r8d
vpsubq %ymm5, %ymm10, %ymm1
vpsubq %ymm4, %ymm11, %ymm10
vpcmpgtq %ymm10, %ymm1, %ymm11
vblendvpd %ymm11, %ymm1, %ymm10, %ymm10
vmovdqa (%rbp,%r8), %ymm1
vpcmpgtq %ymm10, %ymm1, %ymm11
vblendvpd %ymm11, %ymm1, %ymm10, %ymm11
vmovapd %ymm11, (%r14,%r8)
vpcmpgtq %ymm2, %ymm11, %ymm1
vblendvpd %ymm1, %ymm2, %ymm11, %ymm1
vpcmpgtq %ymm1, %ymm10, %ymm2
vblendvpd %ymm2, %ymm1, %ymm10, %ymm2
vpcmpgtq %ymm11, %ymm3, %ymm1
vblendvpd %ymm1, %ymm3, %ymm11, %ymm3
addq $0x20, %r8
cmpq %r8, %r11
jne 0x54ec62
vmovdqa (%r10), %ymm10
vpcmpgtq %ymm8, %ymm10, %ymm11
vtestpd %ymm9, %ymm11
cmovnel %edi, %esi
vmovdqa %ymm10, %ymm12
cmpl $0x2, 0xc(%rsp)
jg 0x54ecf1
xorl %r8d, %r8d
vmovdqa %ymm10, %ymm12
vperm2i128 $0x8, %ymm12, %ymm12, %ymm1 # ymm1 = zero,zero,ymm12[0,1]
vpalignr $0x8, %ymm1, %ymm12, %ymm12 # ymm12 = ymm1[8,9,10,11,12,13,14,15],ymm12[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm12[16,17,18,19,20,21,22,23]
incl %r8d
cmpl %edx, %r8d
jl 0x54ecdd
vblendvpd %ymm11, %ymm10, %ymm8, %ymm8
vextracti128 $0x1, %ymm12, %xmm1
movq 0x30(%rsp), %r8
movq 0x10(%r8), %r8
movq (%r8), %r8
vpextrd $0x2, %xmm1, (%r8,%rdi,4)
cmpq 0x28(%rsp), %rcx
jne 0x54eb48
leaq (,%r13,4), %rcx
leaq (%rcx,%rcx,2), %rdi
movq %r13, %r8
shlq $0x3, %r8
xorl %r9d, %r9d
movq 0x30(%rsp), %r11
movq 0x10(%r11), %r10
movq 0x8(%r10), %r10
vmovdqa (%r14,%r9,8), %xmm1
vmovdqa 0x10(%r14,%r9,8), %xmm4
vmovd %xmm1, (%r10,%r9)
addq %r9, %r10
vpextrd $0x2, %xmm1, (%rcx,%r10)
vmovd %xmm4, (%r8,%r10)
vpextrd $0x2, %xmm4, (%rdi,%r10)
addq $0x4, %r9
cmpq %r9, %rcx
jne 0x54ed36
cmpl $0x0, 0x100(%rsp)
movl 0x1c(%rsp), %r9d
je 0x54eda9
cmpl $0x2, 0xc(%rsp)
jg 0x54ed9b
xorl %ecx, %ecx
vperm2i128 $0x8, %ymm8, %ymm8, %ymm1 # ymm1 = zero,zero,ymm8[0,1]
vpalignr $0x8, %ymm1, %ymm8, %ymm8 # ymm8 = ymm1[8,9,10,11,12,13,14,15],ymm8[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm8[16,17,18,19,20,21,22,23]
incl %ecx
cmpl %edx, %ecx
jl 0x54ed89
vextracti128 $0x1, %ymm8, %xmm1
vpextrq $0x1, %xmm1, 0x10(%rsp)
cmpl $0x0, 0xf0(%rsp)
je 0x54ee24
cmpl $0x0, 0x60(%rsp)
je 0x54ee24
movl %r13d, %edi
andl $0x1fffffff, %edi       # imm = 0x1FFFFFFF
shll $0x2, %edi
xorl %r8d, %r8d
movl %r9d, %ecx
movl %r8d, %r10d
shrl $0x2, %r10d
movl %r8d, %r9d
andl $0x3, %r9d
imull %r13d, %r9d
addl %r10d, %r9d
cmpl 0x48(%rsp), %r9d
jge 0x54ee1a
movq (%r14,%r8,8), %r10
movq 0x10(%rsp), %rbx
cmpq %rbx, %r10
jle 0x54ee04
movq %r10, 0x10(%rsp)
movl 0x8(%rsp), %esi
movl %r9d, %ecx
jmp 0x54ee1a
cmpl %ecx, %r9d
cmovgel %ecx, %r9d
cmpl 0x8(%rsp), %esi
cmovnel %ecx, %r9d
cmpq %rbx, %r10
cmovel %r9d, %ecx
incq %r8
cmpl %r8d, %edi
jne 0x54edcc
jmp 0x54ee27
movl %r9d, %ecx
movl 0xf0(%rsp), %edi
orl %edi, 0x40(%rsp)
jne 0x54eeca
movq 0x20(%rsp), %rcx
shlq $0x5, %rcx
vmovdqa (%r14,%rcx), %ymm4
cmpl $0x2, 0xc(%rsp)
jg 0x54eeb2
xorl %ecx, %ecx
movl 0x1c(%rsp), %edi
vperm2i128 $0x8, %ymm4, %ymm4, %ymm1 # ymm1 = zero,zero,ymm4[0,1]
vpalignr $0x8, %ymm1, %ymm4, %ymm4 # ymm4 = ymm1[8,9,10,11,12,13,14,15],ymm4[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm4[16,17,18,19,20,21,22,23]
incl %ecx
cmpl %edx, %ecx
jl 0x54ee54
jmp 0x54eeb6
callq 0x1ef2a7
jmp 0x54ee9e
callq 0x1ef281
jmp 0x54ee9e
callq 0x1ef25b
jmp 0x54ee9e
callq 0x1ef235
jmp 0x54ee9e
callq 0x1ef20f
jmp 0x54ee9e
callq 0x1ef1e9
jmp 0x54ee9e
callq 0x1ef1c3
jmp 0x54ee9e
callq 0x1ef19d
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x1c(%rsp), %edi
vextracti128 $0x1, %ymm4, %xmm1
vpextrq $0x1, %xmm1, 0x10(%rsp)
movl 0x8(%rsp), %esi
movl %edi, %ecx
vpcmpgtq %ymm2, %ymm0, %ymm0
vpcmpgtq 0x70(%rsp), %ymm3, %ymm1
vpor %ymm0, %ymm1, %ymm0
vtestpd %ymm0, %ymm0
je 0x54eef3
orb $0x40, 0xc(%r11)
movq $0x0, 0x10(%rsp)
xorl %esi, %esi
xorl %ecx, %ecx
movq 0x10(%rsp), %rdx
movl %edx, (%r11)
movl %ecx, 0x4(%r11)
movl %esi, 0x8(%r11)
movq %rax, %rdi
vzeroupper
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
movq %rbp, %rdi
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r15, %rdi
callq 0x20a60d
movq 0x30(%rsp), %rax
jmp 0x54eea0