// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/nw_trace_diag_avx2_256_32.c
// Function: parasail_nw_trace_diag_avx2_256_32
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;
    int32_t * restrict s1 = NULL;
    int32_t * restrict s2B = NULL;
    int32_t * restrict _H_pr = NULL;
    int32_t * restrict _F_pr = NULL;
    int32_t * restrict s2 = NULL;
    int32_t * restrict H_pr = NULL;
    int32_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;
    int32_t NEG_LIMIT = 0;
    int32_t POS_LIMIT = 0;
    int32_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 = 8; /* 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 ? INT32_MIN + open : INT32_MIN - matrix->min) + 1;
    POS_LIMIT = INT32_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm256_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm256_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm256_set1_epi32(NEG_LIMIT);
    vOpen = _mm256_set1_epi32(open);
    vGap  = _mm256_set1_epi32(gap);
    vOne = _mm256_set1_epi32(1);
    vN = _mm256_set1_epi32(N);
    vGapN = _mm256_set1_epi32(gap*N);
    vNegOne = _mm256_set1_epi32(-1);
    vI = _mm256_set_epi32(0,1,2,3,4,5,6,7);
    vJreset = _mm256_set_epi32(0,-1,-2,-3,-4,-5,-6,-7);
    vMax = vNegInf;
    vILimit = _mm256_set1_epi32(s1Len);
    vILimit1 = _mm256_sub_epi32(vILimit, vOne);
    vJLimit = _mm256_set1_epi32(s2Len);
    vJLimit1 = _mm256_sub_epi32(vJLimit, vOne);
    vIBoundary = _mm256_set_epi32(
            -open-0*gap,
            -open-1*gap,
            -open-2*gap,
            -open-3*gap,
            -open-4*gap,
            -open-5*gap,
            -open-6*gap,
            -open-7*gap);
    vTDiag = _mm256_set1_epi32(PARASAIL_DIAG);
    vTIns = _mm256_set1_epi32(PARASAIL_INS);
    vTDel = _mm256_set1_epi32(PARASAIL_DEL);
    vTDiagE = _mm256_set1_epi32(PARASAIL_DIAG_E);
    vTInsE = _mm256_set1_epi32(PARASAIL_INS_E);
    vTDiagF = _mm256_set1_epi32(PARASAIL_DIAG_F);
    vTDelF = _mm256_set1_epi32(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_32 | PARASAIL_FLAG_LANES_8;

    /* initialize heap variables */
    s2B= parasail_memalign_int32_t(32, s2Len+PAD2);
    _H_pr = parasail_memalign_int32_t(32, s2Len+PAD2);
    _F_pr = parasail_memalign_int32_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_int32_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))];
        const int * const restrict matrow4 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+4] : ((i+4 >= s1Len) ? s1Len-1 : i+4))];
        const int * const restrict matrow5 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+5] : ((i+5 >= s1Len) ? s1Len-1 : i+5))];
        const int * const restrict matrow6 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+6] : ((i+6 >= s1Len) ? s1Len-1 : i+6))];
        const int * const restrict matrow7 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+7] : ((i+7 >= s1Len) ? s1Len-1 : i+7))];
        vNH = _mm256_srli_si256_rpl(vNH, 4);
        vNH = _mm256_insert_epi32_rpl(vNH, H_pr[-1], 7);
        vWH = _mm256_srli_si256_rpl(vWH, 4);
        vWH = _mm256_insert_epi32_rpl(vWH, -open - i*gap, 7);
        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, 4);
            vNH = _mm256_insert_epi32_rpl(vNH, H_pr[j], 7);
            vF = _mm256_srli_si256_rpl(vF, 4);
            vF = _mm256_insert_epi32_rpl(vF, F_pr[j], 7);
            vF_opn = _mm256_sub_epi32(vNH, vOpen);
            vF_ext = _mm256_sub_epi32(vF, vGap);
            vF = _mm256_max_epi32(vF_opn, vF_ext);
            vE_opn = _mm256_sub_epi32(vWH, vOpen);
            vE_ext = _mm256_sub_epi32(vE, vGap);
            vE = _mm256_max_epi32(vE_opn, vE_ext);
            vMat = _mm256_set_epi32(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]],
                    matrow2[s2[j-2]],
                    matrow3[s2[j-3]],
                    matrow4[s2[j-4]],
                    matrow5[s2[j-5]],
                    matrow6[s2[j-6]],
                    matrow7[s2[j-7]]
                    );
            vNWH = _mm256_add_epi32(vNWH, vMat);
            vWH = _mm256_max_epi32(vNWH, vE);
            vWH = _mm256_max_epi32(vWH, vF);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m256i cond = _mm256_cmpeq_epi32(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_epi32(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm256_max_epi32(vSaturationCheckMax, vWH);
            }
            /* trace table */
            {
                __m256i case1 = _mm256_cmpeq_epi32(vWH, vNWH);
                __m256i case2 = _mm256_cmpeq_epi32(vWH, vF);
                __m256i vT = _mm256_blendv_epi8(
                        _mm256_blendv_epi8(vTIns, vTDel, case2),
                        vTDiag,
                        case1);
                __m256i condE = _mm256_cmpgt_epi32(vE_opn, vE_ext);
                __m256i condF = _mm256_cmpgt_epi32(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-7] = (int32_t)_mm256_extract_epi32_rpl(vWH,0);
            F_pr[j-7] = (int32_t)_mm256_extract_epi32_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_epi32(vI, vILimit1);
                __m256i cond_valid_J = _mm256_cmpeq_epi32(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_epi32(vJ, vOne);
        }
        vI = _mm256_add_epi32(vI, vN);
        vIBoundary = _mm256_sub_epi32(vIBoundary, vGapN);
    }

    /* max in vMax */
    for (i=0; i<N; ++i) {
        int32_t value;
        value = (int32_t) _mm256_extract_epi32_rpl(vMax, 7);
        if (value > score) {
            score = value;
        }
        vMax = _mm256_slli_si256_rpl(vMax, 4);
    }

    if (_mm256_movemask_epi8(_mm256_or_si256(
            _mm256_cmplt_epi32_rpl(vSaturationCheckMin, vNegLimit),
            _mm256_cmpgt_epi32(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 $0x308, %rsp            # imm = 0x308
movq %r9, 0x20(%rsp)
testq %rdx, %rdx
je 0x57fd3e
movl %ecx, %ebp
testl %ecx, %ecx
jle 0x57fd45
movl %r8d, %r13d
testl %r8d, %r8d
js 0x57fd4c
cmpl $0x0, 0x20(%rsp)
js 0x57fd53
movq 0x340(%rsp), %rbx
testq %rbx, %rbx
je 0x57fd5a
movq %rdx, %r15
movl 0x30(%rbx), %eax
testl %eax, %eax
jne 0x57f1eb
testq %rdi, %rdi
je 0x57fd61
movl %esi, %r14d
testl %esi, %esi
jle 0x57fd68
testl %eax, %eax
je 0x57f1ef
movl 0x34(%rbx), %r14d
movq %rdi, 0xe0(%rsp)
movl %r13d, %esi
negl %esi
movl 0x20(%rbx), %eax
movl $0x80000000, %edx       # imm = 0x80000000
movl %r13d, %ecx
orl %edx, %ecx
subl %eax, %edx
movl %esi, 0x8(%rsp)
cmpl %esi, %eax
cmovgl %ecx, %edx
movl %edx, 0x4(%rsp)
movl $0x7ffffffe, %r12d      # imm = 0x7FFFFFFE
subl 0x1c(%rbx), %r12d
movl $0x20, %edx
movl $0x1, %ecx
movl %r14d, %edi
movl %ebp, %esi
callq 0x2097d1
testq %rax, %rax
je 0x57fd6d
movl %r13d, 0x58(%rsp)
movq %r15, 0x38(%rsp)
movq %r14, 0x10(%rsp)
movq %rax, 0x28(%rsp)
orl $0x8481001, 0xc(%rax)   # imm = 0x8481001
leal 0xe(%rbp), %r13d
movl $0x20, %edi
movq %r13, %rsi
callq 0x2094d5
movq %rax, %r15
movl $0x20, %edi
movq %r13, %rsi
callq 0x2094d5
movq %rax, %r14
movl $0x20, %edi
movq %r13, %rsi
callq 0x2094d5
testq %r15, %r15
sete %dl
testq %r14, %r14
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x57fd6d
movq %rax, 0x40(%rsp)
movq %r14, 0x18(%rsp)
cmpl $0x0, 0x30(%rbx)
je 0x57f2c8
xorl %eax, %eax
movq 0x10(%rsp), %r14
movq 0x38(%rsp), %r13
jmp 0x57f34c
movq 0x10(%rsp), %r14
leal 0x7(%r14), %ebx
movslq %ebx, %rsi
movl $0x20, %edi
callq 0x2094d5
testq %rax, %rax
movq 0x38(%rsp), %r13
je 0x57fd6d
movq %rax, %r8
testl %r14d, %r14d
movq 0xe0(%rsp), %rdi
jle 0x57f320
movq 0x340(%rsp), %rax
movq 0x10(%rax), %rax
movl %r14d, %ecx
xorl %edx, %edx
movzbl (%rdi,%rdx), %esi
movl (%rax,%rsi,4), %esi
movl %esi, (%r8,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x57f30d
movslq %r14d, %rax
leal 0x1(%r14), %ecx
cmpl %ecx, %ebx
cmovgl %ebx, %ecx
leaq (%r8,%rax,4), %rdi
movl %r14d, %eax
notl %eax
addl %ecx, %eax
leaq 0x4(,%rax,4), %rdx
xorl %esi, %esi
movq %r8, %rbx
callq 0x19e090
movq %rbx, %rax
movq %rax, 0x48(%rsp)
leal 0x7(%rbp), %ebx
vmovd %r12d, %xmm0
movl 0x58(%rsp), %edi
vmovd %edi, %xmm1
movq 0x20(%rsp), %r8
leal (,%r8,8), %edx
leal (%r8,%r8), %ecx
leal (,%r8,4), %esi
movl 0x8(%rsp), %r9d
movl %r9d, %eax
subl %esi, %eax
movl %r8d, %esi
subl %edx, %esi
leal (%r8,%r8,2), %edx
addl %edi, %edx
negl %edx
vmovd %edx, %xmm2
movl %r9d, %edx
subl %ecx, %edx
vpinsrd $0x1, %edx, %xmm2, %xmm2
leal (%r8,%r8,4), %edx
addl %edi, %edx
leal (%rcx,%rcx,2), %ecx
addl %edi, %ecx
subl %edi, %esi
movl %r9d, %edi
subl %r8d, %edi
vpinsrd $0x2, %edi, %xmm2, %xmm2
leal -0x1(%r14), %edi
vmovd %esi, %xmm3
leal -0x1(%rbp), %esi
movl 0x4(%rsp), %r12d
incl %r12d
movl %r12d, 0x4(%rsp)
vmovd %r12d, %xmm4
vpbroadcastd %xmm4, %ymm4
vmovdqu %ymm4, 0x160(%rsp)
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0x100(%rsp)
vpbroadcastd %xmm1, %ymm0
vmovdqu %ymm0, 0x2e0(%rsp)
vmovd %r8d, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0x2c0(%rsp)
vpslld $0x3, %ymm0, %ymm0
vmovdqu %ymm0, 0x1c0(%rsp)
movl %edi, 0xc(%rsp)
vmovd %edi, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0x1a0(%rsp)
movl %esi, 0x64(%rsp)
vmovd %esi, %xmm0
negl %edx
negl %ecx
vpinsrd $0x3, %r9d, %xmm2, %xmm1
vpinsrd $0x1, %ecx, %xmm3, %xmm2
vpinsrd $0x2, %edx, %xmm2, %xmm2
vpinsrd $0x3, %eax, %xmm2, %xmm2
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0x2a0(%rsp)
vinserti128 $0x1, %xmm1, %ymm2, %ymm0
vmovdqu %ymm0, 0xe0(%rsp)
movq 0x340(%rsp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, %ebp
movl $0x1, %r12d
cmovgel %ebp, %r12d
xorl %ecx, %ecx
movzbl (%r13,%rcx), %edx
movl (%rax,%rdx,4), %edx
movl %edx, 0x1c(%r15,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x57f493
vpxor %xmm0, %xmm0, %xmm0
vmovdqu %xmm0, 0xc(%r15)
vmovdqu %xmm0, (%r15)
movl %ebp, %r14d
leal 0x1(%rbp), %eax
cmpl %eax, %ebx
cmovgl %ebx, %eax
leaq (%r15,%r14,4), %rdi
addq $0x1c, %rdi
movl %ebp, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %r13d, %r13d
xorl %esi, %esi
vzeroupper
callq 0x19e090
movl 0x8(%rsp), %eax
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %rsi
movq 0x40(%rsp), %rdi
movl %eax, 0x1c(%rsi,%r13,4)
movl %edx, 0x1c(%rdi,%r13,4)
incq %r13
subl %ecx, %eax
cmpq %r13, %r12
jne 0x57f4fd
xorl %eax, %eax
movl 0xc(%rsp), %r9d
movl %edx, (%rsi,%rax,4)
movl %edx, (%rdi,%rax,4)
incq %rax
cmpq $0x7, %rax
jne 0x57f518
leaq 0x7(%r14), %rax
movq 0x48(%rsp), %r11
vmovdqu 0x160(%rsp), %ymm12
movq 0x10(%rsp), %rcx
movl %edx, (%rsi,%rax,4)
movl %edx, (%rdi,%rax,4)
incq %rax
incl %ebp
cmpl %ebp, %ebx
jg 0x57f53e
movl $0x0, 0x18(%rsi)
testl %ecx, %ecx
jle 0x57fc93
vextracti128 $0x1, %ymm12, %xmm0
cmpl $0x2, %ebx
movl $0x1, %eax
cmovgel %ebx, %eax
movq %rax, 0xc0(%rsp)
vpalignr $0x4, %ymm12, %ymm0, %ymm0 # ymm0 = ymm12[4,5,6,7,8,9,10,11,12,13,14,15],ymm0[0,1,2,3],ymm12[20,21,22,23,24,25,26,27,28,29,30,31],ymm0[16,17,18,19]
vmovdqu %ymm0, 0x180(%rsp)
movl %ecx, %ecx
leaq (,%r14,8), %rax
leaq -0x1(%r14), %rdx
movq %rdx, 0xa0(%rsp)
movq %rax, 0xa8(%rsp)
subq %r14, %rax
addq $-0x7, %rax
movq %rax, 0x90(%rsp)
leaq (%r14,%r14,2), %rax
leaq -0x6(,%rax,2), %rax
movq %rax, 0x88(%rsp)
leaq -0x5(%r14,%r14,4), %rax
movq %rax, 0x80(%rsp)
leaq -0x4(,%r14,4), %rax
movq %rax, 0x78(%rsp)
leaq -0x3(%r14,%r14,2), %rax
movq %rax, 0x70(%rsp)
leaq -0x2(%r14,%r14), %rax
movq %rax, 0x68(%rsp)
vpmovsxbd 0x785de(%rip), %ymm4 # 0x5f7bda
movq $0x0, 0x98(%rsp)
vbroadcastss 0x7652f(%rip), %ymm0 # 0x5f5b40
vmovups %ymm0, 0x280(%rsp)
vbroadcastss 0x7bdf1(%rip), %ymm0 # 0x5fb414
vmovups %ymm0, 0x260(%rsp)
vbroadcastss 0x7a3cb(%rip), %ymm10 # 0x5f9a00
vbroadcastss 0x7bdc6(%rip), %ymm0 # 0x5fb404
vmovups %ymm0, 0x240(%rsp)
vbroadcastss 0x7bdb8(%rip), %ymm0 # 0x5fb408
vmovups %ymm0, 0x220(%rsp)
vbroadcastss 0x7bdaa(%rip), %ymm0 # 0x5fb40c
vmovups %ymm0, 0x200(%rsp)
xorl %esi, %esi
vmovdqu 0x100(%rsp), %ymm0
vmovdqu %ymm0, 0x140(%rsp)
vmovdqu %ymm12, 0x120(%rsp)
vmovdqa %ymm12, %ymm3
movq 0x340(%rsp), %rdi
movl 0x30(%rdi), %edx
movl %esi, %eax
testl %edx, %edx
jne 0x57f6a1
movl (%r11,%rsi,4), %eax
movl %eax, 0x50(%rsp)
movq %rsi, %rax
orq $0x1, %rax
testl %edx, %edx
je 0x57f6bb
cmpq %rcx, %rax
movl %r9d, %edi
cmovbl %eax, %edi
jmp 0x57f6bf
movl (%r11,%rax,4), %edi
movl %edi, 0x30(%rsp)
movq %rax, 0x10(%rsp)
movq %rsi, %r8
orq $0x2, %r8
testl %edx, %edx
je 0x57f6df
cmpq %rcx, %r8
movl %r9d, %eax
cmovbl %r8d, %eax
jmp 0x57f6e3
movl (%r11,%r8,4), %eax
movq %rsi, %r10
orq $0x3, %r10
testl %edx, %edx
je 0x57f6fa
cmpq %rcx, %r10
movl %r9d, %r13d
cmovbl %r10d, %r13d
jmp 0x57f6fe
movl (%r11,%r10,4), %r13d
movq %rsi, %rbx
orq $0x4, %rbx
testl %edx, %edx
je 0x57f715
cmpq %rcx, %rbx
movl %r9d, %r12d
cmovbl %ebx, %r12d
jmp 0x57f719
movl (%r11,%rbx,4), %r12d
movq %r8, 0x38(%rsp)
movq %rsi, %rbp
orq $0x5, %rbp
testl %edx, %edx
je 0x57f735
cmpq %rcx, %rbp
movl %r9d, %r8d
cmovbl %ebp, %r8d
jmp 0x57f739
movl (%r11,%rbp,4), %r8d
movq %rsi, %rdi
orq $0x6, %rsi
testl %edx, %edx
movq %r10, 0x58(%rsp)
movq %rbx, 0xd8(%rsp)
movq %rbp, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
je 0x57f76a
cmpq %rcx, %rsi
cmovbl %esi, %r9d
jmp 0x57f76e
movl (%r11,%rsi,4), %r9d
movq 0x340(%rsp), %rsi
movq 0x8(%rsi), %r10
movl 0x18(%rsi), %ebp
movq %rdi, %rbx
orq $0x7, %rbx
testl %edx, %edx
je 0x57f796
cmpq %rcx, %rbx
movl 0xc(%rsp), %r11d
cmovbl %ebx, %r11d
jmp 0x57f79a
movl (%r11,%rbx,4), %r11d
movq 0x18(%rsp), %rsi
movl 0x50(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r10,%rdx,4), %rdx
movq %rdx, 0x50(%rsp)
movl 0x30(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r10,%rdx,4), %rdx
movq %rdx, 0x30(%rsp)
imull %ebp, %eax
cltq
leaq (%r10,%rax,4), %rax
movq %rax, 0xb0(%rsp)
imull %ebp, %r13d
movslq %r13d, %r13
leaq (%r10,%r13,4), %r13
imull %ebp, %r12d
movslq %r12d, %r12
leaq (%r10,%r12,4), %r12
imull %ebp, %r8d
movslq %r8d, %r8
leaq (%r10,%r8,4), %r8
imull %ebp, %r9d
movslq %r9d, %r9
leaq (%r10,%r9,4), %r9
imull %ebp, %r11d
movslq %r11d, %r11
leaq (%r10,%r11,4), %r10
movq %rdi, %rdx
addq $0x8, %rdi
movq %rdi, 0xb8(%rsp)
movl %edi, %r11d
movq 0x20(%rsp), %rdi
imull %edi, %r11d
movl 0x8(%rsp), %eax
movl %eax, %ebp
subl %r11d, %ebp
vpbroadcastd 0x18(%rsi), %ymm0
movl %ebp, 0x18(%rsi)
imull %edi, %edx
movl %eax, %r11d
movq 0xb0(%rsp), %rax
subl %edx, %r11d
vmovd %r11d, %xmm1
vpbroadcastd %xmm1, %ymm1
vmovdqu 0x180(%rsp), %ymm2
vpblendd $0x80, %ymm1, %ymm2, %ymm5 # ymm5 = ymm2[0,1,2,3,4,5,6],ymm1[7]
vpblendd $0x80, %ymm0, %ymm2, %ymm1 # ymm1 = ymm2[0,1,2,3,4,5,6],ymm0[7]
vmovdqu %ymm4, 0x1e0(%rsp)
vpcmpeqd 0x1a0(%rsp), %ymm4, %ymm14
xorl %r11d, %r11d
vpmovsxbd 0x78362(%rip), %ymm15 # 0x5f7bea
vmovdqa %ymm12, %ymm4
vmovdqa %ymm12, %ymm0
movq 0x40(%rsp), %rdi
movslq 0x10(%r15,%r11,4), %rbp
vmovd (%r13,%rbp,4), %xmm2
movslq 0x14(%r15,%r11,4), %rbp
vpinsrd $0x1, (%rax,%rbp,4), %xmm2, %xmm2
movslq 0x18(%r15,%r11,4), %rbp
movq 0x30(%rsp), %rdx
vpinsrd $0x2, (%rdx,%rbp,4), %xmm2, %xmm2
movslq 0x1c(%r15,%r11,4), %rbp
movq 0x50(%rsp), %rdx
vpinsrd $0x3, (%rdx,%rbp,4), %xmm2, %xmm2
movslq (%r15,%r11,4), %rbp
vpcmpeqd %ymm13, %ymm13, %ymm13
vmovd (%r10,%rbp,4), %xmm6
movslq 0x4(%r15,%r11,4), %rbp
vpinsrd $0x1, (%r9,%rbp,4), %xmm6, %xmm6
movslq 0x8(%r15,%r11,4), %rbp
vpinsrd $0x2, (%r8,%rbp,4), %xmm6, %xmm6
movslq 0xc(%r15,%r11,4), %rbp
vpinsrd $0x3, (%r12,%rbp,4), %xmm6, %xmm6
vpmovsxbd 0x7a0f9(%rip), %ymm11 # 0x5f9a04
vpermd %ymm5, %ymm11, %ymm8
vpbroadcastd 0x1c(%rsi,%r11,4), %ymm9
vinserti128 $0x1, %xmm2, %ymm6, %ymm2
vpaddd %ymm1, %ymm2, %ymm7
vpblendd $0x80, %ymm9, %ymm8, %ymm1 # ymm1 = ymm8[0,1,2,3,4,5,6],ymm9[7]
vpermd %ymm4, %ymm11, %ymm2
vpbroadcastd 0x1c(%rdi,%r11,4), %ymm4
vpblendd $0x80, %ymm4, %ymm2, %ymm2 # ymm2 = ymm2[0,1,2,3,4,5,6],ymm4[7]
vmovdqu 0x2e0(%rsp), %ymm9
vpsubd %ymm9, %ymm1, %ymm6
vmovdqu 0x2c0(%rsp), %ymm11
vpsubd %ymm11, %ymm2, %ymm8
vpmaxsd %ymm8, %ymm6, %ymm4
vpsubd %ymm9, %ymm5, %ymm9
vpsubd %ymm11, %ymm0, %ymm11
vpmaxsd %ymm11, %ymm9, %ymm0
vpmaxsd %ymm4, %ymm0, %ymm2
vpmaxsd %ymm2, %ymm7, %ymm5
vpcmpeqd %ymm13, %ymm15, %ymm2
vblendvps %ymm2, 0xe0(%rsp), %ymm5, %ymm5
vblendvps %ymm2, %ymm12, %ymm4, %ymm4
cmpq $0x8, %r11
jb 0x57f9bd
vmovdqu 0x140(%rsp), %ymm12
vpminsd %ymm5, %ymm12, %ymm12
vmovdqu %ymm12, 0x140(%rsp)
vmovdqu 0x120(%rsp), %ymm12
vpmaxsd %ymm5, %ymm12, %ymm12
vmovdqu %ymm12, 0x120(%rsp)
vpcmpeqd %ymm7, %ymm5, %ymm7
vpcmpeqd %ymm4, %ymm5, %ymm12
vmovdqu 0x280(%rsp), %ymm13
vpsubd %ymm12, %ymm13, %ymm12
vblendvps %ymm7, 0x260(%rsp), %ymm12, %ymm7
vpcmpgtd %ymm11, %ymm9, %ymm9
vpcmpgtd %ymm8, %ymm6, %ymm6
vmovups 0x200(%rsp), %ymm8
vblendvps %ymm6, 0x220(%rsp), %ymm8, %ymm6
vmovups 0x240(%rsp), %ymm8
vblendvps %ymm9, %ymm10, %ymm8, %ymm8
vorps %ymm6, %ymm8, %ymm6
vorps %ymm7, %ymm6, %ymm6
movq 0x28(%rsp), %rsi
movq 0x10(%rsi), %rbp
movq (%rbp), %rbp
vextractf128 $0x1, %ymm6, %xmm7
cmpq %r14, %r11
jae 0x57fa3d
movq 0x98(%rsp), %rsi
addq %rbp, %rsi
vpextrb $0xc, %xmm7, (%r11,%rsi)
cmpq %rcx, 0x10(%rsp)
setae %sil
leaq -0x1(%r11), %rdi
cmpq %r14, %rdi
setae %dil
orb %sil, %dil
jne 0x57fa68
movq 0xa0(%rsp), %rsi
addq %rbp, %rsi
vpextrb $0x8, %xmm7, (%r11,%rsi)
cmpq %rcx, 0x38(%rsp)
vmovups 0x160(%rsp), %ymm12
jae 0x57faa3
leaq -0x2(%r11), %rsi
cmpq $0x2, %r11
setae %dil
cmpq %r14, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x57faa3
movq 0x68(%rsp), %rsi
addq %rbp, %rsi
vpextrb $0x4, %xmm7, (%r11,%rsi)
cmpq %rcx, 0x58(%rsp)
jae 0x57fad5
leaq -0x3(%r11), %rsi
cmpq $0x3, %r11
setae %dil
cmpq %r14, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x57fad5
movq 0x70(%rsp), %rsi
addq %rbp, %rsi
vpextrb $0x0, %xmm7, (%r11,%rsi)
cmpq %rcx, 0xd8(%rsp)
jae 0x57fb0a
leaq -0x4(%r11), %rsi
cmpq $0x4, %r11
setae %dil
cmpq %r14, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x57fb0a
movq 0x78(%rsp), %rsi
addq %rbp, %rsi
vpextrb $0xc, %xmm6, (%r11,%rsi)
cmpq %rcx, 0xd0(%rsp)
jae 0x57fb42
leaq -0x5(%r11), %rsi
cmpq $0x5, %r11
setae %dil
cmpq %r14, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x57fb42
movq 0x80(%rsp), %rsi
addq %rbp, %rsi
vpextrb $0x8, %xmm6, (%r11,%rsi)
cmpq %rcx, 0xc8(%rsp)
jae 0x57fb7a
leaq -0x6(%r11), %rsi
cmpq $0x6, %r11
setae %dil
cmpq %r14, %rsi
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x57fb7a
movq 0x88(%rsp), %rsi
addq %rbp, %rsi
vpextrb $0x4, %xmm6, (%r11,%rsi)
cmpq %rcx, %rbx
jae 0x57fba6
leaq -0x7(%r11), %rsi
cmpq $0x7, %r11
setb %dil
cmpq %r14, %rsi
setge %sil
orb %dil, %sil
jne 0x57fba6
addq 0x90(%rsp), %rbp
vpextrb $0x0, %xmm6, (%r11,%rbp)
vblendvps %ymm2, %ymm12, %ymm0, %ymm0
movq 0x18(%rsp), %rsi
vmovd %xmm5, (%rsi,%r11,4)
movq 0x40(%rsp), %rdi
vmovd %xmm4, (%rdi,%r11,4)
vpcmpeqd 0x2a0(%rsp), %ymm15, %ymm2
vpand %ymm2, %ymm14, %ymm2
vblendvps %ymm2, %ymm5, %ymm3, %ymm3
vpcmpeqd %ymm2, %ymm2, %ymm2
vpsubd %ymm2, %ymm15, %ymm15
incq %r11
cmpq %r11, 0xc0(%rsp)
jne 0x57f895
vmovdqu 0x1e0(%rsp), %ymm4
vpaddd %ymm4, %ymm10, %ymm4
vmovdqu 0xe0(%rsp), %ymm0
vpsubd 0x1c0(%rsp), %ymm0, %ymm0
vmovdqu %ymm0, 0xe0(%rsp)
movq 0xa8(%rsp), %rax
addq %rax, 0x98(%rsp)
addq %rax, 0xa0(%rsp)
addq %rax, 0x90(%rsp)
addq %rax, 0x88(%rsp)
addq %rax, 0x80(%rsp)
addq %rax, 0x78(%rsp)
addq %rax, 0x70(%rsp)
addq %rax, 0x68(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, %rsi
cmpq %rcx, %rax
movq 0x48(%rsp), %r11
movl 0xc(%rsp), %r9d
jb 0x57f68c
movq 0x340(%rsp), %rbx
movl 0x4(%rsp), %edx
vmovdqu 0x120(%rsp), %ymm13
vmovdqu 0x140(%rsp), %ymm1
jmp 0x57fcb2
vmovdqa %ymm12, %ymm3
vmovdqa %ymm12, %ymm13
vmovdqu 0x100(%rsp), %ymm1
movq 0x340(%rsp), %rbx
movq 0x40(%rsp), %rdi
movl $0x8, %eax
vextractf128 $0x1, %ymm3, %xmm0
vextractps $0x3, %xmm0, %ecx
cmpl %edx, %ecx
cmovgl %ecx, %edx
vperm2f128 $0x28, %ymm3, %ymm3, %ymm0 # ymm0 = zero,zero,ymm3[0,1]
vpalignr $0xc, %ymm0, %ymm3, %ymm3 # ymm3 = ymm0[12,13,14,15],ymm3[0,1,2,3,4,5,6,7,8,9,10,11],ymm0[28,29,30,31],ymm3[16,17,18,19,20,21,22,23,24,25,26,27]
decl %eax
jne 0x57fcb7
vpcmpgtd %ymm1, %ymm12, %ymm0
vpcmpgtd 0x100(%rsp), %ymm13, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestps %ymm0, %ymm0
movq 0x28(%rsp), %rax
movl 0x64(%rsp), %ecx
je 0x57fd04
orb $0x40, 0xc(%rax)
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
movl %edx, (%rax)
movl %r9d, 0x4(%rax)
movl %ecx, 0x8(%rax)
vzeroupper
callq 0x2094b5
movq 0x18(%rsp), %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%rbx)
jne 0x57fd37
movq 0x48(%rsp), %rdi
callq 0x2094b5
movq 0x28(%rsp), %rax
jmp 0x57fd6f
callq 0x1f954b
jmp 0x57fd6d
callq 0x1f9525
jmp 0x57fd6d
callq 0x1f94ff
jmp 0x57fd6d
callq 0x1f94d9
jmp 0x57fd6d
callq 0x1f94b3
jmp 0x57fd6d
callq 0x1f948d
jmp 0x57fd6d
callq 0x1f9467
xorl %eax, %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)