// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_trace_diag_sse2_128_32.c
// Function: parasail_sw_trace_diag_sse2_128_32
parasail_result_t* FNAME(
        const char * const restrict _s1, const int _s1Len,
        const char * const restrict _s2, const int s2Len,
        const int open, const int gap, const parasail_matrix_t *matrix)
{
    /* declare local variables */
    int32_t N = 0;
    int32_t PAD = 0;
    int32_t PAD2 = 0;
    int32_t s1Len_PAD = 0;
    int32_t s2Len_PAD = 0;
    int32_t * restrict s1 = NULL;
    int32_t * restrict s2B = NULL;
    int32_t * restrict _H_pr = NULL;
    int32_t * restrict _F_pr = NULL;
    int32_t * restrict s2 = NULL;
    int32_t * restrict H_pr = NULL;
    int32_t * restrict F_pr = NULL;
    parasail_result_t *result = NULL;
    int32_t i = 0;
    int32_t j = 0;
    int32_t s1Len = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    int32_t NEG_LIMIT = 0;
    int32_t POS_LIMIT = 0;
    int32_t score = 0;
    __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 = 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 ? INT32_MIN + open : INT32_MIN - matrix->min) + 1;
    POS_LIMIT = INT32_MAX - matrix->max - 1;
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm_set1_epi32(NEG_LIMIT);
    vNegInf0 = _mm_srli_si128(vNegInf, 4); /* shift in a 0 */
    vOpen = _mm_set1_epi32(open);
    vGap  = _mm_set1_epi32(gap);
    vZero = _mm_set1_epi32(0);
    vOne = _mm_set1_epi32(1);
    vN = _mm_set1_epi32(N);
    vNegOne = _mm_set1_epi32(-1);
    vI = _mm_set_epi32(0,1,2,3);
    vJreset = _mm_set_epi32(0,-1,-2,-3);
    vMaxH = vNegInf;
    vEndI = vNegInf;
    vEndJ = vNegInf;
    vILimit = _mm_set1_epi32(s1Len);
    vJLimit = _mm_set1_epi32(s2Len);
    vTDiag = _mm_set1_epi32(PARASAIL_DIAG);
    vTIns = _mm_set1_epi32(PARASAIL_INS);
    vTDel = _mm_set1_epi32(PARASAIL_DEL);
    vTZero = _mm_set1_epi32(PARASAIL_ZERO);
    vTDiagE = _mm_set1_epi32(PARASAIL_DIAG_E);
    vTInsE = _mm_set1_epi32(PARASAIL_INS_E);
    vTDiagF = _mm_set1_epi32(PARASAIL_DIAG_F);
    vTDelF = _mm_set1_epi32(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_32 | PARASAIL_FLAG_LANES_4;

    /* initialize heap variables */
    s2B= parasail_memalign_int32_t(16, s2Len+PAD2);
    _H_pr = parasail_memalign_int32_t(16, s2Len+PAD2);
    _F_pr = parasail_memalign_int32_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_int32_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))];
        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))];
        __m128i vIltLimit = _mm_cmplt_epi32(vI, vILimit);
        /* iterate over database sequence */
        for (j=0; j<s2Len+PAD; ++j) {
            __m128i vMat;
            __m128i vNWH = vNH;
            vNH = _mm_srli_si128(vWH, 4);
            vNH = _mm_insert_epi32_rpl(vNH, H_pr[j], 3);
            vF = _mm_srli_si128(vF, 4);
            vF = _mm_insert_epi32_rpl(vF, F_pr[j], 3);
            vF_opn = _mm_sub_epi32(vNH, vOpen);
            vF_ext = _mm_sub_epi32(vF, vGap);
            vF = _mm_max_epi32_rpl(vF_opn, vF_ext);
            vE_opn = _mm_sub_epi32(vWH, vOpen);
            vE_ext = _mm_sub_epi32(vE, vGap);
            vE = _mm_max_epi32_rpl(vE_opn, vE_ext);
            vMat = _mm_set_epi32(
                    matrow0[s2[j-0]],
                    matrow1[s2[j-1]],
                    matrow2[s2[j-2]],
                    matrow3[s2[j-3]]
                    );
            vNWH = _mm_add_epi32(vNWH, vMat);
            vNWH = _mm_max_epi32_rpl(vNWH, vZero);
            vWH = _mm_max_epi32_rpl(vNWH, vE);
            vWH = _mm_max_epi32_rpl(vWH, vF);
            /* as minor diagonal vector passes across the j=-1 boundary,
             * assign the appropriate boundary conditions */
            {
                __m128i cond = _mm_cmpeq_epi32(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_epi32_rpl(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm_max_epi32_rpl(vSaturationCheckMax, vWH);
            }
            /* trace table */
            {
                __m128i cond_zero = _mm_cmpeq_epi32(vWH, vZero);
                __m128i case1 = _mm_cmpeq_epi32(vWH, vNWH);
                __m128i case2 = _mm_cmpeq_epi32(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_epi32(vE_opn, vE_ext);
                __m128i condF = _mm_cmpgt_epi32(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-3] = (int32_t)_mm_extract_epi32_rpl(vWH,0);
            F_pr[j-3] = (int32_t)_mm_extract_epi32_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_epi32(vJ, vNegOne),
                        _mm_cmplt_epi32(vJ, vJLimit));
                __m128i cond_valid_IJ = _mm_and_si128(cond_valid_J, vIltLimit);
                __m128i cond_eq = _mm_cmpeq_epi32(vWH, vMaxH);
                __m128i cond_max = _mm_cmpgt_epi32(vWH, vMaxH);
                __m128i cond_all = _mm_and_si128(cond_max, cond_valid_IJ);
                __m128i cond_Jlt = _mm_cmplt_epi32(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_epi32(vJ, vOne);
        }
        vI = _mm_add_epi32(vI, vN);
    }

    /* alignment ending position */
    {
        int32_t *t = (int32_t*)&vMaxH;
        int32_t *i = (int32_t*)&vEndI;
        int32_t *j = (int32_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_epi32(vSaturationCheckMin, vNegLimit),
            _mm_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 $0x168, %rsp            # imm = 0x168
testq %rdx, %rdx
je 0x391528
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x39152f
testl %r8d, %r8d
js 0x391536
movl %r9d, %r12d
testl %r9d, %r9d
js 0x39153d
movq 0x1a0(%rsp), %r15
testq %r15, %r15
je 0x391544
movl 0x30(%r15), %eax
testl %eax, %eax
jne 0x390bf2
testq %rdi, %rdi
je 0x39154b
movl %esi, %ebx
testl %esi, %esi
jle 0x391552
testl %eax, %eax
je 0x390bf6
movl 0x34(%r15), %ebx
movq %rdi, 0x58(%rsp)
movq %rdx, 0x40(%rsp)
movl %r8d, %eax
negl %eax
movl 0x20(%r15), %ecx
movl $0x80000000, %esi       # imm = 0x80000000
movl %r8d, 0x18(%rsp)
movl %r8d, %edx
orl %esi, %edx
subl %ecx, %esi
cmpl %eax, %ecx
cmovgl %edx, %esi
incl %esi
movl $0x7ffffffe, %ebp       # imm = 0x7FFFFFFE
subl 0x1c(%r15), %ebp
movl %esi, 0x24(%rsp)
movd %esi, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xe0(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0xb0(%rsp)
movl $0x10, %edx
movl $0x1, %ecx
movl %ebx, %edi
movl %r14d, %esi
callq 0x2097d1
testq %rax, %rax
je 0x391557
movq %rax, %r13
movl %r12d, 0xd0(%rsp)
orl $0x4481004, 0xc(%rax)   # imm = 0x4481004
movq %r14, 0x30(%rsp)
leal 0x6(%r14), %r12d
movl $0x10, %edi
movq %r12, %rsi
callq 0x2094d5
movq %rax, %r14
movl $0x10, %edi
movq %r12, %rsi
callq 0x2094d5
movl $0x10, %edi
movq %r12, %rsi
movq %rax, %r12
callq 0x2094d5
testq %r14, %r14
sete %dl
testq %r12, %r12
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x391557
cmpl $0x0, 0x30(%r15)
movq %rax, 0x38(%rsp)
je 0x390ce6
xorl %eax, %eax
jmp 0x390d61
leal 0x3(%rbx), %eax
movl %eax, 0x28(%rsp)
movslq %eax, %rsi
movl $0x10, %edi
callq 0x2094d5
testq %rax, %rax
je 0x391557
movq %rbx, %r8
testl %ebx, %ebx
movq 0x58(%rsp), %r9
jle 0x390d2b
movq 0x10(%r15), %rdi
movl %r8d, %ecx
xorl %edx, %edx
movzbl (%r9,%rdx), %esi
movl (%rdi,%rsi,4), %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x390d18
movq %r8, %rbx
movslq %ebx, %rcx
leaq (%rax,%rcx,4), %rdi
leal 0x1(%r8), %edx
movl 0x28(%rsp), %ecx
cmpl %edx, %ecx
cmovgl %ecx, %edx
movl %ebx, %ecx
notl %ecx
addl %edx, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %esi, %esi
movq %rax, 0x10(%rsp)
callq 0x19e090
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, 0x28(%rsp)
movq 0x30(%rsp), %rsi
leal 0x3(%rsi), %r8d
movd %ebp, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xc0(%rsp)
movdqa 0x60(%rsp), %xmm0
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movdqa %xmm0, 0x120(%rsp)
movd 0x18(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x150(%rsp)
movd 0xd0(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x140(%rsp)
movq %rbx, 0x18(%rsp)
movd %ebx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x110(%rsp)
movd %esi, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x130(%rsp)
movq 0x10(%r15), %rax
cmpl $0x2, %esi
movl $0x1, %ebx
cmovgel %esi, %ebx
xorl %ecx, %ecx
movq 0x40(%rsp), %rdi
movzbl (%rdi,%rcx), %edx
movl (%rax,%rdx,4), %edx
movl %edx, 0xc(%r14,%rcx,4)
incq %rcx
cmpq %rcx, %rbx
jne 0x390e04
movl $0x0, 0x8(%r14)
movq $0x0, (%r14)
movl %esi, %ebp
leaq (%r14,%rbp,4), %rdi
addq $0xc, %rdi
leal 0x1(%rsi), %eax
cmpl %eax, %r8d
movl %r8d, 0x40(%rsp)
cmovgl %r8d, %eax
movl %esi, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %r13d, %r13d
xorl %esi, %esi
callq 0x19e090
movl 0x24(%rsp), %ecx
movq 0x38(%rsp), %rdx
movl $0x0, 0xc(%r12,%r13,4)
movl %ecx, 0xc(%rdx,%r13,4)
incq %r13
cmpq %r13, %rbx
jne 0x390e61
xorl %eax, %eax
movl %ecx, (%r12,%rax,4)
movl %ecx, (%rdx,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x390e79
leaq 0x3(%rbp), %rax
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdi
movl 0x40(%rsp), %r8d
movl %ecx, (%r12,%rax,4)
movl %ecx, (%rdx,%rax,4)
incq %rax
incl %edi
cmpl %edi, %r8d
jg 0x390ea1
movdqa 0x70(%rsp), %xmm2
testl %esi, %esi
jle 0x39144f
leal -0x1(%rsi), %eax
movl %eax, 0xc(%rsp)
cmpl $0x2, %r8d
movl $0x1, %eax
cmovgel %r8d, %eax
movq %rax, 0x108(%rsp)
movl %esi, %edx
leaq (,%rbp,4), %rax
movq %rax, 0xf8(%rsp)
leaq -0x1(%rbp), %rax
movq %rax, 0x98(%rsp)
leaq -0x3(%rbp,%rbp,2), %rax
movq %rax, 0x88(%rsp)
leaq -0x2(%rbp,%rbp), %rax
movq %rax, 0x80(%rsp)
movaps 0x264a85(%rip), %xmm0   # 0x5f59a0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x90(%rsp)
pcmpeqd %xmm12, %xmm12
xorl %ecx, %ecx
movaps 0xc0(%rsp), %xmm0
movaps %xmm0, 0xa0(%rsp)
movdqa 0x60(%rsp), %xmm0
movl 0x30(%r15), %r8d
movl %ecx, %esi
testl %r8d, %r8d
jne 0x390f58
movl (%r10,%rcx,4), %esi
movq %rcx, %r13
orq $0x1, %r13
testl %r8d, %r8d
je 0x390f71
cmpq %rdx, %r13
movl 0xc(%rsp), %edi
cmovbl %r13d, %edi
jmp 0x390f75
movl (%r10,%r13,4), %edi
movq %rcx, %r11
orq $0x2, %r11
testl %r8d, %r8d
je 0x390f8f
cmpq %rdx, %r11
movl 0xc(%rsp), %r9d
cmovbl %r11d, %r9d
jmp 0x390f93
movl (%r10,%r11,4), %r9d
movq %rcx, %rax
orq $0x3, %rax
testl %r8d, %r8d
movq %rcx, 0x100(%rsp)
je 0x390fb5
cmpq %rdx, %rax
movl 0xc(%rsp), %r10d
cmovbl %eax, %r10d
jmp 0x390fb9
movl (%r10,%rax,4), %r10d
movq 0x8(%r15), %rbx
movl 0x18(%r15), %ecx
imull %ecx, %esi
movslq %esi, %rsi
leaq (%rbx,%rsi,4), %rsi
movq %rsi, 0x18(%rsp)
imull %ecx, %edi
movslq %edi, %rdi
leaq (%rbx,%rdi,4), %rsi
movq %rsi, 0x30(%rsp)
imull %ecx, %r9d
movslq %r9d, %rdi
leaq (%rbx,%rdi,4), %rsi
movq %rsi, 0x58(%rsp)
imull %ecx, %r10d
movslq %r10d, %rcx
leaq (%rbx,%rcx,4), %rbx
movdqa 0x110(%rsp), %xmm1
pcmpgtd 0x40(%rsp), %xmm1
movdqa %xmm1, 0xd0(%rsp)
xorl %edi, %edi
movdqa 0x264b64(%rip), %xmm1   # 0x5f5b80
movaps 0x60(%rsp), %xmm15
movaps %xmm15, %xmm4
movaps 0x120(%rsp), %xmm9
movaps %xmm9, %xmm13
movq 0x38(%rsp), %rsi
movq %r11, %r9
movq %r13, %r8
movq %r12, %r13
movss 0xc(%r12,%rdi,4), %xmm5
shufps $0xf4, %xmm13, %xmm5    # xmm5 = xmm5[0,1],xmm13[3,3]
movslq 0xc(%r14,%rdi,4), %rcx
movslq 0x8(%r14,%rdi,4), %r10
movslq 0x4(%r14,%rdi,4), %r15
movslq (%r14,%rdi,4), %r12
movq 0x18(%rsp), %r11
movd (%r11,%rcx,4), %xmm3
movq 0x30(%rsp), %rcx
movd (%rcx,%r10,4), %xmm6
punpckldq %xmm3, %xmm6    # xmm6 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
movq 0x58(%rsp), %rcx
movd (%rcx,%r15,4), %xmm3
movd (%rbx,%r12,4), %xmm10
punpckldq %xmm3, %xmm10   # xmm10 = xmm10[0],xmm3[0],xmm10[1],xmm3[1]
punpcklqdq %xmm6, %xmm10   # xmm10 = xmm10[0],xmm6[0]
paddd %xmm9, %xmm10
movaps %xmm13, %xmm9
shufps $0x29, %xmm5, %xmm9     # xmm9 = xmm9[1,2],xmm5[2,0]
movss 0xc(%rsi,%rdi,4), %xmm3
shufps $0xf4, %xmm4, %xmm3     # xmm3 = xmm3[0,1],xmm4[3,3]
shufps $0x29, %xmm3, %xmm4     # xmm4 = xmm4[1,2],xmm3[2,0]
movaps %xmm9, %xmm11
movdqa 0x150(%rsp), %xmm6
psubd %xmm6, %xmm11
movdqa 0x140(%rsp), %xmm7
psubd %xmm7, %xmm4
movdqa %xmm11, %xmm3
pcmpgtd %xmm4, %xmm3
movdqa %xmm3, %xmm5
pandn %xmm4, %xmm5
pand %xmm3, %xmm11
por %xmm5, %xmm11
psubd %xmm6, %xmm13
psubd %xmm7, %xmm15
movdqa %xmm13, %xmm14
pcmpgtd %xmm15, %xmm14
movdqa %xmm14, %xmm4
pandn %xmm15, %xmm4
pand %xmm14, %xmm13
movdqa %xmm13, %xmm5
por %xmm4, %xmm5
movdqa %xmm10, %xmm6
pcmpgtd 0x20516c(%rip), %xmm6   # 0x596290
pand %xmm10, %xmm6
movdqa %xmm6, %xmm4
pcmpgtd %xmm5, %xmm4
movdqa %xmm6, %xmm7
pand %xmm4, %xmm7
pandn %xmm5, %xmm4
por %xmm7, %xmm4
movdqa %xmm4, %xmm10
pcmpgtd %xmm11, %xmm10
pand %xmm10, %xmm4
pandn %xmm11, %xmm10
por %xmm4, %xmm10
movdqa %xmm1, %xmm8
pcmpeqd %xmm12, %xmm8
movdqa %xmm8, %xmm13
pandn %xmm10, %xmm13
movdqa %xmm8, %xmm4
pandn %xmm11, %xmm4
movdqa 0x60(%rsp), %xmm15
pand %xmm8, %xmm15
por %xmm15, %xmm4
cmpq $0x4, %rdi
jb 0x3911d7
movdqa 0xa0(%rsp), %xmm12
movdqa %xmm12, %xmm11
pcmpgtd %xmm13, %xmm11
movdqa %xmm13, %xmm7
pand %xmm11, %xmm7
pandn %xmm12, %xmm11
por %xmm7, %xmm11
movdqa %xmm0, %xmm7
pcmpgtd %xmm13, %xmm7
pand %xmm7, %xmm0
pandn %xmm13, %xmm7
por %xmm7, %xmm0
movdqa %xmm11, 0xa0(%rsp)
movq %r9, %r11
pcmpeqd %xmm13, %xmm6
movdqa %xmm13, %xmm7
pcmpeqd 0x2050a4(%rip), %xmm7   # 0x596290
pandn %xmm6, %xmm7
movdqa %xmm13, %xmm11
pcmpeqd %xmm4, %xmm11
movdqa 0x264d3d(%rip), %xmm12  # 0x5f5f40
psubd %xmm11, %xmm12
pandn %xmm12, %xmm6
pand 0x26497b(%rip), %xmm7   # 0x5f5b90
por %xmm6, %xmm7
pand 0x2662ee(%rip), %xmm14  # 0x5f7510
pand 0x266306(%rip), %xmm3   # 0x5f7530
por %xmm14, %xmm3
por %xmm7, %xmm3
pxor 0x2664f5(%rip), %xmm3   # 0x5f7730
movq 0x28(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx), %r10
cmpq %rbp, %rdi
movq %r13, %r12
jae 0x391264
pextrw $0x6, %xmm3, %ecx
movq 0x90(%rsp), %rsi
leaq (%r10,%rsi), %r15
movb %cl, (%rdi,%r15)
movq %r8, %r13
cmpq %rdx, %r8
setae %cl
leaq -0x1(%rdi), %r15
cmpq %rbp, %r15
setae %r15b
orb %cl, %r15b
jne 0x391292
pextrw $0x4, %xmm3, %ecx
movq 0x98(%rsp), %rsi
leaq (%r10,%rsi), %r15
movb %cl, (%rdi,%r15)
cmpq %rdx, %r11
jae 0x3912c6
leaq -0x2(%rdi), %rcx
cmpq $0x2, %rdi
setae %r15b
cmpq %rbp, %rcx
setl %cl
andb %r15b, %cl
cmpb $0x1, %cl
jne 0x3912c6
pextrw $0x2, %xmm3, %ecx
movq 0x80(%rsp), %rsi
leaq (%r10,%rsi), %r15
movb %cl, (%rdi,%r15)
cmpq %rdx, %rax
jae 0x3912f2
leaq -0x3(%rdi), %rcx
cmpq $0x3, %rdi
setb %r15b
cmpq %rbp, %rcx
setge %cl
orb %r15b, %cl
jne 0x3912f2
movd %xmm3, %ecx
addq 0x88(%rsp), %r10
movb %cl, (%rdi,%r10)
pandn %xmm5, %xmm8
por %xmm8, %xmm15
movd %xmm13, (%r12,%rdi,4)
movq 0x38(%rsp), %rsi
movd %xmm4, (%rsi,%rdi,4)
movdqa 0x130(%rsp), %xmm3
pcmpgtd %xmm1, %xmm3
pand 0xd0(%rsp), %xmm3
movdqa %xmm1, %xmm5
psrad $0x1f, %xmm5
pandn %xmm3, %xmm5
movdqa 0xe0(%rsp), %xmm3
movdqa %xmm13, %xmm7
pcmpeqd %xmm3, %xmm7
movdqa %xmm13, %xmm8
pcmpgtd %xmm3, %xmm8
movdqa 0xb0(%rsp), %xmm11
movdqa %xmm11, %xmm6
pcmpgtd %xmm1, %xmm6
pand %xmm7, %xmm6
movdqa %xmm6, %xmm7
movdqa %xmm5, %xmm12
pand %xmm6, %xmm12
por %xmm8, %xmm6
pand %xmm5, %xmm8
pand %xmm8, %xmm10
pandn %xmm8, %xmm7
pandn %xmm3, %xmm8
por %xmm8, %xmm10
movdqa %xmm10, 0xe0(%rsp)
por %xmm7, %xmm12
movdqa 0x40(%rsp), %xmm3
pand %xmm12, %xmm3
pandn %xmm2, %xmm12
movdqa %xmm12, %xmm2
por %xmm3, %xmm2
pand %xmm5, %xmm6
movdqa %xmm1, %xmm3
pand %xmm6, %xmm3
pandn %xmm11, %xmm6
por %xmm3, %xmm6
movdqa %xmm6, 0xb0(%rsp)
pcmpeqd %xmm12, %xmm12
psubd %xmm12, %xmm1
incq %rdi
cmpq %rdi, 0x108(%rsp)
jne 0x391038
movdqa 0x40(%rsp), %xmm1
paddd 0x264793(%rip), %xmm1   # 0x5f5b90
movdqa %xmm1, 0x40(%rsp)
movq 0x100(%rsp), %rcx
addq $0x4, %rcx
movq 0xf8(%rsp), %rax
addq %rax, 0x90(%rsp)
addq %rax, 0x98(%rsp)
addq %rax, 0x88(%rsp)
addq %rax, 0x80(%rsp)
cmpq %rdx, %rcx
movq 0x1a0(%rsp), %r15
movq 0x10(%rsp), %r10
jb 0x390f49
jmp 0x391467
movdqa 0x60(%rsp), %xmm0
movdqa 0xc0(%rsp), %xmm1
movdqa %xmm1, 0xa0(%rsp)
movdqa %xmm2, 0x70(%rsp)
xorl %edx, %edx
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x28(%rsp), %rbx
movl 0x24(%rsp), %r8d
movl 0xe0(%rsp,%rdx,4), %esi
cmpl %r8d, %esi
jle 0x391499
movl 0x70(%rsp,%rdx,4), %eax
movl 0xb0(%rsp,%rdx,4), %ecx
movl %esi, %r8d
jmp 0x3914bc
jne 0x3914bc
movl 0xb0(%rsp,%rdx,4), %esi
cmpl %ecx, %esi
jge 0x3914ae
movl 0x70(%rsp,%rdx,4), %eax
movl %esi, %ecx
jmp 0x3914bc
jne 0x3914bc
movl 0x70(%rsp,%rdx,4), %edi
cmpl %eax, %edi
cmovll %esi, %ecx
cmovll %edi, %eax
incq %rdx
cmpl $0x4, %edx
jne 0x39147d
movdqa 0x60(%rsp), %xmm1
pcmpgtd 0xa0(%rsp), %xmm1
pcmpgtd 0xc0(%rsp), %xmm0
por %xmm1, %xmm0
movmskps %xmm0, %edx
testl %edx, %edx
je 0x3914f2
orb $0x40, 0xc(%rbx)
xorl %r8d, %r8d
xorl %ecx, %ecx
xorl %eax, %eax
movl %r8d, (%rbx)
movl %eax, 0x4(%rbx)
movl %ecx, 0x8(%rbx)
movq 0x38(%rsp), %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq %r14, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%r15)
jne 0x391559
movq 0x10(%rsp), %rdi
callq 0x2094b5
jmp 0x391559
callq 0x1be027
jmp 0x391557
callq 0x1be001
jmp 0x391557
callq 0x1bdfdb
jmp 0x391557
callq 0x1bdfb5
jmp 0x391557
callq 0x1bdf8f
jmp 0x391557
callq 0x1bdf69
jmp 0x391557
callq 0x1bdf43
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop