// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/sw_trace_diag_avx2_256_64.c
// Function: parasail_sw_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 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;
    __m256i vTDiag;
    __m256i vTIns;
    __m256i vTDel;
    __m256i vTZero;
    __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 = 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);
    vTDiag = _mm256_set1_epi64x_rpl(PARASAIL_DIAG);
    vTIns = _mm256_set1_epi64x_rpl(PARASAIL_INS);
    vTDel = _mm256_set1_epi64x_rpl(PARASAIL_DEL);
    vTZero = _mm256_set1_epi64x_rpl(PARASAIL_ZERO);
    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_SW | 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] = 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 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))];
        __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_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);
            vNWH = _mm256_max_epi64_rpl(vNWH, vZero);
            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_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);
            }
            /* trace table */
            {
                __m256i cond_zero = _mm256_cmpeq_epi64(vWH, vZero);
                __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),
                        _mm256_blendv_epi8(vTDiag, vTZero, cond_zero),
                        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
             * 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 $0x460, %rsp            # imm = 0x460
testq %rdx, %rdx
je 0x54ffc7
movl %ecx, %r12d
testl %ecx, %ecx
jle 0x54ffeb
testl %r8d, %r8d
js 0x55000f
testl %r9d, %r9d
js 0x550049
movq %rdx, %r14
movq 0x10(%rbp), %rdx
testq %rdx, %rdx
je 0x55006a
cmpl $0x0, 0x30(%rdx)
je 0x54f589
movl 0x34(%rdx), %ebx
jmp 0x54f59c
testq %rdi, %rdi
je 0x55008b
movl %esi, %ebx
testl %esi, %esi
jle 0x5500ac
movq %rdi, 0x140(%rsp)
movl %r9d, 0xe0(%rsp)
movslq 0x20(%rdx), %rax
movl %r8d, %ecx
negl %r8d
movq %rcx, 0xa0(%rsp)
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
movq %r15, %rsi
subq %rax, %rsi
cmpl %r8d, %eax
cmovgq %rcx, %rsi
movq %rsi, 0x20(%rsp)
movslq 0x1c(%rdx), %rax
movq %rax, 0x160(%rsp)
pushq $0x20
popq %rdx
pushq $0x1
popq %rcx
movl %ebx, %edi
movl %r12d, %esi
callq 0x1abb59
testq %rax, %rax
je 0x54f66a
movq %rax, %r13
movq %r14, 0xc0(%rsp)
movq %rbx, 0x18(%rsp)
orl $0x4881004, 0xc(%rax)   # imm = 0x4881004
movq %r12, 0x1e0(%rsp)
addl $0x6, %r12d
pushq $0x20
popq %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1ab78c
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1ab78c
movq %rax, %rbx
pushq $0x20
popq %rdi
movq %r12, %rsi
callq 0x1ab78c
movq %r14, 0x8(%rsp)
testq %r14, %r14
sete %dl
testq %rbx, %rbx
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
je 0x54f671
xorl %ebx, %ebx
jmp 0x5500d4
movq %rbx, %r9
movq %r13, 0x40(%rsp)
movq 0x18(%rsp), %rbx
movslq %ebx, %r13
movq 0x10(%rbp), %r12
cmpl $0x0, 0x30(%r12)
movq %r9, 0x28(%rsp)
je 0x54ff52
movq $0x0, 0x10(%rsp)
movq 0xc0(%rsp), %r10
movq 0x1e0(%rsp), %rdx
leal 0x3(%rdx), %edi
movq 0x20(%rsp), %rcx
incq %rcx
subq 0x160(%rsp), %r15
addq $-0x2, %r15
movq %rcx, 0x20(%rsp)
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm7
vmovq %r15, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x220(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vpblendd $0xc0, %ymm0, %ymm7, %ymm0 # ymm0 = ymm7[0,1,2,3,4,5],ymm0[6,7]
vmovdqa %ymm0, 0x2a0(%rsp)
vmovsd 0xa0(%rsp), %xmm0
vbroadcastsd %xmm0, %ymm0
vmovaps %ymm0, 0xc0(%rsp)
movl 0xe0(%rsp), %ecx
vmovq %rcx, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x120(%rsp)
vmovq %r13, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x280(%rsp)
movl %edx, %ebx
vmovq %rbx, %xmm0
vpbroadcastq %xmm0, %ymm0
vmovdqa %ymm0, 0x300(%rsp)
movq 0x10(%r12), %rcx
xorl %edx, %edx
movq 0x8(%rsp), %r8
cmpq %rdx, %rbx
je 0x54f778
movzbl (%r10,%rdx), %esi
movslq (%rcx,%rsi,4), %rsi
movq %rsi, 0x18(%r8,%rdx,8)
incq %rdx
jmp 0x54f760
xorl %ecx, %ecx
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %rdx
cmpq $0x3, %rcx
je 0x54f794
andq $0x0, (%rdx,%rcx,8)
incq %rcx
jmp 0x54f784
movq %rbx, %rcx
movq 0x8(%rsp), %rdx
cmpl %ecx, %edi
jle 0x54f7ab
andq $0x0, 0x18(%rdx,%rcx,8)
incq %rcx
jmp 0x54f79c
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x54f7c2
andq $0x0, 0x18(%r9,%rcx,8)
movq %r10, 0x18(%rax,%rcx,8)
incq %rcx
jmp 0x54f7ad
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x54f7d7
movq %r10, (%r9,%rcx,8)
movq %r10, (%rax,%rcx,8)
incq %rcx
jmp 0x54f7c4
movq %rbx, %rcx
cmpl %ecx, %edi
jle 0x54f7ed
movq %r10, 0x18(%r9,%rcx,8)
movq %r10, 0x18(%rax,%rcx,8)
incq %rcx
jmp 0x54f7da
movq 0x18(%rsp), %rcx
decl %ecx
movq %rcx, 0x18(%rsp)
movl %edi, %ecx
sarl $0x1f, %ecx
andnl %edi, %ecx, %ecx
movq %rcx, 0x98(%rsp)
leaq -0x2(,%rbx,2), %rcx
movq %rcx, 0x30(%rsp)
leaq (,%rbx,4), %rcx
movq %rcx, 0x48(%rsp)
vmovaps 0x7bf93(%rip), %ymm0    # 0x5cb7c0
vmovaps %ymm0, 0x100(%rsp)
movq $0x0, 0x38(%rsp)
xorl %esi, %esi
vmovdqa %ymm7, %ymm5
vmovdqa %ymm7, %ymm9
vmovdqa %ymm7, %ymm10
vmovdqa %ymm7, 0x180(%rsp)
vmovdqa 0x220(%rsp), %ymm0
vmovdqa %ymm0, 0x1a0(%rsp)
vmovdqa %ymm7, 0x240(%rsp)
cmpq %r13, %rsi
jge 0x54fe47
movq %rsi, %r11
orq $0x2, %r11
cmpl $0x0, 0x30(%r12)
movq %rsi, 0x50(%rsp)
je 0x54f8cd
movq %rsi, %r14
orq $0x1, %r14
cmpq %r13, %r14
movq %rsi, %rdi
movq 0x18(%rsp), %rsi
movl %esi, %ecx
cmovll %r14d, %ecx
movslq %ecx, %r10
cmpq %r13, %r11
movl %r11d, %ecx
cmovgel %esi, %ecx
movslq %ecx, %rcx
movq %rdi, %r15
orq $0x3, %r15
cmpq %r13, %r15
movl %r15d, %edx
cmovgel %esi, %edx
movslq %edx, %rdx
movq %rdi, %rsi
jmp 0x54f8f5
movq 0x10(%rsp), %rdx
movq %rsi, %rdi
movq (%rdx,%rsi,8), %rsi
movq 0x8(%rdx,%rdi,8), %r10
movq %rdi, %r14
orq $0x1, %r14
movq (%rdx,%r11,8), %rcx
movq %rdi, %r15
orq $0x3, %r15
movq 0x18(%rdx,%rdi,8), %rdx
movq 0x8(%r12), %rdi
movslq 0x18(%r12), %r8
imulq %r8, %r10
leaq (%rdi,%r10,4), %r10
movq %r10, 0x80(%rsp)
imulq %r8, %rsi
leaq (%rdi,%rsi,4), %rsi
movq %rsi, 0x78(%rsp)
imulq %r8, %rcx
leaq (%rdi,%rcx,4), %rcx
movq %rcx, 0x70(%rsp)
imulq %r8, %rdx
leaq (%rdi,%rdx,4), %rcx
movq %rcx, 0x68(%rsp)
movq %r14, %rcx
imulq %rbx, %rcx
movq %r15, %rdx
imulq %rbx, %rdx
addq $-0x3, %rdx
movq %rdx, 0x58(%rsp)
decq %rcx
movq %rcx, 0x60(%rsp)
vmovdqa 0x280(%rsp), %ymm0
vpcmpgtq 0x100(%rsp), %ymm0, %ymm0
vmovdqa %ymm0, 0x320(%rsp)
xorl %r12d, %r12d
vmovdqa 0x2a0(%rsp), %ymm12
vmovdqa %ymm12, %ymm2
vmovdqa %ymm7, %ymm6
vmovdqa %ymm7, %ymm0
vpmovsxbq 0x7a33c(%rip), %ymm11 # 0x5c9cce
movq %r14, 0x90(%rsp)
movq %r15, 0x88(%rsp)
cmpq %r12, 0x98(%rsp)
je 0x54fe02
movq %r13, %r14
movq %rbx, %r13
movq %r11, %rbx
vmovdqa %ymm10, 0x3e0(%rsp)
vmovdqa %ymm9, 0x400(%rsp)
vmovdqa %ymm5, 0x1e0(%rsp)
vpermq $0xf9, %ymm12, %ymm1    # ymm1 = ymm12[1,2,3,3]
vmovdqa %ymm2, 0x1c0(%rsp)
vpbroadcastq 0x18(%r9,%r12,8), %ymm2
vpblendd $0xc0, %ymm2, %ymm1, %ymm2 # ymm2 = ymm1[0,1,2,3,4,5],ymm2[6,7]
vpermq $0xf9, %ymm0, %ymm0     # ymm0 = ymm0[1,2,3,3]
movq %rax, %r15
vpbroadcastq 0x18(%rax,%r12,8), %ymm1
vpblendd $0xc0, %ymm1, %ymm0, %ymm1 # ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
vmovdqa %ymm2, 0x3c0(%rsp)
vpsubq 0xc0(%rsp), %ymm2, %ymm0
vpsubq 0x120(%rsp), %ymm1, %ymm1
vmovdqa %ymm0, 0x3a0(%rsp)
vmovdqa %ymm1, 0x380(%rsp)
vmovdqa %ymm11, 0x140(%rsp)
vmovdqa %ymm12, 0xe0(%rsp)
vmovdqa %ymm6, 0xa0(%rsp)
callq 0x5500e6
vmovdqa %ymm0, 0x160(%rsp)
vmovdqa 0xe0(%rsp), %ymm0
vpsubq 0xc0(%rsp), %ymm0, %ymm0
vmovdqa 0xa0(%rsp), %ymm1
vpsubq 0x120(%rsp), %ymm1, %ymm1
vmovdqa %ymm0, 0x360(%rsp)
vmovdqa %ymm1, 0x340(%rsp)
callq 0x5500e6
vmovdqa %ymm0, 0xa0(%rsp)
movq 0x8(%rsp), %rsi
movq 0x18(%rsi,%r12,8), %rax
movq 0x78(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
movq 0x10(%rsi,%r12,8), %rcx
movq 0x80(%rsp), %rdx
movslq (%rdx,%rcx,4), %rcx
movq (%rsi,%r12,8), %rdx
movq 0x8(%rsi,%r12,8), %rsi
movq 0x70(%rsp), %rdi
movslq (%rdi,%rsi,4), %rsi
movq 0x68(%rsp), %rdi
movslq (%rdi,%rdx,4), %rdx
vmovq %rax, %xmm0
vmovq %rcx, %xmm1
vpunpcklqdq %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0]
vmovq %rsi, %xmm1
vmovq %rdx, %xmm2
vpunpcklqdq %xmm1, %xmm2, %xmm1 # xmm1 = xmm2[0],xmm1[0]
vinserti128 $0x1, %xmm0, %ymm1, %ymm0
vpaddq 0x1c0(%rsp), %ymm0, %ymm0
vpxor %xmm1, %xmm1, %xmm1
callq 0x5500e6
vmovdqa %ymm0, 0x1c0(%rsp)
vmovaps 0xa0(%rsp), %ymm1
callq 0x5500e6
vmovapd 0x160(%rsp), %ymm1
callq 0x5500e6
vmovdqa 0x140(%rsp), %ymm11
vmovdqa %ymm0, %ymm6
vpcmpeqq 0x7bf32(%rip), %ymm11, %ymm13 # 0x5cba80
vpandn %ymm0, %ymm13, %ymm12
cmpq $0x4, %r12
jb 0x54fbcf
vmovdqa 0x1a0(%rsp), %ymm1
vpcmpgtq %ymm1, %ymm12, %ymm0
vblendvpd %ymm0, %ymm1, %ymm12, %ymm1
vmovapd %ymm1, 0x1a0(%rsp)
vmovdqa 0x180(%rsp), %ymm0
vmovapd %ymm12, %ymm1
vmovaps %ymm12, 0xe0(%rsp)
vmovdqa %ymm13, 0x2e0(%rsp)
vmovdqa %ymm6, 0x2c0(%rsp)
callq 0x5500e6
vmovdqa 0x2c0(%rsp), %ymm6
vmovdqa 0x2e0(%rsp), %ymm13
vmovapd 0xe0(%rsp), %ymm12
vmovdqa 0x140(%rsp), %ymm11
vmovdqa %ymm0, 0x180(%rsp)
vmovapd 0x240(%rsp), %ymm7
movq %rbx, %r11
vmovapd 0x160(%rsp), %ymm0
vblendvpd %ymm13, %ymm7, %ymm0, %ymm0
vpcmpeqq 0x1c0(%rsp), %ymm12, %ymm1
vpcmpeqq %ymm0, %ymm12, %ymm2
vpbroadcastq 0x785fe(%rip), %ymm3 # 0x5c8200
vpsubq %ymm2, %ymm3, %ymm2
vpcmpeqq 0x7bc31(%rip), %ymm12, %ymm3 # 0x5cb840
vpbroadcastq 0x7be88(%rip), %ymm4 # 0x5cbaa0
vpandn %ymm4, %ymm3, %ymm3
vblendvpd %ymm1, %ymm3, %ymm2, %ymm1
vmovdqa 0x360(%rsp), %ymm2
vpcmpgtq 0x340(%rsp), %ymm2, %ymm2
vmovdqa 0x3a0(%rsp), %ymm3
vpcmpgtq 0x380(%rsp), %ymm3, %ymm3
vbroadcastsd 0x7da7f(%rip), %ymm4 # 0x5cd6d0
vbroadcastsd 0x7da7e(%rip), %ymm5 # 0x5cd6d8
vblendvpd %ymm2, %ymm4, %ymm5, %ymm2
vbroadcastsd 0x7da77(%rip), %ymm4 # 0x5cd6e0
vbroadcastsd 0x7da76(%rip), %ymm5 # 0x5cd6e8
vblendvpd %ymm3, %ymm4, %ymm5, %ymm3
vorpd %ymm2, %ymm3, %ymm2
vorpd %ymm1, %ymm2, %ymm1
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
vextractf128 $0x1, %ymm1, %xmm2
movq %r13, %rbx
cmpq %r13, %r12
movq 0x28(%rsp), %r9
movq %r15, %rax
vmovdqa 0x400(%rsp), %ymm9
vmovdqa 0x3e0(%rsp), %ymm10
jae 0x54fcc3
movq 0x38(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x8, %xmm2, (%r12,%rcx)
movq %r14, %r13
movq 0x90(%rsp), %r14
cmpq %r13, %r14
setge %cl
leaq -0x1(%r12), %rdx
cmpq %rbx, %rdx
setae %dl
orb %cl, %dl
movq 0x88(%rsp), %r15
jne 0x54fcfa
movq 0x60(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x0, %xmm2, (%r12,%rcx)
cmpq %r13, %r11
jge 0x54fd27
leaq -0x2(%r12), %rcx
cmpq $0x2, %r12
setae %dl
cmpq %rbx, %rcx
setl %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x54fd27
movq 0x30(%rsp), %rcx
addq %rsi, %rcx
vpextrb $0x8, %xmm1, (%r12,%rcx)
cmpq %r13, %r15
setge %cl
cmpq $0x3, %r12
setb %dl
orb %cl, %dl
jne 0x54fd44
addq 0x58(%rsp), %rsi
vpextrb $0x0, %xmm1, (%r12,%rsi)
vpcmpeqd %ymm8, %ymm8, %ymm8
vpcmpgtq %ymm8, %ymm11, %ymm1
vmovdqa 0x300(%rsp), %ymm2
vpcmpgtq %ymm11, %ymm2, %ymm2
vpand 0x320(%rsp), %ymm2, %ymm2
vpand %ymm1, %ymm2, %ymm1
vextracti128 $0x1, %ymm1, %xmm2
vpackssdw %xmm2, %xmm1, %xmm2
vpcmpeqq %ymm10, %ymm12, %ymm3
vpcmpgtq %ymm10, %ymm12, %ymm4
vpand %ymm1, %ymm4, %ymm5
vblendvpd %ymm5, %ymm6, %ymm10, %ymm10
vextracti128 $0x1, %ymm5, %xmm6
vpackssdw %xmm6, %xmm5, %xmm5
vpcmpgtq %ymm11, %ymm9, %ymm6
vpand %ymm6, %ymm3, %ymm3
vextracti128 $0x1, %ymm3, %xmm6
vpackssdw %xmm6, %xmm3, %xmm6
vblendvps %xmm6, %xmm2, %xmm5, %xmm2
vmovapd 0xa0(%rsp), %ymm5
vblendvpd %ymm13, %ymm7, %ymm5, %ymm6
vpmovsxdq %xmm2, %ymm2
vmovapd 0x1e0(%rsp), %ymm5
vblendvpd %ymm2, 0x100(%rsp), %ymm5, %ymm5
vpor %ymm4, %ymm3, %ymm2
vpand %ymm2, %ymm1, %ymm1
vblendvpd %ymm1, %ymm11, %ymm9, %ymm9
vmovq %xmm12, (%r9,%r12,8)
vmovq %xmm0, (%rax,%r12,8)
vpsubq %ymm8, %ymm11, %ymm11
incq %r12
vmovdqa 0x3c0(%rsp), %ymm2
jmp 0x54f9a2
vpbroadcastq 0x7bc95(%rip), %ymm0 # 0x5cbaa0
vmovdqa 0x100(%rsp), %ymm1
vpaddq %ymm0, %ymm1, %ymm1
vmovdqa %ymm1, 0x100(%rsp)
movq 0x50(%rsp), %rsi
addq $0x4, %rsi
movq 0x48(%rsp), %rcx
addq %rcx, 0x30(%rsp)
addq %rcx, 0x38(%rsp)
movq 0x10(%rbp), %r12
movq 0x20(%rsp), %r10
jmp 0x54f871
vmovdqa %ymm10, 0x420(%rsp)
vmovdqa %ymm9, 0x260(%rsp)
vmovdqa %ymm5, 0x200(%rsp)
xorl %edx, %edx
xorl %r9d, %r9d
xorl %ecx, %ecx
movq 0x40(%rsp), %rbx
cmpl $0x4, %edx
je 0x54feda
movq 0x420(%rsp,%rdx,8), %rsi
cmpq %r10, %rsi
jle 0x54fe91
movl 0x200(%rsp,%rdx,8), %ecx
movl 0x260(%rsp,%rdx,8), %r9d
jmp 0x54fed2
jne 0x54fecf
movq 0x260(%rsp,%rdx,8), %rdi
movslq %r9d, %rsi
cmpq %rsi, %rdi
jge 0x54feb2
movl 0x200(%rsp,%rdx,8), %ecx
movq %r10, %rsi
movl %edi, %r9d
jmp 0x54fed2
jne 0x54fecf
movq 0x200(%rsp,%rdx,8), %r8
movslq %ecx, %rsi
cmpq %rsi, %r8
jge 0x54fecf
movq %r10, %rsi
movl %edi, %r9d
movl %r8d, %ecx
jmp 0x54fed2
movq %r10, %rsi
incq %rdx
movq %rsi, %r10
jmp 0x54fe6e
vpcmpgtq 0x1a0(%rsp), %ymm7, %ymm0
vmovdqa 0x180(%rsp), %ymm1
vpcmpgtq 0x220(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestpd %ymm0, %ymm0
je 0x54ff0e
orb $0x40, 0xc(%rbx)
xorl %r10d, %r10d
xorl %r9d, %r9d
xorl %ecx, %ecx
movl %r10d, (%rbx)
movl %ecx, 0x4(%rbx)
movl %r9d, 0x8(%rbx)
movq %rax, %rdi
vzeroupper
callq 0x1ab763
movq 0x28(%rsp), %rdi
callq 0x1ab763
movq 0x8(%rsp), %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%r12)
jne 0x5500d4
movq 0x10(%rsp), %rdi
callq 0x1ab763
jmp 0x5500d4
movq %rax, 0x120(%rsp)
leal 0x3(%rbx), %eax
movslq %eax, %r14
pushq $0x20
popq %rdi
movq %r14, %rsi
callq 0x1ab78c
movq %rax, 0x10(%rsp)
testq %rax, %rax
movq 0xc0(%rsp), %r10
je 0x54f66a
movl %ebx, %eax
sarl $0x1f, %eax
andnl %ebx, %eax, %edi
xorl %ecx, %ecx
movq 0x28(%rsp), %r9
movq 0x120(%rsp), %rax
movq 0x10(%rsp), %r8
movq 0x140(%rsp), %r11
cmpq %rcx, %rdi
je 0x550033
movq 0x10(%r12), %rdx
movzbl (%r11,%rcx), %esi
movslq (%rdx,%rsi,4), %rdx
movq %rdx, (%r8,%rcx,8)
incq %rcx
jmp 0x54ffa7
movq 0x1eb00a(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x77013(%rip), %rsi     # 0x5c6feb
leaq 0x47649(%rip), %rdx     # 0x597628
leaq 0x77717(%rip), %rcx     # 0x5c76fd
jmp 0x5500cb
movq 0x1eafe6(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x77705(%rip), %rsi     # 0x5c7701
leaq 0x47625(%rip), %rdx     # 0x597628
leaq 0x7770b(%rip), %rcx     # 0x5c7715
jmp 0x5500cb
movq 0x1eafc2(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x776fb(%rip), %rsi     # 0x5c771b
leaq 0x47601(%rip), %rdx     # 0x597628
leaq 0x77702(%rip), %rcx     # 0x5c7730
jmp 0x5500cb
movq %r13, %rcx
cmpq %r14, %rcx
jge 0x54f6a7
andq $0x0, (%r8,%rcx,8)
incq %rcx
jmp 0x550036
movq 0x1eaf88(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x776c1(%rip), %rsi     # 0x5c771b
leaq 0x475c7(%rip), %rdx     # 0x597628
leaq 0x776cd(%rip), %rcx     # 0x5c7735
jmp 0x5500cb
movq 0x1eaf67(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x76f70(%rip), %rsi     # 0x5c6feb
leaq 0x475a6(%rip), %rdx     # 0x597628
leaq 0x778b9(%rip), %rcx     # 0x5c7942
jmp 0x5500cb
movq 0x1eaf46(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x76f4f(%rip), %rsi     # 0x5c6feb
leaq 0x47585(%rip), %rdx     # 0x597628
leaq 0x7768f(%rip), %rcx     # 0x5c7739
jmp 0x5500cb
movq 0x1eaf25(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x77644(%rip), %rsi     # 0x5c7701
leaq 0x47564(%rip), %rdx     # 0x597628
leaq 0x77672(%rip), %rcx     # 0x5c773d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq