// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: asg_arc_cut_inexact_debug(asg_t*, ma_hit_t_alloc*, asg64_v*, int, unsigned int, unsigned int, asg64_v*)
void asg_arc_cut_inexact_debug(asg_t *g, ma_hit_t_alloc* src, asg64_v *in, int32_t max_ext, uint32_t is_ou, uint32_t is_trio, asg64_v *dbg)
{
    asg64_v tx = {0,0,0}, *b = NULL;
    uint32_t v, w, i, k, nv, nw, kv, kw, iv, iw, n_vtx = g->n_seq<<1, to_del, cnt = 0, ov_max = 0, ow_max = 0, ov_max_i = 0;
    asg_arc_t *av = NULL, *aw = NULL, *a = NULL;
    if(in) b = in;
    else b = &tx;
    b->n = 0;

    for (v = 0; v < n_vtx; ++v)  {
        if(g->seq[v>>1].del) continue;
        if(g->seq_vis[v] == 0) {
            av = asg_arc_a(g, v); nv = asg_arc_n(g, v);
            if (nv < 2) continue;
            for (i = kv = 0; i < nv; ++i) {
                if(av[i].del) continue;
                kv++;
            }
            if(kv < 2) continue;

            for (i = 0; i < nv; ++i) {
                if(av[i].del || av[i].el) continue;
                kv_push(uint64_t, *b, (uint64_t)((uint64_t)av[i].ol << 32 | (av - g->arc + i)));   
            }
        }
	}
    radix_sort_srt64(b->a, b->a + b->n);

    for (k = 0; k < b->n; k++) {
        a = &g->arc[(uint32_t)b->a[k]];
        if(a->del) continue;
        v = (a->ul)>>32, w = a->v^1; to_del = 0;
        nv = asg_arc_n(g, v), nw = asg_arc_n(g, w);
        if(((v>>1) == 50356 && (w>>1) == 1276292)||((v>>1) == 1276292 && (w>>1) == 50356)) {
            fprintf(stderr, "[0]v->%u, w->%u, nv->%u, nw->%u\n", v, w, nv, nw);
        }
        if (nv == 1 && nw == 1) continue;
        av = asg_arc_a(g, v), aw = asg_arc_a(g, w);
        ov_max = ow_max = ov_max_i = 0;

        for (i = 0, kv = 0; i < nv; ++i) {
			if (av[i].del) continue;
			if (ov_max < av[i].ol) {
                ov_max = av[i].ol;
                ov_max_i = i;
            }
			++kv;
		}
        if(((v>>1) == 50356 && (w>>1) == 1276292)||((v>>1) == 1276292 && (w>>1) == 50356)) {
            fprintf(stderr, "[1]v->%u, w->%u, kv->%u, a->ol->%u, ov_max->%u\n", v, w, kv, a->ol, ov_max);
        }
		if (kv >= 2 && a->ol == ov_max) continue;

        for (i = 0, kw = 0; i < nw; ++i) {
			if (aw[i].del) continue;
			if (ow_max < aw[i].ol) {
                ow_max = aw[i].ol;
            }
			++kw;
		}
        if(((v>>1) == 50356 && (w>>1) == 1276292)||((v>>1) == 1276292 && (w>>1) == 50356)) {
            fprintf(stderr, "[2]v->%u, w->%u, kw->%u, a->ol->%u, ow_max->%u\n", v, w, kw, a->ol, ow_max);
        }
		if (kw >= 2 && a->ol == ow_max) continue;

        if (kv <= 1 && kw <= 1) continue;

        ///to see which one is the current edge (from v and w)
		for (iv = 0; iv < nv; ++iv)
			if (av[iv].v == (w^1)) break;
		for (iw = 0; iw < nw; ++iw)
			if (aw[iw].v == (v^1)) break;
        ///if one edge has been deleted, it should be deleted in both direction
        if (av[iv].del && aw[iw].del) continue;

        ///if this edge is an inexact edge
        if(a->el == 0 && src[v>>1].is_fully_corrected == 1 && src[w>>1].is_fully_corrected == 1) {
            if (kv > 1 && kw > 1) {
				to_del = 1;
            } else if (kw == 1) {
                if (asg_topocut_aux(g, w^1, max_ext) < max_ext) to_del = 1;
            } else if (kv == 1) {
                if (asg_topocut_aux(g, v^1, max_ext) < max_ext) to_del = 1;
            }
        }

        if(a->el == 0 && src[v>>1].is_fully_corrected == 1 && src[w>>1].is_fully_corrected == 0) {
            if(av[ov_max_i].el == 1 && src[av[ov_max_i].v>>1].is_fully_corrected == 1) {
                if (kv > 1 && kw > 1) {
                    to_del = 1;
                } else if (kw == 1) {
                    if (asg_topocut_aux(g, w^1, max_ext) < max_ext) to_del = 1;
                } else if (kv == 1) {
                    if (asg_topocut_aux(g, v^1, max_ext) < max_ext) to_del = 1;
                }
            }
        }

        if(((v>>1) == 50356 && (w>>1) == 1276292)||((v>>1) == 1276292 && (w>>1) == 50356)) {
            fprintf(stderr, "[3]v->%u, w->%u, to_del->%u, el->%u, src[v>>1].is_fully_corrected->%u, src[w>>1].is_fully_corrected->%u\n", 
                    v, w, to_del, a->el, src[v>>1].is_fully_corrected, src[w>>1].is_fully_corrected);
            fprintf(stderr, "[4]v->%u, w->%u, to_del->%u, av[ov_max_i].v->%u, av[ov_max_i].el->%u, src[av[ov_max_i].v>>1].is_fully_corrected->%u\n", 
                    v, w, to_del, av[ov_max_i].v, av[ov_max_i].el, src[av[ov_max_i].v>>1].is_fully_corrected);
        }

        if (to_del) {
            av[iv].del = aw[iw].del = 1, ++cnt;
            if(dbg) {
                kv_push(uint64_t, *dbg, (av - g->arc + iv)); 
                kv_push(uint64_t, *dbg, (aw - g->arc + iw)); 
                if(((v>>1) == 50356 && (w>>1) == 1276292)||((v>>1) == 1276292 && (w>>1) == 50356)) {
                    fprintf(stderr, "[5]v->%u, w->%u, (av-g->arc+iv)->%u, (aw-g->arc+iw)->%u\n", 
                    v, w, (uint32_t)(av - g->arc + iv), (uint32_t)(aw - g->arc + iw));
                }
            }
        }
    }

    if(!in) free(tx.a);
    if(dbg) {
        for (i = 0; i < dbg->n; i++) g->arc[dbg->a[i]].del = 0;
    }
    // if (cnt > 0) asg_cleanup(g);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, 0x6c(%rsp)
movl 0x14(%rdi), %eax
addl %eax, %eax
testq %rdx, %rdx
je 0x1e749c
movq $0x0, (%rdx)
movq %rsi, 0x70(%rsp)
testl %eax, %eax
movq %rdi, 0x8(%rsp)
movq %rdx, 0x20(%rsp)
je 0x1e767a
movl %eax, %r11d
xorl %r14d, %r14d
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
xorl %r10d, %r10d
xorl %eax, %eax
movq $0x0, 0x60(%rsp)
movq 0x20(%rdi), %rcx
movl %r14d, %esi
shrl %esi
cmpl $0x0, (%rcx,%rsi,8)
js 0x1e74e6
movq 0x30(%rdi), %rcx
cmpb $0x0, (%rcx,%r14)
je 0x1e74f9
movq %rax, %r15
incq %r14
movq %r15, %rax
cmpq %r11, %r14
jne 0x1e74cc
jmp 0x1e7686
movq 0x28(%rdi), %rcx
movq (%rcx,%r14,8), %rcx
testl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
je 0x1e74e6
movq 0x8(%rdi), %r8
movq %rcx, %rsi
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%r8,%rsi,8), %r9
movq %r9, 0x28(%rsp)
movl %ecx, %r12d
leaq (%r8,%rsi,8), %r13
addq $0xc, %r13
xorl %ecx, %ecx
movq %r12, %r9
movq %r13, %rsi
movl (%rsi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %ecx
addq $0x18, %rsi
decq %r9
jne 0x1e7534
cmpl $0x2, %ecx
jb 0x1e74e6
xorl %ebp, %ebp
cmpl $0x0, (%r13)
js 0x1e755f
cmpb $0x0, 0x6(%r13)
je 0x1e7567
movq %rax, %r15
jmp 0x1e7662
movq 0x60(%rsp), %rcx
testq %rdx, %rdx
je 0x1e7574
movq (%rdx), %rcx
movq %rax, %rsi
testq %rdx, %rdx
je 0x1e7580
movq 0x8(%rdx), %rsi
cmpq %rsi, %rcx
jne 0x1e75a7
movq %rax, %rcx
testq %rdx, %rdx
je 0x1e7591
movq 0x8(%rdx), %rcx
testq %rcx, %rcx
je 0x1e75ac
movq %rax, %rsi
testq %rdx, %rdx
je 0x1e75a2
movq 0x8(%rdx), %rsi
addq %rsi, %rsi
jmp 0x1e75b1
movq %rax, %r15
jmp 0x1e7607
movl $0x2, %esi
movq %rsi, %r15
testq %rdx, %rdx
je 0x1e75c0
movq %rsi, 0x8(%rdx)
movq %rax, %r15
movq %r11, %rbx
movq %r10, 0x18(%rsp)
movq %r10, %rdi
testq %rdx, %rdx
je 0x1e75d4
movq 0x10(%rdx), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
je 0x1e75f7
movq %rax, 0x10(%rdx)
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %r10
jmp 0x1e75ff
movq %rax, %r10
movq 0x8(%rsp), %rdi
movq %rbx, %r11
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movl (%r13), %eax
andl %ebx, %eax
movq 0x28(%rsp), %rcx
subq 0x8(%rdi), %rcx
movq %r10, %r9
testq %rdx, %rdx
je 0x1e7622
movq 0x10(%rdx), %r9
movq 0x60(%rsp), %rsi
testq %rdx, %rdx
je 0x1e762f
movq (%rdx), %rsi
leaq 0x1(%rsi), %r8
testq %rdx, %rdx
je 0x1e763d
movq %r8, (%rdx)
jmp 0x1e7642
movq %r8, 0x60(%rsp)
shlq $0x20, %rax
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %r8 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r8, %rcx
addq %rbp, %rcx
orq %rax, %rcx
movq %rcx, (%r9,%rsi,8)
incq %rbp
addq $0x18, %r13
movq %r15, %rax
cmpq %rbp, %r12
jne 0x1e7551
jmp 0x1e74e9
movq $0x0, 0x60(%rsp)
xorl %r10d, %r10d
movq %r10, %rdi
testq %rdx, %rdx
je 0x1e7692
movq 0x10(%rdx), %rdi
movq %r10, 0x18(%rsp)
movq 0x60(%rsp), %rax
testq %rdx, %rdx
je 0x1e76a4
movq (%rdx), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x1e3b6a
movq 0x20(%rsp), %r10
xorl %ebp, %ebp
movq 0x8(%rsp), %r9
movq 0x18(%rsp), %r11
movq 0x60(%rsp), %rax
testq %r10, %r10
je 0x1e76cb
movq (%r10), %rax
movl %ebp, %ebp
cmpq %rbp, %rax
jbe 0x1e7f45
movq %r11, %rax
testq %r10, %r10
je 0x1e76e2
movq 0x10(%r10), %rax
movq 0x8(%r9), %rcx
movl (%rax,%rbp,8), %eax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1e7dc7
leaq (%rcx,%rax,8), %rax
movq (%rax), %r8
movq %r8, %r12
shrq $0x20, %r12
movq %rax, 0x50(%rsp)
movl 0x8(%rax), %edx
movl %edx, %ecx
movq %rcx, 0x80(%rsp)
xorq $0x1, %rcx
movq 0x28(%r9), %rax
movq (%rax,%r12,8), %r15
movq %rcx, 0x58(%rsp)
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
shrq $0x21, %r8
movl %r8d, %eax
xorl $0xc4b4, %eax           # imm = 0xC4B4
movl %edx, 0x3c(%rsp)
andl $-0x2, %edx
movl %edx, %ecx
xorl $0x26f308, %ecx         # imm = 0x26F308
orl %eax, %ecx
sete %sil
je 0x1e7a1d
movl %r8d, %eax
xorl $0x137984, %eax         # imm = 0x137984
movl %edx, %ecx
xorl $0x18968, %ecx          # imm = 0x18968
orl %eax, %ecx
je 0x1e7a1d
cmpl $0x1, %r15d
jne 0x1e7782
cmpl $0x1, 0x28(%rsp)
je 0x1e7dc7
movq 0x8(%r9), %rdi
movq 0x28(%r9), %rax
movq (%rax,%r12,8), %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rbx
testl %r15d, %r15d
movl %edx, 0x4(%rsp)
movb %sil, 0x3(%rsp)
movq %rdi, 0x40(%rsp)
movq %rbx, 0x10(%rsp)
je 0x1e7823
movq %r8, %r14
movl %r15d, %ecx
leaq (%rdi,%rbx,8), %rdx
addq $0xc, %rdx
xorl %esi, %esi
xorl %edi, %edi
xorl %ebx, %ebx
xorl %r13d, %r13d
movl %ebx, %r8d
movl (%rdx), %r9d
cmpl %r9d, %ebx
movl %r9d, %ebx
cmoval %r8d, %ebx
movl %edi, %r10d
movl %esi, %edi
cmovael %r10d, %edi
xorl %r11d, %r11d
testl %r9d, %r9d
setns %r11b
cmovsl %r8d, %ebx
cmovsl %r10d, %edi
addl %r11d, %r13d
incq %rsi
addq $0x18, %rdx
cmpq %rsi, %rcx
jne 0x1e77c5
movl %edi, %ecx
movq %rcx, 0x78(%rsp)
movq 0x8(%rsp), %r9
movq 0x20(%rsp), %r10
movq 0x18(%rsp), %r11
movq %r14, %r8
movl 0x4(%rsp), %edx
movb 0x3(%rsp), %sil
jmp 0x1e7831
xorl %r13d, %r13d
xorl %ebx, %ebx
movq $0x0, 0x78(%rsp)
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %r14
testb %sil, %sil
jne 0x1e7a6d
movl %r8d, %eax
xorl $0x137984, %eax         # imm = 0x137984
movl %edx, %ecx
xorl $0x18968, %ecx          # imm = 0x18968
orl %eax, %ecx
je 0x1e7a6d
cmpl $0x2, %r13d
jb 0x1e7878
movq 0x50(%rsp), %rax
movl 0xc(%rax), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %ebx, %eax
je 0x1e7dc7
movq %r8, 0x30(%rsp)
movq %r12, 0x48(%rsp)
shrq $0x20, %r14
leaq (%r14,%r14,2), %r12
movq 0x28(%rsp), %rax
testl %eax, %eax
je 0x1e78d5
movl %eax, %ecx
movq 0x40(%rsp), %rax
leaq (%rax,%r12,8), %rax
addq $0xc, %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %ebx, %ebx
xorl %r14d, %r14d
movl (%rax,%rdx), %esi
cmpl %esi, %ebx
movl %esi, %edi
cmoval %ebx, %edi
xorl %r8d, %r8d
testl %esi, %esi
cmovnsl %edi, %ebx
setns %r8b
addl %r8d, %r14d
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x1e78b1
jmp 0x1e78da
xorl %r14d, %r14d
xorl %ebx, %ebx
movb 0x3(%rsp), %sil
testb %sil, %sil
movq 0x48(%rsp), %rdx
movq 0x30(%rsp), %r8
movl 0x4(%rsp), %edi
jne 0x1e7dce
movl %r8d, %eax
xorl $0x137984, %eax         # imm = 0x137984
movl %edi, %ecx
xorl $0x18968, %ecx          # imm = 0x18968
orl %eax, %ecx
je 0x1e7dce
cmpl $0x2, %r14d
jb 0x1e792b
movq 0x50(%rsp), %rax
movl 0xc(%rax), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %ebx, %eax
je 0x1e7dc7
cmpl $0x1, %r13d
ja 0x1e793b
cmpl $0x2, %r14d
jb 0x1e7dc7
movq %r12, %rdi
xorl %r12d, %r12d
movl $0x0, %ebx
testl %r15d, %r15d
je 0x1e7975
movq 0x40(%rsp), %rax
movq 0x10(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
addq $0x8, %rax
xorl %ebx, %ebx
movl 0x3c(%rsp), %ecx
cmpl %ecx, (%rax)
je 0x1e7975
incl %ebx
addq $0x18, %rax
cmpl %ebx, %r15d
jne 0x1e7963
movl %r15d, %ebx
movq 0x28(%rsp), %r15
testl %r15d, %r15d
je 0x1e79a7
movq 0x40(%rsp), %rax
leaq (%rax,%rdi,8), %rax
addq $0x8, %rax
xorl %r12d, %r12d
movl (%rax), %ecx
xorl %edx, %ecx
cmpl $0x1, %ecx
je 0x1e79a7
incl %r12d
addq $0x18, %rax
cmpl %r12d, %r15d
jne 0x1e798f
movl %r15d, %r12d
movq 0x40(%rsp), %rax
movq 0x10(%rsp), %rcx
leaq (%rax,%rcx,8), %r15
leaq (%rax,%rdi,8), %rax
movq %rax, 0x40(%rsp)
movl %ebx, %eax
movq %rax, 0x88(%rsp)
leaq (%rax,%rax,2), %rax
movq %rax, 0x90(%rsp)
cmpl $0x0, 0xc(%r15,%rax,8)
movl 0x4(%rsp), %edi
jns 0x1e79f7
movl %r12d, %eax
leaq (%rax,%rax,2), %rax
movq 0x40(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1e7dc7
movl $0x0, 0x10(%rsp)
movq 0x50(%rsp), %rax
cmpb $0x0, 0x12(%rax)
movq %r15, 0x28(%rsp)
je 0x1e7ac8
movq 0x70(%rsp), %rcx
jmp 0x1e7b73
movq 0xa25bc(%rip), %rax     # 0x289fe0
movl %edx, 0x4(%rsp)
movq (%rax), %rdi
movl %esi, %r13d
leaq 0x519e0(%rip), %rsi     # 0x239415
movl %r12d, %edx
movq 0x58(%rsp), %rcx
movq %r8, %r14
movl %r15d, %r8d
movq 0x28(%rsp), %r9
xorl %eax, %eax
callq 0x22b0
movl %r13d, %esi
movl 0x4(%rsp), %edx
movq %r14, %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
jmp 0x1e7771
movq 0xa256c(%rip), %rax     # 0x289fe0
movq (%rax), %rdi
movq 0x50(%rsp), %rax
movl 0xc(%rax), %r9d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r9d
subq $0x8, %rsp
leaq 0x519a3(%rip), %rsi     # 0x239436
movl %r12d, %edx
movq 0x60(%rsp), %rcx
movq %r8, 0x38(%rsp)
movl %r13d, %r8d
xorl %eax, %eax
pushq %rbx
callq 0x22b0
movq 0x40(%rsp), %r8
movq 0x28(%rsp), %r11
movq 0x30(%rsp), %r10
movq 0x18(%rsp), %r9
addq $0x10, %rsp
jmp 0x1e785b
movl %r8d, %eax
leaq (%rax,%rax,2), %rax
movq 0x70(%rsp), %rcx
cmpb $0x1, 0x10(%rcx,%rax,8)
jne 0x1e7b73
movq 0x80(%rsp), %rax
shrl %eax
leaq (%rax,%rax,2), %rax
cmpb $0x1, 0x10(%rcx,%rax,8)
jne 0x1e7b73
cmpl $0x2, %r13d
jb 0x1e7b08
movl $0x1, 0x10(%rsp)
cmpl $0x1, %r14d
ja 0x1e7b73
movl 0x3c(%rsp), %esi
cmpl $0x1, %r14d
je 0x1e7b2a
movl $0x0, 0x10(%rsp)
cmpl $0x1, %r13d
movb 0x3(%rsp), %sil
jne 0x1e7b73
movl %edx, %esi
xorl $0x1, %esi
movq %r9, %rdi
movl 0x6c(%rsp), %r15d
movl %r15d, %edx
callq 0xaa77e
movl 0x4(%rsp), %edi
movq 0x30(%rsp), %r8
movq 0x48(%rsp), %rdx
movq 0x18(%rsp), %r11
movq 0x70(%rsp), %rcx
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
xorl %esi, %esi
cmpl %r15d, %eax
movq 0x28(%rsp), %r15
setl %sil
movl %esi, 0x10(%rsp)
movb 0x3(%rsp), %sil
movq 0x50(%rsp), %rax
cmpb $0x0, 0x12(%rax)
jne 0x1e7c3d
movl %r8d, %eax
leaq (%rax,%rax,2), %rax
cmpb $0x1, 0x10(%rcx,%rax,8)
jne 0x1e7c3d
movq 0x80(%rsp), %rax
shrl %eax
leaq (%rax,%rax,2), %rax
cmpb $0x0, 0x10(%rcx,%rax,8)
jne 0x1e7c3d
movq 0x78(%rsp), %rax
leaq (%rax,%rax,2), %rax
cmpb $0x1, 0x12(%r15,%rax,8)
jne 0x1e7c3d
leaq (%r15,%rax,8), %rax
movl 0x8(%rax), %eax
shrl %eax
leaq (%rax,%rax,2), %rax
cmpb $0x1, 0x10(%rcx,%rax,8)
jne 0x1e7c3d
cmpl $0x2, %r13d
jb 0x1e7be4
movl $0x1, %r15d
cmpl $0x1, %r14d
ja 0x1e7c42
cmpl $0x1, %r14d
je 0x1e7bf9
cmpl $0x1, %r13d
jne 0x1e7c3d
movl %edx, %eax
xorl $0x1, %eax
movl %eax, 0x3c(%rsp)
movq %r9, %rdi
movl 0x3c(%rsp), %esi
movl 0x6c(%rsp), %r14d
movl %r14d, %edx
callq 0xaa77e
movb 0x3(%rsp), %sil
movl 0x4(%rsp), %edi
movq 0x30(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
cmpl %r14d, %eax
movl $0x1, %eax
movl 0x10(%rsp), %r15d
cmovll %eax, %r15d
jmp 0x1e7c42
movl 0x10(%rsp), %r15d
testb %sil, %sil
jne 0x1e7e30
movl %r8d, %eax
xorl $0x137984, %eax         # imm = 0x137984
movl %edi, %ecx
xorl $0x18968, %ecx          # imm = 0x18968
orl %eax, %ecx
je 0x1e7e30
testl %r15d, %r15d
movq 0x28(%rsp), %rax
je 0x1e7dc7
movq 0x90(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
addq $0xc, %rax
movl %r12d, %r14d
leaq (%r14,%r14,2), %rcx
movq 0x40(%rsp), %rdx
orb $-0x80, 0xf(%rdx,%rcx,8)
orb $-0x80, 0x3(%rax)
cmpq $0x0, 0xd0(%rsp)
je 0x1e7dc7
movq 0xd0(%rsp), %r15
movq 0x8(%r15), %rax
cmpq %rax, (%r15)
jne 0x1e7cef
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r15)
movq 0x10(%r15), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x30(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
movq %rax, 0x10(%r15)
movq 0x28(%rsp), %rax
subq 0x8(%r9), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq 0x88(%rsp), %rax
movq (%r15), %rcx
movq 0x10(%r15), %rdi
leaq 0x1(%rcx), %rdx
movq %rdx, (%r15)
movq %rax, (%rdi,%rcx,8)
movq 0x8(%r15), %rax
cmpq %rax, (%r15)
jne 0x1e7d62
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%r15)
shlq $0x3, %rsi
callq 0x2370
movq 0x30(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
movq %rax, 0x10(%r15)
movq 0x8(%r9), %rax
movq 0x40(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq %rdx, %r13
addq %rdx, %r14
movq (%r15), %rcx
movq 0x10(%r15), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r15)
movq %r14, (%rdx,%rcx,8)
cmpb $0x0, 0x3(%rsp)
movq 0x48(%rsp), %rdx
movl 0x4(%rsp), %ecx
movq 0x28(%rsp), %rsi
jne 0x1e7efc
xorl $0x137984, %r8d         # imm = 0x137984
xorl $0x18968, %ecx          # imm = 0x18968
orl %r8d, %ecx
je 0x1e7efc
incl %ebp
jmp 0x1e76be
movq 0xa220b(%rip), %rax     # 0x289fe0
movq (%rax), %rdi
movq 0x50(%rsp), %rax
movl 0xc(%rax), %r9d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r9d
subq $0x8, %rsp
leaq 0x51672(%rip), %rsi     # 0x239466
movq 0x50(%rsp), %rdx
movq 0x60(%rsp), %rcx
movl %r14d, %r8d
xorl %eax, %eax
pushq %rbx
callq 0x22b0
movb 0x13(%rsp), %sil
movq 0x40(%rsp), %r8
movq 0x58(%rsp), %rdx
movq 0x28(%rsp), %r11
movq 0x30(%rsp), %r10
movq 0x18(%rsp), %r9
addq $0x10, %rsp
jmp 0x1e790e
movq 0xa21a9(%rip), %rax     # 0x289fe0
movq (%rax), %rdi
movq 0x50(%rsp), %rax
movzbl 0x12(%rax), %r9d
movl %r8d, %eax
leaq (%rax,%rax,2), %rax
movq 0x70(%rsp), %r14
movzbl 0x10(%r14,%rax,8), %r10d
movq 0x80(%rsp), %rax
shrl %eax
leaq (%rax,%rax,2), %rax
movzbl 0x10(%r14,%rax,8), %r11d
leaq 0x51625(%rip), %rsi     # 0x239496
movq 0x48(%rsp), %rdx
movq 0x58(%rsp), %r13
movl %r13d, %ecx
movl %r15d, %r8d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
addq $0x10, %rsp
movq 0xa2149(%rip), %rax     # 0x289fe0
movq (%rax), %rdi
movq 0x78(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
movl 0x8(%rcx,%rax,8), %r9d
movzbl 0x12(%rcx,%rax,8), %r10d
movl %r9d, %eax
shrl %eax
leaq (%rax,%rax,2), %rax
movzbl 0x10(%r14,%rax,8), %r11d
leaq 0x51636(%rip), %rsi     # 0x2394ff
movq 0x48(%rsp), %rdx
movl %r13d, %ecx
movl %r15d, %r8d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
movq 0x40(%rsp), %r8
movq 0x28(%rsp), %r11
movq 0x30(%rsp), %r10
movq 0x18(%rsp), %r9
addq $0x10, %rsp
jmp 0x1e7c63
movq 0xa20dd(%rip), %rcx     # 0x289fe0
movq (%rcx), %rdi
subq %rax, %rsi
shrq $0x3, %rsi
imull $0xaaaaaaab, %esi, %eax # imm = 0xAAAAAAAB
addl %eax, %ebx
addl %r13d, %r12d
leaq 0x51655(%rip), %rsi     # 0x239574
movq 0x58(%rsp), %rcx
movl %ebx, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
jmp 0x1e7dc7
testq %r10, %r10
jne 0x1e7f57
movq %r11, %rdi
callq 0x2220
movq 0x8(%rsp), %r9
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x1e7f92
cmpq $0x0, (%rdi)
je 0x1e7f92
movl $0x1, %eax
xorl %ecx, %ecx
movq 0x8(%r9), %rdx
movq 0x10(%rdi), %rsi
movq (%rsi,%rcx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
andl $0x7fffffff, 0xc(%rdx,%rcx,8) # imm = 0x7FFFFFFF
movl %eax, %ecx
incl %eax
cmpq %rcx, (%rdi)
ja 0x1e7f71
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq