LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: reload_uu(all_ul_t*, ma_ug_t*, char*, char const*)
void reload_uu(all_ul_t *x, ma_ug_t *raw_g, char* file_name, const char *bin_file)
{
    char* gfa_name = NULL; MALLOC(gfa_name, strlen(asm_opt.output_file_name)+50);
	sprintf(gfa_name, "%s.%s", asm_opt.output_file_name, bin_file);
    clear_all_ul_t(x);
    load_all_ul_t(x, gfa_name, &R_INF, raw_g);
    // filter_ul_ug(raw_g);//no filter since we would like to use all alignments
    gen_ul_vec_rid_t(x, NULL, raw_g);
    free(gfa_name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x80375(%rip), %rax     # 0x253758
movq 0x10(%rax), %r13
movq %r13, %rdi
callq 0x2090
leaq 0x32(%rax), %rdi
callq 0x2280
movq %rax, %r15
leaq 0x17b10(%rip), %rsi     # 0x1eaf12
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
callq 0x19c9d8
leaq 0x80e0f(%rip), %rdx     # 0x254230
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x19aa47
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x193ac1
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: fill_scaffolds(usc_t*, unsigned long, ma_ug_t*, long, char const*)
void fill_scaffolds(usc_t *a, uint64_t a_n, ma_ug_t *raw_g, int64_t min_arc_len, const char *bin_file)
{   
    scaf_mul_t ss; uint32_t k, occ = 0;
    reload_uu(&UL_INF, raw_g, asm_opt.output_file_name, bin_file);
    // reload_uovl(&UL_INF, asm_opt.output_file_name);
    // filter_ul_ug(raw_g);
    // free(UL_INF.ridx.idx.a); UL_INF.ridx.idx.n = UL_INF.ridx.idx.m = 0;
    // free(UL_INF.ridx.occ.a); UL_INF.ridx.occ.n = UL_INF.ridx.occ.m = 0;
    // gen_ul_vec_rid_t(&UL_INF, NULL, raw_g);
    ss.a = a; ss.a_n = a_n; ss.ug = raw_g;
    kt_for(asm_opt.thread_num, gen_scaffold_id, &ss, a_n);
    for (k = 0; k < a_n; k++) {
        if(a[k].ulid == ((uint32_t)-1)) continue;
        // if(a[k].raw_eof + min_arc_len <= a[k].raw_sof) {///has an overlap longer than min_arc_len; 
        if(a[k].raw_eof <= a[k].raw_sof) {
            continue;///no need ul, could directly use hifi
        }
        // if(a[k].raw_eof <= a[k].raw_sof) continue;///no need UL reads
        // fprintf(stderr, "[M::%s] ulid::%u(%c), dd::%u\n", 
        // __func__, a[k].ulid>>1, "+-"[a[k].ulid&1], UL_INF.a[a[k].ulid>>1].dd);
        UL_INF.a[a[k].ulid>>1].dd = 4;///load
        occ++;
    }

    // fprintf(stderr, "[M::%s] occ::%u\n", __func__, occ);
    if(occ) load_scaf_base(&UL_INF, asm_opt.output_file_name, bin_file);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r8, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
leaq 0x80eab(%rip), %r13     # 0x254318
movq %r13, %rdi
movq %rdx, %rsi
movq %r8, %rcx
callq 0x1d33ca
leaq 0x8(%rsp), %rdx
movq %r15, (%rdx)
movq %r14, 0x8(%rdx)
movq %r12, 0x10(%rdx)
leaq 0x802c6(%rip), %r12     # 0x253758
movl 0x7c(%r12), %edi
leaq 0x6e(%rip), %rsi        # 0x1d350c
movq %r14, %rcx
callq 0xc67c0
movq 0x48(%r13), %rax
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl %ecx, %ecx
cmpq %r14, %rcx
jae 0x1d34e6
imulq $0x18, %rcx, %r8
movl 0x4(%r15,%r8), %edi
cmpq %rdx, %rdi
je 0x1d34e2
addq %r15, %r8
movl 0x14(%r8), %r9d
cmpl 0x10(%r8), %r9d
jbe 0x1d34e2
shrl %edi
imulq $0x58, %rdi, %rdi
movb $0x4, 0x50(%rax,%rdi)
incl %esi
incl %ecx
jmp 0x1d34b3
testl %esi, %esi
je 0x1d34fe
movq 0x10(%r12), %rsi
leaq 0x80e22(%rip), %rdi     # 0x254318
movq %rbx, %rdx
callq 0x1d1f08
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_spec_rc_edge(asg_t*, ug_opt_t*, unsigned int, unsigned int, asg_arc_t*, ma_hit_t**)
int32_t gen_spec_rc_edge(asg_t *rg, ug_opt_t *uopt, uint32_t v, uint32_t w, asg_arc_t *t, ma_hit_t **te)
{
    uint32_t k, qn, tn; int32_t r; ma_hit_t_alloc *s = &(uopt->reverse_sources[v>>1]); asg_arc_t p;
    for (k = 0; k < s->length; k++) {
        qn = Get_qn(s->buffer[k]); tn = Get_tn(s->buffer[k]);
        if(tn != (w>>1)) continue;
        r = ma_hit2arc(&(s->buffer[k]), rg->seq[qn].len, rg->seq[tn].len, uopt->max_hang, asm_opt.max_hang_rate, uopt->min_ovlp, &p);
        if(r < 0) continue;
        if((p.ul>>32) != v || p.v != w) continue;
        *t = p; t->ou = 0; if(te) (*te) = &(s->buffer[k]);
        return 1;
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, 0x28(%rsp)
movq 0x10(%rsi), %rax
movl %edx, %esi
movq %rsi, 0x20(%rsp)
shrl %edx
imulq $0x18, %rdx, %rdx
leaq (%rax,%rdx), %r14
movl 0xc(%rax,%rdx), %eax
movl %ecx, 0x8(%rsp)
movl %ecx, %ebx
shrl %ebx
leaq 0x7fc42(%rip), %rcx     # 0x253758
movss 0x158(%rcx), %xmm0
movss %xmm0, 0xc(%rsp)
imulq $0x28, %rax, %rbp
xorl %r13d, %r13d
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
cmpq %r13, %rbp
je 0x1d3b92
movq (%r14), %rdi
cmpl %ebx, 0xc(%rdi,%r13)
jne 0x1d3b8c
addq %r13, %rdi
movl 0x4(%rdi), %eax
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rcx
movl (%rcx,%rax,8), %esi
andl %r12d, %esi
movl (%rcx,%rbx,8), %edx
andl %r12d, %edx
movl 0x40(%r15), %ecx
movl 0x44(%r15), %r8d
movss 0xc(%rsp), %xmm0
leaq 0x30(%rsp), %r9
callq 0x1aac6d
testl %eax, %eax
js 0x1d3b8c
movq 0x20(%rsp), %rax
cmpl %eax, 0x34(%rsp)
jne 0x1d3b8c
movl 0x8(%rsp), %eax
cmpl %eax, 0x38(%rsp)
je 0x1d3ba4
addq $0x28, %r13
jmp 0x1d3b31
pushq $-0x1
popq %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x40(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rax, 0x10(%rcx)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rcx)
andl $0xc000, %eax           # imm = 0xC000
movw %ax, 0x10(%rcx)
pushq $0x1
popq %rax
movq 0x18(%rsp), %rcx
testq %rcx, %rcx
je 0x1d3b95
addq (%r14), %r13
movq %r13, (%rcx)
jmp 0x1d3b95
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: push_scaff_node(ma_hit_t_alloc*, unsigned long, unsigned long, unsigned long, asg_t*)
void push_scaff_node(ma_hit_t_alloc *src, uint64_t v, uint64_t w, uint64_t ol, asg_t *ng)
{
    uint64_t vl = ng->seq[v>>1].len, wl = ng->seq[w>>1].len; 
    ma_hit_t arc, arc1;
    arc.qns = (v>>1)<<32; 
    if(!(v&1)) {
        arc.qns += vl - ol; arc.qe = vl;
    } else {
        arc.qns += 0; arc.qe = ol;
    }
    arc.tn = w>>1;
    if(!(w&1)) {
        arc.ts = 0; arc.te = ol;
    } else {
        arc.ts = wl - ol; arc.te = wl;
    }

    arc.rev = (v^w)&1; arc.el = 0;
    arc.ml = arc.no_l_indel = arc.bl = 0;

    add_ma_hit_t_alloc(&(src[v>>1]), &arc);
    set_reverse_overlap(&arc1, &arc);
    add_ma_hit_t_alloc(&(src[w>>1]), &arc1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x20(%r8), %r8
movq %rsi, %rax
shrq %rax
movl (%r8,%rax,8), %r9d
movq %rdx, %r12
shrq %r12
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl (%r8,%r12,8), %edi
movq %rax, %r8
shlq $0x20, %r8
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movq %r8, %r10
subq %rcx, %r10
addq %r9, %r10
testb $0x1, %sil
cmovneq %r8, %r10
cmovnel %ecx, %r9d
leaq 0x30(%rsp), %r14
movq %r10, (%r14)
movl %r9d, 0x8(%r14)
movl %r12d, 0xc(%r14)
movl %edi, %r8d
subl %ecx, %r8d
xorl %r9d, %r9d
testb $0x1, %dl
cmovnel %r8d, %r9d
cmovel %ecx, %edi
movl %r9d, 0x10(%r14)
movl %edi, 0x14(%r14)
xorl %esi, %edx
andw $0x0, 0x20(%r14)
shll $0x1f, %edx
movq %rdx, 0x18(%r14)
imulq $0x18, %rax, %rdi
addq %rbx, %rdi
movq %r14, %rsi
callq 0x69052
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x696da
imulq $0x18, %r12, %rdi
addq %rbx, %rdi
movq %r15, %rsi
callq 0x69052
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: prt_usg_t(ul_resolve_t*, usg_t*, char const*)
void prt_usg_t(ul_resolve_t *uidx, usg_t *ng, const char *cmd)
{
    ma_ug_t *ug = gen_debug_hybrid_ug(uidx, ng);
    print_debug_gfa(uidx->sg, ug, uidx->uopt->coverage_cut, cmd, 
    uidx->uopt->sources, uidx->uopt->ruIndex, uidx->uopt->max_hang, uidx->uopt->min_ovlp, 0, 0, 0);
    ma_ug_destroy(ug);
    // exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
callq 0x1d5e07
movq %rax, %r15
movq (%r14), %rax
movq 0x20(%r14), %rdi
movq (%rax), %rdx
movq 0x8(%rax), %r8
movq 0x30(%rax), %r9
movl 0x40(%rax), %r10d
movl 0x44(%rax), %eax
subq $0x8, %rsp
movq %r15, %rsi
movq %rbx, %rcx
pushq $0x0
pushq $0x0
pushq $0x0
pushq %rax
pushq %r10
callq 0x926e3
addq $0x30, %rsp
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x6921d
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: usg_bub_dis(usg_t*, buf_t*)
uint64_t usg_bub_dis(usg_t *g, buf_t *b)
{
    usg_arc_t *av = NULL; uint64_t cLen = 0, mLen = 0;
    uint32_t n_vtx = g->n<<1, k, v, w, kv, nv, p_bub;

    for (v = 0; v < n_vtx; ++v) {
        if(b->a[v>>1].s || g->a[v>>1].del) continue;
        av = usg_arc_a(g, v); nv = usg_arc_n(g, v);
        for (k = kv = 0; k < nv && kv <= 1; k++) {
            if(av[k].del) continue;
            w = av[k].v^1; kv++;
        }
        if(kv == 1) {
            av = usg_arc_a(g, w); nv = usg_arc_n(g, w);
            for (k = kv = 0; k < nv && kv <= 1; k++) {
                if(av[k].del) continue;
                w = av[k].v^1; kv++;
            }
            if(kv == 1) continue;
        }

        cLen = dfs_usg_t_dis(g, b, v^1, &p_bub);
        if(p_bub == 0) continue;///no bubble
        if(cLen > mLen) mLen = cLen;
    }

    for (k = 0; k < g->n; ++k) b->a[k].s = 0;
    b->S.n = b->b.n = 0;
    return mLen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %ebp
addl %ebp, %ebp
xorl %r15d, %r15d
xorl %r13d, %r13d
cmpl %ebp, %r13d
je 0x1d64f1
movq (%rbx), %rax
movl %r13d, %ecx
shrl %ecx
imulq $0x1c, %rcx, %rdx
cmpl $0x0, 0x18(%rax,%rdx)
js 0x1d64e9
movq (%r14), %rax
imulq $0x78, %rcx, %rdx
cmpb $0x0, 0x70(%rax,%rdx)
jne 0x1d64e9
addq %rax, %rdx
movl %r13d, %ecx
andl $0x1, %ecx
imulq $0x18, %rcx, %rsi
movq 0x20(%rdx,%rsi), %rcx
movl 0x10(%rdx,%rsi), %edx
addq $0xc, %rcx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rdx, %rsi
jae 0x1d6470
cmpl $0x1, %edi
ja 0x1d6470
cmpl $0x0, (%rcx)
js 0x1d6467
movl -0x4(%rcx), %r12d
xorl $0x1, %r12d
incl %edi
incq %rsi
addq $0x20, %rcx
jmp 0x1d644e
cmpl $0x1, %edi
jne 0x1d64c3
movl %r12d, %ecx
shrl %ecx
movl %r12d, %edx
andl $0x1, %edx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
imulq $0x18, %rdx, %rdx
movq 0x20(%rdx,%rax), %rcx
movl 0x10(%rdx,%rax), %eax
addq $0xc, %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rax, %rdx
jae 0x1d64be
cmpl $0x1, %esi
ja 0x1d64be
cmpl $0x0, (%rcx)
js 0x1d64b5
movl -0x4(%rcx), %r12d
xorl $0x1, %r12d
incl %esi
incq %rdx
addq $0x20, %rcx
jmp 0x1d649c
cmpl $0x1, %esi
je 0x1d64e9
movl %r13d, %edx
xorl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x4(%rsp), %rcx
callq 0x1d60f1
cmpq %r15, %rax
cmovbeq %r15, %rax
cmpl $0x0, 0x4(%rsp)
cmovneq %rax, %r15
incl %r13d
jmp 0x1d63fe
xorl %eax, %eax
movl %eax, %eax
cmpq %rax, 0x8(%r14)
jbe 0x1d650e
movq (%rbx), %rcx
imulq $0x1c, %rax, %rdx
andl $0x7fffffff, 0x18(%rcx,%rdx) # imm = 0x7FFFFFFF
incl %eax
jmp 0x1d64f3
andq $0x0, 0x38(%rbx)
andq $0x0, 0x8(%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: extracr_clean_arc(usg_t*, unsigned int, asg64_v*, asg64_v*)
void extracr_clean_arc(usg_t *g, uint32_t v, asg64_v *b, asg64_v *ub)
{
    usg_arc_t *av; uint32_t i, kv, nv; uint64_t x, kocc[2];
    av = usg_arc_a(g, v); nv = usg_arc_n(g, v);
    if (nv < 2) return;
    for (i = kv = kocc[0] = kocc[1] = 0; i < nv; ++i) {
        if(av[i].del) continue;
        kv++; 
        if((av[i].ou>>1) > 0) { ///if av[i].ou == 1, ignore it
            if(kocc[1] < (av[i].ou>>1)) kocc[1] = (av[i].ou>>1);
        } else if(av[i].ou == 0) { 
            kocc[0]++;
        }            
    }
    if(kv < 2 || kocc[0] == 0 || kocc[1] == 0) return;
    for (i = 0; i < nv; ++i) {
        if(av[i].del || av[i].ou) continue;
        // if(max_drop_len && av[i].ol >= (*max_drop_len)) continue;
        x = av[i].ol; x <<= 32;
        kv_push(uint64_t, *b, ((x)|((uint64_t)(ub->n))));
        kv_push(uint64_t, *ub, ((((uint64_t)(v))<<32)|((uint64_t)(i))));   
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %esi, %r15d
movl %esi, %eax
shrl %eax
movl %esi, %ecx
imulq $0x78, %rax, %rax
addq (%rdi), %rax
andl $0x1, %ecx
imulq $0x18, %rcx, %rcx
movq 0x10(%rcx,%rax), %rsi
testl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
je 0x1d6a43
movq 0x20(%rcx,%rax), %r12
movl %esi, %r13d
shlq $0x5, %r13
xorl %r8d, %r8d
xorl %esi, %esi
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %r8, %r13
je 0x1d6966
cmpl $0x0, 0xc(%r12,%r8)
js 0x1d6960
incl %esi
movl 0x10(%r12,%r8), %edi
cmpq $0x2, %rdi
jae 0x1d6957
xorl $0x1, %edi
addq %rdi, %rcx
jmp 0x1d6960
shrl %edi
cmpq %rdi, %rax
cmovbeq %rdi, %rax
addq $0x20, %r8
jmp 0x1d6935
cmpl $0x2, %esi
jb 0x1d6a43
testq %rcx, %rcx
je 0x1d6a43
testq %rax, %rax
je 0x1d6a43
shlq $0x20, %r15
xorl %ebp, %ebp
movq %rdx, (%rsp)
cmpq %rbp, %r13
je 0x1d6a43
movslq 0xc(%r12,%rbp), %r14
testq %r14, %r14
js 0x1d6a37
cmpl $0x0, 0x10(%r12,%rbp)
jne 0x1d6a37
movq (%rdx), %rcx
movq 0x10(%rdx), %rax
cmpq 0x8(%rdx), %rcx
jne 0x1d69e4
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rdx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq (%rsp), %rdx
movq %rax, 0x10(%rdx)
movq (%rdx), %rcx
shlq $0x20, %r14
orq (%rbx), %r14
leaq 0x1(%rcx), %rsi
movq %rsi, (%rdx)
movq %r14, (%rax,%rcx,8)
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rcx
jne 0x1d6a2c
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq (%rsp), %rdx
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movq %r15, (%rax,%rcx,8)
addq $0x20, %rbp
incq %r15
jmp 0x1d698b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_hybrid_ug(ul_resolve_t*, usg_t*)
ma_ug_t *gen_hybrid_ug(ul_resolve_t *uidx, usg_t *ng)
{
    // fprintf(stderr, "[M::%s::] ng->n::%u\n", __func__, (uint32_t)ng->n);
    ma_ug_t *ug = ma_ug_hybrid_gen(ng); 
    // fprintf(stderr, "[M::%s::] ug->g->n_seq::%u\n", __func__, (uint32_t)ug->g->n_seq);
    uint32_t i; ma_utg_t *u; kvec_asg_arc_t_warp e; kv_init(e.a); e.i = 0;
    for (i = 0; i < ug->u.n; i++) {
        ug->g->seq[i].c = PRIMARY_LABLE;
        u = &(ug->u.a[i]);
        if(u->m == 0) continue;
        // fprintf(stderr, "+[M::%s::] i::%u\n", __func__, i);
        merge_hybrid_utg_content(u, uidx->l1_ug, uidx->sg, ng, &e);
        // fprintf(stderr, "-[M::%s::] i::%u\n", __func__, i);
        ug->g->seq[i].len = u->len;
    }
    kv_destroy(e.a);
    return ug;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r15
movq %rsi, 0x8(%rsp)
movq %rsi, %rdi
callq 0x1cbbbd
movq %rax, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq (%rbx), %rbp
xorl %r12d, %r12d
movl %r12d, %r12d
cmpq %r12, %rbp
jbe 0x1d7876
movq 0x18(%rbx), %r14
movq 0x20(%r14), %rax
movb $0x0, 0x4(%rax,%r12,8)
movq 0x10(%rbx), %r13
imulq $0x28, %r12, %rax
cmpl $0x0, 0xc(%r13,%rax)
je 0x1d7871
addq %rax, %r13
movq 0x18(%r15), %rsi
movq 0x20(%r15), %rdx
movq %r13, %rdi
movq 0x8(%rsp), %rcx
leaq 0x10(%rsp), %r8
callq 0x1cfe19
movl (%r13), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
movq 0x20(%r14), %rcx
movl (%rcx,%r12,8), %edx
movl $0x80000000, %esi       # imm = 0x80000000
andl %esi, %edx
orl %eax, %edx
movl %edx, (%rcx,%r12,8)
incl %r12d
jmp 0x1d780e
movq 0x20(%rsp), %rdi
callq 0x2220
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_utg_telo(ma_utg_t*, telo_end_t*)
uint32_t gen_utg_telo(ma_utg_t *u, telo_end_t *te)
{
    uint32_t i;
    for (i = 0; i < u->n; ++i) {
        if(te->hh[u->a[i]>>33]) return 1;
    }
    return 0;
}

// Assembly:
movl 0x10(%rdi), %ecx
xorl %eax, %eax
pushq $0x1
popq %rdx
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x1d78be
movq 0x10(%rsi), %r9
movq 0x18(%rdi), %r10
movq (%r10,%r8,8), %r10
shrq $0x21, %r10
incq %r8
cmpb $0x0, (%r9,%r10)
je 0x1d789d
movl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: renew_ul2_utg(ul_resolve_t*)
void renew_ul2_utg(ul_resolve_t *uidx)
{
    ul2ul_idx_t *z = &(uidx->uovl);
    if(uidx->uovl.cc.iug_a) {
        uint32_t k;
        for (k = 0; k < z->i_ug->u.n; k++) free(uidx->uovl.cc.iug_a[k].a);
    }
    renew_utg(&(z->i_ug), z->i_g, NULL); 
    free(z->i_ug->g->seq_vis); CALLOC(z->i_ug->g->seq_vis, z->i_ug->g->n_seq*2);
    renew_u2g_cov(uidx, uidx->uopt->te); 
    renew_u2g_bg(uidx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x260(%rdi)
je 0x1d82cc
xorl %eax, %eax
movl %eax, %r14d
movq 0x230(%rbx), %rax
cmpq %r14, (%rax)
jbe 0x1d82cc
movq 0x260(%rbx), %rax
imulq $0x18, %r14, %rcx
movq 0x10(%rax,%rcx), %rdi
callq 0x2220
leal 0x1(%r14), %eax
jmp 0x1d82a2
leaq 0x230(%rbx), %rdi
movq 0x228(%rbx), %rsi
xorl %edx, %edx
callq 0x80328
movq 0x230(%rbx), %rax
movq 0x18(%rax), %rax
movq 0x30(%rax), %rdi
callq 0x2220
movq 0x230(%rbx), %rax
movq 0x18(%rax), %r14
movl 0x14(%r14), %edi
addl %edi, %edi
pushq $0x1
popq %rsi
callq 0x2120
movq %rax, 0x30(%r14)
movq (%rbx), %rax
movq 0x70(%rax), %rsi
movq %rbx, %rdi
callq 0x1d91ce
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1d96a2
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_ulg_spec_ovlp(ul_resolve_t*, unsigned long, unsigned long)
ul2ul_t* get_ulg_spec_ovlp(ul_resolve_t *uidx, uint64_t uv, uint64_t uw)
{
    ma_ug_t *iug = uidx->uovl.i_ug; uint32_t qid, tid;
    qid = iug->u.a[uv>>1].a[((uv&1)?(0):(iug->u.a[uv>>1].n-1))]>>33;
    tid = iug->u.a[uw>>1].a[((uw&1)?(iug->u.a[uw>>1].n-1):(0))]>>33;

    if(uidx->uovl.item_idx[qid] == (uint32_t)-1) return NULL;
    ul2ul_item_t *o = &(uidx->uovl.a[uidx->uovl.item_idx[qid]]); uint64_t k;
    for (k = 0; k < o->cn; k++) {
        if(o->a[k].hid != tid) continue;
        return &(o->a[k]);
    }
    return NULL;
}

// Assembly:
movq 0x230(%rdi), %rax
movq 0x10(%rax), %rax
movq %rsi, %rcx
shrq %rcx
imulq $0x28, %rcx, %r8
movq 0x18(%rax,%r8), %rcx
testb $0x1, %sil
jne 0x1d8bde
addq %rax, %r8
movl 0x10(%r8), %esi
decl %esi
jmp 0x1d8be0
xorl %esi, %esi
movq (%rcx,%rsi,8), %rsi
shrq $0x21, %rsi
movq %rdx, %rcx
shrq %rcx
imulq $0x28, %rcx, %rcx
testb $0x1, %dl
jne 0x1d8bfb
xorl %edx, %edx
jmp 0x1d8c04
leaq (%rax,%rcx), %rdx
movl 0x10(%rdx), %edx
decl %edx
movq 0x220(%rdi), %r8
movl (%r8,%rsi,4), %esi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
cmpq %r8, %rsi
je 0x1d8c60
movq 0x18(%rax,%rcx), %rax
movq (%rax,%rdx,8), %rcx
shrq $0x21, %rcx
movq 0x1f0(%rdi), %rax
shlq $0x5, %rsi
leaq (%rax,%rsi), %rdx
movl 0x1c(%rax,%rsi), %eax
imulq $0x28, %rax, %rsi
pushq $-0x28
popq %rdi
xorl %eax, %eax
leaq 0x28(%rdi), %r8
cmpq %r8, %rsi
je 0x1d8c5f
movq (%rdx), %r9
cmpl %ecx, 0x28(%r9,%rdi)
movq %r8, %rdi
jne 0x1d8c43
addq %r8, %r9
movq %r9, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: str_occ_w(ul_str_t*, ul_vec_t*, ma_ug_t*)
uint64_t str_occ_w(ul_str_t *str, ul_vec_t *raw, ma_ug_t *ug)
{
    uint64_t occ, k; uc_block_t *z;
    for (k = occ = 0; k < str->cn; k++) {
        z = &(raw->bb.a[str->a[k]>>32]);
        assert(((z->hid<<1)+z->rev)==((uint32_t)str->a[k]));
        occ += ug_occ_w(z->ts, z->te, &(ug->u.a[z->hid]));
    }
    return occ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x18(%rdi), %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
xorl %r12d, %r12d
cmpq %rbp, %r13
je 0x1da776
movq 0x30(%r14), %rax
movq 0x10(%r15), %rcx
movq (%rcx,%rbp,8), %rsi
movq %rsi, %rcx
shrq $0x20, %rcx
imulq $0x24, %rcx, %rdx
movl (%rax,%rdx), %ecx
movl 0x20(%rax,%rdx), %edi
shrl $0x5, %edi
andl $0x1, %edi
leal (%rdi,%rcx,2), %edi
cmpl %esi, %edi
jne 0x1da788
addq %rdx, %rax
movl 0xc(%rax), %edi
movl 0x10(%rax), %esi
imulq $0x28, %rcx, %rdx
addq 0x10(%rbx), %rdx
callq 0x1b2312
addq %rax, %r12
incq %rbp
jmp 0x1da728
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x219f7(%rip), %rdi     # 0x1fc186
leaq 0x1cd43(%rip), %rsi     # 0x1f74d9
leaq 0x21a15(%rip), %rcx     # 0x1fc1b2
movl $0x41f3, %edx           # imm = 0x41F3
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_cul_g_t(ul_resolve_t*)
void gen_cul_g_t(ul_resolve_t *uidx)
{
    ma_ug_t *ug = uidx->l1_ug; uint64_t k; ul_str_idx_t *str_idx = &(uidx->pstr);
    CALLOC(uidx->cg, 1);
    uidx->cg->n[0] = uidx->idx->n; uidx->cg->n[1] = ug->g->n_seq; 
    uidx->cg->tot = uidx->cg->n[0] + uidx->cg->n[1];
    uidx->cg->g = asg_init();
    for (k = 0; k < uidx->cg->tot; k++) {
        if(k < uidx->cg->n[0]) {
            asg_seq_set(uidx->cg->g, k, str_occ_w(&(str_idx->str.a[k]), &(uidx->idx->a[k]), ug), 
                                                                        ((str_idx->str.a[k].cn>1)?0:1));
        } else {
            asg_seq_set(uidx->cg->g, k, ug->u.a[k-uidx->cg->n[0]].n, 0);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r14
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x2120
movq %rax, 0x1e8(%rbx)
movq 0x30(%rbx), %rcx
movq 0x50(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq %r14, (%rsp)
movq 0x18(%r14), %rdx
movl 0x14(%rdx), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rdx, 0x10(%rax)
addq %rdx, %rcx
movq %rcx, 0x18(%rax)
callq 0x68f5d
movq 0x1e8(%rbx), %rcx
movq %rax, (%rcx)
pushq $0x10
popq %r13
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq 0x18(%rcx), %r15
jae 0x1da89a
movq (%rcx), %r12
movq 0x8(%rcx), %rax
cmpq %rax, %r15
jae 0x1da861
movq 0x1d0(%rbx), %rdi
addq %r14, %rdi
movq 0x30(%rbx), %rax
movq 0x48(%rax), %rsi
addq %rbp, %rsi
movq (%rsp), %rdx
callq 0x1da704
movq 0x1d0(%rbx), %rdx
xorl %ecx, %ecx
testl $0x7ffffffe, 0x18(%rdx,%r14) # imm = 0x7FFFFFFE
sete %cl
movq %r12, %rdi
movl %r15d, %esi
movl %eax, %edx
jmp 0x1da87a
imulq $-0x28, %rax, %rax
movq (%rsp), %rcx
addq 0x10(%rcx), %rax
movl (%r13,%rax), %edx
movq %r12, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x69316
incq %r15
movq 0x1e8(%rbx), %rcx
addq $0x20, %r14
addq $0x28, %r13
addq $0x58, %rbp
jmp 0x1da80e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: renew_paf1(ma_hit_t_alloc*, unsigned long*, unsigned long, unsigned long)
void renew_paf1(ma_hit_t_alloc *paf, uint64_t *a, uint64_t an, uint64_t len)
{
    uint64_t i, k, qn, tn; ma_hit_t arc;
    arc.qns = 0; arc.qe = len;
    arc.tn = 0; arc.ts = 0; arc.te = len;
    arc.rev = arc.el = arc.ml = arc.no_l_indel = arc.bl = 0;

    for (i = 0; i < an; i++) {
        qn = ((uint32_t)a[i]);
        for (k = 0; k < an; k++) {
            tn = ((uint32_t)a[k]);
            update_qtn(&arc, qn, tn); 
            add_ma_hit_t_alloc(&(paf[qn]), &arc);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, (%rsp)
leaq 0x10(%rsp), %r12
andq $0x0, (%r12)
movl %ecx, 0x8(%r12)
andl $0x0, 0x10(%r12)
movl %ecx, 0x14(%r12)
andq $0x0, 0x18(%r12)
andw $0x0, 0x20(%r12)
xorl %eax, %eax
cmpq %rbx, %rax
je 0x1db333
movq %rax, 0x8(%rsp)
movq (%r14,%rax,8), %r15
movl %r15d, %eax
shlq $0x20, %r15
imulq $0x18, %rax, %r13
addq (%rsp), %r13
xorl %ebp, %ebp
cmpq %rbp, %rbx
je 0x1db329
movl (%r14,%rbp,8), %eax
movl 0x10(%rsp), %ecx
orq %r15, %rcx
movq %rcx, 0x10(%rsp)
movl %eax, 0x1c(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x69052
incq %rbp
jmp 0x1db300
movq 0x8(%rsp), %rax
incq %rax
jmp 0x1db2e1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: usg_t_destroy(usg_t*)
void usg_t_destroy(usg_t *g) {
    uint32_t k;
    for (k = 0; k < g->mp.n; k++) {
        free(g->mp.a[k].a);
    }
    free(g->mp.a);

    for (k = 0; k < g->n; k++) {
        free(g->a[k].arc[0].a); free(g->a[k].arc[1].a);
        free(g->a[k].arc_mm[0].a); free(g->a[k].arc_mm[1].a);
    }
    free(g->a);
    
    free(g);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movl %eax, %r14d
movq 0x28(%rbx), %rdi
cmpq %r14, 0x18(%rbx)
jbe 0x1dc85e
imulq $0x18, %r14, %rax
movq (%rdi,%rax), %rdi
callq 0x2220
leal 0x1(%r14), %eax
jmp 0x1dc83e
callq 0x2220
xorl %eax, %eax
movl %eax, %r14d
movq (%rbx), %rdi
cmpq %r14, 0x8(%rbx)
jbe 0x1dc8ac
imulq $0x78, %r14, %r15
movq 0x20(%rdi,%r15), %rdi
callq 0x2220
movq (%rbx), %rax
movq 0x38(%rax,%r15), %rdi
callq 0x2220
movq (%rbx), %rax
movq 0x50(%rax,%r15), %rdi
callq 0x2220
movq (%rbx), %rax
movq 0x68(%rax,%r15), %rdi
callq 0x2220
leal 0x1(%r14), %eax
jmp 0x1dc865
callq 0x2220
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: destroy_ul_resolve_t(ul_resolve_t*)
void destroy_ul_resolve_t(ul_resolve_t *uidx)
{
    ma_ug_destroy(uidx->l1_ug);
    uint32_t k;
    for (k = 0; k < uidx->str_b.n_thread; k++) {
        destroy_integer_t(&(uidx->str_b.buf[k]));
    }
    free(uidx->str_b.buf);

    for (k = 0; k < uidx->pstr.str.n; k++) {
        free(uidx->pstr.str.a[k].a);
    }
    free(uidx->pstr.str.a); 
    free(uidx->pstr.occ.a); 
    free(uidx->pstr.idx.a);

    
    free(uidx->uovl.telo);
    for (k = 0; k < uidx->uovl.n; k++) {
        free(uidx->uovl.a[k].a);
    }
    free(uidx->uovl.a);
    free(uidx->uovl.item_idx);
    asg_destroy(uidx->uovl.i_g);
    

    free(uidx->uovl.cc.uc); 
    free(uidx->uovl.cc.hc); 
    free(uidx->uovl.cc.raw_uc); 
    if(uidx->uovl.cc.iug_a) {
        for (k = 0; k < uidx->uovl.i_ug->u.n; k++) free(uidx->uovl.cc.iug_a[k].a);
    }
    free(uidx->uovl.cc.iug_a); 
    free(uidx->uovl.cc.iug_idx); 
    free(uidx->uovl.cc.iug_b);

    asg_destroy(uidx->uovl.bg.bg); 
    free(uidx->uovl.bg.w_n); 
    free(uidx->uovl.bg.a_n);
    ma_ug_destroy(uidx->uovl.i_ug);
    usg_t_destroy(uidx->uovl.h_usg);

    free(uidx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x6921d
xorl %eax, %eax
movl %eax, %r14d
movq 0x1d8(%rbx), %rdi
cmpq %r14, 0x1e0(%rbx)
jbe 0x1dc8f8
imulq $0x328, %r14, %rax      # imm = 0x328
addq %rax, %rdi
callq 0x1dc6be
leal 0x1(%r14), %eax
jmp 0x1dc8d0
callq 0x2220
xorl %eax, %eax
movl %eax, %r14d
movq 0x1d0(%rbx), %rdi
cmpq %r14, 0x1c0(%rbx)
jbe 0x1dc929
movq %r14, %rax
shlq $0x5, %rax
movq 0x10(%rdi,%rax), %rdi
callq 0x2220
leal 0x1(%r14), %eax
jmp 0x1dc8ff
callq 0x2220
movq 0x1b8(%rbx), %rdi
callq 0x2220
movq 0x1a0(%rbx), %rdi
callq 0x2220
movq 0x2a8(%rbx), %rdi
callq 0x2220
xorl %eax, %eax
movl %eax, %r14d
movq 0x1f0(%rbx), %rdi
cmpq %r14, 0x1f8(%rbx)
jbe 0x1dc97d
movq %r14, %rax
shlq $0x5, %rax
movq (%rdi,%rax), %rdi
callq 0x2220
leal 0x1(%r14), %eax
jmp 0x1dc954
callq 0x2220
movq 0x220(%rbx), %rdi
callq 0x2220
movq 0x228(%rbx), %rdi
callq 0x68f68
movq 0x248(%rbx), %rdi
callq 0x2220
movq 0x250(%rbx), %rdi
callq 0x2220
movq 0x258(%rbx), %rdi
callq 0x2220
xorl %edi, %edi
cmpq $0x0, 0x260(%rbx)
je 0x1dc9f4
movl %edi, %r14d
movq 0x230(%rbx), %rax
movq 0x260(%rbx), %rdi
cmpq %r14, (%rax)
jbe 0x1dc9f4
imulq $0x18, %r14, %rax
movq 0x10(%rdi,%rax), %rdi
callq 0x2220
leal 0x1(%r14), %edi
jmp 0x1dc9ca
callq 0x2220
movq 0x268(%rbx), %rdi
callq 0x2220
movq 0x270(%rbx), %rdi
callq 0x2220
movq 0x278(%rbx), %rdi
callq 0x68f68
movq 0x280(%rbx), %rdi
callq 0x2220
movq 0x288(%rbx), %rdi
callq 0x2220
movq 0x230(%rbx), %rdi
callq 0x6921d
movq 0x240(%rbx), %rdi
callq 0x1dc834
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: renew_R_to_U(asg_t*, ma_hit_t_alloc*, ma_hit_t_alloc*, long, ma_sub_t*, R_to_U*, int, int)
void renew_R_to_U(asg_t *ng, ma_hit_t_alloc* src, ma_hit_t_alloc* r_src, int64_t n_read, ma_sub_t *coverage_cut, 
R_to_U* ruIndex, int max_hang, int min_ovlp)
{
    sset_aux s; memset(&s, 0, sizeof(s)); 
    kt_for(asm_opt.thread_num, clear_ma_hit_t_alloc, src, n_read);
    kt_for(asm_opt.thread_num, clear_ma_hit_t_alloc, r_src, n_read);

    s.g = NULL; s.cov = coverage_cut;
    kt_for(asm_opt.thread_num, reset_ma_sub_t, &s, n_read);

    ma_hit_contained_advance(src, n_read, coverage_cut, ruIndex, max_hang, min_ovlp);

    // s.g = ng; s.cov = coverage_cut;
    // kt_for(asm_opt.thread_num, reset_ma_sub_t, &s, n_read);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, (%rsp)
movq %rsi, %r13
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbp
movups %xmm0, 0x28(%rbp)
movups %xmm0, 0x18(%rbp)
movups %xmm0, 0x8(%rbp)
leaq 0x76cc1(%rip), %r12     # 0x253758
movl 0x7c(%r12), %edi
leaq 0x71(%rip), %rbx        # 0x1dcb14
movq %rbx, %rsi
movq %r13, %rdx
callq 0xc67c0
movl 0x7c(%r12), %edi
movq %rbx, %rsi
movq (%rsp), %rdx
movq %r15, %rcx
callq 0xc67c0
andq $0x0, (%rbp)
movq %r14, 0x10(%rbp)
movl 0x7c(%r12), %edi
leaq 0x6c(%rip), %rsi        # 0x1dcb43
movq %rbp, %rdx
movq %r15, %rcx
callq 0xc67c0
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movl 0x80(%rsp), %r8d
movl 0x88(%rsp), %r9d
callq 0x6a8ea
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: init_ug_clean_t(ug_opt_t*, asg_t*, unsigned char, unsigned char, long, double, double, long)
ug_clean_t *init_ug_clean_t(ug_opt_t *uopt, asg_t *sg, uint8_t is_ou, uint8_t is_trio, int64_t max_ext, double len_rat, double ou_rat, int64_t min_ou)
{
    uint64_t i;
    ug_clean_t *sl; CALLOC(sl, 1);
    ma_ug_t *ug = ma_ug_gen(sg);
    for (i = 0; i < ug->g->n_seq; ++i) {
        if(ug->g->seq[i].del) continue;
        ug->g->seq[i].c = PRIMARY_LABLE;
    }
    MALLOC(sl->idx, (ug->g->n_seq<<1)); memset(sl->idx, -1, sizeof((*(sl->idx)))*(ug->g->n_seq<<1));
    MALLOC(sl->bid, (ug->g->n_seq<<1)); memset(sl->bid, -1, sizeof((*(sl->bid)))*(ug->g->n_seq<<1));
    sl->uopt = uopt; sl->sg = sg; sl->ug = ug; sl->idx_n = sl->bid_n = ug->g->n_seq<<1;
    memset(&(sl->b), 0, sizeof(sl->b)); CALLOC(sl->b.a, (ug->g->n_seq<<1));
    sl->is_ou = is_ou;
    sl->is_trio = is_trio;
    sl->max_ext = max_ext;
    sl->len_rat = len_rat;
    sl->ou_rat = ou_rat;
    sl->min_ou = min_ou;
    if(is_ou) update_ug_ou(sl->ug, sl->sg);
    return sl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x30(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl %ecx, 0xc(%rsp)
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
pushq $0x1
popq %rdi
movl $0xc8, %esi
callq 0x2120
movq %rax, %r15
movq %rbx, %rdi
callq 0x76d91
movq %rax, %r14
movq 0x18(%rax), %rax
xorl %ecx, %ecx
movl 0x14(%rax), %r12d
movl %r12d, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpq %rdx, %rcx
jae 0x1dd228
movq 0x20(%rax), %rdx
cmpl $0x0, (%rdx,%rcx,8)
js 0x1dd223
movb $0x0, 0x4(%rdx,%rcx,8)
incq %rcx
jmp 0x1dd202
addl %edx, %edx
movslq %edx, %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x80(%r15)
addl %r12d, %r12d
movslq %r12d, %r13
leaq (,%r13,4), %r12
movq %rax, %rdi
movl $0xff, %esi
movq %r12, %rdx
callq 0x20e0
movq %r12, %rdi
callq 0x2280
movq %rax, 0x88(%r15)
movq %rax, %rdi
movl $0xff, %esi
movq %r12, %rdx
callq 0x20e0
movq 0x10(%rsp), %rax
movq %rax, (%r15)
movq %rbx, 0x8(%r15)
movq %r14, 0x10(%r15)
movl %r13d, 0x94(%r15)
movl %r13d, 0x90(%r15)
pushq $0x1c
popq %rsi
movq %r13, %rdi
callq 0x2120
movq %rax, 0x18(%r15)
movb %bpl, 0x98(%r15)
movl 0xc(%rsp), %eax
movb %al, 0x99(%r15)
movq 0x18(%rsp), %rax
movq %rax, 0xa0(%r15)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0xb0(%r15)
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0xb8(%r15)
movq 0x30(%rsp), %rax
movq %rax, 0xc0(%r15)
testb %bpl, %bpl
je 0x1dd2ff
movq %r14, %rdi
movq %rbx, %rsi
callq 0x76c93
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: usg_topocut_aux_del(ma_ug_t*, unsigned int, int, asg64_v*)
int usg_topocut_aux_del(ma_ug_t *ug, uint32_t v, int max_ext, asg64_v *b)
{
	int32_t n_ext; 
	for (n_ext = 0; n_ext < max_ext && v != (uint32_t)-1; ) {
		if (usg_topocut_aux_unambi1(ug->g, v^1) == (uint32_t)-1) break;
        if(b) kv_push(uint64_t, *b, v); n_ext += ug->u.a[v>>1].n;
		v = usg_topocut_aux_unambi1(ug->g, v);
	}
	return n_ext;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r15
xorl %r14d, %r14d
cmpl $-0x1, %r12d
je 0x1dd8f0
cmpl %ebp, %r14d
jge 0x1dd8f0
movq 0x18(%r15), %r13
movl %r12d, %esi
xorl $0x1, %esi
movq %r13, %rdi
callq 0x1dd7e1
cmpl $-0x1, %eax
je 0x1dd8f0
testq %rbx, %rbx
je 0x1dd8cb
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rcx
jne 0x1dd8bd
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
movq 0x18(%r15), %r13
movl %r12d, %edx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
movq %rdx, (%rax,%rcx,8)
movq 0x10(%r15), %rax
movl %r12d, %ecx
shrl %ecx
imulq $0x28, %rcx, %rcx
addl 0x10(%rax,%rcx), %r14d
movq %r13, %rdi
movl %r12d, %esi
callq 0x1dd7e1
movl %eax, %r12d
jmp 0x1dd858
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: cal_utg_occ(ma_ug_t*, unsigned int)
uint32_t cal_utg_occ(ma_ug_t *ug, uint32_t begNode)
{
    uint32_t v = begNode, w, kv, occ = 0; ma_utg_t *u;

    while (1) {
        kv = get_real_length(ug->g, v, NULL);
        u = &(ug->u.a[v>>1]); occ += u->n; 
        if(kv!=1) break;
        ///kv must be 1 here
        kv = get_real_length(ug->g, v, &w);
        if(get_real_length(ug->g, w^1, NULL)!=1) break;
        v = w;
        if(v == begNode) break;
    }
    return occ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r15
xorl %r14d, %r14d
leaq 0xc(%rsp), %r12
movl %esi, %ebp
movq 0x18(%r15), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0xc2e7a
movq 0x10(%r15), %rcx
movl %ebp, %edx
shrl %edx
imulq $0x28, %rdx, %rdx
addl 0x10(%rcx,%rdx), %r14d
cmpl $0x1, %eax
jne 0x1dd96d
movq 0x18(%r15), %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0xc2e7a
movq 0x18(%r15), %rdi
movl 0xc(%rsp), %esi
xorl $0x1, %esi
xorl %edx, %edx
callq 0xc2e7a
cmpl $0x1, %eax
jne 0x1dd96d
movl 0xc(%rsp), %ebp
cmpl %ebx, %ebp
jne 0x1dd91d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: cal_bub_best(void*, long, int)
static void cal_bub_best(void *data, long i, int tid)
{
    ug_clean_t *sl = (ug_clean_t *)data;
    ma_ug_t *ug = sl->ug; uint32_t v, w;
    sl->idx[i<<1] = sl->idx[(i<<1)+1] = (uint32_t)-1;
    if(ug->g->seq[i].del) return;
    if((sl->bid[i<<1] == (uint32_t)-1) || (sl->bid[(i<<1)+1] == (uint32_t)-1)) return;///not within a bubble
    
    v = i<<1;
    if(sl->bid[v] != v) {///not the beg/sink node
        w = get_best_het_node(ug, v, sl->bid, sl->is_ou, sl->is_trio, sl->len_rat, sl->ou_rat, sl->min_ou);
        // if(v == 352) fprintf(stderr, "-v-[M::%s]\tutg%.6ul(%c)\tv::%u\tw::%u\n", __func__, (v>>1)+1, "+-"[v&1], v, w);
        if((w != (uint32_t)-1) && ((v^1) == get_best_het_node(ug, w^1, sl->bid, sl->is_ou, sl->is_trio, sl->len_rat, sl->ou_rat, sl->min_ou))) {
            sl->idx[v] = w;
        }
    }

    v = (i<<1)+1;
    if(sl->bid[v] != v) {///not the beg/sink node
        w = get_best_het_node(ug, v, sl->bid, sl->is_ou, sl->is_trio, sl->len_rat, sl->ou_rat, sl->min_ou);
        if((w != (uint32_t)-1) && ((v^1) == get_best_het_node(ug, w^1, sl->bid, sl->is_ou, sl->is_trio, sl->len_rat, sl->ou_rat, sl->min_ou))) {
            sl->idx[v] = w;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %r14
movq 0x80(%rdi), %rax
leaq (%rsi,%rsi), %r12
orl $-0x1, 0x4(%rax,%r12,4)
orl $-0x1, (%rax,%rsi,8)
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
cmpl $0x0, (%rax,%rsi,8)
js 0x1de4e9
movq %rdi, %rbx
movq 0x88(%rdi), %rdx
cmpl $-0x1, (%rdx,%r12,4)
je 0x1de4e9
leaq 0x1(,%rsi,2), %r15
cmpl $-0x1, (%rdx,%r15,4)
je 0x1de4e9
movl %r12d, %r13d
andl $-0x2, %r13d
cmpl %r12d, (%rdx,%r13,4)
je 0x1de44f
movzbl 0x98(%rbx), %ecx
movzbl 0x99(%rbx), %r8d
movsd 0xb0(%rbx), %xmm0
movsd 0xb8(%rbx), %xmm1
movl 0xc0(%rbx), %r9d
movq %r14, %rdi
movl %r12d, %esi
callq 0x1dd5be
cmpl $-0x1, %eax
je 0x1de44f
movl %eax, %ebp
orl $0x1, %r12d
movl %eax, %esi
xorl $0x1, %esi
movq 0x88(%rbx), %rdx
movzbl 0x98(%rbx), %ecx
movzbl 0x99(%rbx), %r8d
movsd 0xb0(%rbx), %xmm0
movsd 0xb8(%rbx), %xmm1
movl 0xc0(%rbx), %r9d
movq %r14, %rdi
callq 0x1dd5be
cmpl %eax, %r12d
jne 0x1de44f
movq 0x80(%rbx), %rax
movl %ebp, (%rax,%r13,4)
movq 0x88(%rbx), %rdx
movl %r15d, %r12d
cmpl %r15d, (%rdx,%r12,4)
je 0x1de4e9
movzbl 0x98(%rbx), %ecx
movzbl 0x99(%rbx), %r8d
movsd 0xb0(%rbx), %xmm0
movsd 0xb8(%rbx), %xmm1
movl 0xc0(%rbx), %r9d
movq %r14, %rdi
movl %r15d, %esi
callq 0x1dd5be
cmpl $-0x1, %eax
je 0x1de4e9
movl %eax, %ebp
andl $-0x2, %r15d
movl %eax, %esi
xorl $0x1, %esi
movq 0x88(%rbx), %rdx
movzbl 0x98(%rbx), %ecx
movzbl 0x99(%rbx), %r8d
movsd 0xb0(%rbx), %xmm0
movsd 0xb8(%rbx), %xmm1
movl 0xc0(%rbx), %r9d
movq %r14, %rdi
callq 0x1dd5be
cmpl %eax, %r15d
jne 0x1de4e9
movq 0x80(%rbx), %rax
movl %ebp, (%rax,%r12,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_specfic_edge(asg_t*, unsigned int, unsigned int)
inline asg_arc_t* get_specfic_edge(asg_t *g, uint32_t v, uint32_t w)
{
    asg_arc_t *av = asg_arc_a(g, v); uint32_t nv = asg_arc_n(g, v), k;
    for (k = 0; k < nv; k++) {
        if(av[k].del) continue;
        if(av[k].v == w) break;
    }

    if(k < nv) return (&av[k]);
    return NULL;    
}

// Assembly:
movq 0x28(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
shrq $0x20, %rax
imulq $0x18, %rax, %rax
addq 0x8(%rdi), %rax
subq $0x1, %rcx
jb 0x1de65c
cmpl $0x0, 0xc(%rax)
js 0x1de656
cmpl %edx, 0x8(%rax)
je 0x1de65e
addq $0x18, %rax
jmp 0x1de645
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_bridges(ul_resolve_t*, unsigned long*, unsigned long, unsigned int*, unsigned int*)
inline void get_bridges(ul_resolve_t *uidx, uint64_t *v_a, uint64_t v_n, uint32_t *w_occ, uint32_t *am_occ)
{
    ul_bg_t *bg = &(uidx->uovl.bg); uint64_t k, w, am, l; uint32_t uv, uw, bv, bw; 
    for (k = w = am = 0, uv = uw = (uint32_t)-1; k < v_n; k++) {
        w += bg->w_n[v_a[k]>>1]; am += bg->a_n[v_a[k]>>1]; uw = v_a[k];
        if(uv != (uint32_t)-1) {
            bv = uidx->uovl.cc.iug_a[uv>>1].a[((uv&1)?(0):(uidx->uovl.cc.iug_a[uv>>1].n-1))].v; if(uv&1) bv ^= 1;
            bw = uidx->uovl.cc.iug_a[uw>>1].a[((uw&1)?(uidx->uovl.cc.iug_a[uw>>1].n-1):(0))].v; if(uw&1) bw ^= 1;
            if((ulg_type(uidx->uovl, (bv>>1))) && (ulg_type(uidx->uovl, (bw>>1)))) {
                l = get_bg_flag(uidx, bv, bw);
                if(l == bg_wrong) w++;
                if(l == bg_ambiguous) am++;
            }
        }
        uv = uw;
    }
    if(w_occ) *w_occ = w;
    if(am_occ) *am_occ = am;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rsi, %r11
pushq $-0x1
popq %r12
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %rdi, 0x10(%rsp)
cmpq %r14, %r15
je 0x1ded91
movl %r12d, %eax
movq (%r11,%r14,8), %r12
movq %r12, %rdx
shrq %rdx
movq 0x280(%rdi), %rcx
addl (%rcx,%rdx,4), %ebx
movq 0x288(%rdi), %rcx
addl (%rcx,%rdx,4), %ebp
cmpl $-0x1, %eax
je 0x1ded89
movq 0x260(%rdi), %rcx
movl %eax, %esi
shrl %esi
imulq $0x18, %rsi, %rsi
testb $0x1, %al
jne 0x1decf3
leaq (%rcx,%rsi), %r8
movq (%r8), %r8
decq %r8
jmp 0x1decf6
xorl %r8d, %r8d
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
imulq $0x18, %rdx, %rdx
movl %r12d, %r13d
andl $0x1, %r13d
jne 0x1ded0e
xorl %r9d, %r9d
jmp 0x1ded18
leaq (%rcx,%rdx), %r9
movq (%r9), %r9
decq %r9
movq 0x10(%rcx,%rsi), %rsi
shlq $0x4, %r8
movl (%rsi,%r8), %esi
movl %esi, %r10d
shrl %r10d
movq 0x208(%rdi), %r8
cmpq %r10, %r8
jbe 0x1ded89
movq 0x10(%rcx,%rdx), %rcx
shlq $0x4, %r9
movl (%rcx,%r9), %edx
movl %edx, %ecx
shrl %ecx
cmpq %rcx, %r8
jbe 0x1ded89
andl $0x1, %eax
xorl %eax, %esi
xorl %r13d, %edx
movq %rbx, %r13
movl %ebp, %ebx
movq %r15, %rbp
movq %r11, %r15
callq 0x1dedb7
movq %r15, %r11
movq %rbp, %r15
movl %ebx, %ebp
movq %r13, %rbx
movq 0x10(%rsp), %rdi
xorl %ecx, %ecx
cmpl $0x2, %eax
sete %cl
addl %ecx, %ebx
xorl %ecx, %ecx
cmpl $0x3, %eax
sete %cl
addl %ecx, %ebp
incq %r14
jmp 0x1deca1
movq (%rsp), %rax
testq %rax, %rax
je 0x1ded9c
movl %ebx, (%rax)
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x1deda8
movl %ebp, (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_bg_flag(ul_resolve_t*, unsigned int, unsigned int)
inline uint32_t get_bg_flag(ul_resolve_t *uidx, uint32_t v, uint32_t w)
{
    asg_t *g = uidx->uovl.bg.bg; asg_arc_t *av; uint32_t k, nv; 
    if(g->seq[v>>1].del || g->seq[w>>1].del) return bg_unavailable;

    av = asg_arc_a(g, v); nv = asg_arc_n(g, v);
    for (k = 0; k < nv; k++) {
        if(av[k].v == w) break;
    }
    if(k >= nv) return bg_unavailable;
    if(av[k].ou == 3) return bg_correct;
    if(av[k].ou == 2) return bg_wrong;
    return bg_ambiguous;
}

// Assembly:
movq 0x278(%rdi), %rdi
movq 0x20(%rdi), %rcx
movl %esi, %r8d
shrl %r8d
pushq $-0x1
popq %rax
cmpl $0x0, (%rcx,%r8,8)
js 0x1dee3a
movl %edx, %r8d
shrl %r8d
cmpl $0x0, (%rcx,%r8,8)
js 0x1dee3a
movq 0x8(%rdi), %rcx
movq 0x28(%rdi), %rdi
movl %esi, %esi
movq (%rdi,%rsi,8), %rsi
movl %esi, %edi
shrq $0x20, %rsi
imulq $0x18, %rsi, %rsi
leaq (%rsi,%rcx), %r8
addq $0x10, %r8
imulq $0x18, %rdi, %r9
xorl %edi, %edi
cmpq %rdi, %r9
je 0x1dee3a
cmpl %edx, -0x8(%r8,%rdi)
je 0x1dee17
addq $0x18, %rdi
jmp 0x1dee05
addq %rcx, %rsi
movzwl 0x10(%rdi,%rsi), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
xorl %ecx, %ecx
cmpw $0x2, %ax
sete %cl
xorl $0x3, %ecx
cmpw $0x3, %ax
pushq $0x1
popq %rax
cmovnel %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_usg_arc(usg_t*, unsigned int, unsigned int)
inline usg_arc_t* get_usg_arc(usg_t *g, uint32_t v, uint32_t w)
{
    usg_arc_t *av = usg_arc_a(g, v); uint32_t nv = usg_arc_n(g, v), k;
    for (k = 0; k < nv; k++) {
        if(av[k].v == w) break;
    }

    if(k < nv) return (&av[k]);
    return NULL;    
}

// Assembly:
movl %esi, %eax
shrl %eax
andl $0x1, %esi
imulq $0x78, %rax, %rax
addq (%rdi), %rax
imulq $0x18, %rsi, %rcx
movq 0x20(%rcx,%rax), %rsi
movl 0x10(%rcx,%rax), %ecx
addq $-0x20, %rsi
incq %rcx
decq %rcx
je 0x1dee6f
leaq 0x20(%rsi), %rax
cmpl %edx, 0x28(%rsi)
movq %rax, %rsi
jne 0x1dee5d
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: undel_arcs(usg_t*, unsigned int, unsigned int*)
inline int undel_arcs(usg_t *g, uint32_t v, uint32_t* v_s)
{
    uint32_t i, nv = usg_arc_n(g, v), kv; 
    usg_arc_t *av = usg_arc_a(g, v);
    for (i = kv = 0; i < nv; i++) {
        if(av[i].del) continue;
        if(v_s) v_s[kv] = av[i].v;
        kv++; 
    }
    return kv;
}

// Assembly:
movl %esi, %eax
shrl %eax
andl $0x1, %esi
imulq $0x78, %rax, %rax
addq (%rdi), %rax
imulq $0x18, %rsi, %rsi
movl 0x10(%rsi,%rax), %ecx
movq 0x20(%rsi,%rax), %rsi
shlq $0x5, %rcx
xorl %edi, %edi
xorl %eax, %eax
cmpq %rdi, %rcx
je 0x1df06c
cmpl $0x0, 0xc(%rsi,%rdi)
js 0x1df066
testq %rdx, %rdx
je 0x1df064
movl 0x8(%rsi,%rdi), %r8d
movl %eax, %r9d
movl %r8d, (%rdx,%r9,4)
incl %eax
addq $0x20, %rdi
jmp 0x1df047
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_usg_tig(usg_t*, unsigned int, unsigned int*, long*, buf_t*)
inline uint32_t gen_usg_tig(usg_t *g, uint32_t sid, uint32_t *eid, int64_t *baseLen, buf_t* b)
{
    uint32_t v = sid, w, k, kv, nv, return_flag;
    usg_arc_t *av;
    (*baseLen) = 0; (*eid) = (uint32_t)-1;
    while (1) {
        kv = usg_arc_occ(g, v, NULL);
        (*eid) = v;
        if(b) kv_push(uint32_t, b->b, v);
        ///means reach the end of a unitig
        if(kv!=1) (*baseLen) += g->a[v>>1].len;
        if(kv==0) {
            return_flag = END_TIPS;
            break;
        } else if(kv>1) {
            return_flag = MUL_OUTPUT;
            break;
        }

        ///kv must be 1 here
        kv = usg_arc_occ(g, v, &w);
        if(usg_arc_occ(g, w^1, NULL)!=1) {
            (*baseLen) += g->a[v>>1].len;
            return_flag = MUL_INPUT;
            break;
        } else {
            av = usg_arc_a(g, v); nv = usg_arc_n(g, v);
            for (k = 0; k < nv; k++) {
                if(av[k].del) continue;
                ///here is just one undeleted edge
                (*baseLen) += asg_arc_len(av[k]);
                break;
            }
        }

        v = w;
        if(v == sid) {
            return_flag = LOOP;
            break;
        } 
    }
    return return_flag;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %r12
movq %rcx, 0x10(%rsp)
andq $0x0, (%rcx)
orl $-0x1, (%rdx)
movl %esi, %ebp
movq %r12, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x1df1ab
movl %eax, %ebx
movl %ebp, (%r15)
testq %r14, %r14
je 0x1df0ea
movq 0x38(%r14), %rcx
movq 0x48(%r14), %rax
cmpq 0x40(%r14), %rcx
jne 0x1df0df
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x40(%r14)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x48(%r14)
movq 0x38(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x38(%r14)
movl %ebp, (%rax,%rcx,4)
cmpl $0x1, %ebx
jne 0x1df169
movq %r12, %rdi
movl %ebp, %esi
leaq 0xc(%rsp), %rdx
callq 0x1df1ab
movl 0xc(%rsp), %esi
xorl $0x1, %esi
movq %r12, %rdi
xorl %edx, %edx
callq 0x1df1ab
movl %ebp, %edx
shrl %edx
movq (%r12), %rcx
cmpl $0x1, %eax
jne 0x1df189
andl $0x1, %ebp
imulq $0x78, %rdx, %rax
addq %rax, %rcx
imulq $0x18, %rbp, %rdx
movq 0x20(%rdx,%rcx), %rax
movl 0x10(%rdx,%rcx), %ecx
shlq $0x5, %rcx
pushq $-0x20
popq %rdx
leaq 0x20(%rdx), %rsi
cmpq %rsi, %rcx
je 0x1df158
cmpl $0x0, 0x2c(%rax,%rdx)
movq %rsi, %rdx
js 0x1df13a
movl (%rax,%rsi), %eax
movq 0x10(%rsp), %rcx
addq %rax, (%rcx)
movl 0xc(%rsp), %ebp
cmpl %r13d, %ebp
jne 0x1df095
pushq $0x7
jmp 0x1df19b
movq (%r12), %rax
shrl %ebp
imulq $0x78, %rbp, %rcx
movl 0x8(%rax,%rcx), %eax
movq 0x10(%rsp), %rcx
addq %rax, (%rcx)
xorl %eax, %eax
cmpl $0x1, %ebx
adcl $0x4, %eax
jmp 0x1df19c
imulq $0x78, %rdx, %rax
movl 0x8(%rcx,%rax), %eax
movq 0x10(%rsp), %rcx
addq %rax, (%rcx)
pushq $0x3
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq