// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/nw_diag_avx2_256_32.c
// Function: parasail_nw_rowcol_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 = 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 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;

    /* 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);

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

    /* set known flags */
    result->flag |= PARASAIL_FLAG_NW | PARASAIL_FLAG_DIAG
        | PARASAIL_FLAG_BITS_32 | PARASAIL_FLAG_LANES_8;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* 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 vF = vNegInf;
        __m256i vJ = vJreset;
        const int * const restrict matrow0 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+0] : ((i+0 >= s1Len) ? s1Len-1 : i+0))];
        const int * const restrict matrow1 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+1] : ((i+1 >= s1Len) ? s1Len-1 : i+1))];
        const int * const restrict matrow2 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+2] : ((i+2 >= s1Len) ? s1Len-1 : i+2))];
        const int * const restrict matrow3 = &matrix->matrix[matrix->size * ((matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) ? s1[i+3] : ((i+3 >= s1Len) ? s1Len-1 : i+3))];
        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 = _mm256_max_epi32(
                    _mm256_sub_epi32(vNH, vOpen),
                    _mm256_sub_epi32(vF, vGap));
            vE = _mm256_max_epi32(
                    _mm256_sub_epi32(vWH, vOpen),
                    _mm256_sub_epi32(vE, vGap));
            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);
            }
#ifdef PARASAIL_TABLE
            arr_store_si256(result->tables->score_table, vWH, i, s1Len, j, s2Len);
#endif
#ifdef PARASAIL_ROWCOL
            arr_store_rowcol(result->rowcols->score_row, result->rowcols->score_col, vWH, i, s1Len, j, s2Len);
