// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/nw_trace_diag_sse41_128_32.c
// Function: parasail_nw_trace_diag_sse41_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 vOpen;
    __m128i vGap;
    __m128i vOne;
    __m128i vN;
    __m128i vGapN;
    __m128i vNegOne;
    __m128i vI;
    __m128i vJreset;
    __m128i vMax;
    __m128i vILimit;
    __m128i vILimit1;
    __m128i vJLimit;
    __m128i vJLimit1;
    __m128i vIBoundary;
    __m128i vTDiag;
    __m128i vTIns;
    __m128i vTDel;
    __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 = 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 = _mm_set1_epi32(NEG_LIMIT);
    vPosLimit = _mm_set1_epi32(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInf = _mm_set1_epi32(NEG_LIMIT);
    vOpen = _mm_set1_epi32(open);
    vGap  = _mm_set1_epi32(gap);
    vOne = _mm_set1_epi32(1);
    vN = _mm_set1_epi32(N);
    vGapN = _mm_set1_epi32(gap*N);
    vNegOne = _mm_set1_epi32(-1);
    vI = _mm_set_epi32(0,1,2,3);
    vJreset = _mm_set_epi32(0,-1,-2,-3);
    vMax = vNegInf;
    vILimit = _mm_set1_epi32(s1Len);
    vILimit1 = _mm_sub_epi32(vILimit, vOne);
    vJLimit = _mm_set1_epi32(s2Len);
    vJLimit1 = _mm_sub_epi32(vJLimit, vOne);
    vIBoundary = _mm_set_epi32(
            -open-0*gap,
            -open-1*gap,
            -open-2*gap,
            -open-3*gap);
    vTDiag = _mm_set1_epi32(PARASAIL_DIAG);
    vTIns = _mm_set1_epi32(PARASAIL_INS);
    vTDel = _mm_set1_epi32(PARASAIL_DEL);
    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_NW | 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] = -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 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))];
        vNH = _mm_srli_si128(vNH, 4);
        vNH = _mm_insert_epi32(vNH, H_pr[-1], 3);
        vWH = _mm_srli_si128(vWH, 4);
        vWH = _mm_insert_epi32(vWH, -open - i*gap, 3);
        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, 4);
            vNH = _mm_insert_epi32(vNH, H_pr[j], 3);
            vF = _mm_srli_si128(vF, 4);
            vF = _mm_insert_epi32(vF, F_pr[j], 3);
            vF_opn = _mm_sub_epi32(vNH, vOpen);
            vF_ext = _mm_sub_epi32(vF, vGap);
            vF = _mm_max_epi32(vF_opn, vF_ext);
            vE_opn = _mm_sub_epi32(vWH, vOpen);
            vE_ext = _mm_sub_epi32(vE, vGap);
            vE = _mm_max_epi32(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);
            vWH = _mm_max_epi32(vNWH, vE);
            vWH = _mm_max_epi32(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_blendv_epi8(vWH, vIBoundary, cond);
                vF = _mm_blendv_epi8(vF, vNegInf, cond);
                vE = _mm_blendv_epi8(vE, vNegInf, cond);
            }
            /* cannot start checking sat until after J clears boundary */
            if (j > PAD) {
                vSaturationCheckMin = _mm_min_epi32(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm_max_epi32(vSaturationCheckMax, vWH);
            }
            /* trace table */
            {
                __m128i case1 = _mm_cmpeq_epi32(vWH, vNWH);
                __m128i case2 = _mm_cmpeq_epi32(vWH, vF);
                __m128i vT = _mm_blendv_epi8(
                        _mm_blendv_epi8(vTIns, vTDel, case2),
                        vTDiag,
                        case1);
                __m128i condE = _mm_cmpgt_epi32(vE_opn, vE_ext);
                __m128i condF = _mm_cmpgt_epi32(vF_opn, vF_ext);
                __m128i vET = _mm_blendv_epi8(vTInsE, vTDiagE, condE);
                __m128i vFT = _mm_blendv_epi8(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(vWH,0);
            F_pr[j-3] = (int32_t)_mm_extract_epi32(vF,0);
            /* as minor diagonal vector passes across table, extract
               last table value at the i,j bound */
            {
                __m128i cond_valid_I = _mm_cmpeq_epi32(vI, vILimit1);
                __m128i cond_valid_J = _mm_cmpeq_epi32(vJ, vJLimit1);
                __m128i cond_all = _mm_and_si128(cond_valid_I, cond_valid_J);
                vMax = _mm_blendv_epi8(vMax, vWH, cond_all);
            }
            vJ = _mm_add_epi32(vJ, vOne);
        }
        vI = _mm_add_epi32(vI, vN);
        vIBoundary = _mm_sub_epi32(vIBoundary, vGapN);
    }

    /* max in vMax */
    for (i=0; i<N; ++i) {
        int32_t value;
        value = (int32_t) _mm_extract_epi32(vMax, 3);
        if (value > score) {
            score = value;
        }
        vMax = _mm_slli_si128(vMax, 4);
    }

    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 $0x158, %rsp            # imm = 0x158
testq %rdx, %rdx
je 0x47441e
movl %r8d, %r13d
movl %ecx, %r8d
testl %ecx, %ecx
jle 0x474425
testl %r13d, %r13d
js 0x47442c
testl %r9d, %r9d
js 0x474433
movq 0x190(%rsp), %r12
testq %r12, %r12
je 0x47443a
movl 0x30(%r12), %eax
testl %eax, %eax
jne 0x473bcf
testq %rdi, %rdi
je 0x474441
movl %esi, %ebx
testl %esi, %esi
jle 0x474448
testl %eax, %eax
je 0x473bd4
movl 0x34(%r12), %ebx
movq %rdi, 0x80(%rsp)
movq %rdx, 0x20(%rsp)
movq %r9, 0x58(%rsp)
movl %r13d, %edx
negl %edx
movl 0x20(%r12), %eax
movl $0x80000000, %ebp       # imm = 0x80000000
movl %r13d, %ecx
orl %ebp, %ecx
subl %eax, %ebp
movl %edx, 0xc(%rsp)
cmpl %edx, %eax
cmovgl %ecx, %ebp
movl $0x7ffffffe, %r14d      # imm = 0x7FFFFFFE
subl 0x1c(%r12), %r14d
movl $0x10, %edx
movl $0x1, %ecx
movl %ebx, %edi
movl %r8d, %esi
movq %r8, %r15
callq 0x2097d1
testq %rax, %rax
je 0x47444d
movl %r13d, 0x70(%rsp)
movq %rax, 0x18(%rsp)
orl $0x4481001, 0xc(%rax)   # imm = 0x4481001
movq %r15, 0x38(%rsp)
leal 0x6(%r15), %r13d
movl $0x10, %edi
movq %r13, %rsi
callq 0x2094d5
movq %rax, %r15
movl $0x10, %edi
movq %r13, %rsi
callq 0x2094d5
movl $0x10, %edi
movq %r13, %rsi
movq %rax, %r13
callq 0x2094d5
testq %r15, %r15
sete %dl
testq %r13, %r13
sete %cl
orb %dl, %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x47444d
cmpl $0x0, 0x30(%r12)
movq %rax, 0x60(%rsp)
je 0x473ca4
xorl %eax, %eax
jmp 0x473d23
leal 0x3(%rbx), %eax
movl %eax, 0x40(%rsp)
movslq %eax, %rsi
movl $0x10, %edi
callq 0x2094d5
testq %rax, %rax
je 0x47444d
movq %rbx, %r8
testl %ebx, %ebx
movq 0x80(%rsp), %r9
jle 0x473ced
movq 0x10(%r12), %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 0x473cda
movq %r8, %rbx
movslq %ebx, %rcx
leaq (%rax,%rcx,4), %rdi
leal 0x1(%r8), %edx
movl 0x40(%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 0x38(%rsp), %r8
leal 0x3(%r8), %r10d
movq %rbx, 0x30(%rsp)
leal -0x1(%rbx), %ecx
leal -0x1(%r8), %eax
incl %ebp
movl %ebp, 0x2c(%rsp)
movd %ebp, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x40(%rsp)
movd %r14d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xb0(%rsp)
movl 0x70(%rsp), %r9d
movd %r9d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x140(%rsp)
movq 0x58(%rsp), %rsi
movd %esi, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x130(%rsp)
pslld $0x2, %xmm0
movdqa %xmm0, 0x110(%rsp)
movl %ecx, 0x8(%rsp)
movd %ecx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x100(%rsp)
movl %eax, 0x6c(%rsp)
movd %eax, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x120(%rsp)
movl 0xc(%rsp), %edi
movl %edi, %eax
subl %esi, %eax
movl %edi, %edx
subl %esi, %edx
subl %esi, %edx
leal (%rsi,%rsi,2), %ecx
addl %r9d, %ecx
negl %ecx
movd %ecx, %xmm0
pinsrd $0x1, %edx, %xmm0
pinsrd $0x2, %eax, %xmm0
pinsrd $0x3, %edi, %xmm0
movdqa %xmm0, 0x80(%rsp)
movq 0x10(%r12), %rax
cmpl $0x2, %r8d
movl $0x1, %ebx
cmovgel %r8d, %ebx
xorl %ecx, %ecx
movq 0x20(%rsp), %rsi
movzbl (%rsi,%rcx), %edx
movl (%rax,%rdx,4), %edx
movl %edx, 0xc(%r15,%rcx,4)
incq %rcx
cmpq %rcx, %rbx
jne 0x473e1c
movl $0x0, 0x8(%r15)
movq $0x0, (%r15)
movl %r8d, %r14d
leaq 0xc(%r15,%r14,4), %rdi
leal 0x1(%r8), %eax
cmpl %eax, %r10d
movl %r10d, 0x20(%rsp)
cmovgl %r10d, %eax
movl %r8d, %ecx
notl %ecx
addl %eax, %ecx
leaq 0x4(,%rcx,4), %rdx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x19e090
movl 0xc(%rsp), %eax
movl 0x2c(%rsp), %edx
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %rdi
movl %eax, 0xc(%r13,%rbp,4)
movl %edx, 0xc(%rdi,%rbp,4)
incq %rbp
subl %ecx, %eax
cmpq %rbp, %rbx
jne 0x473e81
xorl %eax, %eax
movl %edx, (%r13,%rax,4)
movl %edx, (%rdi,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x473e96
leaq 0x3(%r14), %rax
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
movl 0x20(%rsp), %r9d
movl %edx, (%r13,%rax,4)
movl %edx, (%rdi,%rax,4)
incq %rax
incl %r8d
cmpl %r8d, %r9d
jg 0x473ebf
movl $0x0, 0x8(%r13)
testl %ecx, %ecx
jle 0x47437b
movdqa 0x40(%rsp), %xmm6
movdqa %xmm6, %xmm0
cmpl $0x2, %r9d
movl $0x1, %eax
cmovgel %r9d, %eax
movq %rax, 0xe8(%rsp)
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movdqa %xmm0, 0xf0(%rsp)
movl %ecx, %ecx
leaq (,%r14,4), %rax
movq %rax, 0xd8(%rsp)
leaq -0x1(%r14), %rax
movq %rax, 0x30(%rsp)
leaq -0x3(%r14,%r14,2), %rax
movq %rax, 0xa0(%rsp)
leaq -0x2(%r14,%r14), %rax
movq %rax, 0x98(%rsp)
pmovsxbd 0x183c60(%rip), %xmm8   # 0x5f7bae
movq $0x0, 0xa8(%rsp)
xorl %r11d, %r11d
movdqa 0xb0(%rsp), %xmm0
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm6, %xmm10
pcmpeqd %xmm5, %xmm5
movl 0x30(%r12), %r8d
movl %r11d, %edx
testl %r8d, %r8d
jne 0x473f86
movl (%rsi,%r11,4), %edx
movq %r11, %r10
orq $0x1, %r10
testl %r8d, %r8d
je 0x473f9f
cmpq %rcx, %r10
movl 0x8(%rsp), %edi
cmovbl %r10d, %edi
jmp 0x473fa3
movl (%rsi,%r10,4), %edi
movq %r11, %rax
orq $0x2, %rax
testl %r8d, %r8d
je 0x473fbd
cmpq %rcx, %rax
movl 0x8(%rsp), %r9d
cmovbl %eax, %r9d
jmp 0x473fc1
movl (%rsi,%rax,4), %r9d
movq %r11, 0xc0(%rsp)
movq %r11, %rbp
orq $0x3, %rbp
testl %r8d, %r8d
movq %rax, 0x20(%rsp)
je 0x473fe6
cmpq %rcx, %rbp
movl 0x8(%rsp), %ebx
cmovbl %ebp, %ebx
jmp 0x473fe9
movl (%rsi,%rbp,4), %ebx
movq 0x8(%r12), %rsi
movl 0x18(%r12), %eax
imull %eax, %edx
movslq %edx, %rdx
leaq (%rsi,%rdx,4), %rdx
movq %rdx, 0x38(%rsp)
imull %eax, %edi
movslq %edi, %rdi
leaq (%rsi,%rdi,4), %r11
imull %eax, %r9d
movslq %r9d, %r8
leaq (%rsi,%r8,4), %r8
imull %eax, %ebx
movslq %ebx, %rax
leaq (%rsi,%rax,4), %rbx
movq 0xc0(%rsp), %r12
leaq 0x4(%r12), %rax
movq %rax, 0xe0(%rsp)
movq 0x58(%rsp), %r9
imull %r9d, %eax
movl 0xc(%rsp), %edi
movl %edi, %esi
subl %eax, %esi
movdqa 0xf0(%rsp), %xmm11
movdqa %xmm11, %xmm7
pinsrd $0x3, 0x8(%r13), %xmm7
movl %esi, 0x8(%r13)
imull %r9d, %r12d
movl %edi, %eax
subl %r12d, %eax
pinsrd $0x3, %eax, %xmm11
movdqa %xmm8, 0xc0(%rsp)
pcmpeqd 0x100(%rsp), %xmm8
xorl %esi, %esi
pmovsxbd 0x183b20(%rip), %xmm13  # 0x5f7bb2
movdqa 0x40(%rsp), %xmm12
movdqa %xmm12, %xmm14
movq 0x60(%rsp), %rdi
movq %r10, %rdx
movdqa %xmm7, %xmm0
pshufd $0xf9, %xmm11, %xmm7    # xmm7 = xmm11[1,2,3,3]
movq %r13, %r10
pinsrd $0x3, 0xc(%r13,%rsi,4), %xmm7
pshufd $0xf9, %xmm14, %xmm9    # xmm9 = xmm14[1,2,3,3]
pinsrd $0x3, 0xc(%rdi,%rsi,4), %xmm9
movslq 0xc(%r15,%rsi,4), %rax
movslq 0x8(%r15,%rsi,4), %r9
movslq 0x4(%r15,%rsi,4), %r13
movslq (%r15,%rsi,4), %r12
movd (%rbx,%r12,4), %xmm2
pinsrd $0x1, (%r8,%r13,4), %xmm2
pinsrd $0x2, (%r11,%r9,4), %xmm2
movq 0x38(%rsp), %rdi
pinsrd $0x3, (%rdi,%rax,4), %xmm2
paddd %xmm0, %xmm2
movdqa %xmm7, %xmm1
movdqa 0x140(%rsp), %xmm0
psubd %xmm0, %xmm1
movdqa 0x130(%rsp), %xmm4
psubd %xmm4, %xmm9
movdqa %xmm1, %xmm14
pmaxsd %xmm9, %xmm14
movdqa %xmm11, %xmm3
psubd %xmm0, %xmm3
movdqa %xmm12, %xmm15
psubd %xmm4, %xmm15
movdqa %xmm3, %xmm12
pmaxsd %xmm15, %xmm12
movdqa %xmm12, %xmm11
pmaxsd %xmm14, %xmm11
pmaxsd %xmm2, %xmm11
movdqa %xmm13, %xmm0
pcmpeqd %xmm5, %xmm0
blendvps %xmm0, 0x80(%rsp), %xmm11
movaps 0x40(%rsp), %xmm4
blendvps %xmm0, %xmm4, %xmm14
blendvps %xmm0, %xmm4, %xmm12
cmpq $0x4, %rsi
jb 0x4741a0
movdqa 0x70(%rsp), %xmm0
pminsd %xmm11, %xmm0
movdqa %xmm0, 0x70(%rsp)
pmaxsd %xmm11, %xmm10
movq 0x18(%rsp), %rax
pcmpeqd %xmm11, %xmm2
movdqa %xmm11, %xmm0
pcmpeqd %xmm14, %xmm0
pmovsxbd 0x183c55(%rip), %xmm4   # 0x5f7e12
psubd %xmm0, %xmm4
movdqa %xmm2, %xmm0
blendvps %xmm0, 0x1819c2(%rip), %xmm4 # 0x5f5b90
pcmpgtd %xmm15, %xmm3
pcmpgtd %xmm9, %xmm1
movaps 0x183340(%rip), %xmm9   # 0x5f7520
movdqa %xmm3, %xmm0
blendvps %xmm0, 0x1836a2(%rip), %xmm9 # 0x5f7890
movaps 0x18334b(%rip), %xmm2   # 0x5f7540
movdqa %xmm1, %xmm0
blendvps %xmm0, 0x1850ce(%rip), %xmm2 # 0x5f92d0
orps %xmm9, %xmm2
orps %xmm4, %xmm2
movq 0x10(%rax), %rax
movq (%rax), %r9
cmpq %r14, %rsi
movq %r10, %r13
jae 0x47422a
movq 0xa8(%rsp), %rax
addq %r9, %rax
pextrb $0xc, %xmm2, (%rsi,%rax)
movq %rdx, %r10
cmpq %rcx, %rdx
setae %al
leaq -0x1(%rsi), %r12
cmpq %r14, %r12
setae %r12b
orb %al, %r12b
pcmpeqd %xmm1, %xmm1
jne 0x474256
movq 0x30(%rsp), %rax
addq %r9, %rax
pextrb $0x8, %xmm2, (%rsi,%rax)
cmpq %rcx, 0x20(%rsp)
jae 0x474288
leaq -0x2(%rsi), %rax
cmpq $0x2, %rsi
setae %r12b
cmpq %r14, %rax
setl %al
andb %r12b, %al
cmpb $0x1, %al
jne 0x474288
movq 0x98(%rsp), %rax
addq %r9, %rax
pextrb $0x4, %xmm2, (%rsi,%rax)
cmpq %rcx, %rbp
jae 0x4742b4
leaq -0x3(%rsi), %rax
cmpq $0x3, %rsi
setb %r12b
cmpq %r14, %rax
setge %al
orb %r12b, %al
jne 0x4742b4
addq 0xa0(%rsp), %r9
pextrb $0x0, %xmm2, (%rsi,%r9)
movd %xmm11, (%r13,%rsi,4)
movdqa %xmm13, %xmm0
pcmpeqd 0x120(%rsp), %xmm0
pand %xmm8, %xmm0
blendvps %xmm0, %xmm11, %xmm6
movq 0x60(%rsp), %rdi
movd %xmm14, (%rdi,%rsi,4)
psubd %xmm1, %xmm13
incq %rsi
cmpq %rsi, 0xe8(%rsp)
jne 0x4740a3
movdqa 0xc0(%rsp), %xmm8
paddd 0x181888(%rip), %xmm8   # 0x5f5b90
movdqa 0x80(%rsp), %xmm0
psubd 0x110(%rsp), %xmm0
movdqa %xmm0, 0x80(%rsp)
movq 0xd8(%rsp), %rax
addq %rax, 0xa8(%rsp)
addq %rax, 0x30(%rsp)
addq %rax, 0xa0(%rsp)
addq %rax, 0x98(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, %r11
cmpq %rcx, %rax
movq 0x190(%rsp), %r12
movq 0x10(%rsp), %rsi
jb 0x473f75
movl 0x2c(%rsp), %edx
movdqa %xmm10, %xmm5
movdqa 0x70(%rsp), %xmm10
jmp 0x474393
movdqa 0x40(%rsp), %xmm0
movdqa %xmm0, %xmm6
movdqa %xmm0, %xmm5
movdqa 0xb0(%rsp), %xmm10
movl $0x4, %eax
pextrd $0x3, %xmm6, %ecx
cmpl %edx, %ecx
cmovgl %ecx, %edx
pslldq $0x4, %xmm6             # xmm6 = zero,zero,zero,zero,xmm6[0,1,2,3,4,5,6,7,8,9,10,11]
decl %eax
jne 0x474398
movdqa 0x40(%rsp), %xmm0
pcmpgtd %xmm10, %xmm0
pcmpgtd 0xb0(%rsp), %xmm5
por %xmm0, %xmm5
movmskps %xmm5, %eax
testl %eax, %eax
movq 0x18(%rsp), %rax
movl 0x6c(%rsp), %ecx
je 0x4743e4
orb $0x40, 0xc(%rax)
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x0, 0x8(%rsp)
movl %edx, (%rax)
movl 0x8(%rsp), %edx
movl %edx, 0x4(%rax)
movl %ecx, 0x8(%rax)
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
movq %r15, %rdi
callq 0x2094b5
cmpl $0x0, 0x30(%r12)
jne 0x474417
movq 0x10(%rsp), %rdi
callq 0x2094b5
movq 0x18(%rsp), %rax
jmp 0x47444f
callq 0x1db87f
jmp 0x47444d
callq 0x1db859
jmp 0x47444d
callq 0x1db833
jmp 0x47444d
callq 0x1db80d
jmp 0x47444d
callq 0x1db7e7
jmp 0x47444d
callq 0x1db7c1
jmp 0x47444d
callq 0x1db79b
xorl %eax, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)