// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/parasail/src/nw_trace_diag_avx2_256_64.c
// Function: parasail_nw_trace_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_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 s1Len = 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 vOpen;
    __m256i vGap;
    __m256i vOne;
    __m256i vN;
    __m256i vGapN;
    __m256i vNegOne;
    __m256i vI;
    __m256i vJreset;
    __m256i vMax;
    __m256i vILimit;
    __m256i vILimit1;
    __m256i vJLimit;
    __m256i vJLimit1;
    __m256i vIBoundary;
    __m256i vTDiag;
    __m256i vTIns;
    __m256i vTDel;
    __m256i vTDiagE;
    __m256i vTInsE;
    __m256i vTDiagF;
    __m256i vTDelF;

    /* 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 = s1Len-1;
    end_ref = s2Len-1;
    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);
    vOpen = _mm256_set1_epi64x_rpl(open);
    vGap  = _mm256_set1_epi64x_rpl(gap);
    vOne = _mm256_set1_epi64x_rpl(1);
    vN = _mm256_set1_epi64x_rpl(N);
    vGapN = _mm256_set1_epi64x_rpl(gap*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);
    vMax = vNegInf;
    vILimit = _mm256_set1_epi64x_rpl(s1Len);
    vILimit1 = _mm256_sub_epi64(vILimit, vOne);
    vJLimit = _mm256_set1_epi64x_rpl(s2Len);
    vJLimit1 = _mm256_sub_epi64(vJLimit, vOne);
    vIBoundary = _mm256_set_epi64x_rpl(
            -open-0*gap,
            -open-1*gap,
            -open-2*gap,
            -open-3*gap);
    vTDiag = _mm256_set1_epi64x_rpl(PARASAIL_DIAG);
    vTIns = _mm256_set1_epi64x_rpl(PARASAIL_INS);
    vTDel = _mm256_set1_epi64x_rpl(PARASAIL_DEL);
    vTDiagE = _mm256_set1_epi64x_rpl(PARASAIL_DIAG_E);
    vTInsE = _mm256_set1_epi64x_rpl(PARASAIL_INS_E);
    vTDiagF = _mm256_set1_epi64x_rpl(PARASAIL_DIAG_F);
    vTDelF = _mm256_set1_epi64x_rpl(PARASAIL_DEL_F);

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

    /* set known flags */
    result->flag |= PARASAIL_FLAG_NW | PARASAIL_FLAG_DIAG
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_4;

    /* 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] = -open - j*gap;
        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;
    }
    H_pr[-1] = 0; /* upper left corner */

    /* iterate over query sequence */
    for (i=0; i<s1Len; i+=N) {
        __m256i vNH = vNegInf;
        __m256i vWH = vNegInf;
        __m256i vE = vNegInf;
        __m256i vE_opn = vNegInf;
        __m256i vE_ext = vNegInf;
        __m256i vF = vNegInf;
        __m256i vF_opn = vNegInf;
        __m256i vF_ext = 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))];
        vNH = _mm256_srli_si256_rpl(vNH, 8);
        vNH = _mm256_insert_epi64_rpl(vNH, H_pr[-1], 3);
        vWH = _mm256_srli_si256_rpl(vWH, 8);
        vWH = _mm256_insert_epi64_rpl(vWH, -open - i*gap, 3);
        H_pr[-1] = -open - (i+N)*gap;
        /* 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_opn = _mm256_sub_epi64(vNH, vOpen);
            vF_ext = _mm256_sub_epi64(vF, vGap);
            vF = _mm256_max_epi64_rpl(vF_opn, vF_ext);
            vE_opn = _mm256_sub_epi64(vWH, vOpen);
            vE_ext = _mm256_sub_epi64(vE, vGap);
            vE = _mm256_max_epi64_rpl(vE_opn, vE_ext);
            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);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m256i cond = _mm256_cmpeq_epi64(vJ,vNegOne);
                vWH = _mm256_blendv_epi8(vWH, vIBoundary, cond);
                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);
            }
            /* trace table */
            {
                __m256i case1 = _mm256_cmpeq_epi64(vWH, vNWH);
                __m256i case2 = _mm256_cmpeq_epi64(vWH, vF);
                __m256i vT = _mm256_blendv_epi8(
                        _mm256_blendv_epi8(vTIns, vTDel, case2),
                        vTDiag,
                        case1);
                __m256i condE = _mm256_cmpgt_epi64(vE_opn, vE_ext);
                __m256i condF = _mm256_cmpgt_epi64(vF_opn, vF_ext);
                __m256i vET = _mm256_blendv_epi8(vTInsE, vTDiagE, condE);
                __m256i vFT = _mm256_blendv_epi8(vTDelF, vTDiagF, condF);
                vT = _mm256_or_si256(vT, vET);
                vT = _mm256_or_si256(vT, vFT);
                arr_store_si256(result->trace->trace_table, vT, i, s1Len, j, s2Len);
            }
            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
               last table value at the i,j bound */
            {
                __m256i cond_valid_I = _mm256_cmpeq_epi64(vI, vILimit1);
                __m256i cond_valid_J = _mm256_cmpeq_epi64(vJ, vJLimit1);
                __m256i cond_all = _mm256_and_si256(cond_valid_I, cond_valid_J);
                vMax = _mm256_blendv_epi8(vMax, vWH, cond_all);
            }
            vJ = _mm256_add_epi64(vJ, vOne);
        }
        vI = _mm256_add_epi64(vI, vN);
        vIBoundary = _mm256_sub_epi64(vIBoundary, vGapN);
    }

    /* max in vMax */
    for (i=0; i<N; ++i) {
        int64_t value;
        value = (int64_t) _mm256_extract_epi64_rpl(vMax, 3);
        if (value > score) {
            score = value;
        }
        vMax = _mm256_slli_si256_rpl(vMax, 8);
    }

    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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
testq %rdx, %rdx
je 0x5b0e6d
movl %ecx, %ebx
testl %ecx, %ecx
jle 0x5b0e74
movl %r8d, %r12d
testl %r8d, %r8d
js 0x5b0e7b
movl %r9d, %r14d
testl %r9d, %r9d
js 0x5b0e82
movq 0x2d0(%rsp), %r8
testq %r8, %r8
je 0x5b0e89
cmpl $0x0, 0x30(%r8)
je 0x5b0566
movl 0x34(%r8), %r13d
jmp 0x5b057a
testq %rdi, %rdi
je 0x5b0e90
movl %esi, %r13d
testl %esi, %esi
jle 0x5b0e97
movq %rdi, 0xf0(%rsp)
movq %rdx, 0x28(%rsp)
movslq 0x20(%r8), %rax
movl %r12d, %ecx
movq %rcx, 0x70(%rsp)
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %rbp # imm = 0x8000000000000000
movq %rbp, %rsi
subq %rax, %rsi
movslq 0x1c(%r8), %rdx
movq %rdx, 0x20(%rsp)
movl %r12d, %edx
negl %edx
movl %edx, 0x90(%rsp)
cmpl %edx, %eax
cmovgq %rcx, %rsi
movq %rsi, 0x10(%rsp)
movl $0x20, %edx
movl $0x1, %ecx
movl %r13d, %edi
movl %ebx, %esi
callq 0x20adf4
testq %rax, %rax
je 0x5b0e9c
movq %rax, %r15
movl %r12d, 0x130(%rsp)
movq %r14, 0x150(%rsp)
orl $0x4881001, 0xc(%rax)   # imm = 0x4881001
leal 0x6(%rbx), %r12d
movl $0x20, %edi
movq %r12, %rsi
callq 0x20a636
movq %rax, %r14
movl $0x20, %edi
movq %r12, %rsi
callq 0x20a636
movl $0x20, %edi
movq %r12, %rsi
movq %rax, %r12
callq 0x20a636
testq %r14, %r14
sete %dl
testq %r12, %r12
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x5b0e9c
movq %rbx, 0xd0(%rsp)
movq %r15, 0x68(%rsp)
movq %r13, %rbx
movslq %ebx, %r13
movq 0x2d0(%rsp), %r15
cmpl $0x0, 0x30(%r15)
movq %rax, 0x30(%rsp)
je 0x5b067f
movq %rbx, 0x8(%rsp)
xorl %eax, %eax
jmp 0x5b06ff
leal 0x3(%rbx), %eax
movl %eax, 0x170(%rsp)
movslq %eax, %rsi
movl $0x20, %edi
callq 0x20a636
testq %rax, %rax
je 0x5b0e9c
movq %rbx, 0x8(%rsp)
testl %ebx, %ebx
movq 0xf0(%rsp), %rdi
jle 0x5b06ca
movq 0x10(%r15), %rsi
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %edx
movslq (%rsi,%rdx,4), %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r13
jne 0x5b06b6
movq 0x8(%rsp), %rcx
leal 0x1(%rcx), %edx
movl 0x170(%rsp), %esi
cmpl %edx, %esi
cmovgl %esi, %edx
leaq (%rax,%r13,8), %rdi
notl %ecx
addl %edx, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %esi, %esi
movq %rax, 0x18(%rsp)
callq 0x19e090
movq 0x18(%rsp), %rax
movq 0xd0(%rsp), %r8
movl 0x90(%rsp), %edi
movq 0x70(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq %rax, 0x18(%rsp)
leal 0x3(%r8), %r9d
movq 0x8(%rsp), %rax
decl %eax
movl %eax, 0x4(%rsp)
subq %rdx, %rbp
leal -0x1(%r8), %eax
movl %eax, 0x3c(%rsp)
addq $-0x2, %rbp
vmovq %rbp, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x110(%rsp)
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x170(%rsp)
movq 0x150(%rsp), %rsi
leal (,%rsi,4), %eax
vmovq %rax, %xmm0
leaq -0x1(%r13), %rax
vmovq %rax, %xmm1
movl %edi, %ecx
subl %esi, %ecx
subl %esi, %ecx
leal (%rsi,%rsi,2), %eax
addl 0x130(%rsp), %eax
movl %edi, %edx
subl %esi, %edx
movl %esi, %esi
movq %rsi, 0x40(%rsp)
vmovq %rsi, %xmm2
vpbroadcastq %xmm2, %ymm2
vmovdqu %ymm2, 0x150(%rsp)
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x1d0(%rsp)
vpbroadcastq %xmm1, %ymm0
vmovdqu %ymm0, 0x1b0(%rsp)
negl %eax
vmovd %eax, %xmm0
movl %r8d, %ebp
vpinsrd $0x1, %ecx, %xmm0, %xmm0
leaq -0x1(%rbp), %rcx
movq %rcx, 0x60(%rsp)
vmovq %rcx, %xmm1
vpbroadcastq %xmm1, %ymm1
vmovdqu %ymm1, 0x130(%rsp)
movq 0x10(%rsp), %rax
incq %rax
movq %rax, 0x10(%rsp)
vmovq %rax, %xmm1
vpinsrd $0x2, %edx, %xmm0, %xmm0
vpinsrd $0x3, %edi, %xmm0, %xmm0
vpbroadcastq %xmm1, %ymm1
vmovdqu %ymm1, 0xf0(%rsp)
vpmovsxdq %xmm0, %ymm0
vmovdqu %ymm0, 0x90(%rsp)
movq 0x10(%r15), %rax
xorl %ecx, %ecx
movq 0x28(%rsp), %rsi
movzbl (%rsi,%rcx), %edx
movslq (%rax,%rdx,4), %rdx
movq %rdx, 0x18(%r14,%rcx,8)
incq %rcx
cmpq %rcx, %rbp
jne 0x5b0838
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, (%r14)
movq $0x0, 0x10(%r14)
leal 0x1(%r8), %eax
cmpl %eax, %r9d
movl %r9d, 0x70(%rsp)
cmovgl %r9d, %eax
leaq (%r14,%rbp,8), %rdi
addq $0x18, %rdi
movl %r8d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %ebx, %ebx
xorl %esi, %esi
vzeroupper
callq 0x19e090
vmovdqu 0x90(%rsp), %ymm0
vextracti128 $0x1, %ymm0, %xmm0
vpextrq $0x1, %xmm0, %rax
movq %rax, 0xc0(%rsp)
movq 0x10(%rsp), %rcx
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rdx
movq %rax, 0x18(%r12,%rbx,8)
movq %rcx, 0x18(%rdi,%rbx,8)
incq %rbx
subq %rdx, %rax
cmpq %rbx, %rbp
jne 0x5b08bd
xorl %eax, %eax
movq %rcx, (%r12,%rax,8)
movq %rcx, (%rdi,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x5b08d4
leaq 0x3(%rbp), %rax
vmovdqu 0xf0(%rsp), %ymm12
movq 0xd0(%rsp), %rdx
movl 0x70(%rsp), %esi
movq %rcx, (%r12,%rax,8)
movq %rcx, (%rdi,%rax,8)
incq %rax
incl %edx
cmpl %edx, %esi
jg 0x5b08fe
movq $0x0, 0x10(%r12)
vmovdqa %ymm12, %ymm2
vmovdqa %ymm12, %ymm0
vmovdqu 0x110(%rsp), %ymm1
cmpl $0x0, 0x8(%rsp)
jle 0x5b0dd6
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x3, %ymm0, %ymm12, %ymm0 # ymm0 = ymm0[0,1],ymm12[2,3,4,5,6,7]
vpermq $0x39, %ymm0, %ymm0     # ymm0 = ymm0[1,2,3,0]
vmovdqu %ymm0, 0x190(%rsp)
cmpl $0x2, %esi
movl $0x1, %eax
cmovgel %esi, %eax
movq %rax, 0x8(%rsp)
leaq -0x3(%rbp,%rbp,2), %rax
movq %rax, 0x58(%rsp)
leaq -0x2(%rbp,%rbp), %rax
movq %rax, 0x48(%rsp)
leaq (,%rbp,4), %rax
movq %rax, 0xb8(%rsp)
vpmovsxbq 0x7b560(%rip), %ymm9 # 0x62beea
movq $0x0, 0x50(%rsp)
vbroadcastsd 0x799b4(%rip), %ymm0 # 0x62a350
vmovups %ymm0, 0xd0(%rsp)
vbroadcastsd 0x7d1da(%rip), %ymm0 # 0x62db88
vmovups %ymm0, 0x70(%rsp)
vbroadcastsd 0x7f2eb(%rip), %ymm0 # 0x62fca8
vmovups %ymm0, 0x270(%rsp)
vbroadcastsd 0x7f2e1(%rip), %ymm0 # 0x62fcb0
vmovups %ymm0, 0x250(%rsp)
vbroadcastsd 0x7f2d7(%rip), %ymm0 # 0x62fcb8
vmovups %ymm0, 0x230(%rsp)
vbroadcastsd 0x7f2cd(%rip), %ymm0 # 0x62fcc0
vmovups %ymm0, 0x210(%rsp)
xorl %r10d, %r10d
vmovdqu 0x110(%rsp), %ymm1
vmovdqa %ymm12, %ymm0
vmovdqa %ymm12, %ymm2
movq %r10, %rbx
orq $0x2, %rbx
cmpl $0x0, 0x30(%r15)
je 0x5b0a51
movq %r10, %rax
orq $0x1, %rax
cmpq %r13, %rax
movl 0x4(%rsp), %ecx
cmovgel %ecx, %eax
cltq
cmpq %r13, %rbx
movl %ebx, %edx
cmovgel %ecx, %edx
movslq %edx, %rdx
movq %r10, %rsi
orq $0x3, %rsi
cmpq %r13, %rsi
cmovgel %ecx, %esi
movslq %esi, %rsi
movq %r10, %rdi
jmp 0x5b0a68
movq 0x18(%rsp), %rcx
movq (%rcx,%r10,8), %rdi
movq 0x8(%rcx,%r10,8), %rax
movq (%rcx,%rbx,8), %rdx
movq 0x18(%rcx,%r10,8), %rsi
movq 0x8(%r15), %r8
movslq 0x18(%r15), %r9
imulq %r9, %rax
leaq (%r8,%rax,4), %rax
movq %rax, 0x20(%rsp)
imulq %r9, %rdi
leaq (%r8,%rdi,4), %rax
movq %rax, 0x28(%rsp)
imulq %r9, %rdx
leaq (%r8,%rdx,4), %r11
imulq %r9, %rsi
leaq (%r8,%rsi,4), %rsi
leaq 0x4(%r10), %rdx
movq %rdx, 0xc8(%rsp)
movq 0x40(%rsp), %rcx
imulq %rcx, %rdx
movq 0xc0(%rsp), %rdi
movq %rdi, %r8
subq %rdx, %r8
vpbroadcastq 0x10(%r12), %ymm3
movq %r8, 0x10(%r12)
movq %r10, %rdx
imulq %rcx, %rdx
movq %rdi, %r8
subq %rdx, %r8
vmovq %r8, %xmm4
vpbroadcastq %xmm4, %ymm4
vmovdqu 0x190(%rsp), %ymm6
vpblendd $0xc0, %ymm4, %ymm6, %ymm5 # ymm5 = ymm6[0,1,2,3,4,5],ymm4[6,7]
vpblendd $0xc0, %ymm3, %ymm6, %ymm15 # ymm15 = ymm6[0,1,2,3,4,5],ymm3[6,7]
movq %r10, %r9
orq $0x1, %r9
orq $0x3, %r10
vmovdqu %ymm9, 0x1f0(%rsp)
vpcmpeqq 0x1b0(%rsp), %ymm9, %ymm13
xorl %edx, %edx
vpmovsxbq 0x7b3d0(%rip), %ymm14 # 0x62beee
vmovdqa %ymm12, %ymm3
vmovdqa %ymm12, %ymm4
movq 0x30(%rsp), %rdi
movq %r10, %rax
movq %rbx, %r10
vmovdqa %ymm15, %ymm6
vpermq $0xf9, %ymm5, %ymm7     # ymm7 = ymm5[1,2,3,3]
movq %r12, %rbx
vpbroadcastq 0x18(%r12,%rdx,8), %ymm9
vpblendd $0xc0, %ymm9, %ymm7, %ymm15 # ymm15 = ymm7[0,1,2,3,4,5],ymm9[6,7]
vpermq $0xf9, %ymm3, %ymm3     # ymm3 = ymm3[1,2,3,3]
vpbroadcastq 0x18(%rdi,%rdx,8), %ymm7
vpblendd $0xc0, %ymm7, %ymm3, %ymm3 # ymm3 = ymm3[0,1,2,3,4,5],ymm7[6,7]
vmovdqu 0x170(%rsp), %ymm7
vpsubq %ymm7, %ymm15, %ymm9
vpcmpeqd %ymm8, %ymm8, %ymm8
vmovdqu 0x150(%rsp), %ymm10
vpsubq %ymm10, %ymm3, %ymm3
vpsubq %ymm7, %ymm5, %ymm5
vpsubq %ymm10, %ymm4, %ymm4
movq 0x18(%r14,%rdx,8), %r8
movq 0x28(%rsp), %rcx
movslq (%rcx,%r8,4), %r8
movq 0x10(%r14,%rdx,8), %rcx
movq 0x20(%rsp), %rdi
movslq (%rdi,%rcx,4), %rcx
movq (%r14,%rdx,8), %r12
movq 0x8(%r14,%rdx,8), %r15
movslq (%r11,%r15,4), %r15
movslq (%rsi,%r12,4), %r12
vmovq %r8, %xmm7
vmovq %rcx, %xmm10
vpunpcklqdq %xmm7, %xmm10, %xmm10 # xmm10 = xmm10[0],xmm7[0]
vmovq %r15, %xmm7
vmovq %r12, %xmm11
vpunpcklqdq %xmm7, %xmm11, %xmm11 # xmm11 = xmm11[0],xmm7[0]
vpcmpgtq %ymm3, %ymm9, %ymm7
vblendvpd %ymm7, %ymm9, %ymm3, %ymm3
vinserti128 $0x1, %xmm10, %ymm11, %ymm10
vpcmpgtq %ymm4, %ymm5, %ymm9
vblendvpd %ymm9, %ymm5, %ymm4, %ymm4
vpaddq %ymm6, %ymm10, %ymm10
vpcmpgtq %ymm4, %ymm10, %ymm5
vblendvpd %ymm5, %ymm10, %ymm4, %ymm5
vpcmpgtq %ymm3, %ymm5, %ymm6
vblendvpd %ymm6, %ymm5, %ymm3, %ymm5
vpcmpeqq %ymm8, %ymm14, %ymm6
vblendvpd %ymm6, 0x90(%rsp), %ymm5, %ymm5
vblendvpd %ymm6, %ymm12, %ymm3, %ymm3
cmpq $0x4, %rdx
jb 0x5b0c38
vpcmpgtq %ymm1, %ymm5, %ymm11
vblendvpd %ymm11, %ymm1, %ymm5, %ymm1
vpcmpgtq %ymm5, %ymm0, %ymm11
vblendvpd %ymm11, %ymm0, %ymm5, %ymm0
vpcmpeqq %ymm10, %ymm5, %ymm10
vpcmpeqq %ymm3, %ymm5, %ymm11
vmovdqu 0xd0(%rsp), %ymm8
vpsubq %ymm11, %ymm8, %ymm11
vblendvpd %ymm10, 0x70(%rsp), %ymm11, %ymm10
vmovupd 0x250(%rsp), %ymm8
vblendvpd %ymm9, 0x270(%rsp), %ymm8, %ymm9
vmovupd 0x210(%rsp), %ymm8
vblendvpd %ymm7, 0x230(%rsp), %ymm8, %ymm7
vorpd %ymm7, %ymm9, %ymm7
vorpd %ymm7, %ymm10, %ymm7
movq 0x68(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx), %r8
vextractf128 $0x1, %ymm7, %xmm9
cmpq %rbp, %rdx
movq %rbx, %r12
jae 0x5b0cb1
movq 0x50(%rsp), %rcx
addq %r8, %rcx
vpextrb $0x8, %xmm9, (%rdx,%rcx)
cmpq %r13, %r9
setge %cl
leaq -0x1(%rdx), %r15
cmpq %rbp, %r15
setae %r15b
orb %cl, %r15b
vpcmpeqd %ymm10, %ymm10, %ymm10
movq %r10, %rbx
jne 0x5b0cde
movq 0x60(%rsp), %rcx
addq %r8, %rcx
vpextrb $0x0, %xmm9, (%rdx,%rcx)
cmpq %r13, %rbx
movq %rax, %r10
jge 0x5b0d0f
leaq -0x2(%rdx), %rcx
cmpq $0x2, %rdx
setae %r15b
cmpq %rbp, %rcx
setl %cl
andb %r15b, %cl
cmpb $0x1, %cl
jne 0x5b0d0f
movq 0x48(%rsp), %rcx
addq %r8, %rcx
vpextrb $0x8, %xmm7, (%rdx,%rcx)
cmpq %r13, %r10
setge %cl
cmpq $0x3, %rdx
setb %r15b
orb %cl, %r15b
jne 0x5b0d2e
addq 0x58(%rsp), %r8
vpextrb $0x0, %xmm7, (%rdx,%r8)
vmovupd 0xf0(%rsp), %ymm12
vblendvpd %ymm6, %ymm12, %ymm4, %ymm4
vmovq %xmm5, (%r12,%rdx,8)
movq 0x30(%rsp), %rdi
vmovq %xmm3, (%rdi,%rdx,8)
vpcmpeqq 0x130(%rsp), %ymm14, %ymm6
vpand %ymm6, %ymm13, %ymm6
vblendvpd %ymm6, %ymm5, %ymm2, %ymm2
vpsubq %ymm10, %ymm14, %ymm14
incq %rdx
cmpq %rdx, 0x8(%rsp)
jne 0x5b0b2b
vmovdqu 0x1f0(%rsp), %ymm9
vpaddq 0x70(%rsp), %ymm9, %ymm9
vmovdqu 0x90(%rsp), %ymm3
vpsubq 0x1d0(%rsp), %ymm3, %ymm3
vmovdqu %ymm3, 0x90(%rsp)
movq 0xb8(%rsp), %rax
addq %rax, 0x58(%rsp)
addq %rax, 0x50(%rsp)
addq %rax, 0x60(%rsp)
addq %rax, 0x48(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, %r10
cmpq %r13, %rax
movq 0x2d0(%rsp), %r15
jl 0x5b0a10
movl $0x4, %eax
movq 0x10(%rsp), %rdx
vextracti128 $0x1, %ymm2, %xmm3
vpextrq $0x1, %xmm3, %rcx
cmpq %rdx, %rcx
cmovgq %rcx, %rdx
vperm2i128 $0x8, %ymm2, %ymm2, %ymm3 # ymm3 = zero,zero,ymm2[0,1]
vpalignr $0x8, %ymm3, %ymm2, %ymm2 # ymm2 = ymm3[8,9,10,11,12,13,14,15],ymm2[0,1,2,3,4,5,6,7],ymm3[24,25,26,27,28,29,30,31],ymm2[16,17,18,19,20,21,22,23]
decl %eax
jne 0x5b0de0
vpcmpgtq %ymm1, %ymm12, %ymm1
vpcmpgtq 0x110(%rsp), %ymm0, %ymm0
vpor %ymm0, %ymm1, %ymm0
vtestpd %ymm0, %ymm0
movq 0x68(%rsp), %rbx
movl 0x3c(%rsp), %ecx
je 0x5b0e36
orb $0x40, 0xc(%rbx)
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x0, 0x4(%rsp)
movl %edx, (%rbx)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%rbx)
movl %ecx, 0x8(%rbx)
vzeroupper
callq 0x20a60d
movq %r12, %rdi
callq 0x20a60d
movq %r14, %rdi
callq 0x20a60d
cmpl $0x0, 0x30(%r15)
jne 0x5b0e9e
movq 0x18(%rsp), %rdi
callq 0x20a60d
jmp 0x5b0e9e
callq 0x1f9221
jmp 0x5b0e9c
callq 0x1f91fb
jmp 0x5b0e9c
callq 0x1f91d5
jmp 0x5b0e9c
callq 0x1f91af
jmp 0x5b0e9c
callq 0x1f9189
jmp 0x5b0e9c
callq 0x1f9163
jmp 0x5b0e9c
callq 0x1f913d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop