// File: /workspace/github_c_makefile_star2_O1/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 $0x338, %rsp            # imm = 0x338
testq %rdx, %rdx
je 0x57d344
movl %ecx, %r13d
testl %ecx, %ecx
jle 0x57d34b
testl %r8d, %r8d
js 0x57d352
testl %r9d, %r9d
js 0x57d359
movq %rdx, %r12
movq 0x370(%rsp), %rdx
testq %rdx, %rdx
je 0x57d360
movl 0x30(%rdx), %eax
testl %eax, %eax
jne 0x57c74e
testq %rdi, %rdi
je 0x57d367
movl %esi, %r14d
testl %esi, %esi
jle 0x57d36e
testl %eax, %eax
je 0x57c752
movl 0x34(%rdx), %r14d
movq %rdi, 0x58(%rsp)
movq %r9, 0xd0(%rsp)
movl %r8d, %r15d
negl %r15d
movslq 0x20(%rdx), %rax
movl %r8d, 0xf0(%rsp)
movl %r8d, %ecx
movq %rcx, 0x30(%rsp)
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %rbp # imm = 0x8000000000000000
movq %rbp, %rsi
subq %rax, %rsi
cmpl %r15d, %eax
cmovgq %rcx, %rsi
movq %rsi, 0x10(%rsp)
movslq 0x1c(%rdx), %rax
movq %rax, 0x60(%rsp)
movl $0x20, %edx
movl $0x1, %ecx
movl %r14d, %edi
movl %r13d, %esi
callq 0x2097d1
testq %rax, %rax
je 0x57d373
movq %rax, %rbx
movq %r12, 0x50(%rsp)
movl %r15d, 0x20(%rsp)
movq %r14, 0x28(%rsp)
orl $0x4881001, 0xc(%rax)   # imm = 0x4881001
leal 0x6(%r13), %r12d
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094de
movq %rax, %r14
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094de
movq %rax, %r15
movl $0x20, %edi
movq %r12, %rsi
callq 0x2094de
testq %r14, %r14
sete %dl
movq %r15, 0xa0(%rsp)
testq %r15, %r15
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x57d373
movq 0x28(%rsp), %r15
movslq %r15d, %rcx
movq 0x370(%rsp), %r12
cmpl $0x0, 0x30(%r12)
movq %rbx, 0x40(%rsp)
movq %rax, 0x68(%rsp)
movq %r14, 0x48(%rsp)
je 0x57c861
movq $0x0, 0x38(%rsp)
jmp 0x57c8d7
movq %rcx, %r14
leal 0x3(%r15), %ebx
movslq %ebx, %rsi
movl $0x20, %edi
callq 0x2094de
testq %rax, %rax
je 0x57d373
testl %r15d, %r15d
movq 0x58(%rsp), %r8
jle 0x57c8a7
movq 0x10(%r12), %rdi
movl %r15d, %ecx
xorl %edx, %edx
movzbl (%r8,%rdx), %esi
movslq (%rdi,%rsi,4), %rsi
movq %rsi, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x57c892
leal 0x1(%r15), %edx
cmpl %edx, %ebx
cmovgl %ebx, %edx
movq %rax, 0x38(%rsp)
leaq (%rax,%r14,8), %rdi
movl %r15d, %ecx
notl %ecx
addl %edx, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %esi, %esi
callq 0x19e090
movq %r14, %rcx
movq 0x48(%rsp), %r14
leal 0x3(%r13), %r8d
leal -0x1(%r15), %eax
movl %eax, 0xc(%rsp)
leal -0x1(%r13), %eax
movl %eax, 0x74(%rsp)
movq 0x10(%rsp), %r15
incq %r15
subq 0x60(%rsp), %rbp
addq $-0x2, %rbp
movq %r15, 0x10(%rsp)
vmovq %r15, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x170(%rsp)
vmovq %rbp, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x150(%rsp)
vmovsd 0x30(%rsp), %xmm0
vbroadcastsd %xmm0, %ymm0
vmovups %ymm0, 0x2f0(%rsp)
movq 0xd0(%rsp), %rdx
movl %edx, %eax
movq %rax, 0x78(%rsp)
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x2d0(%rsp)
leal (,%rdx,4), %eax
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x1d0(%rsp)
decq %rcx
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x1b0(%rsp)
movl %r13d, %esi
leaq -0x1(%rsi), %rax
vmovq %rax, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqu %ymm0, 0x2b0(%rsp)
movl 0x20(%rsp), %edi
movl %edi, %ecx
subl %edx, %ecx
subl %edx, %ecx
movl %edi, %eax
subl %edx, %eax
leal (%rdx,%rdx,2), %edx
addl 0xf0(%rsp), %edx
movslq %edi, %r15
cltq
movslq %ecx, %rcx
negl %edx
movslq %edx, %rdx
vmovq %rcx, %xmm0
vmovq %rdx, %xmm1
vpunpcklqdq %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0]
vmovq %rax, %xmm1
vmovq %r15, %xmm2
vpunpcklqdq %xmm2, %xmm1, %xmm1 # xmm1 = xmm1[0],xmm2[0]
vinserti128 $0x1, %xmm1, %ymm0, %ymm0
vmovdqu %ymm0, 0xf0(%rsp)
movq 0x10(%r12), %rax
cmpl $0x2, %r13d
movl $0x1, %ebx
cmovgel %r13d, %ebx
xorl %ecx, %ecx
movq 0x50(%rsp), %rdi
movzbl (%rdi,%rcx), %edx
movslq (%rax,%rdx,4), %rdx
movq %rdx, 0x18(%r14,%rcx,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x57ca10
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, (%r14)
movq $0x0, 0x10(%r14)
leal 0x1(%r13), %eax
cmpl %eax, %r8d
movl %r8d, 0xd0(%rsp)
cmovgl %r8d, %eax
movq %rsi, 0x18(%rsp)
leaq (%r14,%rsi,8), %rdi
addq $0x18, %rdi
movl %r13d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x8(,%rcx,8), %rdx
xorl %r12d, %r12d
xorl %esi, %esi
vzeroupper
callq 0x19e090
movq 0x10(%rsp), %rcx
movq 0xa0(%rsp), %rbp
movq 0x68(%rsp), %rdi
movq 0x78(%rsp), %rax
movq %r15, 0x18(%rbp,%r12,8)
movq %rcx, 0x18(%rdi,%r12,8)
incq %r12
subq %rax, %r15
cmpq %r12, %rbx
jne 0x57ca89
xorl %eax, %eax
movq 0x38(%rsp), %r14
movq %rcx, (%rbp,%rax,8)
movq %rcx, (%rdi,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x57caa5
movq 0x18(%rsp), %rax
addq $0x3, %rax
movq 0x40(%rsp), %rbx
movq 0x370(%rsp), %r15
vmovdqu 0x170(%rsp), %ymm13
movl 0xd0(%rsp), %edx
movq %rcx, (%rbp,%rax,8)
movq %rcx, (%rdi,%rax,8)
incq %rax
incl %r13d
cmpl %r13d, %edx
jg 0x57cadd
movq $0x0, 0x10(%rbp)
vmovdqa %ymm13, %ymm1
vmovdqu %ymm13, 0x130(%rsp)
vmovdqu 0x150(%rsp), %ymm0
vmovdqu %ymm0, 0x110(%rsp)
movq 0x28(%rsp), %rcx
testl %ecx, %ecx
jle 0x57d2a4
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0x3, %ymm0, %ymm13, %ymm0 # ymm0 = ymm0[0,1],ymm13[2,3,4,5,6,7]
vpermq $0x39, %ymm0, %ymm0     # ymm0 = ymm0[1,2,3,0]
vmovdqu %ymm0, 0x190(%rsp)
cmpl $0x2, %edx
movl $0x1, %eax
cmovgel %edx, %eax
movq %rax, 0xc8(%rsp)
movl %ecx, %r13d
movslq 0x20(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x18(%rsp), %rax
leaq (,%rax,4), %rdx
movq %rdx, 0xa8(%rsp)
leaq -0x1(%rax), %rdx
movq %rdx, 0x98(%rsp)
leaq -0x3(%rax,%rax,2), %rdx
movq %rdx, 0x88(%rsp)
leaq -0x2(%rax,%rax), %rax
movq %rax, 0x80(%rsp)
vpmovsxbq 0x7b009(%rip), %ymm5 # 0x5f7bae
movq $0x0, 0x90(%rsp)
vbroadcastsd 0x79546(%rip), %ymm0 # 0x5f6100
vmovups %ymm0, 0x290(%rsp)
vbroadcastsd 0x7cdb4(%rip), %ymm0 # 0x5f9980
vmovups %ymm0, 0xd0(%rsp)
vbroadcastsd 0x7e7aa(%rip), %ymm0 # 0x5fb388
vmovups %ymm0, 0x270(%rsp)
vbroadcastsd 0x7e7a0(%rip), %ymm0 # 0x5fb390
vmovups %ymm0, 0x250(%rsp)
vbroadcastsd 0x7e796(%rip), %ymm0 # 0x5fb398
vmovups %ymm0, 0x230(%rsp)
vbroadcastsd 0x7e78c(%rip), %ymm0 # 0x5fb3a0
vmovups %ymm0, 0x210(%rsp)
xorl %eax, %eax
vmovdqu 0x150(%rsp), %ymm0
vmovdqu %ymm0, 0x110(%rsp)
vmovdqu %ymm13, 0x130(%rsp)
vmovdqa %ymm13, %ymm1
movq %r13, 0xc0(%rsp)
movl 0x30(%r15), %r8d
movq %rax, %rsi
testl %r8d, %r8d
jne 0x57cc56
movq (%r14,%rax,8), %rsi
movq %rax, %rcx
orq $0x1, %rcx
testl %r8d, %r8d
je 0x57cc71
cmpq %r13, %rcx
movl 0xc(%rsp), %edx
cmovbl %ecx, %edx
movslq %edx, %rdi
jmp 0x57cc75
movq (%r14,%rcx,8), %rdi
movq %rax, %r9
orq $0x2, %r9
testl %r8d, %r8d
movq %r9, 0x30(%rsp)
je 0x57cc96
cmpq %r13, %r9
movl 0xc(%rsp), %edx
cmovbl %r9d, %edx
movslq %edx, %r9
jmp 0x57cc9a
movq (%r14,%r9,8), %r9
movq %rax, %rdx
orq $0x3, %rdx
testl %r8d, %r8d
movq %rdx, 0x60(%rsp)
je 0x57ccbc
cmpq %r13, %rdx
movl 0xc(%rsp), %r8d
cmovbl %edx, %r8d
movslq %r8d, %r8
jmp 0x57ccc0
movq (%r14,%rdx,8), %r8
movq 0x8(%r15), %r10
movslq 0x18(%r15), %r11
imulq %r11, %rsi
leaq (%r10,%rsi,4), %rdx
movq %rdx, 0x28(%rsp)
imulq %r11, %rdi
leaq (%r10,%rdi,4), %rdx
movq %rdx, 0x58(%rsp)
imulq %r11, %r9
leaq (%r10,%r9,4), %rdx
movq %rdx, 0x20(%rsp)
imulq %r11, %r8
leaq (%r10,%r8,4), %rdx
movq %rdx, 0x50(%rsp)
leaq 0x4(%rax), %rsi
movq %rsi, 0xb8(%rsp)
movq 0x78(%rsp), %rdx
imulq %rdx, %rsi
movq 0xb0(%rsp), %r8
movq %r8, %rdi
subq %rsi, %rdi
vpbroadcastq 0x10(%rbp), %ymm0
movq %rdi, 0x10(%rbp)
imulq %rdx, %rax
movq %r8, %rsi
subq %rax, %rsi
vmovq %rsi, %xmm2
vpbroadcastq %xmm2, %ymm2
vmovdqu 0x190(%rsp), %ymm3
vpblendd $0xc0, %ymm2, %ymm3, %ymm4 # ymm4 = ymm3[0,1,2,3,4,5],ymm2[6,7]
vpblendd $0xc0, %ymm0, %ymm3, %ymm15 # ymm15 = ymm3[0,1,2,3,4,5],ymm0[6,7]
vmovdqu %ymm5, 0x1f0(%rsp)
vpcmpeqq 0x1b0(%rsp), %ymm5, %ymm0
vmovdqu %ymm0, 0x310(%rsp)
xorl %r14d, %r14d
vpmovsxbq 0x7ae38(%rip), %ymm14 # 0x5f7bb2
vmovdqa %ymm13, %ymm5
vmovdqa %ymm13, %ymm8
movq 0x68(%rsp), %rdi
vmovdqa %ymm15, %ymm9
vpermq $0xf9, %ymm4, %ymm0     # ymm0 = ymm4[1,2,3,3]
vpbroadcastq 0x18(%rbp,%r14,8), %ymm2
vpblendd $0xc0, %ymm2, %ymm0, %ymm15 # ymm15 = ymm0[0,1,2,3,4,5],ymm2[6,7]
vpermq $0xf9, %ymm5, %ymm0     # ymm0 = ymm5[1,2,3,3]
vpbroadcastq 0x18(%rdi,%r14,8), %ymm2
vpblendd $0xc0, %ymm2, %ymm0, %ymm2 # ymm2 = ymm0[0,1,2,3,4,5],ymm2[6,7]
vmovdqu 0x2f0(%rsp), %ymm3
vpsubq %ymm3, %ymm15, %ymm0
vmovdqu 0x2d0(%rsp), %ymm7
vpsubq %ymm7, %ymm2, %ymm2
vmovq %xmm0, %rax
vmovq %xmm2, %r15
cmpq %r15, %rax
cmovgq %rax, %r15
vpextrq $0x1, %xmm0, %rax
vpextrq $0x1, %xmm2, %rsi
cmpq %rsi, %rax
cmovgq %rax, %rsi
vextracti128 $0x1, %ymm0, %xmm5
vmovq %xmm5, %rax
vextracti128 $0x1, %ymm2, %xmm6
vmovq %xmm6, %r8
cmpq %r8, %rax
cmovgq %rax, %r8
vpextrq $0x1, %xmm5, %rax
vpextrq $0x1, %xmm6, %r13
cmpq %r13, %rax
cmovgq %rax, %r13
vpsubq %ymm3, %ymm4, %ymm6
vpsubq %ymm7, %ymm8, %ymm8
vmovq %xmm6, %rax
vmovq %xmm8, %r10
cmpq %r10, %rax
cmovgq %rax, %r10
vpextrq $0x1, %xmm6, %r9
vpextrq $0x1, %xmm8, %rax
cmpq %rax, %r9
cmovgq %r9, %rax
vextracti128 $0x1, %ymm6, %xmm4
vmovq %xmm4, %r9
vextracti128 $0x1, %ymm8, %xmm5
vmovq %xmm5, %r12
cmpq %r12, %r9
cmovgq %r9, %r12
vpextrq $0x1, %xmm4, %r9
movq 0x48(%rsp), %rdi
movq 0x18(%rdi,%r14,8), %r11
movq 0x28(%rsp), %rdx
movslq (%rdx,%r11,4), %r11
movq 0x10(%rdi,%r14,8), %rbx
movq 0x58(%rsp), %rdx
movslq (%rdx,%rbx,4), %rbx
movq (%rdi,%r14,8), %rdx
movq 0x8(%rdi,%r14,8), %rbp
movq 0x20(%rsp), %rdi
movslq (%rdi,%rbp,4), %rbp
movq 0x50(%rsp), %rdi
movslq (%rdi,%rdx,4), %rdx
vmovq %r11, %xmm4
vmovq %rbx, %xmm10
vpunpcklqdq %xmm4, %xmm10, %xmm4 # xmm4 = xmm10[0],xmm4[0]
vmovq %rbp, %xmm10
vmovq %rdx, %xmm11
vpunpcklqdq %xmm10, %xmm11, %xmm10 # xmm10 = xmm11[0],xmm10[0]
vinserti128 $0x1, %xmm4, %ymm10, %ymm4
vpaddq %ymm4, %ymm9, %ymm10
vpextrq $0x1, %xmm5, %r11
cmpq %r11, %r9
cmovgq %r9, %r11
vmovq %xmm10, %r9
cmpq %r10, %r9
cmovleq %r10, %r9
vpextrq $0x1, %xmm10, %rbx
cmpq %rax, %rbx
cmovleq %rax, %rbx
vextracti128 $0x1, %ymm10, %xmm4
vmovq %xmm4, %rdx
cmpq %r12, %rdx
cmovleq %r12, %rdx
vpextrq $0x1, %xmm4, %rbp
cmpq %r11, %rbp
cmovleq %r11, %rbp
vmovq %r15, %xmm4
cmpq %r15, %r9
cmovleq %r15, %r9
vmovq %rsi, %xmm5
cmpq %rsi, %rbx
cmovleq %rsi, %rbx
vmovq %r8, %xmm9
cmpq %r8, %rdx
cmovleq %r8, %rdx
vmovq %r13, %xmm11
cmpq %r13, %rbp
cmovleq %r13, %rbp
vmovq %rbp, %xmm7
vmovq %rdx, %xmm13
vmovq %rbx, %xmm3
vmovq %r9, %xmm12
vpunpcklqdq %xmm11, %xmm9, %xmm11 # xmm11 = xmm9[0],xmm11[0]
vpunpcklqdq %xmm5, %xmm4, %xmm5 # xmm5 = xmm4[0],xmm5[0]
vpunpcklqdq %xmm7, %xmm13, %xmm4 # xmm4 = xmm13[0],xmm7[0]
vmovupd 0x170(%rsp), %ymm13
vpunpcklqdq %xmm3, %xmm12, %xmm3 # xmm3 = xmm12[0],xmm3[0]
vpcmpeqd %ymm12, %ymm12, %ymm12
vinserti128 $0x1, %xmm4, %ymm3, %ymm3
vpcmpeqq %ymm12, %ymm14, %ymm9
vblendvpd %ymm9, 0xf0(%rsp), %ymm3, %ymm4
vinserti128 $0x1, %xmm11, %ymm5, %ymm3
vblendvpd %ymm9, %ymm13, %ymm3, %ymm5
cmpq $0x4, %r14
jb 0x57d0a0
vmovdqu 0x110(%rsp), %ymm3
vmovq %xmm3, %r15
vmovq %xmm4, %rsi
cmpq %rsi, %r15
cmovgeq %rsi, %r15
vpextrq $0x1, %xmm3, %rbx
vpextrq $0x1, %xmm4, %r8
cmpq %r8, %rbx
cmovgeq %r8, %rbx
vextracti128 $0x1, %ymm3, %xmm3
vmovq %xmm3, %rdx
vextracti128 $0x1, %ymm4, %xmm7
vmovq %xmm7, %r13
cmpq %r13, %rdx
cmovgeq %r13, %rdx
vpextrq $0x1, %xmm3, %rbp
vpextrq $0x1, %xmm7, %r9
cmpq %r9, %rbp
cmovgeq %r9, %rbp
vmovq %rbp, %xmm3
vmovq %rdx, %xmm7
vpunpcklqdq %xmm3, %xmm7, %xmm3 # xmm3 = xmm7[0],xmm3[0]
vmovdqu 0x130(%rsp), %ymm12
vmovq %xmm12, %rdx
cmpq %rsi, %rdx
cmovgq %rdx, %rsi
vpextrq $0x1, %xmm12, %rdx
vmovq %rbx, %xmm7
cmpq %r8, %rdx
cmovgq %rdx, %r8
vmovq %r15, %xmm11
vextracti128 $0x1, %ymm12, %xmm12
vmovq %xmm12, %rdx
cmpq %r13, %rdx
cmovgq %rdx, %r13
vpextrq $0x1, %xmm12, %rdx
vpcmpeqd %ymm12, %ymm12, %ymm12
vpunpcklqdq %xmm7, %xmm11, %xmm7 # xmm7 = xmm11[0],xmm7[0]
cmpq %r9, %rdx
cmovgq %rdx, %r9
vinserti128 $0x1, %xmm3, %ymm7, %ymm3
vmovdqu %ymm3, 0x110(%rsp)
vmovq %r9, %xmm3
vmovq %r13, %xmm7
vpunpcklqdq %xmm3, %xmm7, %xmm3 # xmm3 = xmm7[0],xmm3[0]
vmovq %r8, %xmm7
vmovq %rsi, %xmm11
vpunpcklqdq %xmm7, %xmm11, %xmm7 # xmm7 = xmm11[0],xmm7[0]
vinserti128 $0x1, %xmm3, %ymm7, %ymm3
vmovdqu %ymm3, 0x130(%rsp)
movq 0x40(%rsp), %rbx
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %r9
vpcmpeqq %ymm10, %ymm4, %ymm3
vpcmpeqq %ymm5, %ymm4, %ymm7
vmovdqu 0x290(%rsp), %ymm10
vpsubq %ymm7, %ymm10, %ymm7
vblendvpd %ymm3, 0xd0(%rsp), %ymm7, %ymm3
vpcmpgtq %ymm8, %ymm6, %ymm6
vmovupd 0x250(%rsp), %ymm7
vblendvpd %ymm6, 0x270(%rsp), %ymm7, %ymm6
vpcmpgtq %ymm2, %ymm0, %ymm0
vmovupd 0x210(%rsp), %ymm2
vblendvpd %ymm0, 0x230(%rsp), %ymm2, %ymm0
vorpd %ymm6, %ymm0, %ymm0
vorpd %ymm3, %ymm0, %ymm0
movq 0x10(%rbx), %rdx
movq (%rdx), %rsi
vextractf128 $0x1, %ymm0, %xmm2
cmpq %rdi, %r14
movq 0xa0(%rsp), %rbp
movq 0xc0(%rsp), %r13
jae 0x57d13f
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
vpextrb $0x8, %xmm2, (%r14,%rdx)
cmpq %r13, %rcx
setae %dl
leaq -0x1(%r14), %r8
cmpq %rdi, %r8
setae %r8b
orb %dl, %r8b
jne 0x57d167
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
vpextrb $0x0, %xmm2, (%r14,%rdx)
cmpq %r13, %r9
jae 0x57d198
leaq -0x2(%r14), %rdx
cmpq $0x2, %r14
setae %r8b
cmpq %rdi, %rdx
setl %dl
andb %r8b, %dl
cmpb $0x1, %dl
jne 0x57d198
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
vpextrb $0x8, %xmm0, (%r14,%rdx)
cmpq %r13, 0x60(%rsp)
jae 0x57d1c5
leaq -0x3(%r14), %rdx
cmpq $0x3, %r14
setb %r8b
cmpq %rdi, %rdx
setge %dl
orb %r8b, %dl
jne 0x57d1c5
addq 0x88(%rsp), %rsi
vpextrb $0x0, %xmm0, (%r14,%rsi)
vmovq %rax, %xmm0
vmovq %r10, %xmm2
vpunpcklqdq %xmm0, %xmm2, %xmm0 # xmm0 = xmm2[0],xmm0[0]
vmovq %r11, %xmm2
vmovq %r12, %xmm3
vpunpcklqdq %xmm2, %xmm3, %xmm2 # xmm2 = xmm3[0],xmm2[0]
vinserti128 $0x1, %xmm2, %ymm0, %ymm0
vblendvpd %ymm9, %ymm13, %ymm0, %ymm8
vmovq %xmm4, (%rbp,%r14,8)
movq 0x68(%rsp), %rdi
vmovq %xmm5, (%rdi,%r14,8)
vpcmpeqq 0x2b0(%rsp), %ymm14, %ymm0
vpand 0x310(%rsp), %ymm0, %ymm0
vblendvpd %ymm0, %ymm4, %ymm1, %ymm1
vpsubq %ymm12, %ymm14, %ymm14
incq %r14
cmpq %r14, 0xc8(%rsp)
jne 0x57cd88
vmovdqu 0x1f0(%rsp), %ymm5
vpaddq 0xd0(%rsp), %ymm5, %ymm5
vmovdqu 0xf0(%rsp), %ymm0
vpsubq 0x1d0(%rsp), %ymm0, %ymm0
vmovdqu %ymm0, 0xf0(%rsp)
movq 0xa8(%rsp), %rax
addq %rax, 0x90(%rsp)
addq %rax, 0x98(%rsp)
addq %rax, 0x88(%rsp)
addq %rax, 0x80(%rsp)
movq 0xb8(%rsp), %rcx
movq %rcx, %rax
cmpq %r13, %rcx
movq 0x370(%rsp), %r15
movq 0x38(%rsp), %r14
jb 0x57cc46
movl $0x4, %eax
movq 0x10(%rsp), %rdx
vextracti128 $0x1, %ymm1, %xmm0
vpextrq $0x1, %xmm0, %rcx
cmpq %rdx, %rcx
cmovgq %rcx, %rdx
vperm2i128 $0x8, %ymm1, %ymm1, %ymm0 # ymm0 = zero,zero,ymm1[0,1]
vpalignr $0x8, %ymm0, %ymm1, %ymm1 # ymm1 = ymm0[8,9,10,11,12,13,14,15],ymm1[0,1,2,3,4,5,6,7],ymm0[24,25,26,27,28,29,30,31],ymm1[16,17,18,19,20,21,22,23]
decl %eax
jne 0x57d2ae
vpcmpgtq 0x110(%rsp), %ymm13, %ymm0
vmovdqu 0x130(%rsp), %ymm1
vpcmpgtq 0x150(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestpd %ymm0, %ymm0
movl 0x74(%rsp), %eax
je 0x57d30d
orb $0x40, 0xc(%rbx)
xorl %edx, %edx
xorl %eax, %eax
movl $0x0, 0xc(%rsp)
movl %edx, (%rbx)
movl 0xc(%rsp), %ecx
movl %ecx, 0x4(%rbx)
movl %eax, 0x8(%rbx)
vzeroupper
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq 0x48(%rsp), %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%r15)
jne 0x57d375
movq %r14, %rdi
callq 0x2094b5
jmp 0x57d375
callq 0x1f922d
jmp 0x57d373
callq 0x1f9207
jmp 0x57d373
callq 0x1f91e1
jmp 0x57d373
callq 0x1f91bb
jmp 0x57d373
callq 0x1f9195
jmp 0x57d373
callq 0x1f916f
jmp 0x57d373
callq 0x1f9149
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop