// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/nw_scan_avx2_256_64.c
// Function: parasail_nw_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)
{
    /* 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;
    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 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;
    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_NW | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_4;
#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 = -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 = -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);
        }
    }

    /* 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);
            vSaturationCheckMax = _mm256_max_epi64_rpl(vSaturationCheckMax, vH);
#ifdef PARASAIL_TABLE
            arr_store_si256(result->tables->score_table, vH, i, segLen, j, s2Len);
#endif
        } 


#ifdef PARASAIL_ROWCOL
        /* extract last value from the column */
        {
            vH = _mm256_load_si256(pvH + offset);
            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

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

    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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x120, %rsp            # imm = 0x120
movq %rsi, 0x88(%rsp)
testq %rdi, %rdi
je 0x51f5ae
movq 0x60(%rdi), %rax
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0x51f5b5
movq 0x10(%rdi), %rax
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x51f5bc
movl 0x8(%rdi), %edi
testl %edi, %edi
jle 0x51f5c3
cmpq $0x0, 0x88(%rsp)
je 0x51f5ca
movl %edx, %r14d
testl %edx, %edx
jle 0x51f5d1
movl %ecx, %r13d
testl %ecx, %ecx
js 0x51f5d8
testl %r8d, %r8d
js 0x51f5df
movl %r8d, 0x28(%rsp)
leal -0x1(%rdi), %ebx
addq $0x3, %rdi
movq %rdi, %rcx
shrq $0x2, %rcx
movl %ebx, %eax
cltd
movq %rcx, 0x58(%rsp)
idivl %ecx
movl %eax, 0x24(%rsp)
movl %edx, 0x48(%rsp)
movl %r13d, %r12d
negl %r13d
movq 0x80(%rsp), %rdx
movslq 0x20(%rdx), %rax
movq %r12, %rcx
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
subq %rax, %rsi
cmpl %r13d, %eax
cmovgq %rcx, %rsi
movq %rsi, 0x68(%rsp)
movslq 0x1c(%rdx), %rax
movq %rax, 0x60(%rsp)
andl $0x7ffffffc, %edi       # imm = 0x7FFFFFFC
movl %r14d, %esi
callq 0x209630
testq %rax, %rax
je 0x51f5e4
movq %rax, %r15
movl %r13d, 0x14(%rsp)
movl %ebx, 0x74(%rsp)
orl $0x4840401, 0xc(%rax)   # imm = 0x4840401
movl $0x20, %edi
movq 0x58(%rsp), %rbx
movq %rbx, %rsi
callq 0x4c5e3c
movq %rax, %r13
leal 0x1(%r14), %esi
movl $0x20, %edi
movq %rsi, 0xa0(%rsp)
callq 0x2094de
movq %rax, 0x40(%rsp)
movl $0x20, %edi
movq %rbx, %rsi
callq 0x4c5e3c
movq %r14, 0x38(%rsp)
movq %rax, %r14
movl $0x20, %edi
movq %rbx, %rsi
callq 0x4c5e3c
movq %rax, 0x18(%rsp)
movl $0x20, %edi
movq %rbx, %rsi
callq 0x4c5e3c
movq 0x40(%rsp), %r11
testq %r13, %r13
sete %cl
testq %r11, %r11
sete %dl
orb %cl, %dl
testq %r14, %r14
sete %cl
cmpq $0x0, 0x18(%rsp)
sete %sil
orb %cl, %sil
orb %dl, %sil
movq %rax, 0x50(%rsp)
testq %rax, %rax
sete %cl
orb %sil, %cl
jne 0x51f5e4
movq 0x38(%rsp), %rax
decl %eax
movl %eax, 0x30(%rsp)
movl $0x3, %eax
subl 0x24(%rsp), %eax
movl %eax, 0x34(%rsp)
vmovq %r12, %xmm0
vpbroadcastq %xmm0, %ymm2
movl 0x28(%rsp), %eax
movl %eax, %ecx
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm3
movq 0x68(%rsp), %rsi
incq %rsi
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
subq 0x60(%rsp), %rdx
addq $-0x2, %rdx
vmovq %rsi, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovq %rdx, %xmm1
vpbroadcastq %xmm1, %ymm7
vmovq %xmm0, %xmm4            # xmm4 = xmm0[0],zero
movq 0x58(%rsp), %r8
imull %r8d, %eax
negl %eax
movslq %eax, %rdx
vmovq %rdx, %xmm5
vpbroadcastq %xmm5, %ymm5
vpxor %xmm6, %xmm6, %xmm6
vpblendd $0x3, %ymm6, %ymm5, %ymm5 # ymm5 = ymm6[0,1],ymm5[2,3,4,5,6,7]
vpaddq %ymm5, %ymm4, %ymm5
movslq 0x14(%rsp), %rdx
movl %r8d, %esi
negq %r12
movq %rsi, 0x28(%rsp)
imulq %rcx, %rsi
xorl %edi, %edi
movq %r8, %rax
movq %rdx, %r8
xorl %r9d, %r9d
movq %r8, 0xe0(%rsp,%r9,8)
leaq (%r12,%r8), %r10
movq %r10, 0xc0(%rsp,%r9,8)
incq %r9
subq %rsi, %r8
cmpq $0x4, %r9
jne 0x51edd4
movq %rdi, %r8
shlq $0x5, %r8
vmovaps 0xe0(%rsp), %ymm6
movq 0x18(%rsp), %r9
vmovaps %ymm6, (%r9,%r8)
vmovdqa 0xc0(%rsp), %ymm6
vmovdqa %ymm6, (%r13,%r8)
incq %rdi
subq %rcx, %rdx
cmpq 0x28(%rsp), %rdi
jne 0x51edce
movq $0x0, (%r11)
movslq 0x14(%rsp), %rdx
movl $0x1, %esi
movq 0xa0(%rsp), %rdi
movq %rdx, (%r11,%rsi,8)
incq %rsi
subq %rcx, %rdx
cmpq %rsi, %rdi
jne 0x51ee45
vpxor %xmm6, %xmm6, %xmm6
vpsubq %ymm2, %ymm6, %ymm6
leal -0x1(%rax), %ecx
movq %rcx, %rsi
shlq $0x5, %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
movl %eax, %esi
vmovdqa %ymm6, (%rdx)
vpsubq %ymm3, %ymm6, %ymm6
addq $-0x20, %rdx
decl %esi
jg 0x51ee70
movl %ecx, %edx
shlq $0x5, %rdx
movq 0x18(%rsp), %rcx
addq %rcx, %rdx
movq %rdx, 0x68(%rsp)
movl 0x48(%rsp), %edx
movq %rdx, 0x90(%rsp)
shlq $0x5, %rdx
addq %rcx, %rdx
movq %rdx, 0x60(%rsp)
movl $0x1, %ecx
cmpl %ecx, %eax
movl %eax, %r11d
adcl $0x0, %r11d
movl 0x34(%rsp), %eax
cmpl $0x2, %eax
movl $0x1, %edx
cmovgel %eax, %edx
movl %edx, 0x14(%rsp)
movq 0x38(%rsp), %rax
cmpl $0x2, %eax
cmovgel %eax, %ecx
movq %rcx, 0x38(%rsp)
shlq $0x5, %r11
xorl %edx, %edx
vpxor %xmm8, %xmm8, %xmm8
vmovdqa %ymm0, %ymm6
vmovdqa %ymm7, 0xa0(%rsp)
movq %r15, 0x78(%rsp)
movq %rdx, %rsi
movq 0x68(%rsp), %rax
vmovdqa (%rax), %ymm9
vinserti128 $0x1, %xmm9, %ymm0, %ymm10
vpalignr $0x8, %ymm10, %ymm9, %ymm9 # ymm9 = ymm10[8,9,10,11,12,13,14,15],ymm9[0,1,2,3,4,5,6,7],ymm10[24,25,26,27,28,29,30,31],ymm9[16,17,18,19,20,21,22,23]
movq 0x40(%rsp), %rax
vmovq (%rax,%rdx,8), %xmm10
vpblendd $0x3, %ymm10, %ymm9, %ymm9 # ymm9 = ymm10[0,1],ymm9[2,3,4,5,6,7]
movq 0x80(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x88(%rsp), %rdx
movq %rsi, 0x48(%rsp)
movzbl (%rdx,%rsi), %edx
movslq (%rcx,%rdx,4), %rdx
imulq 0x28(%rsp), %rdx
shlq $0x5, %rdx
addq 0x98(%rsp), %rdx
movq 0x50(%rsp), %r15
vpsubq (%r15), %ymm0, %ymm11
xorl %r12d, %r12d
vmovdqa %ymm0, %ymm10
movq %r11, %rax
vpaddq (%rdx,%r12), %ymm9, %ymm12
movq 0x18(%rsp), %rcx
vmovdqa (%rcx,%r12), %ymm9
vmovdqa (%r13,%r12), %ymm13
vpsubq %ymm3, %ymm13, %ymm13
vpsubq %ymm2, %ymm9, %ymm14
vmovq %xmm13, %rcx
vmovq %xmm14, %rbx
cmpq %rbx, %rcx
cmovgq %rcx, %rbx
vpextrq $0x1, %xmm13, %rcx
vpextrq $0x1, %xmm14, %rdi
cmpq %rdi, %rcx
cmovgq %rcx, %rdi
vextracti128 $0x1, %ymm13, %xmm13
vmovq %xmm13, %rcx
vextracti128 $0x1, %ymm14, %xmm14
vmovq %xmm14, %r10
cmpq %r10, %rcx
cmovgq %rcx, %r10
vpextrq $0x1, %xmm13, %rcx
movq %r13, %r11
vpextrq $0x1, %xmm14, %r13
cmpq %r13, %rcx
cmovgq %rcx, %r13
vmovq %rdi, %xmm13
vpaddq (%r15,%r12), %ymm11, %ymm11
vmovq %xmm10, %rcx
vmovq %xmm11, %r8
cmpq %r8, %rcx
cmovgq %rcx, %r8
vpextrq $0x1, %xmm10, %rcx
vpextrq $0x1, %xmm11, %r9
cmpq %r9, %rcx
cmovgq %rcx, %r9
vextracti128 $0x1, %ymm10, %xmm10
vmovq %xmm10, %rcx
vextracti128 $0x1, %ymm11, %xmm11
vmovq %xmm11, %rsi
cmpq %rsi, %rcx
cmovgq %rcx, %rsi
vpextrq $0x1, %xmm10, %r15
vmovq %rbx, %xmm10
vpextrq $0x1, %xmm11, %rcx
cmpq %rcx, %r15
cmovgq %r15, %rcx
vmovq %xmm12, %r15
cmpq %r15, %rbx
cmovleq %r15, %rbx
vpextrq $0x1, %xmm12, %r15
vmovq %r13, %xmm11
cmpq %r15, %rdi
cmovleq %r15, %rdi
vmovq %r10, %xmm14
vextracti128 $0x1, %ymm12, %xmm12
vmovq %xmm12, %r15
cmpq %r15, %r10
cmovleq %r15, %r10
vpextrq $0x1, %xmm12, %r15
cmpq %r15, %r13
cmovleq %r15, %r13
movq 0x50(%rsp), %r15
vmovq %r13, %xmm15
movq %r11, %r13
vpunpcklqdq %xmm13, %xmm10, %xmm1 # xmm1 = xmm10[0],xmm13[0]
vpunpcklqdq %xmm11, %xmm14, %xmm14 # xmm14 = xmm14[0],xmm11[0]
vmovq %rcx, %xmm10
vmovq %rsi, %xmm11
vpunpcklqdq %xmm10, %xmm11, %xmm10 # xmm10 = xmm11[0],xmm10[0]
vmovq %r9, %xmm11
vmovq %r8, %xmm12
vpunpcklqdq %xmm11, %xmm12, %xmm11 # xmm11 = xmm12[0],xmm11[0]
vinserti128 $0x1, %xmm10, %ymm11, %ymm10
vmovq %rdi, %xmm12
vmovq %rbx, %xmm11
vpunpcklqdq %xmm12, %xmm11, %xmm11 # xmm11 = xmm11[0],xmm12[0]
vmovq %r10, %xmm13
vinserti128 $0x1, %xmm13, %ymm11, %ymm13
vpbroadcastq %xmm15, %ymm11
vpblendd $0xc0, %ymm11, %ymm13, %ymm11 # ymm11 = ymm13[0,1,2,3,4,5],ymm11[6,7]
vmovdqa %xmm14, 0x10(%r11,%r12)
vmovdqa %xmm1, (%r11,%r12)
vmovdqa %ymm11, (%r14,%r12)
addq $0x20, %r12
cmpq %r12, %rax
jne 0x51ef68
movq %rax, %r11
vpbroadcastq %xmm12, %ymm1
vpunpcklqdq %ymm13, %ymm1, %ymm1 # ymm1 = ymm1[0],ymm13[0],ymm1[2],ymm13[2]
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
movq 0x8(%rax,%rdx,8), %r12
vmovq %r12, %xmm9
vpblendd $0x3, %ymm9, %ymm1, %ymm1 # ymm1 = ymm9[0,1],ymm1[2,3,4,5,6,7]
vpaddq (%r15), %ymm1, %ymm1
vmovq %xmm1, %r15
cmpq %r15, %r8
cmovgq %r8, %r15
vpextrq $0x1, %xmm1, %r8
cmpq %r8, %r9
cmovgq %r9, %r8
vextracti128 $0x1, %ymm1, %xmm1
vmovq %xmm1, %r9
cmpq %r9, %rsi
cmovgq %rsi, %r9
vpextrq $0x1, %xmm1, %rsi
incq %rdx
cmpq %rsi, %rcx
cmovgq %rcx, %rsi
vmovq %rsi, %xmm1
vmovq %r9, %xmm9
vpunpcklqdq %xmm1, %xmm9, %xmm1 # xmm1 = xmm9[0],xmm1[0]
vmovq %r8, %xmm9
vmovq %r15, %xmm10
vpunpcklqdq %xmm9, %xmm10, %xmm9 # xmm9 = xmm10[0],xmm9[0]
vinserti128 $0x1, %xmm1, %ymm9, %ymm9
movl $0x1, %ecx
vperm2i128 $0x8, %ymm9, %ymm9, %ymm1 # ymm1 = zero,zero,ymm9[0,1]
vpalignr $0x8, %ymm1, %ymm9, %ymm1 # ymm1 = ymm1[8,9,10,11,12,13,14,15],ymm9[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm9[16,17,18,19,20,21,22,23]
vpaddq %ymm1, %ymm5, %ymm1
vmovq %xmm9, %rsi
vmovq %xmm1, %r8
cmpq %r8, %rsi
cmovgq %rsi, %r8
vpextrq $0x1, %xmm9, %rsi
vpextrq $0x1, %xmm1, %r9
cmpq %r9, %rsi
cmovgq %rsi, %r9
vextracti128 $0x1, %ymm9, %xmm9
vmovq %xmm9, %rsi
vextracti128 $0x1, %ymm1, %xmm1
vmovq %xmm1, %r15
cmpq %r15, %rsi
cmovgq %rsi, %r15
vmovq %r9, %xmm10
vmovq %r8, %xmm11
vpunpcklqdq %xmm10, %xmm11, %xmm11 # xmm11 = xmm11[0],xmm10[0]
vmovq %r15, %xmm12
vpextrq $0x1, %xmm9, %rsi
vpextrq $0x1, %xmm1, %r8
vinserti128 $0x1, %xmm12, %ymm11, %ymm11
cmpq %r8, %rsi
cmovgq %rsi, %r8
vmovq %r8, %xmm1
vpbroadcastq %xmm1, %ymm1
vpblendd $0xc0, %ymm1, %ymm11, %ymm9 # ymm9 = ymm11[0,1,2,3,4,5],ymm1[6,7]
decl %ecx
je 0x51f194
vpbroadcastq %xmm10, %xmm1
vinserti128 $0x1, %xmm1, %ymm8, %ymm1
vpalignr $0x8, %ymm1, %ymm11, %ymm1 # ymm1 = ymm1[8,9,10,11,12,13,14,15],ymm11[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm11[16,17,18,19,20,21,22,23]
vpaddq %ymm1, %ymm4, %ymm9
vmovq %xmm9, %rcx
cmpq %rcx, %r12
cmovgq %r12, %rcx
vpextrq $0x1, %xmm9, %rsi
cmpq %rsi, %rbx
cmovgq %rbx, %rsi
vextracti128 $0x1, %ymm9, %xmm1
vmovq %xmm1, %r8
cmpq %r8, %rdi
cmovgq %rdi, %r8
vpextrq $0x1, %xmm1, %rdi
cmpq %rdi, %r10
cmovgq %r10, %rdi
vmovq %rdi, %xmm1
vmovq %r8, %xmm10
vpunpcklqdq %xmm1, %xmm10, %xmm1 # xmm1 = xmm10[0],xmm1[0]
vmovq %rsi, %xmm10
vmovq %rcx, %xmm11
vpunpcklqdq %xmm10, %xmm11, %xmm10 # xmm10 = xmm11[0],xmm10[0]
vinserti128 $0x1, %xmm1, %ymm10, %ymm10
xorl %edi, %edi
movq 0x18(%rsp), %rax
vpsubq %ymm3, %ymm9, %ymm1
vpsubq %ymm2, %ymm10, %ymm9
vmovq %xmm1, %rcx
vmovq %xmm9, %r10
cmpq %r10, %rcx
cmovgq %rcx, %r10
vpextrq $0x1, %xmm1, %rcx
vpextrq $0x1, %xmm9, %rbx
cmpq %rbx, %rcx
cmovgq %rcx, %rbx
vextracti128 $0x1, %ymm1, %xmm1
vmovq %xmm1, %rsi
vextracti128 $0x1, %ymm9, %xmm9
vmovq %xmm9, %rcx
cmpq %rcx, %rsi
cmovgq %rsi, %rcx
vpextrq $0x1, %xmm1, %r8
vpextrq $0x1, %xmm9, %rsi
cmpq %rsi, %r8
cmovgq %r8, %rsi
vmovq %rsi, %xmm12
vmovq %rcx, %xmm13
vmovq %rbx, %xmm9
vmovq %r10, %xmm11
movq (%r14,%rdi), %r8
cmpq %r10, %r8
cmovgq %r8, %r10
movq 0x8(%r14,%rdi), %r8
cmpq %rbx, %r8
cmovgq %r8, %rbx
movq 0x10(%r14,%rdi), %r8
cmpq %rcx, %r8
cmovgq %r8, %rcx
movq 0x18(%r14,%rdi), %r8
cmpq %rsi, %r8
cmovgq %r8, %rsi
vmovq %rsi, %xmm1
vmovq %rcx, %xmm10
vpunpcklqdq %xmm1, %xmm10, %xmm1 # xmm1 = xmm10[0],xmm1[0]
vmovq %rbx, %xmm10
vmovq %r10, %xmm14
vpunpcklqdq %xmm10, %xmm14, %xmm10 # xmm10 = xmm14[0],xmm10[0]
vinserti128 $0x1, %xmm1, %ymm10, %ymm10
vmovdqa %ymm10, (%rax,%rdi)
vmovq %xmm7, %r8
cmpq %r10, %r8
cmovgeq %r10, %r8
vpextrq $0x1, %xmm7, %r9
cmpq %rbx, %r9
cmovgeq %rbx, %r9
vpunpcklqdq %xmm12, %xmm13, %xmm1 # xmm1 = xmm13[0],xmm12[0]
vextracti128 $0x1, %ymm7, %xmm7
vmovq %xmm7, %r15
cmpq %rcx, %r15
cmovgeq %rcx, %r15
vpextrq $0x1, %xmm7, %r12
vpunpcklqdq %xmm9, %xmm11, %xmm7 # xmm7 = xmm11[0],xmm9[0]
cmpq %rsi, %r12
cmovgeq %rsi, %r12
vinserti128 $0x1, %xmm1, %ymm7, %ymm9
vmovq %r12, %xmm1
vmovq %r15, %xmm7
vpunpcklqdq %xmm1, %xmm7, %xmm1 # xmm1 = xmm7[0],xmm1[0]
vmovq %r9, %xmm7
vmovq %r8, %xmm11
vmovq %xmm6, %r8
cmpq %r10, %r8
cmovgq %r8, %r10
vpextrq $0x1, %xmm6, %r8
vpunpcklqdq %xmm7, %xmm11, %xmm7 # xmm7 = xmm11[0],xmm7[0]
cmpq %rbx, %r8
cmovgq %r8, %rbx
vinserti128 $0x1, %xmm1, %ymm7, %ymm7
vextracti128 $0x1, %ymm6, %xmm1
vmovq %xmm1, %r8
cmpq %rcx, %r8
cmovgq %r8, %rcx
vpextrq $0x1, %xmm1, %r8
cmpq %rsi, %r8
cmovgq %r8, %rsi
vmovq %rsi, %xmm1
vmovq %rcx, %xmm6
vpunpcklqdq %xmm1, %xmm6, %xmm1 # xmm1 = xmm6[0],xmm1[0]
vmovq %rbx, %xmm6
vmovq %r10, %xmm11
vpunpcklqdq %xmm6, %xmm11, %xmm6 # xmm6 = xmm11[0],xmm6[0]
vinserti128 $0x1, %xmm1, %ymm6, %ymm6
addq $0x20, %rdi
cmpq %rdi, %r11
jne 0x51f2a1
movq 0x60(%rsp), %rax
vmovdqa (%rax), %ymm9
cmpl $0x2, 0x24(%rsp)
jg 0x51f464
movl 0x14(%rsp), %ecx
movq 0x78(%rsp), %r15
vperm2i128 $0x8, %ymm9, %ymm9, %ymm1 # ymm1 = zero,zero,ymm9[0,1]
vpalignr $0x8, %ymm1, %ymm9, %ymm9 # ymm9 = ymm1[8,9,10,11,12,13,14,15],ymm9[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm9[16,17,18,19,20,21,22,23]
decl %ecx
jne 0x51f452
jmp 0x51f469
movq 0x78(%rsp), %r15
vextracti128 $0x1, %ymm9, %xmm1
movq 0x10(%r15), %rcx
movq (%rcx), %rcx
movq 0x48(%rsp), %rax
vpextrd $0x2, %xmm1, (%rcx,%rax,4)
cmpq 0x38(%rsp), %rdx
jne 0x51eef9
movq 0x58(%rsp), %rax
cmpl $0x1, %eax
adcl $0x0, %eax
movq 0x28(%rsp), %rsi
leaq (,%rsi,4), %rcx
leaq (%rcx,%rcx,2), %rdx
leaq (,%rsi,8), %rsi
shlq $0x2, %rax
xorl %edi, %edi
movq 0x18(%rsp), %r9
movq 0x10(%r15), %r8
movq 0x8(%r8), %r8
vmovdqa (%r9,%rdi,8), %xmm1
vmovdqa 0x10(%r9,%rdi,8), %xmm2
vmovd %xmm1, (%r8,%rdi)
addq %rdi, %r8
vpextrd $0x2, %xmm1, (%rcx,%r8)
vmovd %xmm2, (%rsi,%r8)
vpextrd $0x2, %xmm2, (%rdx,%r8)
addq $0x4, %rdi
cmpq %rdi, %rax
jne 0x51f4bc
movq 0x90(%rsp), %rax
shlq $0x5, %rax
vmovdqa (%r9,%rax), %ymm2
cmpl $0x2, 0x24(%rsp)
jg 0x51f535
movl 0x34(%rsp), %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl 0x30(%rsp), %eax
vperm2i128 $0x8, %ymm2, %ymm2, %ymm1 # ymm1 = zero,zero,ymm2[0,1]
vpalignr $0x8, %ymm1, %ymm2, %ymm2 # ymm2 = ymm1[8,9,10,11,12,13,14,15],ymm2[0,1,2,3,4,5,6,7],ymm1[24,25,26,27,28,29,30,31],ymm2[16,17,18,19,20,21,22,23]
decl %ecx
jne 0x51f523
jmp 0x51f539
movl 0x30(%rsp), %eax
vpcmpgtq %ymm7, %ymm0, %ymm0
vpcmpgtq 0xa0(%rsp), %ymm6, %ymm1
vpor %ymm0, %ymm1, %ymm0
vtestpd %ymm0, %ymm0
je 0x51f560
orb $0x40, 0xc(%r15)
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
jmp 0x51f570
vextracti128 $0x1, %ymm2, %xmm0
vpextrq $0x1, %xmm0, %rcx
movl 0x74(%rsp), %edx
movl %ecx, (%r15)
movl %edx, 0x4(%r15)
movl %eax, 0x8(%r15)
movq 0x50(%rsp), %rdi
vzeroupper
callq 0x2094b5
movq 0x18(%rsp), %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq 0x40(%rsp), %rdi
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
jmp 0x51f5e7
callq 0x1ef079
jmp 0x51f5e4
callq 0x1ef053
jmp 0x51f5e4
callq 0x1ef02d
jmp 0x51f5e4
callq 0x1ef007
jmp 0x51f5e4
callq 0x1eefe1
jmp 0x51f5e4
callq 0x1eefbb
jmp 0x51f5e4
callq 0x1eef95
jmp 0x51f5e4
callq 0x1eef6f
xorl %r15d, %r15d
movq %r15, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)