// File: 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
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq 0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x108(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x265365
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x108(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %esi
leaq -0x10e(%rbp), %rdx
leaq -0x110(%rbp), %rcx
leaq -0x112(%rbp), %r8
leaq -0x10c(%rbp), %r9
callq 0x1b53f0
movl %eax, %eax
movq %rax, -0x40(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x2, %eax
je 0x2651f3
movl -0x10c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x3, %eax
je 0x26520d
movl -0x10c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x0, %eax
je 0x26522e
jmp 0x265181
jmp 0x265230
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2652a1
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x265260
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x128(%rbp)
jmp 0x26526e
movl $0x2, %eax
movq %rax, -0x128(%rbp)
jmp 0x26526e
movq -0x128(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x60(%rbp), %rdx
shlq %rdx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2652c7
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x265338
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2652f7
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x130(%rbp)
jmp 0x265305
movl $0x2, %eax
movq %rax, -0x130(%rbp)
jmp 0x265305
movq -0x130(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rdx
shlq %rdx
orq $0x1, %rdx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x265181
movq -0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x108(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x26558c
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x108(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %esi
leaq -0x10e(%rbp), %rdx
leaq -0x110(%rbp), %rcx
leaq -0x112(%rbp), %r8
leaq -0x10c(%rbp), %r9
callq 0x1b53f0
movl %eax, %eax
movq %rax, -0x40(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x2, %eax
je 0x26541a
movl -0x10c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x3, %eax
je 0x265434
movl -0x10c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x0, %eax
je 0x265455
jmp 0x2653a8
jmp 0x265457
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2654c8
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x265487
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x138(%rbp)
jmp 0x265495
movl $0x2, %eax
movq %rax, -0x138(%rbp)
jmp 0x265495
movq -0x138(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x70(%rbp), %rdx
shlq %rdx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2654ee
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x26555f
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x26551e
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x140(%rbp)
jmp 0x26552c
movl $0x2, %eax
movq %rax, -0x140(%rbp)
jmp 0x26552c
movq -0x140(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x68(%rbp), %rdx
shlq %rdx
orq $0x1, %rdx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2653a8
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq 0x18(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x24aba0
movq $0x0, -0x38(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x80(%rbp)
movq $-0x1, -0x88(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2656dc
movq -0x80(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x265621
movq -0x80(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x26562d
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
cmpq $0x2, -0x78(%rbp)
jb 0x26569d
cmpq $-0x1, -0x88(%rbp)
je 0x26569d
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
jbe 0x26569b
movq -0x88(%rbp), %rdx
shlq $0x20, %rdx
orq -0x90(%rbp), %rdx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x98(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x26569d
movq $-0x1, -0x88(%rbp)
cmpq $0x2, -0x80(%rbp)
jb 0x2656c9
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq %rax
movq %rax, -0x88(%rbp)
jmp 0x2656cb
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2655e0
cmpq $0x0, -0x98(%rbp)
jbe 0x265f89
movq -0x98(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq -0x108(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2659f5
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x108(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %esi
leaq -0x10e(%rbp), %rdx
leaq -0x110(%rbp), %rcx
leaq -0x112(%rbp), %r8
leaq -0x10c(%rbp), %r9
callq 0x1b53f0
movl %eax, %eax
movq %rax, -0x40(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x2, %eax
je 0x2657b5
movl -0x10c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x3, %eax
je 0x2657cf
movl -0x10c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x0, %eax
je 0x2657f0
jmp 0x265743
movq -0x60(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xb0(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x38(%rbp)
movb %al, -0x141(%rbp)
jbe 0x265863
movq -0x38(%rbp), %rcx
movb $0x1, %al
cmpq -0x98(%rbp), %rcx
movb %al, -0x142(%rbp)
jae 0x265857
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
cmpq -0xa0(%rbp), %rax
seta %al
movb %al, -0x142(%rbp)
movb -0x142(%rbp), %al
movb %al, -0x141(%rbp)
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0x26586f
jmp 0x26587f
jmp 0x265871
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x265811
jmp 0x265881
movq -0x38(%rbp), %rax
cmpq -0x98(%rbp), %rax
jae 0x2659f0
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jb 0x2658db
jmp 0x2659f0
movq -0x88(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jb 0x2659dd
movq -0x90(%rbp), %rax
cmpq -0xa8(%rbp), %rax
ja 0x2659dd
movq -0xb0(%rbp), %rax
addq -0x88(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rax
addq -0x90(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2659ac
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x26596b
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x150(%rbp)
jmp 0x265979
movl $0x2, %eax
movq %rax, -0x150(%rbp)
jmp 0x265979
movq -0x150(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb8(%rbp), %rdx
shlq $0x20, %rdx
orq -0xc0(%rbp), %rdx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2659dd
jmp 0x2659df
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x265881
jmp 0x265743
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq -0x98(%rbp), %rcx
shlq %rcx
cmpq %rcx, %rax
jne 0x265a0d
jmp 0x265a2c
leaq 0x12a56e(%rip), %rdi    # 0x38ff82
leaq 0x1291f0(%rip), %rsi    # 0x38ec0b
movl $0x15e4, %edx           # imm = 0x15E4
leaq 0x12a570(%rip), %rcx    # 0x38ff97
callq 0x2130
movq -0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq -0x108(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x265d29
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x108(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %esi
leaq -0x10e(%rbp), %rdx
leaq -0x110(%rbp), %rcx
leaq -0x112(%rbp), %r8
leaq -0x10c(%rbp), %r9
callq 0x1b53f0
movl %eax, %eax
movq %rax, -0x40(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x2, %eax
je 0x265ae9
movl -0x10c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x3, %eax
je 0x265b03
movl -0x10c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movzwl -0x10e(%rbp), %eax
cmpl $0x0, %eax
je 0x265b24
jmp 0x265a77
movq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xb0(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x38(%rbp)
movb %al, -0x151(%rbp)
jbe 0x265b97
movq -0x38(%rbp), %rcx
movb $0x1, %al
cmpq -0x98(%rbp), %rcx
movb %al, -0x152(%rbp)
jae 0x265b8b
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
cmpq -0xa0(%rbp), %rax
seta %al
movb %al, -0x152(%rbp)
movb -0x152(%rbp), %al
movb %al, -0x151(%rbp)
movb -0x151(%rbp), %al
testb $0x1, %al
jne 0x265ba3
jmp 0x265bb3
jmp 0x265ba5
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x265b45
jmp 0x265bb5
movq -0x38(%rbp), %rax
cmpq -0x98(%rbp), %rax
jae 0x265d24
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x88(%rbp)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jb 0x265c0f
jmp 0x265d24
movq -0x88(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jb 0x265d11
movq -0x90(%rbp), %rax
cmpq -0xa8(%rbp), %rax
ja 0x265d11
movq -0xb0(%rbp), %rax
addq -0x88(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rax
addq -0x90(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x265ce0
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x265c9f
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x160(%rbp)
jmp 0x265cad
movl $0x2, %eax
movq %rax, -0x160(%rbp)
jmp 0x265cad
movq -0x160(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb8(%rbp), %rdx
shlq $0x20, %rdx
orq -0xc0(%rbp), %rdx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x265d11
jmp 0x265d13
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x265bb5
jmp 0x265a77
movq 0x18(%rbp), %rax
movq (%rax), %rax
imulq $0x3, -0x98(%rbp), %rcx
cmpq %rcx, %rax
jne 0x265d3f
jmp 0x265d5e
leaq 0x12a2d0(%rip), %rdi    # 0x390016
leaq 0x128ebe(%rip), %rsi    # 0x38ec0b
movl $0x1602, %edx           # imm = 0x1602
leaq 0x12a23e(%rip), %rcx    # 0x38ff97
callq 0x2130
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x98(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq $0x0, -0x120(%rbp)
movq $0x0, -0x100(%rbp)
movq $0x0, -0xf8(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x98(%rbp), %rax
jae 0x265f19
movq -0xc8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0xd8(%rbp)
movq -0xc8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0xe0(%rbp)
movq -0xd0(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0xe8(%rbp)
movq -0xd0(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0xf0(%rbp)
movq -0xd8(%rbp), %rax
subq -0xe0(%rbp), %rax
addq -0x120(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq -0x100(%rbp), %rsi
movq -0xe8(%rbp), %rdx
subq -0x100(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq -0xf8(%rbp), %rcx
movq -0xd8(%rbp), %r8
subq -0xf8(%rbp), %r8
movq 0x20(%rbp), %r9
movsd 0x11c3a3(%rip), %xmm0   # 0x382250
movq $0x2710, (%rsp)         # imm = 0x2710
movq $0x7ff, 0x8(%rsp)       # imm = 0x7FF
callq 0x264810
movq -0x18(%rbp), %rdi
movq -0xe0(%rbp), %rax
subq -0xd8(%rbp), %rax
movl %eax, %r8d
xorl %esi, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r9d
movl %ecx, %edx
callq 0x26d790
movq -0xe0(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x265dda
movq -0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq -0x100(%rbp), %rsi
movq -0xe8(%rbp), %rdx
subq -0x100(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq -0xf8(%rbp), %rcx
movq -0xd8(%rbp), %r8
subq -0xf8(%rbp), %r8
movq 0x20(%rbp), %r9
movsd 0x11c2df(%rip), %xmm0   # 0x382250
movq $0x2710, (%rsp)         # imm = 0x2710
movq $0x7ff, 0x8(%rsp)       # imm = 0x7FF
callq 0x264810
jmp 0x265fbf
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq 0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq 0x20(%rbp), %r9
movsd 0x11c2a7(%rip), %xmm0   # 0x382250
movq $0x2710, (%rsp)         # imm = 0x2710
movq $0x7ff, 0x8(%rsp)       # imm = 0x7FF
callq 0x264810
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax,%rax)