// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: u2g_threading(ul_resolve_t*, ulg_opt_t*, unsigned long, unsigned long, asg64_v*, asg64_v*)
void u2g_threading(ul_resolve_t *uidx, ulg_opt_t *ulopt, uint64_t cov_cutoff, uint64_t is_bridg, asg64_v *b, asg64_v *ub)
{
    renew_ul2_utg(uidx);
    ul2ul_idx_t *idx = &(uidx->uovl); ma_ug_t *iug = idx->i_ug; ma_ug_t *raw = uidx->l1_ug;
    uint64_t k, z, i, t_s, t_e; uinfo_srt_warp_t *seq; 
    usg_t *ng; CALLOC(ng, 1); usg_seq_t *s; usg_arc_warp *sv; usg_arc_t *p; 
    asg_arc_t *av; uint32_t nv, v, w, vx, wx; int64_t tt, tl, tm; 

    ng->mp.n = ng->mp.m = raw->g->n_seq; MALLOC(ng->mp.a, ng->mp.n);
    for (k = 0; k < raw->g->n_seq; k++) {
        s = push_usg_t_node(ng, k); 
        s->mm = k; s->arc[0].n = s->arc[1].n = 0; s->occ = raw->u.a[k].n;
        s->arc_mm[0].n = s->arc_mm[1].n;
        s->del = raw->g->seq[k].del; s->len = raw->g->seq[k].len;
        s->telo = 0; 
        if(uidx->uopt->te) {
            s->telo = gen_utg_telo(&(raw->u.a[k]), uidx->uopt->te);
        }

        av = asg_arc_a(raw->g, (k<<1)); nv = asg_arc_n(raw->g, (k<<1)); sv = &(s->arc[0]);
        for (z = 0; z < nv; z++) {
            if(av[z].del) continue;
            kv_pushp(usg_arc_t, *sv, &p); 
            p->del = 0; p->ou = 0; p->v = av[z].v; p->ol = av[z].ol; p->ul = av[z].ul; p->idx = 0;
        }

        av = asg_arc_a(raw->g, ((k<<1)+1)); nv = asg_arc_n(raw->g, ((k<<1)+1)); sv = &(s->arc[1]);
        for (z = 0; z < nv; z++) {
            if(av[z].del) continue;
            kv_pushp(usg_arc_t, *sv, &p); 
            p->del = 0; p->ou = 0; p->v = av[z].v; p->ol = av[z].ol; p->ul = av[z].ul; p->idx = 0;
        }
        ///map: ng id -> raw id
        ng->mp.a[k].n = ng->mp.a[k].m = 1; MALLOC(ng->mp.a[k].a, 1); ng->mp.a[k].a[0] = k;
    }

    for (k = b->n = 0; k < iug->u.n; k++) {
        seq = &(idx->cc.iug_a[k]);
        if(seq->n <= 1) continue;

        uidx->uovl.iug_seq = seq; uidx->uovl.iug_cov_thre = cov_cutoff;
        for (z = 0; z < uidx->str_b.n_thread; z++) {
            uidx->str_b.buf[z].res_dump.n = 0;
        }
        kt_for(uidx->str_b.n_thread, worker_update_ul_arc_drop, uidx, seq->n-1);///seq->n > 1
        for (z = ub->n = 0; z < uidx->str_b.n_thread; z++) {
            for (i = 0; i < uidx->str_b.buf[z].res_dump.n; i++) {
                kv_push(uint64_t, *ub, uidx->str_b.buf[z].res_dump.a[i]);
            }
        }

        for (z = 0; z < ub->n; z++) {///all unreliable arcs
            i = ub->a[z]; tm = 1; p = get_usg_arc(ng, seq->a[i].v, seq->a[i+1].v);
            if(p) {
                if(p->ou < (uint64_t)tm) p->ou = tm;///since the initial ou is 0, p->ou = 1
                pushp_usg_arc_mm(ng, seq->a[i].v, seq->a[i+1].v, k, i); 

                p = get_usg_arc(ng, seq->a[i+1].v^1, seq->a[i].v^1);
                if(p->ou < (uint64_t)tm) p->ou = tm;///since the initial ou is 0, p->ou = 1
                pushp_usg_arc_mm(ng, seq->a[i+1].v^1, seq->a[i].v^1, k, i); 
            } 
            ///give up unreliable arcs if they are not adjacent
        }

        radix_sort_srt64(ub->a, ub->a + ub->n); 
        if(ub->n == 0 || ub->a[ub->n-1] < seq->n-1) kv_push(uint64_t, *ub, seq->n-1);
        for (z = t_s = t_e = 0; z < ub->n; z++) {
            t_e = ub->a[z];
            if(t_s < t_e) {
                for (i = t_s, tt = seq->a[t_e].n; i < t_e; i++) {
                    tt += seq->a[i].n;///how many HiFi reads are covered
                }
                for (i = t_s, tl = 0; i < t_e; i++) {
                    tl += seq->a[i].n; 
                    tm = tt - tl; if(tm > tl) tm = tl; assert(tm > 0); tm <<= 1; tm += 1;
                    p = get_usg_arc(ng, seq->a[i].v, seq->a[i+1].v);
                    if(p) {
                        if(p->ou < (uint64_t)tm) p->ou = tm;
                        p = get_usg_arc(ng, seq->a[i+1].v^1, seq->a[i].v^1);
                        if(p->ou < (uint64_t)tm) p->ou = tm;
                    } else if(is_bridg) {
                        v = seq->a[i].v; w = seq->a[i+1].v; p = NULL;
                        vx = (v&1?((raw->u.a[v>>1].a[0]>>32)^1):(raw->u.a[v>>1].a[raw->u.a[v>>1].n-1]>>32));
                        wx = (w&1?((raw->u.a[w>>1].a[raw->u.a[w>>1].n-1]>>32)^1):(raw->u.a[w>>1].a[0]>>32));
                        ///(v>>1) != (w>>1) or v == w, need to handle (v>>1) == (w>>1) && (v&1) != (w&1) later
                        if(((v^w) != 1) && (uidx->sg->seq[vx>>1].len > uidx->uopt->min_ovlp) && 
                                (uidx->sg->seq[wx>>1].len > uidx->uopt->min_ovlp)) {
                            kv_pushp(usg_arc_t, (ng->a[v>>1].arc[v&1]), &p); 
                            p->del = 0; p->ou = tm; p->v = w; p->ol = 0; p->idx = 0;
                            p->ul = (((uint64_t)v)<<32)|(raw->g->seq[v>>1].len);

                            v = seq->a[i+1].v^1; w = seq->a[i].v^1; 
                            kv_pushp(usg_arc_t, (ng->a[v>>1].arc[v&1]), &p); 
                            p->del = 0; p->ou = tm; p->v = w; p->ol = 0; p->idx = 0;
                            p->ul = (((uint64_t)v)<<32)|(raw->g->seq[v>>1].len);
                        }
                    }
                    if(p) {
                        pushp_usg_arc_mm(ng, seq->a[i].v, seq->a[i+1].v, k, i); 
                        pushp_usg_arc_mm(ng, seq->a[i+1].v^1, seq->a[i].v^1, k, i); 
                    }
                }
            }
            t_s = ub->a[z] + 1;
        }
    }

    // for (v = 0; v < (ng->n<<1); v++) {
    //     p = usg_arc_a(ng, v); nv = usg_arc_n(ng, v);
    //     for (i = 0; i < nv; i++) {
    //         assert(get_usg_arc(ng, p[i].v^1, v^1));
    //     }
    // }

    usg_cleanup(ng);

    ///debug
    debug_sysm_usg_t(ng, __func__);

    idx->h_usg = ng;

    /******for debug******/
    // prt_usg_t(uidx, ng, "ng0");
    /******for debug******/



    u2g_hybrid_clean(uidx, ulopt, ng, b, ub);
    // idx->hybrid_ug = gen_hybrid_ug(uidx, ng);
    
    
    // idx->hybrid_ug = gen_debug_hybrid_ug(uidx, ng);
    // fprintf(stderr, "-[M::%s::] idx->hybrid_ug->g->n_seq::%u\n", __func__, (uint32_t)idx->hybrid_ug->g->n_seq);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r12
movq %r8, 0x50(%rsp)
movq %rcx, 0x90(%rsp)
movq %rdx, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdi, %r14
callq 0x21c396
movq 0x230(%r14), %rax
movq %rax, 0x58(%rsp)
movq 0x18(%r14), %rbx
movl $0x1, %edi
movl $0x30, %esi
callq 0x2120
movq %rax, %rbp
movq 0x18(%rbx), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x20(%rbp)
movq %rax, 0x18(%rbp)
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x2280
movq %rax, 0x28(%rbp)
movq 0x18(%rbx), %rax
testl $0x7fffffff, 0x14(%rax) # imm = 0x7FFFFFFF
movq %r12, 0x40(%rsp)
movq %r14, (%rsp)
movq %rbp, 0x8(%rsp)
movq %rbx, 0x18(%rsp)
je 0x21bb01
xorl %r14d, %r14d
movq %rbp, %rdi
movq %r14, %rsi
callq 0x20817b
movq %rax, %r15
movl %r14d, (%rax)
xorl %eax, %eax
movq %rax, 0x28(%r15)
movq %rax, 0x10(%r15)
movq 0x10(%rbx), %rcx
leaq (%r14,%r14,4), %rdx
movl 0x10(%rcx,%rdx,8), %eax
movl %eax, 0x4(%r15)
movq 0x58(%r15), %rax
movq %rax, 0x40(%r15)
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rsi
movl (%rsi,%r14,8), %edi
shrl $0x1f, %edi
movb %dil, 0x70(%r15)
movl (%rsi,%r14,8), %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %esi
movl %esi, 0x8(%r15)
movb $0x0, 0x71(%r15)
movq (%rsp), %rsi
movq (%rsi), %rsi
movq 0x70(%rsi), %rdi
testq %rdi, %rdi
movq %rbx, %rbp
je 0x21b914
movl 0x10(%rcx,%rdx,8), %esi
testq %rsi, %rsi
je 0x21b90a
leaq (%rcx,%rdx,8), %rdx
movq 0x10(%rdi), %rcx
movq 0x18(%rdx), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
shrq $0x21, %r8
cmpb $0x0, (%rcx,%r8)
jne 0x21b90e
incq %rdi
cmpq %rdi, %rsi
jne 0x21b8f3
xorl %ecx, %ecx
jmp 0x21b910
movb $0x1, %cl
movb %cl, 0x71(%r15)
movq 0x28(%rax), %rcx
movq %r14, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rcx
movq %rcx, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rdx
je 0x21b9e2
movq 0x8(%rax), %rax
shrq $0x20, %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %r12
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %r13
addq $0xc, %r13
xorl %ebx, %ebx
cmpl $0x0, (%r13,%rbx)
js 0x21b9d5
movq 0x18(%r15), %rax
cmpq %rax, 0x10(%r15)
jne 0x21b989
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x18(%r15)
movq 0x20(%r15), %rdi
shlq $0x5, %rsi
callq 0x2370
movq %rax, 0x20(%r15)
movq 0x10(%r15), %rax
movq 0x20(%r15), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x10(%r15)
shlq $0x5, %rax
andb $0x7f, 0xf(%rcx,%rax)
movl $0x0, 0x10(%rcx,%rax)
movl -0x4(%r13,%rbx), %edx
movl %edx, 0x8(%rcx,%rax)
movl (%r13,%rbx), %edx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %edx
movl %edx, 0xc(%rcx,%rax)
movq -0xc(%r13,%rbx), %rdx
movq %rdx, (%rcx,%rax)
movq $0x0, 0x18(%rcx,%rax)
addq $0x18, %rbx
cmpq %rbx, %r12
jne 0x21b952
leaq (%r14,%r14), %rax
movq 0x18(%rbp), %rdx
movq 0x28(%rdx), %rcx
movq 0x8(%rcx,%rax,8), %rax
movq %rax, %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rcx
je 0x21bab2
movq 0x8(%rdx), %rdx
shrq $0x20, %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %r12
leaq (%rax,%rax,2), %rax
leaq (%rdx,%rax,8), %r13
addq $0xc, %r13
xorl %ebx, %ebx
cmpl $0x0, (%r13,%rbx)
js 0x21baa5
movq 0x30(%r15), %rax
cmpq %rax, 0x28(%r15)
jne 0x21ba59
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x30(%r15)
movq 0x38(%r15), %rdi
shlq $0x5, %rsi
callq 0x2370
movq %rax, 0x38(%r15)
movq 0x28(%r15), %rax
movq 0x38(%r15), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x28(%r15)
shlq $0x5, %rax
andb $0x7f, 0xf(%rcx,%rax)
movl $0x0, 0x10(%rcx,%rax)
movl -0x4(%r13,%rbx), %edx
movl %edx, 0x8(%rcx,%rax)
movl (%r13,%rbx), %edx
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %edx
movl %edx, 0xc(%rcx,%rax)
movq -0xc(%r13,%rbx), %rdx
movq %rdx, (%rcx,%rax)
movq $0x0, 0x18(%rcx,%rax)
addq $0x18, %rbx
cmpq %rbx, %r12
jne 0x21ba22
movq 0x8(%rsp), %rbp
movq 0x28(%rbp), %rbx
leaq (%r14,%r14,2), %r15
movl $0x1, %eax
movq %rax, 0x10(%rbx,%r15,8)
movq %rax, 0x8(%rbx,%r15,8)
movl $0x4, %edi
callq 0x2280
movq %rax, (%rbx,%r15,8)
movl %r14d, (%rax)
incq %r14
movq 0x18(%rsp), %rbx
movq 0x18(%rbx), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r14
movq 0x40(%rsp), %r12
jb 0x21b86f
movq 0x50(%rsp), %rax
movq $0x0, (%rax)
movq 0x58(%rsp), %rax
cmpq $0x0, (%rax)
je 0x21c31a
xorl %ecx, %ecx
movq (%rsp), %rax
movq 0x260(%rax), %rax
movq %rcx, 0x30(%rsp)
leaq (%rcx,%rcx,2), %rdx
movq (%rax,%rdx,8), %rcx
cmpq $0x2, %rcx
jb 0x21c304
leaq (%rax,%rdx,8), %rax
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
movq %rax, 0x298(%rdx)
movq 0x80(%rsp), %rax
movq %rax, 0x2a0(%rdx)
movq 0x1e0(%rdx), %rdi
testq %rdi, %rdi
je 0x21bb97
movq (%rsp), %rax
movq 0x1d8(%rax), %rax
movl $0x300, %edx            # imm = 0x300
addq %rdx, %rax
movq %rdi, %rdx
movq $0x0, (%rax)
addq $0x328, %rax            # imm = 0x328
decq %rdx
jne 0x21bb85
decq %rcx
leaq 0x8a2(%rip), %rsi       # 0x21c443
movq (%rsp), %rbx
movq %rbx, %rdx
callq 0x1047b4
movq $0x0, (%r12)
cmpq $0x0, 0x1e0(%rbx)
je 0x21bc6c
xorl %ebx, %ebx
movq (%rsp), %rax
movq 0x1d8(%rax), %rax
imulq $0x328, %rbx, %r14      # imm = 0x328
cmpq $0x0, 0x300(%rax,%r14)
je 0x21bc58
xorl %r15d, %r15d
movq 0x8(%r12), %rax
cmpq %rax, (%r12)
jne 0x21bc18
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r12)
movq 0x10(%r12), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%r12)
movq (%rsp), %rdi
movq 0x1d8(%rdi), %rax
movq 0x310(%rax,%r14), %rax
movq (%rax,%r15,8), %rax
movq (%r12), %rcx
movq 0x10(%r12), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r12)
movq %rax, (%rdx,%rcx,8)
incq %r15
movq 0x1d8(%rdi), %rax
cmpq 0x300(%rax,%r14), %r15
jb 0x21bbe5
incq %rbx
movq (%rsp), %rax
cmpq 0x1e0(%rax), %rbx
jb 0x21bbc5
movq (%r12), %rax
testq %rax, %rax
je 0x21bd8a
xorl %ebx, %ebx
movq 0x10(%r12), %rax
movq (%rax,%rbx,8), %r15
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %r15, %r14
shlq $0x4, %r14
movl (%rax,%r14), %esi
leaq 0x1(%r15), %r12
shlq $0x4, %r12
movl (%rax,%r12), %edx
movl %esi, %eax
shrl %eax
movl %esi, %ecx
imulq $0x78, %rax, %rax
addq (%rbp), %rax
andl $0x1, %ecx
leaq (%rcx,%rcx,2), %rdi
movl 0x10(%rax,%rdi,8), %ecx
testq %rcx, %rcx
je 0x21bcd5
movq 0x20(%rax,%rdi,8), %rax
cmpl %edx, 0x8(%rax)
je 0x21bcd7
addq $0x20, %rax
decq %rcx
jne 0x21bcc7
xorl %eax, %eax
testq %rax, %rax
je 0x21bd75
cmpl $0x0, 0x10(%rax)
jne 0x21bced
movl $0x1, 0x10(%rax)
movq %rbp, %rdi
movq 0x30(%rsp), %rcx
movl %r15d, %r8d
callq 0x208213
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%r12), %ecx
movq %rcx, %rsi
xorq $0x1, %rsi
movl (%rax,%r14), %edx
xorl $0x1, %edx
shrl %ecx
movl %esi, %eax
andl $0x1, %eax
imulq $0x78, %rcx, %rcx
addq (%rbp), %rcx
leaq (%rax,%rax,2), %rax
movq 0x20(%rcx,%rax,8), %rax
cmpl %edx, 0x8(%rax)
jne 0x21bd39
xorl %ecx, %ecx
jmp 0x21bd4d
leaq 0x28(%rax), %rdi
xorl %ecx, %ecx
incq %rcx
leaq 0x20(%rdi), %r8
cmpl %edx, (%rdi)
movq %r8, %rdi
jne 0x21bd3f
shlq $0x5, %rcx
cmpl $0x0, 0x10(%rax,%rcx)
jne 0x21bd65
addq %rcx, %rax
addq $0x10, %rax
movl $0x1, (%rax)
movq %rbp, %rdi
movq 0x30(%rsp), %rcx
movl %r15d, %r8d
callq 0x208213
incq %rbx
movq 0x40(%rsp), %r12
movq (%r12), %rax
cmpq %rax, %rbx
jb 0x21bc7b
movq 0x10(%r12), %rdi
leaq (%rdi,%rax,8), %rsi
callq 0x1e3b6a
movq (%r12), %rax
testq %rax, %rax
je 0x21bdb8
movq 0x10(%r12), %rcx
movq 0x10(%rsp), %rdx
movq (%rdx), %rdx
decq %rdx
cmpq %rdx, -0x8(%rcx,%rax,8)
jae 0x21be0a
movq 0x8(%r12), %rcx
cmpq %rcx, %rax
jne 0x21bdea
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r12)
movq 0x10(%r12), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x10(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %rax
decq %rax
movq (%r12), %rcx
movq 0x10(%r12), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r12)
movq %rax, (%rdx,%rcx,8)
cmpq $0x0, (%r12)
je 0x21c304
xorl %ecx, %ecx
xorl %r11d, %r11d
movq 0x10(%r12), %rax
movq %rcx, 0x88(%rsp)
movq (%rax,%rcx,8), %rax
movq %rax, 0x48(%rsp)
cmpq %rax, %r11
jae 0x21c2de
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x48(%rsp), %rcx
shlq $0x4, %rcx
movl 0xc(%rax,%rcx), %r13d
movq %r11, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0xc, %rax
movq %r11, %rcx
movl (%rax), %edx
addq %rdx, %r13
incq %rcx
addq $0x10, %rax
cmpq %rcx, 0x48(%rsp)
jne 0x21be61
xorl %ecx, %ecx
movq %r13, 0x98(%rsp)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %r11, %rdi
shlq $0x4, %rdi
movl 0xc(%rax,%rdi), %esi
addq %rcx, %rsi
movq %r13, %rdx
subq %rsi, %rdx
cmpq %rsi, %rdx
movq %rsi, 0xa0(%rsp)
cmovgeq %rsi, %rdx
testq %rdx, %rdx
jle 0x21c377
movq %rdi, 0x70(%rsp)
movl (%rax,%rdi), %ebx
leaq 0x1(%r11), %r12
movq %r12, %rcx
shlq $0x4, %rcx
movq %rcx, 0x68(%rsp)
movl (%rax,%rcx), %r14d
movq (%rbp), %r8
movl %ebx, %ebp
shrl %ebp
movl %ebx, %eax
andl $0x1, %eax
imulq $0x78, %rbp, %rcx
movq %rcx, 0x20(%rsp)
addq %r8, %rcx
leaq (%rax,%rax,2), %r15
movq 0x10(%rcx,%r15,8), %rsi
movq 0x20(%rcx,%r15,8), %rdi
testl %esi, %esi
je 0x21bf0f
movl %esi, %r10d
movq %rdi, %r9
cmpl %r14d, 0x8(%r9)
je 0x21bf12
addq $0x20, %r9
decq %r10
jne 0x21bf00
xorl %r9d, %r9d
leaq 0x1(,%rdx,2), %r10
testq %r9, %r9
je 0x21bf5e
addq %rdx, %rdx
movl 0x10(%r9), %eax
cmpq %rax, %rdx
jb 0x21bf2f
movl %r10d, 0x10(%r9)
movl %r14d, %eax
shrl %eax
notl %r14d
andl $0x1, %r14d
imulq $0x78, %rax, %rax
addq %rax, %r8
leaq (%r14,%r14,2), %rax
movq 0x20(%r8,%rax,8), %rcx
movl 0x8(%rcx), %eax
xorl %ebx, %eax
cmpl $0x1, %eax
movq 0x8(%rsp), %rbp
jne 0x21bf8c
xorl %esi, %esi
jmp 0x21bfa2
cmpq $0x0, 0x90(%rsp)
je 0x21c021
leaq (,%rbp,4), %r8
addq %rbp, %r8
testl %eax, %eax
je 0x21bfb9
movq 0x18(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0x18(%rdx,%r8,8), %rdx
jmp 0x21bfd2
leaq 0x28(%rcx), %rax
xorl %esi, %esi
incq %rsi
movl (%rax), %edi
xorl %ebx, %edi
addq $0x20, %rax
cmpl $0x1, %edi
jne 0x21bf92
shlq $0x5, %rsi
leaq (%rcx,%rsi), %rax
movl 0x10(%rcx,%rsi), %ecx
cmpq %rcx, %rdx
jb 0x21c028
movl %r10d, 0x10(%rax)
jmp 0x21c028
movq 0x18(%rsp), %rdx
movq 0x10(%rdx), %r9
movl 0x10(%r9,%r8,8), %edx
decl %edx
shlq $0x3, %rdx
addq 0x18(%r9,%r8,8), %rdx
movl %r14d, %r8d
shrl %r8d
leaq (%r8,%r8,4), %r9
testb $0x1, %r14b
movq %r10, 0x60(%rsp)
jne 0x21bff7
movq 0x18(%rsp), %r8
movq 0x10(%r8), %r8
movq 0x18(%r8,%r9,8), %r8
jmp 0x21c011
movq 0x18(%rsp), %r8
movq 0x10(%r8), %r10
movl 0x10(%r10,%r9,8), %r8d
decl %r8d
shlq $0x3, %r8
addq 0x18(%r10,%r9,8), %r8
movl %r14d, %r9d
xorl %ebx, %r9d
cmpl $0x1, %r9d
jne 0x21c0a9
xorl %eax, %eax
movq 0x8(%rsp), %rbp
testq %rax, %rax
je 0x21c08e
movq 0x10(%rsp), %r14
movq 0x10(%r14), %rax
movq %r12, 0x20(%rsp)
movq 0x70(%rsp), %r12
movl (%rax,%r12), %esi
movq 0x68(%rsp), %r15
movl (%rax,%r15), %edx
movq %rbp, %rdi
movq 0x30(%rsp), %rbx
movl %ebx, %ecx
movl %r11d, %r8d
movq %r11, %r13
callq 0x208213
movq 0x10(%r14), %rax
movl (%rax,%r15), %esi
xorl $0x1, %esi
movl (%rax,%r12), %edx
movq 0x20(%rsp), %r12
xorl $0x1, %edx
movq %rbp, %rdi
movl %ebx, %ecx
movl %r13d, %r8d
movq 0x98(%rsp), %r13
callq 0x208213
movq %r12, %r11
cmpq 0x48(%rsp), %r12
movq 0xa0(%rsp), %rcx
jne 0x21be7e
jmp 0x21c2de
movq %r11, 0x28(%rsp)
movq (%rdx), %r9
shrq $0x21, %r9
movq (%rsp), %rdx
movq (%rdx), %r10
movq 0x20(%rdx), %rdx
movq 0x20(%rdx), %rdx
movl (%rdx,%r9,8), %r11d
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
andl %r9d, %r11d
movl 0x44(%r10), %r9d
cmpl %r9d, %r11d
jle 0x21c2cd
movq (%r8), %r8
shrq $0x21, %r8
movl (%rdx,%r8,8), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %edx
cmpl %r9d, %edx
movq 0x28(%rsp), %r11
jle 0x21c021
leaq (%rcx,%r15,8), %rdx
addq $0x10, %rdx
movq 0x8(%rdx), %r8
cmpq %r8, %rsi
jne 0x21c15c
leaq (%r8,%r8), %rsi
testq %r8, %r8
movl $0x2, %r8d
cmoveq %r8, %rsi
shll $0x3, %eax
leaq (%rax,%rax,2), %rax
movq %rax, 0x38(%rsp)
movq %rsi, 0x18(%rcx,%rax)
movq 0x8(%rdx), %rsi
shlq $0x5, %rsi
callq 0x2370
movq 0x28(%rsp), %r11
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
addq 0x20(%rsp), %rcx
movq 0x38(%rsp), %rdx
movq %rax, 0x20(%rcx,%rdx)
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq (%rdi), %rsi
movq 0x10(%rsi,%r15,8), %rax
movq 0x20(%rsi,%r15,8), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x10(%rsi,%r15,8)
shlq $0x5, %rax
movq 0x60(%rsp), %rsi
movl %esi, 0x10(%rcx,%rax)
movl %r14d, 0x8(%rcx,%rax)
movl $0x0, 0xc(%rcx,%rax)
movq $0x0, 0x18(%rcx,%rax)
shlq $0x20, %rbx
movq 0x18(%rsp), %rdx
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %rdx
movl (%rdx,%rbp,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
orq %rbx, %rdx
movq %rdx, (%rcx,%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x68(%rsp), %rcx
movl (%rax,%rcx), %r14d
movq %r14, %rbx
xorq $0x1, %rbx
movq 0x70(%rsp), %rcx
movl (%rax,%rcx), %r8d
shrl %r14d
movl %ebx, %eax
andl $0x1, %eax
imulq $0x78, %r14, %r15
movq (%rdi), %rcx
addq %r15, %rcx
leaq (%rax,%rax,2), %rbp
movq 0x18(%rcx,%rbp,8), %rdx
cmpq %rdx, 0x10(%rcx,%rbp,8)
jne 0x21c267
leaq (%rcx,%rbp,8), %rdi
addq $0x10, %rdi
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %edx
cmoveq %rdx, %rsi
shll $0x3, %eax
leaq (%rax,%rax,2), %rax
movq %rax, 0x38(%rsp)
movq %rsi, 0x18(%rcx,%rax)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
shlq $0x5, %rsi
movl %r8d, 0x20(%rsp)
callq 0x2370
movl 0x20(%rsp), %r8d
movq 0x8(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x28(%rsp), %r11
movq (%rdi), %rcx
addq %r15, %rcx
movq 0x38(%rsp), %rdx
movq %rax, 0x20(%rcx,%rdx)
xorl $0x1, %r8d
addq (%rdi), %r15
movq 0x10(%r15,%rbp,8), %rcx
movq 0x20(%r15,%rbp,8), %rdx
leaq 0x1(%rcx), %rax
movq %rax, 0x10(%r15,%rbp,8)
shlq $0x5, %rcx
leaq (%rdx,%rcx), %rax
movl %esi, 0x10(%rdx,%rcx)
movl %r8d, 0x8(%rdx,%rcx)
movl $0x0, 0xc(%rdx,%rcx)
movq $0x0, 0x18(%rdx,%rcx)
shlq $0x20, %rbx
movq 0x18(%rsp), %rsi
movq 0x18(%rsi), %rsi
movq 0x20(%rsi), %rsi
movl (%rsi,%r14,8), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
orq %rbx, %rsi
movq %rsi, (%rdx,%rcx)
movq %rdi, %rbp
jmp 0x21c028
xorl %eax, %eax
movq 0x8(%rsp), %rbp
movq 0x28(%rsp), %r11
jmp 0x21c028
movq 0x40(%rsp), %r12
movq 0x10(%r12), %rax
movq 0x88(%rsp), %rcx
movq (%rax,%rcx,8), %r11
incq %r11
incq %rcx
cmpq (%r12), %rcx
jb 0x21be1a
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x58(%rsp), %rax
cmpq (%rax), %rcx
jb 0x21bb1e
leaq 0x6e437(%rip), %rax     # 0x28a758
movl 0x7c(%rax), %edi
movq 0x8(%rbp), %rcx
leaq -0x14047(%rip), %rsi    # 0x2082e8
movq %rbp, %rdx
callq 0x1047b4
leaq 0x219cb(%rip), %rsi     # 0x23dd09
movq %rbp, %rdi
callq 0x20e650
movq (%rsp), %rdi
movq %rbp, 0x240(%rdi)
movq 0x78(%rsp), %rsi
movq %rbp, %rdx
movq 0x50(%rsp), %rcx
movq %r12, %r8
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b324
leaq 0x2192a(%rip), %rdi     # 0x23dca8
leaq 0x1cfa0(%rip), %rsi     # 0x239325
leaq 0x21923(%rip), %rcx     # 0x23dcaf
movl $0x3f5c, %edx           # imm = 0x3F5C
callq 0x2110