// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: asg_arc_cut_bub_links(asg_t*, asg64_v*, float, float, float, unsigned int, unsigned long, ma_hit_t_alloc*, R_to_U*, int)
void asg_arc_cut_bub_links(asg_t *g, asg64_v *in, float len_rat, float sec_len_rat, float ou_rat, uint32_t is_ou, uint64_t check_dist, ma_hit_t_alloc *rev, R_to_U* rI, int32_t max_ext)
{
    asg64_v tx = {0,0,0}, *b = NULL;
    uint32_t v, w, t, k, i, n_vtx = g->n_seq<<1, nv, nw, kv, kw, kol, bn, me, mu, cnt = 0, sec_check;
    asg_arc_t *av, *aw, *ref;
    buf_t x; memset(&x, 0, sizeof(x)); x.a = (binfo_t*)calloc(n_vtx, sizeof(binfo_t));

    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 = kol = 0; i < nv; ++i) {
                if(av[i].del) continue;
                kv++; kol += av[i].ol; 
            }
            if(kv < 2) continue;//must have at least one exact and one inexact

            kv_push(uint64_t, *b, ((((uint64_t)(kol))<<32) | v));  
        }
    }

    if(rev && rI) memset(g->seq_vis, 0, g->n_seq*2*sizeof(uint8_t));
    radix_sort_srt64(b->a, b->a + b->n); bn = b->n;
    for (k = 0; k < bn; k++) {
        v = (uint32_t)b->a[k];
        if (g->seq[v>>1].del) continue;
        nv = asg_arc_n(g, v); av = asg_arc_a(g, v);
        if (nv < 2 || get_arcs(g, v, NULL, 0) < 2) continue;

        for (i = 0, b->n = bn, sec_check = 0; i < nv; i++) {
            if (av[i].del) continue;

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

            for (t = kw = 0, me = mu = (uint32_t)-1; t < nw; t++) {
                if(aw[t].del) continue;
                kw++; 
                if(aw[t].v == (v^1)) continue;//note: me is the shortest edge except aw[t], so here is continue
                if(aw[t].ol < me) me = aw[t].ol;
                if(aw[t].ou < mu) mu = aw[t].ou;
                kv_push(uint64_t, *b, ((uint64_t)(aw-g->arc+t)));                
            }
            if(kw < 2) break;

            if(av[i].ol > me*len_rat && av[i].ol > me*sec_len_rat) break;
            if(av[i].ol > me*len_rat) sec_check++;
            if(is_ou && av[i].ou > mu*ou_rat) break;
        }

        if(i < nv) continue;

        if(sec_check) {
            for (i = 0, ref = NULL; i < nv; i++) {//forward
                if (av[i].del) continue;
                if(!ref) {
                    ref = &(av[i]);
                } else {
                    if(trans_path_check(ref->v, av[i].v, g, rev, rI, max_ext, b)!=1) break;
                }
            }

            if(i < nv) {
                if (b->n < bn + 2) continue;///less than two edges
                for (i = bn, ref = NULL; i < b->n; i++) {
                    if(g->arc[b->a[i]].del) continue;
                    if(get_arcs(g, g->arc[b->a[i]].ul>>32, NULL, 0)!=2) break;
                    if(!ref) {
                        ref = &(g->arc[b->a[i]]);
                    } else {
                        if(trans_path_check(ref->v, g->arc[b->a[i]].v, g, rev, rI, max_ext, b)!=1) break;
                    }
                }
                if(i < b->n) continue;
            }
        }

        if(if_false_bub_links(v, g, &x, b, bn, check_dist)) {
            for (i = 0; i < nv; ++i) {
                if (av[i].del) continue;
                av[i].del = 1; asg_arc_del(g, av[i].v^1, (av[i].ul>>32)^1, 1);
            }
            cnt++;
        }
    }

    // stats_sysm(g);
    if(!in) free(tx.a);
    free(x.a); free(x.S.a); free(x.T.a); free(x.b.a); free(x.e.a);
    if(cnt > 0) asg_cleanup(g);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movss %xmm1, -0x18(%rbp)
movss %xmm2, -0x1c(%rbp)
movl %edx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2100
movq $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x70(%rbp)
movl $0x0, -0x94(%rbp)
leaq -0x118(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x2100
movl -0x70(%rbp), %eax
movl %eax, %edi
movl $0x1c, %esi
callq 0x2140
movq %rax, -0x118(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x31be81
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x31be89
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jae 0x31c05a
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31bec6
jmp 0x31c04c
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x5c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x31c04a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x5c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x74(%rbp)
cmpl $0x2, -0x74(%rbp)
jae 0x31bf24
jmp 0x31c04c
movl $0x0, -0x84(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x31bf9b
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31bf62
jmp 0x31bf90
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x31bf3c
cmpl $0x2, -0x7c(%rbp)
jae 0x31bfa6
jmp 0x31c04c
jmp 0x31bfa8
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x31c019
movq -0x58(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31bfd8
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x120(%rbp)
jmp 0x31bfe6
movl $0x2, %eax
movq %rax, -0x120(%rbp)
jmp 0x31bfe6
movq -0x120(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x84(%rbp), %eax
movl %eax, %edx
shlq $0x20, %rdx
movl -0x5c(%rbp), %eax
orq %rax, %rdx
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x31c04a
jmp 0x31c04c
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x31be9b
cmpq $0x0, -0x30(%rbp)
je 0x31c08c
cmpq $0x0, -0x38(%rbp)
je 0x31c08c
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movslq %eax, %rdx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x58(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x30ed90
movq -0x58(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x88(%rbp)
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x88(%rbp), %eax
jae 0x31c7e0
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x68(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31c103
jmp 0x31c7d2
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x74(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x5c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
cmpl $0x2, -0x74(%rbp)
jb 0x31c15b
movq -0x8(%rbp), %rdi
movl -0x5c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x311ba0
cmpl $0x2, %eax
jae 0x31c160
jmp 0x31c7d2
movl $0x0, -0x6c(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %ecx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x98(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x31c4cb
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31c1ad
jmp 0x31c4bd
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x60(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
cmpl $0x2, -0x78(%rbp)
jae 0x31c20d
jmp 0x31c4cb
movl $0x0, -0x80(%rbp)
movl $0x0, -0x64(%rbp)
movl $0xffffffff, -0x90(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x8c(%rbp) # imm = 0xFFFFFFFF
movl -0x64(%rbp), %eax
cmpl -0x78(%rbp), %eax
jae 0x31c3d3
movq -0xa8(%rbp), %rax
movl -0x64(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31c25c
jmp 0x31c3c5
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movq -0xa8(%rbp), %rax
movl -0x64(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x5c(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x31c288
jmp 0x31c3c5
movq -0xa8(%rbp), %rax
movl -0x64(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x8c(%rbp), %eax
jae 0x31c2c8
movq -0xa8(%rbp), %rax
movl -0x64(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x8c(%rbp)
movq -0xa8(%rbp), %rax
movl -0x64(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movw 0x10(%rax), %ax
andw $0x3fff, %ax            # imm = 0x3FFF
movzwl %ax, %eax
cmpl -0x90(%rbp), %eax
jae 0x31c30e
movq -0xa8(%rbp), %rax
movl -0x64(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movw 0x10(%rax), %ax
andw $0x3fff, %ax            # imm = 0x3FFF
movzwl %ax, %eax
movl %eax, -0x90(%rbp)
jmp 0x31c310
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x31c381
movq -0x58(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31c340
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x128(%rbp)
jmp 0x31c34e
movl $0x2, %eax
movq %rax, -0x128(%rbp)
jmp 0x31c34e
movq -0x128(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xa8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movl $0x18, %ecx
cqto
idivq %rcx
movq %rax, %rdx
movl -0x64(%rbp), %eax
addq %rax, %rdx
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x31c3c5
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x31c22f
cmpl $0x2, -0x80(%rbp)
jae 0x31c3de
jmp 0x31c4cb
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cvtsi2ss %eax, %xmm0
movl -0x8c(%rbp), %eax
cvtsi2ss %rax, %xmm1
mulss -0x14(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x31c443
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cvtsi2ss %eax, %xmm0
movl -0x8c(%rbp), %eax
cvtsi2ss %rax, %xmm1
mulss -0x18(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x31c443
jmp 0x31c4cb
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cvtsi2ss %eax, %xmm0
movl -0x8c(%rbp), %eax
cvtsi2ss %rax, %xmm1
mulss -0x14(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x31c482
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x31c4bb
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
movzwl 0x10(%rax,%rcx,8), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
cvtsi2ss %eax, %xmm0
movl -0x90(%rbp), %eax
cvtsi2ss %rax, %xmm1
mulss -0x1c(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x31c4bb
jmp 0x31c4cb
jmp 0x31c4bd
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x31c180
movl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x31c4d8
jmp 0x31c7d2
cmpl $0x0, -0x98(%rbp)
je 0x31c6ee
movl $0x0, -0x6c(%rbp)
movq $0x0, -0xb0(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x31c599
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31c521
jmp 0x31c58b
cmpq $0x0, -0xb0(%rbp)
jne 0x31c545
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
jmp 0x31c589
movq -0xb0(%rbp), %rax
movl 0x8(%rax), %edi
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movl 0x10(%rbp), %r9d
movq -0x58(%rbp), %rax
movq %rax, (%rsp)
callq 0x3156e0
cmpl $0x1, %eax
je 0x31c587
jmp 0x31c599
jmp 0x31c589
jmp 0x31c58b
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x31c4f7
movl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x31c6ec
movq -0x58(%rbp), %rax
movq (%rax), %rax
movl -0x88(%rbp), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x31c5c1
jmp 0x31c7d2
movl -0x88(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq $0x0, -0xb0(%rbp)
movl -0x6c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x31c6d9
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x6c(%rbp), %edx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31c610
jmp 0x31c6cb
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x6c(%rbp), %edx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %esi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x311ba0
cmpl $0x2, %eax
je 0x31c64d
jmp 0x31c6d9
cmpq $0x0, -0xb0(%rbp)
jne 0x31c67b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x6c(%rbp), %edx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
jmp 0x31c6c9
movq -0xb0(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x6c(%rbp), %edx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movl 0x10(%rbp), %r9d
movq -0x58(%rbp), %rax
movq %rax, (%rsp)
callq 0x3156e0
cmpl $0x1, %eax
je 0x31c6c7
jmp 0x31c6d9
jmp 0x31c6c9
jmp 0x31c6cb
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x31c5d5
movl -0x6c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x31c6ea
jmp 0x31c7d2
jmp 0x31c6ec
jmp 0x31c6ee
movl -0x5c(%rbp), %edi
movq -0x8(%rbp), %rsi
movq -0x58(%rbp), %rcx
movl -0x88(%rbp), %r8d
movq -0x28(%rbp), %rax
movl %eax, %r9d
leaq -0x118(%rbp), %rdx
callq 0x31b820
cmpl $0x0, %eax
je 0x31c7d0
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jae 0x31c7c1
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31c74d
jmp 0x31c7b3
movq -0xa0(%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)
movq -0x8(%rbp), %rdi
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movq -0xa0(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
movl $0x1, %ecx
callq 0x31bd30
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x31c723
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x31c7d2
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x31c0c3
cmpq $0x0, -0x10(%rbp)
jne 0x31c7f0
movq -0x40(%rbp), %rdi
callq 0x2210
movq -0x118(%rbp), %rdi
callq 0x2210
movq -0x100(%rbp), %rdi
callq 0x2210
movq -0xe8(%rbp), %rdi
callq 0x2210
movq -0xd0(%rbp), %rdi
callq 0x2210
movq -0xb8(%rbp), %rdi
callq 0x2210
cmpl $0x0, -0x94(%rbp)
jbe 0x31c83e
movq -0x8(%rbp), %rdi
callq 0xcdd10
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw (%rax,%rax)