// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: update_usg_t_threading_0(ul_resolve_t*, usg_t*, unsigned long*, unsigned long, unsigned int*, asg64_v*)
void update_usg_t_threading_0(ul_resolve_t *uidx, usg_t *ng, uint64_t *a, uint64_t a_n, uint32_t *occ, asg64_v *b)
{
    uint64_t k, i, *p, nid, nnid, v, w; b->n = 0; usg_seq_t *s; 

    // fprintf(stderr, "[M::%s::] a_n::%lu\n", __func__, a_n);
    // for (k = 0; k < a_n; k++) {
    //     fprintf(stderr, "utg%.6dl(%c)(hom::%u)\t", (int32_t)(a[k]>>1)+1, "+-"[a[k]&1], (IF_HOM((a[k]>>1), (*(uidx->bub)))));
    // }
    // fprintf(stderr, "\n");

    assert(a_n > 1); 
    assert(occ[a[0]] == 1); 
    kv_pushp(uint64_t, *b, &p); (*p) = a[0]; (*p) <<= 32; (*p) |= a[0]; occ[a[0]]--; 
    
    for (k = 1; k + 1 < a_n; k++) {
        assert(occ[a[k]] == occ[a[k]^1]); assert(occ[a[k]] > 0);
        if(occ[a[k]] > 1) {///copy a node
            nid = a[k]>>1; nnid = ng->n;
            kv_push(uint32_t, ng->mp.a[ng->a[nid].mm], nnid);
            s = push_usg_t_node(ng, nnid); 
            s->mm = ng->a[nid].mm; s->occ = ng->a[nid].occ; s->len = ng->a[nid].len; s->telo = ng->a[nid].telo; s->del = 0;
            s->arc[0].n = s->arc[1].n = 0; s->arc_mm[0].n = s->arc_mm[1].n = 0;
            nnid <<= 1; nnid |= a[k]&1;
            kv_pushp(uint64_t, *b, &p); (*p) = a[k]^1; (*p) <<= 32; (*p) |= nnid^1;
            kv_pushp(uint64_t, *b, &p); (*p) = a[k]; (*p) <<= 32; (*p) |= nnid;
        } else {
            kv_pushp(uint64_t, *b, &p); (*p) = a[k]^1; (*p) <<= 32; (*p) |= a[k]^1;
            kv_pushp(uint64_t, *b, &p); (*p) = a[k]; (*p) <<= 32; (*p) |= a[k];
        }
        occ[a[k]]--; occ[a[k]^1]--;
    }
    // if(occ[a[a_n-1]^1] != 1) {
    //     fprintf(stderr, "[M::%s] utg%.6dl(%c)(occ::%u)\n", __func__,
    //             (int32_t)((a[a_n-1]^1)>>1)+1, "+-"[(a[a_n-1]^1)&1], occ[a[a_n-1]^1]);
    // }
    assert(occ[a[a_n-1]^1] == 1); 
    kv_pushp(uint64_t, *b, &p); (*p) = a[a_n-1]^1; (*p) <<= 32; (*p) |= a[a_n-1]^1; occ[a[a_n-1]^1]--; 
    
    for (k = 0; k < b->n; k += 2) {
        v = b->a[k]; w = b->a[k+1];
        if(((v>>32) == ((uint32_t)v)) && ((w>>32) == ((uint32_t)w))) continue;//no need arc
        remap_gen_arcs(ng, v>>32, (w>>32)^1, ((uint32_t)v), ((uint32_t)w)^1);///v>>32: old id; ((uint32_t)v): new id
        remap_gen_arcs(ng, w>>32, (v>>32)^1, ((uint32_t)w), ((uint32_t)v)^1);
    }

    // usg_arc_t *z = get_usg_arc(ng, 220, 157075), *q = get_usg_arc(ng, 157074, 221);
    // fprintf(stderr, "\n+[M::%s::a_n->%lu] p->del::%u, q->del::%u\n", 
    //             __func__, a_n, z?z->del:1, q?q->del:1);

    usg_arc_t *av, *aw, *z; uint32_t kv, kw, nv, nw, v0, v1, w0, w1;
    for (k = 0; k < b->n; k += 2) {
        v0 = b->a[k]>>32; v1 = (uint32_t)b->a[k];
        w0 = b->a[k+1]>>32; w1 = (uint32_t)b->a[k+1];

        av = usg_arc_a(ng, v1); nv = usg_arc_n(ng, v1);
        for (i = kv = 0; i < nv; i++) {
            if(av[i].v == (w1^1)) {
                av[i].del = 0; kv++;
            } else if(av[i].del == 0) {
                av[i].del = 1;
                z = get_usg_arc(ng, av[i].v^1, (av[i].ul>>32)^1); 
                // if(!(z && (!z->del))) {
                //     fprintf(stderr, "[M::%s::] z::%u, z->del::%u\n", __func__, z?1:0, z?z->del:1);
                //     fprintf(stderr, "[M::%s::arc] utg%.6dl(%c)->utg%.6dl(%c)\n", 
                //                                     __func__, (int32_t)(av[i].ul>>33)+1, "+-"[(av[i].ul>>32)&1], 
                //                                               (int32_t)(av[i].v>>1)+1, "+-"[(av[i].v)&1]);
                //     fprintf(stderr, "[M::%s::new] utg%.6dl(%c)->utg%.6dl(%c)\n", 
                //                                     __func__, (int32_t)(v1>>1)+1, "+-"[v1&1], 
                //                                               (int32_t)(w1>>1)+1, "+-"[w1&1]);
                //     fprintf(stderr, "[M::%s::old] utg%.6dl(%c)->utg%.6dl(%c)\n", 
                //                                     __func__, (int32_t)(v0>>1)+1, "+-"[v0&1], 
                //                                               (int32_t)(w0>>1)+1, "+-"[w0&1]);
                // }
                assert(z && (!z->del)); z->del = 1;
            }
        }
        assert(kv == 1);
        
        aw = usg_arc_a(ng, w1); nw = usg_arc_n(ng, w1);
        for (i = kw = 0; i < nw; i++) {
            if(aw[i].v == (v1^1)) {
                aw[i].del = 0; kw++;
            } else if(aw[i].del == 0) {
                aw[i].del = 1;
                z = get_usg_arc(ng, aw[i].v^1, (aw[i].ul>>32)^1); 
                assert(z && (!z->del)); z->del = 1;
            }
        }
        assert(kw == 1);

        if(v0 == v1 && w0 == w1) continue;

        av = usg_arc_a(ng, v0); nv = usg_arc_n(ng, v0);
        for (i = 0; i < nv; i++) {
            if(av[i].v == (w0^1)) {
                av[i].del = 1; break;
            }
        }
        assert(i < nv);

        aw = usg_arc_a(ng, w0); nw = usg_arc_n(ng, w0);
        for (i = 0; i < nw; i++) {
            if(aw[i].v == (v0^1)) {
                aw[i].del = 1; break;
            }
        }
        assert(i < nw);
    }

    // z = get_usg_arc(ng, 220, 157075), q = get_usg_arc(ng, 157074, 221);
    // fprintf(stderr, "-[M::%s::a_n->%lu] p->del::%u, q->del::%u\n", 
    //             __func__, a_n, z?z->del:1, q?q->del:1);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
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 -0x30(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x1, -0x20(%rbp)
jbe 0x358927
jmp 0x358946
leaq 0x40e27(%rip), %rdi     # 0x399755
leaq 0x3d884(%rip), %rsi     # 0x3961b9
movl $0x305d, %edx           # imm = 0x305D
leaq 0x40e1c(%rip), %rcx     # 0x39975d
callq 0x2130
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x358959
jmp 0x358978
leaq 0x40e61(%rip), %rdi     # 0x3997c1
leaq 0x3d852(%rip), %rsi     # 0x3961b9
movl $0x305e, %edx           # imm = 0x305E
leaq 0x40dea(%rip), %rcx     # 0x39975d
callq 0x2130
jmp 0x35897a
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3589eb
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x3589aa
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xb0(%rbp)
jmp 0x3589b8
movl $0x2, %eax
movq %rax, -0xb0(%rbp)
jmp 0x3589b8
movq -0xb0(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq $0x1, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
cmpq -0x20(%rbp), %rax
jae 0x359122
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
xorq $0x1, %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x358a98
jmp 0x358ab7
leaq 0x40d31(%rip), %rdi     # 0x3997d0
leaq 0x3d713(%rip), %rsi     # 0x3961b9
movl $0x3062, %edx           # imm = 0x3062
leaq 0x40cab(%rip), %rcx     # 0x39975d
callq 0x2130
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x0, (%rax,%rcx,4)
jbe 0x358acf
jmp 0x358aee
leaq 0x40d13(%rip), %rdi     # 0x3997e9
leaq 0x3d6dc(%rip), %rsi     # 0x3961b9
movl $0x3062, %edx           # imm = 0x3062
leaq 0x40c74(%rip), %rcx     # 0x39975d
callq 0x2130
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl $0x1, (%rax,%rcx,4)
jbe 0x358f39
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x78, -0x50(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x78, -0x50(%rbp), %rsi
addq %rsi, %rdx
movl (%rdx), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x10(%rcx), %rax
jne 0x358c7b
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x78, -0x50(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
je 0x358bcc
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x78, -0x50(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0xb8(%rbp)
jmp 0x358bda
movl $0x2, %eax
movq %rax, -0xb8(%rbp)
jmp 0x358bda
movq -0xb8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x78, -0x50(%rbp), %rsi
addq %rsi, %rdx
movl (%rdx), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x78, -0x50(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x78, -0x50(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x78, -0x50(%rbp), %rsi
addq %rsi, %rdx
movl (%rdx), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x78, -0x50(%rbp), %rsi
addq %rsi, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x78, -0x50(%rbp), %rdi
addq %rdi, %rcx
movl (%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rsi
movq 0x8(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x8(%rsi)
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x34d480
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x78, -0x50(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x70(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x78, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x70(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x78, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x70(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x78, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x71(%rax), %cl
movq -0x70(%rbp), %rax
movb %cl, 0x71(%rax)
movq -0x70(%rbp), %rax
movb $0x0, 0x70(%rax)
movq -0x70(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x70(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x70(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x70(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x58(%rbp), %rax
shlq %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
orq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x358e15
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x358dd4
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xc0(%rbp)
jmp 0x358de2
movl $0x2, %eax
movq %rax, -0xc0(%rbp)
jmp 0x358de2
movq -0xc0(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
xorq $0x1, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
xorq $0x1, %rcx
movq -0x48(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x358ee1
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x358ea0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xc8(%rbp)
jmp 0x358eae
movl $0x2, %eax
movq %rax, -0xc8(%rbp)
jmp 0x358eae
movq -0xc8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
movq -0x48(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x3590db
jmp 0x358f3b
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x358fac
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x358f6b
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xd0(%rbp)
jmp 0x358f79
movl $0x2, %eax
movq %rax, -0xd0(%rbp)
jmp 0x358f79
movq -0xd0(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
xorq $0x1, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
xorq $0x1, %rcx
movq -0x48(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x359080
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x35903f
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xd8(%rbp)
jmp 0x35904d
movl $0x2, %eax
movq %rax, -0xd8(%rbp)
jmp 0x35904d
movq -0xd8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x48(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
xorq $0x1, %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x358a58
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
xorq $0x1, %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x359142
jmp 0x359161
leaq 0x406ae(%rip), %rdi     # 0x3997f7
leaq 0x3d069(%rip), %rsi     # 0x3961b9
movl $0x3076, %edx           # imm = 0x3076
leaq 0x40601(%rip), %rcx     # 0x39975d
callq 0x2130
jmp 0x359163
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3591d4
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x359193
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xe0(%rbp)
jmp 0x3591a1
movl $0x2, %eax
movq %rax, -0xe0(%rbp)
jmp 0x3591a1
movq -0xe0(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
xorq $0x1, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
xorq $0x1, %rcx
movq -0x48(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
xorq $0x1, %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x35933f
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
shrq $0x20, %rax
movq -0x60(%rbp), %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x3592ca
movq -0x68(%rbp), %rax
shrq $0x20, %rax
movq -0x68(%rbp), %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x3592ca
jmp 0x35932e
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rax
shrq $0x20, %rax
movl %eax, %esi
movq -0x68(%rbp), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
movq -0x60(%rbp), %rax
movl %eax, %ecx
movq -0x68(%rbp), %rax
movl %eax, %r8d
xorl $0x1, %r8d
callq 0x3531e0
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
shrq $0x20, %rax
movl %eax, %esi
movq -0x60(%rbp), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
movq -0x68(%rbp), %rax
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %eax, %r8d
xorl $0x1, %r8d
callq 0x3531e0
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
jmp 0x359268
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x359a24
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x9c(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0xa0(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0xa4(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movl %eax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0xa0(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0xa0(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0xa0(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0xa0(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x94(%rbp)
movl $0x0, -0x8c(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x94(%rbp), %ecx
cmpq %rcx, %rax
jae 0x3595a5
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0xa8(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x35949d
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0xc(%rax)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x359592
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x359590
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
callq 0x37d400
movq %rax, -0x88(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x88(%rbp)
movb %al, -0xe1(%rbp)
je 0x35954a
movq -0x88(%rbp), %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0xe1(%rbp)
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x359556
jmp 0x359558
jmp 0x359577
leaq 0x402ad(%rip), %rdi     # 0x39980c
leaq 0x3cc53(%rip), %rsi     # 0x3961b9
movl $0x309c, %edx           # imm = 0x309C
leaq 0x401eb(%rip), %rcx     # 0x39975d
callq 0x2130
movq -0x88(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
jmp 0x359592
jmp 0x359594
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x359439
cmpl $0x1, -0x8c(%rbp)
jne 0x3595b0
jmp 0x3595cf
leaq 0x40264(%rip), %rdi     # 0x39981b
leaq 0x3cbfb(%rip), %rsi     # 0x3961b9
movl $0x309f, %edx           # imm = 0x309F
leaq 0x40193(%rip), %rcx     # 0x39975d
callq 0x2130
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0xa8(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0xa8(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0xa8(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0xa8(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x98(%rbp)
movl $0x0, -0x90(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x98(%rbp), %ecx
cmpq %rcx, %rax
jae 0x3597ba
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0xa0(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3596b2
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0xc(%rax)
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x3597a7
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x3597a5
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
callq 0x37d400
movq %rax, -0x88(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x88(%rbp)
movb %al, -0xe2(%rbp)
je 0x35975f
movq -0x88(%rbp), %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0xe2(%rbp)
movb -0xe2(%rbp), %al
testb $0x1, %al
jne 0x35976b
jmp 0x35976d
jmp 0x35978c
leaq 0x40098(%rip), %rdi     # 0x39980c
leaq 0x3ca3e(%rip), %rsi     # 0x3961b9
movl $0x30a8, %edx           # imm = 0x30A8
leaq 0x3ffd6(%rip), %rcx     # 0x39975d
callq 0x2130
movq -0x88(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
jmp 0x3597a7
jmp 0x3597a9
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x35964e
cmpl $0x1, -0x90(%rbp)
jne 0x3597c5
jmp 0x3597e4
leaq 0x40057(%rip), %rdi     # 0x399823
leaq 0x3c9e6(%rip), %rsi     # 0x3961b9
movl $0x30ab, %edx           # imm = 0x30AB
leaq 0x3ff7e(%rip), %rcx     # 0x39975d
callq 0x2130
movl -0x9c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jne 0x359805
movl -0xa4(%rbp), %eax
cmpl -0xa8(%rbp), %eax
jne 0x359805
jmp 0x359a13
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x9c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0x9c(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x9c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0x9c(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x94(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x94(%rbp), %ecx
cmpq %rcx, %rax
jae 0x3598db
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0xa4(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3598cb
movq -0x78(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
jmp 0x3598db
jmp 0x3598cd
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x35987a
movq -0x40(%rbp), %rax
movl -0x94(%rbp), %ecx
cmpq %rcx, %rax
jae 0x3598ec
jmp 0x35990b
leaq 0x2d3d7(%rip), %rdi     # 0x386cca
leaq 0x3c8bf(%rip), %rsi     # 0x3961b9
movl $0x30b5, %edx           # imm = 0x30B5
leaq 0x3fe57(%rip), %rcx     # 0x39975d
callq 0x2130
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0xa4(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0xa4(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0xa4(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0xa4(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x98(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x98(%rbp), %ecx
cmpq %rcx, %rax
jae 0x3599e1
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x9c(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3599d1
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
jmp 0x3599e1
jmp 0x3599d3
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x359980
movq -0x40(%rbp), %rax
movl -0x98(%rbp), %ecx
cmpq %rcx, %rax
jae 0x3599f2
jmp 0x359a11
leaq 0x3fe32(%rip), %rdi     # 0x39982b
leaq 0x3c7b9(%rip), %rsi     # 0x3961b9
movl $0x30bd, %edx           # imm = 0x30BD
leaq 0x3fd51(%rip), %rcx     # 0x39975d
callq 0x2130
jmp 0x359a13
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
jmp 0x359347
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)