LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_sub_integer_path(unsigned long*, long, long, long, unsigned long, asg64_v*)
void gen_sub_integer_path(uint64_t *int_a, int64_t s, int64_t e, int64_t it, uint64_t v, asg64_v *res)
{
    int64_t k; res->n = 0; assert((int_a[it]>>1) == (v>>1));
    if(int_a[it] == v) {///forward
        kv_resize(uint64_t, *res, (uint64_t)(e - it));
        for (k = it; k < e; k++) res->a[res->n++] = int_a[k];
    } else {//reverse
        kv_resize(uint64_t, *res, (uint64_t)(it - s));
        for (k = it; k >= s; k--) res->a[res->n++] = int_a[k]^1;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq $0x0, (%r9)
movq (%rdi,%rcx,8), %rax
movq %rax, %rcx
xorq %r8, %rcx
cmpq $0x2, %rcx
jae 0x21f49f
movq %r9, %rbx
movq %rdi, %r15
movq 0x8(%r9), %rcx
cmpq %r8, %rax
jne 0x21f40b
movq %rdx, %r13
movq %rdx, %rax
subq %r14, %rax
cmpq %rax, %rcx
jae 0x21f3df
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq %rax, 0x10(%rbx)
cmpq %r14, %r13
jle 0x21f495
movq 0x10(%rbx), %rax
movq (%r15,%r14,8), %rcx
movq (%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%rbx)
movq %rcx, (%rax,%rdx,8)
incq %r14
cmpq %r14, %r13
jne 0x21f3ec
jmp 0x21f495
movq %rsi, %r12
movq %r14, %rax
subq %rsi, %rax
cmpq %rax, %rcx
jae 0x21f46a
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq %rax, 0x10(%rbx)
cmpq %r12, %r14
jl 0x21f495
movq 0x10(%rbx), %rax
incq %r14
movq -0x8(%r15,%r14,8), %rcx
xorq $0x1, %rcx
movq (%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%rbx)
movq %rcx, (%rax,%rdx,8)
decq %r14
cmpq %r12, %r14
jg 0x21f476
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x29ef0(%rip), %rdi     # 0x249396
leaq 0x2615c(%rip), %rsi     # 0x245609
leaq 0x29efb(%rip), %rcx     # 0x2493af
movl $0x36dd, %edx           # imm = 0x36DD
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_sub_integer_path_ff(unsigned long*, long, long, long, unsigned long, unsigned char*, asg64_v*)
uint64_t gen_sub_integer_path_ff(uint64_t *int_a, int64_t s, int64_t e, int64_t it, uint64_t v, uint8_t *f, asg64_v *res)
{
    int64_t k; res->n = 0; assert((int_a[it]>>1) == (v>>1));
    if(int_a[it] == v) {///forward
        kv_resize(uint64_t, *res, (uint64_t)(e - it));
        for (k = it; k < e; k++) {
            res->a[res->n++] = int_a[k];
            if(res->n > 1 && f[res->a[res->n-1]^1]) return res->n;
        }
    } else {//reverse
        kv_resize(uint64_t, *res, (uint64_t)(it - s));
        for (k = it; k >= s; k--) {
            res->a[res->n++] = int_a[k]^1;
            if(res->n > 1 && f[res->a[res->n-1]^1]) return res->n;
        }
    }
    res->n = 0; return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq 0x40(%rsp), %rbp
movq $0x0, (%rbp)
movq (%rdi,%rcx,8), %rax
movq %rax, %rcx
xorq %r8, %rcx
cmpq $0x2, %rcx
jae 0x21fbed
movq %r9, %rbx
movq %rdi, %r15
movq 0x8(%rbp), %rcx
cmpq %r8, %rax
jne 0x21fb2f
movq %rdx, %r13
movq %rdx, %rax
subq %r14, %rax
cmpq %rax, %rcx
jae 0x21fae4
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%rbp)
movq 0x10(%rbp), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
cmpq %r14, %r13
jle 0x21fbd4
movq (%rbp), %rax
movq 0x10(%rbp), %rcx
movq (%r15,%r14,8), %rdx
leaq 0x1(%rax), %rsi
movq %rsi, (%rbp)
movq %rdx, (%rcx,%rax,8)
movq (%rbp), %rax
cmpq $0x2, %rax
jb 0x21fb22
movq -0x8(%rcx,%rax,8), %rdx
xorq $0x1, %rdx
cmpb $0x0, (%rbx,%rdx)
jne 0x21fbde
incq %r14
cmpq %r14, %r13
jne 0x21faf5
jmp 0x21fbd4
movq %rsi, %r12
movq %r14, %rax
subq %rsi, %rax
cmpq %rax, %rcx
jae 0x21fb8e
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%rbp)
movq 0x10(%rbp), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq %rax, 0x10(%rbp)
cmpq %r12, %r14
jl 0x21fbd4
movq (%rbp), %rax
movq 0x10(%rbp), %rcx
incq %r14
movq -0x8(%r15,%r14,8), %rdx
xorq $0x1, %rdx
leaq 0x1(%rax), %rsi
movq %rsi, (%rbp)
movq %rdx, (%rcx,%rax,8)
movq (%rbp), %rax
cmpq $0x2, %rax
jb 0x21fbcc
movq -0x8(%rcx,%rax,8), %rdx
xorq $0x1, %rdx
cmpb $0x0, (%rbx,%rdx)
jne 0x21fbde
decq %r14
cmpq %r12, %r14
jg 0x21fb9e
movq $0x0, (%rbp)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x297a2(%rip), %rdi     # 0x249396
leaq 0x25a0e(%rip), %rsi     # 0x245609
leaq 0x298f6(%rip), %rcx     # 0x2494f8
movl $0x375f, %edx           # imm = 0x375F
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_best_pair(ul_resolve_t*, usg_t*, unsigned long*, unsigned long*, unsigned char*, unsigned long, unsigned long, asg64_v*, asg64_v*, unsigned long*, unsigned long*, asg64_v*)
void get_best_pair(ul_resolve_t *uidx, usg_t *ng, uint64_t *int_idx, uint64_t *int_a, 
uint8_t *f, uint64_t s, uint64_t e, asg64_v *b0, asg64_v *b1, uint64_t *ridx_a, 
uint64_t *ridx, asg64_v *res)
{
    uint64_t pi, v, k, *pz;
    b0->n = b1->n = 0; 
    for (k = s, pi = (uint64_t)-1; k < e; k++) {
        v = int_a[k]; 
        if((f[v^1])) {
            if(pi != (uint64_t)-1) {
                if(is_best_pair(uidx, ng, int_idx, int_a, s, e, k, v^1, ridx_a, ridx, b0, b1, f, 0.51)) {
                    kv_pushp(uint64_t, *res, &pz); 
                    *pz = pi; (*pz) <<= 32; (*pz) |= k;
                } 
            }
            pi = (uint64_t)-1;    
        }
        if(f[v]) {
            pi = (uint64_t)-1;
            if(is_best_pair(uidx, ng, int_idx, int_a, s, e, k, v, ridx_a, ridx, b0, b1, f, 0.51)) {
                pi = k;//keep the shortest pi<->k
            } 
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %r10
xorl %eax, %eax
movq %rax, (%rcx)
movq %rax, (%rdx)
movq %r9, 0x8(%rsp)
cmpq %r10, %r9
jae 0x2200c3
movq %r8, %r14
movq $-0x1, %r12
movq 0x8(%rsp), %rbx
movq (%r15,%rbx,8), %rbp
movq %rbp, %rax
xorq $0x1, %rax
cmpb $0x0, (%r14,%rax)
je 0x220020
movq $-0x1, %r13
cmpq $-0x1, %r12
je 0x220046
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r15, %rcx
movq 0x10(%rsp), %r8
movq %r10, %r9
movsd 0x1169c(%rip), %xmm0    # 0x231648
pushq %r14
pushq 0x80(%rsp)
pushq 0x80(%rsp)
pushq 0xa0(%rsp)
pushq 0xa0(%rsp)
pushq %rax
pushq %rbx
callq 0x21fc0c
addq $0x40, %rsp
testq %rax, %rax
je 0x220025
movq 0x88(%rsp), %rdx
movq (%rdx), %rcx
movq 0x10(%rdx), %rax
cmpq 0x8(%rdx), %rcx
jne 0x22002c
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rdx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x88(%rsp), %rsi
movq %rax, 0x10(%rsi)
movq (%rsi), %rcx
jmp 0x22002f
movq %r12, %r13
jmp 0x220046
movq 0x60(%rsp), %r10
jmp 0x220046
movq %rdx, %rsi
movq 0x60(%rsp), %r10
leaq 0x1(%rcx), %rdx
movq %rdx, (%rsi)
shlq $0x20, %r12
orq %rbx, %r12
movq %r12, (%rax,%rcx,8)
cmpb $0x0, (%r14,%rbp)
je 0x2200b4
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r15, %rcx
movq 0x10(%rsp), %r8
movq %r10, %r9
movsd 0x115d5(%rip), %xmm0    # 0x231648
pushq %r14
pushq 0x80(%rsp)
pushq 0x80(%rsp)
pushq 0xa0(%rsp)
pushq 0xa0(%rsp)
pushq %rbp
pushq %rbx
callq 0x21fc0c
movq 0xa0(%rsp), %r10
addq $0x40, %rsp
cmpq $0x1, %rax
movl $0x0, %r13d
sbbq %r13, %r13
orq %rbx, %r13
incq %rbx
movq %r13, %r12
cmpq %rbx, %r10
jne 0x21ff5f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: debug_prt_renew_aln(usg_t*, unsigned long*, unsigned long, unsigned long*, unsigned long, asg64_v*, unsigned long*)
void debug_prt_renew_aln(usg_t *ng, uint64_t *int_idx, uint64_t int_idx_n, uint64_t *int_a, uint64_t int_an, asg64_v *b64, uint64_t *ridx)
{
    uint64_t k, s, e, i;
    for (i = 0; i < int_idx_n; i++) {///scan all integer contigs
        s = int_idx[i]>>32; e = s + ((uint32_t)int_idx[i]); assert(e > s + 1);//the length is at least 2
        fprintf(stderr, "\n[M::%s::] occ::%lu\n", __func__, e - s);
        for (k = s; k <= e; k++) {
            // fprintf(stderr, "utg%.6dl(%c),", (int32_t)(int_a[k]>>1)+1, "+-"[int_a[k]&1]);
            fprintf(stderr, "utg%.6dl,", (int32_t)(int_a[k]>>1)+1);
        }
        fprintf(stderr, "\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
testq %rdx, %rdx
je 0x2204d6
movq %rcx, %rbx
movq 0x74b82(%rip), %r12     # 0x294fe0
xorl %r13d, %r13d
movq 0x10(%rsp), %rax
movq (%rax,%r13,8), %r15
movl %r15d, %ecx
cmpq $0x1, %rcx
jbe 0x2204e5
shrq $0x20, %r15
leaq (%r15,%rcx), %rbp
movq (%r12), %rdi
leaq 0x292e5(%rip), %rsi     # 0x24976b
leaq 0x292f3(%rip), %rdx     # 0x249780
xorl %eax, %eax
callq 0x22b0
decq %r15
leaq 0x28fab(%rip), %r14     # 0x249449
movq (%r12), %rdi
movq 0x8(%rbx,%r15,8), %rdx
shrq %rdx
incl %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x22b0
incq %r15
cmpq %rbp, %r15
jb 0x22049e
movq (%r12), %rsi
movl $0xa, %edi
callq 0x2270
incq %r13
cmpq 0x8(%rsp), %r13
jne 0x220461
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28720(%rip), %rdi     # 0x248c0c
leaq 0x25116(%rip), %rsi     # 0x245609
leaq 0x2920c(%rip), %rcx     # 0x249706
movl $0x3816, %edx           # imm = 0x3816
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: worker_ul_aln_path(void*, long, int)
static void worker_ul_aln_path(void *data, long i, int tid) // callback for kt_for()
{
    unique_bridge_check_t *u_aux = (unique_bridge_check_t*)data;
    ul_resolve_t *uidx = u_aux->uidx; 
    integer_t *buf = &(uidx->str_b.buf[tid]);
    uint64_t s, e;
    // uint64_t *x = &(uidx->uovl.iug_tra->a[i]); 
    // asg_arc_t *ve = &(uidx->uovl.i_ug->g->arc[*x]);

    asg64_v b_v, b_r, res; 
    b_v.a = buf->u.a; b_v.n = buf->u.n; b_v.m = buf->u.m; 
    b_r.a = buf->o.a; b_r.n = buf->o.n; b_r.m = buf->o.m; 
    res.a = buf->res_dump.a; res.n = buf->res_dump.n; res.m = buf->res_dump.m;

    b_v.n = b_r.n = 0; 
    s = u_aux->int_idx[i]>>32; ///the i-th integer contig/path 
    e = s + ((uint32_t)(u_aux->int_idx[i])); 
    assert(e > s + 1);//the length is at least 2

    get_best_path(uidx, u_aux->ng, u_aux->int_idx, u_aux->int_a, u_aux->f, s, e, &b_v, &b_r, u_aux->ridx_a, u_aux->ridx, &res);
    // get_ul_arc_supports(uidx, ve, &b_v, &b_r, 1, &w_v, &w_r);

    buf->u.a = b_v.a; buf->u.n = b_v.n; buf->u.m = b_v.m; 
    buf->o.a = b_r.a; buf->o.n = b_r.n; buf->o.m = b_r.m; 
    buf->res_dump.a = res.a; buf->res_dump.n = res.n; buf->res_dump.m = res.m;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rax
movq (%rdi), %rdi
movq 0x1d8(%rdi), %rbx
movslq %edx, %rcx
imulq $0x328, %rcx, %rcx      # imm = 0x328
movq 0xa0(%rbx,%rcx), %rdx
movq %rdx, 0x60(%rsp)
movq 0x98(%rbx,%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x88(%rbx,%rcx), %rdx
movq %rdx, 0x40(%rsp)
movq 0x80(%rbx,%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x310(%rbx,%rcx), %rdx
movq %rdx, 0x80(%rsp)
movups 0x300(%rbx,%rcx), %xmm0
movaps %xmm0, 0x70(%rsp)
xorl %edx, %edx
movq %rdx, 0x30(%rsp)
movq %rdx, 0x50(%rsp)
movq 0x38(%rax), %rdx
movq (%rdx,%rsi,8), %r9
movl %r9d, %esi
cmpq $0x1, %rsi
jbe 0x220916
addq %rcx, %rbx
shrq $0x20, %r9
addq %r9, %rsi
movq 0x28(%rax), %r8
movq 0x48(%rax), %rcx
movups 0x58(%rax), %xmm0
leaq 0x70(%rsp), %r14
movq %r14, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
leaq 0x30(%rsp), %r15
movq %r15, 0x10(%rsp)
leaq 0x50(%rsp), %r12
movq %r12, 0x8(%rsp)
movq %rsi, (%rsp)
callq 0x21f863
movq 0x10(%r12), %rax
movq %rax, 0xa0(%rbx)
movaps (%r12), %xmm0
movups %xmm0, 0x90(%rbx)
movq 0x10(%r15), %rax
movq %rax, 0x88(%rbx)
movaps (%r15), %xmm0
movups %xmm0, 0x78(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x310(%rbx)
movaps (%r14), %xmm0
movups %xmm0, 0x300(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x282ef(%rip), %rdi     # 0x248c0c
leaq 0x24ce5(%rip), %rsi     # 0x245609
leaq 0x29ce3(%rip), %rcx     # 0x24a60e
movl $0x37b8, %edx           # imm = 0x37B8
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: reset_scaf_node_uinfo_srt_t(usc_t*, long, long, long*)
uint64_t reset_scaf_node_uinfo_srt_t(usc_t *z, int64_t min_arc_len, int64_t scaf_len, int64_t *nlen)
{
    (*nlen) = scaf_len + (min_arc_len<<1);
    if(z->ulid == ((uint32_t)-1)) return 0;///a scaffold node
    if(z->raw_eof + min_arc_len <= z->raw_sof) {///has an overlap longer than min_arc_len; 
        return 1;///a scaffold node; no need this node, could directly use existing nodes
    }
    int64_t s, e;
    s = z->raw_sof; e = z->raw_eof; 
    (*nlen) = (min_arc_len<<1) + (e - s);  ///(e - s)>=(-min_arc_len)
    return 2;
}

// Assembly:
leaq (%rdx,%rsi,2), %rax
movq %rax, (%rcx)
cmpl $-0x1, 0x4(%rdi)
je 0x22126b
movl 0x10(%rdi), %edx
movl 0x14(%rdi), %edi
leaq (%rdi,%rsi), %r8
movl $0x1, %eax
cmpq %rdx, %r8
jle 0x22126a
addq %rsi, %rsi
addq %rdi, %rsi
subq %rdx, %rsi
movq %rsi, (%rcx)
movl $0x2, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x73a5e(%rip), %rax     # 0x295758
movq 0x10(%rax), %r13
movq %r13, %rdi
callq 0x2090
leaq 0x32(%rax), %rdi
callq 0x2280
movq %rax, %r15
leaq 0x172f9(%rip), %rsi     # 0x239012
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
callq 0x1e7efd
leaq 0x744f8(%rip), %rdx     # 0x296230
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x1e67fb
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1e0ae1
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq %rsi, %r14
movq %rdi, %r15
leaq 0x74594(%rip), %r12     # 0x296318
movq %r12, %rdi
movq %rdx, %rsi
movq %r8, %rcx
callq 0x221ce1
leaq 0x8(%rsp), %rdx
movq %r15, (%rdx)
movq %r14, 0x8(%rdx)
movq %r13, 0x10(%rdx)
leaq 0x739af(%rip), %r13     # 0x295758
movl 0x7c(%r13), %edi
leaq 0x73(%rip), %rsi        # 0x221e27
movq %r14, %rcx
callq 0x108f2c
testq %r14, %r14
je 0x221e19
movq 0x48(%r12), %rax
addq $0x14, %r15
xorl %ecx, %ecx
movl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl -0x10(%r15), %edi
cmpq %rsi, %rdi
je 0x221df5
movl (%r15), %r8d
cmpl -0x4(%r15), %r8d
jbe 0x221df5
shrl %edi
imulq $0x58, %rdi, %rdi
movb $0x4, 0x50(%rax,%rdi)
incl %ecx
movl %edx, %edi
addq $0x18, %r15
incl %edx
cmpq %r14, %rdi
jb 0x221dd6
testl %ecx, %ecx
je 0x221e19
movq 0x10(%r13), %rsi
leaq 0x74507(%rip), %rdi     # 0x296318
movq %rbx, %rdx
callq 0x220ed5
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %rdi
shrq %rdi
movq %rdx, %r12
shrq %r12
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl (%r8,%r12,8), %eax
movl (%r8,%rdi,8), %r8d
movq %rdi, %r10
shlq $0x20, %r10
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq %r10, %r9
subq %rcx, %r9
addq %r8, %r9
testb $0x1, %sil
cmovneq %r10, %r9
cmovnel %ecx, %r8d
leaq (%rdi,%rdi,2), %rdi
leaq 0x30(%rsp), %r14
movq %r9, (%r14)
movl %r8d, 0x8(%r14)
movl %eax, %r8d
subl %ecx, %r8d
xorl %r9d, %r9d
testb $0x1, %dl
cmovnel %r8d, %r9d
cmovel %ecx, %eax
movl %r12d, 0xc(%r14)
movl %r9d, 0x10(%r14)
movl %eax, 0x14(%r14)
xorl %esi, %edx
shll $0x1f, %edx
movw $0x0, 0x20(%r14)
movq %rdx, 0x18(%r14)
leaq (%rbx,%rdi,8), %rdi
movq %r14, %rsi
callq 0xa058c
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa0cca
leaq (%r12,%r12,2), %rax
leaq (%rbx,%rax,8), %rdi
movq %r15, %rsi
callq 0xa058c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %r15
callq 0x224e6d
movq %rax, %rbx
movq (%r15), %rax
movq 0x20(%r15), %rdi
movq (%rax), %rdx
movq 0x8(%rax), %r8
movq 0x30(%rax), %r9
movl 0x40(%rax), %r10d
movl 0x44(%rax), %eax
subq $0x8, %rsp
xorl %r11d, %r11d
movq %rbx, %rsi
movq %r14, %rcx
pushq %r11
pushq %r11
pushq %r11
pushq %rax
pushq %r10
callq 0xa5f3
addq $0x30, %rsp
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xa0761
// File: /workspace/github_cpp_makefile_star2_O3/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
movq 0x8(%rdi), %rax
xorl %r13d, %r13d
movl %eax, %ebp
addl %eax, %ebp
je 0x225701
xorl %r15d, %r15d
movq (%rbx), %rax
movl %r13d, %ecx
shrl %ecx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
cmpl $0x0, 0x18(%rax,%rdx)
js 0x2256ef
movq (%r14), %rax
imulq $0x78, %rcx, %rdx
cmpb $0x0, 0x70(%rax,%rdx)
jne 0x2256ef
addq %rax, %rdx
movl %r13d, %ecx
andl $0x1, %ecx
leaq (%rcx,%rcx,2), %rsi
movl 0x10(%rdx,%rsi,8), %ecx
testq %rcx, %rcx
je 0x2256c9
movq 0x20(%rdx,%rsi,8), %rdx
addq $0xc, %rdx
xorl %esi, %esi
movl $0x1, %edi
cmpl $0x0, (%rdx)
js 0x22565f
movl -0x4(%rdx), %r12d
xorl $0x1, %r12d
incl %esi
cmpq %rcx, %rdi
jae 0x225670
addq $0x20, %rdx
incq %rdi
cmpl $0x2, %esi
jb 0x225650
cmpl $0x1, %esi
jne 0x2256c9
movl %r12d, %ecx
shrl %ecx
movl %r12d, %edx
andl $0x1, %edx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
leaq (%rdx,%rdx,2), %rdx
movl 0x10(%rax,%rdx,8), %ecx
testq %rcx, %rcx
je 0x2256c9
movq 0x20(%rax,%rdx,8), %rax
addq $0xc, %rax
xorl %edx, %edx
movl $0x1, %esi
cmpl $0x0, (%rax)
js 0x2256b3
movl -0x4(%rax), %r12d
xorl $0x1, %r12d
incl %edx
cmpq %rcx, %rsi
jae 0x2256c4
addq $0x20, %rax
incq %rsi
cmpl $0x2, %edx
jb 0x2256a4
cmpl $0x1, %edx
je 0x2256ef
movl %r13d, %edx
xorl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x4(%rsp), %rcx
callq 0x22526e
cmpq %r15, %rax
cmovbeq %r15, %rax
cmpl $0x0, 0x4(%rsp)
cmovneq %rax, %r15
incl %r13d
cmpl %ebp, %r13d
jne 0x2255f6
movq 0x8(%r14), %rax
jmp 0x225704
xorl %r15d, %r15d
testq %rax, %rax
je 0x225730
movl $0x1, %eax
xorl %ecx, %ecx
movq (%rbx), %rdx
leaq (%rcx,%rcx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rcx, %rsi
andl $0x7fffffff, 0x18(%rdx,%rsi) # imm = 0x7FFFFFFF
movl %eax, %ecx
incl %eax
cmpq %rcx, 0x8(%r14)
ja 0x225710
xorl %eax, %eax
movq %rax, 0x38(%rbx)
movq %rax, 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_O3/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
movq %rdx, %r14
movl %esi, %eax
shrl %eax
movl %esi, %ecx
imulq $0x78, %rax, %rax
addq (%rdi), %rax
andl $0x1, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%rcx,8), %rdx
testl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
je 0x225d52
movl %esi, %r15d
movq 0x20(%rax,%rcx,8), %r12
movl %edx, %r13d
leaq 0x10(%r12), %rdx
xorl %eax, %eax
movq %r13, %rsi
xorl %ecx, %ecx
xorl %edi, %edi
cmpl $0x0, -0x4(%rdx)
js 0x225c78
incl %edi
movl (%rdx), %r8d
cmpq $0x2, %r8
jae 0x225c6e
xorl $0x1, %r8d
addq %r8, %rax
jmp 0x225c78
shrl %r8d
cmpq %r8, %rcx
cmovbeq %r8, %rcx
addq $0x20, %rdx
decq %rsi
jne 0x225c54
cmpl $0x2, %edi
jb 0x225d52
testq %rax, %rax
je 0x225d52
testq %rcx, %rcx
je 0x225d52
shlq $0x20, %r15
addq $0x10, %r12
movslq -0x4(%r12), %rbp
testq %rbp, %rbp
js 0x225d42
cmpl $0x0, (%r12)
jne 0x225d42
movq (%r14), %rcx
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rcx
jne 0x225cf1
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r14)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r14)
movq (%r14), %rcx
shlq $0x20, %rbp
orq (%rbx), %rbp
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
movq %rbp, (%rax,%rcx,8)
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rcx
jne 0x225d37
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r15, (%rax,%rcx,8)
addq $0x20, %r12
incq %r15
decq %r13
jne 0x225ca4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movq %rdi, %r15
movq %rsi, 0x10(%rsp)
movq %rsi, %rdi
callq 0x21a43d
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq (%rax), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x226c7e
movq 0x10(%r14), %rbx
movq %r14, 0x8(%rsp)
movq 0x18(%r14), %r12
movl $0x1, %r14d
xorl %ebp, %ebp
movq 0x20(%r12), %rax
movb $0x0, 0x4(%rax,%rbp,8)
leaq (,%rbp,4), %rax
addq %rbp, %rax
cmpl $0x0, 0xc(%rbx,%rax,8)
je 0x226c65
leaq (%rbx,%rax,8), %r13
movq 0x18(%r15), %rsi
movq 0x20(%r15), %rdx
movq %r13, %rdi
movq 0x10(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x21ecc9
movl (%r13), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rbp,8), %edx
movl $0x80000000, %esi       # imm = 0x80000000
andl %esi, %edx
orl %eax, %edx
movl %edx, (%rcx,%rbp,8)
movl %r14d, %ebp
incl %r14d
cmpq %rbp, 0x18(%rsp)
ja 0x226c0c
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %r14
jmp 0x226c80
xorl %edi, %edi
callq 0x2220
movq %r14, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x260(%rdi)
je 0x227912
movq 0x230(%rbx), %rax
cmpq $0x0, (%rax)
je 0x227912
movl $0x1, %ebp
xorl %eax, %eax
movq 0x260(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq 0x10(%rcx,%rax,8), %rdi
callq 0x2220
movl %ebp, %eax
movq 0x230(%rbx), %rcx
incl %ebp
cmpq %rax, (%rcx)
ja 0x2278ed
leaq 0x230(%rbx), %rdi
movq 0x228(%rbx), %rsi
xorl %edx, %edx
callq 0xbb7a4
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
movl $0x1, %esi
callq 0x2120
movq %rax, 0x30(%r14)
movq (%rbx), %rax
movq 0x70(%rax), %rsi
movq %rbx, %rdi
callq 0x228c08
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x229159
// File: /workspace/github_cpp_makefile_star2_O3/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
leaq (%rcx,%rcx,4), %r8
movq 0x18(%rax,%r8,8), %rcx
testb $0x1, %sil
jne 0x228545
leaq (%rax,%r8,8), %rsi
movl 0x10(%rsi), %esi
decl %esi
jmp 0x228547
xorl %esi, %esi
movq (%rcx,%rsi,8), %r8
shrq $0x21, %r8
movq %rdx, %rcx
shrq %rcx
leaq (%rcx,%rcx,4), %rcx
testb $0x1, %dl
jne 0x228562
xorl %esi, %esi
jmp 0x22856b
leaq (%rax,%rcx,8), %rdx
movl 0x10(%rdx), %esi
decl %esi
movq 0x220(%rdi), %rdx
movl (%rdx,%r8,4), %r8d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %r8
je 0x2285b5
movq 0x1f0(%rdi), %rdi
shlq $0x5, %r8
movl 0x1c(%rdi,%r8), %edx
testq %rdx, %rdx
je 0x2285b5
movq 0x18(%rax,%rcx,8), %rax
movq (%rax,%rsi,8), %rcx
shrq $0x21, %rcx
addq %r8, %rdi
movq (%rdi), %rax
cmpl %ecx, (%rax)
je 0x2285b7
addq $0x28, %rax
decq %rdx
jne 0x2285a8
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movl 0x18(%rdi), %r15d
andq $0x7fffffff, %r15       # imm = 0x7FFFFFFF
je 0x22a250
movq %rdx, %rbx
movq 0x30(%rsi), %r12
movq 0x10(%rdi), %r13
xorl %r14d, %r14d
xorl %ebp, %ebp
movq (%r13,%rbp,8), %rdx
movq %rdx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,8), %rcx
movl (%r12,%rcx,4), %eax
movl 0x20(%r12,%rcx,4), %esi
shrl $0x5, %esi
andl $0x1, %esi
leal (%rsi,%rax,2), %esi
cmpl %edx, %esi
jne 0x22a265
leaq (%r12,%rcx,4), %rcx
movl 0xc(%rcx), %edi
movl 0x10(%rcx), %esi
leaq (%rax,%rax,4), %rdx
shlq $0x3, %rdx
addq 0x10(%rbx), %rdx
callq 0x1fe266
addq %rax, %r14
incq %rbp
cmpq %rbp, %r15
jne 0x22a202
jmp 0x22a253
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ff5b(%rip), %rdi     # 0x24a1c7
leaq 0x1b396(%rip), %rsi     # 0x245609
leaq 0x1ff79(%rip), %rcx     # 0x24a1f3
movl $0x41f3, %edx           # imm = 0x41F3
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x1, %edi
movl $0x20, %esi
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 0xa0485
movq 0x1e8(%rbx), %rcx
movq %rax, (%rcx)
cmpq $0x0, 0x18(%rcx)
je 0x22a389
movl $0x10, %r13d
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rcx), %r12
movq 0x8(%rcx), %rax
cmpq %rax, %r15
jae 0x22a344
movq 0x1d0(%rbx), %rdi
addq %rbp, %rdi
movq 0x30(%rbx), %rax
movq 0x48(%rax), %rsi
addq %r14, %rsi
movq (%rsp), %rdx
callq 0x22a1da
movq 0x1d0(%rbx), %rdx
xorl %ecx, %ecx
testl $0x7ffffffe, 0x18(%rdx,%rbp) # imm = 0x7FFFFFFE
sete %cl
movq %r12, %rdi
movl %r15d, %esi
movl %eax, %edx
jmp 0x22a364
movq (%rsp), %rcx
movq 0x10(%rcx), %rcx
shlq $0x3, %rax
leaq (%rax,%rax,4), %rax
subq %rax, %rcx
movl (%r13,%rcx), %edx
movq %r12, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0xa0887
incq %r15
movq 0x1e8(%rbx), %rcx
addq $0x58, %r14
addq $0x20, %rbp
addq $0x28, %r13
cmpq 0x18(%rcx), %r15
jb 0x22a2fc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, (%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %ecx, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
movq %rax, 0x28(%rsp)
movw $0x0, 0x30(%rsp)
testq %rdx, %rdx
je 0x22a952
movq %rdx, %rbx
movq %rsi, %r14
xorl %eax, %eax
leaq 0x10(%rsp), %r12
movq %rax, 0x8(%rsp)
movq (%r14,%rax,8), %r15
movl %r15d, %eax
shlq $0x20, %r15
leaq (%rax,%rax,2), %rax
movq (%rsp), %rcx
leaq (%rcx,%rax,8), %r13
xorl %ebp, %ebp
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 0xa058c
incq %rbp
cmpq %rbp, %rbx
jne 0x22a91e
movq 0x8(%rsp), %rax
incq %rax
cmpq %rbx, %rax
jne 0x22a900
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
je 0x22ab07
movl $0x1, %ebp
xorl %eax, %eax
movq 0x28(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rdi
callq 0x2220
movl %ebp, %eax
incl %ebp
cmpq %rax, 0x18(%rbx)
ja 0x22aaec
movq 0x28(%rbx), %rdi
callq 0x2220
cmpq $0x0, 0x8(%rbx)
je 0x22ab60
movl $0x1, %ebp
xorl %eax, %eax
movq (%rbx), %rcx
imulq $0x78, %rax, %r14
movq 0x20(%rcx,%r14), %rdi
callq 0x2220
movq (%rbx), %rax
movq 0x38(%rax,%r14), %rdi
callq 0x2220
movq (%rbx), %rax
movq 0x50(%rax,%r14), %rdi
callq 0x2220
movq (%rbx), %rax
movq 0x68(%rax,%r14), %rdi
callq 0x2220
movl %ebp, %eax
incl %ebp
cmpq %rax, 0x8(%rbx)
ja 0x22ab1e
movq (%rbx), %rdi
callq 0x2220
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0xa0761
cmpq $0x0, 0x1e0(%rbx)
je 0x22abb4
movl $0x1, %ebp
xorl %eax, %eax
imulq $0x328, %rax, %rdi      # imm = 0x328
addq 0x1d8(%rbx), %rdi
callq 0x22a961
movl %ebp, %eax
incl %ebp
cmpq %rax, 0x1e0(%rbx)
ja 0x22ab94
movq 0x1d8(%rbx), %rdi
callq 0x2220
cmpq $0x0, 0x1c0(%rbx)
je 0x22abf3
movl $0x1, %ebp
xorl %eax, %eax
movq 0x1d0(%rbx), %rcx
shlq $0x5, %rax
movq 0x10(%rcx,%rax), %rdi
callq 0x2220
movl %ebp, %eax
incl %ebp
cmpq %rax, 0x1c0(%rbx)
ja 0x22abd1
movq 0x1d0(%rbx), %rdi
callq 0x2220
movq 0x1b8(%rbx), %rdi
callq 0x2220
movq 0x1a0(%rbx), %rdi
callq 0x2220
movq 0x2a8(%rbx), %rdi
callq 0x2220
cmpq $0x0, 0x1f8(%rbx)
je 0x22ac55
movl $0x1, %ebp
xorl %eax, %eax
movq 0x1f0(%rbx), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rdi
callq 0x2220
movl %ebp, %eax
incl %ebp
cmpq %rax, 0x1f8(%rbx)
ja 0x22ac34
movq 0x1f0(%rbx), %rdi
callq 0x2220
movq 0x220(%rbx), %rdi
callq 0x2220
movq 0x228(%rbx), %rdi
callq 0xa0494
movq 0x248(%rbx), %rdi
callq 0x2220
movq 0x250(%rbx), %rdi
callq 0x2220
movq 0x258(%rbx), %rdi
callq 0x2220
movq 0x260(%rbx), %rdi
testq %rdi, %rdi
je 0x22aceb
movq 0x230(%rbx), %rax
cmpq $0x0, (%rax)
je 0x22aced
movl $0x1, %ebp
xorl %eax, %eax
movq 0x260(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movq 0x10(%rcx,%rax,8), %rdi
callq 0x2220
movl %ebp, %eax
movq 0x230(%rbx), %rcx
incl %ebp
cmpq %rax, (%rcx)
ja 0x22acbd
movq 0x260(%rbx), %rdi
jmp 0x22aced
xorl %edi, %edi
callq 0x2220
movq 0x268(%rbx), %rdi
callq 0x2220
movq 0x270(%rbx), %rdi
callq 0x2220
movq 0x278(%rbx), %rdi
callq 0xa0494
movq 0x280(%rbx), %rdi
callq 0x2220
movq 0x288(%rbx), %rdi
callq 0x2220
movq 0x230(%rbx), %rdi
callq 0xa0761
movq 0x240(%rbx), %rdi
callq 0x22aad7
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6a9c9(%rip), %r12     # 0x295758
movl 0x7c(%r12), %edi
leaq 0x74(%rip), %rbx        # 0x22ae0f
movq %rbx, %rsi
movq %r13, %rdx
callq 0x108f2c
movl 0x7c(%r12), %edi
movq %rbx, %rsi
movq (%rsp), %rdx
movq %r15, %rcx
callq 0x108f2c
movq $0x0, (%rbp)
movq %r14, 0x10(%rbp)
movl 0x7c(%r12), %edi
leaq 0x74(%rip), %rsi        # 0x22ae46
movq %rbp, %rdx
movq %r15, %rcx
callq 0x108f2c
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movl 0x80(%rsp), %r8d
movl 0x88(%rsp), %r9d
callq 0xa2432
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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)
movl $0x1, %edi
movl $0xc8, %esi
callq 0x2120
movq %rax, %r15
movq %rbx, %rdi
callq 0xb10cd
movq %rax, %r14
movq 0x18(%rax), %rax
movl 0x14(%rax), %r12d
testl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
je 0x22b0bc
movq 0x20(%rax), %rcx
xorl %edx, %edx
cmpl $0x0, (%rcx,%rdx,8)
js 0x22b0a0
movb $0x0, 0x4(%rcx,%rdx,8)
movl 0x14(%rax), %r12d
incq %rdx
movl %r12d, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmpq %rsi, %rdx
jb 0x22b091
addl %esi, %esi
movslq %esi, %rdi
shlq $0x2, %rdi
jmp 0x22b0be
xorl %edi, %edi
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)
movl $0x1c, %esi
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 0x22b18e
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb0fb2
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_O3/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
testl %edx, %edx
setle %al
cmpl $-0x1, %esi
sete %cl
xorl %r14d, %r14d
orb %al, %cl
jne 0x22b81a
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r15
movq 0x18(%rdi), %r13
xorl %r14d, %r14d
movl %r12d, %esi
xorl $0x1, %esi
movq %r13, %rdi
callq 0x22b6f7
cmpl $-0x1, %eax
je 0x22b81a
testq %rbx, %rbx
je 0x22b7ec
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rcx
jne 0x22b7de
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
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
leaq (%rcx,%rcx,4), %rcx
addl 0x10(%rax,%rcx,8), %r14d
movq %r13, %rdi
movl %r12d, %esi
callq 0x22b6f7
cmpl $-0x1, %eax
je 0x22b81a
movl %eax, %r12d
cmpl %ebp, %r14d
jl 0x22b78e
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_O3/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 %rbx
movq 0x18(%rdi), %rcx
movq 0x28(%rcx), %rdx
xorl %eax, %eax
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl %esi, %r8d
movl %r8d, %r10d
movq (%rdx,%r10,8), %r11
movq %r11, %rbx
andq %r9, %rbx
je 0x22b917
movq 0x8(%rcx), %r10
shrq $0x20, %r11
leaq (%r11,%r11,2), %r11
leaq (%r10,%r11,8), %r11
addq $0xc, %r11
shlq $0x3, %rbx
leaq (%rbx,%rbx,2), %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movl (%r11,%r14), %r15d
notl %r15d
shrl $0x1f, %r15d
addl %r15d, %ebp
addq $0x18, %r14
cmpq %r14, %rbx
jne 0x22b879
movq 0x10(%rdi), %r14
movl %r8d, %r15d
shrl %r15d
leaq (%r15,%r15,4), %r15
addl 0x10(%r14,%r15,8), %eax
cmpl $0x1, %ebp
jne 0x22b926
xorl %r14d, %r14d
cmpl $0x0, (%r11,%r14)
js 0x22b8b7
movl -0x4(%r11,%r14), %r8d
addq $0x18, %r14
cmpq %r14, %rbx
jne 0x22b8ab
movl %r8d, %r11d
xorl $0x1, %r11d
movq (%rdx,%r11,8), %rbx
movq %rbx, %r11
andq %r9, %r11
je 0x22b926
shrq $0x20, %rbx
leaq (%rbx,%rbx,2), %rbx
leaq (%r10,%rbx,8), %r10
addq $0xc, %r10
shlq $0x3, %r11
leaq (%r11,%r11,2), %rbx
xorl %r14d, %r14d
xorl %r11d, %r11d
movl (%r10,%r14), %ebp
notl %ebp
shrl $0x1f, %ebp
addl %ebp, %r11d
addq $0x18, %r14
cmpq %r14, %rbx
jne 0x22b8f1
cmpl %esi, %r8d
je 0x22b926
cmpl $0x1, %r11d
je 0x22b845
jmp 0x22b926
movq 0x10(%rdi), %rcx
shrl %r8d
leaq (%r8,%r8,4), %rdx
addl 0x10(%rcx,%rdx,8), %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq