// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: rescue_bubbles_by_missing_ovlp(ma_ug_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, R_to_U*, int, int, unsigned int, unsigned int, unsigned int, bubble_type*, bub_label_t*)
void rescue_bubbles_by_missing_ovlp(ma_ug_t *i_u_g, asg_t *r_g, ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, 
R_to_U* ruIndex, int max_hang, int min_ovlp, uint32_t chainLenThres, uint32_t beg_idx, uint32_t occ, bubble_type* bub, 
bub_label_t* b_mask_t)
{
    asg_t* nsg = NULL;
    uint32_t beg_utg, sink_utg, *a = NULL, n, i, bub_i, k_i, k_v, k, uId, endRid, is_Unitig, v, w;
    uint64_t l_bub, m_bub, r_bub/**, bub_0, bub_1**/;
    ma_ug_t* ug = i_u_g;
    ma_utg_t *nsu = NULL, *u = NULL;
    uint8_t* expect_vis = NULL; CALLOC(expect_vis, r_g->n_seq);
    asg_arc_t t, r_edge;

    for (v = 0; v < ug->u.n; v++) ug->g->seq[v].c = PRIMARY_LABLE;
    
    kvec_t(asg_arc_t) new_edges;
    kv_init(new_edges);

    kvec_t(asg_arc_t) rbub_edges;
    kv_init(rbub_edges);


    nsg = ug->g;
    for (v = 0; v < nsg->n_seq; v++)
    {
        uId = v;
        nsu = &(ug->u.a[uId]);
        if(nsu->m == 0) continue;
        if(nsg->seq[v].del) continue;
        for (k = 0; k < nsu->n; k++) 
        {
            set_R_to_U(ruIndex, nsu->a[k]>>33, uId, 1, &(r_g->seq[nsu->a[k]>>33].c));
        }
    }

    for (i = 0; i < bub->b_ug->u.n; i++)
    {
        u = &(bub->b_ug->u.a[i]);
        if(u->n < 3) continue; ///should be at least 3
        for (bub_i = 1; bub_i+1 < u->n; bub_i++)
        {
            m_bub = u->a[bub_i]>>33; l_bub = r_bub = (uint64_t)-1;
            if(m_bub < beg_idx || m_bub >= beg_idx + occ) continue;
            l_bub = u->a[bub_i-1]>>33;
            r_bub = u->a[bub_i+1]>>33;

            set_rtg_flag_by_bubble(bub, ug, r_g, l_bub, expect_vis, 1);
            set_rtg_flag_by_bubble(bub, ug, r_g, r_bub, expect_vis, 1);
            set_rtg_flag_by_bubble(bub, ug, r_g, m_bub, expect_vis, 1);

            get_bubbles(bub, m_bub, &beg_utg, &sink_utg, &a, &n, NULL);

            for (k_i = 0; k_i < n; k_i++)
            {
                uId = a[k_i]>>1;
                nsu = &(ug->u.a[uId]);
                if(nsu->m == 0) continue;
                for (k_v = 0; k_v < 2; k_v++)
                {
                    v = (uId<<1) + k_v;
                    if(get_real_length(nsg, v, NULL) != 0) continue;

                    if(v&1)
                    {
                        endRid = nsu->start^1;
                    }
                    else
                    {
                        endRid = nsu->end^1;
                    }


                    k = 0; rbub_edges.n = 0;
                    while(get_edge2existing_node_advance_by_broken_bub(ug, r_g, sources, coverage_cut, 
                        ruIndex, expect_vis, max_hang, min_ovlp, endRid, &k, &r_edge, 1))
                    {
                        kv_push(asg_arc_t, rbub_edges, r_edge);
                    }

                    if(rbub_edges.n > 0)
                    {
                        ///need to do transitive reduction
                        ///note here is different to standard transitive reduction
                        minor_transitive_reduction_r_g(r_g, rbub_edges.a, rbub_edges.n);
                        for (k = 0; k < rbub_edges.n; k++)
                        {
                            t = rbub_edges.a[k];
                            if(t.del) continue;
                    
                            kv_push(asg_arc_t, new_edges, t);
                            get_edge_from_source(sources, coverage_cut, ruIndex, max_hang, min_ovlp, 
                            (t.v^1), ((t.ul>>32)^1), &t);
                            kv_push(asg_arc_t, new_edges, t);
                        }
                    }
                }
            }
            

            set_rtg_flag_by_bubble(bub, ug, r_g, l_bub, expect_vis, 0);
            set_rtg_flag_by_bubble(bub, ug, r_g, r_bub, expect_vis, 0);
            set_rtg_flag_by_bubble(bub, ug, r_g, m_bub, expect_vis, 0);
        }
    }

    asg_arc_t* p = NULL;
    for (k = 0; k < new_edges.n; k++)
    {
        p = asg_arc_pushp(r_g);
        *p = new_edges.a[k];
    }
    if(new_edges.n != 0)
    {
        free(r_g->idx);
        r_g->idx = 0;
        r_g->is_srt = 0;
        asg_cleanup(r_g);
        asg_symm(r_g);
    }

    pre_clean(sources, coverage_cut, r_g, 0);

    lable_all_bubbles(r_g, b_mask_t);


    for (k = 0; k < new_edges.n; k++)
    {
        v = new_edges.a[k].ul>>32;
        w = new_edges.a[k].v;

        if(r_g->seq[v>>1].del) continue;
        if(r_g->seq[w>>1].del) continue;
        ///if this edge is at a bubble
        if(r_g->seq_vis[v]!=0 && r_g->seq_vis[w^1]!=0) continue;

        asg_arc_del(r_g, v, w, 1);
        asg_arc_del(r_g, w^1, v^1, 1);
    }
    asg_cleanup(r_g);
    asg_symm(r_g);

    
    for (v = 0; v < ruIndex->len; v++)
    {
        get_R_to_U(ruIndex, v, &uId, &is_Unitig);
        if(is_Unitig == 1) ruIndex->index[v] = (uint32_t)-1;
    }
    // fprintf(stderr, "M::%s has done!\n", __func__);
    // print_bubble_filling_status(ug, r_g, ruIndex, bub, beg_idx, occ, new_edges.a, new_edges.n);

    kv_destroy(new_edges);
    kv_destroy(rbub_edges);
    free(expect_vis);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %r9d, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %rcx, %r14
movq %rdx, 0x98(%rsp)
movq %rdi, %rbx
movq $0x0, 0xa0(%rsp)
movq %rsi, (%rsp)
movl 0x14(%rsi), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl $0x1, %esi
callq 0x2120
movq %rax, 0x18(%rsp)
movq %rbx, 0x8(%rsp)
movq (%rbx), %rax
testq %rax, %rax
je 0xf7993
movq 0x8(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
xorl %edx, %edx
movb $0x0, 0x4(%rcx,%rdx,8)
incq %rdx
movl %edx, %esi
cmpq %rsi, %rax
ja 0xf7984
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
testl $0x7fffffff, 0x14(%rax) # imm = 0x7FFFFFFF
movq (%rsp), %rdx
je 0xf7a36
xorl %ebx, %ebx
movq 0x28(%rsp), %r13
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rbx,%rbx,4), %rcx
cmpl $0x0, 0xc(%rax,%rcx,8)
je 0xf7a21
movq 0x10(%rsp), %rsi
movq 0x20(%rsi), %rsi
cmpl $0x0, (%rsi,%rbx,8)
js 0xf7a21
leaq (%rax,%rcx,8), %r15
cmpl $0x0, 0x10(%r15)
je 0xf7a21
xorl %r12d, %r12d
movq 0x18(%r15), %rax
movq (%rax,%r12,8), %rsi
shrq $0x21, %rsi
movq 0x20(%rdx), %rax
leaq (%rax,%rsi,8), %r8
addq $0x4, %r8
movq %r13, %rdi
movl %ebx, %edx
movl $0x1, %ecx
callq 0xa1cd4
movq (%rsp), %rdx
incq %r12
movl 0x10(%r15), %eax
cmpq %rax, %r12
jb 0xf79ea
incq %rbx
movq 0x10(%rsp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rbx
jb 0xf79b9
movq 0x170(%rsp), %rax
movq 0xc0(%rax), %rax
xorl %esi, %esi
cmpq $0x0, (%rax)
je 0xf8103
movl 0x160(%rsp), %edi
movl %edi, %r9d
addl 0x168(%rsp), %edi
movq $0x0, 0x20(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq $0x0, 0x88(%rsp)
xorl %r8d, %r8d
movq %rdi, 0xb8(%rsp)
movq %r9, 0xb0(%rsp)
movq 0x10(%rax), %rax
leaq (%rsi,%rsi,4), %rcx
cmpl $0x3, 0x10(%rax,%rcx,8)
movq %rsi, 0xa8(%rsp)
jb 0xf80df
leaq (%rax,%rcx,8), %r10
cmpl $0x3, 0x10(%r10)
jb 0xf80df
movl $0x2, %r11d
movl $0x1, %ebx
movq %r10, 0xc0(%rsp)
movq 0x18(%r10), %rax
movq (%rax,%rbx,8), %r15
shrq $0x21, %r15
cmpq %r9, %r15
setb %cl
cmpq %rdi, %r15
setae %sil
orb %cl, %sil
jne 0xf80cc
movq %r8, 0x48(%rsp)
movq %rbx, 0xd8(%rsp)
movq -0x8(%rax,%rbx,8), %rcx
shrq $0x21, %rcx
movq %r11, 0xe0(%rsp)
movq (%rax,%r11,8), %rbx
shrq $0x21, %rbx
movq 0x170(%rsp), %rdi
movq 0x8(%rsp), %rbp
movq %rbp, %rsi
movq %rcx, 0xc8(%rsp)
movq 0x18(%rsp), %r8
movl $0x1, %r9d
movq %r15, 0x78(%rsp)
movq %rdx, %r15
callq 0xf4de5
movq 0x170(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %rbx, 0xd0(%rsp)
movl %ebx, %ecx
movq 0x18(%rsp), %rbx
movq %rbx, %r8
movl $0x1, %r9d
callq 0xf4de5
movq 0x170(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq 0x78(%rsp), %r15
movl %r15d, %ecx
movq %rbx, %r8
movl $0x1, %r9d
callq 0xf4de5
subq $0x8, %rsp
movq 0x178(%rsp), %rdi
movq %r15, %rsi
leaq 0x104(%rsp), %rdx
leaq 0x100(%rsp), %rcx
leaq 0xa8(%rsp), %r8
leaq 0x3c(%rsp), %r9
pushq $0x0
callq 0x13812e
addq $0x10, %rsp
cmpl $0x0, 0x34(%rsp)
je 0xf8032
xorl %ecx, %ecx
movq (%rsp), %r8
movq 0x10(%rsp), %r9
movq 0xa0(%rsp), %rax
movq %rcx, 0xe8(%rsp)
movl (%rax,%rcx,4), %r10d
movl %r10d, %ecx
shrl %ecx
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rcx,%rcx,4), %rcx
cmpl $0x0, 0xc(%rax,%rcx,8)
je 0xf8018
leaq (%rax,%rcx,8), %rax
movq %rax, 0xf0(%rsp)
andl $-0x2, %r10d
xorl %r11d, %r11d
movq %r10, 0x80(%rsp)
movq %r11, %rax
orq %r10, %rax
movq 0x28(%r9), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rcx
je 0xf7c83
movq 0x8(%r9), %rdx
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
leaq (%rdx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %esi, %esi
movl (%rax,%rdx), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %esi
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0xf7c68
testl %esi, %esi
jne 0xf8008
movq %r13, 0x38(%rsp)
xorl %eax, %eax
movq %r11, 0x90(%rsp)
testq %r11, %r11
sete %al
movq 0xf0(%rsp), %rcx
movl 0x4(%rcx,%rax,4), %eax
movq %rax, %r13
xorq $0x1, %r13
shrl %eax
leaq (%rax,%rax,2), %rax
movq 0x98(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x20(%rsp), %rdx
movq %rsi, 0x50(%rsp)
movl 0xc(%rsi), %r15d
movb $0x1, %al
cmpl %r15d, %ebp
jae 0xf7e09
movq %rdx, 0x20(%rsp)
movq %r12, 0x40(%rsp)
leaq 0x192a6d(%rip), %rax    # 0x28a758
movss 0x158(%rax), %xmm0
movss %xmm0, 0x58(%rsp)
movl %ebp, %eax
leaq (%rax,%rax,4), %r12
shlq $0x3, %r12
addq (%rsi), %r12
subq %rax, %r15
movl 0xc(%r12), %edx
leaq (%rdx,%rdx,2), %rcx
movl (%r14,%rcx,4), %eax
testl %eax, %eax
js 0xf7de9
movq 0x20(%r8), %rsi
cmpl $0x0, (%rsi,%rdx,8)
js 0xf7de9
movl 0x4(%r12), %edx
leaq (%rdx,%rdx,2), %rdx
leaq (%r14,%rdx,4), %rdx
leaq (%r14,%rcx,4), %rcx
movl 0x4(%rdx), %esi
movl (%rdx), %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %edx
subl %edx, %esi
movl 0x4(%rcx), %edx
subl %eax, %edx
movq %r12, %rdi
movl 0x30(%rsp), %ecx
movss 0x58(%rsp), %xmm0
movl 0x150(%rsp), %r8d
leaq 0x100(%rsp), %r9
callq 0xa159b
movq (%rsp), %r8
testl %eax, %eax
js 0xf7de9
cmpl %r13d, 0x104(%rsp)
jne 0xf7de9
movl 0x108(%rsp), %eax
shrl %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rdx
cmpq %rax, (%rdx)
jbe 0xf7db7
movq 0x8(%rdx), %rdx
movl (%rdx,%rax,4), %edx
cmpl $-0x1, %edx
je 0xf7db7
movl %edx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
testl %edx, %edx
setns %dl
jmp 0xf7db9
xorl %edx, %edx
cmpl $-0x1, %ecx
sete %sil
orb %dl, %sil
jne 0xf7de9
movq 0x8(%rsp), %rdx
movq 0x18(%rdx), %rdx
movq 0x20(%rdx), %rdx
movl %ecx, %ecx
cmpl $0x0, (%rdx,%rcx,8)
js 0xf7de9
movq 0x18(%rsp), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0xf7e6b
incl %ebp
addq $0x28, %r12
decq %r15
jne 0xf7d09
movq 0x40(%rsp), %r12
movq 0x20(%rsp), %rdx
movq 0x50(%rsp), %rsi
movb $0x1, %al
testb %al, %al
jne 0xf7e80
cmpq %rdx, %rbx
jne 0xf7e45
leaq (%rdx,%rdx), %r15
testq %rdx, %rdx
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
movq %r12, %rdi
callq 0x2370
movq 0x50(%rsp), %rsi
movq (%rsp), %r8
movq %rax, %r12
movq %r15, %rdx
leaq (%rbx,%rbx,2), %rax
incq %rbx
movq 0x110(%rsp), %rcx
movq %rcx, 0x10(%r12,%rax,8)
movups 0x100(%rsp), %xmm0
movups %xmm0, (%r12,%rax,8)
jmp 0xf7ccb
incl %ebp
xorl %eax, %eax
movq 0x40(%rsp), %r12
movq 0x20(%rsp), %rdx
movq 0x50(%rsp), %rsi
jmp 0xf7e09
movq %rdx, 0x20(%rsp)
testq %rbx, %rbx
je 0xf7fee
movq %r8, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xf4f30
movl $0x1, %ebp
xorl %ecx, %ecx
movq 0x48(%rsp), %rax
movq 0x38(%rsp), %r13
movq 0x88(%rsp), %rsi
movq %rbx, 0x58(%rsp)
movq %r12, 0x40(%rsp)
leaq (%rcx,%rcx,2), %rcx
movups (%r12,%rcx,8), %xmm0
movaps %xmm0, 0x60(%rsp)
movq 0x10(%r12,%rcx,8), %rcx
movq %rcx, 0x70(%rsp)
cmpl $0x0, 0x6c(%rsp)
js 0xf7fce
cmpq %rsi, %r13
jne 0xf7f0c
leaq (%rsi,%rsi), %r15
testq %rsi, %rsi
movl $0x2, %ecx
cmoveq %rcx, %r15
leaq (,%r15,8), %rcx
leaq (%rcx,%rcx,2), %rsi
movq %rax, %rdi
callq 0x2370
jmp 0xf7f0f
movq %rsi, %r15
leaq 0x1(%r13), %rbx
movq %r13, 0x38(%rsp)
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq 0x70(%rsp), %rcx
movq %rcx, 0x10(%rax,%rdx,8)
movaps 0x60(%rsp), %xmm0
movups %xmm0, (%rax,%rdx,8)
movl 0x64(%rsp), %edx
movl 0x68(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %edx
movq 0x98(%rsp), %rdi
movq %r14, %rsi
movl 0x30(%rsp), %ecx
movq %rax, %r13
movl 0x150(%rsp), %r8d
leaq 0x60(%rsp), %rax
pushq %rax
pushq %rdx
callq 0xb2ced
addq $0x10, %rsp
cmpq %r15, %rbx
movq %r15, %rsi
jne 0xf7fa6
leaq (%rsi,%rsi), %r12
testq %rsi, %rsi
movl $0x2, %eax
cmoveq %rax, %r12
leaq (,%r12,8), %rax
leaq (%rax,%rax,2), %rsi
movq %r13, %rdi
callq 0x2370
movq %r12, %rsi
movq 0x40(%rsp), %r12
jmp 0xf7fa9
movq %r13, %rax
movq 0x38(%rsp), %r13
addq $0x2, %r13
leaq (%rbx,%rbx,2), %rdx
movq 0x70(%rsp), %rcx
movq %rcx, 0x10(%rax,%rdx,8)
movaps 0x60(%rsp), %xmm0
movups %xmm0, (%rax,%rdx,8)
movq 0x58(%rsp), %rbx
movl %ebp, %ecx
incl %ebp
cmpq %rcx, %rbx
ja 0xf7ebe
movq %rsi, 0x88(%rsp)
movq %rax, 0x48(%rsp)
movq (%rsp), %r8
jmp 0xf7ff3
movq 0x38(%rsp), %r13
movq 0x10(%rsp), %r9
movq 0x80(%rsp), %r10
movq 0x90(%rsp), %r11
leaq 0x1(%r11), %rax
testq %r11, %r11
movq %rax, %r11
je 0xf7c2d
movq 0xe8(%rsp), %rcx
incq %rcx
movl 0x34(%rsp), %eax
cmpq %rax, %rcx
jb 0xf7be1
jmp 0xf8036
movq (%rsp), %r8
movq 0x170(%rsp), %rbp
movq %rbp, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rsi
movq %r8, %rdx
movq 0xc8(%rsp), %rcx
movq 0x18(%rsp), %rbx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xf4de5
movq %rbp, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq 0xd0(%rsp), %rcx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xf4de5
movq %rbp, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq 0x78(%rsp), %rcx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xf4de5
movq (%rsp), %rdx
movq 0x48(%rsp), %r8
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %r9
movq 0xc0(%rsp), %r10
movq 0xe0(%rsp), %r11
movq 0xd8(%rsp), %rbx
incq %r11
movl 0x10(%r10), %eax
incq %rbx
cmpq %rax, %r11
jb 0xf7acd
movq 0xa8(%rsp), %rsi
incl %esi
movq 0x170(%rsp), %rax
movq 0xc0(%rax), %rax
cmpq %rsi, (%rax)
ja 0xf7a90
jmp 0xf810c
xorl %r8d, %r8d
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %r13, %r14
testq %r13, %r13
movq %r8, %r13
je 0xf81e6
movl $0x1, %ebx
xorl %r15d, %r15d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl 0x4(%rdx), %ecx
andl %ebp, %ecx
movl (%rdx), %eax
cmpl %eax, %ecx
jne 0xf815e
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovel %eax, %ecx
movl %ecx, (%rdx)
movq 0x8(%rdx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %r13, %r8
movq (%rsp), %rdx
movq %rax, 0x8(%rdx)
movq 0x8(%rdx), %rax
movl 0x4(%rdx), %ecx
movl %ecx, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
leal 0x1(%rcx), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %esi, %ecx
movl %ecx, 0x4(%rdx)
leaq (%rdi,%rdi,2), %rcx
leaq (%r15,%r15,2), %rdi
movq 0x10(%r8,%rdi,8), %rsi
movq %rsi, 0x10(%rax,%rcx,8)
movups (%r8,%rdi,8), %xmm0
movups %xmm0, (%rax,%rcx,8)
movl %ebx, %r15d
incl %ebx
cmpq %r15, %r14
ja 0xf8128
movq 0x28(%rdx), %rdi
callq 0x2220
movq (%rsp), %rax
movq $0x0, 0x28(%rax)
movq (%rsp), %rax
andb $0x7f, 0x7(%rax)
movq (%rsp), %rdi
callq 0xa02fa
movq (%rsp), %rdi
callq 0xa0333
movq (%rsp), %rdi
callq 0xa03e9
movq (%rsp), %rdx
orb $-0x80, 0x17(%rdx)
movq 0x178(%rsp), %rbx
movl $0x64, %ecx
xorl %r8d, %r8d
callq 0xe7e99
movq (%rsp), %rdx
testq %rax, %rax
jne 0xf81ee
movq %rdx, %rdi
callq 0xa02fa
movq (%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xa6dbe
movq (%rsp), %rbx
testq %r14, %r14
je 0xf832b
movq %r13, %rdx
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq (%rax,%rax,2), %rsi
movq (%rdx,%rsi,8), %rdx
movq 0x20(%rbx), %r9
movq %rdx, %r8
shrq $0x21, %r8
cmpl $0x0, (%r9,%r8,8)
js 0xf831a
movl 0x8(%r13,%rsi,8), %esi
movl %esi, %r8d
shrl %r8d
cmpl $0x0, (%r9,%r8,8)
js 0xf831a
shrq $0x20, %rdx
movq 0x30(%rbx), %r9
cmpb $0x0, (%r9,%rdx)
je 0xf8286
movq %rsi, %r8
xorq $0x1, %r8
cmpb $0x0, (%r9,%r8)
jne 0xf831a
movq 0x28(%rbx), %r8
movq (%r8,%rdx,8), %r8
movq %r8, %r10
andq %rcx, %r10
je 0xf82cb
movq 0x8(%rbx), %r9
shrq $0x20, %r8
shlq $0x3, %r10
leaq (%r10,%r10,2), %r10
leaq (%r8,%r8,2), %r8
leaq (%r9,%r8,8), %r8
addq $0xc, %r8
xorl %r9d, %r9d
cmpl %esi, -0x4(%r8,%r9)
jne 0xf82c2
orb $-0x80, 0x3(%r8,%r9)
addq $0x18, %r9
cmpq %r9, %r10
jne 0xf82b5
xorl $0x1, %esi
movq 0x28(%rbx), %r8
movq (%r8,%rsi,8), %r9
movq %r9, %rsi
andq %rcx, %rsi
je 0xf831a
movq 0x8(%rbx), %r8
shrq $0x20, %r9
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%r9,%r9,2), %r9
leaq (%r8,%r9,8), %r10
addq $0xc, %r10
xorl %r8d, %r8d
movl -0x4(%r10,%r8), %r9d
xorl %edx, %r9d
cmpl $0x1, %r9d
jne 0xf8311
orb $-0x80, 0x3(%r10,%r8)
addq $0x18, %r8
cmpq %r8, %rsi
jne 0xf82fd
incq %rax
movl %eax, %edx
cmpq %rdx, %r14
movq %r13, %rdx
ja 0xf8231
movq %rbx, %rdi
callq 0xa02fa
movq %rbx, %rdi
callq 0xa0333
movq %rbx, %rdi
callq 0xa03e9
movq %r13, %rdi
orb $-0x80, 0x17(%rbx)
movq 0x28(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xf8382
movq 0x28(%rsp), %rcx
movq 0x8(%rcx), %rcx
xorl %edx, %edx
cmpl $-0x2, (%rcx,%rdx,4)
jg 0xf8378
movq 0x28(%rsp), %rsi
movq 0x8(%rsi), %rsi
movl $0xffffffff, (%rsi,%rdx,4) # imm = 0xFFFFFFFF
incq %rdx
movl %edx, %esi
cmpq %rsi, %rax
ja 0xf8362
callq 0x2220
movq %r12, %rdi
callq 0x2220
movq 0x18(%rsp), %rdi
callq 0x2220
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq