// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_trace_diag_sse2_128_64.c
// Function: parasail_sw_trace_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)
{
    /* 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;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vNegInf;
    __m128i vNegInf0;
    __m128i vOpen;
    __m128i vGap;
    __m128i vZero;
    __m128i vOne;
    __m128i vN;
    __m128i vNegOne;
    __m128i vI;
    __m128i vJreset;
    __m128i vMaxH;
    __m128i vEndI;
    __m128i vEndJ;
    __m128i vILimit;
    __m128i vJLimit;
    __m128i vTDiag;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTZero;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i 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 = 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);
    vNegInf0 = _mm_srli_si128(vNegInf, 8); /* shift in a 0 */
    vOpen = _mm_set1_epi64x_rpl(open);
    vGap  = _mm_set1_epi64x_rpl(gap);
    vZero = _mm_set1_epi64x_rpl(0);
    vOne = _mm_set1_epi64x_rpl(1);
    vN = _mm_set1_epi64x_rpl(N);
    vNegOne = _mm_set1_epi64x_rpl(-1);
    vI = _mm_set_epi64x_rpl(0,1);
    vJreset = _mm_set_epi64x_rpl(0,-1);
    vMaxH = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm_set1_epi64x_rpl(s1Len);
    vJLimit = _mm_set1_epi64x_rpl(s2Len);
    vTDiag = _mm_set1_epi64x_rpl(PARASAIL_DIAG);
    vTIns = _mm_set1_epi64x_rpl(PARASAIL_INS);
    vTDel = _mm_set1_epi64x_rpl(PARASAIL_DEL);
    vTZero = _mm_set1_epi64x_rpl(PARASAIL_ZERO);
    vTDiagE = _mm_set1_epi64x_rpl(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi64x_rpl(PARASAIL_INS_E);
    vTDiagF = _mm_set1_epi64x_rpl(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi64x_rpl(PARASAIL_DEL_F);

    /* initialize result */
    result = parasail_result_new_trace(s1Len, s2Len, 16, 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_2;

    /* 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 */
    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) {
        __m128i vNH = vNegInf0;
        __m128i vWH = vNegInf0;
        __m128i vE = vNegInf;
        __m128i vE_opn = vNegInf;
        __m128i vE_ext = vNegInf;
        __m128i vF = vNegInf;
        __m128i vF_opn = vNegInf;
        __m128i vF_ext = 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);
        /* 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_opn = _mm_sub_epi64(vNH, vOpen);
            vF_ext = _mm_sub_epi64(vF, vGap);
            vF = _mm_max_epi64_rpl(vF_opn, vF_ext);
            vE_opn = _mm_sub_epi64(vWH, vOpen);
            vE_ext = _mm_sub_epi64(vE, vGap);
            vE = _mm_max_epi64_rpl(vE_opn, vE_ext);
            vMat = _mm_set_epi64x_rpl(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]]
                    );
            vNWH = _mm_add_epi64(vNWH, vMat);
            vNWH = _mm_max_epi64_rpl(vNWH, vZero);
            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_andnot_si128(cond, vWH);
                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);
            }
            /* trace table */
            {
                __m128i cond_zero = _mm_cmpeq_epi64_rpl(vWH, vZero);
                __m128i case1 = _mm_cmpeq_epi64_rpl(vWH, vNWH);
                __m128i case2 = _mm_cmpeq_epi64_rpl(vWH, vF);
                __m128i vT = _mm_blendv_epi8_rpl(
                        _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                        _mm_blendv_epi8_rpl(vTDiag, vTZero, cond_zero),
                        case1);
                __m128i condE = _mm_cmpgt_epi64_rpl(vE_opn, vE_ext);
                __m128i condF = _mm_cmpgt_epi64_rpl(vF_opn, vF_ext);
                __m128i vET = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, condE);
                __m128i vFT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, condF);
                vT = _mm_or_si128(vT, vET);
                vT = _mm_or_si128(vT, vFT);
                arr_store_si128(result->trace->trace_table, vT, i, s1Len, j, s2Len);
            }
            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 table, extract
             * max values within the i,j bounds */
            {
                __m128i cond_valid_J = _mm_and_si128(
                        _mm_cmpgt_epi64_rpl(vJ, vNegOne),
                        _mm_cmplt_epi64_rpl(vJ, vJLimit));
                __m128i cond_valid_IJ = _mm_and_si128(cond_valid_J, vIltLimit);
                __m128i cond_eq = _mm_cmpeq_epi64_rpl(vWH, vMaxH);
                __m128i cond_max = _mm_cmpgt_epi64_rpl(vWH, vMaxH);
                __m128i cond_all = _mm_and_si128(cond_max, cond_valid_IJ);
                __m128i cond_Jlt = _mm_cmplt_epi64_rpl(vJ, vEndJ);
                vMaxH = _mm_blendv_epi8_rpl(vMaxH, vWH, cond_all);
                vEndI = _mm_blendv_epi8_rpl(vEndI, vI, cond_all);
                vEndJ = _mm_blendv_epi8_rpl(vEndJ, vJ, cond_all);
                cond_all = _mm_and_si128(cond_Jlt, cond_eq);
                cond_all = _mm_and_si128(cond_all, cond_valid_IJ);
                vEndI = _mm_blendv_epi8_rpl(vEndI, vI, cond_all);
                vEndJ = _mm_blendv_epi8_rpl(vEndJ, vJ, cond_all);
            }
            vJ = _mm_add_epi64(vJ, vOne);
        }
        vI = _mm_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 (_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 $0x1b8, %rsp            # imm = 0x1B8
testq %rdx, %rdx
je 0x38f3c6
movl %ecx, %r12d
testl %ecx, %ecx
jle 0x38f3cd
testl %r8d, %r8d
js 0x38f3d4
movl %r9d, %ebx
testl %r9d, %r9d
js 0x38f3db
movq 0x1f0(%rsp), %r15
testq %r15, %r15
je 0x38f3e2
movl 0x30(%r15), %eax
testl %eax, %eax
jne 0x38e86c
testq %rdi, %rdi
je 0x38f3e9
testl %esi, %esi
jle 0x38f3f0
testl %eax, %eax
je 0x38e870
movl 0x34(%r15), %esi
movq %rdi, 0x28(%rsp)
movq %rdx, 0xb0(%rsp)
movslq 0x20(%r15), %rax
movl %r8d, %ecx
negl %r8d
movq %rcx, 0xa0(%rsp)
btsq $0x3f, %rcx
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
subq %rax, %r14
cmpl %r8d, %eax
cmovgq %rcx, %r14
leaq 0x1(%r14), %rbp
movslq 0x1c(%r15), %rax
movq %rax, 0x20(%rsp)
movq %rbp, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xe0(%rsp)
movdqa %xmm0, 0x40(%rsp)
movdqa %xmm0, 0x30(%rsp)
movdqa %xmm0, 0xc0(%rsp)
movl $0x10, %edx
movl $0x1, %ecx
movq %rsi, 0x8(%rsp)
movl %esi, %edi
movl %r12d, %esi
callq 0x2097d1
testq %rax, %rax
je 0x38f3f5
movq %rax, %r13
movq %r14, 0xf8(%rsp)
orl $0x2881004, 0xc(%rax)   # imm = 0x2881004
movq %r12, 0x10(%rsp)
addl $0x2, %r12d
movl $0x10, %edi
movq %r12, %rsi
callq 0x2094de
movq %rax, %r14
movl $0x10, %edi
movq %r12, %rsi
callq 0x2094de
movl $0x10, %edi
movq %r12, %rsi
movq %r14, %r12
movq %rax, %r14
callq 0x2094de
movq %rax, %r10
testq %r12, %r12
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
testq %r10, %r10
sete %al
orb %cl, %al
jne 0x38f3f5
movl %ebx, 0x18(%rsp)
movq 0x8(%rsp), %rbx
movslq %ebx, %r11
cmpl $0x0, 0x30(%r15)
movq %r11, 0x68(%rsp)
movq %r10, 0x70(%rsp)
je 0x38e9a4
movq $0x0, (%rsp)
movq 0xb0(%rsp), %rdi
movl 0x18(%rsp), %ecx
movq 0xa0(%rsp), %r9
jmp 0x38ea0b
leal 0x1(%rbx), %eax
movslq %eax, %rsi
movl $0x10, %edi
callq 0x2094de
testq %rax, %rax
je 0x38f3f5
testl %ebx, %ebx
movq 0x68(%rsp), %r11
movq 0xb0(%rsp), %rdi
movq 0x28(%rsp), %r8
movq 0xa0(%rsp), %r9
jle 0x38e9f6
movq 0x10(%r15), %rsi
xorl %ecx, %ecx
movzbl (%r8,%rcx), %edx
movslq (%rsi,%rdx,4), %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r11
jne 0x38e9e1
movq %rax, (%rsp)
movq $0x0, (%rax,%r11,8)
movq 0x70(%rsp), %r10
movl 0x18(%rsp), %ecx
movq 0x20(%rsp), %rdx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
subq %rdx, %rax
addq $-0x2, %rax
movq %rax, 0xf0(%rsp)
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xd0(%rsp)
movdqa 0x30(%rsp), %xmm0
psrldq $0x8, %xmm0             # xmm0 = xmm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movdqa %xmm0, 0x170(%rsp)
movq %r9, %xmm1
pshufd $0x44, %xmm1, %xmm0     # xmm0 = xmm1[0,1,0,1]
movdqa %xmm0, 0x190(%rsp)
movd %ecx, %xmm1
pshufd $0x44, %xmm1, %xmm0     # xmm0 = xmm1[0,1,0,1]
movdqa %xmm0, 0x180(%rsp)
movq 0x10(%rsp), %rdx
movl %edx, %ebx
movq 0x10(%r15), %rcx
cmpl $0x2, %edx
movl $0x1, %eax
cmovgel %edx, %eax
xorl %edx, %edx
movzbl (%rdi,%rdx), %esi
movslq (%rcx,%rsi,4), %rsi
movq %rsi, 0x8(%r12,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x38ea8d
xorl %ecx, %ecx
movq %rcx, (%r12)
movq %rcx, 0x8(%r12,%rbx,8)
movq $0x0, 0x8(%r14,%rcx,8)
movq %rbp, 0x8(%r10,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x38eaad
movq %rbp, (%r14)
movq %rbp, (%r10)
movq %rbp, 0x8(%r14,%rbx,8)
movq %rbp, 0x8(%r10,%rbx,8)
movdqa 0xe0(%rsp), %xmm2
movdqa 0xc0(%rsp), %xmm1
movdqa 0x40(%rsp), %xmm6
movq 0x8(%rsp), %rax
testl %eax, %eax
movq %r13, 0x78(%rsp)
jle 0x38f26e
decl %eax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
leaq (%rbx,%rbx), %rax
movq %rax, 0x100(%rsp)
leaq -0x1(%rbx), %rax
movq %rax, 0x60(%rsp)
movss 0x267013(%rip), %xmm0   # 0x5f5b40
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0x58(%rsp)
xorl %edx, %edx
movdqa 0x30(%rsp), %xmm0
movdqa %xmm0, 0x80(%rsp)
movq %rbp, 0x108(%rsp)
movq %r14, 0x120(%rsp)
movq %r12, 0x128(%rsp)
movq %rbx, 0x118(%rsp)
movl 0x30(%r15), %ecx
movq %rdx, %rax
testl %ecx, %ecx
jne 0x38eb82
movq (%rsp), %rax
movq (%rax,%rdx,8), %rax
movq %rdx, %rsi
orq $0x1, %rsi
testl %ecx, %ecx
movq %rdx, 0x110(%rsp)
movq %rsi, 0x140(%rsp)
je 0x38ebad
cmpq %r11, %rsi
movq 0x8(%rsp), %rcx
cmovbl %esi, %ecx
movslq %ecx, %rcx
jmp 0x38ebb5
movq (%rsp), %rcx
movq (%rcx,%rsi,8), %rcx
movq 0x8(%r15), %rdx
movslq 0x18(%r15), %rsi
imulq %rsi, %rax
leaq (%rdx,%rax,4), %rax
movq %rax, 0x138(%rsp)
imulq %rsi, %rcx
leaq (%rdx,%rcx,4), %rax
movq %rax, 0x130(%rsp)
movdqa 0x90(%rsp), %xmm0
movq %xmm0, %rax
xorl %ecx, %ecx
cmpq %r11, %rax
setl %cl
negq %rcx
pshufd $0xee, %xmm0, %xmm3     # xmm3 = xmm0[2,3,2,3]
movq %xmm3, %rax
xorl %edx, %edx
cmpq %r11, %rax
setl %dl
negq %rdx
movq %rcx, %xmm0
movq %rdx, %xmm3
punpcklqdq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0]
movdqa %xmm0, 0x1a0(%rsp)
xorl %ecx, %ecx
movq 0x266f1b(%rip), %xmm10  # 0x5f5b48
movdqa 0x30(%rsp), %xmm11
movdqa %xmm11, %xmm14
movdqa 0x170(%rsp), %xmm12
movdqa %xmm12, %xmm13
movdqa %xmm1, 0xb0(%rsp)
movq (%r12,%rcx,8), %rax
movq 0x8(%r12,%rcx,8), %rdx
movq 0x138(%rsp), %rsi
movslq (%rsi,%rdx,4), %rdx
movq 0x130(%rsp), %rsi
movslq (%rsi,%rax,4), %rax
movq %rdx, %xmm3
movq %rax, %xmm5
punpcklqdq %xmm3, %xmm5    # xmm5 = xmm5[0],xmm3[0]
paddq %xmm12, %xmm5
pshufd $0xee, %xmm13, %xmm12   # xmm12 = xmm13[2,3,2,3]
movq 0x8(%r14,%rcx,8), %xmm3
punpcklqdq %xmm3, %xmm12   # xmm12 = xmm12[0],xmm3[0]
pshufd $0xee, %xmm14, %xmm3    # xmm3 = xmm14[2,3,2,3]
movq 0x8(%r10,%rcx,8), %xmm8
punpcklqdq %xmm8, %xmm3    # xmm3 = xmm3[0],xmm8[0]
movdqa %xmm12, %xmm8
movdqa 0x190(%rsp), %xmm0
psubq %xmm0, %xmm8
movdqa 0x180(%rsp), %xmm1
psubq %xmm1, %xmm3
movq %xmm8, %rax
movq %xmm3, %r9
cmpq %r9, %rax
movq %r9, 0x150(%rsp)
movq %rax, 0x168(%rsp)
cmovgq %rax, %r9
pshufd $0xee, %xmm8, %xmm8     # xmm8 = xmm8[2,3,2,3]
movq %xmm8, %rax
pshufd $0xee, %xmm3, %xmm3     # xmm3 = xmm3[2,3,2,3]
movq %xmm3, %r10
cmpq %r10, %rax
movq %r10, 0x160(%rsp)
movq %rax, 0x18(%rsp)
cmovgq %rax, %r10
psubq %xmm0, %xmm13
psubq %xmm1, %xmm11
movq %xmm13, %r15
movq %xmm11, %rax
cmpq %rax, %r15
movq %rax, %rdx
cmovgq %r15, %rdx
pshufd $0xee, %xmm13, %xmm3    # xmm3 = xmm13[2,3,2,3]
movq %xmm3, %rsi
pshufd $0xee, %xmm11, %xmm3    # xmm3 = xmm11[2,3,2,3]
movq %xmm3, %r12
cmpq %r12, %rsi
movq %r12, %rdi
movq %rsi, 0x148(%rsp)
cmovgq %rsi, %rdi
movq %xmm5, %rbx
testq %rbx, %rbx
movl $0x0, %esi
cmovleq %rsi, %rbx
pshufd $0xee, %xmm5, %xmm3     # xmm3 = xmm5[2,3,2,3]
movq %xmm3, %r8
testq %r8, %r8
cmovleq %rsi, %r8
cmpq %rdx, %rbx
movq %rdx, 0x158(%rsp)
movq %rdx, %rsi
cmovgq %rbx, %rsi
cmpq %rdi, %r8
movq %rdi, %r11
cmovgq %r8, %r11
cmpq %r9, %rsi
cmovleq %r9, %rsi
movq %rsi, %xmm5
cmpq %r10, %r11
cmovleq %r10, %r11
movq %r11, %xmm3
movq %xmm10, %r11
xorl %esi, %esi
movq %r11, 0x20(%rsp)
cmpq $-0x1, %r11
sete %sil
negq %rsi
movq %rsi, %xmm11
pshufd $0xee, %xmm10, %xmm8    # xmm8 = xmm10[2,3,2,3]
movq %xmm8, %r11
xorl %esi, %esi
movq %r11, 0x28(%rsp)
cmpq $-0x1, %r11
sete %sil
negq %rsi
movq %rsi, %xmm8
punpcklqdq %xmm3, %xmm5    # xmm5 = xmm5[0],xmm3[0]
punpcklqdq %xmm8, %xmm11   # xmm11 = xmm11[0],xmm8[0]
movdqa %xmm11, %xmm13
pandn %xmm5, %xmm13
pshufd $0xee, %xmm13, %xmm5    # xmm5 = xmm13[2,3,2,3]
movq %xmm13, %rbp
cmpq $0x2, %rcx
movdqa %xmm10, 0xa0(%rsp)
jb 0x38ee9a
movdqa 0xd0(%rsp), %xmm0
movq %xmm0, %rsi
cmpq %rbp, %rsi
cmovgeq %rbp, %rsi
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %r11
movq %xmm5, %r14
cmpq %r14, %r11
cmovgeq %r14, %r11
movq %rsi, %xmm0
movq %r11, %xmm3
movdqa 0x80(%rsp), %xmm1
movq %xmm1, %rsi
cmpq %rbp, %rsi
cmovleq %rbp, %rsi
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, %r11
cmpq %r14, %r11
cmovgq %r11, %r14
punpcklqdq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0]
movdqa %xmm0, 0xd0(%rsp)
movq %rsi, %xmm0
movq %r14, %xmm3
punpcklqdq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0]
movdqa %xmm0, 0x80(%rsp)
movq %r9, %xmm3
movq %r10, %xmm8
punpcklqdq %xmm8, %xmm3    # xmm3 = xmm3[0],xmm8[0]
movdqa %xmm11, %xmm14
pandn %xmm3, %xmm14
movdqa %xmm11, %xmm15
pand 0x30(%rsp), %xmm15
por %xmm15, %xmm14
cmpq $0x1, %rbp
movl $0x0, %r10d
sbbq %r10, %r10
movq %xmm5, %r9
cmpq $0x1, %r9
movl $0x0, %esi
sbbq %rsi, %rsi
xorl %r13d, %r13d
cmpq %rbx, %rbp
sete %r13b
negq %r13
xorl %ebx, %ebx
cmpq %r8, %r9
sete %bl
negq %rbx
movq %xmm14, %r11
xorl %r8d, %r8d
cmpq %r11, %rbp
sete %r8b
negq %r8
pshufd $0xee, %xmm14, %xmm3    # xmm3 = xmm14[2,3,2,3]
movq %xmm3, %r14
xorl %r11d, %r11d
cmpq %r14, %r9
sete %r11b
negq %r11
xorl %r14d, %r14d
cmpq %rax, %r15
setg %r14b
negq %r14
xorl %r15d, %r15d
cmpq %r12, 0x148(%rsp)
setg %r15b
negq %r15
xorl %eax, %eax
movq 0x150(%rsp), %rdx
cmpq %rdx, 0x168(%rsp)
setg %al
negq %rax
xorl %r12d, %r12d
movq 0x160(%rsp), %rdx
cmpq %rdx, 0x18(%rsp)
movq %r10, %xmm5
movq %rsi, %xmm3
movq %r13, %xmm8
movq %rbx, %xmm4
movq %r8, %xmm0
movq %r11, %xmm1
movq %r15, %xmm7
movq %r14, %xmm10
setg %r12b
negq %r12
movq %r12, %xmm9
punpcklqdq %xmm3, %xmm5    # xmm5 = xmm5[0],xmm3[0]
punpcklqdq %xmm4, %xmm8    # xmm8 = xmm8[0],xmm4[0]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
pand 0x2684dc(%rip), %xmm0   # 0x5f7490
pxor 0x266f14(%rip), %xmm0   # 0x5f5ed0
pandn %xmm8, %xmm5
pandn %xmm0, %xmm8
pand 0x2684d2(%rip), %xmm5   # 0x5f74a0
punpcklqdq %xmm7, %xmm10   # xmm10 = xmm10[0],xmm7[0]
pand 0x268474(%rip), %xmm10  # 0x5f7450
movq %rax, %xmm3
punpcklqdq %xmm9, %xmm3    # xmm3 = xmm3[0],xmm9[0]
pand 0x268482(%rip), %xmm3   # 0x5f7470
por %xmm10, %xmm3
por %xmm5, %xmm3
por %xmm8, %xmm3
pxor 0x2686ec(%rip), %xmm3   # 0x5f76f0
movq 0x78(%rsp), %r10
movq 0x10(%r10), %rax
movq (%rax), %rax
movq 0x118(%rsp), %rbx
cmpq %rbx, %rcx
jae 0x38f02e
pextrw $0x4, %xmm3, %esi
movq 0x58(%rsp), %r8
addq %rax, %r8
movb %sil, (%rcx,%r8)
movq 0x68(%rsp), %r11
cmpq %r11, 0x140(%rsp)
setae %sil
testq %rcx, %rcx
sete %r8b
orb %sil, %r8b
movq 0x128(%rsp), %r12
movq 0x120(%rsp), %r14
movq 0x70(%rsp), %r10
movdqa 0xa0(%rsp), %xmm10
jne 0x38f077
movd %xmm3, %esi
addq 0x60(%rsp), %rax
movb %sil, (%rcx,%rax)
movq 0x158(%rsp), %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
pandn %xmm0, %xmm11
por %xmm15, %xmm11
movq %xmm13, (%r14,%rcx,8)
movq %xmm14, (%r10,%rcx,8)
movq 0x28(%rsp), %r13
movq %r13, %xmm0
movq 0x20(%rsp), %r15
movq %r15, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
pcmpeqd %xmm9, %xmm9
pxor %xmm9, %xmm0
psrad $0x1f, %xmm0
pand 0x1a0(%rsp), %xmm0
xorl %eax, %eax
cmpq %rbx, %r15
setl %al
negq %rax
xorl %edx, %edx
cmpq %rbx, %r13
setl %dl
negq %rdx
movq %rdx, %xmm1
movq %rax, %xmm15
punpcklqdq %xmm1, %xmm15   # xmm15 = xmm15[0],xmm1[0]
pand %xmm0, %xmm15
movq %xmm2, %rdx
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
movq %xmm0, %rsi
xorl %edi, %edi
xorl %eax, %eax
cmpq %rsi, %r9
sete %dil
setg %al
xorl %esi, %esi
xorl %r8d, %r8d
cmpq %rdx, %rbp
sete %sil
setg %r8b
negq %rsi
negq %rdi
movq %rsi, %xmm8
movq %rdi, %xmm0
punpcklqdq %xmm0, %xmm8    # xmm8 = xmm8[0],xmm0[0]
negq %r8
negq %rax
movq %r8, %xmm5
movq %rax, %xmm0
punpcklqdq %xmm0, %xmm5    # xmm5 = xmm5[0],xmm0[0]
pand %xmm15, %xmm5
movdqa 0xb0(%rsp), %xmm1
movq %xmm1, %rdx
xorl %eax, %eax
cmpq %rdx, %r15
setl %al
negq %rax
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
movq %xmm0, %rdx
xorl %esi, %esi
cmpq %rdx, %r13
setl %sil
negq %rsi
movdqa %xmm5, %xmm0
pandn %xmm1, %xmm0
movq %rax, %xmm1
movq %rsi, %xmm3
punpcklqdq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0]
movdqa %xmm5, %xmm3
pandn %xmm2, %xmm3
movdqa %xmm5, %xmm2
pand %xmm13, %xmm2
por %xmm3, %xmm2
movdqa %xmm5, %xmm3
pandn %xmm6, %xmm3
movdqa %xmm5, %xmm4
movdqa 0x90(%rsp), %xmm7
pand %xmm7, %xmm4
por %xmm3, %xmm4
pand %xmm10, %xmm5
por %xmm0, %xmm5
pand %xmm15, %xmm1
pand %xmm8, %xmm1
movdqa %xmm1, %xmm0
pandn %xmm4, %xmm0
movdqa %xmm1, %xmm6
pand %xmm7, %xmm6
por %xmm0, %xmm6
movdqa %xmm1, %xmm0
pandn %xmm5, %xmm0
pand %xmm10, %xmm1
por %xmm0, %xmm1
psubq %xmm9, %xmm10
incq %rcx
cmpq %rcx, 0x10(%rsp)
jne 0x38ec48
movdqa 0x90(%rsp), %xmm0
paddq 0x266904(%rip), %xmm0   # 0x5f5b30
movdqa %xmm0, 0x90(%rsp)
movq 0x110(%rsp), %rdx
addq $0x2, %rdx
movq 0x100(%rsp), %rax
addq %rax, 0x58(%rsp)
addq %rax, 0x60(%rsp)
cmpq %r11, %rdx
movq 0x1f0(%rsp), %r15
movq 0x108(%rsp), %rbp
jb 0x38eb6f
jmp 0x38f27d
movdqa 0x30(%rsp), %xmm0
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm2, 0xe0(%rsp)
movdqa %xmm1, 0xc0(%rsp)
movdqa %xmm6, 0x40(%rsp)
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x78(%rsp), %rbx
movq 0xe0(%rsp,%rdx,8), %rsi
cmpq %rbp, %rsi
jle 0x38f2bd
movl 0x40(%rsp,%rdx,8), %eax
movl 0xc0(%rsp,%rdx,8), %ecx
movq %rsi, %rbp
jmp 0x38f2ea
jne 0x38f2ea
movq 0xc0(%rsp,%rdx,8), %rsi
movslq %ecx, %rdi
cmpq %rdi, %rsi
jge 0x38f2d7
movl 0x40(%rsp,%rdx,8), %eax
movl %esi, %ecx
jmp 0x38f2ea
jne 0x38f2ea
movq 0x40(%rsp,%rdx,8), %rdi
movslq %eax, %r8
cmpq %r8, %rdi
jge 0x38f2ea
movl %esi, %ecx
movl %edi, %eax
incq %rdx
cmpl $0x1, %edx
je 0x38f2a0
movdqa 0xd0(%rsp), %xmm0
movq %xmm0, %rdx
xorl %esi, %esi
movq 0xf8(%rsp), %r8
cmpq %r8, %rdx
setle %sil
negq %rsi
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rdx
xorl %edi, %edi
cmpq %r8, %rdx
setle %dil
negq %rdi
movq %rsi, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa 0x80(%rsp), %xmm1
movq %xmm1, %rdx
xorl %esi, %esi
movq 0xf0(%rsp), %r8
cmpq %r8, %rdx
setg %sil
negq %rsi
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, %rdx
xorl %edi, %edi
cmpq %r8, %rdx
setg %dil
negq %rdi
movq %rsi, %xmm1
movq %rdi, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
por %xmm0, %xmm1
pmovmskb %xmm1, %edx
testl %edx, %edx
je 0x38f394
orb $0x40, 0xc(%rbx)
xorl %ebp, %ebp
xorl %ecx, %ecx
xorl %eax, %eax
movl %ebp, (%rbx)
movl %eax, 0x4(%rbx)
movl %ecx, 0x8(%rbx)
movq %r10, %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%r15)
jne 0x38f3f7
movq (%rsp), %rdi
callq 0x2094b5
jmp 0x38f3f7
callq 0x1bdd09
jmp 0x38f3f5
callq 0x1bdce3
jmp 0x38f3f5
callq 0x1bdcbd
jmp 0x38f3f5
callq 0x1bdc97
jmp 0x38f3f5
callq 0x1bdc71
jmp 0x38f3f5
callq 0x1bdc4b
jmp 0x38f3f5
callq 0x1bdc25
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq