// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/ecovlp.cpp
// Function: gen_updated_trace(asg16_v*, asg16_v*, asg16_v*, char*, unsigned long, char*, unsigned long, asg64_v*, bit_extz_t*, unsigned long)
void gen_updated_trace(asg16_v *qcc, asg16_v *tcc, asg16_v *tcc_res, char *qstr, uint64_t ql, char *tstr, uint64_t tl, asg64_v *srt, bit_extz_t *exz, uint64_t rid)
{
    uint64_t k, ck, qk, tk, wq[2], wt[2], old_dp, dp, s, e, srt_n, si, ei, so, os, oe, *qd, *td, qs, qe, ts, te, q0, t0; 
    asg16_v *cc; uint32_t len; uint16_t c, bq, bt;

    srt->n = 0;

    cc = qcc;
    ck = qk = tk = wq[0] = wq[1] = wt[0] = wt[1] = 0;
    while (ck < cc->n) {
        wq[0] = qk; wt[0] = tk;
        ck = pop_trace_bp_f(cc, ck, &c, &bq, &bt, &len);
        if(c != 2) qk += len;
        if(c != 3) tk += len;
        wq[1] = qk; wt[1] = tk;
        if(c != 0) continue;

        kv_push(uint64_t, (*srt), (wq[0]<<1));
        kv_push(uint64_t, (*srt), ((wq[1]<<1)|1));
    }

    cc = tcc;
    ck = qk = tk = wq[0] = wq[1] = wt[0] = wt[1] = 0;
    while (ck < cc->n) {
        wq[0] = qk; wt[0] = tk;
        ck = pop_trace_bp_f(cc, ck, &c, &bq, &bt, &len);
        if(c != 2) qk += len;
        if(c != 3) tk += len;
        wq[1] = qk; wt[1] = tk;
        if(c != 0) continue;

        kv_push(uint64_t, (*srt), (wt[0]<<1));
        kv_push(uint64_t, (*srt), ((wt[1]<<1)|1));
    }

    // fprintf(stderr, "[M::%s] rid::%lu, ql::%lu, tl::%lu\n", __func__, rid, ql, tl);

    radix_sort_ec64(srt->a, srt->a + srt->n);
    for (k = 0, dp = e = srt_n = 0, s = (uint64_t)-1; k < srt->n; k++) {
        old_dp = dp;
        //if a[k] is qe
        if (srt->a[k]&1) --dp;
        else ++dp;

        if(old_dp >= 2 && s != (uint64_t)-1) {
            e = srt->a[k]>>1;
            if(e > s) srt->a[srt_n++] = ((s<<32)|(e));
        }

        s = (uint64_t)-1;
        if(dp >= 2) s = srt->a[k]>>1;
        // if (old_dp < 2 && dp >= 2) {///old_dp < dp, a[k] is qs
        //     s = srt->a[k]>>1;
        // } else if (old_dp >= 2 && dp < 2) {///old_dp > dp, a[k] is qe
        //     e = srt->a[k]>>1;
        //     if(e > s) {
        //         srt->a[srt_n++] = ((s<<32)|(e));
        //         fprintf(stderr, "[M::%s] x::[%lu,\t%lu)\n", __func__, s, e);
        //     }
        // }
    }

    
    // for (k = 0; k < srt_n; k++) {
    //     fprintf(stderr, "[M::%s] x[%lu]::[%lu,\t%u)\n", __func__, k, srt->a[k]>>32, (uint32_t)srt->a[k]);
    // }
    

    if(srt_n > 0) {
        srt->n = srt_n;

        cc = qcc;
        k = ck = qk = tk = wq[0] = wq[1] = wt[0] = wt[1] = 0;
        while (ck < cc->n) {
            wq[0] = qk; wt[0] = tk;
            ck = pop_trace_bp_f(cc, ck, &c, &bq, &bt, &len);
            if(c != 2) qk += len;
            if(c != 3) tk += len;
            wq[1] = qk; wt[1] = tk;
            if(c != 0) continue;
            si = wq[0]; ei = wq[1];
            so = wt[0]; ///eo = wt[1];

            for (; (k > 0) && ((k >= srt_n) || (((uint32_t)(srt->a[k])) > si)); k--);
            for (; k < srt_n; k++) {
                s = srt->a[k]>>32; e = (uint32_t)(srt->a[k]);
                if(s >= ei) break;
                if(s >= si && e <= ei) {
                    os = so + s - si;
                    oe = so + e - si; 
                    kv_push(uint64_t, (*srt), ((os<<32)|(oe)));
                }
            }
        }
        assert(srt->n == (srt_n<<1));

        cc = tcc;
        k = ck = qk = tk = wq[0] = wq[1] = wt[0] = wt[1] = 0;
        while (ck < cc->n) {
            wq[0] = qk; wt[0] = tk;
            ck = pop_trace_bp_f(cc, ck, &c, &bq, &bt, &len);
            if(c != 2) qk += len;
            if(c != 3) tk += len;
            wq[1] = qk; wt[1] = tk;
            if(c != 0) continue;
            si = wt[0]; ei = wt[1];
            so = wq[0]; ///eo = wq[1];

            for (; (k > 0) && ((k >= srt_n) || (((uint32_t)(srt->a[k])) > si)); k--);
            for (; k < srt_n; k++) {
                s = srt->a[k]>>32; e = (uint32_t)(srt->a[k]);
                // fprintf(stderr, "######[M::%s] t[%lu]::[%lu,\t%lu) i::[%lu,\t%lu)\n", __func__, k, s, e, si, ei);
                if(s >= ei) break;
                if(s >= si && e <= ei) {
                    os = so + s - si;
                    oe = so + e - si; 
                    kv_push(uint64_t, (*srt), ((os<<32)|(oe)));
                    // fprintf(stderr, "[M::%s] ******\n", __func__);
                }
            }
        }
        // if(!(srt->n == (srt_n*3))) {
        //     fprintf(stderr, "[M::%s] rid::%lu, srt_n::%lu, srt->n::%lu\n", __func__, rid, srt_n, (uint64_t)srt->n);
        // }
        assert(srt->n == (srt_n*3));

        
        tcc_res->n = 0; ///reset tcc
        qd = srt->a + srt_n; td = srt->a + srt_n + srt_n; uint64_t nl = 0;///, dbg_ql, dbg_tl;
        for (k = q0 = t0 = 0; k < srt_n; k++) {
            qs = qd[k]>>32; qe = (uint32_t)qd[k];
            ts = td[k]>>32; te = (uint32_t)td[k];
            nl += qs - qe;
            // assert((qe - qs) == (te - ts));
            // assert(!memcmp(qstr + qs, tstr + ts, sizeof((*qstr))*(qe - qs)));

            // if(t0 > ts || q0 > qs) {
            //     fprintf(stderr, "[M::%s] rid::%lu, ql::%lu, tl::%lu\n", __func__, rid, ql, tl);
            // }
            // fprintf(stderr, "[M::%s] qseq::[%lu,%lu), ql::%lu, tseq::[%lu,%lu), tl::%lu\n", __func__, t0, ts, tl, q0, qs, ql);

            gen_cc_fly(tcc_res, tstr + t0, ts - t0, qstr + q0, qs - q0, exz, 0.25, MAX_SIN_L, MAX_SIN_E);

            // cal_updated_trace_len(tcc_res, &dbg_ql, &dbg_tl);
            // assert(dbg_ql == ts && dbg_tl == qs);

            // fprintf(stderr, "******\n");
            
            push_trace_bp_f(tcc_res, 0, (uint16_t)-1, (uint16_t)-1,  qe - qs, 1);

            // cal_updated_trace_len(tcc_res, &dbg_ql, &dbg_tl);
            // assert(dbg_ql == te && dbg_tl == qe);

            q0 = qe; t0 = te;
        }

        qs = ql; ts = tl;
        // fprintf(stderr, "[M::%s] qseq::[%lu,%lu), ql::%lu, tseq::[%lu,%lu), tl::%lu\n", __func__, t0, ts, tl, q0, qs, ql);
        gen_cc_fly(tcc_res, tstr + t0, ts - t0, qstr + q0, qs - q0, exz, 0.25, MAX_SIN_L, MAX_SIN_E);
        // if(!(dbg_ql == ts && dbg_tl == qs)) {
        //     fprintf(stderr, "[M::%s] rid::%lu, qseq::[%lu,%lu), ql::%lu, tseq::[%lu,%lu), tl::%lu\n", __func__, rid, t0, ts, tl, q0, qs, ql);
        // }
        // cal_updated_trace_len(tcc_res, &dbg_ql, &dbg_tl);
        // assert(dbg_ql == ts && dbg_tl == qs);

        // fprintf(stderr, "[M::%s] srt_n::%lu, nl::%lu, ql::%lu, tl::%lu\n", __func__, srt_n, nl, ql, tl);
    } else {
        gen_cc_fly(tcc_res, tstr, tl, qstr, ql, exz, 0.25, MAX_SIN_L, MAX_SIN_E);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
movq 0x88(%rsp), %rbp
movq $0x0, (%rbp)
movq (%rdi), %rax
testq %rax, %rax
je 0x188d1a
xorl %ecx, %ecx
movl $0x2, %r14d
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%r13), %rsi
movzwl (%rsi,%rcx,2), %ecx
movl %ecx, %edx
shrl $0xe, %edx
leal -0x2(%rdx), %edi
cmpl $0x2, %edi
jae 0x188bad
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r9d
andl $0xfff, %r9d            # imm = 0xFFF
jmp 0x188bbf
testl %edx, %edx
jne 0x188bc7
movl %ecx, %r9d
andl $0x3fff, %r9d           # imm = 0x3FFF
movw $0xffff, %di            # imm = 0xFFFF
movl $0xffff, %r8d           # imm = 0xFFFF
jmp 0x188be4
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r8d
shrl $0xa, %r8d
andl $0x3, %r8d
movl %ecx, %r9d
andl $0x3ff, %r9d            # imm = 0x3FF
movzwl %r9w, %r9d
incl %r15d
cmpq %r15, %rax
jbe 0x188c65
movzwl (%rsi,%r15,2), %r10d
movl %r10d, %r11d
shrl $0xe, %r11d
cmpl %edx, %r11d
jne 0x188c65
movzwl %dx, %r11d
leal -0x2(%r11), %ebx
cmpl $0x2, %ebx
jae 0x188c22
movl %r10d, %r11d
shrl $0xc, %r11d
andl $0x3, %r11d
andl $0xfff, %r10d           # imm = 0xFFF
jmp 0x188c33
testl %r11d, %r11d
jne 0x188c3a
andl $0x3fff, %r10d          # imm = 0x3FFF
movw $0xffff, %r11w          # imm = 0xFFFF
movl $0xffff, %ebx           # imm = 0xFFFF
jmp 0x188c55
movl %r10d, %r11d
shrl $0xc, %r11d
andl $0x3, %r11d
movl %r10d, %ebx
shrl $0xa, %ebx
andl $0x3, %ebx
andl $0x3ff, %r10d           # imm = 0x3FF
cmpl %r8d, %ebx
jne 0x188c65
cmpw %r11w, %di
jne 0x188c65
addl %r10d, %r9d
jmp 0x188be8
cmpw $0x2, %dx
movl %r9d, %eax
movl $0x0, %ebx
cmovneq %rax, %rbx
addq %r12, %rbx
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x188d07
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
jne 0x188cae
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r14, %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
addq %r12, %r12
movq (%rbp), %rax
movq 0x10(%rbp), %rdi
leaq 0x1(%rax), %rcx
movq %rcx, (%rbp)
movq %r12, (%rdi,%rax,8)
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
jne 0x188ceb
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r14, %rsi
movq %rsi, 0x8(%rbp)
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
leaq 0x1(,%rbx,2), %rax
movq (%rbp), %rcx
movq 0x10(%rbp), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbp)
movq %rax, (%rdx,%rcx,8)
movl %r15d, %ecx
movq (%r13), %rax
movq %rbx, %r12
cmpq %rcx, %rax
ja 0x188b84
movq %r13, 0x8(%rsp)
movq 0x10(%rsp), %rdx
movq (%rdx), %rax
testq %rax, %rax
je 0x188ede
xorl %ecx, %ecx
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%rdx), %rsi
movzwl (%rsi,%rcx,2), %ecx
movl %ecx, %edx
shrl $0xe, %edx
leal -0x2(%rdx), %edi
cmpl $0x2, %edi
jae 0x188d64
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r9d
andl $0xfff, %r9d            # imm = 0xFFF
jmp 0x188d76
testl %edx, %edx
jne 0x188d7e
movl %ecx, %r9d
andl $0x3fff, %r9d           # imm = 0x3FFF
movw $0xffff, %di            # imm = 0xFFFF
movl $0xffff, %r8d           # imm = 0xFFFF
jmp 0x188d9b
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r8d
shrl $0xa, %r8d
andl $0x3, %r8d
movl %ecx, %r9d
andl $0x3ff, %r9d            # imm = 0x3FF
movzwl %r9w, %r9d
incl %r12d
cmpq %r12, %rax
jbe 0x188e18
movzwl %dx, %r10d
leal -0x2(%r10), %r11d
movzwl (%rsi,%r12,2), %ebx
movl %ebx, %ebp
shrl $0xe, %ebp
cmpl %edx, %ebp
jne 0x188e18
cmpl $0x2, %r11d
jae 0x188dd3
movl %ebx, %ebp
shrl $0xc, %ebp
andl $0x3, %ebp
andl $0xfff, %ebx            # imm = 0xFFF
jmp 0x188de2
testl %r10d, %r10d
jne 0x188dea
andl $0x3fff, %ebx           # imm = 0x3FFF
movw $0xffff, %bp            # imm = 0xFFFF
movl $0xffff, %r15d          # imm = 0xFFFF
jmp 0x188e03
movl %ebx, %ebp
shrl $0xc, %ebp
andl $0x3, %ebp
movl %ebx, %r15d
shrl $0xa, %r15d
andl $0x3, %r15d
andl $0x3ff, %ebx            # imm = 0x3FF
cmpl %r8d, %r15d
jne 0x188e18
cmpw %bp, %di
jne 0x188e18
addl %ebx, %r9d
incl %r12d
cmpq %r12, %rax
ja 0x188daf
cmpw $0x3, %dx
movl %r9d, %ebx
cmoveq %r14, %rbx
addq %r13, %rbx
cmpl $0x3fff, %ecx           # imm = 0x3FFF
movq 0x88(%rsp), %rbp
ja 0x188ec7
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
jne 0x188e69
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rbp)
movq 0x10(%rbp), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
addq %r13, %r13
movq (%rbp), %rax
movq 0x10(%rbp), %rdi
leaq 0x1(%rax), %rcx
movq %rcx, (%rbp)
movq %r13, (%rdi,%rax,8)
movq 0x8(%rbp), %rax
cmpq %rax, (%rbp)
jne 0x188eab
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rbp)
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
leaq 0x1(,%rbx,2), %rax
movq (%rbp), %rcx
movq 0x10(%rbp), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbp)
movq %rax, (%rdx,%rcx,8)
movl %r12d, %ecx
movq 0x10(%rsp), %rdx
movq (%rdx), %rax
movq %rbx, %r13
cmpq %rcx, %rax
ja 0x188d3b
movq (%rbp), %rax
movq 0x10(%rbp), %rdi
leaq (%rdi,%rax,8), %rsi
callq 0x178fc2
cmpq $0x0, (%rbp)
je 0x188f68
movq 0x10(%rbp), %rax
movq $-0x1, %r9
xorl %ecx, %ecx
xorl %r11d, %r11d
xorl %edx, %edx
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdi
movq (%rax,%rcx,8), %r10
cmpq $0x2, %rdx
jb 0x188f3b
cmpq $-0x1, %r9
je 0x188f3b
movq %r10, %r8
shrq %r8
cmpq %r9, %r8
jbe 0x188f3b
shlq $0x20, %r9
orq %r9, %r8
movq %r8, (%rax,%r11,8)
incq %r11
andl $0x1, %r10d
negq %r10
orq $0x1, %r10
addq %r10, %rdx
movq $-0x1, %r9
cmpq $0x2, %rdx
jb 0x188f5d
movq (%rax,%rcx,8), %r9
shrq %r9
incq %rcx
cmpq (%rbp), %rcx
jb 0x188f12
jmp 0x188f75
xorl %r11d, %r11d
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdi
movq 0x90(%rsp), %r9
movq 0x80(%rsp), %rdx
testq %r11, %r11
je 0x189512
movq %r11, (%rbp)
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %r14d, %r14d
movq %r11, (%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl %r12d, %r12d
cmpq %r12, %rax
jbe 0x1891c4
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rsi
movzwl (%rsi,%r12,2), %ecx
movl %ecx, %edx
shrl $0xe, %edx
leal -0x2(%rdx), %edi
movq %rbp, %r13
movq %rbx, %r15
cmpl $0x2, %edi
jae 0x188fe9
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r9d
andl $0xfff, %r9d            # imm = 0xFFF
jmp 0x188ffb
testl %edx, %edx
jne 0x189003
movl %ecx, %r9d
andl $0x3fff, %r9d           # imm = 0x3FFF
movw $0xffff, %di            # imm = 0xFFFF
movl $0xffff, %r8d           # imm = 0xFFFF
jmp 0x189020
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r8d
shrl $0xa, %r8d
andl $0x3, %r8d
movl %ecx, %r9d
andl $0x3ff, %r9d            # imm = 0x3FF
movzwl %r9w, %r9d
incl %r12d
cmpq %r12, %rax
jbe 0x1890a1
movzwl (%rsi,%r12,2), %r10d
movl %r10d, %r11d
shrl $0xe, %r11d
cmpl %edx, %r11d
jne 0x1890a1
movzwl %dx, %r11d
leal -0x2(%r11), %ebx
cmpl $0x2, %ebx
jae 0x18905e
movl %r10d, %r11d
shrl $0xc, %r11d
andl $0x3, %r11d
andl $0xfff, %r10d           # imm = 0xFFF
jmp 0x18906f
testl %r11d, %r11d
jne 0x189076
andl $0x3fff, %r10d          # imm = 0x3FFF
movw $0xffff, %r11w          # imm = 0xFFFF
movl $0xffff, %ebx           # imm = 0xFFFF
jmp 0x189091
movl %r10d, %r11d
shrl $0xc, %r11d
andl $0x3, %r11d
movl %r10d, %ebx
shrl $0xa, %ebx
andl $0x3, %ebx
andl $0x3ff, %r10d           # imm = 0x3FF
cmpl %r8d, %ebx
jne 0x1890a1
cmpw %r11w, %di
jne 0x1890a1
addl %r10d, %r9d
jmp 0x189024
cmpw $0x2, %dx
movl %r9d, %ebp
movq %rbp, %rbx
movl $0x0, %esi
cmoveq %rsi, %rbx
addq %r15, %rbx
cmpw $0x3, %dx
cmoveq %rsi, %rbp
addq %r13, %rbp
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x188fa8
movq %r15, %r8
movq %r13, %r9
testq %r14, %r14
je 0x189105
movq (%rsp), %r11
cmpq %r11, %r14
jae 0x1890fb
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%r14,8), %eax
cmpq %r8, %rax
movq (%rsp), %r11
jbe 0x189109
decq %r14
jne 0x1890dd
xorl %r14d, %r14d
jmp 0x189109
movq (%rsp), %r11
cmpq %r11, %r14
jae 0x188fa0
subq %r8, %r9
movq %r8, 0x20(%rsp)
movq %r9, 0x40(%rsp)
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rdi
movq (%rdi,%r14,8), %r13
movl %r13d, %r15d
shrq $0x20, %r13
cmpq %rbx, %r13
jae 0x188fa0
cmpq %r8, %r13
jb 0x1891ac
cmpq %rbx, %r15
ja 0x1891ac
movq 0x88(%rsp), %r10
movq 0x8(%r10), %rax
cmpq %rax, (%r10)
jne 0x18918d
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r10)
shlq $0x3, %rsi
callq 0x2370
movq 0x88(%rsp), %r10
movq 0x40(%rsp), %r9
movq 0x20(%rsp), %r8
movq %rax, 0x10(%r10)
addq %r9, %r13
addq %r9, %r15
shlq $0x20, %r13
orq %r15, %r13
movq (%r10), %rax
movq 0x10(%r10), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r10)
movq %r13, (%rcx,%rax,8)
incq %r14
movq (%rsp), %r11
cmpq %r14, %r11
jne 0x18911f
movq %r11, %r14
jmp 0x188fa0
movq (%rsp), %rax
addq %rax, %rax
movq 0x88(%rsp), %rbp
cmpq %rax, (%rbp)
jne 0x189542
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rsp), %rsi
movq (%rsi), %rax
movl %r15d, %r15d
cmpq %r15, %rax
jbe 0x189402
movq 0x10(%rsi), %rsi
movzwl (%rsi,%r15,2), %ecx
movl %ecx, %edx
shrl $0xe, %edx
leal -0x2(%rdx), %edi
cmpl $0x2, %edi
movq %r14, 0x8(%rsp)
movq %r13, %rbp
jae 0x18922f
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r9d
andl $0xfff, %r9d            # imm = 0xFFF
jmp 0x189241
testl %edx, %edx
jne 0x189249
movl %ecx, %r9d
andl $0x3fff, %r9d           # imm = 0x3FFF
movw $0xffff, %di            # imm = 0xFFFF
movl $0xffff, %r8d           # imm = 0xFFFF
jmp 0x189266
movl %ecx, %edi
shrl $0xc, %edi
andl $0x3, %edi
movl %ecx, %r8d
shrl $0xa, %r8d
andl $0x3, %r8d
movl %ecx, %r9d
andl $0x3ff, %r9d            # imm = 0x3FF
movzwl %r9w, %r9d
incl %r15d
cmpq %r15, %rax
jbe 0x1892e7
movzwl (%rsi,%r15,2), %r10d
movl %r10d, %r11d
shrl $0xe, %r11d
cmpl %edx, %r11d
jne 0x1892e7
movzwl %dx, %r11d
leal -0x2(%r11), %ebx
cmpl $0x2, %ebx
jae 0x1892a4
movl %r10d, %r11d
shrl $0xc, %r11d
andl $0x3, %r11d
andl $0xfff, %r10d           # imm = 0xFFF
jmp 0x1892b5
testl %r11d, %r11d
jne 0x1892bc
andl $0x3fff, %r10d          # imm = 0x3FFF
movw $0xffff, %r11w          # imm = 0xFFFF
movl $0xffff, %ebx           # imm = 0xFFFF
jmp 0x1892d7
movl %r10d, %r11d
shrl $0xc, %r11d
andl $0x3, %r11d
movl %r10d, %ebx
shrl $0xa, %ebx
andl $0x3, %ebx
andl $0x3ff, %r10d           # imm = 0x3FF
cmpl %r8d, %ebx
jne 0x1892e7
cmpw %r11w, %di
jne 0x1892e7
addl %r10d, %r9d
jmp 0x18926a
cmpw $0x2, %dx
movl %r9d, %r14d
movq %r14, %r13
movl $0x0, %esi
cmoveq %rsi, %r13
addq %rbp, %r13
cmpw $0x3, %dx
cmoveq %rsi, %r14
movq 0x8(%rsp), %r9
addq %r9, %r14
cmpl $0x3fff, %ecx           # imm = 0x3FFF
movq 0x10(%rsp), %rsi
ja 0x1891f1
movq %rbp, %r8
movq 0x88(%rsp), %rbp
testq %r12, %r12
je 0x189349
cmpq (%rsp), %r12
jae 0x189341
movq 0x10(%rbp), %rax
movl (%rax,%r12,8), %eax
cmpq %r9, %rax
jbe 0x189349
decq %r12
jne 0x18932e
xorl %r12d, %r12d
cmpq (%rsp), %r12
jae 0x1891ee
subq %r9, %r8
movq %r8, 0x20(%rsp)
movq 0x10(%rbp), %rdi
movq (%rdi,%r12,8), %rbx
movl %ebx, %ebp
shrq $0x20, %rbx
cmpq %r14, %rbx
jae 0x1891ee
cmpq %r9, %rbx
jb 0x1893e4
cmpq %r14, %rbp
ja 0x1893e4
movq 0x88(%rsp), %r10
movq 0x8(%r10), %rax
cmpq %rax, (%r10)
jne 0x1893c5
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r10)
shlq $0x3, %rsi
callq 0x2370
movq 0x88(%rsp), %r10
movq 0x8(%rsp), %r9
movq 0x20(%rsp), %r8
movq 0x10(%rsp), %rsi
movq %rax, 0x10(%r10)
addq %r8, %rbx
addq %r8, %rbp
shlq $0x20, %rbx
orq %rbp, %rbx
movq (%r10), %rax
movq 0x10(%r10), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r10)
movq %rbx, (%rcx,%rax,8)
incq %r12
cmpq %r12, (%rsp)
movq 0x88(%rsp), %rbp
jne 0x18935b
movq (%rsp), %r12
jmp 0x1891ee
movq (%rsp), %rcx
leaq (%rcx,%rcx,2), %rax
movq 0x88(%rsp), %rdx
cmpq %rax, (%rdx)
jne 0x189561
movq 0x28(%rsp), %rbx
movq $0x0, (%rbx)
leaq (,%rcx,8), %rax
addq 0x10(%rdx), %rax
movq %rax, 0x10(%rsp)
leaq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r15d, %r15d
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %r13
movq %r13, %r14
shrq $0x20, %r14
addq %r12, %rcx
movq %r14, %r8
subq %r12, %r8
movl %r13d, %r12d
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rax
movq %rax, %rdx
shrq $0x20, %rdx
movq 0x18(%rsp), %rsi
addq %rbp, %rsi
subq %rbp, %rdx
movl %eax, %ebp
movq %rbx, %rdi
movq 0x90(%rsp), %r9
movsd 0x9c036(%rip), %xmm0    # 0x2254d0
pushq $0x7ff                  # imm = 0x7FF
pushq $0x2710                 # imm = 0x2710
callq 0x18842e
addq $0x10, %rsp
subl %r14d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0xffff, %ecx           # imm = 0xFFFF
movl %r13d, %r8d
movl $0x1, %r9d
callq 0x18d9ca
movq 0x30(%rsp), %rcx
incq %r15
cmpq %r15, (%rsp)
jne 0x18944e
movq 0x18(%rsp), %rsi
addq %rbp, %rsi
movq 0x80(%rsp), %rdx
subq %rbp, %rdx
addq %r12, %rcx
movq 0x38(%rsp), %r8
subq %r12, %r8
movsd 0x9bfcb(%rip), %xmm0    # 0x2254d0
movq %rbx, %rdi
movq 0x90(%rsp), %r9
jmp 0x189524
movsd 0x9bfb6(%rip), %xmm0    # 0x2254d0
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
pushq $0x7ff                  # imm = 0x7FF
pushq $0x2710                 # imm = 0x2710
callq 0x18842e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa9c0a(%rip), %rdi     # 0x233153
leaq 0xa889b(%rip), %rsi     # 0x231deb
leaq 0xa9c11(%rip), %rcx     # 0x233168
movl $0x15e4, %edx           # imm = 0x15E4
callq 0x2110
leaq 0xa9c7f(%rip), %rdi     # 0x2331e7
leaq 0xa887c(%rip), %rsi     # 0x231deb
leaq 0xa9bf2(%rip), %rcx     # 0x233168
movl $0x1602, %edx           # imm = 0x1602
callq 0x2110