// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: usg_arc_cut_tips(usg_t*, unsigned int, unsigned int, asg64_v*)
uint32_t usg_arc_cut_tips(usg_t *g, uint32_t max_ext, uint32_t ignore_ul, asg64_v *in)
{
    asg64_v tx = {0,0,0}, *b = NULL;
    uint32_t n_vtx = g->n<<1, v, w, i, k, cnt = 0, nv, kv, pb, ff, is_telo;
    usg_arc_t *av = NULL, *p; uint64_t lw;
    if(in) b = in;
    else b = &tx;

    for (v = b->n = 0; v < n_vtx; ++v) {
        if (g->a[v>>1].del) continue;

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

        if(kv) continue;
        
        is_telo = 0; if(g->a[v>>1].telo) is_telo = 1;
        for (i = 0, w = v, kv = g->a[v>>1].occ; i < max_ext; i++) {
            if(usg_end(g, w^1, &lw)!=0) break;
            w = (uint32_t)lw; kv += g->a[w>>1].occ;
            if(g->a[w>>1].telo) is_telo = 1;
        }
        if((kv <= max_ext) && (!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->a[v>>1].del) continue;

        av = usg_arc_a(g, v^1); nv = usg_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); 
        is_telo = 0; if(g->a[v>>1].telo) is_telo = 1;
        for (i = 0, w = v, kv = g->a[v>>1].occ; i < max_ext; i++) {
            if(usg_end(g, w^1, &lw)!=0) break;
            w = (uint32_t)lw; kv += g->a[w>>1].occ; kv_push(uint64_t, *b, lw);
            if(g->a[w>>1].telo) is_telo = 1;
        }
        // if((v>>1) == 308) {
        //     fprintf(stderr, "[M::%s::] v>>1::%u, v&1::%u, kv::%u\n", 
        //     __func__, v>>1, v&1, kv);
        // }


        if((kv <= max_ext) && (!is_telo)) {
            ff = 0;
            if(!ignore_ul) {///consider UL
                for (i = pb; i + 1 < b->n; i++) {
                    p = get_usg_arc(g, ((uint32_t)b->a[i]), ((uint32_t)b->a[i+1])); assert(p);
                    if(p->ou > 1) {//ignore ou == 1
                        ff = 1;
                        break;
                    }
                }

                if(ff == 0 && i < b->n) {
                    av = usg_arc_a(g, ((uint32_t)b->a[i])); nv = usg_arc_n(g, ((uint32_t)b->a[i]));
                    for (i = 0; i < nv; i++) {
                        if(av[i].del) continue;
                        if(av[i].ou > 1) {//ignore ou == 1
                            ff = 1;
                            break;
                        }
                    }
                }
            }

            // if((v>>1) == 139131) {
            //     fprintf(stderr, "+[M::%s::] v>>1::%u, v&1::%u, kv::%u, ff::%u, pb::%u, b->n::%u, w>>1::%u, w&1::%u\n", __func__, v>>1, v&1, kv,
            //     ff, pb, (uint32_t)b->n, ((uint32_t)b->a[b->n-1])>>1, ((uint32_t)b->a[b->n-1])&1);
            // }

            if((ff == 0) && (pb < b->n) && (!usg_real_tip(g, ((uint32_t)b->a[b->n-1]), 0.75))) {
                ff = 1;
            }

            // if((v>>1) == 139131) {
            //     fprintf(stderr, "-[M::%s::] v>>1::%u, v&1::%u, kv::%u, ff::%u, pb::%u, b->n::%u, w>>1::%u, w&1::%u\n", __func__, v>>1, v&1, kv,
            //     ff, pb, (uint32_t)b->n, ((uint32_t)b->a[b->n-1])>>1, ((uint32_t)b->a[b->n-1])&1);
            // }

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

            // if((v>>1) == 139131) {
            //     fprintf(stderr, ">[M::%s::] v>>1::%u, v&1::%u, kv::%u, ff::%u, pb::%u, b->n::%u, w>>1::%u, w&1::%u, del::%u\n", __func__, v>>1, v&1, kv,
            //     ff, pb, (uint32_t)b->n, ((uint32_t)b->a[b->n-1])>>1, ((uint32_t)b->a[b->n-1])&1, 
            //     g->a[((uint32_t)b->a[b->n-1])>>1].del);
            // }
        }
        b->n = pb; 
    }

    if(!in) free(tx.a);
    if(cnt > 0) usg_cleanup(g);

    return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2100
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x50(%rbp)
movq $0x0, -0x70(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x34e1cf
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x34e1d7
leaq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jae 0x34e45f
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x70(%rax)
je 0x34e215
jmp 0x34e451
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x34e2c6
movq -0x70(%rbp), %rax
movl -0x48(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x34e2b0
jmp 0x34e2bb
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x34e2c6
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x34e28d
cmpl $0x0, -0x58(%rbp)
je 0x34e2d1
jmp 0x34e451
movl $0x0, -0x64(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x71(%rax)
je 0x34e2fa
movl $0x1, -0x64(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x48(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x34e398
movq -0x8(%rbp), %rdi
movl -0x44(%rbp), %esi
xorl $0x1, %esi
leaq -0x80(%rbp), %rdx
callq 0x34ea20
cmpl $0x0, %eax
je 0x34e344
jmp 0x34e398
movq -0x80(%rbp), %rax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x44(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
addl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x44(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x71(%rax)
je 0x34e38b
movl $0x1, -0x64(%rbp)
jmp 0x34e38d
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x34e322
movl -0x58(%rbp), %eax
cmpl -0xc(%rbp), %eax
ja 0x34e44f
cmpl $0x0, -0x64(%rbp)
jne 0x34e44f
jmp 0x34e3b0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x34e421
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x34e3e0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x88(%rbp)
jmp 0x34e3ee
movl $0x2, %eax
movq %rax, -0x88(%rbp)
jmp 0x34e3ee
movq -0x88(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x58(%rbp), %eax
movl %eax, %edx
shlq $0x20, %rdx
movl -0x40(%rbp), %eax
orq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x34e44f
jmp 0x34e451
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x34e1e9
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x30ed90
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x34e9f0
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x70(%rax)
je 0x34e4cb
jmp 0x34e9e2
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x34e57c
movq -0x70(%rbp), %rax
movl -0x48(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x34e566
jmp 0x34e571
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x34e57c
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x34e543
cmpl $0x0, -0x58(%rbp)
je 0x34e587
jmp 0x34e9e2
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x5c(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x34e602
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x34e5c1
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x90(%rbp)
jmp 0x34e5cf
movl $0x2, %eax
movq %rax, -0x90(%rbp)
jmp 0x34e5cf
movq -0x90(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x40(%rbp), %eax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x64(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x71(%rax)
je 0x34e64d
movl $0x1, -0x64(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x48(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x34e787
movq -0x8(%rbp), %rdi
movl -0x44(%rbp), %esi
xorl $0x1, %esi
leaq -0x80(%rbp), %rdx
callq 0x34ea20
cmpl $0x0, %eax
je 0x34e69e
jmp 0x34e787
movq -0x80(%rbp), %rax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x44(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
addl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x34e734
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x34e6f3
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x98(%rbp)
jmp 0x34e701
movl $0x2, %eax
movq %rax, -0x98(%rbp)
jmp 0x34e701
movq -0x98(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rdx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x44(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x71(%rax)
je 0x34e777
movl $0x1, -0x64(%rbp)
jmp 0x34e779
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x34e675
movl -0x58(%rbp), %eax
cmpl -0xc(%rbp), %eax
ja 0x34e9d6
cmpl $0x0, -0x64(%rbp)
jne 0x34e9d6
movl $0x0, -0x60(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x34e944
movl -0x5c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x34e844
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x48(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x48(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
callq 0x37d400
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x34e802
jmp 0x34e821
leaq 0x32bbb(%rip), %rdi     # 0x3813c4
leaq 0x479a9(%rip), %rsi     # 0x3961b9
movl $0x2a16, %edx           # imm = 0x2A16
leaq 0x4a9ae(%rip), %rcx     # 0x3991ca
callq 0x2130
movq -0x78(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jbe 0x34e834
movl $0x1, -0x60(%rbp)
jmp 0x34e844
jmp 0x34e836
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x34e7b4
cmpl $0x0, -0x60(%rbp)
jne 0x34e942
movl -0x48(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x34e942
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x48(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x48(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x48(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
addq $0x10, %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x48(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
andl $0x1, %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x54(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x34e940
movq -0x70(%rbp), %rax
movl -0x48(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x34e916
jmp 0x34e935
movq -0x70(%rbp), %rax
movl -0x48(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x1, 0x10(%rax)
jbe 0x34e933
movl $0x1, -0x60(%rbp)
jmp 0x34e940
jmp 0x34e935
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x34e8f3
jmp 0x34e942
jmp 0x34e944
cmpl $0x0, -0x60(%rbp)
jne 0x34e98c
movl -0x5c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x34e98c
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
movsd 0x306a5(%rip), %xmm0    # 0x37f020
callq 0x34df00
cmpl $0x0, %eax
jne 0x34e98c
movl $0x1, -0x60(%rbp)
cmpl $0x0, -0x60(%rbp)
jne 0x34e9d4
movl -0x5c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x34e9cb
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x48(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
shrl %esi
callq 0x34ec20
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x34e998
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x34e9d6
movl -0x5c(%rbp), %eax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x34e489
cmpq $0x0, -0x18(%rbp)
jne 0x34ea00
movq -0x20(%rbp), %rdi
callq 0x2210
cmpl $0x0, -0x50(%rbp)
jbe 0x34ea0f
movq -0x8(%rbp), %rdi
callq 0x34d830
movl -0x50(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)