// File: 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
movq %rsp, %rbp
subq $0xe0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2100
movq $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x74(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x314a33
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x314a3b
leaq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x314c78
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x4c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x314a78
jmp 0x314c6a
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x4c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x314c68
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x4c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
cmpl $0x2, -0x5c(%rbp)
jae 0x314ad6
jmp 0x314c6a
movl $0x0, -0x64(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x314b1e
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x314b0a
jmp 0x314b13
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x314ae4
cmpl $0x2, -0x64(%rbp)
jae 0x314b29
jmp 0x314c6a
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x314c66
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x314b6f
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x12(%rax)
je 0x314b74
jmp 0x314c58
jmp 0x314b76
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x314be7
movq -0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x314ba6
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa8(%rbp)
jmp 0x314bb4
movl $0x2, %eax
movq %rax, -0xa8(%rbp)
jmp 0x314bb4
movq -0xa8(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
shlq $0x20, %rax
movq %rax, -0xb0(%rbp)
movq -0x90(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movl $0x18, %ecx
cqto
idivq %rcx
movq -0xb0(%rbp), %rdx
movl -0x54(%rbp), %ecx
addq %rcx, %rax
orq %rax, %rdx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x314c58
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x314b30
jmp 0x314c68
jmp 0x314c6a
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x314a4d
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x48(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x30ed90
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x315672
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x58(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x314cf0
jmp 0x315664
movq -0xa0(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x4c(%rbp)
movq -0xa0(%rbp), %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x50(%rbp)
movl $0x0, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x60(%rbp)
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x314d54
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
je 0x314d6c
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
jne 0x314d92
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x314d92
movq 0xaf26d(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0x5c(%rbp), %r8d
movl -0x60(%rbp), %r9d
leaq 0x8151e(%rip), %rsi     # 0x3962a9
movb $0x0, %al
callq 0x22a0
cmpl $0x1, -0x5c(%rbp)
jne 0x314da3
cmpl $0x1, -0x60(%rbp)
jne 0x314da3
jmp 0x315664
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x4c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x50(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x88(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0x80(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x314e9e
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x314e44
jmp 0x314e93
movl -0x80(%rbp), %eax
movq -0x90(%rbp), %rcx
movl -0x54(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x314e8a
movq -0x90(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x80(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x314e1e
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x314eb6
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
je 0x314ece
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
jne 0x314f08
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x314f08
movq 0xaf10b(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0x64(%rbp), %r8d
movq -0xa0(%rbp), %rax
movl 0xc(%rax), %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movl -0x80(%rbp), %eax
leaq 0x813cc(%rip), %rsi     # 0x3962ca
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
cmpl $0x2, -0x64(%rbp)
jb 0x314f27
movq -0xa0(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x80(%rbp), %eax
jne 0x314f27
jmp 0x315664
movl $0x0, -0x54(%rbp)
movl $0x0, -0x68(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0x314fb2
movq -0x98(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x314f5b
jmp 0x314fa7
movl -0x84(%rbp), %eax
movq -0x98(%rbp), %rcx
movl -0x54(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x314f9e
movq -0x98(%rbp), %rax
movl -0x54(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x84(%rbp)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x314f35
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x314fca
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
je 0x314fe2
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
jne 0x31501f
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x31501f
movq 0xaeff7(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0x68(%rbp), %r8d
movq -0xa0(%rbp), %rax
movl 0xc(%rax), %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movl -0x84(%rbp), %eax
leaq 0x812e5(%rip), %rsi     # 0x3962fa
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
cmpl $0x2, -0x68(%rbp)
jb 0x315041
movq -0xa0(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x84(%rbp), %eax
jne 0x315041
jmp 0x315664
cmpl $0x1, -0x64(%rbp)
ja 0x315052
cmpl $0x1, -0x68(%rbp)
ja 0x315052
jmp 0x315664
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x31508e
movq -0x90(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x50(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x315081
jmp 0x31508e
jmp 0x315083
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x315059
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0x3150ca
movq -0x98(%rbp), %rax
movl -0x70(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x4c(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3150bd
jmp 0x3150ca
jmp 0x3150bf
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x315095
movq -0x90(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x315107
movq -0x98(%rbp), %rax
movl -0x70(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x315107
jmp 0x315664
movq -0xa0(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x0, %eax
jne 0x3151bc
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x3151bc
movq -0x10(%rbp), %rax
movl -0x50(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x3151bc
cmpl $0x1, -0x64(%rbp)
jbe 0x31516a
cmpl $0x1, -0x68(%rbp)
jbe 0x31516a
movl $0x1, -0x78(%rbp)
jmp 0x3151ba
cmpl $0x1, -0x68(%rbp)
jne 0x315190
movq -0x8(%rbp), %rdi
movl -0x50(%rbp), %esi
xorl $0x1, %esi
movl -0x1c(%rbp), %edx
callq 0xdd220
cmpl -0x1c(%rbp), %eax
jge 0x31518e
movl $0x1, -0x78(%rbp)
jmp 0x3151b8
cmpl $0x1, -0x64(%rbp)
jne 0x3151b6
movq -0x8(%rbp), %rdi
movl -0x4c(%rbp), %esi
xorl $0x1, %esi
movl -0x1c(%rbp), %edx
callq 0xdd220
cmpl -0x1c(%rbp), %eax
jge 0x3151b4
movl $0x1, -0x78(%rbp)
jmp 0x3151b6
jmp 0x3151b8
jmp 0x3151ba
jmp 0x3151bc
movq -0xa0(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x0, %eax
jne 0x3152c7
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x3152c7
movq -0x10(%rbp), %rax
movl -0x50(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
cmpl $0x0, %eax
jne 0x3152c7
movq -0x90(%rbp), %rax
movl -0x88(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0x3152c5
movq -0x10(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x88(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x3152c5
cmpl $0x1, -0x64(%rbp)
jbe 0x315273
cmpl $0x1, -0x68(%rbp)
jbe 0x315273
movl $0x1, -0x78(%rbp)
jmp 0x3152c3
cmpl $0x1, -0x68(%rbp)
jne 0x315299
movq -0x8(%rbp), %rdi
movl -0x50(%rbp), %esi
xorl $0x1, %esi
movl -0x1c(%rbp), %edx
callq 0xdd220
cmpl -0x1c(%rbp), %eax
jge 0x315297
movl $0x1, -0x78(%rbp)
jmp 0x3152c1
cmpl $0x1, -0x64(%rbp)
jne 0x3152bf
movq -0x8(%rbp), %rdi
movl -0x4c(%rbp), %esi
xorl $0x1, %esi
movl -0x1c(%rbp), %edx
callq 0xdd220
cmpl -0x1c(%rbp), %eax
jge 0x3152bd
movl $0x1, -0x78(%rbp)
jmp 0x3152bf
jmp 0x3152c1
jmp 0x3152c3
jmp 0x3152c5
jmp 0x3152c7
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x3152df
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
je 0x3152ff
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
jne 0x3153e8
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x3153e8
movq 0xaecda(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0x78(%rbp), %r8d
movq -0xa0(%rbp), %rax
movzbl 0x12(%rax), %r9d
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %esi
shrl %esi
movl %esi, %esi
imulq $0x18, %rsi, %rsi
addq %rsi, %rax
movzbl 0x10(%rax), %r10d
movq -0x10(%rbp), %rax
movl -0x50(%rbp), %esi
shrl %esi
movl %esi, %esi
imulq $0x18, %rsi, %rsi
addq %rsi, %rax
movzbl 0x10(%rax), %eax
leaq 0x80fd7(%rip), %rsi     # 0x39632a
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x22a0
movq 0xaec77(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0x78(%rbp), %r8d
movq -0x90(%rbp), %rax
movl -0x88(%rbp), %esi
imulq $0x18, %rsi, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
movq -0x90(%rbp), %rax
movl -0x88(%rbp), %esi
imulq $0x18, %rsi, %rsi
addq %rsi, %rax
movzbl 0x12(%rax), %r10d
movq -0x10(%rbp), %rax
movq -0x90(%rbp), %rsi
movl -0x88(%rbp), %r11d
imulq $0x18, %r11, %r11
addq %r11, %rsi
movl 0x8(%rsi), %esi
shrl %esi
movl %esi, %esi
imulq $0x18, %rsi, %rsi
addq %rsi, %rax
movzbl 0x10(%rax), %eax
leaq 0x80fba(%rip), %rsi     # 0x396393
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x22a0
cmpl $0x0, -0x78(%rbp)
je 0x315662
movq -0x98(%rbp), %rax
movl -0x70(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movq -0x90(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x315660
jmp 0x31544e
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3154bf
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31547e
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xb8(%rbp)
jmp 0x31548c
movl $0x2, %eax
movq %rax, -0xb8(%rbp)
jmp 0x31548c
movq -0xb8(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x90(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movl $0x18, %ecx
cqto
idivq %rcx
movq %rax, %rdx
movl -0x6c(%rbp), %eax
addq %rax, %rdx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x315503
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x315574
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x315533
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xc0(%rbp)
jmp 0x315541
movl $0x2, %eax
movq %rax, -0xc0(%rbp)
jmp 0x315541
movq -0xc0(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movl $0x18, %ecx
cqto
idivq %rcx
movq %rax, %rdx
movl -0x70(%rbp), %eax
addq %rax, %rdx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x3155ce
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
je 0x3155ea
movl -0x4c(%rbp), %eax
shrl %eax
cmpl $0x137984, %eax         # imm = 0x137984
jne 0x31565e
movl -0x50(%rbp), %eax
shrl %eax
cmpl $0xc4b4, %eax           # imm = 0xC4B4
jne 0x31565e
movq 0xae9ef(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movl -0x4c(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0x50(%rbp), %ecx
movq -0x90(%rbp), %rax
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rdx
subq %rdx, %rax
movl $0x18, %esi
cqto
idivq %rsi
movl -0x6c(%rbp), %edx
addq %rdx, %rax
movl %eax, %r8d
movq -0x98(%rbp), %rax
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rdx
subq %rdx, %rax
movl $0x18, %esi
cqto
idivq %rsi
movl -0xc4(%rbp), %edx
movl -0x70(%rbp), %esi
addq %rsi, %rax
movl %eax, %r9d
leaq 0x80db1(%rip), %rsi     # 0x396408
movb $0x0, %al
callq 0x22a0
jmp 0x315660
jmp 0x315662
jmp 0x315664
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x314ca2
cmpq $0x0, -0x18(%rbp)
jne 0x315682
movq -0x30(%rbp), %rdi
callq 0x2210
cmpq $0x0, 0x10(%rbp)
je 0x3156d3
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq 0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3156d1
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x54(%rbp), %edx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0xc(%rax)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x315690
jmp 0x3156d3
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)