// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_arc_del_short_false_link_advance(asg_t*, float, float, int, ma_hit_t_alloc*, long long, R_to_U*)
int asg_arc_del_short_false_link_advance(asg_t *g, float drop_ratio, float o_drop_ratio, int max_dist, 
ma_hit_t_alloc* reverse_sources, long long miniedgeLen, R_to_U* ruIndex)
{
    double startTime = Get_T();
    
    kvec_t(uint64_t) b;
    memset(&b, 0, sizeof(b));


    kvec_t(uint32_t) b_f;
    memset(&b_f, 0, sizeof(b_f));

    kvec_t(uint32_t) b_r;
    memset(&b_r, 0, sizeof(b_r));


	uint32_t v, w, n_vtx = g->n_seq * 2, n_cut = 0;
    uint32_t sink;

    buf_t bub;
    if (!g->is_symm) asg_symm(g);
    memset(&bub, 0, sizeof(buf_t));
    bub.a = (binfo_t*)calloc(n_vtx, sizeof(binfo_t));
    
    for (v = 0; v < n_vtx; ++v) 
    {
        if(g->seq_vis[v] == 0)
        {
            asg_arc_t *av = asg_arc_a(g, v);
            uint32_t nv = asg_arc_n(g, v);
            if(nv == 1 && asg_arc_n(g, v^1) == 1) continue;

            uint64_t t_ol = 0;
            long long i;
            for (i = 0; i < nv; ++i)
            {
                t_ol += av[i].ol;
            }
            kv_push(uint64_t, b, (uint64_t)(t_ol << 32 | v));  
        }
	}

    radix_sort_arch64(b.a, b.a + b.n);

    uint32_t min_edge;
    
    uint64_t k, t;
    for (k = 0; k < b.n; k++)
    {
        ///v is the node
        v = (uint32_t)b.a[k];
        if (g->seq[v>>1].del) continue;
        uint32_t nv = asg_arc_n(g, v), nw, to_del_l, to_del_r;
        if (nv < 2) continue;
        uint32_t kv = get_real_length(g, v, NULL), kw;
        if (kv < 2) continue;
        uint32_t i;
        asg_arc_t *av = asg_arc_a(g, v), *aw;

        b_f.n = 0;
        b_r.n = 0;
        to_del_l = 0;
        for (i = 0; i < nv; i++)
        {
            if (av[i].del) continue;
            
            w = av[i].v^1;
            nw = asg_arc_n(g, w);
            if(nw < 2) break;
            kw = get_real_length(g, w, NULL);
            if(kw < 2) break;

            kv_push(uint32_t, b_f, av[i].v);
            kv_push(uint32_t, b_r, w);

            aw = asg_arc_a(g, w);
            min_edge = (uint32_t)-1;
            for (t = 0; t < nw; t++)
            {
                if(aw[t].del) continue;
                if((aw[t].v>>1) == (v>>1)) continue;
                if(aw[t].ol < min_edge) min_edge = aw[t].ol;
                ///kv_push(uint32_t, b_r, aw[t].v);
            }

            if(av[i].ol < min_edge * drop_ratio) to_del_l++;
        }












        /****************************may have bugs********************************/
        if(to_del_l != kv)
        {
            b_f.n = 0;
            b_r.n = 0;
            to_del_l = 0;

            for (i = 0; i < nv; i++)
            {
                if (av[i].del) continue;

                w = av[i].v^1;
                nw = asg_arc_n(g, w);
                if(nw < 2) break;
                kw = get_real_length(g, w, NULL);
                if(kw < 2) break;

                kv_push(uint32_t, b_f, av[i].v);
                kv_push(uint32_t, b_r, w);

                aw = asg_arc_a(g, w);
                min_edge = (uint32_t)-1;
                for (t = 0; t < nw; t++)
                {
                    if(aw[t].del) continue;
                    if((aw[t].v>>1) == (v>>1)) continue;
                    if(aw[t].ol < min_edge) min_edge = aw[t].ol;
                }

                if(av[i].ol < min_edge * o_drop_ratio) to_del_l++;
            }

            if(to_del_l == kv)
            {
                ///forward
                to_del_l = 1;
                for (i = 1; i < b_f.n; i++)
                {
                    if(check_if_diploid(b_f.a[0], b_f.a[i], g, reverse_sources, miniedgeLen, ruIndex) == 1)
                    {
                        to_del_l++;
                    }
                }

                ///backward
                if(to_del_l != kv && b_r.n >= 2)
                {
                    to_del_l = 0;
                    uint32_t w0 = 0, w1 = 0;


                    w = b_r.a[0];
                    kw = get_real_length(g, w, NULL);
                    if(kw != 2) goto terminal;
                    aw = asg_arc_a(g, w);
                    nw = asg_arc_n(g, w);
                    for (t = 0; t < nw; t++)
                    {
                        if(aw[t].del) continue;
                        if((aw[t].v>>1) == (v>>1)) continue;
                        w0 = aw[t].v;
                    }
                    to_del_l = 1;


                    for (i = 1; i < b_r.n; i++)
                    {
                        w = b_r.a[i];
                        kw = get_real_length(g, w, NULL);
                        if(kw != 2) goto terminal;
                        aw = asg_arc_a(g, w);
                        nw = asg_arc_n(g, w);
                        for (t = 0; t < nw; t++)
                        {
                            if(aw[t].del) continue;
                            if((aw[t].v>>1) == (v>>1)) continue;
                            w1 = aw[t].v;
                        }

                        if(check_if_diploid(w0, w1, g, reverse_sources, miniedgeLen, ruIndex) == 1)
                        {
                            to_del_l++;
                        }
                    }

                }
            }
        }

        terminal:
        /****************************may have bugs********************************/


        if(to_del_l != kv) continue;





        uint32_t convex1;
        long long l1;




        ////forward bubble
        to_del_l = 0;
        for (i = 0; i < b_f.n; i++)
        {
            if(b_f.a[i] == b_f.a[0])
            {
                to_del_l = 1;
            } 
            else
            {
                to_del_l = 0;
                break;
            }
        }
        //check the length
        if(to_del_l == 0 && asg_bub_end_finder_with_del_advance(g, 
        b_f.a, b_f.n, max_dist, &bub, 0, (uint32_t)-1, &sink)==1)
        {
            to_del_l = 1;
        }
        if(to_del_l == 0 && detect_mul_bubble_end_with_bubbles(g, b_f.a, b_f.n, &convex1, &l1, NULL))
        {
            to_del_l = 1;
        }

        ////backward bubble
        to_del_r = 0;
        for (i = 0; i < b_r.n; i++)
        {
            if(b_r.a[i] == b_r.a[0])
            {
                to_del_r = 1;
            } 
            else
            {
                to_del_r = 0;
                break;
            }
        }
        if(to_del_r == 0 && asg_bub_end_finder_with_del_advance
        (g, b_r.a, b_r.n, max_dist, &bub, 1, v^1, &sink)==1)
        {
            to_del_r = 1;
        }
        if(to_del_r == 0 && detect_mul_bubble_end_with_bubbles(g, b_r.a, b_r.n, &convex1, &l1, NULL))
        {
            to_del_r = 1;
        }

  


		if (to_del_l && to_del_r)
        {
            ///fprintf(stderr, "%.*s\n", Get_NAME_LENGTH((R_INF), v>>1), Get_NAME((R_INF), v>>1));
            for (i = 0; i < nv; ++i) 
            {
			    if (av[i].del) continue;
                
                ++n_cut;
                av[i].del = 1;
                asg_arc_del(g, av[i].v^1, av[i].ul>>32^1, 1);
		    }

        }
    }
    
    free(b.a); free(b_f.a); free(b_r.a);
    free(bub.a); free(bub.S.a); free(bub.T.a); free(bub.b.a); free(bub.e.a);
	if (n_cut) 
    {
		asg_cleanup(g);
		asg_symm(g);
	}
	fprintf(stderr, "[M::%s] removed %d false overlaps\n", __func__, n_cut);
    fprintf(stderr, "[M::%s] takes %0.2f s\n\n", __func__, Get_T()-startTime);
	return n_cut;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %r8, %r12
movq %rcx, %rbp
movq %rdx, 0xb0(%rsp)
movl %esi, 0x74(%rsp)
movss %xmm1, 0x98(%rsp)
movss %xmm0, 0x9c(%rsp)
movq %rdi, %r15
callq 0x300fc
movsd %xmm0, 0xb8(%rsp)
movl 0x14(%r15), %eax
leal (%rax,%rax), %ebx
testl %eax, %eax
js 0x6ae9
movq %r15, %rdi
callq 0xa0333
movq %r15, %rdi
callq 0xa03e9
orb $-0x80, 0x17(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
andq $0x0, 0x130(%rsp)
movl %ebx, %r14d
pushq $0x1c
popq %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, 0xd0(%rsp)
xorl %r13d, %r13d
movl $0x0, %eax
movq %rax, 0x48(%rsp)
testl %ebx, %ebx
movq %r15, 0x60(%rsp)
movq %r12, 0xa8(%rsp)
movl $0x0, %r12d
jne 0x6b84
movq 0x48(%rsp), %rbx
leaq (%r12,%rbx,8), %rsi
movq %r12, %rdi
callq 0x9d53f
testq %rbx, %rbx
jne 0x6c59
xorl %r10d, %r10d
xorl %r11d, %r11d
jmp 0x766d
xorl %ebx, %ebx
movq $0x0, 0x48(%rsp)
xorl %r8d, %r8d
xorl %r12d, %r12d
movq 0x30(%r15), %rcx
cmpb $0x0, (%rcx,%rbx)
jne 0x6c43
movq 0x28(%r15), %rsi
movq (%rsi,%rbx,8), %rcx
movq %r15, %rdx
movl %ecx, %r15d
testl %ecx, %ecx
je 0x6bff
movq 0x8(%rdx), %rdx
cmpl $0x1, %ecx
jne 0x6bd3
movl %ebx, %edi
xorq $0x1, %rdi
cmpl $0x1, (%rsi,%rdi,8)
je 0x6c3e
testq %r15, %r15
je 0x6c54
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rdx, %rcx
addq $0xc, %rcx
xorl %edx, %edx
movl (%rcx), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
addq %rsi, %rdx
addq $0x18, %rcx
decq %r15
jne 0x6be4
shlq $0x20, %rdx
movq %rdx, %r15
cmpq %r8, 0x48(%rsp)
jne 0x6c2a
movq %r12, %rdi
leaq (%r8,%r8), %r12
testq %r8, %r8
pushq $0x2
popq %rax
cmoveq %rax, %r12
leaq (,%r12,8), %rsi
callq 0x2370
movq %r12, %r8
movq %rax, %r12
orq %rbx, %r15
movq 0x48(%rsp), %rax
movq %r15, (%r12,%rax,8)
incq %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %r15
incq %rbx
cmpq %r14, %rbx
jne 0x6b95
jmp 0x6b5f
xorl %r15d, %r15d
jmp 0x6bff
xorl %r14d, %r14d
xorl %r8d, %r8d
xorl %r13d, %r13d
xorl %r11d, %r11d
xorl %r10d, %r10d
movq $0x0, 0x68(%rsp)
movq %rbp, 0x18(%rsp)
movq %r12, 0x78(%rsp)
movq (%r12,%r14,8), %rdi
movq 0x20(%r15), %rax
movl %edi, %ecx
shrl %ecx
movq %rcx, 0x80(%rsp)
cmpl $0x0, (%rax,%rcx,8)
js 0x7661
movl %edi, %eax
movq 0x28(%r15), %rcx
movq (%rcx,%rax,8), %rdx
movq %rdx, 0x88(%rsp)
cmpl $0x2, %edx
jb 0x7661
movq (%rcx,%rax,8), %rax
movq %rax, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rcx
je 0x6cf7
movq 0x8(%r15), %rdx
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq %rdx, %rax
addq $0xc, %rax
imulq $0x18, %rcx, %rcx
xorl %edx, %edx
xorl %r12d, %r12d
movl (%rax,%rdx), %esi
notl %esi
shrl $0x1f, %esi
addl %esi, %r12d
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x6ce1
jmp 0x6cfa
xorl %r12d, %r12d
cmpl $0x2, %r12d
jae 0x6d0a
movq 0x78(%rsp), %r12
jmp 0x7661
movq %rdi, 0xc0(%rsp)
movq %r13, 0x58(%rsp)
movq 0x88(%rsp), %rcx
movq %rcx, %rax
shrq $0x20, %rax
imulq $0x18, %rax, %rdi
addq 0x8(%r15), %rdi
cmpl $0x1, %ecx
adcl $0x0, %ecx
movq %rcx, 0x50(%rsp)
xorl %ebx, %ebx
movl $0x0, 0x4(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
movq %r14, 0x40(%rsp)
movq %rdi, 0x8(%rsp)
imulq $0x18, %rbx, %r13
cmpl $0x0, 0xc(%rdi,%r13)
js 0x6eed
addq %rdi, %r13
movl 0x8(%r13), %r14d
xorq $0x1, %r14
movq 0x28(%r15), %rax
movq (%rax,%r14,8), %rax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x6f02
movq %rax, %rbp
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
andq %rcx, %rbp
je 0x6efd
movq 0x8(%r15), %rcx
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq %rcx, %rax
addq $0xc, %rax
imulq $0x18, %rbp, %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 0x6db9
cmpl $0x2, %esi
jb 0x6f09
cmpq %r8, 0x30(%rsp)
jne 0x6e0a
leaq (%r8,%r8), %r15
testq %r8, %r8
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,4), %rsi
movq %r11, %rdi
movq %r10, 0x28(%rsp)
callq 0x2370
movq 0x28(%rsp), %r10
movq %rax, %r11
movq %r15, %r8
movq 0x68(%rsp), %rcx
movl 0x8(%r13), %eax
movq 0x30(%rsp), %rdx
movl %eax, (%r11,%rdx,4)
cmpq %rcx, 0x20(%rsp)
jne 0x6e5d
leaq (%rcx,%rcx), %r15
testq %rcx, %rcx
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,4), %rsi
movq %r10, %rdi
movq %r11, 0x38(%rsp)
movq %r8, 0x10(%rsp)
callq 0x2370
movq 0x10(%rsp), %r8
movq 0x38(%rsp), %r11
movq %rax, %r10
movq %r15, 0x68(%rsp)
movq 0x60(%rsp), %r15
movq 0x8(%rsp), %rdi
incq 0x30(%rsp)
movq 0x20(%rsp), %rax
movl %r14d, (%r10,%rax,4)
incq %rax
movq %rax, 0x20(%rsp)
movq 0x8(%r15), %rax
movq 0x28(%r15), %rcx
movl 0x4(%rcx,%r14,8), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addq $0xc, %rax
pushq $-0x1
popq %rcx
movq 0x40(%rsp), %r14
movl (%rax), %edx
testl %edx, %edx
js 0x6eb7
movl -0x4(%rax), %esi
shrl %esi
cmpl %ecx, %edx
cmovael %ecx, %edx
cmpl 0x80(%rsp), %esi
cmovnel %edx, %ecx
addq $0x18, %rax
decq %rbp
jne 0x6e9d
movl %ecx, %eax
cvtsi2ss %rax, %xmm0
movl 0xc(%r13), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cvtsi2ss %eax, %xmm1
mulss 0x9c(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x6ee8
incl 0x4(%rsp)
movq 0x18(%rsp), %rbp
incq %rbx
cmpq 0x50(%rsp), %rbx
jne 0x6d5f
jmp 0x6f18
movq 0x18(%rsp), %rbp
movq 0x40(%rsp), %r14
jmp 0x6f18
movq 0x18(%rsp), %rbp
movq 0x40(%rsp), %r14
movq 0x8(%rsp), %rdi
cmpl %r12d, 0x4(%rsp)
je 0x7386
movq 0x88(%rsp), %rax
cmpl $0x1, %eax
adcl $0x0, %eax
movq %rax, 0x50(%rsp)
xorl %ebx, %ebx
movl $0x0, 0x4(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
imulq $0x18, %rbx, %r13
cmpl $0x0, 0xc(%rdi,%r13)
js 0x70e0
addq %rdi, %r13
movl 0x8(%r13), %r14d
xorq $0x1, %r14
movq 0x28(%r15), %rax
movq (%rax,%r14,8), %rax
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x70f5
movq %rax, %rbp
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
andq %rcx, %rbp
je 0x70f0
movq 0x8(%r15), %rcx
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq %rcx, %rax
addq $0xc, %rax
imulq $0x18, %rbp, %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 0x6fac
cmpl $0x2, %esi
jb 0x70fc
cmpq %r8, 0x30(%rsp)
jne 0x6ffd
leaq (%r8,%r8), %r15
testq %r8, %r8
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,4), %rsi
movq %r11, %rdi
movq %r10, 0x28(%rsp)
callq 0x2370
movq 0x28(%rsp), %r10
movq %rax, %r11
movq %r15, %r8
movq 0x68(%rsp), %rcx
movl 0x8(%r13), %eax
movq 0x30(%rsp), %rdx
movl %eax, (%r11,%rdx,4)
cmpq %rcx, 0x20(%rsp)
jne 0x7050
leaq (%rcx,%rcx), %r15
testq %rcx, %rcx
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,4), %rsi
movq %r10, %rdi
movq %r11, 0x38(%rsp)
movq %r8, 0x10(%rsp)
callq 0x2370
movq 0x10(%rsp), %r8
movq 0x38(%rsp), %r11
movq %rax, %r10
movq %r15, 0x68(%rsp)
movq 0x60(%rsp), %r15
movq 0x8(%rsp), %rdi
incq 0x30(%rsp)
movq 0x20(%rsp), %rax
movl %r14d, (%r10,%rax,4)
incq %rax
movq %rax, 0x20(%rsp)
movq 0x8(%r15), %rax
movq 0x28(%r15), %rcx
movl 0x4(%rcx,%r14,8), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addq $0xc, %rax
pushq $-0x1
popq %rcx
movq 0x40(%rsp), %r14
movl (%rax), %edx
testl %edx, %edx
js 0x70aa
movl -0x4(%rax), %esi
shrl %esi
cmpl %ecx, %edx
cmovael %ecx, %edx
cmpl 0x80(%rsp), %esi
cmovnel %edx, %ecx
addq $0x18, %rax
decq %rbp
jne 0x7090
movl %ecx, %eax
cvtsi2ss %rax, %xmm0
movl 0xc(%r13), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cvtsi2ss %eax, %xmm1
mulss 0x98(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x70db
incl 0x4(%rsp)
movq 0x18(%rsp), %rbp
incq %rbx
cmpq 0x50(%rsp), %rbx
jne 0x6f52
jmp 0x710b
movq 0x18(%rsp), %rbp
movq 0x40(%rsp), %r14
jmp 0x710b
movq 0x18(%rsp), %rbp
movq 0x40(%rsp), %r14
movq 0x8(%rsp), %rdi
cmpl %r12d, 0x4(%rsp)
jne 0x7386
movl %r12d, 0x94(%rsp)
movq %r8, 0x10(%rsp)
movq %r10, 0x28(%rsp)
pushq $0x1
popq %rax
movq %r15, %r14
movl %eax, %r15d
movq %rbp, %r8
movq 0x30(%rsp), %rdx
cmpq $0x2, %rdx
movq 0xa8(%rsp), %r12
jb 0x7196
pushq $0x2
popq %rbx
pushq $0x1
popq %rax
pushq $0x1
popq %r15
movq %rdx, 0x30(%rsp)
movl (%r11), %edi
movl (%r11,%rax,4), %esi
movq %r14, %rdx
movq 0xb0(%rsp), %rcx
movq %r8, %rbp
movq %r12, %r9
movq %r11, %r13
callq 0xa9c9f
movq 0x30(%rsp), %rdx
movq %rbp, %r8
movq %r13, %r11
xorl %ecx, %ecx
cmpq $0x1, %rax
sete %cl
addl %ecx, %r15d
movl %ebx, %eax
incl %ebx
cmpq %rax, %rdx
ja 0x7156
movq %r14, %rdx
movq %r8, %rbp
movl %r15d, 0x4(%rsp)
movl 0x94(%rsp), %r12d
cmpl %r12d, %r15d
setne %al
movq 0x20(%rsp), %rbx
cmpq $0x2, %rbx
setae %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x40(%rsp), %r14
jne 0x75cb
movq 0x28(%rsp), %r10
movl (%r10), %eax
movq %rdx, %r15
movq 0x28(%rdx), %rcx
movq (%rcx,%rax,8), %rcx
movq %rcx, %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rax
je 0x75e7
movq 0x8(%r15), %rdx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rdx
addq $0xc, %rdx
imulq $0x18, %rax, %rax
xorl %esi, %esi
xorl %edi, %edi
movl (%rdx,%rsi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %edi
addq $0x18, %rsi
cmpq %rsi, %rax
jne 0x720a
cmpl $0x2, %edi
movq 0x58(%rsp), %r13
jne 0x7603
movq 0x8(%r15), %rdx
addq %rdx, %rcx
addq $0xc, %rcx
xorl %edx, %edx
movl $0x0, 0x50(%rsp)
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
cmpl $0x0, (%rcx,%rdx)
js 0x727f
movl -0x4(%rcx,%rdx), %esi
movl %esi, %edi
shrl %edi
cmpl 0x80(%rsp), %edi
movq 0x8(%rsp), %rdi
movq %r13, %r9
movq %rbp, %r13
movl 0x50(%rsp), %ebp
cmovnel %esi, %ebp
movl %ebp, 0x50(%rsp)
movq %r13, %rbp
movq %r9, %r13
addq $0x18, %rdx
cmpq %rdx, %rax
jne 0x724e
cmpq $0x2, %rbx
jb 0x761a
xorl %ebp, %ebp
pushq $0x1
popq %rax
pushq $0x1
popq %rcx
movl %ecx, %ebx
movl %ecx, 0x4(%rsp)
movq %r11, 0x38(%rsp)
movl (%r10,%rax,4), %eax
movq 0x28(%r15), %rcx
movq (%rcx,%rax,8), %rcx
movq %rcx, %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rax
je 0x7625
movq 0x8(%r15), %rdx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rdx
addq $0xc, %rdx
imulq $0x18, %rax, %rax
xorl %esi, %esi
xorl %edi, %edi
movl (%rdx,%rsi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %edi
addq $0x18, %rsi
cmpq %rsi, %rax
jne 0x72dd
cmpl $0x2, %edi
jne 0x762f
movq 0x8(%r15), %rdx
addq %rdx, %rcx
addq $0xc, %rcx
xorl %edx, %edx
cmpl $0x0, (%rcx,%rdx)
js 0x7322
movl -0x4(%rcx,%rdx), %esi
movl %esi, %edi
shrl %edi
cmpl 0x80(%rsp), %edi
cmovnel %esi, %ebp
addq $0x18, %rdx
cmpq %rdx, %rax
jne 0x730a
movl 0x50(%rsp), %edi
movl %ebp, %esi
movq %r15, %rdx
movq 0xb0(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0xa8(%rsp), %r9
callq 0xa9c9f
xorl %ecx, %ecx
cmpq $0x1, %rax
sete %cl
addl %ecx, 0x4(%rsp)
incl %ebx
movq %rbx, %rax
cmpq %rbx, 0x20(%rsp)
movq 0x28(%rsp), %r10
movq 0x38(%rsp), %r11
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
ja 0x72a5
xorl %eax, %eax
jmp 0x7628
movq 0x58(%rsp), %r13
movq 0x20(%rsp), %rbx
cmpl %r12d, 0x4(%rsp)
jne 0x7657
movq 0x30(%rsp), %r13
testq %r13, %r13
movq 0x78(%rsp), %r12
movq %r10, 0x28(%rsp)
movq %r11, 0x38(%rsp)
movq %r8, 0x10(%rsp)
je 0x73dd
movl (%r11), %eax
pushq $0x1
popq %rcx
xorl %esi, %esi
movl (%r11,%rsi,4), %edx
cmpl %eax, %edx
jne 0x73d2
movl %ecx, %esi
incl %ecx
cmpq %rsi, %r13
ja 0x73c1
movb $0x1, %bpl
cmpl %eax, %edx
je 0x745d
movq %r15, %rdi
movq %r11, %rsi
movl %r13d, %edx
movl 0x74(%rsp), %ecx
leaq 0xd0(%rsp), %r8
xorl %r9d, %r9d
leaq 0xa4(%rsp), %rax
pushq %rax
pushq $-0x1
callq 0xa4d09
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %r8
movq 0x48(%rsp), %r11
movq 0x38(%rsp), %r10
addq $0x10, %rsp
movb $0x1, %bpl
cmpq $0x1, %rax
je 0x745d
movq %r15, %rdi
movq %r11, %rsi
movl %r13d, %edx
leaq 0xa0(%rsp), %rcx
leaq 0xc8(%rsp), %r8
xorl %r9d, %r9d
callq 0xa3f1f
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r8
movq 0x38(%rsp), %r11
movq 0x28(%rsp), %r10
movl %eax, %ebp
testq %rbx, %rbx
movq 0x58(%rsp), %r13
je 0x748a
movl (%r10), %ecx
pushq $0x1
popq %rax
xorl %esi, %esi
movl (%r10,%rsi,4), %edx
cmpl %ecx, %edx
jne 0x7480
movl %eax, %esi
incl %eax
cmpq %rsi, %rbx
ja 0x746f
movb $0x1, %al
cmpl %ecx, %edx
je 0x7515
movq 0xc0(%rsp), %r11
xorl $0x1, %r11d
movq %r15, %rdi
movq %r10, %rsi
movl %ebx, %edx
movl 0x74(%rsp), %ecx
leaq 0xd0(%rsp), %r8
pushq $0x1
popq %r9
leaq 0xa4(%rsp), %rax
pushq %rax
pushq %r11
callq 0xa4d09
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %r8
movq 0x48(%rsp), %r11
movq 0x38(%rsp), %r10
addq $0x10, %rsp
movq %rax, %rcx
movb $0x1, %al
cmpq $0x1, %rcx
je 0x7515
movq %r15, %rdi
movq %r10, %rsi
movl %ebx, %edx
leaq 0xa0(%rsp), %rcx
leaq 0xc8(%rsp), %r8
xorl %r9d, %r9d
callq 0xa3f1f
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r8
movq 0x38(%rsp), %r11
movq 0x28(%rsp), %r10
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x75c1
movq 0x88(%rsp), %rbx
cmpl $0x1, %ebx
adcl $0x0, %ebx
xorl %eax, %eax
movq 0x18(%rsp), %rbp
imulq $0x18, %rax, %rcx
movl 0xc(%rdi,%rcx), %edx
testl %edx, %edx
js 0x75b0
addq %rdi, %rcx
incl %r13d
orl $0x80000000, %edx       # imm = 0x80000000
movl %edx, 0xc(%rcx)
movl 0x8(%rcx), %edx
xorq $0x1, %rdx
movq 0x28(%r15), %rsi
movq (%rsi,%rdx,8), %rsi
movq %rsi, %rdx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rdx
je 0x75ab
movl 0x4(%rcx), %ecx
movq 0x8(%r15), %rdi
shrq $0x20, %rsi
imulq $0x18, %rdx, %rdx
imulq $0x18, %rsi, %rsi
addq %rdi, %rsi
addq $0xc, %rsi
xorl %edi, %edi
movl -0x4(%rsi,%rdi), %r8d
xorl %ecx, %r8d
cmpl $0x1, %r8d
jne 0x759d
orb $-0x80, 0x3(%rsi,%rdi)
addq $0x18, %rdi
cmpq %rdi, %rdx
jne 0x758a
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
incq %rax
cmpq %rbx, %rax
jne 0x7537
jmp 0x765c
movq 0x18(%rsp), %rbp
jmp 0x765c
movq 0x28(%rsp), %r10
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
movq 0x58(%rsp), %r13
movq %rdx, %r15
jmp 0x7390
movl $0x0, 0x4(%rsp)
pushq $0x24
popq %rax
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
movq 0x58(%rsp), %r13
jmp 0x7646
movl $0x0, 0x4(%rsp)
pushq $0x24
popq %rax
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
jmp 0x7646
xorl %eax, %eax
pushq $0x1
popq %rcx
movl %ecx, 0x4(%rsp)
jmp 0x7646
pushq $0x24
popq %rax
movq 0x18(%rsp), %rbp
jmp 0x7641
pushq $0x24
popq %rax
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rbx
cmpl $0x24, %eax
je 0x7390
testl %eax, %eax
je 0x7390
movq 0x78(%rsp), %r12
movq 0x48(%rsp), %rbx
incq %r14
cmpq %rbx, %r14
jne 0x6c7b
movq %r12, %rdi
movq %r10, %rbx
movq %r11, %r14
callq 0x2220
movq %r14, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x2220
movq 0xd0(%rsp), %rdi
callq 0x2220
movq 0xe8(%rsp), %rdi
callq 0x2220
movq 0x100(%rsp), %rdi
callq 0x2220
movq 0x118(%rsp), %rdi
callq 0x2220
movq 0x130(%rsp), %rdi
callq 0x2220
testl %r13d, %r13d
je 0x76ee
movq %r15, %rdi
callq 0xa02fa
movq %r15, %rdi
callq 0xa0333
movq %r15, %rdi
callq 0xa03e9
orb $-0x80, 0x17(%r15)
movq 0x2828eb(%rip), %r14    # 0x289fe0
movq (%r14), %rdi
leaq 0x222967(%rip), %rsi    # 0x22a066
leaq 0x222983(%rip), %rbx    # 0x22a089
movq %rbx, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %r14
callq 0x300fc
subsd 0xb8(%rsp), %xmm0
leaq 0x2228d6(%rip), %rsi    # 0x22a001
movq %r14, %rdi
movq %rbx, %rdx
movb $0x1, %al
callq 0x22b0
movl %r13d, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq