// File: /workspace/github_cpp_makefile_star2_O3/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 $0x128, %rsp            # imm = 0x128
movq %r8, 0x98(%rsp)
movq %rcx, 0x90(%rsp)
movq %rdx, 0xa0(%rsp)
movl %esi, 0x58(%rsp)
movss %xmm1, 0x80(%rsp)
movss %xmm0, 0x84(%rsp)
movq %rdi, %r13
callq 0x2f3fc
movsd %xmm0, 0xa8(%rsp)
movl 0x14(%r13), %eax
leal (%rax,%rax), %ebx
testl %eax, %eax
js 0x6d0f
movq %r13, %rdi
callq 0xa0ab6
movq %r13, %rdi
callq 0xa0b79
orb $-0x80, 0x17(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%rsp)
movups %xmm0, 0x108(%rsp)
movups %xmm0, 0xf8(%rsp)
movups %xmm0, 0xe8(%rsp)
movups %xmm0, 0xd8(%rsp)
movups %xmm0, 0xc8(%rsp)
movl %ebx, %r14d
pushq $0x1c
popq %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x48(%rsp)
movq %rax, 0xc0(%rsp)
testl %ebx, %ebx
movq %r13, 0x8(%rsp)
jne 0x6d88
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
callq 0x9dc69
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0x6e60
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x30(%r13), %rax
cmpb $0x0, (%rax,%rbx)
jne 0x6e2e
movq %r12, %rdi
movq 0x28(%r13), %rcx
movq (%rcx,%rbx,8), %rax
movl %eax, %r12d
testl %eax, %eax
je 0x6df8
movq 0x8(%r13), %rdx
cmpl $0x1, %eax
jne 0x6dcc
movl %ebx, %esi
xorq $0x1, %rsi
cmpl $0x1, (%rcx,%rsi,8)
jne 0x6dcc
movq %rdi, %r12
jmp 0x6e2e
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq %rdx, %rax
addq $0xc, %rax
xorl %ecx, %ecx
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addq %rdx, %rcx
addq $0x18, %rax
decq %r12
jne 0x6ddd
shlq $0x20, %rcx
movq %rcx, %r12
cmpq %r15, %rbp
jne 0x6e1e
leaq (,%rbp,2), %r15
testq %rbp, %rbp
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,8), %rsi
callq 0x2370
jmp 0x6e21
movq %rdi, %rax
orq %rbx, %r12
movq %r12, (%rax,%rbp,8)
incq %rbp
movq %rax, %r12
incq %rbx
cmpq %r14, %rbx
jne 0x6d92
leaq (%r12,%rbp,8), %rsi
movq %r12, %rdi
callq 0x9dc69
testq %rbp, %rbp
jne 0x6e73
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq %r12, %rbx
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %r14d, %r14d
jmp 0x7742
xorl %ecx, %ecx
movq $0x0, 0x60(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %r11d, %r11d
xorl %r10d, %r10d
movq %rbp, 0x30(%rsp)
movq %r12, 0x68(%rsp)
movq (%r12,%rcx,8), %rdi
movq 0x20(%r13), %rax
movl %edi, %edx
shrl %edx
movq %rdx, 0x48(%rsp)
cmpl $0x0, (%rax,%rdx,8)
js 0x76ed
movq %rcx, 0x50(%rsp)
movl %edi, %eax
movq 0x28(%r13), %rcx
movq (%rcx,%rax,8), %rdx
testl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
je 0x76e8
movq %rdx, %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %rsi
je 0x76e8
movq %rdi, 0xb0(%rsp)
movq 0x8(%r13), %rax
movq %rdx, 0x70(%rsp)
shrq $0x20, %rdx
imulq $0x18, %rdx, %rdx
leaq (%rax,%rdx), %r9
addq %rax, %rdx
addq $0xc, %rdx
imulq $0x18, %rsi, %rsi
xorl %edi, %edi
xorl %r12d, %r12d
movl (%rdx,%rdi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %r12d
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0x6f08
cmpl $0x2, %r12d
jae 0x6f2f
movq 0x68(%rsp), %r12
jmp 0x76e8
movl %r14d, 0x5c(%rsp)
movl 0x70(%rsp), %edx
movq %rdx, 0x38(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x28(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %r9, 0x40(%rsp)
imulq $0x18, %r14, %r13
cmpl $0x0, 0xc(%r9,%r13)
js 0x70e4
addq %r9, %r13
movl 0x8(%r13), %edx
movq %rdx, %rbp
xorq $0x1, %rbp
movq (%rcx,%rbp,8), %rsi
testl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
je 0x70f4
movq %rsi, %rbx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
andq %rdi, %rbx
je 0x70f4
movq %r10, 0x20(%rsp)
shrq $0x20, %rsi
imulq $0x18, %rsi, %rsi
addq %rax, %rsi
addq $0xc, %rsi
imulq $0x18, %rbx, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
movl (%rsi,%r8), %r10d
notl %r10d
shrl $0x1f, %r10d
addl %r10d, %r9d
addq $0x18, %r8
cmpq %r8, %rdi
jne 0x6fbc
cmpl $0x2, %r9d
jb 0x70fb
movq 0x10(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
jne 0x701e
leaq (%rsi,%rsi), %rcx
testq %rsi, %rsi
pushq $0x2
popq %rax
cmoveq %rax, %rcx
movq %rcx, 0x60(%rsp)
leaq (,%rcx,4), %rsi
movq %r15, %rdi
movq %r11, %r15
callq 0x2370
movq 0x10(%rsp), %rsi
movq %r15, %r11
movq %rax, %r15
movl 0x8(%r13), %edx
movq 0x20(%rsp), %r10
movl %edx, (%r15,%rsi,4)
cmpq %r10, 0x18(%rsp)
jne 0x705c
movq %r15, 0x20(%rsp)
leaq (%r10,%r10), %r15
testq %r10, %r10
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,4), %rsi
movq %r11, %rdi
callq 0x2370
movq %rax, %r11
movq %r15, %r10
movq 0x20(%rsp), %r15
movq 0x40(%rsp), %r9
incq 0x10(%rsp)
movq 0x18(%rsp), %rax
movl %ebp, (%r11,%rax,4)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rcx), %rcx
movl 0x4(%rcx,%rbp,8), %edx
imulq $0x18, %rdx, %rdx
leaq (%rax,%rdx), %rsi
addq $0xc, %rsi
pushq $-0x1
popq %rdx
movq 0x30(%rsp), %rbp
movl (%rsi), %edi
testl %edi, %edi
js 0x70ae
movl -0x4(%rsi), %r8d
shrl %r8d
cmpl %edx, %edi
cmovael %edx, %edi
cmpl 0x48(%rsp), %r8d
cmovnel %edi, %edx
addq $0x18, %rsi
decq %rbx
jne 0x7094
movl 0xc(%r13), %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %esi
cvtsi2ss %esi, %xmm0
movl %edx, %edx
cvtsi2ss %rdx, %xmm1
incq 0x18(%rsp)
mulss 0x84(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x70e4
incl 0x28(%rsp)
incq %r14
cmpq 0x38(%rsp), %r14
jne 0x6f5f
jmp 0x710a
movq 0x30(%rsp), %rbp
jmp 0x710a
movq 0x30(%rsp), %rbp
movq 0x20(%rsp), %r10
movq 0x40(%rsp), %r9
cmpl %r12d, 0x28(%rsp)
jne 0x7120
movl 0x5c(%rsp), %r14d
movq 0x10(%rsp), %rdx
jmp 0x7514
movl 0x70(%rsp), %edx
movq %rdx, 0x78(%rsp)
xorl %r13d, %r13d
movl $0x0, 0x38(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
imulq $0x18, %r13, %rbx
cmpl $0x0, 0xc(%r9,%rbx)
js 0x72c5
addq %r9, %rbx
movl 0x8(%rbx), %edx
movq %rdx, %rbp
xorq $0x1, %rbp
movq (%rcx,%rbp,8), %rcx
testl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
je 0x72d5
movq %rcx, %r14
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %r14
je 0x72d5
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addq $0xc, %rax
imulq $0x18, %r14, %rcx
xorl %esi, %esi
xorl %edi, %edi
movl (%rax,%rsi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %edi
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0x719b
cmpl $0x2, %edi
movq 0x10(%rsp), %rsi
jb 0x72d5
cmpq 0x60(%rsp), %rsi
jne 0x7205
leaq (%rsi,%rsi), %rcx
testq %rsi, %rsi
pushq $0x2
popq %rax
cmoveq %rax, %rcx
movq %rcx, 0x60(%rsp)
leaq (,%rcx,4), %rsi
movq %r15, %rdi
movq %r11, 0x28(%rsp)
movq %r10, %r15
callq 0x2370
movq 0x10(%rsp), %rsi
movq %r15, %r10
movq 0x28(%rsp), %r11
movq %rax, %r15
movl 0x8(%rbx), %edx
movl %edx, (%r15,%rsi,4)
cmpq %r10, 0x18(%rsp)
jne 0x723e
movq %r15, 0x20(%rsp)
leaq (%r10,%r10), %r15
testq %r10, %r10
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,4), %rsi
movq %r11, %rdi
callq 0x2370
movq %rax, %r11
movq %r15, %r10
movq 0x20(%rsp), %r15
movq 0x40(%rsp), %r9
incq 0x10(%rsp)
movq 0x18(%rsp), %rax
movl %ebp, (%r11,%rax,4)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rcx), %rcx
movl 0x4(%rcx,%rbp,8), %edx
imulq $0x18, %rdx, %rdx
leaq (%rax,%rdx), %rsi
addq $0xc, %rsi
pushq $-0x1
popq %rdx
movq 0x30(%rsp), %rbp
movl (%rsi), %edi
testl %edi, %edi
js 0x7290
movl -0x4(%rsi), %r8d
shrl %r8d
cmpl %edx, %edi
cmovael %edx, %edi
cmpl 0x48(%rsp), %r8d
cmovnel %edi, %edx
addq $0x18, %rsi
decq %r14
jne 0x7276
movl 0xc(%rbx), %esi
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %esi
cvtsi2ss %esi, %xmm0
movl %edx, %edx
cvtsi2ss %rdx, %xmm1
incq 0x18(%rsp)
mulss 0x80(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x72c5
incl 0x38(%rsp)
incq %r13
cmpq 0x78(%rsp), %r13
jne 0x7146
jmp 0x72da
movq 0x30(%rsp), %rbp
movl 0x38(%rsp), %r14d
cmpl %r12d, %r14d
movq 0x10(%rsp), %rdx
jne 0x7506
movq %r10, 0x20(%rsp)
movq %r11, 0x28(%rsp)
pushq $0x1
popq %r14
cmpq $0x2, %rdx
movq 0x8(%rsp), %r10
movq 0x98(%rsp), %r9
movq 0x90(%rsp), %rbp
movq 0xa0(%rsp), %r13
jb 0x736e
pushq $0x2
popq %rbx
pushq $0x1
popq %rax
movl %r14d, 0x38(%rsp)
movl (%r15), %edi
movl (%r15,%rax,4), %esi
movq %r10, %rdx
movq %r13, %rcx
movq %rbp, %r8
movq %r15, %r14
movq %r9, %r15
callq 0xaad4d
movq %r15, %r9
movq %r14, %r15
movq 0x8(%rsp), %r10
movl 0x38(%rsp), %r14d
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
cmpq $0x1, %rax
sete %cl
addl %ecx, %r14d
movl %ebx, %eax
incl %ebx
cmpq %rax, %rdx
ja 0x7324
cmpl %r12d, %r14d
setne %al
cmpq $0x2, 0x18(%rsp)
setae %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %r11
movq 0x20(%rsp), %r10
jne 0x7506
movl (%r11), %eax
movq 0x8(%rsp), %rdi
movq 0x28(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rcx
je 0x7503
movq 0x8(%rdi), %rsi
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq %rsi, %rax
addq $0xc, %rax
imulq $0x18, %rcx, %rcx
xorl %r8d, %r8d
xorl %esi, %esi
movl (%rax,%r8), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %esi
addq $0x18, %r8
cmpq %r8, %rcx
jne 0x73d4
cmpl $0x2, %esi
jne 0x7503
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpl $0x0, (%rax,%r8)
js 0x740f
movl -0x4(%rax,%r8), %esi
movl %esi, %edi
shrl %edi
cmpl 0x48(%rsp), %edi
cmovnel %esi, %r9d
addq $0x18, %r8
cmpq %r8, %rcx
jne 0x73f7
movl %r9d, 0x78(%rsp)
xorl %r13d, %r13d
pushq $0x1
popq %rax
pushq $0x1
popq %r14
movl %r14d, %ebx
movl (%r11,%rax,4), %eax
movq 0x8(%rsp), %rdi
movq 0x28(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rcx
je 0x7506
movq 0x8(%rdi), %rsi
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq %rsi, %rax
addq $0xc, %rax
imulq $0x18, %rcx, %r8
xorl %ecx, %ecx
xorl %esi, %esi
movl (%rax,%rcx), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %esi
addq $0x18, %rcx
cmpq %rcx, %r8
jne 0x7467
cmpl $0x2, %esi
movq 0xa0(%rsp), %rcx
jne 0x7506
movl %r14d, 0x38(%rsp)
xorl %edx, %edx
movl 0x78(%rsp), %edi
cmpl $0x0, (%rax,%rdx)
js 0x74ab
movl -0x4(%rax,%rdx), %esi
movl %esi, %r9d
shrl %r9d
cmpl 0x48(%rsp), %r9d
cmovnel %esi, %r13d
addq $0x18, %rdx
cmpq %rdx, %r8
jne 0x7492
movl %r13d, %esi
movq 0x8(%rsp), %rdx
movq 0x90(%rsp), %r8
movq 0x98(%rsp), %r9
callq 0xaad4d
xorl %ecx, %ecx
cmpq $0x1, %rax
sete %cl
movl 0x38(%rsp), %r14d
addl %ecx, %r14d
incl %ebx
movq %rbx, %rax
cmpq %rbx, 0x18(%rsp)
movq 0x28(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %rdx
ja 0x742a
jmp 0x7506
xorl %r14d, %r14d
cmpl %r12d, %r14d
movl 0x5c(%rsp), %r14d
jne 0x76fb
movq %r11, 0x28(%rsp)
testq %rdx, %rdx
movq 0x8(%rsp), %rdi
movq 0x68(%rsp), %r12
movq %r10, 0x20(%rsp)
je 0x7549
movl (%r15), %eax
pushq $0x1
popq %rcx
xorl %esi, %esi
cmpl %eax, (%r15,%rsi,4)
jne 0x7549
movl %ecx, %esi
incl %ecx
cmpq %rsi, %rdx
ja 0x7535
movb $0x1, %r13b
jmp 0x759e
movq %r15, %rsi
movl 0x58(%rsp), %ecx
leaq 0xc0(%rsp), %r8
movq %rdx, %rbx
xorl %r9d, %r9d
leaq 0x8c(%rsp), %rax
pushq %rax
pushq $-0x1
callq 0xa5e58
popq %rcx
popq %rdx
movb $0x1, %r13b
cmpq $0x1, %rax
je 0x759e
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movl %ebx, %edx
leaq 0x88(%rsp), %rcx
leaq 0xb8(%rsp), %r8
xorl %r9d, %r9d
callq 0xa4faf
movl %eax, %r13d
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
movq 0x28(%rsp), %rsi
movq 0xb0(%rsp), %rdi
je 0x75d1
movl (%rsi), %eax
pushq $0x1
popq %rcx
xorl %r8d, %r8d
cmpl %eax, (%rsi,%r8,4)
jne 0x75d1
movl %ecx, %r8d
incl %ecx
cmpq %r8, %rdx
ja 0x75bd
movb $0x1, %al
jmp 0x7630
xorl $0x1, %edi
movq %rdi, %r10
movq 0x8(%rsp), %rdi
movl 0x58(%rsp), %ecx
leaq 0xc0(%rsp), %r8
pushq $0x1
popq %r9
leaq 0x8c(%rsp), %rax
pushq %rax
pushq %r10
movq %rdx, %rbx
callq 0xa5e58
popq %rcx
popq %rdx
movq %rax, %rcx
movb $0x1, %al
cmpq $0x1, %rcx
je 0x7630
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl %ebx, %edx
leaq 0x88(%rsp), %rcx
leaq 0xb8(%rsp), %r8
xorl %r9d, %r9d
callq 0xa4faf
andb %al, %r13b
cmpb $0x1, %r13b
jne 0x76d9
movl 0x70(%rsp), %eax
xorl %ecx, %ecx
movq 0x8(%rsp), %r13
movq 0x28(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x40(%rsp), %r9
imulq $0x18, %rcx, %rdx
movl 0xc(%r9,%rdx), %esi
testl %esi, %esi
js 0x76cf
addq %r9, %rdx
incl %r14d
orl $0x80000000, %esi       # imm = 0x80000000
movl %esi, 0xc(%rdx)
movl 0x8(%rdx), %esi
xorq $0x1, %rsi
movq 0x28(%r13), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, %rsi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
andq %r8, %rsi
je 0x76cf
movl 0x4(%rdx), %edx
movq 0x8(%r13), %r8
shrq $0x20, %rdi
imulq $0x18, %rsi, %rsi
imulq $0x18, %rdi, %rdi
addq %r8, %rdi
addq $0xc, %rdi
xorl %r8d, %r8d
movl -0x4(%rdi,%r8), %r9d
xorl %edx, %r9d
cmpl $0x1, %r9d
jne 0x76c1
orb $-0x80, 0x3(%rdi,%r8)
addq $0x18, %r8
cmpq %r8, %rsi
jne 0x76ad
movq 0x40(%rsp), %r9
incq %rcx
cmpq %rax, %rcx
jne 0x7657
jmp 0x76e8
movq 0x8(%rsp), %r13
movq 0x28(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x50(%rsp), %rcx
incq %rcx
cmpq %rbp, %rcx
jne 0x6e94
jmp 0x7705
movq 0x8(%rsp), %r13
jmp 0x6f25
movq 0xc0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xd8(%rsp), %r13
movq %r12, %rbx
movq 0xf0(%rsp), %r12
movq 0x108(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r11, %rbp
movq %rbx, %rdi
callq 0x2220
movq %r15, %rdi
callq 0x2220
movq %rbp, %rdi
callq 0x2220
movq 0x48(%rsp), %rdi
callq 0x2220
movq %r13, %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2220
movq 0x10(%rsp), %rdi
callq 0x2220
movq 0x18(%rsp), %rdi
callq 0x2220
movl %r14d, %ebp
testl %r14d, %r14d
je 0x77b1
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa0a7d
movq %rbx, %rdi
callq 0xa0ab6
movq %rbx, %rdi
callq 0xa0b79
orb $-0x80, 0x17(%rbx)
movq 0x28d828(%rip), %r14    # 0x294fe0
movq (%r14), %rdi
leaq 0x22ea94(%rip), %rsi    # 0x236256
leaq 0x22eab0(%rip), %rbx    # 0x236279
movq %rbx, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %r14
callq 0x2f3fc
subsd 0xa8(%rsp), %xmm0
leaq 0x22ea04(%rip), %rsi    # 0x2361f1
movq %r14, %rdi
movq %rbx, %rdx
movb $0x1, %al
callq 0x22b0
movl %ebp, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq