LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: write_hc_hits_v14(kvec_pe_hit_hap*, char const*)
void write_hc_hits_v14(kvec_pe_hit_hap* i_hits, const char *fn)
{
    char *buf = (char*)calloc(strlen(fn) + 25, 1);
	sprintf(buf, "%s.v14.hic.lk.bin", fn);
    FILE* fp = fopen(buf, "w");
    kvec_pe_hit hits; 
    kv_init(hits.a);
    uint64_t i, m_u = (uint64_t)-1, m_m = (uint64_t)-1;
    pe_hit* p = NULL;
    for (i = 0; i < i_hits->n; i++)
    {
        if(i_hits->a[i].occ1 == 1 && i_hits->a[i].occ2 == 1) 
        {
            kv_pushp(pe_hit, hits.a, &p);
            p->id = i_hits->a[i].id;
            p->s = i_hits->a[i].a[0];
            p->e = i_hits->a[i].a[1];
            m_u = i;
        }
        else
        {
            if(m_m == (uint64_t)-1) m_m = i;
        }
    }
    fprintf(stderr, "m_u: %lu, m_m: %lu, n_u: %lu\n", m_u, m_m, i_hits->n_u);

    fwrite(&hits.a.n, sizeof(hits.a.n), 1, fp);
    fwrite(hits.a.a, sizeof(pe_hit), hits.a.n, fp);

    kv_destroy(hits.a);
    fclose(fp);
    free(buf);
    exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2090
leaq 0x19(%rax), %rdi
movl $0x1, %esi
callq 0x2120
movq %rax, %rbx
leaq 0xef012(%rip), %rsi     # 0x22f5f1
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xfbe0b(%rip), %rsi     # 0x23c3fe
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0x2210
movq %rax, (%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
cmpq $0x0, 0x8(%r15)
jne 0x140635
movq $-0x1, %rdx
xorl %eax, %eax
xorl %ebx, %ebx
movq $-0x1, %r13
xorl %edi, %edi
jmp 0x1406ce
movq $-0x1, %r13
xorl %ebp, %ebp
movq $-0x1, %rdx
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %eax, %eax
xorl %edi, %edi
movq (%r15), %rcx
cmpw $0x1, 0x10(%rcx,%rbp)
jne 0x1406b9
cmpw $0x1, 0x12(%rcx,%rbp)
jne 0x1406b9
cmpq %rax, %rbx
jne 0x140688
leaq (%rax,%rax), %r12
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r12
movq %r12, %rsi
shlq $0x5, %rsi
callq 0x2370
movq %rax, %rdi
movq %r12, %rax
leaq 0x1(%rbx), %rcx
shlq $0x5, %rbx
movq (%r15), %rdx
movq 0x8(%rdx,%rbp), %rsi
movq %rsi, 0x10(%rdi,%rbx)
movq (%rdx,%rbp), %rdx
movq (%rdx), %rsi
movq %rsi, (%rdi,%rbx)
movq 0x8(%rdx), %rdx
movq %rdx, 0x8(%rdi,%rbx)
movq %rcx, %rbx
movq %r14, %rdx
jmp 0x1406c1
cmpq $-0x1, %r13
cmoveq %r14, %r13
incq %r14
addq $0x18, %rbp
cmpq 0x8(%r15), %r14
jb 0x14064e
leaq 0x10(%rsp), %rbp
movq %rbx, (%rbp)
movq %rax, 0x8(%rbp)
movq %rdi, 0x10(%rbp)
movq 0x1498fa(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
movq 0x18(%r15), %r8
leaq 0xeef0f(%rip), %rsi     # 0x22f603
movq %r13, %rcx
xorl %eax, %eax
callq 0x22b0
movl $0x8, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq (%rsp), %rbx
movq %rbx, %rcx
callq 0x2410
movq (%rbp), %rdx
movq 0x10(%rbp), %r15
movl $0x20, %esi
movq %r15, %rdi
movq %rbx, %rcx
callq 0x2410
movq %r15, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x2190
movq 0x8(%rsp), %rdi
callq 0x2220
movl $0x1, %edi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: load_hc_hits(kvec_pe_hit*, ma_ug_t*, char const*)
int load_hc_hits(kvec_pe_hit* hits, ma_ug_t* ug, const char *fn)
{
    uint64_t flag = 0;
    char *buf = (char*)calloc(strlen(fn) + 25, 1);
    sprintf(buf, "%s.hic.lk.bin", fn);

    FILE* fp = NULL; 
    fp = fopen(buf, "r"); 
    if(!fp) 
    {
        free(buf);
        return 0;
    }
    

    kv_init(hits->a);
    flag += fread(&hits->a.n, sizeof(hits->a.n), 1, fp);
    hits->a.m = hits->a.n; MALLOC(hits->a.a, hits->a.n);
    flag += fread(hits->a.a, sizeof(pe_hit), hits->a.n, fp);
    free(buf);

    if(!test_dbug(ug, fp))
    {
        free(hits->a.a);
        kv_init(hits->a);
        fclose(fp);
        fprintf(stderr, "[M::%s::] ==> Renew Hi-C linkages\n", __func__);
        return 0;
    }

    fclose(fp);
    fprintf(stderr, "[M::%s::] ==> Hi-C linkages have been loaded\n", __func__);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x2090
leaq 0x19(%rax), %rdi
movl $0x1, %esi
callq 0x2120
movq %rax, %r15
leaq 0xee534(%rip), %rsi     # 0x22f5e3
xorl %ebp, %ebp
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xf24e2(%rip), %rsi     # 0x2335a7
movq %r15, %rdi
callq 0x2210
testq %rax, %rax
jne 0x1410eb
movq %r15, %rdi
callq 0x2220
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %rax, %rcx
callq 0x22f0
movq (%rbx), %r13
movq %r13, 0x8(%rbx)
movq %r13, %rdi
shlq $0x5, %rdi
callq 0x2280
movq %rax, 0x10(%rbx)
movl $0x20, %esi
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x22f0
movq %r15, %rdi
callq 0x2220
movq %r14, %rdi
movq %r12, %rsi
callq 0xc270e
testl %eax, %eax
jne 0x141168
leaq 0x10(%rbx), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1cd0e
xorl %ebp, %ebp
jmp 0x1410da
movq %r12, %rdi
callq 0x1cce8
movl $0x1, %ebp
jmp 0x1410da
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: normalize_hc_links(hc_links*)
void normalize_hc_links(hc_links* link)
{
    uint64_t i, k;
    for (i = 0; i < link->a.n; ++i) 
    { 
        for (k = 0; k < link->a.a[i].e.n; k++)
        {
            if(link->a.a[i].e.a[k].del) continue;
            link->a.a[i].e.a[k].weight *= 100;
            link->a.a[i].e.a[k].weight /= (double)(MIN(link->enzymes.a[i], link->enzymes.a[link->a.a[i].e.a[k].uID])); 
            ///link->a.a[i].e.a[k].weight /= (double)(link->enzymes.a[i] + link->enzymes.a[link->a.a[i].e.a[k].uID]); 
        }
    }
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x14147e
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rcx
xorl %edx, %edx
movsd 0xec0cb(%rip), %xmm0    # 0x22d4a0
movq 0xe3e63(%rip), %xmm1    # 0x225240
movapd 0xe3e6b(%rip), %xmm2    # 0x225250
leaq (%rdx,%rdx,2), %r9
shlq $0x4, %r9
movq (%rcx,%r9), %rsi
testq %rsi, %rsi
je 0x14146d
leaq (%rcx,%r9), %r8
movq 0x10(%r8), %r8
addq %rcx, %r9
addq $0x10, %r9
xorl %r10d, %r10d
cmpb $0x0, 0x18(%r8,%r10)
js 0x141464
movsd (%r8,%r10), %xmm3
mulsd %xmm0, %xmm3
movsd %xmm3, (%r8,%r10)
movq 0x28(%rdi), %r11
movq (%r11,%rdx,8), %rbx
movq (%r9), %r14
movl 0x8(%r14,%r10), %r15d
movq (%r11,%r15,8), %r11
cmpq %r11, %rbx
cmovbq %rbx, %r11
movq %r11, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
movsd (%r14,%r10), %xmm3
divsd %xmm4, %xmm3
movsd %xmm3, (%r14,%r10)
addq $0x28, %r10
decq %rsi
jne 0x141408
incq %rdx
cmpq %rax, %rdx
jne 0x1413e5
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_rGraph_edge(min_cut_t*, unsigned long, unsigned long)
hc_edge* get_rGraph_edge(min_cut_t* x, uint64_t src, uint64_t dest)
{
    if(src >= x->rGraph.n) return NULL;
    uint64_t i;
    for (i = 0; i < x->rGraph.a[src].n; i++)
    {
        if(x->rGraph.a[src].a[i].del) continue;
        if(x->rGraph.a[src].a[i].uID == dest) return &(x->rGraph.a[src].a[i]);
    }
    return NULL;
}

// Assembly:
cmpq %rsi, (%rdi)
jbe 0x1414b4
movq 0x10(%rdi), %rax
leaq (%rsi,%rsi,2), %rsi
movq (%rax,%rsi,8), %rcx
testq %rcx, %rcx
je 0x1414b4
leaq (%rax,%rsi,8), %rax
movq 0x10(%rax), %rax
cmpb $0x0, 0x18(%rax)
js 0x1414ab
movl 0x8(%rax), %esi
cmpq %rdx, %rsi
je 0x1414b6
addq $0x28, %rax
decq %rcx
jne 0x14149d
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: destory_min_cut_t(min_cut_t*)
void destory_min_cut_t(min_cut_t* x)
{
    kv_destroy(x->order);
    kv_destroy(x->parent);
    kv_destroy(x->p_weight);
    kv_destroy(x->rGraphSet);
    kv_destroy(x->rGraphVis);
    kv_destroy(x->utgVis);
    kv_destroy(x->bmerVis);
    destory_pdq(&(x->pq));
    uint64_t i;
    for (i = 0; i < x->rGraph.m; i++)
    {
        kv_destroy(x->rGraph.a[i]);
    }
    kv_destroy(x->rGraph);
    kdq_destroy(uint64_t, x->q);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x2220
movq 0x110(%rbx), %rdi
callq 0x2220
movq 0x128(%rbx), %rdi
callq 0x2220
movq 0xa8(%rbx), %rdi
callq 0x2220
movq 0xc0(%rbx), %rdi
callq 0x2220
movq 0xd8(%rbx), %rdi
callq 0x2220
movq 0xf0(%rbx), %rdi
callq 0x2220
leaq 0x30(%rbx), %rdi
callq 0x13bc20
cmpq $0x0, 0x8(%rbx)
je 0x141992
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x2220
incq %r15
addq $0x18, %r14
cmpq 0x8(%rbx), %r15
jb 0x141978
movq 0x10(%rbx), %rdi
callq 0x2220
movq 0xf8(%rbx), %rbx
testq %rbx, %rbx
je 0x1419bd
movq 0x18(%rbx), %rdi
callq 0x2220
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: reset_min_cut_t(min_cut_t*, hc_links*)
void reset_min_cut_t(min_cut_t* x, hc_links* link)
{
    ///no need to reset parent[] and q
    uint64_t i, j;
    ///important to have this line
    x->bmerVis.n = x->parent.n = x->p_weight.n = x->order.n = x->rGraph.n = x->rGraphVis.n = x->rGraphSet.n = link->a.n;
    kdq_clear(x->q);

    for (i = 0; i < x->rGraphSet.n; i++)
    {
        x->rGraphVis.a[i] = 0;
        ///x->bmerVis.a[i] = 0;
        ///important to have this line
        x->rGraph.a[i].n = link->a.a[i].e.n;

        if(x->rGraphSet.a[i] == 0) continue;
        for (j = 0; j < x->rGraph.a[i].n; j++)
        {
            x->rGraph.a[i].a[j].weight = link->a.a[i].e.a[j].weight;
        }
        x->rGraphSet.a[i] = 0;
    }
}

// Assembly:
movq (%rsi), %rax
movq %rax, 0x98(%rdi)
movq %rax, 0xb0(%rdi)
movq %rax, (%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x118(%rdi)
movq %rax, 0x100(%rdi)
movq %rax, 0xe0(%rdi)
movq 0xf8(%rdi), %rax
movabsq $-0x400000000000000, %rcx # imm = 0xFC00000000000000
andq %rcx, (%rax)
movq 0xf8(%rdi), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, 0x98(%rdi)
je 0x141a8c
xorl %eax, %eax
movq 0xc0(%rdi), %rcx
movb $0x0, (%rcx,%rax)
movq 0x10(%rsi), %r8
leaq (%rax,%rax,2), %r9
movq %r9, %r10
shlq $0x4, %r10
movq (%r8,%r10), %rcx
movq 0x10(%rdi), %r11
movq %rcx, (%r11,%r9,8)
movq 0xa8(%rdi), %rdx
cmpb $0x0, (%rdx,%rax)
je 0x141a80
testq %rcx, %rcx
je 0x141a7c
leaq (%r11,%r9,8), %r9
movq 0x10(%r8,%r10), %r8
movq 0x10(%r9), %r9
xorl %r10d, %r10d
movsd (%r8,%r10), %xmm0
movsd %xmm0, (%r9,%r10)
addq $0x28, %r10
decq %rcx
jne 0x141a67
movb $0x0, (%rdx,%rax)
incq %rax
cmpq 0x98(%rdi), %rax
jb 0x141a1f
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: update_link_by_min_cut_t(min_cut_t*, hc_links*)
void update_link_by_min_cut_t(min_cut_t* x, hc_links* link)
{
    uint64_t i, j;

    for (i = 0; i < link->a.n; i++)
    {
        for (j = 0; j < link->a.a[i].e.n; j++)
        {
            link->a.a[i].e.a[j].del = x->rGraph.a[i].a[j].del;
        }
    }
}

// Assembly:
cmpq $0x0, (%rsi)
je 0x141afd
pushq %rbx
xorl %eax, %eax
movq 0x10(%rsi), %r8
leaq (%rax,%rax,2), %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
cmpq $0x0, (%r8,%rdx)
je 0x141af4
movl $0x18, %edx
movq %rax, %r9
shlq $0x4, %r9
leaq (%r9,%r9,2), %r9
xorl %r10d, %r10d
movq 0x10(%rdi), %r11
movq 0x10(%r11,%rcx,8), %r11
movb (%r11,%rdx), %r11b
andb $-0x80, %r11b
movq 0x10(%r8,%r9), %r8
movb (%r8,%rdx), %bl
andb $0x7f, %bl
orb %r11b, %bl
movb %bl, (%r8,%rdx)
incq %r10
movq 0x10(%rsi), %r8
addq $0x28, %rdx
cmpq (%r8,%r9), %r10
jb 0x141abf
incq %rax
cmpq (%rsi), %rax
jb 0x141a96
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: maxFlow(unsigned long, unsigned long, min_cut_t*)
uint64_t maxFlow(uint64_t src, uint64_t dest, min_cut_t* x)
{
    double flow = 0, max_flow = 0;
    uint64_t v, u;
    hc_edge *p;

    while (bfs_flow(src, dest, x, NULL))
    {
        kdq_clear(x->q);
        flow = DBL_MAX;
        for (v = dest; v != src; v = x->parent.a[v])
        {
            flow = MIN(flow, x->p_weight.a[v]);
        }

        /*******************************for debug************************************/
        // if(src == 26818) fprintf(stderr, "***********flow: %f*********\n", flow);
        /*******************************for debug************************************/

        for (v = dest; v != src; v = x->parent.a[v])
        {
            u = x->parent.a[v];
            p = get_rGraph_edge(x, u, v);

            /*******************************for debug************************************/
            // if(src == 26818) fprintf(stderr, "utg%.6lul (%f)\n", u+1, p->weight);
            /*******************************for debug************************************/

            p->weight -= flow;
            p = get_rGraph_edge(x, v, u);
            p->weight += flow;
            x->rGraphSet.a[u] = x->rGraphSet.a[v] = 1;
        }

        max_flow += flow;
    }
    
    return (max_flow != 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
xorl %ecx, %ecx
callq 0x141ff9
testq %rax, %rax
je 0x14250d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movb $0x1, %bpl
movq 0xf8(%rbx), %rax
movabsq $-0x400000000000000, %rcx # imm = 0xFC00000000000000
andq %rcx, (%rax)
movq 0xf8(%rbx), %rax
movq $0x0, 0x8(%rax)
movsd 0xe3107(%rip), %xmm3    # 0x225510
cmpq %r15, %r14
je 0x142451
movq 0x110(%rbx), %rax
movq 0x128(%rbx), %rcx
movsd 0xe30ec(%rip), %xmm0    # 0x225510
movq %r14, %rdx
movapd %xmm0, %xmm3
movsd (%rcx,%rdx,8), %xmm1
cmplesd %xmm1, %xmm3
movapd %xmm3, %xmm2
andnpd %xmm1, %xmm2
andpd %xmm0, %xmm3
orpd %xmm2, %xmm3
movl (%rax,%rdx,4), %edx
movapd %xmm3, %xmm0
cmpq %r15, %rdx
jne 0x14242b
movq %r14, %r12
cmpq %r15, %r14
movapd %xmm3, 0x10(%rsp)
je 0x1424cc
movq 0x110(%rbx), %rax
movl (%rax,%r12,4), %r13d
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x14147f
movsd (%rax), %xmm0
subsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x14147f
movapd 0x10(%rsp), %xmm3
movsd (%rax), %xmm0
addsd %xmm3, %xmm0
movsd %xmm0, (%rax)
movq 0xa8(%rbx), %rax
movb %bpl, (%rax,%r12)
movq 0xa8(%rbx), %rax
movb %bpl, (%rax,%r13)
movq 0x110(%rbx), %rax
movl (%rax,%r12,4), %r12d
cmpq %r15, %r12
jne 0x14245f
movsd 0x8(%rsp), %xmm0
addsd %xmm3, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x141ff9
testq %rax, %rax
jne 0x1423de
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
cmpneqsd %xmm0, %xmm1
movq %xmm1, %r12
andl $0x1, %r12d
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: print_rGraph(min_cut_t*)
void print_rGraph(min_cut_t* x)
{
    uint64_t i, k;
    for (i = 0; i < x->rGraph.n; ++i) 
    { 
        for (k = 0; k < x->rGraph.a[i].n; k++)
        {
            if(x->rGraph.a[i].a[k].del) continue;
            fprintf(stderr, "src(utg%.6dl, enz:%lu)\tdes(utg%.6dl, enz:%lu)\t%f\n", 
            (int)(i+1), x->enzymes[i], 
            (int)(x->rGraph.a[i].a[k].uID+1), x->enzymes[x->rGraph.a[i].a[k].uID], 
            x->rGraph.a[i].a[k].weight);    
        }
    }
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x142766
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
leaq (%r15,%r15,2), %r13
cmpq $0x0, (%rax,%r13,8)
je 0x142750
leal 0x1(%r15), %ebp
xorl %r12d, %r12d
xorl %r14d, %r14d
movq 0x10(%rax,%r13,8), %rax
cmpb $0x0, 0x18(%rax,%r12)
jns 0x142716
incq %r14
movq 0x10(%rbx), %rax
addq $0x28, %r12
cmpq (%rax,%r13,8), %r14
jb 0x1426f6
jmp 0x142750
movq 0x1478c3(%rip), %rcx    # 0x289fe0
movq (%rcx), %rdi
movq 0x130(%rbx), %rdx
movq (%rdx,%r15,8), %rcx
movl 0x8(%rax,%r12), %esi
leal 0x1(%rsi), %r8d
movq (%rdx,%rsi,8), %r9
movsd (%rax,%r12), %xmm0
leaq 0xed197(%rip), %rsi     # 0x22f8dc
movl %ebp, %edx
movb $0x1, %al
callq 0x22b0
jmp 0x142703
incq %r15
cmpq (%rbx), %r15
jb 0x1426dd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: select_large_node(ma_ug_t const*, min_cut_t*, unsigned long, unsigned long, unsigned long, int)
int select_large_node(const ma_ug_t *ug, min_cut_t* x, 
uint64_t src, uint64_t dest, uint64_t utg_thres, int weight_thres)
{
    if(src >= ug->u.n || dest >= ug->u.n) return 0;
    if(ug->u.a[src].n < utg_thres || ug->u.a[dest].n < utg_thres) return 0;

    uint64_t k;
    for (k = 0; k < x->rGraph.a[src].n; k++)
    {
        if(x->rGraph.a[src].a[k].del) continue;
        if(x->rGraph.a[src].a[k].weight >= weight_thres) break;
    }
    if(k == x->rGraph.a[src].n) return 0;

    src = dest;
    for (k = 0; k < x->rGraph.a[src].n; k++)
    {
        if(x->rGraph.a[src].a[k].del) continue;
        if(x->rGraph.a[src].a[k].weight >= weight_thres) break;
    }
    if(k == x->rGraph.a[src].n) return 0;

    return 1;
}

// Assembly:
movq (%rdi), %rax
cmpq %rdx, %rax
setbe %r10b
cmpq %rcx, %rax
setbe %r11b
xorl %eax, %eax
orb %r10b, %r11b
jne 0x142841
movq 0x10(%rdi), %rdi
leaq (%rdx,%rdx,4), %r10
movl 0x10(%rdi,%r10,8), %r10d
cmpq %r8, %r10
jb 0x142841
leaq (%rcx,%rcx,4), %r10
movl 0x10(%rdi,%r10,8), %edi
cmpq %r8, %rdi
jb 0x142841
movq 0x10(%rsi), %rsi
leaq (%rdx,%rdx,2), %rdi
movq (%rsi,%rdi,8), %rdx
xorl %eax, %eax
testq %rdx, %rdx
je 0x1427f0
leaq (%rsi,%rdi,8), %rdi
movq 0x10(%rdi), %r8
cvtsi2sd %r9d, %xmm0
xorl %edi, %edi
cmpb $0x0, 0x18(%r8)
js 0x1427df
movsd (%r8), %xmm1
ucomisd %xmm0, %xmm1
jae 0x1427f2
incq %rdi
addq $0x28, %r8
cmpq %rdi, %rdx
jne 0x1427cd
movq %rdx, %rdi
jmp 0x1427f2
xorl %edi, %edi
cmpq %rdx, %rdi
je 0x142841
leaq (%rcx,%rcx,2), %rax
movq (%rsi,%rax,8), %rcx
testq %rcx, %rcx
je 0x142837
leaq (%rsi,%rax,8), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
cvtsi2sd %r9d, %xmm0
xorl %edx, %edx
cmpb $0x0, 0x18(%rax)
js 0x142826
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x142839
incq %rdx
addq $0x28, %rax
cmpq %rdx, %rcx
jne 0x142816
movq %rcx, %rdx
jmp 0x142839
xorl %edx, %edx
xorl %eax, %eax
cmpq %rcx, %rdx
setne %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_bmer_unitgs(min_cut_t*, bubble_type const*, unsigned long, unsigned long)
void get_bmer_unitgs(min_cut_t* x, const bubble_type* bub, uint64_t k, uint64_t src)
{
    uint32_t beg, sink, n, *a;
    if(!IF_BUB(src, *bub)) return;
    get_bubbles((bubble_type*)bub, bub->index[src], &beg, &sink, &a, &n, NULL);
    memset(x->bmerVis.a, 0, x->bmerVis.n);
    ///select_bmer(src, k, bub, x, 1);
    select_bmer_distance(beg^1, k, bub, x, 1, 1);
    select_bmer_distance(sink^1, k, bub, x, 1, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq (%rsi), %rax
movq 0x80(%rsi), %rdx
movl (%rax,%rcx,4), %eax
incq %rdx
cmpq %rax, %rdx
jbe 0x142ef8
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rsi), %rcx
movq 0x40(%rsi), %rdx
movl (%rdx,%rax,4), %eax
movl (%rcx,%rax,4), %ebp
incl %eax
movl (%rcx,%rax,4), %r12d
movq 0xe0(%rdi), %rdx
movq 0xf0(%rdi), %rdi
xorl %esi, %esi
callq 0x20e0
xorl $0x1, %ebp
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x142c1c
xorl $0x1, %r12d
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x142c1c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: init_G_partition(G_partition*, unsigned long)
void init_G_partition(G_partition* x, uint64_t n_utg)
{
    uint64_t i;
    kv_init(*x);
    MALLOC(x->index, n_utg);
    for (i = 0; i < n_utg; i++)
    {
        x->index[i] = (uint32_t)-1;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq (,%rsi,4), %rbx
movq %rbx, %rdi
callq 0x2280
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq %rax, 0x18(%r15)
testq %r14, %r14
je 0x142f49
movq %rax, %rdi
movl $0xff, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x20e0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: reset_G_partition(G_partition*, unsigned long)
void reset_G_partition(G_partition* x, uint64_t n_utg)
{
    uint64_t i;
    x->n = 0;
    for (i = 0; i < n_utg; i++)
    {
        x->index[i] = (uint32_t)-1;
    }
}

// Assembly:
movq $0x0, (%rdi)
testq %rsi, %rsi
je 0x142f70
movq %rsi, %rdx
movq 0x18(%rdi), %rdi
shlq $0x2, %rdx
movl $0xff, %esi
jmp 0x20e0
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: destory_G_partition(G_partition*)
void destory_G_partition(G_partition* x)
{
    uint64_t i;
    for (i = 0; i < x->n; i++)
    {
        kv_destroy(x->a[i].a);
    }
    kv_destroy(*x);
    free(x->index);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x142fa1
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x2220
incq %r15
addq $0x48, %r14
cmpq (%rbx), %r15
jb 0x142f88
movq 0x10(%rbx), %rdi
callq 0x2220
movq 0x18(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_hc_weight(unsigned int, unsigned int, unsigned int, bub_p_t_warp*, min_cut_t*)
double get_hc_weight(uint32_t query, uint32_t v0, uint32_t root, bub_p_t_warp *b, min_cut_t* x)
{
    if(v0 == root) return 0;
    uint32_t v, u;
    hc_edge *p = NULL;
    double weight = 0;
    v = v0;
    do {
		u = b->a[v].p; // u->v
        p = get_rGraph_edge(x, query>>1, v>>1);
        if(p) weight += p->weight;
		v = u;
	} while (v != root);

    return weight;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl %edx, %esi
je 0x14301e
movq %r8, %rbx
movl %edx, %ebp
movl %esi, %r15d
movl %edi, %r14d
movq (%rcx), %r12
shrl %r14d
movsd %xmm0, 0x8(%rsp)
movl %r15d, %edx
movl %r15d, %eax
imulq $0x38, %rax, %rax
movl (%r12,%rax), %r15d
shrl %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14147f
testq %rax, %rax
je 0x143019
movsd 0x8(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl %ebp, %r15d
jne 0x142fe9
movsd 0x8(%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: set_path(bub_p_t_warp*, unsigned int, unsigned char*, unsigned char)
void set_path(bub_p_t_warp *b, uint32_t root, uint8_t* flag, uint8_t label)
{
    uint32_t v, u;
    ///v is the sink of this bubble
	v = b->S.a[0];
    do {
		u = b->a[v].p; // u->v
        flag[v>>1] |= label;
		v = u;
	} while (v != root);
    flag[b->S.a[0]>>1] = 0;
}

// Assembly:
movq 0x18(%rdi), %rax
movl (%rax), %eax
movq (%rdi), %r8
movl %eax, %r9d
imulq $0x38, %r9, %r9
movl (%r8,%r9), %r8d
shrl %eax
orb %cl, (%rdx,%rax)
movl %r8d, %eax
cmpl %esi, %r8d
jne 0x143037
movq 0x18(%rdi), %rax
movl (%rax), %eax
shrl %eax
movb $0x0, (%rdx,%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_co_weight(unsigned int*, unsigned int, unsigned int*, unsigned int, min_cut_t*)
double get_co_weight(uint32_t *query, uint32_t query_n, uint32_t *target, uint32_t target_n, min_cut_t* m)
{
    double weight = 0;
    hc_edge *p = NULL;
    uint32_t i, k;
    for (i = 0; i < query_n; i++)
    {
        for (k = 0; k < target_n; k++)
        {
            p = get_rGraph_edge(m, query[i], target[k]);
            if(p) weight += p->weight;
        }
    }

    return weight;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
testl %esi, %esi
je 0x14383c
movq %r8, %rbx
movq %rdx, %r14
movl %esi, %eax
movq %rax, 0x20(%rsp)
movl %ecx, %r15d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %ebp, %ebp
movl %ecx, 0x14(%rsp)
testl %ecx, %ecx
je 0x14382c
movq 0x18(%rsp), %rax
movl (%rax,%rbp,4), %r12d
xorl %r13d, %r13d
movl (%r14,%r13,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14147f
testq %rax, %rax
je 0x143824
movsd 0x8(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
incq %r13
cmpq %r13, %r15
jne 0x143800
incq %rbp
cmpq 0x20(%rsp), %rbp
movl 0x14(%rsp), %ecx
jne 0x1437f0
jmp 0x143846
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: print_phased_bubble(G_partition*, bubble_type*, unsigned int)
void print_phased_bubble(G_partition* x, bubble_type* bub, uint32_t utg_n)
{
    uint64_t i, k;
    uint32_t beg = 0, sink = 0, h0_n, h1_n, *h0, *h1, full_bub = 0, bubID = 0;

    for (i = 0; i < x->n; i++)
    {
        get_phased_block(x, bub, i, &beg, &sink, &h0, &h0_n, &h1, &h1_n, &full_bub, &bubID);

        fprintf(stderr, "\n[%lu]\tbeg:utg%.6ul\tsink:utg%.6ul\tphased=%u\n", i, (beg>>1)+1, (sink>>1)+1, full_bub);
        for (k = 0; k < h0_n; k++)
        {
            fprintf(stderr, "(0) utg%.6ul\n", h0[k] + 1);
        }

        for (k = 0; k < h1_n; k++)
        {
            fprintf(stderr, "(1) utg%.6ul\n", h1[k] + 1);
        }

        uint32_t n, *a;
        get_bubbles(bub, bubID, &beg, &sink, &a, &n, NULL);
        if(n > 2) fprintf(stderr, "complex\n");
    }

    /*******************************for debug************************************/
    for (i = 0; i < utg_n; i++)
    {
        if(x->index[i] == (uint32_t)-1) continue;
        partition_warp* p = &(x->a[x->index[i]]);
        for (k = 0; k < p->a.n; k++)
        {
            if(p->a.a[k] != i) break;
        }

        if(k == p->a.n) fprintf(stderr, "ERROR\n");
    }
    /*******************************for debug************************************/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
cmpq $0x0, (%rdi)
jne 0x143e31
testl %ebp, %ebp
je 0x143e28
movl %ebp, %r14d
xorl %r15d, %r15d
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rax
movl (%rax,%r15,4), %eax
cmpq %r12, %rax
je 0x143e17
movq 0x10(%rbx), %rcx
leaq (%rax,%rax,8), %rdx
movq (%rcx,%rdx,8), %rax
testq %rax, %rax
je 0x143e10
leaq (%rcx,%rdx,8), %rcx
movq 0x10(%rcx), %rdx
xorl %ecx, %ecx
movl (%rdx,%rcx,4), %esi
cmpq %rsi, %r15
jne 0x143e12
incq %rcx
cmpq %rcx, %rax
jne 0x143dfb
movq %rax, %rcx
jmp 0x143e12
xorl %ecx, %ecx
cmpq %rax, %rcx
je 0x143e21
incq %r15
cmpq %r14, %r15
jne 0x143dd3
jmp 0x143e28
callq 0x1d097
jmp 0x143e17
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x1cee1
jmp 0x143dc3
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_hic_distance(pe_hit*, hc_links*, ha_ug_index const*, unsigned int*)
uint64_t get_hic_distance(pe_hit* hit, hc_links* link, const ha_ug_index* idx, uint32_t *is_cc)
{
    uint64_t s_uid, s_dir, e_uid, e_dir, u_dis, k;
    long long s_pos, e_pos;
    s_uid = ((hit->s<<1)>>(64 - idx->uID_bits)); s_pos = hit->s & idx->pos_mode;
    e_uid = ((hit->e<<1)>>(64 - idx->uID_bits)); e_pos = hit->e & idx->pos_mode;
    if(s_uid == e_uid)
    {
        if(is_cc) (*is_cc) = 1;
        return MAX(s_pos, e_pos) - MIN(s_pos, e_pos);
    } 
    hc_linkeage* t = &(link->a.a[s_uid]);
    for (k = 0; k < t->e.n; k++)
    {
        if(t->e.a[k].del || t->e.a[k].uID != e_uid) continue;
        if(is_cc) (*is_cc) = t->e.a[k].is_cc;
        s_dir = (!!(t->e.a[k].dis&(uint64_t)2));
        e_dir = (!!(t->e.a[k].dis&(uint64_t)1));
        u_dis = (t->e.a[k].dis ==(uint64_t)-1? (uint64_t)-1 : t->e.a[k].dis>>3);
        // if(s_uid == 24684 && s_pos == 124953 && e_uid == 16950 && e_pos == 93039)
        // {
        //     fprintf(stderr, "*****************s_dir: %lu, e_dir: %lu, u_dis: %lu\n", s_dir, e_dir, u_dis);
        // }
        if(u_dis == (uint64_t)-1) return (uint64_t)-1;
        if(s_dir == 1) s_pos = (long long)idx->ug->g->seq[s_uid].len - s_pos - 1;
        if(e_dir == 1) e_pos = (long long)idx->ug->g->seq[e_uid].len - e_pos - 1;
        e_pos = e_pos + u_dis - (long long)idx->ug->g->seq[e_uid].len;
        return MAX(s_pos, e_pos) - MIN(s_pos, e_pos);
    }

    return (uint64_t)-1;
}

// Assembly:
pushq %rbx
movq %rcx, %rax
movq (%rdi), %r8
movq 0x8(%rdi), %rdi
leaq (%r8,%r8), %r10
xorl %ecx, %ecx
subb 0x18(%rdx), %cl
shrq %cl, %r10
leaq (%rdi,%rdi), %r9
shrq %cl, %r9
movq 0x30(%rdx), %rcx
andq %rcx, %r8
andq %rcx, %rdi
cmpq %r9, %r10
jne 0x143e85
testq %rax, %rax
je 0x143e76
movl $0x1, (%rax)
subq %rdi, %r8
movq %r8, %rax
negq %rax
cmovsq %r8, %rax
jmp 0x143ec6
movq 0x10(%rsi), %rcx
leaq (%r10,%r10,2), %r11
shlq $0x4, %r11
movq (%rcx,%r11), %rsi
testq %rsi, %rsi
je 0x143ebf
addq %r11, %rcx
movq 0x10(%rcx), %rcx
addq $0x18, %rcx
movsbl (%rcx), %r11d
testl %r11d, %r11d
js 0x143eb6
movl -0x10(%rcx), %ebx
cmpq %rbx, %r9
je 0x143ec8
addq $0x28, %rcx
decq %rsi
jne 0x143ea5
movq $-0x1, %rax
popq %rbx
retq
testq %rax, %rax
je 0x143ed0
movl %r11d, (%rax)
movq -0x8(%rcx), %rcx
movq %rcx, %rax
shrq $0x3, %rax
cmpq $-0x1, %rcx
cmoveq %rcx, %rax
je 0x143ebf
testb $0x2, %cl
je 0x143f05
movq (%rdx), %rsi
movq 0x18(%rsi), %rsi
movq 0x20(%rsi), %rsi
movl (%rsi,%r10,8), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
notq %r8
addq %rsi, %r8
testb $0x1, %cl
je 0x143f25
movq (%rdx), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
movl (%rcx,%r9,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
notq %rdi
addq %rcx, %rdi
addq %rdi, %rax
subq %rax, %r8
movq (%rdx), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl (%rax,%r9,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %r8, %rcx
movq %rcx, %rax
negq %rax
cmovsq %rcx, %rax
jmp 0x143ec6
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_bub_id(bubble_type*, unsigned int, unsigned long*, unsigned long*, unsigned int)
void get_bub_id(bubble_type* bub, uint32_t root, uint64_t* id0, uint64_t* id1, uint32_t check_het)
{
    if(id0) (*id0) = (uint64_t)-1;
    if(id1) (*id1) = (uint64_t)-1;
    uint64_t b_id0 = (uint64_t)-1, b_id1 = (uint64_t)-1;
    uint32_t beg, sink;

    if((bub->b_s_idx.a[root]&0xffffffff) != 0xffffffff)
    {
        b_id0 = bub->b_s_idx.a[root]&0xffffffff;
        if(check_het)
        {
            get_bubbles(bub, b_id0, &beg, &sink, NULL, NULL, NULL);
            if(((beg == (uint32_t)-1) || IF_HET(beg>>1, *bub)) && ((sink == (uint32_t)-1) || IF_HET(sink>>1, *bub))) b_id0 = (uint64_t)-1;
        } 
    }

    if((bub->b_s_idx.a[root]&0xffffffff00000000) != 0xffffffff00000000)
    {
        b_id1 = bub->b_s_idx.a[root]&0xffffffff00000000; b_id1 >>= 32;
        if(check_het)
        {
            get_bubbles(bub, b_id1, &beg, &sink, NULL, NULL, NULL);
            if(((beg == (uint32_t)-1) || IF_HET(beg>>1, *bub)) && ((sink == (uint32_t)-1) || IF_HET(sink>>1, *bub))) b_id1 = (uint64_t)-1;
        }        
    }

    if(b_id0 == (uint64_t)-1 && b_id1 != (uint64_t)-1)
    {
        b_id0 = b_id1;
        b_id1 = (uint64_t)-1;
    }

    if(id0) (*id0) = b_id0;
    if(id1) (*id1) = b_id1;
}

// Assembly:
testq %rdx, %rdx
je 0x1445f3
movq $-0x1, (%rdx)
testq %rcx, %rcx
je 0x1445ff
movq $-0x1, (%rcx)
pushq %rbx
movq 0x70(%rdi), %rax
movl %esi, %esi
movq (%rax,%rsi,8), %rax
movl %eax, %r9d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movq $-0x1, %rsi
cmpq %r10, %r9
je 0x14468a
testl %r8d, %r8d
je 0x144687
movq 0x28(%rdi), %rsi
movq 0x40(%rdi), %r10
movl (%r10,%r9,4), %r11d
movl (%rsi,%r11,4), %r10d
incl %r11d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl (%rsi,%r11,4), %esi
cmpq %rbx, %r10
je 0x14465e
shrl %r10d
movq (%rdi), %r11
movq 0x80(%rdi), %rbx
movl (%r11,%r10,4), %r10d
incq %rbx
cmpq %r10, %rbx
jne 0x144687
cmpl $-0x1, %esi
je 0x14467e
shrl %esi
movq (%rdi), %r10
movq 0x80(%rdi), %r11
movl (%r10,%rsi,4), %r10d
incq %r11
movq %r9, %rsi
cmpq %r10, %r11
jne 0x14468a
movq $-0x1, %rsi
jmp 0x14468a
movq %r9, %rsi
movabsq $-0x100000001, %r9      # imm = 0xFFFFFFFEFFFFFFFF
cmpq %r9, %rax
jbe 0x1446a2
movq $-0x1, %rax
jmp 0x144705
shrq $0x20, %rax
testl %r8d, %r8d
je 0x144705
movq 0x28(%rdi), %r8
movq 0x40(%rdi), %r9
movl (%r9,%rax,4), %r10d
movl (%r8,%r10,4), %r9d
incl %r10d
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl (%r8,%r10,4), %r8d
cmpq %r11, %r9
je 0x1446e6
shrl %r9d
movq (%rdi), %r10
movq 0x80(%rdi), %r11
movl (%r10,%r9,4), %r9d
incq %r11
cmpq %r9, %r11
jne 0x144705
cmpl $-0x1, %r8d
je 0x144699
shrl %r8d
movq (%rdi), %r9
movq 0x80(%rdi), %rdi
movl (%r9,%r8,4), %r8d
incq %rdi
cmpq %r8, %rdi
je 0x144699
cmpq $-0x1, %rsi
movq %rax, %rdi
cmoveq %rsi, %rdi
testq %rdx, %rdx
popq %rbx
je 0x144729
cmpq $-0x1, %rax
cmoveq %rsi, %rax
cmpq $-0x1, %rsi
cmovneq %rsi, %rax
movq %rax, (%rdx)
testq %rcx, %rcx
je 0x144731
movq %rdi, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: connect_bub_occ(bubble_type*, unsigned int, unsigned int)
uint32_t connect_bub_occ(bubble_type* bub, uint32_t root_id, uint32_t check_het)
{
    uint64_t id0, id1, occ = 2;  
    get_bub_id(bub, root_id, &id0, &id1, check_het);
    if(id0 == (uint64_t)-1) occ--;
    if(id1 == (uint64_t)-1) occ--;
    return occ;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %r8d
leaq 0x10(%rsp), %rbx
leaq 0x8(%rsp), %r14
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1445e7
xorl %eax, %eax
cmpq $-0x1, (%rbx)
sete %al
xorl %ecx, %ecx
cmpq $-0x1, (%r14)
sete %cl
addl %eax, %ecx
movl $0x2, %eax
subl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: is_local_simple_circle(asg_t*, unsigned int)
int is_local_simple_circle(asg_t *g, uint32_t v)
{
    if(asg_arc_n(g, v) != asg_arc_n(g, v^1)) return 0;
    if(asg_arc_n(g, v) == 1) v = arc_first(g, v).v;
    if(asg_arc_n(g, v) != asg_arc_n(g, v^1)) return 0;
    if(asg_arc_n(g, v) != 2) return 0;
    uint32_t ncur, i, u;
    asg_arc_t *acur = NULL;
    ncur = asg_arc_n(g, v);
    acur = asg_arc_a(g, v);
    for (i = 0; i < ncur; i++)
    {
        if(acur[i].del) continue;
        u = acur[i].v;
        if(asg_arc_n(g, u) != 1 || asg_arc_n(g, u^1) != 1) continue;
        if(arc_first(g, u).v != v) continue;
        return 1;
    }
    return 0;
}

// Assembly:
movq 0x28(%rdi), %rcx
movl %esi, %eax
movq (%rcx,%rax,8), %rdx
movl %esi, %r8d
xorl $0x1, %r8d
xorl %eax, %eax
cmpl (%rcx,%r8,8), %edx
jne 0x145cd2
cmpl $0x1, %edx
jne 0x145c65
movq 0x8(%rdi), %rsi
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
movl 0x8(%rsi,%rdx,8), %esi
movl %esi, %edx
movq (%rcx,%rdx,8), %rdx
cmpl $0x2, %edx
jne 0x145cd2
movl %esi, %r8d
xorl $0x1, %r8d
movl (%rcx,%r8,8), %r8d
cmpl $0x2, %r8d
jne 0x145cd2
movq 0x8(%rdi), %rax
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
addq $0xc, %rdx
xorl %edi, %edi
cmpl $0x0, (%rdx,%rdi)
js 0x145cc6
movl -0x4(%rdx,%rdi), %r9d
movq (%rcx,%r9,8), %r8
cmpl $0x1, %r8d
jne 0x145cc6
xorq $0x1, %r9
cmpl $0x1, (%rcx,%r9,8)
jne 0x145cc6
shrq $0x20, %r8
leaq (%r8,%r8,2), %r8
cmpl %esi, 0x8(%rax,%r8,8)
je 0x145cd3
addq $0x18, %rdi
cmpq $0x18, %rdi
je 0x145c97
xorl %eax, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: calculate_chain_weight(ma_utg_t*, bubble_type*, ma_ug_t*, chain_w_type*)
uint64_t calculate_chain_weight(ma_utg_t *u, bubble_type* bub, ma_ug_t *unitig_ug, chain_w_type* x)
{
    x->b_occ = x->g_occ = 0;
    uint32_t i, j, *a, n;
    uint64_t occ, occ_n, thres;
    for (i = occ = occ_n = 0; i < u->n; i++)
    {
        if(bub->b_g->seq[u->a[i]>>33].c != HAP_LABLE)
        {
            get_bubbles(bub, u->a[i]>>33, NULL, NULL, &a, &n, NULL);
            for (j = 0; j < n; j++)
            {
                occ += unitig_ug->u.a[a[j]>>1].n;
            }
            occ_n++;
        }
    }

    thres = (uint64_t)-1;
    if(occ_n > 0) thres = (occ*6)/occ_n;

    for (i = 0; i < u->n; i++)
    {
        occ = 0;
        get_bubbles(bub, u->a[i]>>33, NULL, NULL, &a, &n, NULL);
        for (j = 0; j < n; j++)
        {
            occ += unitig_ug->u.a[a[j]>>1].n;
        }

        if(bub->b_g->seq[u->a[i]>>33].c != HAP_LABLE || occ < thres)
        {
            x->g_occ += occ;
        }
        else
        {
            x->b_occ += occ;
        }
    }

    return thres;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, -0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
movl 0x10(%rdi), %r9d
testq %r9, %r9
je 0x146604
movq 0xb8(%rsi), %rax
movq 0x20(%rax), %rax
movq 0x18(%rdi), %rdx
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %ebx, %ebx
movq -0x8(%rsp), %r8
movq (%rdx,%r11,8), %r15
shrq $0x21, %r15
cmpb $0x2, 0x4(%rax,%r15,8)
je 0x1465f3
movq 0x40(%rsi), %r12
movl (%r12,%r15,4), %r14d
movl 0x4(%r12,%r15,4), %ebp
subl %r14d, %ebp
addl $-0x2, %ebp
je 0x1465f0
movq 0x28(%rsi), %r15
leaq (%r15,%r14,4), %r14
addq $0x8, %r14
movq 0x10(%r8), %r15
movl %ebp, %r12d
xorl %r13d, %r13d
movl (%r14,%r13,4), %ebp
shrl %ebp
leaq (%rbp,%rbp,4), %rbp
movl 0x10(%r15,%rbp,8), %ebp
addq %rbp, %rbx
incq %r13
cmpq %r13, %r12
jne 0x1465d5
incq %r10
incq %r11
cmpq %r9, %r11
jne 0x14659a
addq %rbx, %rbx
leaq (%rbx,%rbx,2), %rax
jmp 0x146609
xorl %eax, %eax
xorl %r10d, %r10d
testq %r10, %r10
je 0x146615
xorl %edx, %edx
divq %r10
jmp 0x14661c
movq $-0x1, %rax
testq %r9, %r9
je 0x1466b3
movq 0x18(%rdi), %rdx
movq 0x28(%rsi), %rdi
movq 0x40(%rsi), %r10
addq $0x8, %rdi
movq 0xb8(%rsi), %rsi
movq 0x20(%rsi), %rsi
xorl %r11d, %r11d
movq (%rdx,%r11,8), %rbx
shrq $0x21, %rbx
movl (%r10,%rbx,4), %r14d
movl 0x4(%r10,%rbx,4), %ebp
subl %r14d, %ebp
addl $-0x2, %ebp
je 0x14668e
leaq (%rdi,%r14,4), %r15
movq -0x8(%rsp), %r8
movq 0x10(%r8), %r12
movl %ebp, %r13d
xorl %ebp, %ebp
xorl %r14d, %r14d
movl (%r15,%rbp,4), %r8d
shrl %r8d
leaq (%r8,%r8,4), %r8
movl 0x10(%r12,%r8,8), %r8d
addq %r8, %r14
incq %rbp
cmpq %rbp, %r13
jne 0x146671
jmp 0x146691
xorl %r14d, %r14d
cmpb $0x2, 0x4(%rsi,%rbx,8)
sete %r8b
cmpq %rax, %r14
setae %bl
andb %r8b, %bl
movzbl %bl, %r8d
addq %r14, (%rcx,%r8,8)
incq %r11
cmpq %r9, %r11
jne 0x146643
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: cmp_chain_weight(void const*, void const*)
int cmp_chain_weight(const void * a, const void * b)
{
    if((*(chain_w_type*)a).del != (*(chain_w_type*)b).del)
    {
        return (*(chain_w_type*)a).del > (*(chain_w_type*)b).del? 1 : -1;
    }
    else
    {
        long long a_occ = (*(chain_w_type*)a).g_occ - (*(chain_w_type*)a).b_occ;
        long long b_occ = (*(chain_w_type*)b).g_occ - (*(chain_w_type*)b).b_occ;
        if(a_occ != b_occ)
        {
            return a_occ > b_occ? -1 : 1;
        }
        else
        {
            return 0;
        }
    }
}

// Assembly:
movb 0x18(%rdi), %cl
movb 0x18(%rsi), %dl
cmpb %dl, %cl
jne 0x1466e9
movq (%rdi), %rax
subq 0x8(%rdi), %rax
movq (%rsi), %rcx
subq 0x8(%rsi), %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rcx, %rax
setle %sil
leal -0x1(%rsi,%rsi), %eax
cmovel %edx, %eax
retq
xorl %eax, %eax
cmpb %cl, %dl
adcl $-0x1, %eax
orl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_btg_occ(bubble_type*, unsigned int)
uint32_t get_btg_occ(bubble_type* bub, uint32_t v)
{
    ma_ug_t *bub_ug = bub->b_ug;
    ma_utg_t *u = NULL;
    uint32_t k_i, k_j, *a = NULL, n, tan_occ = 0;

    u = &(bub_ug->u.a[v]);
    for (k_i = 0; k_i < u->n; k_i++)
    {
        get_bubbles(bub, u->a[k_i]>>33, NULL, NULL, &a, &n, NULL);
        for (k_j = 0; k_j < n; k_j++)
        {
            tan_occ += bub->ug->u.a[a[k_j]>>1].n;
        }
    }
    return tan_occ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0xc0(%rdi), %rax
movq 0x10(%rax), %rax
movl %esi, %ecx
leaq (%rcx,%rcx,4), %rdx
movl 0x10(%rax,%rdx,8), %ecx
testq %rcx, %rcx
je 0x146e03
leaq (%rax,%rdx,8), %rax
movq 0x18(%rax), %rdx
movq 0x28(%rdi), %rsi
movq 0x40(%rdi), %r8
addq $0x8, %rsi
xorl %r9d, %r9d
xorl %eax, %eax
movq (%rdx,%r9,8), %r11
shrq $0x21, %r11
movl (%r8,%r11,4), %r10d
movl 0x4(%r8,%r11,4), %ebx
subl %r10d, %ebx
addl $-0x2, %ebx
je 0x146df9
leaq (%rsi,%r10,4), %r10
movq 0x10(%rdi), %r11
movq 0x10(%r11), %r11
movl %ebx, %ebx
xorl %r14d, %r14d
movl (%r10,%r14,4), %r15d
shrl %r15d
leaq (%r15,%r15,4), %r15
addl 0x10(%r11,%r15,8), %eax
incq %r14
cmpq %r14, %rbx
jne 0x146de1
incq %r9
cmpq %rcx, %r9
jne 0x146db7
jmp 0x146e05
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_utg_end_from_btg(bubble_type*, ma_ug_t*, unsigned int)
uint32_t get_utg_end_from_btg(bubble_type* bub, ma_ug_t *bub_ug, uint32_t v)
{
    ma_utg_t *u = &(bub_ug->u.a[v>>1]);
    
    if((v&1)==1)
    {
        return (u->a[0]>>32)^1;
    }
    else
    {
        return u->a[u->n-1]>>32;
    } 
}

// Assembly:
movq 0x10(%rsi), %rax
movl %edx, %ecx
shrl %ecx
leaq (%rcx,%rcx,4), %rsi
movq 0x18(%rax,%rsi,8), %rcx
testb $0x1, %dl
jne 0x147de3
leaq (%rax,%rsi,8), %rax
movl 0x10(%rax), %eax
decl %eax
movl 0x4(%rcx,%rax,8), %eax
retq
movl 0x4(%rcx), %eax
xorl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: double_check_bub_branch(asg_arc_t*, ma_ug_t*, double*, unsigned int*, double, unsigned int)
int double_check_bub_branch(asg_arc_t *t, ma_ug_t *bs_ug, double *e_w, uint32_t *e_occ, double cutoff, uint32_t max_w_occ)
{
    uint32_t v = t->v^1, w = (t->ul>>32)^1, i, nv, rv, max_i, w_i, *a_occ = NULL;
    asg_arc_t *av = NULL;
    double *aw = NULL, max_w = cutoff - 1, w_w = 1;
    av = asg_arc_a(bs_ug->g, v);
    nv = asg_arc_n(bs_ug->g, v);
    aw = (&e_w[bs_ug->g->idx[v]>>32]);
    a_occ = (&e_occ[bs_ug->g->idx[v]>>32]);

    if(nv <= 1) return 1;

    for (i = rv = 0, max_i = w_i = (uint32_t)-1; i < nv; i++)
    {
        if(av[i].del) continue;
        rv++;
        if(av[i].v == w)
        {
            w_i = i;
            w_w = aw[i];
            continue;
        }
        if(max_i == (uint32_t)-1)
        {
            max_i = i;
            max_w = aw[i];
        }
        else if(max_w < aw[i])
        {
            max_i = i;
            max_w = aw[i];
        }
    }

    if(rv <= 1) return 1; ///must be here

    if(max_i == (uint32_t)-1 || w_i == (uint32_t)-1) return 0;
    ///if(max_w <= max_w_cutoff) return 0; //must be <=
    if(a_occ[max_i] <= max_w_occ) return 0; //must be <=
    
    if(w_w*cutoff < max_w) return 1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x8(%rdi), %eax
xorq $0x1, %rax
movq 0x18(%rsi), %r10
movq 0x28(%r10), %rsi
movq (%rsi,%rax,8), %r9
movl $0x1, %eax
testl $0xfffffffe, %r9d       # imm = 0xFFFFFFFE
je 0x14a9a5
movl 0x4(%rdi), %esi
movq 0x8(%r10), %r10
movq %r9, %r11
shrq $0x20, %r11
leaq (%rdx,%r11,8), %rdx
leaq (%rcx,%r11,4), %rcx
movsd 0xdac31(%rip), %xmm1    # 0x225538
addsd %xmm0, %xmm1
movl %r9d, %edi
leaq (%r11,%r11,2), %r9
leaq (%r10,%r9,8), %r10
addq $0xc, %r10
xorl %r11d, %r11d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movsd 0xda945(%rip), %xmm2    # 0x225270
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %ebp, %ebp
cmpl $0x0, (%r10)
js 0x14a96a
incl %ebp
movl -0x4(%r10), %r14d
xorl %esi, %r14d
cmpl $0x1, %r14d
jne 0x14a952
movsd (%rdx,%r11,8), %xmm2
movl %r11d, %r9d
jmp 0x14a96a
movsd (%rdx,%r11,8), %xmm3
cmpl $-0x1, %ebx
je 0x14a963
ucomisd %xmm1, %xmm3
jbe 0x14a96a
movl %r11d, %ebx
movapd %xmm3, %xmm1
incq %r11
addq $0x18, %r10
cmpq %r11, %rdi
jne 0x14a932
cmpl $0x2, %ebp
jb 0x14a9a5
cmpl $-0x1, %ebx
sete %dl
cmpl $-0x1, %r9d
sete %sil
xorl %eax, %eax
orb %dl, %sil
jne 0x14a9a5
movl %ebx, %edx
cmpl %r8d, (%rcx,%rdx,4)
jbe 0x14a9a5
mulsd %xmm0, %xmm2
xorl %eax, %eax
ucomisd %xmm2, %xmm1
seta %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: is_same_phase(unsigned long, unsigned long, H_partition*, signed char*, mc_gg_status*)
uint32_t is_same_phase(uint64_t bid, uint64_t eid, H_partition* hap, int8_t *s, mc_gg_status *sa)
{
    if(bid == eid) return 1;
    if(hap || s)
    {
        int beg_status, end_status;
        beg_status = (hap? get_phase_status(hap, bid):s[bid]);
        if(beg_status != 1 && beg_status != -1) return (uint32_t)-1;
        end_status = (hap? get_phase_status(hap, eid):s[eid]);
        if(end_status != 1 && end_status != -1) return (uint32_t)-1;
        if(beg_status == end_status) return 1;
        return 0;
    }

    if(sa)
    {
        if(sa[bid].s == 0 || sa[eid].s == 0) return (uint32_t)-1;
        return !!(sa[bid].s&sa[eid].s);
    }
    return (uint32_t)-1;
}

// Assembly:
movl $0x1, %eax
cmpq %rsi, %rdi
jne 0x14b589
retq
movq %rdx, %rax
orq %rcx, %rax
je 0x14b5cd
testq %rdx, %rdx
je 0x14b5f7
movq 0x10(%rdx), %rax
movl %edi, %edi
movl (%rax,%rdi,4), %eax
xorl %edi, %edi
testl %eax, 0x18(%rdx)
setne %dil
leal (%rdi,%rdi,2), %r8d
addl $-0x2, %r8d
movl 0x1c(%rdx), %edi
andl %eax, %edi
xorl %r9d, %r9d
negl %edi
movl $0x0, %edi
sbbl %edi, %edi
orl %r8d, %edi
testl %eax, 0x20(%rdx)
cmovnel %r9d, %edi
jmp 0x14b5fb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r8, %r8
je 0x14b588
shlq $0x5, %rdi
movl (%r8,%rdi), %ecx
testl %ecx, %ecx
je 0x14b588
shlq $0x5, %rsi
movl (%r8,%rsi), %edx
testl %edx, %edx
je 0x14b588
xorl %eax, %eax
testl %ecx, %edx
setne %al
retq
movsbl (%rcx,%rdi), %edi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x1, %edi
je 0x14b60e
cmpl $-0x1, %edi
jne 0x14b588
testq %rdx, %rdx
je 0x14b649
movq 0x10(%rdx), %rcx
movl %esi, %esi
movl (%rcx,%rsi,4), %esi
xorl %ecx, %ecx
testl %esi, 0x18(%rdx)
setne %cl
leal (%rcx,%rcx,2), %r8d
addl $-0x2, %r8d
movl 0x1c(%rdx), %ecx
andl %esi, %ecx
xorl %r9d, %r9d
negl %ecx
movl $0x0, %ecx
sbbl %ecx, %ecx
orl %r8d, %ecx
testl %esi, 0x20(%rdx)
cmovnel %r9d, %ecx
jmp 0x14b64d
movsbl (%rcx,%rsi), %ecx
cmpl $0x1, %ecx
je 0x14b65b
cmpl $-0x1, %ecx
jne 0x14b588
xorl %eax, %eax
cmpl %ecx, %edi
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: get_path_weight(unsigned int, unsigned int, unsigned int, bub_p_t_warp*, hc_links*)
double get_path_weight(uint32_t query, uint32_t v0, uint32_t root, bub_p_t_warp *b, hc_links* x)
{
    if(v0 == root) return 0;
    uint32_t v, u;
    hc_edge *p = NULL;
    double weight = 0;
    v = v0;
    do {
		u = b->a[v].p; // u->v
        p = get_hc_edge(x, query>>1, v>>1, 0);
        if(p) weight += p->weight;
		v = u;
	} while (v != root);

    return weight;
}

// Assembly:
xorpd %xmm0, %xmm0
cmpl %edx, %esi
je 0x14c1ec
pushq %rbx
movq (%rcx), %rax
shrl %edi
movq (%r8), %rcx
xorpd %xmm0, %xmm0
leaq (%rdi,%rdi,2), %r9
shlq $0x4, %r9
cmpq %rdi, %rcx
jbe 0x14c1d1
movq 0x10(%r8), %r10
movq (%r10,%r9), %r11
testq %r11, %r11
je 0x14c1d1
movl %esi, %ebx
shrl %ebx
movq 0x10(%r10,%r9), %r10
cmpb $0x0, 0x18(%r10)
js 0x14c1c8
cmpl %ebx, 0x8(%r10)
je 0x14c1d4
addq $0x28, %r10
decq %r11
jne 0x14c1bb
xorl %r10d, %r10d
testq %r10, %r10
je 0x14c1de
addsd (%r10), %xmm0
movl %esi, %esi
imulq $0x38, %rsi, %rsi
movl (%rax,%rsi), %esi
cmpl %edx, %esi
jne 0x14c1a0
popq %rbx
retq