// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/nw_trace_diag_sse2_128_32.c
// Function: parasail_nw_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 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_rpl(vNH, H_pr[-1], 3);
        vWH = _mm_srli_si128(vWH, 4);
        vWH = _mm_insert_epi32_rpl(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_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);
            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_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_epi32_rpl(vSaturationCheckMin, vWH);
                vSaturationCheckMax = _mm_max_epi32_rpl(vSaturationCheckMax, vWH);
            }
            /* trace table */
            {
                __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),
                        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_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
               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_rpl(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_rpl(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 $0x138, %rsp            # imm = 0x138
movq %r9, 0x20(%rsp)
testq %rdx, %rdx
je 0x34caee
movl %ecx, %ebp
testl %ecx, %ecx
jle 0x34cb12
movl %r8d, %r15d
testl %r8d, %r8d
js 0x34cb36
cmpl $0x0, 0x20(%rsp)
js 0x34cb7c
movq 0x170(%rsp), %r8
testq %r8, %r8
je 0x34cb9d
cmpl $0x0, 0x30(%r8)
je 0x34c29e
movl 0x34(%r8), %esi
jmp 0x34c2af
testq %rdi, %rdi
je 0x34cbbe
testl %esi, %esi
jle 0x34cbdf
movq %rdi, 0x50(%rsp)
movq %rdx, 0x30(%rsp)
movl %r15d, %edx
negl %edx
movl 0x20(%r8), %eax
movl $0x80000000, %r12d      # imm = 0x80000000
movl %r15d, %ecx
orl %r12d, %ecx
subl %eax, %r12d
movl %edx, 0xc(%rsp)
cmpl %edx, %eax
cmovgl %ecx, %r12d
movl $0x7ffffffe, %ebx       # imm = 0x7FFFFFFE
subl 0x1c(%r8), %ebx
pushq $0x10
popq %rdx
pushq $0x1
popq %rcx
movq %rsi, 0x60(%rsp)
movl %esi, %edi
movl %ebp, %esi
callq 0x1abb59
testq %rax, %rax
je 0x34c35e
movq %rax, %r14
movl %ebx, 0x90(%rsp)
movl %r15d, 0x48(%rsp)
orl $0x4481001, 0xc(%rax)   # imm = 0x4481001
leal 0x6(%rbp), %r13d
pushq $0x10
popq %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1ab783
movq %rax, %r15
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1ab783
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %r13
callq 0x1ab783
testq %r15, %r15
sete %dl
testq %r13, %r13
sete %cl
orb %dl, %cl
movq %rax, 0x10(%rsp)
testq %rax, %rax
sete %al
orb %cl, %al
je 0x34c365
xorl %ebx, %ebx
jmp 0x34cc07
movq %rbp, 0x28(%rsp)
movq %r14, 0x78(%rsp)
movq 0x170(%rsp), %r14
cmpl $0x0, 0x30(%r14)
movq 0x60(%rsp), %r11
movslq %r11d, %rbp
je 0x34ca8a
movq $0x0, 0x18(%rsp)
movq 0x30(%rsp), %r9
movq 0x28(%rsp), %r10
leal 0x3(%r10), %r8d
movd %r10d, %xmm0
movd %r11d, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
pcmpeqd %xmm2, %xmm2
paddd %xmm1, %xmm2
incl %r12d
movd %r12d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x30(%rsp)
movd 0x90(%rsp), %xmm0
pshufd $0x0, %xmm0, %xmm12     # xmm12 = xmm0[0,0,0,0]
movl 0x48(%rsp), %r11d
movd %r11d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x90(%rsp)
movq 0x20(%rsp), %rsi
movd %esi, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x80(%rsp)
pslld $0x2, %xmm0
movdqa %xmm0, 0x100(%rsp)
pshufd $0x0, %xmm2, %xmm0      # xmm0 = xmm2[0,0,0,0]
movdqa %xmm0, 0xf0(%rsp)
pshufd $0x55, %xmm2, %xmm0     # xmm0 = xmm2[1,1,1,1]
movdqa %xmm0, 0x120(%rsp)
movl 0xc(%rsp), %edi
movl %edi, %eax
subl %esi, %eax
movl %edi, %edx
subl %esi, %edx
subl %esi, %edx
imull $-0x3, %esi, %ecx
subl %r11d, %ecx
movd %edx, %xmm0
movd %ecx, %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
movd %eax, %xmm0
movd %edi, %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
punpcklqdq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0]
movdqa %xmm3, 0x60(%rsp)
movl %r10d, %ecx
movq 0x10(%r14), %rax
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x34c488
movzbl (%r9,%rdx), %esi
movl (%rax,%rsi,4), %esi
movl %esi, 0xc(%r15,%rdx,4)
incq %rdx
jmp 0x34c471
xorl %eax, %eax
cmpq $0x3, %rax
je 0x34c49a
andl $0x0, (%r15,%rax,4)
incq %rax
jmp 0x34c48a
movq %rcx, %rax
cmpl %eax, %r8d
jle 0x34c4ad
andl $0x0, 0xc(%r15,%rax,4)
incq %rax
jmp 0x34c49d
xorl %eax, %eax
movl 0xc(%rsp), %edx
movq 0x10(%rsp), %rsi
cmpq %rax, %rcx
je 0x34c4d0
movl %edx, 0xc(%r13,%rax,4)
movl %r12d, 0xc(%rsi,%rax,4)
incq %rax
subl 0x20(%rsp), %edx
jmp 0x34c4b8
xorl %eax, %eax
movq 0x10(%rsp), %rdx
cmpq $0x3, %rax
je 0x34c4eb
movl %r12d, (%r13,%rax,4)
movl %r12d, (%rdx,%rax,4)
incq %rax
jmp 0x34c4d7
movq %rcx, %rax
movq 0x10(%rsp), %rdx
cmpl %eax, %r8d
jle 0x34c507
movl %r12d, 0xc(%r13,%rax,4)
movl %r12d, 0xc(%rdx,%rax,4)
incq %rax
jmp 0x34c4f3
andl $0x0, 0x8(%r13)
movdqa 0x30(%rsp), %xmm9
movdqa %xmm9, %xmm0
xorl %edx, %edx
testl %r8d, %r8d
movl $0x0, %eax
movq %rax, 0x28(%rsp)
cmovlel %edx, %r8d
movq %r8, 0x50(%rsp)
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movdqa %xmm0, 0xe0(%rsp)
movdqa %xmm2, 0xd0(%rsp)
movd %xmm2, 0x58(%rsp)
leaq -0x3(%rcx,%rcx,2), %rax
movq %rax, 0x70(%rsp)
leaq (,%rcx,4), %rax
movq %rax, 0xa0(%rsp)
movdqa 0x27b450(%rip), %xmm13  # 0x5c79c0
xorl %r10d, %r10d
movdqa %xmm9, %xmm11
movdqa %xmm12, 0xc0(%rsp)
movl %r12d, 0x5c(%rsp)
cmpq %rbp, %r10
jge 0x34c9f5
movq %r10, %rdi
orq $0x3, %rdi
cmpl $0x0, 0x30(%r14)
movq %rdi, 0x48(%rsp)
je 0x34c5d3
movq %r10, %r11
orq $0x1, %r11
cmpq %rbp, %r11
movl 0x58(%rsp), %eax
movl %eax, %r8d
cmovll %r11d, %r8d
movq %r10, %r9
orq $0x2, %r9
cmpq %rbp, %r9
movl %r9d, %edx
cmovgel %eax, %edx
cmpq %rbp, %rdi
cmovgel %eax, %edi
movl %r10d, %esi
jmp 0x34c5f7
movq 0x18(%rsp), %rax
movl (%rax,%r10,4), %esi
movl 0x4(%rax,%r10,4), %r8d
movq %r10, %r11
orq $0x1, %r11
movq %r10, %r9
orq $0x2, %r9
movl 0x8(%rax,%r10,4), %edx
movl (%rax,%rdi,4), %edi
movq %r10, %r12
movq 0x8(%r14), %rbx
movl 0x18(%r14), %eax
imull %eax, %r8d
movslq %r8d, %r8
leaq (%rbx,%r8,4), %r8
imull %eax, %esi
movslq %esi, %rsi
leaq (%rbx,%rsi,4), %r14
imull %eax, %edx
movslq %edx, %rdx
leaq (%rbx,%rdx,4), %rsi
imull %eax, %edi
movslq %edi, %rax
leaq (%rbx,%rax,4), %rbx
movss 0x8(%r13), %xmm0
movaps 0xe0(%rsp), %xmm8
shufps $0xe4, %xmm8, %xmm0     # xmm0 = xmm0[0,1],xmm8[2,3]
movaps %xmm8, %xmm10
shufps $0x24, %xmm0, %xmm10    # xmm10 = xmm10[0,1],xmm0[2,0]
movl %r12d, %eax
movq 0x20(%rsp), %rdi
imull %edi, %eax
movl 0xc(%rsp), %r10d
movl %r10d, %edx
subl %eax, %edx
movd %edx, %xmm0
shufps $0xe4, %xmm8, %xmm0     # xmm0 = xmm0[0,1],xmm8[2,3]
shufps $0x24, %xmm0, %xmm8     # xmm8 = xmm8[0,1],xmm0[2,0]
addq $0x4, %r12
movq %r12, 0xa8(%rsp)
movl %r12d, %eax
imull %edi, %eax
movl %r10d, %edx
subl %eax, %edx
movl %edx, 0x8(%r13)
movq %r11, %rax
imulq %rcx, %rax
movq %r9, %rdx
imulq %rcx, %rdx
addq $-0x2, %rdx
movq %rdx, 0xb0(%rsp)
decq %rax
movq %rax, 0xb8(%rsp)
movdqa %xmm13, 0x110(%rsp)
pcmpeqd 0xf0(%rsp), %xmm13
xorl %edi, %edi
movaps 0x30(%rsp), %xmm0
movaps %xmm0, %xmm1
movdqa 0x27b4df(%rip), %xmm7   # 0x5c7bb0
cmpq %rdi, 0x50(%rsp)
je 0x34c9a1
movq %r13, %r10
movss 0xc(%r13,%rdi,4), %xmm3
shufps $0xf4, %xmm8, %xmm3     # xmm3 = xmm3[0,1],xmm8[3,3]
movaps %xmm8, %xmm2
shufps $0x29, %xmm3, %xmm2     # xmm2 = xmm2[1,2],xmm3[2,0]
movq 0x10(%rsp), %rax
movss 0xc(%rax,%rdi,4), %xmm3
shufps $0xf4, %xmm0, %xmm3     # xmm3 = xmm3[0,1],xmm0[3,3]
shufps $0x29, %xmm3, %xmm0     # xmm0 = xmm0[1,2],xmm3[2,0]
movaps %xmm2, %xmm6
movdqa 0x90(%rsp), %xmm4
psubd %xmm4, %xmm6
movdqa 0x80(%rsp), %xmm14
psubd %xmm14, %xmm0
movdqa %xmm6, %xmm5
pcmpgtd %xmm0, %xmm5
movdqa %xmm5, %xmm3
pandn %xmm0, %xmm3
pand %xmm5, %xmm6
por %xmm3, %xmm6
psubd %xmm4, %xmm8
psubd %xmm14, %xmm1
movdqa %xmm8, %xmm14
pcmpgtd %xmm1, %xmm14
movdqa %xmm14, %xmm0
pandn %xmm1, %xmm0
pand %xmm14, %xmm8
movdqa %xmm8, %xmm15
por %xmm0, %xmm15
movslq 0xc(%r15,%rdi,4), %rax
movslq 0x8(%r15,%rdi,4), %rdx
movslq 0x4(%r15,%rdi,4), %r13
movslq (%r15,%rdi,4), %r12
movd (%r14,%rax,4), %xmm0
movd (%r8,%rdx,4), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd (%rsi,%r13,4), %xmm0
movd (%rbx,%r12,4), %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
punpcklqdq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0]
paddd %xmm10, %xmm3
movdqa %xmm3, %xmm0
pcmpgtd %xmm15, %xmm0
movdqa %xmm3, %xmm1
pand %xmm0, %xmm1
pandn %xmm15, %xmm0
por %xmm1, %xmm0
movdqa %xmm0, %xmm1
pcmpgtd %xmm6, %xmm1
pand %xmm1, %xmm0
pandn %xmm6, %xmm1
por %xmm0, %xmm1
movdqa %xmm7, %xmm10
pcmpeqd 0x27b37f(%rip), %xmm10  # 0x5c7b60
movdqa %xmm10, %xmm0
pandn %xmm1, %xmm0
movdqa 0x60(%rsp), %xmm8
pand %xmm10, %xmm8
por %xmm0, %xmm8
cmpq $0x4, %rdi
jb 0x34c83b
movdqa %xmm12, %xmm0
pcmpgtd %xmm8, %xmm0
movdqa %xmm8, %xmm1
pand %xmm0, %xmm1
pandn %xmm12, %xmm0
por %xmm1, %xmm0
movdqa %xmm9, %xmm1
pcmpgtd %xmm8, %xmm1
pand %xmm1, %xmm9
pandn %xmm8, %xmm1
por %xmm1, %xmm9
movdqa %xmm0, %xmm12
movdqa %xmm10, %xmm0
pandn %xmm6, %xmm0
movdqa 0x30(%rsp), %xmm1
pand %xmm10, %xmm1
por %xmm1, %xmm0
pcmpeqd %xmm8, %xmm3
movdqa %xmm8, %xmm6
pcmpeqd %xmm0, %xmm6
movdqa 0x27b7d7(%rip), %xmm4   # 0x5c8040
psubd %xmm6, %xmm4
movdqa %xmm3, %xmm6
pandn %xmm4, %xmm6
pand 0x27b343(%rip), %xmm3   # 0x5c7bc0
por %xmm6, %xmm3
pand 0x27cda6(%rip), %xmm14  # 0x5c9630
pand 0x27cdbe(%rip), %xmm5   # 0x5c9650
por %xmm14, %xmm5
por %xmm3, %xmm5
pxor 0x27cfad(%rip), %xmm5   # 0x5c9850
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
cmpq %rcx, %rdi
movq %r10, %r13
jae 0x34c8c9
pextrw $0x6, %xmm5, %edx
movq 0x28(%rsp), %r10
leaq (%rax,%r10), %r12
movb %dl, (%rdi,%r12)
cmpq %rbp, %r11
setge %dl
leaq -0x1(%rdi), %r12
cmpq %rcx, %r12
setae %r12b
orb %dl, %r12b
jne 0x34c8f4
pextrw $0x4, %xmm5, %edx
movq 0xb8(%rsp), %r10
leaq (%rax,%r10), %r12
movb %dl, (%rdi,%r12)
cmpq %rbp, %r9
jge 0x34c928
leaq -0x2(%rdi), %rdx
cmpq $0x2, %rdi
setae %r12b
cmpq %rcx, %rdx
setl %dl
andb %r12b, %dl
cmpb $0x1, %dl
jne 0x34c928
pextrw $0x2, %xmm5, %edx
movq 0xb0(%rsp), %r10
leaq (%rax,%r10), %r12
movb %dl, (%rdi,%r12)
cmpq %rbp, 0x48(%rsp)
setge %dl
cmpq $0x3, %rdi
setb %r12b
orb %dl, %r12b
jne 0x34c949
movd %xmm5, %edx
addq 0x70(%rsp), %rax
movb %dl, (%rdi,%rax)
pandn %xmm15, %xmm10
por %xmm10, %xmm1
movd %xmm8, (%r13,%rdi,4)
movq 0x10(%rsp), %rax
movd %xmm0, (%rax,%rdi,4)
movdqa %xmm7, %xmm3
pcmpeqd 0x120(%rsp), %xmm3
pand %xmm13, %xmm3
movdqa %xmm8, %xmm4
pand %xmm3, %xmm4
pandn %xmm11, %xmm3
por %xmm4, %xmm3
psubd 0x27b1d0(%rip), %xmm7   # 0x5c7b60
incq %rdi
movdqa %xmm3, %xmm11
movaps %xmm2, %xmm10
jmp 0x34c6d1
movdqa 0x110(%rsp), %xmm13
paddd 0x27b20c(%rip), %xmm13  # 0x5c7bc0
movdqa 0x60(%rsp), %xmm0
psubd 0x100(%rsp), %xmm0
movdqa %xmm0, 0x60(%rsp)
movq 0xa0(%rsp), %rax
addq %rax, 0x70(%rsp)
addq %rax, 0x28(%rsp)
movq 0x170(%rsp), %r14
movl 0x5c(%rsp), %r12d
movq 0xa8(%rsp), %r10
jmp 0x34c587
pushq $0x4
popq %rax
movq 0x78(%rsp), %rbx
subl $0x1, %eax
jb 0x34ca1b
pshufd $0xff, %xmm11, %xmm0    # xmm0 = xmm11[3,3,3,3]
movd %xmm0, %ecx
cmpl %r12d, %ecx
cmovgl %ecx, %r12d
pslldq $0x4, %xmm11            # xmm11 = zero,zero,zero,zero,xmm11[0,1,2,3,4,5,6,7,8,9,10,11]
jmp 0x34c9fd
movdqa 0x30(%rsp), %xmm0
pcmpgtd %xmm12, %xmm0
pcmpgtd 0xc0(%rsp), %xmm9
por %xmm0, %xmm9
movmskps %xmm9, %eax
testl %eax, %eax
movaps 0xd0(%rsp), %xmm0
je 0x34ca4f
orb $0x40, 0xc(%rbx)
xorps %xmm0, %xmm0
xorl %r12d, %r12d
movl %r12d, (%rbx)
movlps %xmm0, 0x4(%rbx)
movq 0x10(%rsp), %rdi
callq 0x1ab763
movq %r13, %rdi
callq 0x1ab763
movq %r15, %rdi
callq 0x1ab763
cmpl $0x0, 0x30(%r14)
jne 0x34cc07
movq 0x18(%rsp), %rdi
callq 0x1ab763
jmp 0x34cc07
leal 0x3(%r11), %eax
movslq %eax, %rsi
pushq $0x10
popq %rdi
movq %rsi, 0x80(%rsp)
callq 0x1ab783
xorl %edi, %edi
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x34c35e
movq 0x60(%rsp), %r11
testl %r11d, %r11d
movl $0x0, %ecx
cmovgl %r11d, %ecx
movq 0x30(%rsp), %r9
movq 0x50(%rsp), %r8
movq 0x18(%rsp), %rax
cmpq %rdi, %rcx
je 0x34cb5a
movq 0x10(%r14), %rdx
movzbl (%r8,%rdi), %esi
movl (%rdx,%rsi,4), %edx
movl %edx, (%rax,%rdi,4)
incq %rdi
jmp 0x34cad1
movq 0x3ee4e3(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x27a4ec(%rip), %rsi    # 0x5c6feb
leaq 0x2496bc(%rip), %rdx    # 0x5961c2
leaq 0x27abf0(%rip), %rcx    # 0x5c76fd
jmp 0x34cbfe
movq 0x3ee4bf(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x27abde(%rip), %rsi    # 0x5c7701
leaq 0x249698(%rip), %rdx    # 0x5961c2
leaq 0x27abe4(%rip), %rcx    # 0x5c7715
jmp 0x34cbfe
movq 0x3ee49b(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x27abd4(%rip), %rsi    # 0x5c771b
leaq 0x249674(%rip), %rdx    # 0x5961c2
leaq 0x27abdb(%rip), %rcx    # 0x5c7730
jmp 0x34cbfe
movq %rbp, %rax
movq 0x80(%rsp), %rdx
movq 0x18(%rsp), %rcx
cmpq %rdx, %rax
jge 0x34c398
andl $0x0, (%rcx,%rax,4)
incq %rax
jmp 0x34cb6a
movq 0x3ee455(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x27ab8e(%rip), %rsi    # 0x5c771b
leaq 0x24962e(%rip), %rdx    # 0x5961c2
leaq 0x27ab9a(%rip), %rcx    # 0x5c7735
jmp 0x34cbfe
movq 0x3ee434(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x27a43d(%rip), %rsi    # 0x5c6feb
leaq 0x24960d(%rip), %rdx    # 0x5961c2
leaq 0x27ad86(%rip), %rcx    # 0x5c7942
jmp 0x34cbfe
movq 0x3ee413(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x27a41c(%rip), %rsi    # 0x5c6feb
leaq 0x2495ec(%rip), %rdx    # 0x5961c2
leaq 0x27ab5c(%rip), %rcx    # 0x5c7739
jmp 0x34cbfe
movq 0x3ee3f2(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x27ab11(%rip), %rsi    # 0x5c7701
leaq 0x2495cb(%rip), %rdx    # 0x5961c2
leaq 0x27ab3f(%rip), %rcx    # 0x5c773d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x19e180
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq