// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sg_diag_sse2_128_64.c
// Function: parasail_sg_flags_rowcol_diag_sse2_128_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,
        int s1_beg, int s1_end, int s2_beg, int s2_end)
{
    /* 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;
    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 end_query = 0;
    int32_t end_ref = 0;
    int64_t NEG_LIMIT = 0;
    int64_t POS_LIMIT = 0;
    int64_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vNegInf;
    __m128i vOpen;
    __m128i vGap;
    __m128i vOne;
    __m128i vN;
    __m128i vGapN;
    __m128i vNegOne;
    __m128i vI;
    __m128i vJreset;
    __m128i vMaxHRow;
    __m128i vMaxHCol;
    __m128i vLastVal;
    __m128i vEndI;
    __m128i vEndJ;
    __m128i vILimit;
    __m128i vILimit1;
    __m128i vJLimit;
    __m128i vJLimit1;
    __m128i 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 = 2; /* 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 = _mm_set1_epi64x_rpl(NEG_LIMIT);
    vPosLimit = _mm_set1_epi64x_rpl(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm_set1_epi64x_rpl(NEG_LIMIT);
    vOpen = _mm_set1_epi64x_rpl(open);
    vGap  = _mm_set1_epi64x_rpl(gap);
    vOne = _mm_set1_epi64x_rpl(1);
    vN = _mm_set1_epi64x_rpl(N);
    vGapN = s1_beg ? _mm_set1_epi64x_rpl(0) : _mm_set1_epi64x_rpl(gap*N);
    vNegOne = _mm_set1_epi64x_rpl(-1);
    vI = _mm_set_epi64x_rpl(0,1);
    vJreset = _mm_set_epi64x_rpl(0,-1);
    vMaxHRow = vNegInf;
    vMaxHCol = vNegInf;
    vLastVal = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm_set1_epi64x_rpl(s1Len);
    vILimit1 = _mm_sub_epi64(vILimit, vOne);
    vJLimit = _mm_set1_epi64x_rpl(s2Len);
    vJLimit1 = _mm_sub_epi64(vJLimit, vOne);
    vIBoundary = s1_beg ? _mm_set1_epi64x_rpl(0) : _mm_set_epi64x_rpl(
            -open-0*gap,
            -open-1*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_SG | PARASAIL_FLAG_DIAG
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_2;
    result->flag |= s1_beg ? PARASAIL_FLAG_SG_S1_BEG : 0;
    result->flag |= s1_end ? PARASAIL_FLAG_SG_S1_END : 0;
    result->flag |= s2_beg ? PARASAIL_FLAG_SG_S2_BEG : 0;
    result->flag |= s2_end ? PARASAIL_FLAG_SG_S2_END : 0;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    s2B= parasail_memalign_int64_t(16, s2Len+PAD2);
    _H_pr = parasail_memalign_int64_t(16, s2Len+PAD2);
    _F_pr = parasail_memalign_int64_t(16, 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(16, 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 */
    if (s2_beg) {
        for (j=0; j<s2Len; ++j) {
            H_pr[j] = 0;
            F_pr[j] = NEG_LIMIT;
        }
    }
    else {
        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) {
        __m128i vNH = vNegInf;
        __m128i vWH = vNegInf;
        __m128i vE = vNegInf;
        __m128i vF = vNegInf;
        __m128i 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))];
        __m128i vIltLimit = _mm_cmplt_epi64_rpl(vI, vILimit);
        __m128i vIeqLimit1 = _mm_cmpeq_epi64_rpl(vI, vILimit1);
        vNH = _mm_srli_si128(vNH, 8);
        vNH = _mm_insert_epi64_rpl(vNH, H_pr[-1], 1);
        vWH = _mm_srli_si128(vWH, 8);
        vWH = _mm_insert_epi64_rpl(vWH, s1_beg ? 0 : (-open - i*gap), 1);
        H_pr[-1] = -open - (i+N)*gap;
        /* iterate over database sequence */
        for (j=0; j<s2Len+PAD; ++j) {
            __m128i vMat;
            __m128i vNWH = vNH;
            vNH = _mm_srli_si128(vWH, 8);
            vNH = _mm_insert_epi64_rpl(vNH, H_pr[j], 1);
            vF = _mm_srli_si128(vF, 8);
            vF = _mm_insert_epi64_rpl(vF, F_pr[j], 1);
            vF = _mm_max_epi64_rpl(
                    _mm_sub_epi64(vNH, vOpen),
                    _mm_sub_epi64(vF, vGap));
            vE = _mm_max_epi64_rpl(
                    _mm_sub_epi64(vWH, vOpen),
                    _mm_sub_epi64(vE, vGap));
            vMat = _mm_set_epi64x_rpl(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]]
                    );
            vNWH = _mm_add_epi64(vNWH, vMat);
            vWH = _mm_max_epi64_rpl(vNWH, vE);
            vWH = _mm_max_epi64_rpl(vWH, vF);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m128i cond = _mm_cmpeq_epi64_rpl(vJ,vNegOne);
                vWH = _mm_blendv_epi8_rpl(vWH, vIBoundary, cond);
                vF = _mm_blendv_epi8_rpl(vF, vNegInf, cond);
                vE = _mm_blendv_epi8_rpl(vE, vNegInf, cond);
            }
            /* cannot start checking sat until after J clears boundary */
            if (j > PAD) {
                vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm_max_epi64_rpl(vSaturationCheckMax, vWH);
            }
#ifdef PARASAIL_TABLE
            arr_store_si128(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-1] = (int64_t)_mm_extract_epi64_rpl(vWH,0);
            F_pr[j-1] = (int64_t)_mm_extract_epi64_rpl(vF,0);
            /* as minor diagonal vector passes across the i or j limit
             * boundary, extract the last value of the column or row */
            {
                __m128i vJeqLimit1 = _mm_cmpeq_epi64_rpl(vJ, vJLimit1);
                __m128i vJgtNegOne = _mm_cmpgt_epi64_rpl(vJ, vNegOne);
                __m128i vJltLimit = _mm_cmplt_epi64_rpl(vJ, vJLimit);
                __m128i cond_j = _mm_and_si128(vIltLimit, vJeqLimit1);
                __m128i cond_i = _mm_and_si128(vIeqLimit1,
                        _mm_and_si128(vJgtNegOne, vJltLimit));
                __m128i cond_max_row = _mm_cmpgt_epi64_rpl(vWH, vMaxHRow);
                __m128i cond_max_col = _mm_cmpgt_epi64_rpl(vWH, vMaxHCol);
                __m128i cond_last_val = _mm_and_si128(vIeqLimit1, vJeqLimit1);
                __m128i cond_all_row = _mm_and_si128(cond_max_row, cond_i);
                __m128i cond_all_col = _mm_and_si128(cond_max_col, cond_j);
                vMaxHRow = _mm_blendv_epi8_rpl(vMaxHRow, vWH, cond_all_row);
                vMaxHCol = _mm_blendv_epi8_rpl(vMaxHCol, vWH, cond_all_col);
                vLastVal = _mm_blendv_epi8_rpl(vLastVal, vWH, cond_last_val);
                vEndI = _mm_blendv_epi8_rpl(vEndI, vI, cond_all_col);
                vEndJ = _mm_blendv_epi8_rpl(vEndJ, vJ, cond_all_row);
            }
            vJ = _mm_add_epi64(vJ, vOne);
        }
        vI = _mm_add_epi64(vI, vN);
        vIBoundary = _mm_sub_epi64(vIBoundary, vGapN);
    }

    /* alignment ending position */
    {
        int64_t max_row = NEG_LIMIT;
        int64_t max_col = NEG_LIMIT;
        int64_t last_val = NEG_LIMIT;
        int64_t *s = (int64_t*)&vMaxHRow;
        int64_t *t = (int64_t*)&vMaxHCol;
        int64_t *u = (int64_t*)&vLastVal;
        int64_t *i = (int64_t*)&vEndI;
        int64_t *j = (int64_t*)&vEndJ;
        int32_t k;
        for (k=0; k<N; ++k, ++s, ++t, ++u, ++i, ++j) {
            if (*t > max_col || (*t == max_col && *i < end_query)) {
                max_col = *t;
                end_query = *i;
            }
            if (*s > max_row) {
                max_row = *s;
                end_ref = *j;
            }
            if (*u > last_val) {
                last_val = *u;
            }
        }
        if (s1_end && s2_end) {
            if (max_col > max_row || (max_col == max_row && end_ref == s2Len-1)) {
                score = max_col;
                end_ref = s2Len-1;
            }
            else {
                score = max_row;
                end_query = s1Len-1;
            }
        }
        else if (s1_end) {
            score = max_col;
            end_ref = s2Len-1;
        }
        else if (s2_end) {
            score = max_row;
            end_query = s1Len-1;
        }
        else {
            score = last_val;
            end_query = s1Len-1;
            end_ref = s2Len-1;
        }
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi64_rpl(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi64_rpl(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 $0x1d8, %rsp            # imm = 0x1D8
movq %r9, 0x10(%rsp)
testq %rdx, %rdx
je 0x341a0a
testl %ecx, %ecx
jle 0x341a14
testl %r8d, %r8d
js 0x341a1e
cmpl $0x0, 0x10(%rsp)
js 0x341a28
movq 0x210(%rsp), %rbx
testq %rbx, %rbx
je 0x341a32
movq %rdi, %rbp
movl 0x30(%rbx), %eax
testl %eax, %eax
jne 0x340ebb
testq %rbp, %rbp
je 0x341b36
testl %esi, %esi
jle 0x341b3d
testl %eax, %eax
je 0x340ebe
movl 0x34(%rbx), %esi
leal 0x1(%rsi), %r12d
movslq 0x20(%rbx), %rax
movl %r8d, %r9d
movl %r8d, %r10d
negl %r9d
movq %r10, 0x28(%rsp)
btsq $0x3f, %r10
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
movq %rdi, %r8
subq %rax, %r8
movl %r9d, 0xc(%rsp)
cmpl %r9d, %eax
cmovgq %r10, %r8
movq %r8, 0x120(%rsp)
leaq 0x1(%r8), %r15
movslq 0x1c(%rbx), %rax
subq %rax, %rdi
addq $-0x2, %rdi
movq %rdi, 0x88(%rsp)
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x70(%rsp)
movq 0x10(%rsp), %rax
addl %eax, %eax
movslq %esi, %r8
leaq -0x1(%r8), %rdi
movq %rdi, 0x138(%rsp)
movl %ecx, %r14d
leaq -0x1(%r14), %rdi
movq %rdi, 0x158(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0xb0(%rsp)
cmpl $0x0, 0x218(%rsp)
jne 0x340f69
movd %eax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x170(%rsp)
movq %rdx, 0x18(%rsp)
movq %r8, 0x38(%rsp)
movdqa 0x70(%rsp), %xmm0
movdqa %xmm0, 0x110(%rsp)
movdqa %xmm0, 0x100(%rsp)
movdqa %xmm0, 0xf0(%rsp)
movdqa %xmm0, 0xc0(%rsp)
movdqa %xmm0, 0xe0(%rsp)
jne 0x340fd6
movl 0xc(%rsp), %edx
movslq %edx, %rax
subl 0x10(%rsp), %edx
movslq %edx, %rdx
movq %rdx, %xmm1
movq %rax, %xmm0
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movdqa %xmm1, 0xb0(%rsp)
movq %rsi, 0x30(%rsp)
movl %esi, %edi
movl %ecx, %esi
movq %rcx, %r13
callq 0x209630
testq %rax, %rax
je 0x341b42
movq %rbp, 0x60(%rsp)
movq %r15, 0x50(%rsp)
xorl %edi, %edi
cmpl $0x0, 0x218(%rsp)
setne %dil
xorl %ecx, %ecx
cmpl $0x0, 0x220(%rsp)
setne %cl
shll $0x4, %ecx
xorl %edx, %edx
cmpl $0x0, 0x228(%rsp)
setne %dl
shll $0xe, %edx
xorl %esi, %esi
cmpl $0x0, 0x230(%rsp)
setne %sil
shll $0xf, %esi
leal (%rcx,%rdi,8), %ecx
orl %edx, %ecx
orl %esi, %ecx
orl 0xc(%rax), %ecx
orl $0x2841002, %ecx        # imm = 0x2841002
movq %rax, 0x20(%rsp)
movl %ecx, 0xc(%rax)
movq %r13, 0x40(%rsp)
leal 0x2(%r13), %ebp
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2094de
movq %rax, %r13
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2094de
movq %rax, %r15
movl $0x10, %edi
movq %rbp, %rsi
callq 0x2094de
movq %rax, %rbp
testq %r13, %r13
sete %al
movq %r15, 0x58(%rsp)
testq %r15, %r15
sete %cl
orb %al, %cl
testq %rbp, %rbp
sete %al
orb %cl, %al
jne 0x341b42
cmpl $0x0, 0x30(%rbx)
je 0x3410d6
xorl %eax, %eax
movq 0x20(%rsp), %r10
movq 0x40(%rsp), %rdi
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %r15
movl 0x220(%rsp), %r9d
movq 0x18(%rsp), %r11
jmp 0x341140
movslq %r12d, %rsi
movl $0x10, %edi
callq 0x2094de
testq %rax, %rax
je 0x341b42
cmpl $0x0, 0x30(%rsp)
movq 0x20(%rsp), %r10
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %r15
movl 0x220(%rsp), %r9d
movq 0x38(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x60(%rsp), %rdi
jle 0x341133
movq 0x10(%rbx), %rsi
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %edx
movslq (%rsi,%rdx,4), %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r8
jne 0x34111f
movq $0x0, (%rax,%r8,8)
movq 0x40(%rsp), %rdi
movq 0x88(%rsp), %xmm0
movq 0x28(%rsp), %xmm1
movd 0x10(%rsp), %xmm2
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xd0(%rsp)
pshufd $0x44, %xmm1, %xmm0     # xmm0 = xmm1[0,1,0,1]
movdqa %xmm0, 0x1a0(%rsp)
pshufd $0x44, %xmm2, %xmm0     # xmm0 = xmm2[0,1,0,1]
movdqa %xmm0, 0x190(%rsp)
movq 0x10(%rbx), %rcx
cmpl $0x2, %edi
movl $0x1, %r8d
cmovgel %edi, %r8d
xorl %edx, %edx
movzbl (%r11,%rdx), %esi
movslq (%rcx,%rsi,4), %rsi
movq %rsi, 0x8(%r13,%rdx,8)
incq %rdx
cmpq %rdx, %r8
jne 0x341192
xorl %ecx, %ecx
movq %rcx, (%r13)
movq %rcx, 0x8(%r13,%r14,8)
movl 0x10(%rsp), %ecx
movq %rcx, 0x90(%rsp)
movslq 0xc(%rsp), %r11
cmpl $0x0, 0x228(%rsp)
movq 0x30(%rsp), %rsi
je 0x3411ed
xorl %ecx, %ecx
movq $0x0, 0x8(%r12,%rcx,8)
movq %r15, 0x8(%rbp,%rcx,8)
incq %rcx
cmpq %rcx, %r8
jne 0x3411d5
jmp 0x341219
cmpl $0x2, %edi
movl $0x1, %r8d
cmovgel %edi, %r8d
xorl %ecx, %ecx
movq %r11, %rdx
movq %rdx, 0x8(%r12,%rcx,8)
movq %r15, 0x8(%rbp,%rcx,8)
incq %rcx
subq 0x90(%rsp), %rdx
cmpq %rcx, %r8
jne 0x3411ff
movq %r15, (%r12)
movq %r15, (%rbp)
movq %r15, 0x8(%r12,%r14,8)
movq %r15, 0x8(%rbp,%r14,8)
movq $0x0, (%r12)
movdqa 0x110(%rsp), %xmm3
movdqa 0x100(%rsp), %xmm5
movdqa 0xf0(%rsp), %xmm2
movdqa 0xc0(%rsp), %xmm7
movdqa 0xe0(%rsp), %xmm8
testl %esi, %esi
movq %rax, 0x48(%rsp)
jle 0x34191b
movq %r11, 0x130(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x128(%rsp)
leal -0x1(%rsi), %eax
movq %rax, 0x18(%rsp)
movdqa 0x70(%rsp), %xmm0
movdqa %xmm0, %xmm1
psrldq $0x8, %xmm1             # xmm1 = xmm1[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movdqa %xmm1, 0x180(%rsp)
leal -0x1(%rdi), %eax
movq %rax, 0x150(%rsp)
leal 0x1(%rdi), %eax
movq %rax, 0x148(%rsp)
movd 0x2b4880(%rip), %xmm1   # 0x5f5b40
movdqa %xmm1, 0x60(%rsp)
xorl %r11d, %r11d
movdqa %xmm0, 0xa0(%rsp)
movq %rbp, 0x98(%rsp)
movq 0x38(%rsp), %rsi
pcmpeqd %xmm15, %xmm15
movl 0x30(%rbx), %ecx
movq %r11, %rax
testl %ecx, %ecx
jne 0x3412f7
movq 0x48(%rsp), %rax
movq (%rax,%r11,8), %rax
movq %r11, 0x28(%rsp)
orq $0x1, %r11
testl %ecx, %ecx
je 0x341315
cmpq %rsi, %r11
movq 0x18(%rsp), %rcx
cmovbl %r11d, %ecx
movslq %ecx, %rdx
jmp 0x34131e
movq 0x48(%rsp), %rcx
movq (%rcx,%r11,8), %rdx
movslq 0x18(%rbx), %rcx
imulq %rcx, %rax
imulq %rcx, %rdx
movdqa 0x60(%rsp), %xmm0
movq %xmm0, %r9
xorl %ecx, %ecx
cmpq %rsi, %r9
setl %cl
negq %rcx
pshufd $0xee, %xmm0, %xmm4     # xmm4 = xmm0[2,3,2,3]
movq %xmm4, %rbx
xorl %edi, %edi
cmpq %rsi, %rbx
setl %dil
negq %rdi
xorl %r8d, %r8d
movq 0x138(%rsp), %rsi
cmpq %rsi, %r9
sete %r8b
negq %r8
xorl %r9d, %r9d
cmpq %rsi, %rbx
sete %r9b
movq 0x28(%rsp), %rsi
leaq 0x2(%rsi), %rbx
movq %rbx, 0x140(%rsp)
imulq 0x90(%rsp), %rbx
movq 0x130(%rsp), %r15
subq %rbx, %r15
movl %esi, %ebx
imull 0x10(%rsp), %ebx
movl 0xc(%rsp), %ebp
subl %ebx, %ebp
movq %rcx, %xmm0
movq %rdi, %xmm4
movq %r8, %xmm1
negq %r9
movq %r9, %xmm6
movq (%r12), %xmm10
movq %r15, (%r12)
movq 0x128(%rsp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, 0x168(%rsp)
cmpl $0x0, 0x218(%rsp)
leaq (%rcx,%rdx,4), %rax
movq %rax, 0x160(%rsp)
punpcklqdq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0]
movdqa %xmm0, 0x1c0(%rsp)
punpcklqdq %xmm6, %xmm1    # xmm1 = xmm1[0],xmm6[0]
movdqa %xmm1, 0x1b0(%rsp)
movl $0x0, %eax
cmovnel %eax, %ebp
movslq %ebp, %rcx
movq %rcx, %xmm4
movdqa 0x180(%rsp), %xmm9
movdqa %xmm9, %xmm12
punpcklqdq %xmm4, %xmm12   # xmm12 = xmm12[0],xmm4[0]
punpcklqdq %xmm10, %xmm9   # xmm9 = xmm9[0],xmm10[0]
xorl %edx, %edx
movq 0x2b470a(%rip), %xmm11  # 0x5f5b48
movdqa 0x70(%rsp), %xmm13
movdqa %xmm13, %xmm10
movq 0x98(%rsp), %rbp
movdqa %xmm9, %xmm4
pshufd $0xee, %xmm12, %xmm9    # xmm9 = xmm12[2,3,2,3]
movq 0x8(%r12,%rdx,8), %xmm6
punpcklqdq %xmm6, %xmm9    # xmm9 = xmm9[0],xmm6[0]
pshufd $0xee, %xmm10, %xmm6    # xmm6 = xmm10[2,3,2,3]
movq 0x8(%rbp,%rdx,8), %xmm10
punpcklqdq %xmm10, %xmm6   # xmm6 = xmm6[0],xmm10[0]
movdqa %xmm9, %xmm10
movdqa 0x1a0(%rsp), %xmm0
psubq %xmm0, %xmm10
movdqa 0x190(%rsp), %xmm1
psubq %xmm1, %xmm6
movq %xmm10, %rcx
movq %xmm6, %r15
cmpq %r15, %rcx
cmovgq %rcx, %r15
pshufd $0xee, %xmm10, %xmm10   # xmm10 = xmm10[2,3,2,3]
movq %xmm10, %rcx
pshufd $0xee, %xmm6, %xmm6     # xmm6 = xmm6[2,3,2,3]
movq %xmm6, %rdi
cmpq %rdi, %rcx
cmovgq %rcx, %rdi
movq (%r13,%rdx,8), %rcx
movq %r13, %rsi
movq 0x8(%r13,%rdx,8), %r8
movq 0x168(%rsp), %rax
movslq (%rax,%r8,4), %r8
movq 0x160(%rsp), %rax
movslq (%rax,%rcx,4), %rcx
movq %r8, %xmm6
movq %rcx, %xmm10
punpcklqdq %xmm6, %xmm10   # xmm10 = xmm10[0],xmm6[0]
paddq %xmm4, %xmm10
psubq %xmm0, %xmm12
psubq %xmm1, %xmm13
movq %xmm12, %rcx
movq %xmm13, %rbp
cmpq %rbp, %rcx
cmovgq %rcx, %rbp
pshufd $0xee, %xmm12, %xmm4    # xmm4 = xmm12[2,3,2,3]
movq %xmm4, %rcx
pshufd $0xee, %xmm13, %xmm4    # xmm4 = xmm13[2,3,2,3]
movq %xmm4, %r13
cmpq %r13, %rcx
cmovgq %rcx, %r13
movq %xmm10, %rcx
cmpq %rbp, %rcx
cmovleq %rbp, %rcx
pshufd $0xee, %xmm10, %xmm4    # xmm4 = xmm10[2,3,2,3]
movq %xmm4, %r8
cmpq %r13, %r8
cmovleq %r13, %r8
cmpq %r15, %rcx
cmovleq %r15, %rcx
cmpq %rdi, %r8
cmovleq %rdi, %r8
movq %rcx, %xmm4
movq %r8, %xmm6
punpcklqdq %xmm6, %xmm4    # xmm4 = xmm4[0],xmm6[0]
movq %xmm11, %r8
xorl %ecx, %ecx
cmpq $-0x1, %r8
sete %cl
negq %rcx
pshufd $0xee, %xmm11, %xmm6    # xmm6 = xmm11[2,3,2,3]
movq %xmm6, %r12
xorl %r9d, %r9d
cmpq $-0x1, %r12
sete %r9b
negq %r9
movq %rcx, %xmm13
movq %r9, %xmm6
punpcklqdq %xmm6, %xmm13   # xmm13 = xmm13[0],xmm6[0]
movdqa %xmm13, %xmm6
pandn %xmm4, %xmm6
movdqa %xmm13, %xmm12
pand 0xb0(%rsp), %xmm12
por %xmm6, %xmm12
movq %xmm12, %r9
pshufd $0xee, %xmm12, %xmm14   # xmm14 = xmm12[2,3,2,3]
cmpq $0x2, %rdx
jb 0x341659
movdqa 0xd0(%rsp), %xmm0
movq %xmm0, %rcx
cmpq %r9, %rcx
cmovgeq %r9, %rcx
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rbx
movq %xmm14, %rax
cmpq %rax, %rbx
cmovgeq %rax, %rbx
movq %rcx, %xmm0
movq %rbx, %xmm4
movdqa 0xa0(%rsp), %xmm1
movq %xmm1, %rcx
cmpq %r9, %rcx
cmovleq %r9, %rcx
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, %rbx
cmpq %rax, %rbx
cmovgq %rbx, %rax
punpcklqdq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0]
movdqa %xmm0, 0xd0(%rsp)
movq %rcx, %xmm0
movq %rax, %xmm4
punpcklqdq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0]
movdqa %xmm0, 0xa0(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x18(%rsp), %rax
setne %al
movq 0x10(%r10), %rbx
movq (%rbx), %rcx
movq 0x8(%rbx), %rbx
cmpq %r14, %rdx
setae %r10b
orb %al, %r10b
jne 0x341683
movd %xmm14, (%rcx,%rdx,4)
cmpq %rdx, 0x150(%rsp)
jne 0x341698
movq 0x28(%rsp), %rax
movd %xmm14, (%rbx,%rax,4)
cmpq 0x18(%rsp), %r11
setne %al
testq %rdx, %rdx
sete %r10b
orb %al, %r10b
jne 0x3416b3
movd %xmm12, -0x4(%rcx,%rdx,4)
movq %r15, %xmm4
movq %rdi, %xmm6
punpcklqdq %xmm6, %xmm4    # xmm4 = xmm4[0],xmm6[0]
movq %rbp, %xmm6
movq %r13, %xmm10
punpcklqdq %xmm10, %xmm6   # xmm6 = xmm6[0],xmm10[0]
movdqa %xmm13, %xmm10
pandn %xmm4, %xmm10
movdqa %xmm13, %xmm4
pand 0x70(%rsp), %xmm4
por %xmm4, %xmm10
pandn %xmm6, %xmm13
cmpq 0x38(%rsp), %r11
setae %al
cmpq %rdx, %r14
setne %cl
orb %al, %cl
movq 0x20(%rsp), %r10
jne 0x34170c
movd %xmm12, (%rbx,%r11,4)
por %xmm4, %xmm13
xorl %eax, %eax
movq 0x158(%rsp), %rdi
cmpq %rdi, %r8
sete %al
negq %rax
xorl %ecx, %ecx
cmpq %rdi, %r12
sete %cl
negq %rcx
movq %rcx, %xmm4
movq %rax, %xmm6
punpcklqdq %xmm4, %xmm6    # xmm6 = xmm6[0],xmm4[0]
movq %r12, %xmm4
movq %r8, %xmm0
punpcklqdq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0]
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pxor %xmm15, %xmm0
psrad $0x1f, %xmm0
xorl %eax, %eax
cmpq %r14, %r8
setl %al
negq %rax
xorl %ecx, %ecx
cmpq %r14, %r12
setl %cl
negq %rcx
movq %rcx, %xmm1
movq %rax, %xmm4
punpcklqdq %xmm1, %xmm4    # xmm4 = xmm4[0],xmm1[0]
pand %xmm0, %xmm4
movq %xmm3, %rax
xorl %ecx, %ecx
cmpq %rax, %r9
setg %cl
negq %rcx
movq %xmm14, %rax
pshufd $0xee, %xmm3, %xmm0     # xmm0 = xmm3[2,3,2,3]
movq %xmm0, %rdi
xorl %r8d, %r8d
cmpq %rdi, %rax
setg %r8b
negq %r8
movq %rcx, %xmm0
movq %r8, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %xmm5, %rcx
xorl %edi, %edi
cmpq %rcx, %r9
setg %dil
negq %rdi
pshufd $0xee, %xmm5, %xmm1     # xmm1 = xmm5[2,3,2,3]
movq %xmm1, %rcx
xorl %r8d, %r8d
cmpq %rcx, %rax
setg %r8b
negq %r8
movq %rdi, %xmm1
movq %r8, %xmm14
punpcklqdq %xmm14, %xmm1   # xmm1 = xmm1[0],xmm14[0]
movdqa 0x1b0(%rsp), %xmm14
pand %xmm14, %xmm4
pand %xmm0, %xmm4
movdqa 0x1c0(%rsp), %xmm0
pand %xmm6, %xmm0
pand %xmm14, %xmm6
pand %xmm1, %xmm0
movdqa %xmm4, %xmm1
pandn %xmm3, %xmm1
movdqa %xmm4, %xmm3
pand %xmm12, %xmm3
por %xmm1, %xmm3
movdqa %xmm0, %xmm1
pandn %xmm5, %xmm1
movdqa %xmm0, %xmm5
pand %xmm12, %xmm5
por %xmm1, %xmm5
movdqa %xmm12, %xmm1
pand %xmm6, %xmm1
pandn %xmm2, %xmm6
movdqa %xmm6, %xmm2
por %xmm1, %xmm2
movdqa %xmm0, %xmm1
pandn %xmm7, %xmm1
pand 0x60(%rsp), %xmm0
movdqa %xmm0, %xmm7
por %xmm1, %xmm7
movdqa %xmm4, %xmm0
pandn %xmm8, %xmm0
pand %xmm11, %xmm4
movdqa %xmm4, %xmm8
por %xmm0, %xmm8
movq 0x58(%rsp), %r12
movq %xmm12, (%r12,%rdx,8)
movq 0x98(%rsp), %rbp
movq %xmm10, (%rbp,%rdx,8)
psubq %xmm15, %xmm11
incq %rdx
cmpq %rdx, 0x148(%rsp)
movq %rsi, %r13
jne 0x341452
movdqa 0x60(%rsp), %xmm0
paddq 0x2b4266(%rip), %xmm0   # 0x5f5b30
movdqa %xmm0, 0x60(%rsp)
movdqa 0xb0(%rsp), %xmm0
psubq 0x170(%rsp), %xmm0
movdqa %xmm0, 0xb0(%rsp)
movq 0x140(%rsp), %rax
movq %rax, %r11
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
movq 0x210(%rsp), %rbx
movq 0x50(%rsp), %r15
movl 0x220(%rsp), %r9d
jb 0x3412e4
jmp 0x34192a
movdqa 0x70(%rsp), %xmm0
movdqa %xmm0, 0xa0(%rsp)
movdqa %xmm3, 0x110(%rsp)
movdqa %xmm5, 0x100(%rsp)
movdqa %xmm2, 0xf0(%rsp)
movdqa %xmm7, 0xc0(%rsp)
movdqa %xmm8, 0xe0(%rsp)
xorl %edi, %edi
movq %r15, %rcx
movq %r15, %rsi
xorl %edx, %edx
xorl %eax, %eax
movq 0x40(%rsp), %r11
movl 0x230(%rsp), %r14d
movq 0x100(%rsp,%rdi,8), %r8
cmpq %rcx, %r8
jle 0x34198a
movl 0xc0(%rsp,%rdi,8), %edx
movq %r8, %rcx
jmp 0x3419a1
jne 0x3419a1
movslq %edx, %r9
cmpq %r9, 0xc0(%rsp,%rdi,8)
movl 0x220(%rsp), %r9d
jl 0x34197e
movq 0x110(%rsp,%rdi,8), %r8
cmpq %rsi, %r8
jle 0x3419b8
movl 0xe0(%rsp,%rdi,8), %eax
movq %r8, %rsi
movq 0xf0(%rsp,%rdi,8), %r8
cmpq %r15, %r8
cmovgq %r8, %r15
incq %rdi
cmpl $0x1, %edi
je 0x341971
testl %r14d, %r14d
sete %dil
testl %r9d, %r9d
sete %r8b
orb %dil, %r8b
jne 0x3419fd
cmpq %rsi, %rcx
jg 0x341a02
jne 0x3419f1
leal -0x1(%r11), %edi
cmpl %edi, %eax
je 0x341a02
movq 0x30(%rsp), %rdx
decl %edx
movq %rsi, %rcx
jmp 0x341a57
testl %r9d, %r9d
je 0x341a3c
decl %r11d
movl %r11d, %eax
jmp 0x341a57
callq 0x1b53d3
jmp 0x341b42
callq 0x1b53ad
jmp 0x341b42
callq 0x1b5387
jmp 0x341b42
callq 0x1b5361
jmp 0x341b42
callq 0x1b533b
jmp 0x341b42
movq 0x30(%rsp), %rdx
decl %edx
decl %r11d
testl %r14d, %r14d
cmovneq %rsi, %r15
cmovnel %eax, %r11d
movq %r15, %rcx
movl %r11d, %eax
movdqa 0xd0(%rsp), %xmm0
movq %xmm0, %rsi
xorl %edi, %edi
movq 0x120(%rsp), %r9
cmpq %r9, %rsi
setle %dil
negq %rdi
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rsi
xorl %r8d, %r8d
cmpq %r9, %rsi
setle %r8b
negq %r8
movq %rdi, %xmm0
movq %r8, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa 0xa0(%rsp), %xmm1
movq %xmm1, %rsi
xorl %edi, %edi
movq 0x88(%rsp), %r9
cmpq %r9, %rsi
setg %dil
negq %rdi
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, %rsi
xorl %r8d, %r8d
cmpq %r9, %rsi
setg %r8b
negq %r8
movq %rdi, %xmm1
movq %r8, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
por %xmm0, %xmm1
pmovmskb %xmm1, %esi
testl %esi, %esi
je 0x341afc
orb $0x40, 0xc(%r10)
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
movl %ecx, (%r10)
movl %edx, 0x4(%r10)
movl %eax, 0x8(%r10)
movq %rbp, %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%rbx)
jne 0x341b2f
movq 0x48(%rsp), %rdi
callq 0x2094b5
movq 0x20(%rsp), %rax
jmp 0x341b44
callq 0x1b5315
jmp 0x341b42
callq 0x1b52ef
xorl %eax, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq