// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/src/sw_trace_striped_sse2_128_64.c
// Function: parasail_sw_trace_striped_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 end_query = 0;
    int32_t end_ref = 0;
    int32_t s1Len = 0;
    const parasail_matrix_t *matrix = NULL;
    int32_t segWidth = 0;
    int32_t segLen = 0;
    __m128i* restrict vProfile = NULL;
    __m128i* restrict pvHStore = NULL;
    __m128i* restrict pvHLoad = NULL;
    __m128i* restrict pvE = NULL;
    __m128i* restrict pvEaStore = NULL;
    __m128i* restrict pvEaLoad = NULL;
    __m128i* restrict pvHT = NULL;
    __m128i* restrict pvHMax = NULL;
    __m128i vGapO;
    __m128i vGapE;
    __m128i vZero;
    int64_t score = 0;
    __m128i vMaxH;
    __m128i vMaxHUnit;
    int64_t maxp = 0;
    parasail_result_t *result = NULL;
    __m128i vTZero;
    __m128i vTIns;
    __m128i vTDel;
    __m128i vTDiag;
    __m128i vTDiagE;
    __m128i vTInsE;
    __m128i vTDiagF;
    __m128i vTDelF;
    __m128i vTMask;
    __m128i vFTMask;

    /* 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;
    end_query = 0;
    end_ref = 0;
    s1Len = profile->s1Len;
    matrix = profile->matrix;
    segWidth = 2; /* number of values in vector unit */
    segLen = (s1Len + segWidth - 1) / segWidth;
    vProfile = (__m128i*)profile->profile64.score;
    vGapO = _mm_set1_epi64x_rpl(open);
    vGapE = _mm_set1_epi64x_rpl(gap);
    vZero = _mm_setzero_si128();
    score = NEG_INF;
    vMaxH = vZero;
    vMaxHUnit = vZero;
    maxp = INT64_MAX - (int64_t)(matrix->max+1);
    vTZero = _mm_set1_epi64x_rpl(PARASAIL_ZERO);
    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);
    vTMask = _mm_set1_epi64x_rpl(PARASAIL_ZERO_MASK);
    vFTMask= _mm_set1_epi64x_rpl(PARASAIL_F_MASK);

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

    /* set known flags */
    result->flag |= PARASAIL_FLAG_SW | PARASAIL_FLAG_STRIPED
        | PARASAIL_FLAG_TRACE
        | PARASAIL_FLAG_BITS_64 | PARASAIL_FLAG_LANES_2;

    /* initialize heap variables */
    pvHStore = parasail_memalign___m128i(16, segLen);
    pvHLoad =  parasail_memalign___m128i(16, segLen);
    pvE = parasail_memalign___m128i(16, segLen);
    pvEaStore = parasail_memalign___m128i(16, segLen);
    pvEaLoad = parasail_memalign___m128i(16, segLen);
    pvHT = parasail_memalign___m128i(16, segLen);
    pvHMax = parasail_memalign___m128i(16, segLen);

    /* validate heap variables */
    if (!pvHStore) return NULL;
    if (!pvHLoad) return NULL;
    if (!pvE) return NULL;
    if (!pvEaStore) return NULL;
    if (!pvEaLoad) return NULL;
    if (!pvHT) return NULL;
    if (!pvHMax) return NULL;

    /* initialize H and E */
    parasail_memset___m128i(pvHStore, vZero, segLen);
    parasail_memset___m128i(pvE, _mm_set1_epi64x_rpl(-open), segLen);
    parasail_memset___m128i(pvEaStore, _mm_set1_epi64x_rpl(-open), segLen);

    for (i=0; i<segLen; ++i) {
        arr_store(result->trace->trace_table, vTDiagE, i, segLen, 0);
    }

    /* outer loop over database sequence */
    for (j=0; j<s2Len; ++j) {
        __m128i vEF_opn;
        __m128i vE;
        __m128i vE_ext;
        __m128i vF;
        __m128i vF_ext;
        __m128i vFa;
        __m128i vFa_ext;
        __m128i vH;
        __m128i vH_dag;
        const __m128i* vP = NULL;

        /* Initialize F value to 0.  Any errors to vH values will be
         * corrected in the Lazy_F loop. */
        vF = _mm_sub_epi64(vZero,vGapO);

        /* load final segment of pvHStore and shift left by 8 bytes */
        vH = _mm_load_si128(&pvHStore[segLen - 1]);
        vH = _mm_slli_si128(vH, 8);

        /* Correct part of the vProfile */
        vP = vProfile + matrix->mapper[(unsigned char)s2[j]] * segLen;

        if (end_ref == j-2) {
            /* Swap in the max buffer. */
            SWAP3(pvHMax,  pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }
        else {
            /* Swap the 2 H buffers. */
            SWAP(pvHLoad,  pvHStore)
            SWAP(pvEaLoad,  pvEaStore)
        }

        /* inner loop to process the query sequence */
        for (i=0; i<segLen; ++i) {
            vE = _mm_load_si128(pvE + i);

            /* Get max from vH, vE and vF. */
            vH_dag = _mm_add_epi64(vH, _mm_load_si128(vP + i));
            vH_dag = _mm_max_epi64_rpl(vH_dag, vZero);
            vH = _mm_max_epi64_rpl(vH_dag, vE);
            vH = _mm_max_epi64_rpl(vH, vF);
            /* Save vH values. */
            _mm_store_si128(pvHStore + i, vH);

            {
                __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                __m128i cond_zero = _mm_cmpeq_epi64_rpl(vH, vZero);
                __m128i case1 = _mm_cmpeq_epi64_rpl(vH, vH_dag);
                __m128i case2 = _mm_cmpeq_epi64_rpl(vH, vF);
                __m128i vT = _mm_blendv_epi8_rpl(
                        _mm_blendv_epi8_rpl(vTIns, vTDel, case2),
                        _mm_blendv_epi8_rpl(vTDiag, vTZero, cond_zero),
                        case1);
                _mm_store_si128(pvHT + i, vT);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i, segLen, j);
            }
            vMaxH = _mm_max_epi64_rpl(vH, vMaxH);
            vEF_opn = _mm_sub_epi64(vH, vGapO);

            /* Update vE value. */
            vE_ext = _mm_sub_epi64(vE, vGapE);
            vE = _mm_max_epi64_rpl(vEF_opn, vE_ext);
            _mm_store_si128(pvE + i, vE);
            {
                __m128i vEa = _mm_load_si128(pvEaLoad + i);
                __m128i vEa_ext = _mm_sub_epi64(vEa, vGapE);
                vEa = _mm_max_epi64_rpl(vEF_opn, vEa_ext);
                _mm_store_si128(pvEaStore + i, vEa);
                if (j+1<s2Len) {
                    __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vEa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                    arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                }
            }

            /* Update vF value. */
            vF_ext = _mm_sub_epi64(vF, vGapE);
            vF = _mm_max_epi64_rpl(vEF_opn, vF_ext);
            if (i+1<segLen) {
                __m128i vTAll = arr_load(result->trace->trace_table, i+1, segLen, j);
                __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vF_ext);
                __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                vT = _mm_or_si128(vT, vTAll);
                arr_store(result->trace->trace_table, vT, i+1, segLen, j);
            }

            /* Load the next vH. */
            vH = _mm_load_si128(pvHLoad + i);
        }

        /* Lazy_F loop: has been revised to disallow adjecent insertion and
         * then deletion, so don't update E(i, i), learn from SWPS3 */
        vFa_ext = vF_ext;
        vFa = vF;
        for (k=0; k<segWidth; ++k) {
            __m128i vHp = _mm_load_si128(&pvHLoad[segLen - 1]);
            vHp = _mm_slli_si128(vHp, 8);
            vEF_opn = _mm_slli_si128(vEF_opn, 8);
            vEF_opn = _mm_insert_epi64_rpl(vEF_opn, -open, 0);
            vF_ext = _mm_slli_si128(vF_ext, 8);
            vF_ext = _mm_insert_epi64_rpl(vF_ext, NEG_INF, 0);
            vF = _mm_slli_si128(vF, 8);
            vF = _mm_insert_epi64_rpl(vF, -open, 0);
            vFa_ext = _mm_slli_si128(vFa_ext, 8);
            vFa_ext = _mm_insert_epi64_rpl(vFa_ext, NEG_INF, 0);
            vFa = _mm_slli_si128(vFa, 8);
            vFa = _mm_insert_epi64_rpl(vFa, -open, 0);
            for (i=0; i<segLen; ++i) {
                vH = _mm_load_si128(pvHStore + i);
                vH = _mm_max_epi64_rpl(vH,vF);
                _mm_store_si128(pvHStore + i, vH);
                {
                    __m128i vTAll;
                    __m128i vT;
                    __m128i case1;
                    __m128i case2;
                    __m128i cond;
                    vHp = _mm_add_epi64(vHp, _mm_load_si128(vP + i));
                    vHp = _mm_max_epi64_rpl(vHp, vZero);
                    case1 = _mm_cmpeq_epi64_rpl(vH, vHp);
                    case2 = _mm_cmpeq_epi64_rpl(vH, vF);
                    cond = _mm_andnot_si128(case1,case2);
                    vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    vT = _mm_load_si128(pvHT + i);
                    vT = _mm_blendv_epi8_rpl(vT, vTDel, cond);
                    _mm_store_si128(pvHT + i, vT);
                    vTAll = _mm_and_si128(vTAll, vTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vMaxH = _mm_max_epi64_rpl(vH, vMaxH);
                /* Update vF value. */
                {
                    __m128i vTAll = arr_load(result->trace->trace_table, i, segLen, j);
                    __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vFa_ext);
                    __m128i vT = _mm_blendv_epi8_rpl(vTDelF, vTDiagF, cond);
                    vTAll = _mm_and_si128(vTAll, vFTMask);
                    vTAll = _mm_or_si128(vTAll, vT);
                    arr_store(result->trace->trace_table, vTAll, i, segLen, j);
                }
                vEF_opn = _mm_sub_epi64(vH, vGapO);
                vF_ext = _mm_sub_epi64(vF, vGapE);
                {
                    __m128i vEa = _mm_load_si128(pvEaLoad + i);
                    __m128i vEa_ext = _mm_sub_epi64(vEa, vGapE);
                    vEa = _mm_max_epi64_rpl(vEF_opn, vEa_ext);
                    _mm_store_si128(pvEaStore + i, vEa);
                    if (j+1<s2Len) {
                        __m128i cond = _mm_cmpgt_epi64_rpl(vEF_opn, vEa_ext);
                        __m128i vT = _mm_blendv_epi8_rpl(vTInsE, vTDiagE, cond);
                        arr_store(result->trace->trace_table, vT, i, segLen, j+1);
                    }
                }
                if (! _mm_movemask_epi8(
                            _mm_or_si128(
                                _mm_cmpgt_epi64_rpl(vF_ext, vEF_opn),
                                _mm_cmpeq_epi64_rpl(vF_ext, vEF_opn))))
                    goto end;
                /*vF = _mm_max_epi64_rpl(vEF_opn, vF_ext);*/
                vF = vF_ext;
                vFa_ext = _mm_sub_epi64(vFa, vGapE);
                vFa = _mm_max_epi64_rpl(vEF_opn, vFa_ext);
                vHp = _mm_load_si128(pvHLoad + i);
            }
        }
end:
        {
        }

        {
            __m128i vCompare = _mm_cmpgt_epi64_rpl(vMaxH, vMaxHUnit);
            if (_mm_movemask_epi8(vCompare)) {
                score = _mm_hmax_epi64_rpl(vMaxH);
                /* if score has potential to overflow, abort early */
                if (score > maxp) {
                    result->flag |= PARASAIL_FLAG_SATURATED;
                    break;
                }
                vMaxHUnit = _mm_set1_epi64x_rpl(score);
                end_ref = j;
            }
        }

        /*if (score == stop) break;*/
    }

    if (score == INT64_MAX) {
        result->flag |= PARASAIL_FLAG_SATURATED;
    }

    if (parasail_result_is_saturated(result)) {
        score = 0;
        end_query = 0;
        end_ref = 0;
    }
    else {
        if (end_ref == j-1) {
            /* end_ref was the last store column */
            SWAP(pvHMax,  pvHStore)
        }
        else if (end_ref == j-2) {
            /* end_ref was the last load column */
            SWAP(pvHMax,  pvHLoad)
        }
        /* Trace the alignment ending position on read. */
        {
            int64_t *t = (int64_t*)pvHMax;
            int32_t column_len = segLen * segWidth;
            end_query = s1Len - 1;
            for (i = 0; i<column_len; ++i, ++t) {
                if (*t == score) {
                    int32_t temp = i / segWidth + i % segWidth * segLen;
                    if (temp < end_query) {
                        end_query = temp;
                    }
                }
            }
        }
    }

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

    parasail_free(pvHMax);
    parasail_free(pvHT);
    parasail_free(pvEaLoad);
    parasail_free(pvEaStore);
    parasail_free(pvE);
    parasail_free(pvHLoad);
    parasail_free(pvHStore);

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, 0x88(%rsp)
testq %rdi, %rdi
je 0x39b117
movq 0x60(%rdi), %rax
movq %rax, 0xe8(%rsp)
testq %rax, %rax
je 0x39b11e
movq 0x10(%rdi), %rax
movq %rax, 0x80(%rsp)
testq %rax, %rax
je 0x39b125
movl 0x8(%rdi), %eax
testl %eax, %eax
jle 0x39b12c
cmpq $0x0, 0x88(%rsp)
je 0x39b133
movl %edx, %ebp
testl %edx, %edx
jle 0x39b13a
movl %ecx, %r13d
testl %ecx, %ecx
js 0x39b141
movl %r8d, %r12d
testl %r8d, %r8d
js 0x39b148
movq %rax, 0xc8(%rsp)
leaq 0x1(%rax), %rbx
movq %rbx, %r14
shrq %r14
movq 0x80(%rsp), %rax
movslq 0x1c(%rax), %rax
movq %rax, 0x50(%rsp)
movl $0x10, %edx
movl $0x10, %ecx
movl %r14d, %edi
movl %ebp, %esi
callq 0x2097d1
testq %rax, %rax
je 0x39b14d
movq %rax, %r15
movl %r12d, 0x40(%rsp)
movl %ebp, 0x10(%rsp)
movq %rbx, 0xc0(%rsp)
orl $0x2880804, 0xc(%rax)   # imm = 0x2880804
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %rbx
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %r12
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, 0x30(%rsp)
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, 0x8(%rsp)
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, %rbp
movl $0x10, %edi
movq %r14, %rsi
callq 0x2ea474
movq %rax, 0x38(%rsp)
movl $0x10, %edi
movq %r14, 0x20(%rsp)
movq %r14, %rsi
callq 0x2ea474
movq %rax, %rcx
xorl %eax, %eax
testq %rbx, %rbx
je 0x39b1a0
testq %r12, %r12
je 0x39b1a0
cmpq $0x0, 0x30(%rsp)
je 0x39b1a0
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x39b1a0
testq %rbp, %rbp
je 0x39b1a0
cmpq $0x0, 0x38(%rsp)
je 0x39b1a0
testq %rcx, %rcx
je 0x39b1a0
movq %rcx, 0x28(%rsp)
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movd %r13d, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0xb0(%rsp)
movd 0x40(%rsp), %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x120(%rsp)
movq 0x50(%rsp), %rax
notq %rax
addq %rcx, %rax
movq %rax, 0x50(%rsp)
pxor %xmm0, %xmm0
movq %rbx, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rsi
callq 0x2ea47d
negl %r13d
movslq %r13d, %rax
movq %rax, 0xf0(%rsp)
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x40(%rsp)
movq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x2ea47d
movq 0x8(%rsp), %rdi
movaps 0x40(%rsp), %xmm0
movq %r14, %rsi
callq 0x2ea47d
movl %r14d, %eax
movq %rax, 0x100(%rsp)
movq %rax, %rdx
shlq $0x4, %rdx
xorl %eax, %eax
movdqa 0x25d152(%rip), %xmm0   # 0x5f77f0
movq 0x10(%r15), %rcx
movq (%rcx), %rcx
movdqa %xmm0, (%rcx,%rax)
addq $0x10, %rax
cmpq %rax, %rdx
jne 0x39a69e
pxor %xmm13, %xmm13
pxor %xmm0, %xmm0
psubq 0xb0(%rsp), %xmm0
movdqa %xmm0, 0x130(%rsp)
movq 0x20(%rsp), %rax
leal -0x1(%rax), %esi
cmpl $0x1, %eax
movl %eax, %edi
adcl $0x0, %edi
movl 0x10(%rsp), %r8d
movl %r8d, %ecx
movq %rcx, 0xa0(%rsp)
cmpl $0x2, %r8d
movl $0x1, %ecx
cmovgel %r8d, %ecx
movq %rcx, 0x58(%rsp)
shlq $0x4, %rdi
movq %rdi, 0x98(%rsp)
movabsq $-0x4000000000000000, %rcx # imm = 0xC000000000000000
movq %rcx, 0x18(%rsp)
shlq $0x4, %rsi
movq %rsi, 0xe0(%rsp)
cltq
movq %rax, 0xd8(%rsp)
movdqa 0x25cd57(%rip), %xmm4   # 0x5f7490
movdqa 0x25cd1f(%rip), %xmm5   # 0x5f7460
movdqa 0x25cd27(%rip), %xmm6   # 0x5f7470
movdqa 0x25cd2f(%rip), %xmm7   # 0x5f7480
movdqa 0x25b3d6(%rip), %xmm9   # 0x5f5b30
movdqa 0x25d09d(%rip), %xmm10  # 0x5f7800
movdqa 0x25d0a4(%rip), %xmm11  # 0x5f7810
movq $0x0, 0x10(%rsp)
movq %rdx, 0xd0(%rsp)
movq %rdx, 0x70(%rsp)
xorl %r10d, %r10d
xorl %r8d, %r8d
pxor %xmm0, %xmm0
movdqa %xmm0, 0x110(%rsp)
movq 0x28(%rsp), %r14
movdqa 0x120(%rsp), %xmm3
movq 0x8(%rsp), %rcx
movq %r14, %rax
movq %rbp, 0x8(%rsp)
movq %rcx, 0x90(%rsp)
movq %rbx, %rdi
movq 0xe0(%rsp), %r9
leaq (%rbx,%r9), %rdx
movq %rdx, 0xf8(%rsp)
movq 0x80(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0x88(%rsp), %rsi
movzbl (%rsi,%r10), %esi
movslq (%rdx,%rsi,4), %rdx
imulq 0xd8(%rsp), %rdx
shlq $0x4, %rdx
addq 0xe8(%rsp), %rdx
movq %rdx, 0xa8(%rsp)
leal -0x2(%r10), %edx
movl %r8d, 0x4(%rsp)
cmpl %edx, %r8d
cmoveq %r12, %r14
movq %r14, 0x28(%rsp)
movq %r12, %rbx
cmoveq %rax, %rbx
movq %rdi, 0x78(%rsp)
movdqa (%rdi,%r9), %xmm0
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
movq %r10, 0x60(%rsp)
leaq 0x1(%r10), %rax
movq %rax, 0x40(%rsp)
movl $0x1, %r10d
xorl %ecx, %ecx
movdqa 0x130(%rsp), %xmm12
movq %rbx, 0x108(%rsp)
movq %r10, 0x68(%rsp)
movq 0xa8(%rsp), %rax
paddq (%rax,%rcx), %xmm0
movq %xmm0, %r9
testq %r9, %r9
movl $0x0, %eax
cmovleq %rax, %r9
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %r8
testq %r8, %r8
cmovleq %rax, %r8
movq 0x30(%rsp), %r10
movq (%r10,%rcx), %r13
cmpq %r13, %r9
cmovgq %r9, %r13
movq 0x8(%r10,%rcx), %r12
cmpq %r12, %r8
cmovgq %r8, %r12
movdqa (%r10,%rcx), %xmm0
movq %xmm12, %r11
cmpq %r11, %r13
movq %r11, %rdx
cmovgq %r13, %rdx
pshufd $0xee, %xmm12, %xmm1    # xmm1 = xmm12[2,3,2,3]
movq %xmm1, %r14
cmpq %r14, %r12
movq %r14, %rdi
cmovgq %r12, %rdi
movq %rdx, %xmm8
movq %rdi, %xmm1
punpcklqdq %xmm1, %xmm8    # xmm8 = xmm8[0],xmm1[0]
movdqa %xmm8, (%rbx,%rcx)
movq 0x10(%r15), %rsi
movq (%rsi), %rsi
movq 0x10(%rsp), %rax
addq %rax, %rsi
cmpq $0x1, %rdx
movl $0x0, %ebp
sbbq %rbp, %rbp
cmpq $0x1, %rdi
movq %r15, %rax
movl $0x0, %r15d
sbbq %r15, %r15
xorl %ebx, %ebx
cmpq %r9, %rdx
sete %bl
negq %rbx
xorl %r9d, %r9d
cmpq %r8, %rdi
sete %r9b
negq %r9
xorl %r8d, %r8d
cmpq %r13, %r11
movq %rbp, %xmm2
movq %r15, %xmm14
movq %rax, %r15
movq %rbx, %xmm1
punpcklqdq %xmm14, %xmm2   # xmm2 = xmm2[0],xmm14[0]
movq %r9, %xmm14
punpcklqdq %xmm14, %xmm1   # xmm1 = xmm1[0],xmm14[0]
setge %r8b
negq %r8
xorl %r9d, %r9d
cmpq %r12, %r14
setge %r9b
negq %r9
movq %r8, %xmm14
movq %r9, %xmm15
punpcklqdq %xmm15, %xmm14  # xmm14 = xmm14[0],xmm15[0]
pand %xmm4, %xmm14
pxor 0x25b549(%rip), %xmm14  # 0x5f5ed0
pandn %xmm1, %xmm2
pand 0x25cb0d(%rip), %xmm2   # 0x5f74a0
pandn %xmm14, %xmm1
por %xmm2, %xmm1
movdqa (%rcx,%rsi), %xmm2
movq 0x38(%rsp), %rax
movdqa %xmm1, (%rax,%rcx)
movq 0x10(%r15), %rsi
movq (%rsi), %rsi
addq 0x10(%rsp), %rsi
movq %xmm13, %r8
cmpq %r8, %rdx
cmovleq %r8, %rdx
pshufd $0xee, %xmm13, %xmm13   # xmm13 = xmm13[2,3,2,3]
movq %xmm13, %r8
cmpq %r8, %rdi
cmovleq %r8, %rdi
psubq 0xb0(%rsp), %xmm8
psubq %xmm3, %xmm0
movq %xmm8, %r13
movq %xmm0, %r8
cmpq %r8, %r13
cmovgq %r13, %r8
por %xmm1, %xmm2
pshufd $0xee, %xmm8, %xmm1     # xmm1 = xmm8[2,3,2,3]
movq %xmm1, %r12
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %r9
cmpq %r9, %r12
cmovgq %r12, %r9
movdqa %xmm2, (%rcx,%rsi)
movq %r8, %xmm0
movq %r9, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, (%r10,%rcx)
movq 0x90(%rsp), %rax
movdqa (%rax,%rcx), %xmm0
psubq %xmm3, %xmm0
movq %xmm0, %r8
cmpq %r8, %r13
movq %r8, %r9
cmovgq %r13, %r9
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rsi
cmpq %rsi, %r12
movq %r9, %xmm0
movq %rsi, %r9
cmovgq %r12, %r9
movq %r9, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq 0x8(%rsp), %rax
movdqa %xmm0, (%rax,%rcx)
movq 0x40(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jae 0x39aacd
xorl %r9d, %r9d
cmpq %r8, %r13
setg %r9b
negq %r9
xorl %r8d, %r8d
cmpq %rsi, %r12
setg %r8b
negq %r8
movq %r8, %xmm0
movq %r9, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
pand 0x25c998(%rip), %xmm1   # 0x5f7450
pxor %xmm5, %xmm1
movq 0x10(%r15), %rsi
movq (%rsi), %rsi
addq 0x70(%rsp), %rsi
movdqa %xmm1, (%rcx,%rsi)
movdqa %xmm12, %xmm14
psubq %xmm3, %xmm14
movq %xmm14, %r11
cmpq %r11, %r13
movq %r11, %rsi
cmovgq %r13, %rsi
pshufd $0xee, %xmm14, %xmm0    # xmm0 = xmm14[2,3,2,3]
movq %xmm0, %r9
cmpq %r9, %r12
movq %r9, %r8
cmovgq %r12, %r8
movq 0x68(%rsp), %r10
cmpq 0x100(%rsp), %r10
jae 0x39ab52
movq 0x10(%r15), %rbx
movq (%rbx), %rbx
addq 0x10(%rsp), %rbx
xorl %r14d, %r14d
cmpq %r11, %r13
setg %r14b
negq %r14
xorl %r11d, %r11d
cmpq %r9, %r12
setg %r11b
negq %r11
movq %r11, %xmm0
movq %r14, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
pand %xmm6, %xmm1
pxor %xmm7, %xmm1
por 0x10(%rcx,%rbx), %xmm1
movdqa %xmm1, 0x10(%rcx,%rbx)
movq %rdx, %xmm13
movq %rdi, %xmm0
punpcklqdq %xmm0, %xmm13   # xmm13 = xmm13[0],xmm0[0]
movq %rsi, %xmm12
movq %r8, %xmm0
punpcklqdq %xmm0, %xmm12   # xmm12 = xmm12[0],xmm0[0]
movq 0x78(%rsp), %rax
movdqa (%rax,%rcx), %xmm0
addq $0x10, %rcx
incq %r10
cmpq %rcx, 0x98(%rsp)
movq 0x108(%rsp), %rbx
jne 0x39a85d
xorl %ecx, %ecx
movdqa %xmm12, %xmm0
movq 0x90(%rsp), %rbp
movq 0x38(%rsp), %r10
movq %rcx, 0x68(%rsp)
movq 0x25ccc8(%rip), %xmm1   # 0x5f7880
punpcklqdq %xmm14, %xmm1   # xmm1 = xmm1[0],xmm14[0]
movq 0xf0(%rsp), %xmm14
movdqa %xmm14, %xmm15
punpcklqdq %xmm0, %xmm15   # xmm15 = xmm15[0],xmm0[0]
movdqa %xmm14, %xmm0
punpcklqdq %xmm12, %xmm0   # xmm0 = xmm0[0],xmm12[0]
punpcklqdq %xmm8, %xmm14   # xmm14 = xmm14[0],xmm8[0]
movq 0xf8(%rsp), %rax
movdqa (%rax), %xmm2
pslldq $0x8, %xmm2             # xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0,1,2,3,4,5,6,7]
xorl %r11d, %r11d
movdqa %xmm14, %xmm8
movdqa %xmm0, %xmm12
movdqa %xmm15, %xmm0
movdqa %xmm1, %xmm14
movq %xmm12, %rdx
movq (%rbx,%r11), %rdi
movq 0x8(%rbx,%r11), %r14
cmpq %rdx, %rdi
movq %rdx, %rax
cmovgq %rdi, %rax
pshufd $0xee, %xmm12, %xmm1    # xmm1 = xmm12[2,3,2,3]
movq %xmm1, %rcx
cmpq %rcx, %r14
movq %rcx, %r12
cmovgq %r14, %r12
movq %rax, %xmm15
movq %r12, %xmm1
punpcklqdq %xmm1, %xmm15   # xmm15 = xmm15[0],xmm1[0]
movdqa %xmm15, (%rbx,%r11)
movq 0xa8(%rsp), %rsi
paddq (%rsi,%r11), %xmm2
movq %xmm2, %rsi
testq %rsi, %rsi
movl $0x0, %r9d
cmovleq %r9, %rsi
pshufd $0xee, %xmm2, %xmm1     # xmm1 = xmm2[2,3,2,3]
movq %xmm1, %r8
testq %r8, %r8
cmovleq %r9, %r8
xorl %r9d, %r9d
cmpq %rsi, %rax
sete %r9b
negq %r9
xorl %r13d, %r13d
cmpq %r8, %r12
sete %r13b
negq %r13
xorl %esi, %esi
cmpq %rdi, %rdx
movq %r9, %xmm1
movq %xmm8, %rdi
pshufd $0xee, %xmm8, %xmm2     # xmm2 = xmm8[2,3,2,3]
movq %r13, %xmm8
punpcklqdq %xmm8, %xmm1    # xmm1 = xmm1[0],xmm8[0]
setge %sil
negq %rsi
xorl %edx, %edx
cmpq %r14, %rcx
setge %dl
negq %rdx
movq %rsi, %xmm8
movq %rdx, %xmm3
punpcklqdq %xmm3, %xmm8    # xmm8 = xmm8[0],xmm3[0]
pandn %xmm8, %xmm1
movq 0x10(%r15), %rcx
movq (%rcx), %rcx
movq 0x10(%rsp), %rsi
addq %rsi, %rcx
movdqa (%r11,%rcx), %xmm3
pand %xmm10, %xmm3
movdqa %xmm1, %xmm8
pandn (%r10,%r11), %xmm8
pand %xmm9, %xmm1
por %xmm8, %xmm1
movdqa %xmm1, (%r10,%r11)
por %xmm3, %xmm1
movq 0x10(%r15), %rcx
movq (%rcx), %rcx
addq %rsi, %rcx
movq %xmm13, %rdx
cmpq %rdx, %rax
cmovleq %rdx, %rax
pshufd $0xee, %xmm13, %xmm3    # xmm3 = xmm13[2,3,2,3]
movq %xmm3, %rdx
movdqa 0x120(%rsp), %xmm4
cmpq %rdx, %r12
cmovleq %rdx, %r12
movdqa %xmm1, (%r11,%rcx)
movq 0x10(%r15), %rcx
movq (%rcx), %rcx
addq %rsi, %rcx
movq %xmm14, %rdx
xorl %esi, %esi
cmpq %rdx, %rdi
setg %sil
negq %rsi
movq %xmm2, %rdx
pshufd $0xee, %xmm14, %xmm1    # xmm1 = xmm14[2,3,2,3]
movq %xmm1, %rdi
xorl %r8d, %r8d
cmpq %rdi, %rdx
setg %r8b
negq %r8
movq %rsi, %xmm1
movq %r8, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
pand %xmm6, %xmm1
movdqa (%r11,%rcx), %xmm2
pand %xmm11, %xmm2
por %xmm1, %xmm2
pxor %xmm7, %xmm2
movdqa %xmm2, (%r11,%rcx)
movdqa %xmm15, %xmm8
psubq 0xb0(%rsp), %xmm8
movdqa (%rbp,%r11), %xmm1
psubq %xmm4, %xmm1
movq %xmm8, %rcx
movq %xmm1, %rsi
cmpq %rsi, %rcx
movq %rsi, %rdi
cmovgq %rcx, %rdi
pshufd $0xee, %xmm8, %xmm2     # xmm2 = xmm8[2,3,2,3]
movq %xmm2, %r14
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, %rdx
cmpq %rdx, %r14
movq %rdi, %xmm1
movq %rdx, %rdi
cmovgq %r14, %rdi
movq %rdi, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
movq 0x8(%rsp), %rdi
movdqa %xmm1, (%rdi,%r11)
movq 0x40(%rsp), %rdi
cmpq 0xa0(%rsp), %rdi
jae 0x39ae66
xorl %edi, %edi
cmpq %rsi, %rcx
setg %dil
negq %rdi
xorl %esi, %esi
cmpq %rdx, %r14
setg %sil
negq %rsi
movq %rsi, %xmm1
movq %rdi, %xmm2
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
pand 0x25c600(%rip), %xmm2   # 0x5f7450
pxor %xmm5, %xmm2
movq 0x10(%r15), %rdx
movq (%rdx), %rdx
addq 0x70(%rsp), %rdx
movdqa %xmm2, (%r11,%rdx)
movq %rax, %xmm13
movq %r12, %xmm1
punpcklqdq %xmm1, %xmm13   # xmm13 = xmm13[0],xmm1[0]
movdqa %xmm12, %xmm1
psubq %xmm4, %xmm1
movq %xmm1, %rsi
pshufd $0xee, %xmm1, %xmm2     # xmm2 = xmm1[2,3,2,3]
movq %xmm2, %rdi
xorl %r8d, %r8d
xorl %edx, %edx
cmpq %r14, %rdi
setg %r8b
sete %dl
xorl %edi, %edi
xorl %r9d, %r9d
cmpq %rcx, %rsi
setg %dil
sete %r9b
negq %rdi
negq %r8
movq %rdi, %xmm2
movq %r8, %xmm3
punpcklqdq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0]
negq %r9
negq %rdx
movq %r9, %xmm3
movq %rdx, %xmm15
punpcklqdq %xmm15, %xmm3   # xmm3 = xmm3[0],xmm15[0]
por %xmm2, %xmm3
pmovmskb %xmm3, %edx
testl %edx, %edx
setne %r13b
je 0x39af4a
movdqa %xmm0, %xmm14
psubq %xmm4, %xmm14
movq %xmm14, %rdx
cmpq %rdx, %rcx
cmovgq %rcx, %rdx
pshufd $0xee, %xmm14, %xmm0    # xmm0 = xmm14[2,3,2,3]
movq %xmm0, %rcx
cmpq %rcx, %r14
cmovgq %r14, %rcx
movq %rdx, %xmm0
movq %rcx, %xmm2
punpcklqdq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0]
movq 0x78(%rsp), %rcx
movdqa (%rcx,%r11), %xmm2
addq $0x10, %r11
movdqa %xmm1, %xmm12
cmpq %r11, 0x98(%rsp)
jne 0x39ac08
movdqa %xmm4, %xmm3
xorl %ecx, %ecx
movdqa %xmm1, %xmm12
jmp 0x39af53
movl $0x21, %ecx
movdqa %xmm4, %xmm3
testl %ecx, %ecx
movdqa 0x25c533(%rip), %xmm4   # 0x5f7490
jne 0x39af71
movq 0x68(%rsp), %rdx
leal 0x1(%rdx), %ecx
testl %edx, %edx
je 0x39abab
jmp 0x39af76
cmpl $0x21, %ecx
jne 0x39afea
movdqa 0x110(%rsp), %xmm0
movq %xmm0, %rcx
xorl %edx, %edx
cmpq %rcx, %rax
setg %dl
negq %rdx
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rcx
xorl %esi, %esi
cmpq %rcx, %r12
setg %sil
negq %rsi
movq %rdx, %xmm0
movq %rsi, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
pmovmskb %xmm0, %ecx
movb $0x1, %r13b
testl %ecx, %ecx
movq 0x28(%rsp), %r14
je 0x39afef
cmpq %r12, %rax
cmovgq %rax, %r12
cmpq 0x50(%rsp), %r12
movl 0x4(%rsp), %r8d
movq 0x60(%rsp), %rax
jle 0x39affb
orb $0x40, 0xc(%r15)
xorl %r13d, %r13d
movq %r12, 0x18(%rsp)
jmp 0x39b016
movq 0x28(%rsp), %r14
movl 0x4(%rsp), %r8d
movq 0x60(%rsp), %rax
jmp 0x39b016
movq %r12, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x110(%rsp)
movq %r12, 0x18(%rsp)
movl %eax, %r8d
testb %r13b, %r13b
movq 0x78(%rsp), %r12
je 0x39b04f
movq 0xd0(%rsp), %rax
addq %rax, 0x70(%rsp)
addq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq %rax, %r10
movq 0x8(%rsp), %r13
movq %r13, %rcx
cmpq 0x58(%rsp), %rax
jne 0x39a7a8
jmp 0x39b059
movq %rax, 0x58(%rsp)
movq 0x8(%rsp), %r13
movl %r8d, 0x4(%rsp)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, 0x18(%rsp)
jne 0x39b074
orb $0x40, 0xc(%r15)
movq %r15, %rdi
callq 0x20a805
xorl %ecx, %ecx
testl %eax, %eax
je 0x39b090
movq %r14, %rdi
xorl %r9d, %r9d
xorl %r8d, %r8d
jmp 0x39b159
movq 0x58(%rsp), %rcx
leal -0x1(%rcx), %eax
addl $-0x2, %ecx
movl 0x4(%rsp), %r9d
cmpl %ecx, %r9d
movq %r14, %rdi
cmoveq %r12, %rdi
movq %r12, %rcx
cmoveq %r14, %rcx
cmpl %eax, %r9d
cmoveq %rbx, %rdi
cmoveq %r12, %rcx
movq %rcx, %r12
cmoveq %r14, %rbx
movq 0xc8(%rsp), %r8
decl %r8d
testl $0x7ffffffe, 0xc0(%rsp) # imm = 0x7FFFFFFE
je 0x39b151
movq 0x20(%rsp), %rax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addl %eax, %eax
xorl %ecx, %ecx
movq 0x18(%rsp), %r10
cmpq %r10, (%rdi,%rcx,8)
jne 0x39b10e
movl %ecx, %edx
shrl %edx
testb $0x1, %cl
movl $0x0, %esi
cmovnel 0x20(%rsp), %esi
addl %edx, %esi
cmpl %r8d, %esi
cmovll %esi, %r8d
incq %rcx
cmpl %ecx, %eax
jne 0x39b0ee
jmp 0x39b156
callq 0x1bed11
jmp 0x39b14d
callq 0x1beceb
jmp 0x39b14d
callq 0x1becc5
jmp 0x39b14d
callq 0x1bec9f
jmp 0x39b14d
callq 0x1bec79
jmp 0x39b14d
callq 0x1bec53
jmp 0x39b14d
callq 0x1bec2d
jmp 0x39b14d
callq 0x1bec07
xorl %eax, %eax
jmp 0x39b1a0
movq 0x18(%rsp), %r10
movl %r10d, %ecx
movl %ecx, (%r15)
movl %r8d, 0x4(%r15)
movl %r9d, 0x8(%r15)
callq 0x2094b5
movq 0x38(%rsp), %rdi
callq 0x2094b5
movq %rbp, %rdi
callq 0x2094b5
movq %r13, %rdi
callq 0x2094b5
movq 0x30(%rsp), %rdi
callq 0x2094b5
movq %r12, %rdi
callq 0x2094b5
movq %rbx, %rdi
callq 0x2094b5
movq %r15, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop