// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: ug_ext(ul_resolve_t*, usg_t*, unsigned long*, unsigned long, unsigned long*, unsigned int, unsigned char*, unsigned int*, unsigned long*, asg64_v*, asg64_v*)
uint32_t ug_ext(ul_resolve_t *uidx, usg_t *ng, uint64_t *int_idx, uint64_t int_idx_n, uint64_t *int_a, uint32_t max_ext, 
uint8_t *ff, uint32_t *ng_occ, uint64_t *i_idx, asg64_v *b64, asg64_v *ub64)
{
    uint32_t n_vtx = ng->n<<1, k, i; uint64_t pi, ei, *pz, v, b64_n;
    uint64_t *r_a, r_n, zs, ze, s, e, a_n, ua_n, bn, n_clus;
    memset(ff, 0, sizeof((*ff))*n_vtx);
    memset(ng_occ, 0, sizeof((*ng_occ))*n_vtx); 
    memset(i_idx, 0, sizeof((*i_idx))*n_vtx); 
    b64->n = ub64->n = 0;

    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); 
    int32_t ui, un; ma_utg_t *u = NULL;
    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))) {
                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
    return b64->n - a_n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r9d, 0x44(%rsp)
movq %r8, %r15
movq %rcx, %r12
movq %rdx, 0x58(%rsp)
movq %rdi, 0x60(%rsp)
movq 0xc0(%rsp), %r14
movq 0xb8(%rsp), %rbp
movq 0xb0(%rsp), %rdi
movq %rsi, 0x48(%rsp)
movl 0x8(%rsi), %r13d
addl %r13d, %r13d
xorl %ebx, %ebx
xorl %esi, %esi
movq %r13, %rdx
callq 0x20e0
leaq (,%r13,4), %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x20e0
shlq $0x3, %r13
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r12, %r13
callq 0x20e0
movq 0xd0(%rsp), %rcx
movq %rbx, (%rcx)
movq 0xc8(%rsp), %rax
movq %rbx, (%rax)
testq %r12, %r12
je 0x21e0f9
leaq 0x8(%r15), %rax
movq 0x58(%rsp), %rcx
movq (%rcx,%rbx,8), %rdx
movl %edx, %ecx
cmpq $0x2, %rcx
jb 0x21e877
shrq $0x20, %rdx
cmpl $0x2, %ecx
je 0x21e0da
leaq -0x2(%rcx), %rsi
leaq (%rax,%rdx,8), %rdi
xorl %r8d, %r8d
movq (%rdi,%r8,8), %r9
incl (%rbp,%r9,4)
xorq $0x1, %r9
incl (%rbp,%r9,4)
incq %r8
cmpq %r8, %rsi
jne 0x21e0c0
leaq (%r15,%rdx,8), %rdx
movq (%rdx), %rsi
incl (%rbp,%rsi,4)
movq -0x8(%rdx,%rcx,8), %rcx
xorq $0x1, %rcx
incl (%rbp,%rcx,4)
incl %ebx
cmpq %r13, %rbx
jb 0x21e097
movq %r15, 0x28(%rsp)
movq 0x48(%rsp), %rdi
callq 0x21a43d
movq (%rax), %rcx
testq %rcx, %rcx
movq 0xc0(%rsp), %r12
je 0x21e223
movq 0x10(%rax), %rdx
xorl %esi, %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
leaq (%rsi,%rsi,4), %r9
leaq (%rdx,%r9,8), %r11
movl 0x10(%r11), %r9d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
testl %r9d, %r9d
jle 0x21e179
movq 0x18(%r11), %rbx
xorl %r10d, %r10d
movl 0x4(%rbx,%r10,8), %r14d
shlq $0x2, %r14
xorq $0x4, %r14
movq 0xb8(%rsp), %r15
movl (%r15,%r14), %ebp
andl %edi, %ebp
cmpl $0x1, %ebp
je 0x21e179
incq %r10
cmpq %r10, %r9
jne 0x21e14b
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
testl %r9d, %r9d
jle 0x21e1e5
movq 0x18(%r11), %r14
movq -0x8(%r14,%r9,8), %r15
decq %r9
shrq $0x20, %r15
movq 0xb8(%rsp), %rbx
movl (%rbx,%r15,4), %ebx
movl %ebx, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
cmpl $0x1, %ebp
jne 0x21e179
cmpq %r8, %r10
je 0x21e1b1
cmpq %r9, %r10
ja 0x21e214
cmpq %r8, %r10
movq 0xb8(%rsp), %r11
je 0x21e1df
movl 0x4(%r14,%r10,8), %r10d
shlq $0x2, %r10
xorq $0x4, %r10
orl $0x80000000, (%r11,%r10) # imm = 0x80000000
movq (%r14,%r9,8), %r15
shrq $0x20, %r15
movl (%r11,%r15,4), %ebx
leaq (%r11,%r15,4), %r9
jmp 0x21e20b
cmpq %r8, %r10
je 0x21e214
movq 0x18(%r11), %r9
movl 0x4(%r9,%r10,8), %r10d
shlq $0x2, %r10
xorq $0x4, %r10
movq 0xb8(%rsp), %r11
leaq (%r11,%r10), %r9
movl (%r11,%r10), %ebx
orl $0x80000000, %ebx       # imm = 0x80000000
movl %ebx, (%r9)
incq %rsi
movl %esi, %r9d
cmpq %r9, %rcx
ja 0x21e12d
movq %rax, %rdi
callq 0xa0761
xorl %ecx, %ecx
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
movq 0xc8(%rsp), %rdi
movq $0x0, (%rdi)
testq %r13, %r13
je 0x21e4fa
xorl %r11d, %r11d
movq $0x0, 0x30(%rsp)
movq 0x28(%rsp), %r8
movq 0xb8(%rsp), %r9
movq %r13, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rcx, 0x68(%rsp)
movq (%rax,%rcx,8), %rbx
movl %ebx, %esi
cmpq $0x1, %rsi
jbe 0x21e896
shrq $0x20, %rbx
addq %rbx, %rsi
movl (%rdi), %r13d
leal 0x1(%rbx), %r12d
movq $-0x1, %r14
movq %rbx, %r15
movq %rsi, 0x38(%rsp)
movq %r11, 0x70(%rsp)
movq (%r8,%r15,8), %rbp
movl (%r9,%rbp,4), %ecx
testl %ecx, %ecx
js 0x21e2c7
movq %rbp, %rax
xorq $0x1, %rax
cmpl $0x0, (%r9,%rax,4)
jns 0x21e37b
cmpq $-0x1, %r14
je 0x21e375
movq %rbp, %rax
xorq $0x1, %rax
cmpl $0x0, (%r9,%rax,4)
jns 0x21e375
movq (%rdi), %rdx
movq 0x10(%rdi), %rax
testq %rdx, %rdx
je 0x21e301
leaq (%rax,%rdx,8), %rsi
addq $-0x8, %rsi
je 0x21e301
movl 0x4(%rsi), %esi
cmpq %r14, %rsi
je 0x21e370
cmpq 0x8(%rdi), %rdx
jne 0x21e356
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rdi)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x70(%rsp), %r11
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
movq 0xb8(%rsp), %r9
movq 0x28(%rsp), %r8
movq 0xc8(%rsp), %rdi
movq %rax, 0x10(%rdi)
movq (%rdi), %rdx
movl (%r9,%rbp,4), %ecx
leaq 0x1(%rdx), %rsi
movq %rsi, (%rdi)
movq %r14, %rsi
shlq $0x20, %rsi
orq %r15, %rsi
movq %rsi, (%rax,%rdx,8)
incq 0x30(%rsp)
movq 0x38(%rsp), %rsi
testl %ecx, %ecx
cmovsq %r15, %r14
movl %r12d, %r15d
incl %r12d
cmpq %r15, %rsi
ja 0x21e2a9
movq (%rdi), %r14
cmpq %r13, %r14
jbe 0x21e435
movq 0x10(%rdi), %rax
leal 0x1(%r13), %r15d
movq (%rax,%r13,8), %rcx
movq %rcx, %r12
shrq $0x20, %r12
cmpq %r12, %rbx
jae 0x21e424
movq (%rdi), %rcx
cmpq 0x8(%rdi), %rcx
jne 0x21e408
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rdi)
shlq $0x3, %rsi
movq %rax, %rdi
movq %r11, %rbp
callq 0x2370
movq 0x38(%rsp), %rsi
movq %rbp, %r11
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
movq 0xb8(%rsp), %r9
movq 0x28(%rsp), %r8
movq 0xc8(%rsp), %rdi
movq %rax, 0x10(%rdi)
movq (%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
incq %r11
shlq $0x20, %rbx
orq %rbx, %r12
orq %r10, %r12
movq %r12, (%rax,%rcx,8)
movl (%rax,%r13,8), %ecx
movl %ecx, %ebx
movl %r15d, %r13d
incl %r15d
cmpq %r13, %r14
ja 0x21e39e
decq %rsi
cmpq %rsi, %rbx
jae 0x21e4cd
movq (%rdi), %rcx
movq 0x10(%rdi), %rax
cmpq 0x8(%rdi), %rcx
movq 0xc0(%rsp), %r12
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0x50(%rsp), %r13
jne 0x21e4b3
movq %rsi, %rbp
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rdi)
shlq $0x3, %rsi
movq %rax, %rdi
movq %r11, %r15
callq 0x2370
movq %rbp, %rsi
movq %r15, %r11
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
movq 0xb8(%rsp), %r9
movq 0x28(%rsp), %r8
movq 0xc8(%rsp), %rdi
movq %rax, 0x10(%rdi)
movq (%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
incq %r11
shlq $0x20, %rbx
orq %r10, %rsi
orq %rbx, %rsi
movq %rsi, (%rax,%rcx,8)
jmp 0x21e4e0
movq 0xc0(%rsp), %r12
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0x50(%rsp), %r13
movq 0x68(%rsp), %rcx
incl %ecx
cmpq %r13, %rcx
jb 0x21e26d
movq (%rdi), %rcx
movq 0x30(%rsp), %rbx
jmp 0x21e505
xorl %ebx, %ebx
xorl %r11d, %r11d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leaq (%r11,%rbx), %rax
cmpq %rcx, %rax
jne 0x21e931
movq %r11, %r15
movq 0x10(%rdi), %rdi
leaq (%rdi,%rcx,8), %rsi
callq 0x1ee586
movq 0xc8(%rsp), %r9
movl %ebx, %edx
cmpq %rdx, (%r9)
jbe 0x21e5b6
movq 0x10(%r9), %rax
movl %ebx, %ecx
movq 0x28(%rsp), %r10
movabsq $-0x8000000000000000, %r11 # imm = 0x8000000000000000
movq (%rax,%rdx,8), %rsi
testq %rsi, %rsi
jns 0x21e8f3
movq %rsi, %rdx
shrq $0x20, %rdx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl %esi, %esi
cmpq %rdx, %rsi
jbe 0x21e912
leaq 0x1(%rdx), %rdi
cmpl %edi, %esi
jbe 0x21e593
movq (%r10,%rdi,8), %r8
orq %r11, (%r12,%r8,8)
movq (%r10,%rdi,8), %r8
xorq $0x1, %r8
orq %r11, (%r12,%r8,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x21e577
decq %r15
movq (%r10,%rdx,8), %rdx
orq %r11, (%r12,%rdx,8)
movq (%r10,%rsi,8), %rdx
xorq $0x1, %rdx
orq %r11, (%r12,%rdx,8)
incl %ecx
movq %rcx, %rdx
cmpq %rcx, (%r9)
ja 0x21e54a
jmp 0x21e5bb
movq 0x28(%rsp), %r10
movq %rbx, (%r9)
testq %r15, %r15
jne 0x21e950
xorl %r15d, %r15d
movq 0x10(%r9), %rax
testq %rbx, %rbx
movq %rbx, 0x30(%rsp)
je 0x21e77e
movq (%rax,%r15,8), %rcx
movq %rcx, %r13
shrq $0x20, %r13
movl %ecx, %ebp
cmpq %r13, %rbp
jbe 0x21e8d4
testq %rcx, %rcx
js 0x21e8b5
leaq 0x1(%r13), %rbx
cmpq %rbx, %rbp
jbe 0x21e6bd
movq (%r9), %rcx
cmpq 0x8(%r9), %rcx
jne 0x21e645
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x28(%rsp), %r10
movq 0xc8(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r9)
movq (%r10,%rbx,8), %rdx
shlq $0x20, %rdx
orq %r15, %rdx
movq %rdx, (%rax,%rcx,8)
movq (%r9), %rcx
cmpq 0x8(%r9), %rcx
jne 0x21e698
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x28(%rsp), %r10
movq 0xc8(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r9)
movq (%r10,%rbx,8), %rdx
shlq $0x20, %rdx
orq %r15, %rdx
leaq 0x1(%r14), %rsi
xorq %rdx, %rsi
movq %rsi, (%rax,%rcx,8)
incq %rbx
jmp 0x21e5ff
movq (%r9), %rcx
cmpq 0x8(%r9), %rcx
jne 0x21e6fa
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x28(%rsp), %r10
movq 0xc8(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rcx
movq 0x30(%rsp), %rbx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r9)
movq (%r10,%r13,8), %rdx
shlq $0x20, %rdx
orq %r15, %rdx
movq %rdx, (%rax,%rcx,8)
movq (%r9), %rcx
cmpq 0x8(%r9), %rcx
jne 0x21e752
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x28(%rsp), %r10
movq 0xc8(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r9)
movq (%r10,%rbp,8), %rdx
shlq $0x20, %rdx
orq %r15, %rdx
leaq 0x1(%r14), %rsi
xorq %rdx, %rsi
movq %rsi, (%rax,%rcx,8)
incl %r15d
cmpq %r15, %rbx
ja 0x21e5dc
movq (%r9), %r15
movq %r9, %rbx
movq 0x30(%rsp), %r14
leaq (%rax,%r14,8), %rdi
leaq (%rax,%r15,8), %rsi
callq 0x1ee586
leal 0x1(%r14), %ecx
movq (%rbx), %r15
cmpq %rcx, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq 0xd0(%rsp), %r14
jb 0x21e7f9
movq 0x10(%rdi), %rax
leal 0x2(%rsi), %edx
movl %esi, %r11d
movl %r11d, %r8d
cmpq %rcx, %r15
jne 0x21e7c5
movq (%rax,%r8,8), %r9
jmp 0x21e7d6
movq (%rax,%r8,8), %r9
movq (%rax,%rcx,8), %r10
xorq %r9, %r10
shrq $0x20, %r10
je 0x21e7f0
shlq $0x20, %r8
shrq $0x20, %r9
orq (%r12,%r9,8), %r8
leal -0x1(%rdx), %r11d
orq %rcx, %r8
movq %r8, (%r12,%r9,8)
movq (%rdi), %r15
movl %edx, %ecx
incl %edx
cmpq %rcx, %r15
jae 0x21e7b7
movq %r12, %rdx
movq %rsi, %r15
movq 0x28(%rsp), %rbx
movq %rbx, %rcx
movq %r14, %r8
callq 0x218d9b
movq 0xc8(%rsp), %rdx
leaq (%r15,%r15), %rax
cmpq %rax, (%rdx)
jne 0x21e96f
movl 0x44(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbx, 0x8(%rsp)
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %r14, %rcx
movq %r15, %r8
movq %rdx, %rbx
callq 0x21beee
movl (%rbx), %eax
subl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a718(%rip), %rdi     # 0x248f96
leaq 0x26d84(%rip), %rsi     # 0x245609
leaq 0x2a9ae(%rip), %rcx     # 0x24923a
movl $0x35e9, %edx           # imm = 0x35E9
callq 0x2110
leaq 0x2a36f(%rip), %rdi     # 0x248c0c
leaq 0x26d65(%rip), %rsi     # 0x245609
leaq 0x2a98f(%rip), %rcx     # 0x24923a
movl $0x360a, %edx           # imm = 0x360A
callq 0x2110
leaq 0x2aa4a(%rip), %rdi     # 0x249306
leaq 0x26d46(%rip), %rsi     # 0x245609
leaq 0x2a970(%rip), %rcx     # 0x24923a
movl $0x3640, %edx           # imm = 0x3640
callq 0x2110
leaq 0x29f34(%rip), %rdi     # 0x24880f
leaq 0x26d27(%rip), %rsi     # 0x245609
leaq 0x2a951(%rip), %rcx     # 0x24923a
movl $0x363f, %edx           # imm = 0x363F
callq 0x2110
leaq 0x2a9e3(%rip), %rdi     # 0x2492dd
leaq 0x26d08(%rip), %rsi     # 0x245609
leaq 0x2a932(%rip), %rcx     # 0x24923a
movl $0x3632, %edx           # imm = 0x3632
callq 0x2110
leaq 0x29ef6(%rip), %rdi     # 0x24880f
leaq 0x26ce9(%rip), %rsi     # 0x245609
leaq 0x2a913(%rip), %rcx     # 0x24923a
movl $0x3633, %edx           # imm = 0x3633
callq 0x2110
leaq 0x2a990(%rip), %rdi     # 0x2492c8
leaq 0x26cca(%rip), %rsi     # 0x245609
leaq 0x2a8f4(%rip), %rcx     # 0x24923a
movl $0x362b, %edx           # imm = 0x362B
callq 0x2110
leaq 0x2a6e7(%rip), %rdi     # 0x24903e
leaq 0x26cab(%rip), %rsi     # 0x245609
leaq 0x2a8d5(%rip), %rcx     # 0x24923a
movl $0x363d, %edx           # imm = 0x363D
callq 0x2110
leaq 0x29f18(%rip), %rdi     # 0x24888e
leaq 0x26c8c(%rip), %rsi     # 0x245609
leaq 0x2a8b6(%rip), %rcx     # 0x24923a
movl $0x3661, %edx           # imm = 0x3661
callq 0x2110