// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: asg_arc_cut_tips(asg_t*, unsigned int, asg64_v*, unsigned int, R_to_U*, telo_end_t*)
uint32_t asg_arc_cut_tips(asg_t *g, uint32_t max_ext, asg64_v *in, uint32_t is_ou, R_to_U *ru, telo_end_t *te)
{
    asg64_v tx = {0,0,0}, *b = NULL;
    uint32_t n_vtx = g->n_seq<<1, v, w, i, k, cnt = 0, nv, kv, pb, ou, mm_ou, rr, is_u, is_telo;
    asg_arc_t *av = NULL; uint64_t lw;
	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(te && te->hh[v>>1]) continue;

        av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
        for (i = kv = 0; i < nv; i++) {
            if (av[i].del) continue;
            kv++; break;
        }
        if(kv) continue;
        
        kv = 1; mm_ou = (uint32_t)-1; ou = 0; is_telo = 0;
        if(te && te->hh[v>>1]) is_telo = 1;
        for (i = 0, w = v; i < max_ext; i++) {
            if(asg_end(g, w^1, &lw, is_ou?&ou:NULL)!=0) break;
            w = (uint32_t)lw; kv++; mm_ou = MIN(mm_ou, ou);
            if(te && te->hh[w>>1]) is_telo = 1;
        }

		if(mm_ou == (uint32_t)-1) mm_ou = 0;
		kv += mm_ou; i += mm_ou;
        if((i < max_ext/** + (!!is_ou)**/) && (!is_telo)) kv_push(uint64_t, *b, (((uint64_t)kv)<<32)|v);  
    }

    radix_sort_srt64(b->a, b->a + b->n);

    for (k = 0; k < b->n; k++) {
        v = (uint32_t)(b->a[k]);

        if (g->seq[v>>1].del) continue;
        if(te && te->hh[v>>1]) continue;

        av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
        for (i = kv = 0; i < nv; i++) {
            if (av[i].del) continue;
            kv++; break;
        }

        if(kv) continue;
        
        pb = b->n; kv_push(uint64_t, *b, v); mm_ou = (uint32_t)-1; ou = 0; is_telo = 0;
        if(te && te->hh[v>>1]) is_telo = 1;
        for (i = 0, w = v; i < max_ext; i++) {
            if(asg_end(g, w^1, &lw, is_ou?&ou:NULL)!=0) break;
            w = (uint32_t)lw; kv_push(uint64_t, *b, lw); mm_ou = MIN(mm_ou, ou);
            if(te && te->hh[w>>1]) is_telo = 1;
        }
		if(mm_ou == (uint32_t)-1) mm_ou = 0;
		i += mm_ou;

        if((i < max_ext/** + (!!is_ou)**/) && (!is_telo)) {
            for (i = pb; i < b->n; i++) asg_seq_del(g, ((uint32_t)b->a[i])>>1);
            cnt++;
        }
        b->n = pb; 
    }

    if(ru && is_ou) {
        for (v = b->n = 0; v < n_vtx; ++v) {
            if (g->seq[v>>1].del) continue;
            av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
            for (i = kv = 0; i < nv; i++) {
                if (av[i].del) continue;
                kv++; break;
            }
            if(kv) continue;


            get_R_to_U(ru, v>>1, &rr, &is_u);
            if(rr == (uint32_t)-1 || is_u == 1) continue;
            if(te && te->hh[v>>1]) continue;
            kv_push(uint64_t, *b, v); 

            for (i = 0, w = v; i < max_ext; i++) {
                if(asg_end(g, w^1, &lw, NULL)!=0) break;
                w = (uint32_t)lw; 

                get_R_to_U(ru, w>>1, &rr, &is_u);
                if(rr == (uint32_t)-1 || is_u == 1) break;
                if(te && te->hh[w>>1]) break;

                kv_push(uint64_t, *b, lw);
            }

            for (i = 0; i < b->n; i++) {
                asg_seq_del(g, ((uint32_t)b->a[i])>>1);
            }
            if(b->n) cnt++;
        }
    }
    

    /**
    for (v = 0; v < n_vtx; ++v) {
        if (g->seq[v>>1].del) continue;

        av = asg_arc_a(g, v^1); nv = asg_arc_n(g, v^1);
        for (i = kv = 0; i < nv; i++) {
            if (av[i].del) continue;
            kv++;
        }

        if(kv) continue;
        pb = b->n; kv_push(uint64_t, *b, v);
        for (i = 0, w = v; i < max_ext; i++) {
            if(asg_is_utg_end(g, w^1, &lw)!=0) break;
            w = (uint32_t)lw; kv_push(uint64_t, *b, lw);
        }

        if(i < max_ext) {
            for (i = pb; i < b->n; i++) asg_seq_del(g, ((uint32_t)b->a[i])>>1);
            cnt++;
        }
        b->n = pb; 
    }
    **/
    // stats_sysm(g);
    if(!in) free(tx.a);
    if (cnt > 0) asg_cleanup(g);

    return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2100
movq $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x68(%rbp)
movq $0x0, -0x90(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x311fcd
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x311fd5
leaq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x3122de
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x312012
jmp 0x3122d0
cmpq $0x0, -0x30(%rbp)
je 0x312033
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x312033
jmp 0x3122d0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x58(%rbp), %edx
xorl $0x1, %edx
movl %edx, %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 -0x58(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x3120c2
movq -0x90(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x3120ac
jmp 0x3120b7
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x3120c2
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x312086
cmpl $0x0, -0x70(%rbp)
je 0x3120cd
jmp 0x3122d0
movl $0x1, -0x70(%rbp)
movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x78(%rbp)
movl $0x0, -0x88(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x312112
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x312112
movl $0x1, -0x88(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x60(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x3121f5
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x5c(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x312155
leaq -0x78(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0x312160
xorl %eax, %eax
movq %rax, -0xb0(%rbp)
jmp 0x312160
movl -0x9c(%rbp), %esi
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rcx
leaq -0x98(%rbp), %rdx
callq 0x312a70
cmpl $0x0, %eax
je 0x312187
jmp 0x3121f5
movq -0x98(%rbp), %rax
movl %eax, -0x5c(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x78(%rbp), %eax
ja 0x3121ad
movl -0x7c(%rbp), %eax
movl %eax, -0xb4(%rbp)
jmp 0x3121b6
movl -0x78(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, -0x7c(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3121e5
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x3121e5
movl $0x1, -0x88(%rbp)
jmp 0x3121e7
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x31211f
cmpl $-0x1, -0x7c(%rbp)
jne 0x312202
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
addl -0x70(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x7c(%rbp), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x3122ce
cmpl $0x0, -0x88(%rbp)
jne 0x3122ce
jmp 0x31222f
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3122a0
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31225f
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xc0(%rbp)
jmp 0x31226d
movl $0x2, %eax
movq %rax, -0xc0(%rbp)
jmp 0x31226d
movq -0xc0(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x70(%rbp), %eax
movl %eax, %edx
shlq $0x20, %rdx
movl -0x58(%rbp), %eax
orq %rax, %rdx
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x3122ce
jmp 0x3122d0
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x311fe7
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x50(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x30ed90
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3126d4
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x312349
jmp 0x3126c6
cmpq $0x0, -0x30(%rbp)
je 0x31236a
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x31236a
jmp 0x3126c6
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x58(%rbp), %edx
xorl $0x1, %edx
movl %edx, %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 -0x58(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x3123f9
movq -0x90(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x3123e3
jmp 0x3123ee
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x3123f9
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x3123bd
cmpl $0x0, -0x70(%rbp)
je 0x312404
jmp 0x3126c6
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x74(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x31247f
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31243e
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xc8(%rbp)
jmp 0x31244c
movl $0x2, %eax
movq %rax, -0xc8(%rbp)
jmp 0x31244c
movq -0xc8(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x58(%rbp), %eax
movl %eax, %edx
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x78(%rbp)
movl $0x0, -0x88(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3124df
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x3124df
movl $0x1, -0x88(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x60(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x312651
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl -0x5c(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0xcc(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x312522
leaq -0x78(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x31252d
xorl %eax, %eax
movq %rax, -0xe0(%rbp)
jmp 0x31252d
movl -0xcc(%rbp), %esi
movq -0xd8(%rbp), %rdi
movq -0xe0(%rbp), %rcx
leaq -0x98(%rbp), %rdx
callq 0x312a70
cmpl $0x0, %eax
je 0x312557
jmp 0x312651
movq -0x98(%rbp), %rax
movl %eax, -0x5c(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3125d2
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x312591
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xe8(%rbp)
jmp 0x31259f
movl $0x2, %eax
movq %rax, -0xe8(%rbp)
jmp 0x31259f
movq -0xe8(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rdx
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movl -0x7c(%rbp), %eax
cmpl -0x78(%rbp), %eax
ja 0x312609
movl -0x7c(%rbp), %eax
movl %eax, -0xec(%rbp)
jmp 0x312612
movl -0x78(%rbp), %eax
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %eax
movl %eax, -0x7c(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x312641
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x312641
movl $0x1, -0x88(%rbp)
jmp 0x312643
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x3124ec
cmpl $-0x1, -0x7c(%rbp)
jne 0x31265e
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x3126ba
cmpl $0x0, -0x88(%rbp)
jne 0x3126ba
movl -0x74(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3126b1
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
shrl %esi
callq 0x312c50
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x31267e
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x74(%rbp), %eax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x312308
cmpq $0x0, -0x28(%rbp)
je 0x312a3e
cmpl $0x0, -0x1c(%rbp)
je 0x312a3e
movq -0x50(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x312a3c
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x312726
jmp 0x312a2e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x58(%rbp), %edx
xorl $0x1, %edx
movl %edx, %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 -0x58(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x3127b5
movq -0x90(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31279f
jmp 0x3127aa
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x3127b5
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x312779
cmpl $0x0, -0x70(%rbp)
je 0x3127c0
jmp 0x312a2e
movq -0x28(%rbp), %rdi
movl -0x58(%rbp), %esi
shrl %esi
leaq -0x80(%rbp), %rdx
leaq -0x84(%rbp), %rcx
callq 0xd3d50
cmpl $-0x1, -0x80(%rbp)
je 0x3127e8
cmpl $0x1, -0x84(%rbp)
jne 0x3127ed
jmp 0x312a2e
cmpq $0x0, -0x30(%rbp)
je 0x31280e
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x31280e
jmp 0x312a2e
jmp 0x312810
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x312881
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x312840
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xf8(%rbp)
jmp 0x31284e
movl $0x2, %eax
movq %rax, -0xf8(%rbp)
jmp 0x31284e
movq -0xf8(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x58(%rbp), %eax
movl %eax, %edx
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x60(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x60(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x3129df
movq -0x8(%rbp), %rdi
movl -0x5c(%rbp), %esi
xorl $0x1, %esi
leaq -0x98(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x312a70
cmpl $0x0, %eax
je 0x3128e0
jmp 0x3129df
movq -0x98(%rbp), %rax
movl %eax, -0x5c(%rbp)
movq -0x28(%rbp), %rdi
movl -0x5c(%rbp), %esi
shrl %esi
leaq -0x80(%rbp), %rdx
leaq -0x84(%rbp), %rcx
callq 0xd3d50
cmpl $-0x1, -0x80(%rbp)
je 0x312912
cmpl $0x1, -0x84(%rbp)
jne 0x312917
jmp 0x3129df
cmpq $0x0, -0x30(%rbp)
je 0x312938
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x312938
jmp 0x3129df
jmp 0x31293a
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x3129ab
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31296a
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x100(%rbp)
jmp 0x312978
movl $0x2, %eax
movq %rax, -0x100(%rbp)
jmp 0x312978
movq -0x100(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rdx
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x3129d1
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x3128b0
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x312a19
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
shrl %esi
callq 0x312c50
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x3129e6
movq -0x50(%rbp), %rax
cmpq $0x0, (%rax)
je 0x312a2c
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x312a2e
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x3126fb
jmp 0x312a3e
cmpq $0x0, -0x18(%rbp)
jne 0x312a4e
movq -0x38(%rbp), %rdi
callq 0x2210
cmpl $0x0, -0x68(%rbp)
jbe 0x312a5d
movq -0x8(%rbp), %rdi
callq 0xcdd10
movl -0x68(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)