// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_diag_avx2_256_64.c
// Function: parasail_sw_rowcol_diag_avx2_256_64
parasail_result_t* FNAME(
        const char * const restrict _s1, const int _s1Len,
        const char * const restrict _s2, const int s2Len,
        const int open, const int gap, const parasail_matrix_t *matrix)
{
    /* declare local variables */
    int32_t N = 0;
    int32_t PAD = 0;
    int32_t PAD2 = 0;
    int32_t s1Len = 0;
    int32_t s1Len_PAD = 0;
    int32_t s2Len_PAD = 0;
    int64_t * restrict s1 = NULL;
    int64_t * restrict s2B = NULL;
    int64_t * restrict _H_pr = NULL;
    int64_t * restrict _F_pr = NULL;
    int64_t * restrict s2 = NULL;
    int64_t * restrict H_pr = NULL;
    int64_t * restrict F_pr = NULL;
    parasail_result_t *result = NULL;
    int32_t i = 0;
    int32_t j = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    int64_t NEG_LIMIT = 0;
    int64_t POS_LIMIT = 0;
    int64_t score = 0;
    __m256i vNegLimit;
    __m256i vPosLimit;
    __m256i vSaturationCheckMin;
    __m256i vSaturationCheckMax;
    __m256i vNegInf;
    __m256i vNegInf0;
    __m256i vOpen;
    __m256i vGap;
    __m256i vZero;
    __m256i vOne;
    __m256i vN;
    __m256i vNegOne;
    __m256i vI;
    __m256i vJreset;
    __m256i vMaxH;
    __m256i vEndI;
    __m256i vEndJ;
    __m256i vILimit;
    __m256i vJLimit;

    /* validate inputs */
    PARASAIL_CHECK_NULL(_s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);
    PARASAIL_CHECK_NULL(matrix);
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        PARASAIL_CHECK_NULL(_s1);
        PARASAIL_CHECK_GT0(_s1Len);
    }

    /* initialize stack variables */
    N = 4; /* number of values in vector */
    PAD = N-1;
    PAD2 = PAD*2;
    s1Len = matrix->type == PARASAIL_MATRIX_TYPE_SQUARE ? _s1Len : matrix->length;
    s1Len_PAD = s1Len+PAD;
    s2Len_PAD = s2Len+PAD;
    i = 0;
    j = 0;
    end_query = 0;
    end_ref = 0;
    NEG_LIMIT = (-open < matrix->min ? INT64_MIN + open : INT64_MIN - matrix->min) + 1;
    POS_LIMIT = INT64_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi64x_rpl(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi64x_rpl(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm256_set1_epi64x_rpl(NEG_LIMIT);
    vNegInf0 = _mm256_srli_si256_rpl(vNegInf, 8); /* shift in a 0 */
    vOpen = _mm256_set1_epi64x_rpl(open);
    vGap  = _mm256_set1_epi64x_rpl(gap);
    vZero = _mm256_set1_epi64x_rpl(0);
    vOne = _mm256_set1_epi64x_rpl(1);
    vN = _mm256_set1_epi64x_rpl(N);
    vNegOne = _mm256_set1_epi64x_rpl(-1);
    vI = _mm256_set_epi64x_rpl(0,1,2,3);
    vJreset = _mm256_set_epi64x_rpl(0,-1,-2,-3);
    vMaxH = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm256_set1_epi64x_rpl(s1Len);
    vJLimit = _mm256_set1_epi64x_rpl(s2Len);

    /* initialize result */
#ifdef PARASAIL_TABLE
    result = parasail_result_new_table1(s1Len, s2Len);
#else
#ifdef PARASAIL_ROWCOL
    result = parasail_result_new_rowcol1(s1Len, s2Len);
#else
    result = parasail_result_new();
#endif
#endif
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_DIAG
        | 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 */
    s2B= parasail_memalign_int64_t(32, s2Len+PAD2);
    _H_pr = parasail_memalign_int64_t(32, s2Len+PAD2);
    _F_pr = parasail_memalign_int64_t(32, s2Len+PAD2);
    s2 = s2B+PAD; /* will allow later for negative indices */
    H_pr = _H_pr+PAD;
    F_pr = _F_pr+PAD;

    /* validate heap variables */
    if (!s2B) return NULL;
    if (!_H_pr) return NULL;
    if (!_F_pr) return NULL;

    /* convert _s1 from char to int in range 0-23 */
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        s1 = parasail_memalign_int64_t(32, s1Len+PAD);
        if (!s1) return NULL;
        for (i=0; i<s1Len; ++i) {
            s1[i] = matrix->mapper[(unsigned char)_s1[i]];
        }
        /* pad back of s1 with dummy values */
        for (i=s1Len; i<s1Len_PAD; ++i) {
            s1[i] = 0; /* point to first matrix row because we don't care */
        }
    }

    /* convert _s2 from char to int in range 0-23 */
    for (j=0; j<s2Len; ++j) {
        s2[j] = matrix->mapper[(unsigned char)_s2[j]];
    }
    /* pad front of s2 with dummy values */
    for (j=-PAD; j<0; ++j) {
        s2[j] = 0; /* point to first matrix row because we don't care */
    }
    /* pad back of s2 with dummy values */
    for (j=s2Len; j<s2Len_PAD; ++j) {
        s2[j] = 0; /* point to first matrix row because we don't care */
    }

    /* set initial values for stored row */
    for (j=0; j<s2Len; ++j) {
        H_pr[j] = 0;
        F_pr[j] = NEG_LIMIT;
    }
    /* pad front of stored row values */
    for (j=-PAD; j<0; ++j) {
        H_pr[j] = NEG_LIMIT;
        F_pr[j] = NEG_LIMIT;
    }
    /* pad back of stored row values */
    for (j=s2Len; j<s2Len+PAD; ++j) {
        H_pr[j] = NEG_LIMIT;
        F_pr[j] = NEG_LIMIT;
    }

    /* iterate over query sequence */
    for (i=0; i<s1Len; i+=N) {
        __m256i vNH = vNegInf0;
        __m256i vWH = vNegInf0;
        __m256i vE = vNegInf;
        __m256i vF = vNegInf;
        __m256i vJ = vJreset;
        const int * const restrict matrow0 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+0] : ((i+0 >= s1Len) ? s1Len-1 : i+0))];
        const int * const restrict matrow1 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+1] : ((i+1 >= s1Len) ? s1Len-1 : i+1))];
        const int * const restrict matrow2 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+2] : ((i+2 >= s1Len) ? s1Len-1 : i+2))];
        const int * const restrict matrow3 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+3] : ((i+3 >= s1Len) ? s1Len-1 : i+3))];
        __m256i vIltLimit = _mm256_cmplt_epi64_rpl(vI, vILimit);
        /* iterate over database sequence */
        for (j=0; j<s2Len+PAD; ++j) {
            __m256i vMat;
            __m256i vNWH = vNH;
            vNH = _mm256_srli_si256_rpl(vWH, 8);
            vNH = _mm256_insert_epi64_rpl(vNH, H_pr[j], 3);
            vF = _mm256_srli_si256_rpl(vF, 8);
            vF = _mm256_insert_epi64_rpl(vF, F_pr[j], 3);
            vF = _mm256_max_epi64_rpl(
                    _mm256_sub_epi64(vNH, vOpen),
                    _mm256_sub_epi64(vF, vGap));
            vE = _mm256_max_epi64_rpl(
                    _mm256_sub_epi64(vWH, vOpen),
                    _mm256_sub_epi64(vE, vGap));
            vMat = _mm256_set_epi64x_rpl(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]],
                    matrow2[s2[j-2]],
                    matrow3[s2[j-3]]
                    );
            vNWH = _mm256_add_epi64(vNWH, vMat);
            vWH = _mm256_max_epi64_rpl(vNWH, vE);
            vWH = _mm256_max_epi64_rpl(vWH, vF);
            vWH = _mm256_max_epi64_rpl(vWH, vZero);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m256i cond = _mm256_cmpeq_epi64(vJ,vNegOne);
                vWH = _mm256_andnot_si256(cond, vWH);
                vF = _mm256_blendv_epi8(vF, vNegInf, cond);
                vE = _mm256_blendv_epi8(vE, vNegInf, cond);
            }
            /* cannot start checking sat until after J clears boundary */
            if (j > PAD) {
                vSaturationCheckMin = _mm256_min_epi64_rpl(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm256_max_epi64_rpl(vSaturationCheckMax, vWH);
            }
#ifdef PARASAIL_TABLE
            arr_store_si256(result->tables->score_table, vWH, i, s1Len, j, s2Len);
#endif
#ifdef PARASAIL_ROWCOL
            arr_store_rowcol(result->rowcols->score_row, result->rowcols->score_col, vWH, i, s1Len, j, s2Len);
#endif
            H_pr[j-3] = (int64_t)_mm256_extract_epi64_rpl(vWH,0);
            F_pr[j-3] = (int64_t)_mm256_extract_epi64_rpl(vF,0);
            /* as minor diagonal vector passes across table, extract
             * max values within the i,j bounds */
            {
                __m256i cond_valid_J = _mm256_and_si256(
                        _mm256_cmpgt_epi64(vJ, vNegOne),
                        _mm256_cmplt_epi64_rpl(vJ, vJLimit));
                __m256i cond_valid_IJ = _mm256_and_si256(cond_valid_J, vIltLimit);
                __m256i cond_eq = _mm256_cmpeq_epi64(vWH, vMaxH);
                __m256i cond_max = _mm256_cmpgt_epi64(vWH, vMaxH);
                __m256i cond_all = _mm256_and_si256(cond_max, cond_valid_IJ);
                __m256i cond_Jlt = _mm256_cmplt_epi64_rpl(vJ, vEndJ);
                vMaxH = _mm256_blendv_epi8(vMaxH, vWH, cond_all);
                vEndI = _mm256_blendv_epi8(vEndI, vI, cond_all);
                vEndJ = _mm256_blendv_epi8(vEndJ, vJ, cond_all);
                cond_all = _mm256_and_si256(cond_Jlt, cond_eq);
                cond_all = _mm256_and_si256(cond_all, cond_valid_IJ);
                vEndI = _mm256_blendv_epi8(vEndI, vI, cond_all);
                vEndJ = _mm256_blendv_epi8(vEndJ, vJ, cond_all);
            }
            vJ = _mm256_add_epi64(vJ, vOne);
        }
        vI = _mm256_add_epi64(vI, vN);
    }

    /* alignment ending position */
    {
        int64_t *t = (int64_t*)&vMaxH;
        int64_t *i = (int64_t*)&vEndI;
        int64_t *j = (int64_t*)&vEndJ;
        int32_t k;
        for (k=0; k<N; ++k, ++t, ++i, ++j) {
            if (*t > score) {
                score = *t;
                end_query = *i;
                end_ref = *j;
            }
            else if (*t == score) {
                if (*j < end_ref) {
                    end_query = *i;
                    end_ref = *j;
                }
                else if (*j == end_ref && *i < end_query) {
                    end_query = *i;
                    end_ref = *j;
                }
            }
        }
    }

    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(_F_pr);
    parasail_free(_H_pr);
    parasail_free(s2B);
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        parasail_free(s1);
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
andq $-0x20, %rsp
subq $0x2c0, %rsp            # imm = 0x2C0
testq %rdx, %rdx
je 0x529946
movl %ecx, %ebx
testl %ecx, %ecx
jle 0x52994d
testl %r8d, %r8d
js 0x529954
movl %r9d, %r13d
testl %r9d, %r9d
js 0x52995b
movq 0x10(%rbp), %r14
testq %r14, %r14
je 0x529962
movl 0x30(%r14), %eax
testl %eax, %eax
jne 0x528dae
testq %rdi, %rdi
je 0x529969
testl %esi, %esi
jle 0x529970
testl %eax, %eax
je 0x528db2
movl 0x34(%r14), %esi
movq %rdi, 0x60(%rsp)
movq %rdx, 0x8(%rsp)
movslq 0x20(%r14), %rax
movl %r8d, %ecx
negl %r8d
movq %rcx, 0x28(%rsp)
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
movq %r15, %r12
subq %rax, %r12
cmpl %r8d, %eax
cmovgq %rcx, %r12
incq %r12
movslq 0x1c(%r14), %rax
movq %rax, 0x20(%rsp)
vmovq %r12, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x1a0(%rsp)
vmovdqa %ymm0, 0x100(%rsp)
vmovdqa %ymm0, 0x80(%rsp)
vmovdqa %ymm0, 0x160(%rsp)
movq %rsi, (%rsp)
movl %esi, %edi
movl %ebx, %esi
vzeroupper
callq 0x209630
testq %rax, %rax
je 0x529975
movl %r13d, 0x58(%rsp)
movq %r12, 0x68(%rsp)
movq %rax, 0x10(%rsp)
orl $0x4841004, 0xc(%rax)   # imm = 0x4841004
movq %rbx, 0x18(%rsp)
leal 0x6(%rbx), %r12d
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094de
movq %rax, %r13
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094de
movq %rax, %rbx
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094de
movq %r13, 0x40(%rsp)
testq %r13, %r13
sete %dl
testq %rbx, %rbx
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x529975
movq %rax, 0x70(%rsp)
movq (%rsp), %rax
movslq %eax, %r12
cmpl $0x0, 0x30(%r14)
movq %rbx, 0x38(%rsp)
je 0x528ecc
xorl %r13d, %r13d
movq 0x18(%rsp), %rbx
jmp 0x528f4e
leal 0x3(%rax), %ecx
movl %ecx, 0x50(%rsp)
movslq %ecx, %rsi
movl $0x20, %edi
movq %rax, %r14
callq 0x2094de
testq %rax, %rax
movq 0x18(%rsp), %rbx
je 0x529975
movq %rax, %r13
testl %r14d, %r14d
movq 0x60(%rsp), %rdi
jle 0x528f20
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %r14d, %ecx
xorl %edx, %edx
movzbl (%rdi,%rdx), %esi
movslq (%rax,%rsi,4), %rsi
movq %rsi, (%r13,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x528f0b
leal 0x1(%r14), %eax
movl 0x50(%rsp), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
leaq (,%r12,8), %rdi
addq %r13, %rdi
movl %r14d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %esi, %esi
callq 0x19e090
leal 0x3(%rbx), %r14d
subq 0x20(%rsp), %r15
addq $-0x2, %r15
vmovq %r15, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x180(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x3f, 0x80(%rsp), %ymm0, %ymm0 # ymm0 = mem[0,1,2,3,4,5],ymm0[6,7]
vmovdqa %ymm0, 0x200(%rsp)
vmovsd 0x28(%rsp), %xmm0
vbroadcastsd %xmm0, %ymm0
vmovaps %ymm0, 0x260(%rsp)
movl 0x58(%rsp), %eax
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x240(%rsp)
vmovq %r12, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x1e0(%rsp)
movl %ebx, %edi
vmovq %rdi, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x220(%rsp)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, %ebx
movl $0x1, %r15d
cmovgel %ebx, %r15d
xorl %ecx, %ecx
movq 0x40(%rsp), %rsi
movq 0x8(%rsp), %r8
movzbl (%r8,%rcx), %edx
movslq (%rax,%rdx,4), %rdx
movq %rdx, 0x18(%rsi,%rcx,8)
incq %rcx
cmpq %rcx, %r15
jne 0x528ffa
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
leal 0x1(%rbx), %eax
cmpl %eax, %r14d
cmovgl %r14d, %eax
movq %rdi, 0x30(%rsp)
leaq (%rsi,%rdi,8), %rdi
addq $0x18, %rdi
movl %ebx, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %ebx, %ebx
xorl %esi, %esi
vzeroupper
callq 0x19e090
movq 0x68(%rsp), %r9
movq 0x38(%rsp), %rdx
movq 0x70(%rsp), %r10
movq $0x0, 0x18(%rdx,%rbx,8)
movq %r9, 0x18(%r10,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x529060
xorl %eax, %eax
movq 0x10(%rsp), %r8
movq (%rsp), %rsi
movq %r9, (%rdx,%rax,8)
movq %r9, (%r10,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x529081
movq 0x30(%rsp), %rax
addq $0x3, %rax
movq 0x18(%rsp), %rcx
movq %r9, (%rdx,%rax,8)
movq %r9, (%r10,%rax,8)
incq %rax
incl %ecx
cmpl %ecx, %r14d
jg 0x5290a0
vmovdqa 0x1a0(%rsp), %ymm2
vmovdqa 0x160(%rsp), %ymm3
vmovapd 0x100(%rsp), %ymm4
testl %esi, %esi
jle 0x52982f
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xb8(%rsp)
leal -0x1(%rsi), %eax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
decl %eax
movq %rax, 0x18(%rsp)
cmpl $0x2, %r14d
movl $0x1, %eax
cmovgel %r14d, %eax
movq %rax, 0xd8(%rsp)
movl %esi, %eax
movq %rax, (%rsp)
movq 0x30(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xd0(%rsp)
addq $0x2, %rax
movq %rax, 0xc8(%rsp)
vmovaps 0xd0587(%rip), %ymm0    # 0x5f96c0
vmovaps %ymm0, 0x140(%rsp)
xorl %r11d, %r11d
vpcmpeqd %ymm7, %ymm7, %ymm7
vbroadcastsd 0xd082e(%rip), %ymm0 # 0x5f9980
vmovaps %ymm0, 0x1c0(%rsp)
vmovdqa 0x180(%rsp), %ymm1
vmovdqa 0x80(%rsp), %ymm0
vmovdqa %ymm0, 0x120(%rsp)
movq %r13, 0xc0(%rsp)
movq 0x10(%rbp), %rdi
movl 0x30(%rdi), %edx
movq %r11, %rax
testl %edx, %edx
jne 0x529191
movq (%r13,%r11,8), %rax
movq %r11, %rsi
orq $0x1, %rsi
testl %edx, %edx
movq %rsi, 0x28(%rsp)
je 0x5291b2
cmpq (%rsp), %rsi
movq 0x8(%rsp), %rcx
cmovbl %esi, %ecx
movslq %ecx, %rsi
jmp 0x5291b7
movq (%r13,%rsi,8), %rsi
movq %r11, %rcx
orq $0x2, %rcx
testl %edx, %edx
movq %rcx, 0x20(%rsp)
je 0x5291dc
cmpq (%rsp), %rcx
movq %rcx, %r9
movq 0x8(%rsp), %rcx
cmovbl %r9d, %ecx
movslq %ecx, %rcx
jmp 0x5291e1
movq (%r13,%rcx,8), %rcx
movq %r11, %r9
orq $0x3, %r9
testl %edx, %edx
movq %r9, 0x78(%rsp)
movq %r11, 0x48(%rsp)
je 0x529208
cmpq (%rsp), %r9
movq 0x8(%rsp), %rdx
cmovbl %r9d, %edx
movslq %edx, %rdx
jmp 0x52920d
movq (%r13,%r9,8), %rdx
movslq 0x18(%rdi), %rdi
imulq %rdi, %rax
movq 0xb8(%rsp), %r9
leaq (%r9,%rax,4), %rax
movq %rax, 0xf8(%rsp)
imulq %rdi, %rsi
leaq (%r9,%rsi,4), %rax
movq %rax, 0xf0(%rsp)
imulq %rdi, %rcx
leaq (%r9,%rcx,4), %rax
movq %rax, 0xe8(%rsp)
imulq %rdi, %rdx
leaq (%r9,%rdx,4), %rax
movq %rax, 0xe0(%rsp)
vmovdqa 0x1e0(%rsp), %ymm0
vpcmpgtq 0x140(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x280(%rsp)
xorl %r13d, %r13d
vpmovsxbq 0xce931(%rip), %ymm10 # 0x5f7bb2
vmovdqa 0x80(%rsp), %ymm14
vmovdqa %ymm14, %ymm15
vmovdqa 0x200(%rsp), %ymm11
vmovdqa %ymm11, %ymm12
movq 0x38(%rsp), %rax
vmovdqa %ymm11, %ymm13
vpermq $0xf9, %ymm12, %ymm6    # ymm6 = ymm12[1,2,3,3]
vpbroadcastq 0x18(%rax,%r13,8), %ymm11
vpblendd $0xc0, %ymm11, %ymm6, %ymm11 # ymm11 = ymm6[0,1,2,3,4,5],ymm11[6,7]
vpermq $0xf9, %ymm15, %ymm6    # ymm6 = ymm15[1,2,3,3]
vpbroadcastq 0x18(%r10,%r13,8), %ymm15
vpblendd $0xc0, %ymm15, %ymm6, %ymm6 # ymm6 = ymm6[0,1,2,3,4,5],ymm15[6,7]
vmovdqa 0x260(%rsp), %ymm0
vpsubq %ymm0, %ymm11, %ymm15
vmovdqa 0x240(%rsp), %ymm5
vpsubq %ymm5, %ymm6, %ymm6
vmovq %xmm15, %rax
vmovq %xmm6, %r8
cmpq %r8, %rax
cmovgq %rax, %r8
vpextrq $0x1, %xmm15, %rax
vpextrq $0x1, %xmm6, %rbx
cmpq %rbx, %rax
cmovgq %rax, %rbx
vextracti128 $0x1, %ymm15, %xmm15
vmovq %xmm15, %rax
vextracti128 $0x1, %ymm6, %xmm6
vmovq %xmm6, %rdi
cmpq %rdi, %rax
cmovgq %rax, %rdi
vpextrq $0x1, %xmm15, %rax
vpextrq $0x1, %xmm6, %r12
cmpq %r12, %rax
cmovgq %rax, %r12
vpsubq %ymm0, %ymm12, %ymm6
vpsubq %ymm5, %ymm14, %ymm12
vmovq %xmm6, %rax
vmovq %xmm12, %r15
cmpq %r15, %rax
cmovgq %rax, %r15
vpextrq $0x1, %xmm6, %rcx
vpextrq $0x1, %xmm12, %rax
cmpq %rax, %rcx
cmovgq %rcx, %rax
vextracti128 $0x1, %ymm6, %xmm6
vmovq %xmm6, %rcx
vextracti128 $0x1, %ymm12, %xmm12
vmovq %xmm12, %r14
cmpq %r14, %rcx
cmovgq %rcx, %r14
vpextrq $0x1, %xmm6, %rcx
movq 0x40(%rsp), %r10
movq 0x18(%r10,%r13,8), %rdx
movq 0xf8(%rsp), %rsi
movslq (%rsi,%rdx,4), %rdx
movq 0x10(%r10,%r13,8), %rsi
movq 0xf0(%rsp), %r9
movslq (%r9,%rsi,4), %rsi
movq (%r10,%r13,8), %r9
movq 0x8(%r10,%r13,8), %r10
movq 0xe8(%rsp), %r11
movslq (%r11,%r10,4), %r10
movq 0xe0(%rsp), %r11
movslq (%r11,%r9,4), %r9
vmovq %rdx, %xmm6
vmovq %rsi, %xmm14
vpunpcklqdq %xmm6, %xmm14, %xmm6 # xmm6 = xmm14[0],xmm6[0]
vmovq %r10, %xmm14
vmovq %r9, %xmm15
vpunpcklqdq %xmm14, %xmm15, %xmm14 # xmm14 = xmm15[0],xmm14[0]
vinserti128 $0x1, %xmm6, %ymm14, %ymm6
vpaddq %ymm6, %ymm13, %ymm6
vpextrq $0x1, %xmm12, %r10
cmpq %r10, %rcx
cmovgq %rcx, %r10
vmovq %xmm6, %rcx
cmpq %r15, %rcx
cmovleq %r15, %rcx
vpextrq $0x1, %xmm6, %rsi
cmpq %rax, %rsi
cmovleq %rax, %rsi
vextracti128 $0x1, %ymm6, %xmm6
vmovq %xmm6, %rdx
cmpq %r14, %rdx
cmovleq %r14, %rdx
vpextrq $0x1, %xmm6, %r9
cmpq %r10, %r9
cmovleq %r10, %r9
cmpq %r8, %rcx
movq %r8, 0x60(%rsp)
cmovleq %r8, %rcx
cmpq %rbx, %rsi
movq %rbx, 0x58(%rsp)
cmovleq %rbx, %rsi
cmpq %rdi, %rdx
movq %rdi, 0x50(%rsp)
cmovleq %rdi, %rdx
cmpq %r12, %r9
cmovleq %r12, %r9
movq %rcx, %r11
sarq $0x3f, %r11
andnq %rcx, %r11, %rcx
movq %rsi, %r11
sarq $0x3f, %r11
andnq %rsi, %r11, %rsi
movq %rdx, %r11
sarq $0x3f, %r11
andnq %rdx, %r11, %rdx
movq %r9, %r11
sarq $0x3f, %r11
andnq %r9, %r11, %r9
vmovq %r9, %xmm6
vmovq %rdx, %xmm12
vmovq %rsi, %xmm13
vmovq %rcx, %xmm14
vpunpcklqdq %xmm6, %xmm12, %xmm6 # xmm6 = xmm12[0],xmm6[0]
vpunpcklqdq %xmm13, %xmm14, %xmm12 # xmm12 = xmm14[0],xmm13[0]
vinserti128 $0x1, %xmm6, %ymm12, %ymm14
vpcmpeqq %ymm7, %ymm10, %ymm13
vpandn %ymm14, %ymm13, %ymm12
vextracti128 $0x1, %ymm12, %xmm15
cmpq $0x4, %r13
jb 0x5295be
vmovq %xmm1, %r9
vmovq %xmm12, %rsi
cmpq %rsi, %r9
cmovgeq %rsi, %r9
vpextrq $0x1, %xmm1, %rdx
vpextrq $0x1, %xmm12, %r11
cmpq %r11, %rdx
cmovgeq %r11, %rdx
vextracti128 $0x1, %ymm1, %xmm1
vmovq %xmm1, %rdi
vmovq %xmm15, %rbx
cmpq %rbx, %rdi
cmovgeq %rbx, %rdi
vpextrq $0x1, %xmm1, %r8
vpextrq $0x1, %xmm15, %rcx
cmpq %rcx, %r8
cmovgeq %rcx, %r8
vmovq %r8, %xmm1
movq 0x10(%rsp), %r8
vmovq %rdi, %xmm6
vpunpcklqdq %xmm1, %xmm6, %xmm1 # xmm1 = xmm6[0],xmm1[0]
vmovdqa 0x120(%rsp), %ymm0
vmovq %xmm0, %rdi
cmpq %rsi, %rdi
cmovgq %rdi, %rsi
vpextrq $0x1, %xmm0, %rdi
vmovq %rdx, %xmm6
cmpq %r11, %rdi
cmovgq %rdi, %r11
vmovq %r9, %xmm8
vextracti128 $0x1, %ymm0, %xmm0
vmovq %xmm0, %rdx
cmpq %rbx, %rdx
cmovgq %rdx, %rbx
vpextrq $0x1, %xmm0, %rdx
vpunpcklqdq %xmm6, %xmm8, %xmm0 # xmm0 = xmm8[0],xmm6[0]
cmpq %rcx, %rdx
cmovgq %rdx, %rcx
vinserti128 $0x1, %xmm1, %ymm0, %ymm1
vmovq %rcx, %xmm0
vmovq %rbx, %xmm6
vpunpcklqdq %xmm0, %xmm6, %xmm0 # xmm0 = xmm6[0],xmm0[0]
vmovq %r11, %xmm6
vmovq %rsi, %xmm8
vpunpcklqdq %xmm6, %xmm8, %xmm6 # xmm6 = xmm8[0],xmm6[0]
vinserti128 $0x1, %xmm0, %ymm6, %ymm0
vmovdqa %ymm0, 0x120(%rsp)
movq 0x30(%rsp), %r9
jmp 0x5295c8
movq 0x30(%rsp), %r9
movq 0x10(%rsp), %r8
movq 0x48(%rsp), %rcx
cmpq 0x8(%rsp), %rcx
setne %cl
movq 0x10(%r8), %rdx
movq (%rdx), %r11
movq 0x8(%rdx), %rsi
cmpq %r9, %r13
setae %dl
orb %cl, %dl
jne 0x5295f1
vpextrd $0x2, %xmm15, (%r11,%r13,4)
cmpq %r13, 0x18(%rsp)
jne 0x529604
movq 0x48(%rsp), %rcx
vpextrd $0x2, %xmm15, (%rsi,%rcx,4)
movq 0x28(%rsp), %rcx
cmpq 0x8(%rsp), %rcx
setne %cl
leaq -0x1(%r13), %rdx
cmpq %r9, %rdx
setae %dl
orb %cl, %dl
jne 0x529626
vmovd %xmm15, -0x4(%r11,%r13,4)
movq 0x28(%rsp), %rcx
cmpq (%rsp), %rcx
setae %cl
cmpq %r13, %r9
setne %dl
orb %cl, %dl
jne 0x529646
movq 0x28(%rsp), %rcx
vmovd %xmm15, (%rsi,%rcx,4)
movq 0x20(%rsp), %rcx
cmpq 0x8(%rsp), %rcx
jne 0x529677
leaq -0x2(%r13), %rcx
cmpq $0x2, %r13
setae %dl
cmpq %r9, %rcx
setl %cl
andb %dl, %cl
cmpb $0x1, %cl
movq 0x20(%rsp), %rcx
jne 0x529677
vpextrd $0x2, %xmm12, -0x8(%r11,%r13,4)
cmpq (%rsp), %rcx
setae %cl
cmpq %r13, 0xd0(%rsp)
setne %dl
orb %cl, %dl
jne 0x529699
movq 0x20(%rsp), %rcx
vpextrd $0x2, %xmm12, (%rsi,%rcx,4)
movq 0x78(%rsp), %rdx
cmpq 0x8(%rsp), %rdx
jne 0x5296c6
leaq -0x3(%r13), %rcx
cmpq $0x3, %r13
setb %dl
cmpq %r9, %rcx
setge %cl
orb %dl, %cl
movq 0x78(%rsp), %rdx
jne 0x5296c6
vmovd %xmm12, -0xc(%r11,%r13,4)
vmovq %r12, %xmm6
vmovq 0x50(%rsp), %xmm8
vpunpcklqdq %xmm6, %xmm8, %xmm6 # xmm6 = xmm8[0],xmm6[0]
vmovq 0x58(%rsp), %xmm8
vmovq 0x60(%rsp), %xmm15
vpunpcklqdq %xmm8, %xmm15, %xmm8 # xmm8 = xmm15[0],xmm8[0]
vinserti128 $0x1, %xmm6, %ymm8, %ymm8
vmovq %r10, %xmm6
vmovq %r14, %xmm15
vpunpcklqdq %xmm6, %xmm15, %xmm6 # xmm6 = xmm15[0],xmm6[0]
vmovq %rax, %xmm15
vmovq %r15, %xmm5
vpunpcklqdq %xmm15, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm15[0]
vinserti128 $0x1, %xmm6, %ymm5, %ymm6
vblendvpd %ymm13, 0x80(%rsp), %ymm8, %ymm15
cmpq (%rsp), %rdx
setae %al
cmpq %r13, 0xc8(%rsp)
setne %cl
orb %al, %cl
jne 0x529735
vmovd %xmm12, (%rsi,%rdx,4)
vpcmpgtq %ymm7, %ymm10, %ymm5
vmovdqa 0x220(%rsp), %ymm0
vpcmpgtq %ymm10, %ymm0, %ymm8
vpand 0x280(%rsp), %ymm8, %ymm8
vpand %ymm5, %ymm8, %ymm5
vextracti128 $0x1, %ymm5, %xmm8
vpackssdw %xmm8, %xmm5, %xmm8
vpcmpeqq %ymm2, %ymm12, %ymm9
vpcmpgtq %ymm2, %ymm12, %ymm7
vpand %ymm5, %ymm7, %ymm0
vblendvpd %ymm0, %ymm14, %ymm2, %ymm2
vextracti128 $0x1, %ymm0, %xmm14
vpackssdw %xmm14, %xmm0, %xmm0
vpcmpgtq %ymm10, %ymm3, %ymm14
vpand %ymm14, %ymm9, %ymm9
vextracti128 $0x1, %ymm9, %xmm14
vpackssdw %xmm14, %xmm9, %xmm14
vblendvps %xmm14, %xmm8, %xmm0, %xmm0
vblendvpd %ymm13, 0x80(%rsp), %ymm6, %ymm14
vpmovsxdq %xmm0, %ymm0
vblendvpd %ymm0, 0x140(%rsp), %ymm4, %ymm4
vpor %ymm7, %ymm9, %ymm0
vpcmpeqd %ymm7, %ymm7, %ymm7
vpand %ymm0, %ymm5, %ymm0
vblendvpd %ymm0, %ymm10, %ymm3, %ymm3
movq 0x38(%rsp), %rax
vmovq %xmm12, (%rax,%r13,8)
movq 0x70(%rsp), %r10
vmovlpd %xmm15, (%r10,%r13,8)
vpsubq %ymm7, %ymm10, %ymm10
incq %r13
cmpq %r13, 0xd8(%rsp)
jne 0x5292a2
vmovdqa 0x140(%rsp), %ymm0
vpaddq 0x1c0(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x140(%rsp)
movq 0x48(%rsp), %r11
addq $0x4, %r11
cmpq (%rsp), %r11
movq 0x68(%rsp), %r9
movq 0xc0(%rsp), %r13
jb 0x52917e
jmp 0x52984a
vmovdqa 0x80(%rsp), %ymm0
vmovdqa %ymm0, 0x120(%rsp)
vmovdqa 0x180(%rsp), %ymm1
vmovdqa %ymm2, 0x1a0(%rsp)
vmovdqa %ymm3, 0x160(%rsp)
vmovapd %ymm4, 0x100(%rsp)
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x10(%rbp), %rbx
movq 0x1a0(%rsp,%rdx,8), %rsi
cmpq %r9, %rsi
jle 0x52988f
movl 0x100(%rsp,%rdx,8), %eax
movl 0x160(%rsp,%rdx,8), %ecx
movq %rsi, %r9
jmp 0x5298c7
jne 0x5298c7
movq 0x160(%rsp,%rdx,8), %rsi
movslq %ecx, %rdi
cmpq %rdi, %rsi
jge 0x5298ac
movl 0x100(%rsp,%rdx,8), %eax
movl %esi, %ecx
jmp 0x5298c7
jne 0x5298c7
movq 0x100(%rsp,%rdx,8), %rdi
movslq %eax, %r8
cmpq %r8, %rdi
jge 0x5298c2
movl %esi, %ecx
movl %edi, %eax
movq 0x10(%rsp), %r8
incq %rdx
cmpl $0x4, %edx
jne 0x52986f
vmovdqa 0x80(%rsp), %ymm0
vpcmpgtq %ymm1, %ymm0, %ymm0
vmovdqa 0x120(%rsp), %ymm1
vpcmpgtq 0x180(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestpd %ymm0, %ymm0
je 0x529907
orb $0x40, 0xc(%r8)
xorl %r9d, %r9d
xorl %ecx, %ecx
xorl %eax, %eax
movl %r9d, (%r8)
movl %eax, 0x4(%r8)
movl %ecx, 0x8(%r8)
movq %r10, %rdi
vzeroupper
callq 0x2094b5
movq 0x38(%rsp), %rdi
callq 0x2094b5
movq 0x40(%rsp), %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%rbx)
jne 0x52993f
movq %r13, %rdi
callq 0x2094b5
movq 0x10(%rsp), %rax
jmp 0x529977
callq 0x1f0c15
jmp 0x529975
callq 0x1f0bef
jmp 0x529975
callq 0x1f0bc9
jmp 0x529975
callq 0x1f0ba3
jmp 0x529975
callq 0x1f0b7d
jmp 0x529975
callq 0x1f0b57
jmp 0x529975
callq 0x1f0b31
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop