// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_unique_g_adv(ul_resolve_t*, usg_t*, unsigned long*, unsigned long, unsigned long*, unsigned int)
uint64_t gen_unique_g_adv(ul_resolve_t *uidx, usg_t *ng, uint64_t *int_idx, uint64_t int_idx_n, uint64_t *int_a, uint32_t max_ext)
{
    uint64_t pi, ei, *pz, bn, a_n, ua_n, *r_a, r_n; uint8_t *ff; CALLOC(ff, ng->n<<1);
    uint32_t i, k, n_vtx = ng->n<<1, s, e, zs, ze, v, b64_n; 
    uint32_t *ng_occ; CALLOC(ng_occ, n_vtx); 
    asg64_v b64, ub64; kv_init(b64); kv_init(ub64); 
    uint64_t *i_idx, n_clus; CALLOC(i_idx, ng->n<<1);
    
    for (k = 0; k < int_idx_n; k++) {///scan all integer contigs
        r_a = int_a + (int_idx[k]>>32); r_n = (uint32_t)int_idx[k];
        assert(r_n >= 2);
        for (i = 1; i + 1 < r_n; i++) {
            ng_occ[r_a[i]]++; ng_occ[r_a[i]^1]++;
        }
        ng_occ[r_a[0]]++; ng_occ[r_a[r_n-1]^1]++;
    }

    ma_ug_t *un_g = ma_ug_hybrid_gen(ng); ma_utg_t *u;
    // print_debug_gfa(uidx->sg, un_g, uidx->uopt->coverage_cut, "iig0", uidx->uopt->sources, 
    // uidx->uopt->ruIndex, uidx->uopt->max_hang, uidx->uopt->min_ovlp, 0, 0, 0);
    int32_t ui, un;
    for (k = 0; k < un_g->u.n; k++) {///all unitigs of raw utg 
        u = &(un_g->u.a[k]); 
        zs = ze = (uint32_t)-1; un = u->n;
        for (ui = 0; ui < un; ui++) {
            if(occ_m(ng_occ[(u->a[ui]>>32)^1]) == 1) {
                zs = ui; break;
            }
        }

        for (ui = ((int32_t)un)-1; ui >= 0; ui--) {
            if(occ_m(ng_occ[u->a[ui]>>32]) == 1) {
                ze = ui; break;
            }
        }
        if(zs != (uint32_t)-1 && ze != (uint32_t)-1 && zs > ze) continue;
        if(zs != (uint32_t)-1) ng_occ[(u->a[zs]>>32)^1] |= ((uint32_t)0x80000000);
        if(ze != (uint32_t)-1) ng_occ[(u->a[ze]>>32)] |= ((uint32_t)0x80000000);
    }
    ma_ug_destroy(un_g);
    
    // fprintf(stderr, ">>>>>>[M::%s::] int_idx[0]::%lu, int_idx[1]::%lu\n", __func__, int_idx[0], int_idx[1]);
    // prt_intg_info(int_idx, int_idx_n, int_a, "intg");
    for (i = b64.n = ua_n = a_n = 0; i < int_idx_n; i++) {///scan all integer contigs
        s = int_idx[i]>>32; e = s + ((uint32_t)int_idx[i]); 
        assert(e > s + 1);//the length is at least 2
        for (k = s, bn = b64.n, pi = (uint64_t)-1; k < e; k++) {
            v = int_a[k]; 
            if((!(ng_occ[v]&((uint32_t)0x80000000)))&&(!(ng_occ[v^1]&((uint32_t)0x80000000)))) {
                continue;///it must be a unique node
            }
            if((pi != (uint64_t)-1) && (ng_occ[v^1]&((uint32_t)0x80000000))) {
                // fprintf(stderr, "+++[M::%s::i->%u::s->%u::e->%u] pi::%lu, k::%u\n", __func__, i, s, e, pi, k);
                pz = (b64.n>0)? &(b64.a[b64.n-1]):(NULL);
                if((!pz) || (((*pz)>>32) != pi)) {//keep the shortest pi<->k 
                    kv_pushp(uint64_t, b64, &pz); 
                    *pz = pi; (*pz) <<= 32; (*pz) |= k;
                    a_n++;
                }
            }
            if(ng_occ[v]&((uint32_t)0x80000000)) pi = k;//keep the shortest pi<->k
        }

        b64_n = b64.n;
        for (k = bn, pi = s; k < b64_n; k++) {
            ei = b64.a[k]>>32;
            if(pi < ei) {
                kv_pushp(uint64_t, b64, &pz); ua_n++;
                (*pz) = pi; (*pz) <<= 32; (*pz) |= ei; (*pz) |= ((uint64_t)0x8000000000000000);
            }
            pi = (uint32_t)b64.a[k];
        }

        ei = e - 1;
        if(pi < ei) {
            kv_pushp(uint64_t, b64, &pz); ua_n++;
            (*pz) = pi; (*pz) <<= 32; (*pz) |= ei; (*pz) |= ((uint64_t)0x8000000000000000);
        }
    }
    assert(a_n + ua_n == b64.n);
    // prt_thread_info(b64.a, a_n+ua_n, NULL, 0, "tt_minus");
    // fprintf(stderr, "**0**[M::%s::] a_n::%lu, ua_n::%lu\n", __func__, a_n, ua_n);
    radix_sort_srt64(b64.a, b64.a + b64.n);///keeps the coordinates within int_a[]

    for (i = a_n; i < b64.n; i++) {///unavailable intervals; mask all unavailable nodes
        assert(b64.a[i]&((uint64_t)0x8000000000000000)); ua_n--;
        s = (b64.a[i]<<1)>>33; e = (uint32_t)b64.a[i]; assert(e > s);//[s, e]
        for (k = s + 1; k < e; k++) {///note: here is [s, e]
            i_idx[int_a[k]] |= ((uint64_t)0x8000000000000000);
            i_idx[int_a[k]^1] |= ((uint64_t)0x8000000000000000);
        }
        i_idx[int_a[s]] |= ((uint64_t)0x8000000000000000);
        i_idx[int_a[e]^1] |= ((uint64_t)0x8000000000000000);
    }
    // prt_thread_info(b64.a, a_n, NULL, 0, "tt1");
    ///unavailable intervals are useless
    b64.n = a_n; assert(ua_n == 0);
    for (i = 0; i < a_n; i++) { ///available intervals
        s = b64.a[i]>>32; e = (uint32_t)b64.a[i]; assert(e > s);///[s, e] -> coordinates within int_a[]
        assert(!(b64.a[i]&((uint64_t)0x8000000000000000)));

        for (k = s + 1; k < e; k++) {///note: here is [s, e]; s && e are unique, but [s+1, e-1] are not unique
            kv_pushp(uint64_t, b64, &pz); //i_idx[int_a[k]]++;
            (*pz) = int_a[k]; (*pz) <<= 32; (*pz) |= i;///(raw unitig/non-unqiue node id)|(integer contig id)

            kv_pushp(uint64_t, b64, &pz); //i_idx[int_a[k]^1]++;
            (*pz) = int_a[k]^1; (*pz) <<= 32; (*pz) |= i;
        }
        kv_pushp(uint64_t, b64, &pz); //i_idx[int_a[s]]++;
        (*pz) = int_a[s]; (*pz) <<= 32; (*pz) |= i;

        kv_pushp(uint64_t, b64, &pz); //i_idx[int_a[e]^1]++;
        (*pz) = int_a[e]^1; (*pz) <<= 32; (*pz) |= i;
    }
    // prt_thread_info(b64.a, a_n, NULL, 0, "tt2");
    // fprintf(stderr, "**1**[M::%s::] a_n::%lu, ua_n::%lu\n", __func__, a_n, ua_n);
    ///index
    radix_sort_srt64(b64.a + a_n, b64.a + b64.n);///(raw unitig node id)|(integer contig id)
    for (k = a_n + 1, i = a_n; k <= b64.n; k++) {
        if(k == b64.n || (b64.a[k]>>32) != (b64.a[i]>>32)) {
            i_idx[b64.a[i]>>32] |= (((uint64_t)i)<<32)|((uint64_t)k);///b64.a[i]>>32 appear once (unique ends)/multipe times
            i = k;
        }
    }
    // prt_thread_info(b64.a, a_n, NULL, 0, "tt3");
    // fprintf(stderr, "**2**[M::%s::] a_n::%lu, ua_n::%lu\n", __func__, a_n, ua_n);
    ///b64.a[0, a_n]:: all resolvable paths with unique beg && end
    ///b64.a[a_n, b64.n]:: (raw unitig/non-unqiue node id)|(resolvable path id)
    // n_clus = usg_unique_arcs_cluster(&b64, a_n, i_idx, int_a);///this function might be wrong
    n_clus = usg_unique_arcs_cluster_adv(&b64, a_n, i_idx, int_a, &ub64);
    // fprintf(stderr, "**3**[M::%s::] a_n::%lu, n_clus::%lu\n", __func__, a_n, n_clus);
    // prt_thread_info(b64.a, a_n, NULL, 0, "tt4");
    assert(b64.n == (a_n<<1));
    old_path_ext(uidx, ng, &b64, &ub64, a_n, n_clus, i_idx, int_a, ff, ng_occ, max_ext);
    // new_path_ext(uidx, ng, &b64, &ub64, a_n, n_clus, i_idx, int_a, ff, ng_occ, max_ext);//wrong

    free(ng_occ); free(i_idx); free(ff); kv_destroy(b64); kv_destroy(ub64); 
    return b64.n - a_n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %r9d, 0x8c(%rsp)
movq %r8, %rbp
movq %rcx, %r12
movq %rdx, 0x80(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x90(%rsp)
movq 0x8(%rsi), %rbx
addq %rbx, %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2120
movq %rax, 0xa8(%rsp)
movl %ebx, %edi
pushq $0x4
popq %rsi
callq 0x2120
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rsp)
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x2120
andq $0x0, 0xd0(%rsp)
movq %rax, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
leaq 0x8(%rbp), %rax
movq %rax, 0x98(%rsp)
xorl %eax, %eax
movl %eax, %eax
cmpq %r12, %rax
jae 0x1ce0b2
movq 0x80(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movl %edi, %ecx
cmpq $0x2, %rcx
jb 0x1ce861
shrq $0x20, %rdi
leaq (,%rdi,8), %rdx
addq %rbp, %rdx
leaq -0x2(%rcx), %rsi
movq 0x98(%rsp), %r8
leaq (%r8,%rdi,8), %rdi
xorl %r8d, %r8d
cmpq %r8, %rsi
je 0x1ce09a
movq (%rdi,%r8,8), %r9
incl (%r14,%r9,4)
xorq $0x1, %r9
incl (%r14,%r9,4)
incq %r8
jmp 0x1ce080
movq (%rdx), %rsi
incl (%r14,%rsi,4)
movq -0x8(%rdx,%rcx,8), %rcx
xorq $0x1, %rcx
incl (%r14,%rcx,4)
incl %eax
jmp 0x1ce03f
movq %r14, 0x30(%rsp)
movq 0x90(%rsp), %rdi
callq 0x1cbbbd
movq (%rax), %rcx
xorl %edx, %edx
pushq $-0x1
popq %rsi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0x1ce1b3
movq 0x10(%rax), %r9
imulq $0x28, %rdx, %r10
leaq (%r9,%r10), %r8
movl 0x10(%r9,%r10), %r9d
testl %r9d, %r9d
movl $0x0, %r11d
cmovgl %r9d, %r11d
xorl %r10d, %r10d
cmpq %r10, %r11
je 0x1ce128
movq 0x18(%r8), %rbx
movl 0x4(%rbx,%r10,8), %ebx
shlq $0x2, %rbx
xorq $0x4, %rbx
movq 0x30(%rsp), %r14
movl (%r14,%rbx), %ebx
andl %edi, %ebx
cmpl $0x1, %ebx
je 0x1ce12b
incq %r10
jmp 0x1ce0fd
movl %esi, %r10d
leaq -0x1(%r9), %r11
testl %r9d, %r9d
jle 0x1ce158
movq 0x18(%r8), %rbx
movl %r11d, %r14d
movl 0x4(%rbx,%r14,8), %ebx
movq 0x30(%rsp), %r14
movl (%r14,%rbx,4), %ebx
andl %edi, %ebx
decl %r9d
decq %r11
cmpl $0x1, %ebx
jne 0x1ce12f
jmp 0x1ce15b
movl %esi, %r9d
cmpl $-0x1, %r10d
je 0x1ce166
cmpl %r9d, %r10d
ja 0x1ce1ac
cmpl $-0x1, %r10d
je 0x1ce18d
movq 0x18(%r8), %r11
movl %r10d, %r10d
movl 0x4(%r11,%r10,8), %r10d
shlq $0x2, %r10
xorq $0x4, %r10
movq 0x30(%rsp), %r11
orl $0x80000000, (%r11,%r10) # imm = 0x80000000
cmpl $-0x1, %r9d
je 0x1ce1ac
movq 0x18(%r8), %r8
movl %r9d, %r9d
movl 0x4(%r8,%r9,8), %r8d
movq 0x30(%rsp), %r9
orl $0x80000000, (%r9,%r8,4) # imm = 0x80000000
incl %edx
jmp 0x1ce0d1
movq %rax, %rdi
callq 0x6921d
andq $0x0, 0x38(%rsp)
xorl %eax, %eax
xorl %edi, %edi
xorl %r13d, %r13d
xorl %ecx, %ecx
xorl %r9d, %r9d
movq $0x0, 0x78(%rsp)
movq %rbp, 0x58(%rsp)
movq 0x30(%rsp), %rsi
movq %r15, 0x70(%rsp)
movq %r12, 0xb0(%rsp)
cmpl %r12d, %ecx
movq %r9, 0x28(%rsp)
jae 0x1ce45b
movl %ecx, 0x68(%rsp)
movl %ecx, %ecx
movq 0x80(%rsp), %rdx
movq (%rdx,%rcx,8), %rdx
movq %rdx, %r14
shrq $0x20, %r14
addl %r14d, %edx
leal 0x1(%r14), %ecx
cmpl %ecx, %edx
jbe 0x1ce880
movq %rdx, 0x60(%rsp)
movl %edx, %r10d
movq %r14, %r15
movq %r13, 0xb8(%rsp)
movq %r13, %r12
pushq $-0x1
popq %r13
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
movq %r10, 0x50(%rsp)
cmpq %r10, %r15
jae 0x1ce304
movl (%rbp,%r15,8), %ecx
movl (%rsi,%rcx,4), %ebx
testl %ebx, %ebx
js 0x1ce272
movq %rcx, %rdx
xorq $0x1, %rdx
cmpl $0x0, (%rsi,%rdx,4)
jns 0x1ce2fc
cmpq $-0x1, %r13
je 0x1ce2f6
xorq $0x1, %rcx
cmpl $0x0, (%rsi,%rcx,4)
jns 0x1ce2f6
testq %r12, %r12
je 0x1ce29c
leaq (%rdi,%r12,8), %rcx
addq $-0x8, %rcx
testq %rcx, %rcx
je 0x1ce29c
movl 0x4(%rcx), %ecx
cmpq %r13, %rcx
je 0x1ce2f6
cmpq %rax, %r12
jne 0x1ce2e0
leaq (%rax,%rax), %rbp
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %rbp
leaq (,%rbp,8), %rsi
callq 0x2370
movq 0x50(%rsp), %r10
movq 0x28(%rsp), %r9
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
movq 0x30(%rsp), %rsi
movq %rax, %rdi
movq %rbp, %rax
movq 0x58(%rsp), %rbp
movq %r13, %rcx
shlq $0x20, %rcx
addq %r15, %rcx
movq %rcx, (%rdi,%r12,8)
incq %r12
incq 0x78(%rsp)
testl %ebx, %ebx
cmovsq %r15, %r13
incq %r15
jmp 0x1ce24c
movq %r12, 0x38(%rsp)
movq %rdi, 0x48(%rsp)
movq %rax, 0x40(%rsp)
movl 0xb8(%rsp), %ebx
movl %r12d, %edx
cmpq %rdx, %rbx
jae 0x1ce3ae
movq (%rdi,%rbx,8), %rcx
movq %rcx, %r13
shrq $0x20, %r13
cmpq %r13, %r14
jae 0x1ce3a3
cmpq %rax, %r12
jne 0x1ce38c
leaq (%rax,%rax), %rbp
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %rbp
leaq (,%rbp,8), %rsi
movq %r12, %r15
movq %r9, %r12
movq %r14, 0x28(%rsp)
movq %rdx, %r14
callq 0x2370
movq %r14, %rdx
movq 0x28(%rsp), %r14
movq %r12, %r9
movq %r15, %r12
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
movq 0x30(%rsp), %rsi
movq %rax, %rdi
movq %rbp, %rax
movq 0x58(%rsp), %rbp
incq %r9
shlq $0x20, %r14
orq %r14, %r13
orq %r8, %r13
movq %r13, (%rdi,%r12,8)
incq %r12
movl (%rdi,%rbx,8), %ecx
movl %ecx, %r14d
incq %rbx
jmp 0x1ce31d
movq %rdi, 0x48(%rsp)
movq %r12, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rcx
decl %ecx
cmpq %rcx, %r14
jae 0x1ce440
movq %rcx, %r13
cmpq %rax, %r12
movq 0x70(%rsp), %r15
jne 0x1ce420
leaq (%rax,%rax), %rbx
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %rbx
movq %rbx, 0x40(%rsp)
leaq (,%rbx,8), %rsi
movq %r12, 0x28(%rsp)
movq %r9, %r12
callq 0x2370
movq %r12, %r9
movq 0x28(%rsp), %r12
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
movq 0x30(%rsp), %rsi
movq %rax, %rdi
movq %rax, 0x48(%rsp)
movq %rbx, %rax
leaq 0x1(%r12), %rcx
movq %rcx, 0x38(%rsp)
incq %r9
shlq $0x20, %r14
orq %r13, %r14
orq %r8, %r14
movq %r14, (%rdi,%r12,8)
movq %rcx, %r12
jmp 0x1ce445
movq 0x70(%rsp), %r15
movl 0x68(%rsp), %ecx
incl %ecx
movq %r12, %r13
movq 0xb0(%rsp), %r12
jmp 0x1ce1ed
movq 0x78(%rsp), %rbx
leaq (%rbx,%r9), %rax
cmpq %r13, %rax
jne 0x1ce91b
leaq (%rdi,%r13,8), %rsi
movq %rdi, %r14
callq 0x1a3def
movq %r14, %r9
movl %ebx, %eax
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
movq 0x28(%rsp), %r11
movl %eax, %eax
cmpq %rax, %r13
jbe 0x1ce502
movq (%r9,%rax,8), %rcx
testq %rcx, %rcx
jns 0x1ce89f
movq %rcx, %rdx
shrq $0x20, %rdx
movl %edx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmpl %ecx, %esi
jae 0x1ce8be
decq %r11
movl %edx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl %ecx, %edi
incq %rsi
cmpq %rdi, %rsi
jae 0x1ce4e0
movq (%rbp,%rsi,8), %r8
orq %r10, (%r15,%r8,8)
xorq $0x1, %r8
orq %r10, (%r15,%r8,8)
jmp 0x1ce4c5
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq (%rbp,%rdx,8), %rdx
orq %r10, (%r15,%rdx,8)
movl %ecx, %ecx
movq (%rbp,%rcx,8), %rcx
xorq $0x1, %rcx
orq %r10, (%r15,%rcx,8)
incl %eax
jmp 0x1ce48d
movq 0x78(%rsp), %rbp
movq %rbp, 0x38(%rsp)
testq %r11, %r11
jne 0x1ce93a
xorl %eax, %eax
movl %eax, %esi
cmpq %rsi, %rbp
jbe 0x1ce734
movq (%r9,%rsi,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ecx, %eax
jbe 0x1ce8dd
testq %rax, %rax
js 0x1ce8fc
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %r14
movq %rax, 0x68(%rsp)
movl %eax, %eax
movq %rax, 0x80(%rsp)
leaq 0x1(%rcx), %r13
movq 0x98(%rsp), %rax
movq %rcx, 0x60(%rsp)
leaq (%rax,%rcx,8), %r12
leaq 0x2(,%rdi,2), %r8
leaq (,%rdi,8), %rbx
xorl %ebp, %ebp
movq %rsi, 0x28(%rsp)
movq %rdi, 0x50(%rsp)
leaq (%rdi,%rbp), %r15
cmpq 0x80(%rsp), %r13
jae 0x1ce653
cmpq %r14, %r15
jne 0x1ce5d3
leaq (%r14,%r14), %r15
testq %r14, %r14
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,8), %rsi
movq %r9, %rdi
movq %r8, %r14
callq 0x2370
movq %r14, %r8
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %r9
movq %r15, %r14
leaq (%rdi,%rbp), %rax
incq %rax
leaq (%r9,%rbx), %rcx
movq (%r12,%rbp,4), %rdx
shlq $0x20, %rdx
orq %rsi, %rdx
movq %rdx, (%rcx,%rbp,8)
cmpq %r14, %rax
jne 0x1ce622
testq %rax, %rax
movq %r8, %r14
pushq $0x2
popq %rax
cmoveq %rax, %r14
leaq (,%r14,8), %rsi
movq %r9, %rdi
movq %r8, %r15
callq 0x2370
movq %r15, %r8
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %r9
leaq (%r9,%rbx), %rax
movq (%r12,%rbp,4), %rcx
shlq $0x20, %rcx
orq %rsi, %rcx
movabsq $0x100000000, %rdx      # imm = 0x100000000
xorq %rdx, %rcx
movq %rcx, 0x8(%rax,%rbp,8)
incq %r13
addq $0x2, %rbp
addq $0x4, %r8
jmp 0x1ce588
movq %r14, 0x40(%rsp)
cmpq %r14, %r15
jne 0x1ce68f
leaq (%r14,%r14), %rsi
testq %r14, %r14
pushq $0x2
popq %rax
cmoveq %rax, %rsi
movq %rsi, 0x40(%rsp)
shlq $0x3, %rsi
movq %r9, %rdi
movq %r8, %rbx
callq 0x2370
movq %rbx, %r8
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %r9
movq 0x68(%rsp), %rbx
movq 0x60(%rsp), %rdx
leaq (%r9,%rdi,8), %rax
movq 0x58(%rsp), %rcx
movq (%rcx,%rdx,8), %rcx
shlq $0x20, %rcx
orq %rsi, %rcx
movq %rcx, (%rax,%rbp,8)
subq 0x40(%rsp), %r15
incq %r15
jne 0x1ce6ed
leaq (%rdi,%rbp), %rax
incq %rax
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %r8
movq %r8, 0x40(%rsp)
shlq $0x3, %r8
movq %r9, %rdi
movq %r8, %rsi
callq 0x2370
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %r9
movq 0x70(%rsp), %r15
leaq (%r9,%rdi,8), %rax
leaq (%rdi,%rbp), %rcx
addq $0x2, %rcx
movq %rcx, 0x38(%rsp)
movl %ebx, %ecx
movq 0x58(%rsp), %rdx
movq (%rdx,%rcx,8), %rcx
shlq $0x20, %rcx
orq %rsi, %rcx
movabsq $0x100000000, %rdx      # imm = 0x100000000
xorq %rdx, %rcx
movq %rcx, 0x8(%rax,%rbp,8)
leal 0x1(%rsi), %eax
movq 0x78(%rsp), %rbp
jmp 0x1ce517
movq %r9, 0x48(%rsp)
leaq (%r9,%rbp,8), %rdi
movq 0x38(%rsp), %rbx
leaq (%r9,%rbx,8), %rsi
movq %r9, %r14
callq 0x1a3def
movq %r14, %r9
movl %ebp, %eax
movq 0x58(%rsp), %r14
movl %eax, %ecx
incl %eax
movl %eax, %edi
movl %edi, %edx
cmpq %rdx, %rbx
jb 0x1ce79b
movl %edi, %eax
je 0x1ce782
movq (%r9,%rcx,8), %rsi
movq (%r9,%rdx,8), %r8
xorq %rsi, %r8
shrq $0x20, %r8
leal 0x1(%rax), %edi
testq %r8, %r8
je 0x1ce75e
jmp 0x1ce786
movq (%r9,%rcx,8), %rsi
shlq $0x20, %rcx
shrq $0x20, %rsi
orq (%r15,%rsi,8), %rcx
orq %rdx, %rcx
movq %rcx, (%r15,%rsi,8)
jmp 0x1ce758
leaq 0x38(%rsp), %rbx
leaq 0xc0(%rsp), %r8
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1ca70e
leaq (,%rbp,2), %rax
cmpq %rax, (%rbx)
jne 0x1ce959
movq %r15, %r13
movl 0x8c(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x30(%rsp), %r12
movq %r12, 0x18(%rsp)
movq 0xa8(%rsp), %r15
movq %r15, 0x10(%rsp)
movq %r14, 0x8(%rsp)
leaq 0x38(%rsp), %rbx
leaq 0xc0(%rsp), %r14
movq 0xa0(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %rbp, %r8
callq 0x1cd29e
movq %r12, %rdi
callq 0x2220
movq %r13, %rdi
callq 0x2220
movq %r15, %rdi
callq 0x2220
movq 0x10(%rbx), %rdi
callq 0x2220
movq 0x10(%r14), %rdi
callq 0x2220
movq (%rbx), %rax
subq %rbp, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2c6ed(%rip), %rdi     # 0x1faf55
leaq 0x28c6a(%rip), %rsi     # 0x1f74d9
leaq 0x2c853(%rip), %rcx     # 0x1fb0c9
movl $0x34d2, %edx           # imm = 0x34D2
callq 0x2110
leaq 0x2c344(%rip), %rdi     # 0x1fabcb
leaq 0x28c4b(%rip), %rsi     # 0x1f74d9
leaq 0x2c834(%rip), %rcx     # 0x1fb0c9
movl $0x34f5, %edx           # imm = 0x34F5
callq 0x2110
leaq 0x2c72f(%rip), %rdi     # 0x1fafd5
leaq 0x28c2c(%rip), %rsi     # 0x1f74d9
leaq 0x2c815(%rip), %rcx     # 0x1fb0c9
movl $0x351d, %edx           # imm = 0x351D
callq 0x2110
leaq 0x2bf09(%rip), %rdi     # 0x1fa7ce
leaq 0x28c0d(%rip), %rsi     # 0x1f74d9
leaq 0x2c7f6(%rip), %rcx     # 0x1fb0c9
movl $0x351e, %edx           # imm = 0x351E
callq 0x2110
leaq 0x2beea(%rip), %rdi     # 0x1fa7ce
leaq 0x28bee(%rip), %rsi     # 0x1f74d9
leaq 0x2c7d7(%rip), %rcx     # 0x1fb0c9
movl $0x352a, %edx           # imm = 0x352A
callq 0x2110
leaq 0x2c763(%rip), %rdi     # 0x1fb066
leaq 0x28bcf(%rip), %rsi     # 0x1f74d9
leaq 0x2c7b8(%rip), %rcx     # 0x1fb0c9
movl $0x352b, %edx           # imm = 0x352B
callq 0x2110
leaq 0x2c69f(%rip), %rdi     # 0x1fafc1
leaq 0x28bb0(%rip), %rsi     # 0x1f74d9
leaq 0x2c799(%rip), %rcx     # 0x1fb0c9
movl $0x3517, %edx           # imm = 0x3517
callq 0x2110
leaq 0x2c6bc(%rip), %rdi     # 0x1faffd
leaq 0x28b91(%rip), %rsi     # 0x1f74d9
leaq 0x2c77a(%rip), %rcx     # 0x1fb0c9
movl $0x3528, %edx           # imm = 0x3528
callq 0x2110
leaq 0x2c757(%rip), %rdi     # 0x1fb0b7
leaq 0x28b72(%rip), %rsi     # 0x1f74d9
leaq 0x2c75b(%rip), %rcx     # 0x1fb0c9
movl $0x354c, %edx           # imm = 0x354C
callq 0x2110