#endif
            H_pr[j-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 $0x238, %rsp            # imm = 0x238
movq %r9, 0x38(%rsp)
testq %rdx, %rdx
je 0x4fb7c9
movl %ecx, %r15d
testl %ecx, %ecx
jle 0x4fb7ed
movl %r8d, %r13d
testl %r8d, %r8d
js 0x4fb811
cmpl $0x0, 0x38(%rsp)
js 0x4fb854
movq 0x270(%rsp), %rbp
testq %rbp, %rbp
je 0x4fb875
cmpl $0x0, 0x30(%rbp)
je 0x4facfd
movl 0x34(%rbp), %esi
jmp 0x4fad0e
testq %rdi, %rdi
je 0x4fb896
testl %esi, %esi
jle 0x4fb8b7
movq %rdi, 0x68(%rsp)
movq %rdx, (%rsp)
vmovd 0x38(%rsp), %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0x210(%rsp)
vpinsrd $0x1, %r13d, %xmm0, %xmm0
vpshufd $0x40, %xmm0, %xmm0     # xmm0 = xmm0[0,0,0,1]
vpmulld 0xd0d91(%rip), %xmm0, %xmm0 # 0x5cbad0
movl 0x20(%rbp), %eax
vmovdqa %xmm0, 0xd0(%rsp)
vpextrd $0x3, %xmm0, %edx
movl $0x80000000, %r12d      # imm = 0x80000000
movl %r13d, %ecx
orl %r12d, %ecx
subl %eax, %r12d
movl %edx, 0xc(%rsp)
cmpl %edx, %eax
cmovgl %ecx, %r12d
movl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
subl 0x1c(%rbp), %ebx
movq %rsi, 0x28(%rsp)
movl %esi, %edi
movl %r15d, %esi
vzeroupper
callq 0x1ab93b
testq %rax, %rax
je 0x4fadec
movq %rax, %r14
movl %ebx, 0x58(%rsp)
movl %r13d, 0x18(%rsp)
orl $0x8441001, 0xc(%rax)   # imm = 0x8441001
movq %r15, 0x20(%rsp)
leal 0xe(%r15), %r13d
pushq $0x20
popq %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1ab783
movq %rax, %r15
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1ab783
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %r13
callq 0x1ab783
testq %r15, %r15
sete %dl
testq %r13, %r13
sete %cl
orb %dl, %cl
movq %rax, 0x60(%rsp)
testq %rax, %rax
sete %al
orb %cl, %al
je 0x4fadf3
xorl %ebx, %ebx
jmp 0x4fb8df
movq %r14, 0x78(%rsp)
cmpl $0x0, 0x30(%rbp)
movq 0x28(%rsp), %r8
movslq %r8d, %r14
je 0x4fb766
movq $0x0, 0x30(%rsp)
movq (%rsp), %r9
movl 0x58(%rsp), %r10d
vmovd %r8d, %xmm0
movq 0x20(%rsp), %r8
vpinsrd $0x1, %r8d, %xmm0, %xmm0
leal 0x7(%r8), %ecx
vpcmpeqd %xmm1, %xmm1, %xmm1
vpaddd %xmm1, %xmm0, %xmm5
incl %r12d
vmovd %r12d, %xmm0
vpbroadcastd %xmm0, %ymm1
vmovd %r10d, %xmm0
vpbroadcastd %xmm0, %ymm6
movl 0x18(%rsp), %r10d
vmovd %r10d, %xmm0
vpbroadcastd %xmm0, %ymm3
movq 0x38(%rsp), %rdi
leal (,%rdi,8), %eax
vmovd %eax, %xmm0
vpbroadcastd %xmm0, %ymm0
vmovdqu %ymm0, 0x1b0(%rsp)
vpbroadcastd %xmm5, %ymm0
vmovdqu %ymm0, 0x190(%rsp)
vpbroadcastd 0xcccdd(%rip), %ymm0 # 0x5c7b70
vpermd %ymm5, %ymm0, %ymm0
vmovdqu %ymm0, 0x1f0(%rsp)
movl 0xc(%rsp), %esi
movl %esi, %eax
subl %edi, %eax
subl %edi, %esi
subl %edi, %esi
imull $-0x3, %edi, %edx
subl %r10d, %edx
leal (,%rdi,4), %edi
vpinsrd $0x1, %edi, %xmm3, %xmm0
vpshufd $0x40, %xmm0, %xmm0     # xmm0 = xmm0[0,0,0,1]
vmovdqa 0xd0(%rsp), %xmm7
vpsubd %xmm0, %xmm7, %xmm0
vmovd %edx, %xmm2
vpbroadcastd %xmm2, %ymm2
vpblendd $0x10, %ymm2, %ymm0, %ymm2 # ymm2 = ymm0[0,1,2,3],ymm2[4],ymm0[5,6,7]
vmovd %esi, %xmm4
vpbroadcastd %xmm4, %ymm4
vpblendd $0x20, %ymm4, %ymm2, %ymm2 # ymm2 = ymm2[0,1,2,3,4],ymm4[5],ymm2[6,7]
vmovd %eax, %xmm4
vpbroadcastd %xmm4, %ymm4
vpblendd $0x40, %ymm4, %ymm2, %ymm2 # ymm2 = ymm2[0,1,2,3,4,5],ymm4[6],ymm2[7]
vinserti128 $0x1, %xmm7, %ymm0, %ymm0
vpblendd $0x88, %ymm0, %ymm2, %ymm0 # ymm0 = ymm2[0,1,2],ymm0[3],ymm2[4,5,6],ymm0[7]
vmovdqu %ymm0, 0xd0(%rsp)
movl %r8d, %eax
movq 0x10(%rbp), %rdx
xorl %esi, %esi
movq 0x60(%rsp), %r8
cmpq %rsi, %rax
je 0x4faf39
movzbl (%r9,%rsi), %edi
movl (%rdx,%rdi,4), %edi
movl %edi, 0x1c(%r15,%rsi,4)
incq %rsi
jmp 0x4faf22
xorl %edx, %edx
cmpq $0x7, %rdx
je 0x4faf4b
andl $0x0, (%r15,%rdx,4)
incq %rdx
jmp 0x4faf3b
movq %rax, %rdx
cmpl %edx, %ecx
jle 0x4faf5d
andl $0x0, 0x1c(%r15,%rdx,4)
incq %rdx
jmp 0x4faf4e
xorl %edx, %edx
movl 0xc(%rsp), %esi
cmpq %rdx, %rax
je 0x4faf7b
movl %esi, 0x1c(%r13,%rdx,4)
movl %r12d, 0x1c(%r8,%rdx,4)
incq %rdx
subl 0x38(%rsp), %esi
jmp 0x4faf63
xorl %edx, %edx
cmpq $0x7, %rdx
je 0x4faf91
movl %r12d, (%r13,%rdx,4)
movl %r12d, (%r8,%rdx,4)
incq %rdx
jmp 0x4faf7d
movq %rax, %rdx
cmpl %edx, %ecx
jle 0x4fafa7
movl %r12d, 0x1c(%r13,%rdx,4)
movl %r12d, 0x1c(%r8,%rdx,4)
incq %rdx
jmp 0x4faf94
andl $0x0, 0x18(%r13)
vextracti128 $0x1, %ymm1, %xmm0
vpalignr $0x4, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[4,5,6,7,8,9,10,11,12,13,14,15],ymm0[0,1,2,3],ymm1[20,21,22,23,24,25,26,27,28,29,30,31],ymm0[16,17,18,19]
vmovdqu %ymm0, 0x170(%rsp)
vpextrd $0x1, %xmm5, %edx
movq %rdx, 0xc0(%rsp)
movl %ecx, %edx
sarl $0x1f, %edx
andnl %ecx, %edx, %ecx
movq %rcx, 0x68(%rsp)
vmovdqu %ymm5, 0x150(%rsp)
vmovd %xmm5, %esi
leaq 0x6(%rax), %rcx
movq %rcx, 0xb8(%rsp)
leaq 0x5(%rax), %rcx
movq %rcx, 0xb0(%rsp)
leaq 0x4(%rax), %rcx
movq %rcx, 0xa8(%rsp)
leaq 0x3(%rax), %rcx
movq %rcx, 0xa0(%rsp)
leaq 0x2(%rax), %rcx
movq %rcx, 0x98(%rsp)
leaq 0x1(%rax), %rcx
movq %rcx, 0x90(%rsp)
vpmovsxbd 0xcecba(%rip), %ymm5 # 0x5c9cf6
xorl %ebx, %ebx
vpmovsxbd 0xd0af9(%rip), %ymm14 # 0x5cbb40
vpcmpeqd %ymm15, %ymm15, %ymm15
vmovdqu %ymm1, 0x110(%rsp)
vmovdqu %ymm6, 0x130(%rsp)
vmovdqu %ymm6, 0xf0(%rsp)
vmovdqa %ymm1, %ymm11
movl %r12d, 0x74(%rsp)
movq %r13, 0x80(%rsp)
vmovdqu 0x210(%rsp), %ymm9
cmpq %r14, %rbx
jge 0x4fb6c0
movq %rbx, %r8
orq $0x3, %r8
cmpl $0x0, 0x30(%rbp)
movq %rbx, (%rsp)
movq %r8, 0x28(%rsp)
je 0x4fb12b
movq %rbx, %rcx
orq $0x1, %rcx
cmpq %r14, %rcx
movl %ecx, %edx
cmovgel %esi, %edx
movl %edx, 0x18(%rsp)
movq %rbx, %rdi
orq $0x2, %rdi
cmpq %r14, %rdi
movl %edi, %edx
cmovgel %esi, %edx
movl %edx, 0x50(%rsp)
cmpq %r14, %r8
movl %r8d, %edx
cmovgel %esi, %edx
movl %edx, 0x20(%rsp)
movq %rbx, %r8
orq $0x4, %r8
cmpq %r14, %r8
movl %r8d, %edx
cmovgel %esi, %edx
movl %edx, 0x48(%rsp)
movq %rbx, %r9
orq $0x5, %r9
cmpq %r14, %r9
movl %r9d, %edx
cmovgel %esi, %edx
movq %rbx, %r10
orq $0x6, %r10
cmpq %r14, %r10
movl %r10d, %r11d
cmovgel %esi, %r11d
movl %r11d, 0x40(%rsp)
movq %rbx, %r11
orq $0x7, %r11
cmpq %r14, %r11
movl %r11d, %r13d
cmovgel %esi, %r13d
movl %ebx, 0x10(%rsp)
jmp 0x4fb1ba
movq 0x30(%rsp), %rbx
movq (%rsp), %rcx
movl (%rbx,%rcx,4), %ecx
movl %ecx, 0x10(%rsp)
movq (%rsp), %rcx
movl 0x4(%rbx,%rcx,4), %ecx
movl %ecx, 0x18(%rsp)
movq (%rsp), %rcx
orq $0x1, %rcx
movq (%rsp), %rdi
orq $0x2, %rdi
movq (%rsp), %rdx
movl 0x8(%rbx,%rdx,4), %edx
movl %edx, 0x50(%rsp)
movl (%rbx,%r8,4), %edx
movl %edx, 0x20(%rsp)
movq (%rsp), %r8
orq $0x4, %r8
movq (%rsp), %rdx
movl 0x10(%rbx,%rdx,4), %edx
movl %edx, 0x48(%rsp)
movq (%rsp), %r9
orq $0x5, %r9
movq (%rsp), %rdx
movl 0x14(%rbx,%rdx,4), %edx
movq (%rsp), %r10
orq $0x6, %r10
movq (%rsp), %r11
movl 0x18(%rbx,%r11,4), %r11d
movl %r11d, 0x40(%rsp)
movq (%rsp), %r11
orq $0x7, %r11
movq (%rsp), %r12
movl 0x1c(%rbx,%r12,4), %r13d
movq (%rsp), %rbx
movq 0x8(%rbp), %r12
movl 0x18(%rbp), %ebp
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0x58(%rsp)
movl 0x20(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0x20(%rsp)
movl 0x18(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0x18(%rsp)
movl 0x10(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0x10(%rsp)
movl 0x50(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0x50(%rsp)
movl 0x48(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0x48(%rsp)
movl 0x40(%rsp), %edx
imull %ebp, %edx
movslq %edx, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0x40(%rsp)
imull %ebp, %r13d
movslq %r13d, %rdx
leaq (%r12,%rdx,4), %rdx
movq %rdx, 0xc8(%rsp)
movl %ebx, %edx
movq %rbx, %r13
movq 0x38(%rsp), %rbx
imull %ebx, %edx
movl 0xc(%rsp), %r12d
movl %r12d, %ebp
subl %edx, %ebp
vmovd %ebp, %xmm0
leaq 0x8(%r13), %rdx
movq %rdx, 0x88(%rsp)
imull %ebx, %edx
movl %r12d, %ebp
subl %edx, %ebp
movq 0x80(%rsp), %r13
vpbroadcastd 0x18(%r13), %ymm2
vmovdqu 0x170(%rsp), %ymm4
vpblendd $0x80, %ymm2, %ymm4, %ymm6 # ymm6 = ymm4[0,1,2,3,4,5,6],ymm2[7]
vpbroadcastd %xmm0, %ymm0
vpblendd $0x80, %ymm0, %ymm4, %ymm0 # ymm0 = ymm4[0,1,2,3,4,5,6],ymm0[7]
movl %ebp, 0x18(%r13)
vmovdqu %ymm5, 0x1d0(%rsp)
vpcmpeqd 0x190(%rsp), %ymm5, %ymm2
xorl %r12d, %r12d
vmovdqa %ymm1, %ymm10
vmovdqa %ymm1, %ymm5
vpmovsxbd 0xcea28(%rip), %ymm13 # 0x5c9cfe
movq 0x60(%rsp), %rbx
cmpq %r12, 0x68(%rsp)
je 0x4fb675
movslq 0x10(%r15,%r12,4), %rdx
movq 0x20(%rsp), %rbp
vmovd (%rbp,%rdx,4), %xmm4
movslq 0x14(%r15,%r12,4), %rdx
movq 0x50(%rsp), %rbp
vpinsrd $0x1, (%rbp,%rdx,4), %xmm4, %xmm4
movslq 0x18(%r15,%r12,4), %rdx
movq 0x18(%rsp), %rbp
vpinsrd $0x2, (%rbp,%rdx,4), %xmm4, %xmm4
movslq 0x1c(%r15,%r12,4), %rdx
movq 0x10(%rsp), %rbp
vpinsrd $0x3, (%rbp,%rdx,4), %xmm4, %xmm12
movslq (%r15,%r12,4), %rdx
movq 0xc8(%rsp), %rbp
vmovd (%rbp,%rdx,4), %xmm4
movslq 0x4(%r15,%r12,4), %rdx
movq 0x40(%rsp), %rbp
vpinsrd $0x1, (%rbp,%rdx,4), %xmm4, %xmm4
movslq 0x8(%r15,%r12,4), %rdx
movq 0x58(%rsp), %rbp
vpinsrd $0x2, (%rbp,%rdx,4), %xmm4, %xmm4
movslq 0xc(%r15,%r12,4), %rdx
movq 0x48(%rsp), %rbp
vpinsrd $0x3, (%rbp,%rdx,4), %xmm4, %xmm7
vpermd %ymm0, %ymm14, %ymm4
vpbroadcastd 0x1c(%r13,%r12,4), %ymm8
vpblendd $0x80, %ymm8, %ymm4, %ymm4 # ymm4 = ymm4[0,1,2,3,4,5,6],ymm8[7]
vpermd %ymm5, %ymm14, %ymm5
vpbroadcastd 0x1c(%rbx,%r12,4), %ymm8
vpblendd $0x80, %ymm8, %ymm5, %ymm5 # ymm5 = ymm5[0,1,2,3,4,5,6],ymm8[7]
vpsubd %ymm3, %ymm4, %ymm8
vpsubd %ymm9, %ymm5, %ymm5
vpmaxsd %ymm5, %ymm8, %ymm5
vpsubd %ymm3, %ymm0, %ymm0
vpsubd %ymm9, %ymm10, %ymm8
vpmaxsd %ymm8, %ymm0, %ymm10
cmpq %rsi, (%rsp)
setne %bpl
vinserti128 $0x1, %xmm12, %ymm7, %ymm0
vpaddd %ymm6, %ymm0, %ymm0
vpmaxsd %ymm5, %ymm10, %ymm6
vpmaxsd %ymm6, %ymm0, %ymm0
vpcmpeqd %ymm15, %ymm13, %ymm12
vblendvps %ymm12, 0xd0(%rsp), %ymm0, %ymm0
cmpq $0x8, %r12
jb 0x4fb414
vmovdqu 0xf0(%rsp), %ymm6
vpminsd %ymm0, %ymm6, %ymm6
vmovdqu %ymm6, 0xf0(%rsp)
vmovdqu 0x110(%rsp), %ymm6
vpmaxsd %ymm0, %ymm6, %ymm6
vmovdqu %ymm6, 0x110(%rsp)
movq 0x78(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq (%rdx), %r13
movq 0x8(%rdx), %rdx
cmpq %rax, %r12
setae %bl
orb %bl, %bpl
vextractf128 $0x1, %ymm0, %xmm6
jne 0x4fb43d
vextractps $0x3, %xmm6, (%r13,%r12,4)
cmpq %r12, 0xc0(%rsp)
jne 0x4fb452
movq (%rsp), %rbx
vextractps $0x3, %xmm6, (%rdx,%rbx,4)
cmpq %rsi, %rcx
setne %bl
leaq -0x1(%r12), %rbp
cmpq %rax, %rbp
setae %bpl
orb %bl, %bpl
jne 0x4fb471
vextractps $0x2, %xmm6, -0x4(%r13,%r12,4)
cmpq %r14, %rcx
setge %bl
cmpq %r12, %rax
setne %bpl
orb %bl, %bpl
jne 0x4fb48a
vextractps $0x2, %xmm6, (%rdx,%rcx,4)
cmpq %rsi, %rdi
jne 0x4fb4b2
leaq -0x2(%r12), %rbx
cmpq $0x2, %r12
setae %bpl
cmpq %rax, %rbx
setl %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x4fb4b2
vextractps $0x1, %xmm6, -0x8(%r13,%r12,4)
cmpq %r14, %rdi
setge %bl
cmpq %r12, 0x90(%rsp)
setne %bpl
orb %bl, %bpl
jne 0x4fb4d0
vextractps $0x1, %xmm6, (%rdx,%rdi,4)
movq 0x28(%rsp), %rbx
cmpq %rsi, %rbx
jne 0x4fb501
leaq -0x3(%r12), %rbx
cmpq $0x3, %r12
setae %bpl
cmpq %rax, %rbx
setl %bl
andb %bpl, %bl
cmpb $0x1, %bl
movq 0x28(%rsp), %rbx
jne 0x4fb501
vmovss %xmm6, -0xc(%r13,%r12,4)
cmpq %r14, %rbx
setge %bl
cmpq %r12, 0x98(%rsp)
setne %bpl
orb %bl, %bpl
jne 0x4fb522
movq 0x28(%rsp), %rbx
vmovss %xmm6, (%rdx,%rbx,4)
cmpq %rsi, %r8
jne 0x4fb54a
leaq -0x4(%r12), %rbx
cmpq $0x4, %r12
setae %bpl
cmpq %rax, %rbx
setl %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x4fb54a
vpextrd $0x3, %xmm0, -0x10(%r13,%r12,4)
cmpq %r14, %r8
setge %bl
cmpq %r12, 0xa0(%rsp)
setne %bpl
orb %bl, %bpl
jne 0x4fb568
vpextrd $0x3, %xmm0, (%rdx,%r8,4)
cmpq %rsi, %r9
jne 0x4fb590
leaq -0x5(%r12), %rbx
cmpq $0x5, %r12
setae %bpl
cmpq %rax, %rbx
setl %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x4fb590
vpextrd $0x2, %xmm0, -0x14(%r13,%r12,4)
cmpq %r14, %r9
setge %bl
cmpq %r12, 0xa8(%rsp)
setne %bpl
orb %bl, %bpl
jne 0x4fb5ae
vpextrd $0x2, %xmm0, (%rdx,%r9,4)
cmpq %rsi, %r10
jne 0x4fb5d6
leaq -0x6(%r12), %rbx
cmpq $0x6, %r12
setae %bpl
cmpq %rax, %rbx
setl %bl
andb %bpl, %bl
cmpb $0x1, %bl
jne 0x4fb5d6
vpextrd $0x1, %xmm0, -0x18(%r13,%r12,4)
cmpq %r14, %r10
setge %bl
cmpq %r12, 0xb0(%rsp)
setne %bpl
orb %bl, %bpl
jne 0x4fb5f4
vpextrd $0x1, %xmm0, (%rdx,%r10,4)
cmpq %rsi, %r11
setne %bl
cmpq $0x7, %r12
setb %bpl
orb %bl, %bpl
jne 0x4fb60e
vmovd %xmm0, -0x1c(%r13,%r12,4)
cmpq %r14, %r11
setge %bl
cmpq %r12, 0xb8(%rsp)
setne %r13b
vmovd %xmm0, %ebp
orb %bl, %r13b
jne 0x4fb62d
movl %ebp, (%rdx,%r11,4)
vblendvps %ymm12, %ymm1, %ymm5, %ymm5
vblendvps %ymm12, %ymm1, %ymm10, %ymm10
movq 0x80(%rsp), %r13
movl %ebp, (%r13,%r12,4)
movq 0x60(%rsp), %rbx
vmovss %xmm5, (%rbx,%r12,4)
vpcmpeqd 0x1f0(%rsp), %ymm13, %ymm6
vpand %ymm2, %ymm6, %ymm6
vblendvps %ymm6, %ymm0, %ymm11, %ymm11
vpsubd %ymm15, %ymm13, %ymm13
incq %r12
vmovdqa %ymm4, %ymm6
jmp 0x4fb2db
vpbroadcastd 0xd0462(%rip), %ymm0 # 0x5cbae0
vmovdqu 0x1d0(%rsp), %ymm5
vpaddd %ymm0, %ymm5, %ymm5
vmovdqu 0xd0(%rsp), %ymm0
vpsubd 0x1b0(%rsp), %ymm0, %ymm0
vmovdqu %ymm0, 0xd0(%rsp)
movq 0x88(%rsp), %rbx
movq 0x270(%rsp), %rbp
movl 0x74(%rsp), %r12d
jmp 0x4fb081
pushq $0x8
popq %rax
movq 0x78(%rsp), %rbx
subl $0x1, %eax
jb 0x4fb6ee
vextracti128 $0x1, %ymm11, %xmm0
vpextrd $0x3, %xmm0, %ecx
cmpl %r12d, %ecx
cmovgl %ecx, %r12d
vperm2i128 $0x28, %ymm11, %ymm11, %ymm0 # ymm0 = zero,zero,ymm11[0,1]
vpalignr $0xc, %ymm0, %ymm11, %ymm11 # ymm11 = ymm0[12,13,14,15],ymm11[0,1,2,3,4,5,6,7,8,9,10,11],ymm0[28,29,30,31],ymm11[16,17,18,19,20,21,22,23,24,25,26,27]
jmp 0x4fb6c8
vpcmpgtd 0xf0(%rsp), %ymm1, %ymm0
vmovdqu 0x110(%rsp), %ymm1
vpcmpgtd 0x130(%rsp), %ymm1, %ymm1
vpor %ymm1, %ymm0, %ymm0
vtestps %ymm0, %ymm0
vmovups 0x150(%rsp), %ymm0
je 0x4fb728
orb $0x40, 0xc(%rbx)
vxorps %xmm0, %xmm0, %xmm0
xorl %r12d, %r12d
movl %r12d, (%rbx)
vmovlps %xmm0, 0x4(%rbx)
movq 0x60(%rsp), %rdi
vzeroupper
callq 0x1ab763
movq %r13, %rdi
callq 0x1ab763
movq %r15, %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%rbp)
jne 0x4fb8df
movq 0x30(%rsp), %rdi
callq 0x1ab763
jmp 0x4fb8df
leal 0x7(%r8), %eax
movslq %eax, %rsi
pushq $0x20
popq %rdi
movq %rsi, 0x10(%rsp)
callq 0x1ab783
movq %rax, 0x30(%rsp)
testq %rax, %rax
movl 0x58(%rsp), %r10d
je 0x4fadec
movq 0x28(%rsp), %r8
movl %r8d, %eax
sarl $0x1f, %eax
andnl %r8d, %eax, %eax
xorl %ecx, %ecx
movq (%rsp), %r9
movq 0x68(%rsp), %rdi
cmpq %rcx, %rax
je 0x4fb835
movq 0x10(%rbp), %rdx
movzbl (%rdi,%rcx), %esi
movl (%rdx,%rsi,4), %edx
movq 0x30(%rsp), %rsi
movl %edx, (%rsi,%rcx,4)
incq %rcx
jmp 0x4fb7a8
movq 0x23f808(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcb811(%rip), %rsi     # 0x5c6feb
leaq 0x8ad21(%rip), %rdx     # 0x586502
leaq 0xcbf15(%rip), %rcx     # 0x5c76fd
jmp 0x4fb8d6
movq 0x23f7e4(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcbf03(%rip), %rsi     # 0x5c7701
leaq 0x8acfd(%rip), %rdx     # 0x586502
leaq 0xcbf09(%rip), %rcx     # 0x5c7715
jmp 0x4fb8d6
movq 0x23f7c0(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcbef9(%rip), %rsi     # 0x5c771b
leaq 0x8acd9(%rip), %rdx     # 0x586502
leaq 0xcbf00(%rip), %rcx     # 0x5c7730
jmp 0x4fb8d6
movq %r14, %rax
movq 0x10(%rsp), %rdx
movq 0x30(%rsp), %rcx
cmpq %rdx, %rax
jge 0x4fae1c
andl $0x0, (%rcx,%rax,4)
incq %rax
jmp 0x4fb842
movq 0x23f77d(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcbeb6(%rip), %rsi     # 0x5c771b
leaq 0x8ac96(%rip), %rdx     # 0x586502
leaq 0xcbec2(%rip), %rcx     # 0x5c7735
jmp 0x4fb8d6
movq 0x23f75c(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcb765(%rip), %rsi     # 0x5c6feb
leaq 0x8ac75(%rip), %rdx     # 0x586502
leaq 0xcc0ae(%rip), %rcx     # 0x5c7942
jmp 0x4fb8d6
movq 0x23f73b(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcb744(%rip), %rsi     # 0x5c6feb
leaq 0x8ac54(%rip), %rdx     # 0x586502
leaq 0xcbe84(%rip), %rcx     # 0x5c7739
jmp 0x4fb8d6
movq 0x23f71a(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0xcbe39(%rip), %rsi     # 0x5c7701
leaq 0x8ac33(%rip), %rdx     # 0x586502
leaq 0xcbe67(%rip), %rcx     # 0x5c773d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq