// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/src/nw_trace_scan_sse2_128_64.c
// Function: parasail_nw_trace_scan_profile_sse2_128_64
parasail_result_t* PNAME(
        const parasail_profile_t * const restrict profile,
        const char * const restrict s2, const int s2Len,
        const int open, const int gap)
{
    /* declare local variables */
    int32_t i = 0;
    int32_t j = 0;
    int32_t k = 0;
    int32_t s1Len = 0;
    int32_t end_query = 0;
    int32_t end_ref = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
    int32_t offset = 0;
    int32_t position = 0;
    __m128i* restrict pvP = NULL;
    __m128i* restrict pvE = NULL;
    int64_t* restrict boundary = NULL;
    __m128i* restrict pvHt = NULL;
    __m128i* restrict pvH = NULL;
    __m128i* restrict pvGapper = NULL;
    __m128i vGapO;
    __m128i vGapE;
    int64_t NEG_LIMIT = 0;
    int64_t POS_LIMIT = 0;
    __m128i vZero;
    int64_t score = 0;
    __m128i vNegLimit;
    __m128i vPosLimit;
    __m128i vSaturationCheckMin;
    __m128i vSaturationCheckMax;
    __m128i vNegInfFront;
    __m128i vSegLenXgap;
    parasail_result_t *result = NULL;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;

    /* validate inputs */
    PARASAIL_CHECK_NULL(profile);
    PARASAIL_CHECK_NULL(profile->profile64.score);
    PARASAIL_CHECK_NULL(profile->matrix);
    PARASAIL_CHECK_GT0(profile->s1Len);
    PARASAIL_CHECK_NULL(s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);

    /* initialize stack variables */
    i = 0;
    j = 0;
    k = 0;
    s1Len = profile->s1Len;
    end_query = s1Len-1;
    end_ref = s2Len-1;
    matrix = profile->matrix;
    segWidth = 2; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    offset = (s1Len - 1) % segLen;
    position = (segWidth - 1) - (s1Len - 1) / segLen;
    pvP = (__m128i*)profile->profile64.score;
    vGapO = _mm_set1_epi64x_rpl(open);
    vGapE = _mm_set1_epi64x_rpl(gap);
    NEG_LIMIT = (-open < matrix->min ? INT64_MIN + open : INT64_MIN - matrix->min) + 1;
    POS_LIMIT = INT64_MAX - matrix->max - 1;
    vZero = _mm_setzero_si128();
    score = NEG_LIMIT;
    vNegLimit = _mm_set1_epi64x_rpl(NEG_LIMIT);
    vPosLimit = _mm_set1_epi64x_rpl(POS_LIMIT);
    vSaturationCheckMin = vPosLimit;
    vSaturationCheckMax = vNegLimit;
    vNegInfFront = vZero;
    vTIns  = _mm_set1_epi64x_rpl(PARASAIL_INS);
    vTDel  = _mm_set1_epi64x_rpl(PARASAIL_DEL);
    vTDiag = _mm_set1_epi64x_rpl(PARASAIL_DIAG);
    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);
    vNegInfFront = _mm_insert_epi64_rpl(vNegInfFront, NEG_LIMIT, 0);
    vSegLenXgap = _mm_add_epi64(vNegInfFront,
            _mm_slli_si128(_mm_set1_epi64x_rpl(-segLen*gap), 8));

    /* initialize result */
    result = parasail_result_new_trace(segLen, s2Len, 16, sizeof(__m128i));
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_NW | PARASAIL_FLAG_SCAN
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_2;

    /* initialize heap variables */
    pvE = parasail_memalign___m128i(16, segLen);
    boundary = parasail_memalign_int64_t(16, s2Len+1);
    pvHt= parasail_memalign___m128i(16, segLen);
    pvH = parasail_memalign___m128i(16, segLen);
    pvGapper = parasail_memalign___m128i(16, segLen);

    /* validate heap variables */
    if (!pvE) return NULL;
    if (!boundary) return NULL;
    if (!pvHt) return NULL;
    if (!pvH) return NULL;
    if (!pvGapper) return NULL;

    /* initialize H and E */
    {
        int32_t index = 0;
        for (i=0; i<segLen; ++i) {
            int32_t segNum = 0;
            __m128i_64_t h;
            __m128i_64_t e;
            for (segNum=0; segNum<segWidth; ++segNum) {
                int64_t tmp = -open-gap*(segNum*segLen+i);
                h.v[segNum] = tmp < INT64_MIN ? INT64_MIN : tmp;
                tmp = tmp - open;
                e.v[segNum] = tmp < INT64_MIN ? INT64_MIN : tmp;
            }
            _mm_store_si128(&pvH[index], h.m);
            _mm_store_si128(&pvE[index], e.m);
            ++index;
        }
    }

    /* initialize uppder boundary */
    {
        boundary[0] = 0;
        for (i=1; i<=s2Len; ++i) {
            int64_t tmp = -open-gap*(i-1);
            boundary[i] = tmp < INT64_MIN ? INT64_MIN : tmp;
        }
    }

    {
        __m128i vGapper = _mm_sub_epi64(vZero,vGapO);
        for (i=segLen-1; i>=0; --i) {
            _mm_store_si128(pvGapper+i, vGapper);
            vGapper = _mm_sub_epi64(vGapper, vGapE);
        }
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vE;
        __m128i vE_ext;
        __m128i vE_opn;
        __m128i vHt;
        __m128i vF;
        __m128i vF_ext;
        __m128i vF_opn;
        __m128i vH;
        __m128i vHp;
        __m128i *pvW;
        __m128i vW;
        __m128i case1;
        __m128i case2;
        __m128i vGapper;
        __m128i vT;
        __m128i vET;
        __m128i vFT;

        /* calculate E */
        /* calculate Ht */
        /* calculate F and H first pass */
        vHp = _mm_load_si128(pvH+(segLen-1));
        vHp = _mm_slli_si128(vHp, 8);
        vHp = _mm_insert_epi64_rpl(vHp, boundary[j], 0);
        pvW = pvP + matrix->mapper[(unsigned char)s2[j]]*segLen;
        vHt = _mm_sub_epi64(vNegLimit, pvGapper[0]);
        vF = vNegLimit;
        for (i=0; i<segLen; ++i) {
            vH = _mm_load_si128(pvH+i);
            vE = _mm_load_si128(pvE+i);
            vW = _mm_load_si128(pvW+i);
            vGapper = _mm_load_si128(pvGapper+i);
            vE_opn = _mm_sub_epi64(vH, vGapO);
            vE_ext = _mm_sub_epi64(vE, vGapE);
            case1 = _mm_cmpgt_epi64_rpl(vE_opn, vE_ext);
            vET = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, case1);
            arr_store(result->trace->trace_table, vET, i, segLen, j);
            vE = _mm_max_epi64_rpl(vE_opn, vE_ext);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vE);
            vGapper = _mm_add_epi64(vHt, vGapper);
            vF = _mm_max_epi64_rpl(vF, vGapper);
            vHp = _mm_add_epi64(vHp, vW);
            vHt = _mm_max_epi64_rpl(vE, vHp);
            _mm_store_si128(pvE+i, vE);
            _mm_store_si128(pvHt+i, vHt);
            _mm_store_si128(pvH+i, vHp);
            vHp = vH;
        }

        /* pseudo prefix scan on F and H */
        vHt = _mm_slli_si128(vHt, 8);
        vHt = _mm_insert_epi64_rpl(vHt, boundary[j+1], 0);
        vGapper = _mm_load_si128(pvGapper);
        vGapper = _mm_add_epi64(vHt, vGapper);
        vF = _mm_max_epi64_rpl(vF, vGapper);
        for (i=0; i<segWidth-2; ++i) {
            __m128i vFt = _mm_slli_si128(vF, 8);
            vFt = _mm_add_epi64(vFt, vSegLenXgap);
            vF = _mm_max_epi64_rpl(vF, vFt);
        }

        /* calculate final H */
        vF = _mm_slli_si128(vF, 8);
        vF = _mm_add_epi64(vF, vNegInfFront);
        vH = _mm_max_epi64_rpl(vF, vHt);
        for (i=0; i<segLen; ++i) {
            vET = arr_load(result->trace->trace_table, i, segLen, j);
            vHp = _mm_load_si128(pvH+i);
            vHt = _mm_load_si128(pvHt+i);
            vF_opn = _mm_sub_epi64(vH, vGapO);
            vF_ext = _mm_sub_epi64(vF, vGapE);
            vF = _mm_max_epi64_rpl(vF_opn, vF_ext);
            case1 = _mm_cmpgt_epi64_rpl(vF_opn, vF_ext);
            vFT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, case1);
            vH = _mm_max_epi64_rpl(vHt, vF);
            case1 = _mm_cmpeq_epi64_rpl(vH, vHp);
            case2 = _mm_cmpeq_epi64_rpl(vH, vF);
            vT = _mm_blendv_epi8_rpl(
                    _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                    vTDiag, case1);
            vT = _mm_or_si128(vT, vET);
            vT = _mm_or_si128(vT, vFT);
            arr_store(result->trace->trace_table, vT, i, segLen, j);
            _mm_store_si128(pvH+i, vH);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vH);
            vSaturationCheckMin = _mm_min_epi64_rpl(vSaturationCheckMin, vF);
            vSaturationCheckMax = _mm_max_epi64_rpl(vSaturationCheckMax, vH);
        }
    }

    /* extract last value from the last column */
    {
        __m128i vH = _mm_load_si128(pvH + offset);
        for (k=0; k<position; ++k) {
            vH = _mm_slli_si128(vH, 8);
        }
        score = (int64_t) _mm_extract_epi64_rpl (vH, 1);
    }

    if (_mm_movemask_epi8(_mm_or_si128(
            _mm_cmplt_epi64_rpl(vSaturationCheckMin, vNegLimit),
            _mm_cmpgt_epi64_rpl(vSaturationCheckMax, vPosLimit)))) {
        result->flag |= PARASAIL_FLAG_SATURATED;
        score = 0;
        end_query = 0;
        end_ref = 0;
    }

    result->score = score;
    result->end_query = end_query;
    result->end_ref = end_ref;

    parasail_free(pvGapper);
    parasail_free(pvH);
    parasail_free(pvHt);
    parasail_free(boundary);
    parasail_free(pvE);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, 0xd8(%rsp)
testq %rdi, %rdi
je 0x3413c6
movq 0x60(%rdi), %rax
movq %rax, 0x118(%rsp)
testq %rax, %rax
je 0x3413ea
movq 0x10(%rdi), %rax
movq %rax, 0xd0(%rsp)
testq %rax, %rax
je 0x34140e
movl 0x8(%rdi), %r15d
testl %r15d, %r15d
jle 0x341432
cmpq $0x0, 0xd8(%rsp)
je 0x341456
movl %edx, %r13d
testl %edx, %edx
jle 0x341477
testl %ecx, %ecx
js 0x341498
testl %r8d, %r8d
js 0x3414b9
movl %r8d, 0x40(%rsp)
leal -0x1(%r15), %ebx
incq %r15
shrq %r15
movl %ebx, %eax
xorl %edx, %edx
divl %r15d
movl %eax, 0x10(%rsp)
movl %edx, %ebp
movl %ecx, %r14d
negl %ecx
movq 0xd0(%rsp), %rdx
movslq 0x20(%rdx), %rax
movq %r14, %rsi
btsq $0x3f, %rsi
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
subq %rax, %r12
movl %ecx, 0x20(%rsp)
cmpl %ecx, %eax
cmovgq %rsi, %r12
movslq 0x1c(%rdx), %rax
movq %rax, 0xb0(%rsp)
pushq $0x10
popq %rcx
movl %r15d, %edi
movl %r13d, %esi
movq %rcx, %rdx
callq 0x1abb59
testq %rax, %rax
je 0x340c73
movl %ebp, 0x78(%rsp)
movq %r12, 0xc0(%rsp)
movl %ebx, 0x7c(%rsp)
movq %rax, 0x68(%rsp)
orl $0x2880401, 0xc(%rax)   # imm = 0x2880401
pushq $0x10
popq %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x297cd8
movq %r15, %r12
movq %rax, 0x38(%rsp)
movq %r13, 0xa0(%rsp)
leal 0x1(%r13), %ebp
movq %rbx, %r15
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1ab78c
movq %rax, %rbx
movq %r15, %rdi
movq %r12, %rsi
callq 0x297cd8
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x297cd8
movq %rax, %r15
pushq $0x10
popq %rdi
movq %r12, 0xc8(%rsp)
movq %r12, %rsi
callq 0x297cd8
movq 0x38(%rsp), %xmm0
movq %rbx, 0x8(%rsp)
movq %rbx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %r13, 0x60(%rsp)
movq %r13, %xmm1
movq %r15, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
pxor %xmm2, %xmm2
pcmpeqd %xmm2, %xmm0
pcmpeqd %xmm2, %xmm1
movdqa %xmm0, %xmm2
shufps $0xdd, %xmm1, %xmm2     # xmm2 = xmm2[1,3],xmm1[1,3]
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
andps %xmm2, %xmm0
movmskps %xmm0, %ecx
xorl %r12d, %r12d
testl %ecx, %ecx
jne 0x3414e2
testq %rax, %rax
je 0x3414e2
movq %rax, %rbx
movq 0xa0(%rsp), %r12
leal -0x1(%r12), %eax
movl %eax, 0x70(%rsp)
pushq $0x1
popq %rax
subl 0x10(%rsp), %eax
movl %eax, 0x74(%rsp)
movq %r14, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xe0(%rsp)
movl 0x40(%rsp), %ecx
movd %ecx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xf0(%rsp)
movq 0xc0(%rsp), %rax
incq %rax
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
subq 0xb0(%rsp), %rdx
addq $-0x2, %rdx
movq %rax, %xmm0
movdqa %xmm0, 0x140(%rsp)
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x130(%rsp)
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x120(%rsp)
movl %ecx, %eax
movslq 0x20(%rsp), %rcx
negq %r14
movq 0xc8(%rsp), %r11
movq %r11, %rdx
imulq %rax, %rdx
xorl %esi, %esi
movq %rcx, %rdi
cmpq %r11, %rsi
je 0x340c7b
movq %rdi, %r8
xorl %r9d, %r9d
cmpq $0x2, %r9
je 0x340c43
movq %r8, 0x170(%rsp,%r9,8)
leaq (%r14,%r8), %r10
movq %r10, 0x160(%rsp,%r9,8)
incq %r9
subq %rdx, %r8
jmp 0x340c21
movq %rsi, %r8
shlq $0x4, %r8
movaps 0x170(%rsp), %xmm0
movaps %xmm0, (%r15,%r8)
movdqa 0x160(%rsp), %xmm0
movq 0x38(%rsp), %r9
movdqa %xmm0, (%r9,%r8)
incq %rsi
subq %rax, %rdi
jmp 0x340c16
xorl %r12d, %r12d
jmp 0x3414e2
movq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
pushq $0x1
popq %rdx
movq 0x8(%rsp), %rsi
cmpq %rdx, %rbp
je 0x340c9d
movq %rcx, (%rsi,%rdx,8)
incq %rdx
subq %rax, %rcx
jmp 0x340c8c
pxor %xmm0, %xmm0
psubq 0xe0(%rsp), %xmm0
leal -0x1(%r11), %eax
movl %eax, %ecx
testl %ecx, %ecx
js 0x340ccc
movl %ecx, %edx
shlq $0x4, %rdx
movdqa %xmm0, (%rbx,%rdx)
psubq 0xf0(%rsp), %xmm0
decl %ecx
jmp 0x340cb0
movl %eax, %eax
shlq $0x4, %rax
movq %r15, %rcx
addq %rax, %rcx
movq %rcx, 0x108(%rsp)
movl %r12d, %eax
movq %rax, 0x110(%rsp)
movq %r11, %rbp
shlq $0x4, %rbp
xorl %r13d, %r13d
xorl %edx, %edx
movaps 0x120(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movaps 0x130(%rsp), %xmm0
movaps %xmm0, 0xb0(%rsp)
movq %rbx, 0x58(%rsp)
cmpq 0x110(%rsp), %rdx
je 0x3412b1
movq 0x8(%rsp), %rax
movq (%rax,%rdx,8), %xmm3
movq 0x108(%rsp), %rax
punpcklqdq (%rax), %xmm3   # xmm3 = xmm3[0],mem[0]
movq 0xd0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xd8(%rsp), %rcx
movq %rdx, 0x50(%rsp)
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %eax
imull %r11d, %eax
movslq %eax, %r14
shlq $0x4, %r14
addq 0x118(%rsp), %r14
movdqa 0x130(%rsp), %xmm0
movdqa %xmm0, %xmm2
psubq (%rbx), %xmm2
xorl %r12d, %r12d
movdqa %xmm0, %xmm7
cmpq %r12, %rbp
je 0x340f7b
movdqa (%r15,%r12), %xmm0
movdqa %xmm0, 0x10(%rsp)
movq 0x38(%rsp), %rbx
movdqa (%rbx,%r12), %xmm1
psubq 0xe0(%rsp), %xmm0
movdqa %xmm0, 0x90(%rsp)
psubq 0xf0(%rsp), %xmm1
movdqa %xmm1, 0x80(%rsp)
movq 0x58(%rsp), %rax
paddq (%rax,%r12), %xmm2
movdqa %xmm2, 0x150(%rsp)
paddq (%r14,%r12), %xmm3
movdqa %xmm3, 0xa0(%rsp)
movdqa %xmm7, 0x20(%rsp)
callq 0x3414f7
movdqa 0x20(%rsp), %xmm7
pand 0x288768(%rip), %xmm0   # 0x5c9570
pxor 0x288770(%rip), %xmm0   # 0x5c9580
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
addq %r13, %rax
movdqa %xmm0, (%r12,%rax)
movdqa 0x150(%rsp), %xmm4
movdqa %xmm4, %xmm0
movdqa 0x286ad6(%rip), %xmm5   # 0x5c7910
pxor %xmm5, %xmm0
movdqa %xmm7, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
pand %xmm3, %xmm0
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm0, %xmm1
pand %xmm1, %xmm7
pandn %xmm4, %xmm1
por %xmm1, %xmm7
movdqa 0x80(%rsp), %xmm4
movdqa %xmm4, %xmm0
pxor %xmm5, %xmm0
movdqa 0x90(%rsp), %xmm6
movdqa %xmm6, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm3, %xmm1
pshufd $0xf5, %xmm2, %xmm0     # xmm0 = xmm2[1,1,3,3]
por %xmm1, %xmm0
movdqa %xmm6, %xmm1
pand %xmm0, %xmm1
pandn %xmm4, %xmm0
por %xmm1, %xmm0
movdqa 0x40(%rsp), %xmm6
movdqa %xmm6, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm0, %xmm2
pxor %xmm5, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm2, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
por %xmm1, %xmm3
pand %xmm3, %xmm6
pandn %xmm0, %xmm3
por %xmm3, %xmm6
movdqa %xmm6, 0x40(%rsp)
movdqa 0xa0(%rsp), %xmm6
movdqa %xmm6, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm2, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm2, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm1, %xmm2
movdqa %xmm0, (%rbx,%r12)
pand %xmm2, %xmm0
pandn %xmm6, %xmm2
por %xmm0, %xmm2
movq 0x60(%rsp), %rax
movdqa %xmm2, (%rax,%r12)
movdqa %xmm6, (%r15,%r12)
addq $0x10, %r12
movdqa 0x10(%rsp), %xmm3
jmp 0x340d88
movq 0x8(%rsp), %rax
movq 0x50(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rax
incq %rcx
movq %rcx, 0x50(%rsp)
movq %rax, %xmm5
movq %xmm7, %rcx
movq 0x58(%rsp), %rbx
addq (%rbx), %rax
cmpq %rax, %rcx
cmovgq %rcx, %rax
movq %rax, %xmm6
pslldq $0x8, %xmm6             # xmm6 = zero,zero,zero,zero,zero,zero,zero,zero,xmm6[0,1,2,3,4,5,6,7]
paddq 0x140(%rsp), %xmm6
punpcklqdq %xmm2, %xmm5    # xmm5 = xmm5[0],xmm2[0]
movdqa %xmm6, %xmm1
movdqa 0x286942(%rip), %xmm3   # 0x5c7910
pxor %xmm3, %xmm1
movdqa %xmm5, %xmm2
pxor %xmm3, %xmm2
movdqa %xmm1, %xmm3
pcmpgtd %xmm2, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm0     # xmm0 = xmm3[1,1,3,3]
por %xmm1, %xmm0
movdqa %xmm6, %xmm1
pand %xmm0, %xmm1
pandn %xmm5, %xmm0
por %xmm1, %xmm0
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x34129c
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %r12
addq %r13, %r12
movaps (%r14,%r12), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps (%r15,%r14), %xmm1
movaps %xmm1, 0x90(%rsp)
psubq 0xe0(%rsp), %xmm0
movdqa %xmm0, 0x20(%rsp)
psubq 0xf0(%rsp), %xmm6
movdqa %xmm6, 0x80(%rsp)
movdqa %xmm6, %xmm1
callq 0x3414f7
pand 0x28851f(%rip), %xmm0   # 0x5c9590
pxor 0x288527(%rip), %xmm0   # 0x5c95a0
por 0x10(%rsp), %xmm0
movdqa %xmm0, 0xa0(%rsp)
movdqa 0x80(%rsp), %xmm4
movdqa %xmm4, %xmm0
movdqa 0x286873(%rip), %xmm2   # 0x5c7910
pxor %xmm2, %xmm0
movdqa 0x20(%rsp), %xmm5
movdqa %xmm5, %xmm1
pxor %xmm2, %xmm1
movdqa %xmm2, %xmm6
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm0     # xmm0 = xmm1[1,1,3,3]
pand %xmm3, %xmm0
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm0, %xmm1
movdqa %xmm5, %xmm0
pand %xmm1, %xmm0
pandn %xmm4, %xmm1
por %xmm0, %xmm1
movq 0x60(%rsp), %rax
movdqa (%rax,%r14), %xmm5
movdqa %xmm1, %xmm0
movdqa %xmm1, %xmm4
movdqa %xmm1, 0x10(%rsp)
pxor %xmm6, %xmm0
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm5, %xmm1
pxor %xmm6, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm3, %xmm1
pshufd $0xf5, %xmm2, %xmm0     # xmm0 = xmm2[1,1,3,3]
por %xmm1, %xmm0
pand %xmm0, %xmm5
pandn %xmm4, %xmm0
por %xmm5, %xmm0
movdqa %xmm0, 0x20(%rsp)
movaps 0x90(%rsp), %xmm1
callq 0x34152b
movdqa %xmm0, 0x90(%rsp)
movaps 0x20(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x34152b
andps 0x28843b(%rip), %xmm0   # 0x5c95b0
xorps 0x286e54(%rip), %xmm0   # 0x5c7fd0
movaps 0x90(%rsp), %xmm2
movaps %xmm2, %xmm1
andnps %xmm0, %xmm1
andps 0x28842f(%rip), %xmm2   # 0x5c95c0
orps 0xa0(%rsp), %xmm2
orps %xmm1, %xmm2
movaps %xmm2, (%r14,%r12)
movdqa 0x20(%rsp), %xmm7
movdqa %xmm7, (%r15,%r14)
movdqa 0x40(%rsp), %xmm4
movdqa %xmm4, %xmm1
movdqa 0x286751(%rip), %xmm5   # 0x5c7910
pxor %xmm5, %xmm1
movdqa %xmm7, %xmm0
pxor %xmm5, %xmm0
movdqa %xmm0, %xmm2
pcmpgtd %xmm1, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm3, %xmm1
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
por %xmm1, %xmm2
pand %xmm2, %xmm4
pandn %xmm7, %xmm2
por %xmm4, %xmm2
movdqa %xmm2, %xmm1
pxor %xmm5, %xmm1
movdqa 0x80(%rsp), %xmm6
movdqa %xmm6, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm4     # xmm4 = xmm3[0,0,2,2]
pcmpeqd %xmm6, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pand %xmm4, %xmm1
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
por %xmm1, %xmm3
pand %xmm3, %xmm2
movdqa 0x10(%rsp), %xmm6
pandn %xmm6, %xmm3
por %xmm2, %xmm3
movdqa %xmm3, 0x40(%rsp)
movdqa 0xb0(%rsp), %xmm4
movdqa %xmm4, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pshufd $0xa0, %xmm2, %xmm3     # xmm3 = xmm2[0,0,2,2]
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm5     # xmm5 = xmm1[1,1,3,3]
pand %xmm3, %xmm5
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
movdqa %xmm7, %xmm0
por %xmm5, %xmm1
pand %xmm1, %xmm4
pandn %xmm7, %xmm1
por %xmm1, %xmm4
movdqa %xmm4, 0xb0(%rsp)
addq $0x10, %r14
jmp 0x341010
addq %rbp, %r13
movq 0xc8(%rsp), %r11
movq 0x50(%rsp), %rdx
jmp 0x340d19
movl 0x78(%rsp), %eax
shlq $0x4, %rax
movdqa (%r15,%rax), %xmm0
xorl %eax, %eax
movl 0x7c(%rsp), %ebp
movq 0x68(%rsp), %r12
movq 0xc0(%rsp), %rcx
pushq $0x1
popq %rdx
movl 0x74(%rsp), %esi
cmpl %esi, %eax
jge 0x3412e6
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
movl %edx, %eax
jmp 0x3412d9
movdqa %xmm0, 0x10(%rsp)
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x20(%rsp)
movdqa 0xb0(%rsp), %xmm0
movaps 0x120(%rsp), %xmm1
callq 0x3414f7
movdqa 0x2865f6(%rip), %xmm1   # 0x5c7910
movdqa 0x40(%rsp), %xmm3
pxor %xmm1, %xmm3
movdqa 0x20(%rsp), %xmm4
pxor %xmm1, %xmm4
movdqa %xmm3, %xmm1
pcmpgtd %xmm4, %xmm1
pshufd $0xa0, %xmm1, %xmm2     # xmm2 = xmm1[0,0,2,2]
pcmpeqd %xmm3, %xmm4
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
por %xmm3, %xmm1
pcmpeqd %xmm2, %xmm2
pxor %xmm1, %xmm2
por %xmm0, %xmm2
pmovmskb %xmm2, %eax
testl %eax, %eax
je 0x341373
orb $0x40, 0xc(%r12)
xorl %eax, %eax
xorl %ecx, %ecx
xorl %ebp, %ebp
jmp 0x341383
pshufd $0xee, 0x10(%rsp), %xmm0 # xmm0 = mem[2,3,2,3]
movq %xmm0, %rax
movl 0x70(%rsp), %ecx
movl %eax, (%r12)
movl %ebp, 0x4(%r12)
movl %ecx, 0x8(%r12)
movq 0x58(%rsp), %rdi
callq 0x1ab763
movq %r15, %rdi
callq 0x1ab763
movq 0x60(%rsp), %rdi
callq 0x1ab763
movq 0x8(%rsp), %rdi
callq 0x1ab763
movq 0x38(%rsp), %rdi
callq 0x1ab763
jmp 0x3414e2
movq 0x3f9c0b(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x285c14(%rip), %rsi    # 0x5c6feb
leaq 0x27fdbe(%rip), %rdx    # 0x5c119c
leaq 0x25c0f8(%rip), %rcx    # 0x59d4dd
jmp 0x3414d8
movq 0x3f9be7(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x285bf0(%rip), %rsi    # 0x5c6feb
leaq 0x27fd9a(%rip), %rdx    # 0x5c119c
leaq 0x286517(%rip), %rcx    # 0x5c7920
jmp 0x3414d8
movq 0x3f9bc3(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x285bcc(%rip), %rsi    # 0x5c6feb
leaq 0x27fd76(%rip), %rdx    # 0x5c119c
leaq 0x28650c(%rip), %rcx    # 0x5c7939
jmp 0x3414d8
movq 0x3f9b9f(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x2862be(%rip), %rsi    # 0x5c7701
leaq 0x27fd52(%rip), %rdx    # 0x5c119c
leaq 0x2864f8(%rip), %rcx    # 0x5c7949
jmp 0x3414d8
movq 0x3f9b7b(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x285b84(%rip), %rsi    # 0x5c6feb
leaq 0x27fd2e(%rip), %rdx    # 0x5c119c
leaq 0x286289(%rip), %rcx    # 0x5c76fe
jmp 0x3414d8
movq 0x3f9b5a(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x286279(%rip), %rsi    # 0x5c7701
leaq 0x27fd0d(%rip), %rdx    # 0x5c119c
leaq 0x28627f(%rip), %rcx    # 0x5c7715
jmp 0x3414d8
movq 0x3f9b39(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x286272(%rip), %rsi    # 0x5c771b
leaq 0x27fcec(%rip), %rdx    # 0x5c119c
leaq 0x286279(%rip), %rcx    # 0x5c7730
jmp 0x3414d8
movq 0x3f9b18(%rip), %rax    # 0x73afd8
movq (%rax), %rdi
leaq 0x286251(%rip), %rsi    # 0x5c771b
leaq 0x27fccb(%rip), %rdx    # 0x5c119c
leaq 0x28625d(%rip), %rcx    # 0x5c7735
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x19e180
movq %r12, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq