LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: is_simple_broken_bubble(ma_ug_t*, unsigned int, unsigned int, unsigned int, unsigned int*)
int is_simple_broken_bubble(ma_ug_t *unitig_ug, uint32_t x, uint32_t beg, uint32_t sink, uint32_t* new_het)
{
    uint32_t nv, v = (uint32_t)-1, u_s = (uint32_t)-1, u_e = (uint32_t)-1, i;
    asg_arc_t *av = NULL;
    (*new_het) = (uint32_t)-1;

    if((asg_arc_n(unitig_ug->g, x) == 1) 
                        && (asg_arc_n(unitig_ug->g, x^1) == 0))
    {
        v = x;
    }

    if((asg_arc_n(unitig_ug->g, x^1) == 1) 
                        && (asg_arc_n(unitig_ug->g, x) == 0))
    {
        v = x^1;
    }

    if(v == (uint32_t)-1) return 0;

    
    av = asg_arc_a(unitig_ug->g, v);
    nv = asg_arc_n(unitig_ug->g, v);
    for (i = 0; i < nv; i++)
    {
        if(av[i].del) continue;
        if((av[i].v>>1) == (beg>>1)) u_s = beg, u_e = sink;
        if((av[i].v>>1) == (sink>>1)) u_s = sink, u_e = beg;
    }

    if(u_s == (uint32_t)-1 || u_e == (uint32_t)-1) return 0;

    av = asg_arc_a(unitig_ug->g, u_s);
    nv = asg_arc_n(unitig_ug->g, u_s);
    if(nv != 2) return 0;
    for (i = 0; i < nv; i++)
    {
        if(av[i].del) continue;
        if(av[i].v == (v^1)) continue;
        if(av[i].v == (u_e^1))
        {
            (*new_het) = u_e;
            return 1;
        }
    }

    return 0;
}

// Assembly:
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
movq 0x18(%rdi), %r10
movq 0x28(%r10), %r9
movl %esi, %eax
movl (%r9,%rax,8), %eax
movl %esi, %edi
xorl $0x1, %edi
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
cmpq $0x1, %rax
jne 0x14bdee
xorl %r11d, %r11d
cmpl (%r9,%rdi,8), %r11d
sbbl %r11d, %r11d
orl %esi, %r11d
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl (%r9,%rdi,8), %esi
xorq $0x1, %rsi
orq %rsi, %rax
cmovnel %r11d, %edi
xorl %eax, %eax
cmpl $-0x1, %edi
je 0x14bee8
movl %edi, %esi
movq (%r9,%rsi,8), %rsi
testl %esi, %esi
je 0x14bee8
movq 0x8(%r10), %r10
movq %rsi, %rax
shrq $0x20, %rax
movl %esi, %esi
leaq (%rax,%rax,2), %rax
leaq (%r10,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rbx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
cmpl $0x0, (%rax,%r14)
js 0x14be74
movl -0x4(%rax,%r14), %ebp
movl %ebp, %r15d
xorl %edx, %r15d
cmpl $0x2, %r15d
cmovbl %edx, %r11d
cmovbl %ecx, %esi
xorl %ecx, %ebp
cmpl $0x2, %ebp
cmovbl %ecx, %r11d
cmovbl %edx, %esi
addq $0x18, %r14
cmpq %r14, %rbx
jne 0x14be4b
xorl %eax, %eax
cmpl $-0x1, %r11d
je 0x14bee8
cmpl $-0x1, %esi
je 0x14bee8
movl %r11d, %ecx
movq (%r9,%rcx,8), %rcx
cmpl $0x2, %ecx
jne 0x14bee8
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rax
leaq (%r10,%rax,8), %rcx
movb $0x1, %dl
xorl %r9d, %r9d
leaq (%r9,%r9,2), %rax
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x14becc
leaq (%rcx,%rax,8), %rax
movl 0x8(%rax), %eax
movl %eax, %r9d
xorl %edi, %r9d
cmpl $0x1, %r9d
je 0x14becc
xorl %esi, %eax
cmpl $0x1, %eax
je 0x14bee0
xorl %eax, %eax
movl $0x1, %r9d
testb $0x1, %dl
movl $0x0, %edx
jne 0x14bea7
jmp 0x14bee8
movl %esi, (%r8)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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), %r8
movl %esi, %edx
xorl $0x1, %edx
xorl %eax, %eax
cmpl (%rcx,%rdx,8), %r8d
jne 0x14c32e
cmpl $0x1, %r8d
jne 0x14c2a9
movq 0x8(%rdi), %rdx
shrq $0x20, %r8
leaq (%r8,%r8,2), %rsi
movl 0x8(%rdx,%rsi,8), %esi
movq (%rcx,%rsi,8), %r8
movq %rsi, %rdx
xorq $0x1, %rdx
cmpl $0x2, %r8d
jne 0x14c32e
movl (%rcx,%rdx,8), %edx
cmpl $0x2, %edx
jne 0x14c32e
movq 0x8(%rdi), %rdx
shrq $0x20, %r8
leaq (%r8,%r8,2), %rax
leaq (%rdx,%rax,8), %rdi
movb $0x1, %r8b
xorl %r9d, %r9d
leaq (%r9,%r9,2), %rax
cmpl $0x0, 0xc(%rdi,%rax,8)
js 0x14c31a
leaq (%rdi,%rax,8), %rax
movl 0x8(%rax), %r9d
movq (%rcx,%r9,8), %rax
cmpl $0x1, %eax
jne 0x14c31a
xorq $0x1, %r9
cmpl $0x1, (%rcx,%r9,8)
jne 0x14c31a
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
movl 0x8(%rdx,%rax,8), %r10d
cmpl %esi, %r10d
setne %al
movl $0x1, %r9d
testb %r8b, %al
movl $0x0, %r8d
jne 0x14c2cd
jmp 0x14c32f
xorl %eax, %eax
movl $0x1, %r9d
testb $0x1, %r8b
movl $0x0, %r8d
jne 0x14c2cd
retq
xorl %eax, %eax
cmpl %esi, %r10d
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, -0x10(%rsp)
xorps %xmm0, %xmm0
movq %rcx, -0x18(%rsp)
movups %xmm0, (%rcx)
movl 0x10(%rdi), %r9d
testq %r9, %r9
je 0x14ccc3
movq 0xb8(%rsi), %rax
movq 0x20(%rax), %rdx
movq 0x18(%rdi), %r11
xorl %ebx, %ebx
xorl %r10d, %r10d
xorl %eax, %eax
movq (%r11,%rbx,8), %rcx
shrq $0x21, %rcx
cmpb $0x2, 0x4(%rdx,%rcx,8)
je 0x14cca8
movq 0x40(%rsi), %r14
movl (%r14,%rcx,4), %r8d
movl 0x4(%r14,%rcx,4), %ecx
subl %r8d, %ecx
addl $-0x2, %ecx
je 0x14cca5
movq 0x28(%rsi), %r14
leaq (%r14,%r8,4), %r14
addq $0x8, %r14
movq -0x10(%rsp), %r8
movq 0x10(%r8), %r15
movl %ecx, %r12d
xorl %r8d, %r8d
movl (%r14,%r8,4), %ecx
shrl %ecx
leaq (%rcx,%rcx,4), %rcx
movl 0x10(%r15,%rcx,8), %ecx
addq %rcx, %rax
incq %r8
cmpq %r8, %r12
jne 0x14cc8b
incq %r10
incq %rbx
cmpq %r9, %rbx
jne 0x14cc4c
testq %r10, %r10
je 0x14cccf
addq %rax, %rax
leaq (%rax,%rax,2), %rax
xorl %edx, %edx
divq %r10
jmp 0x14ccd6
movq $-0x1, %rax
jmp 0x14cd87
movq $-0x1, %rax
testq %r9, %r9
je 0x14cd87
movq 0x18(%rdi), %rdx
movq 0x28(%rsi), %rcx
movq 0x40(%rsi), %r10
addq $0x8, %rcx
movq %rcx, -0x8(%rsp)
movq 0xb8(%rsi), %rcx
movq 0x20(%rcx), %rsi
xorl %r11d, %r11d
xorl %ebx, %ebx
xorl %r14d, %r14d
movq (%rdx,%r14,8), %r15
shrq $0x21, %r15
movl (%r10,%r15,4), %r8d
movl 0x4(%r10,%r15,4), %ecx
subl %r8d, %ecx
addl $-0x2, %ecx
je 0x14cd56
movq -0x8(%rsp), %rdi
leaq (%rdi,%r8,4), %r13
movq -0x10(%rsp), %rdi
movq 0x10(%rdi), %rbp
movl %ecx, %r8d
xorl %ecx, %ecx
xorl %r12d, %r12d
movl (%r13,%rcx,4), %edi
shrl %edi
leaq (%rdi,%rdi,4), %rdi
movl 0x10(%rbp,%rdi,8), %edi
addq %rdi, %r12
incq %rcx
cmpq %rcx, %r8
jne 0x14cd3a
jmp 0x14cd59
xorl %r12d, %r12d
cmpb $0x2, 0x4(%rsi,%r15,8)
jne 0x14cd74
cmpq %rax, %r12
jb 0x14cd74
addq %r12, %rbx
movq -0x18(%rsp), %rcx
movq %rbx, 0x8(%rcx)
jmp 0x14cd7f
addq %r12, %r11
movq -0x18(%rsp), %rcx
movq %r11, (%rcx)
incq %r14
cmpq %r9, %r14
jne 0x14cd07
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x14d456
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 0x14d44c
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 0x14d434
incq %r9
cmpq %rcx, %r9
jne 0x14d40a
jmp 0x14d458
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x150f56
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 0xe0780(%rip), %xmm1    # 0x231638
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 0xe0434(%rip), %xmm2    # 0x231310
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %ebp, %ebp
cmpl $0x0, (%r10)
js 0x150f1b
incl %ebp
movl -0x4(%r10), %r14d
xorl %esi, %r14d
cmpl $0x1, %r14d
jne 0x150f03
movsd (%rdx,%r11,8), %xmm2
movl %r11d, %r9d
jmp 0x150f1b
movsd (%rdx,%r11,8), %xmm3
cmpl $-0x1, %ebx
je 0x150f14
ucomisd %xmm1, %xmm3
jbe 0x150f1b
movl %r11d, %ebx
movapd %xmm3, %xmm1
incq %r11
addq $0x18, %r10
cmpq %r11, %rdi
jne 0x150ee3
cmpl $0x2, %ebp
jb 0x150f56
cmpl $-0x1, %ebx
sete %dl
cmpl $-0x1, %r9d
sete %sil
xorl %eax, %eax
orb %dl, %sil
jne 0x150f56
movl %ebx, %edx
cmpl %r8d, (%rcx,%rdx,4)
jbe 0x150f56
mulsd %xmm0, %xmm2
xorl %eax, %eax
ucomisd %xmm2, %xmm1
seta %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x151bce
retq
movq %rdx, %rax
orq %rcx, %rax
je 0x151c15
testq %rdx, %rdx
je 0x151c3f
movq 0x10(%rdx), %rax
movl %edi, %edi
movl (%rax,%rdi,4), %r10d
xorl %r8d, %r8d
testl %r10d, 0x18(%rdx)
setne %r9b
movl 0x1c(%rdx), %eax
andl %r10d, %eax
xorl %edi, %edi
negl %eax
sbbl %edi, %edi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r10d, 0x20(%rdx)
jne 0x151bcd
movb %r9b, %r8b
leal (%r8,%r8,2), %eax
addl $-0x2, %eax
orl %eax, %edi
jmp 0x151c43
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r8, %r8
je 0x151bcd
shlq $0x5, %rdi
movl (%r8,%rdi), %ecx
testl %ecx, %ecx
je 0x151bcd
shlq $0x5, %rsi
movl (%r8,%rsi), %edx
testl %edx, %edx
je 0x151bcd
xorl %eax, %eax
testl %ecx, %edx
setne %al
retq
movsbl (%rcx,%rdi), %edi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x1, %edi
je 0x151c56
cmpl $-0x1, %edi
jne 0x151bcd
testq %rdx, %rdx
je 0x151c94
movq 0x10(%rdx), %rcx
movl %esi, %esi
movl (%rcx,%rsi,4), %r9d
xorl %esi, %esi
testl %r9d, 0x18(%rdx)
setne %r8b
movl 0x1c(%rdx), %r10d
andl %r9d, %r10d
xorl %ecx, %ecx
negl %r10d
sbbl %ecx, %ecx
testl %r9d, 0x20(%rdx)
jne 0x151bcd
movb %r8b, %sil
leal (%rsi,%rsi,2), %edx
addl $-0x2, %edx
orl %edx, %ecx
jmp 0x151c98
movsbl (%rcx,%rsi), %ecx
cmpl $0x1, %ecx
je 0x151ca6
cmpl $-0x1, %ecx
jne 0x151bcd
xorl %eax, %eax
cmpl %ecx, %edi
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl %edx, %esi
je 0x15283c
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
xorl %ecx, %ecx
callq 0x144201
testq %rax, %rax
je 0x152837
movsd 0x8(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl %ebp, %r15d
jne 0x152805
movsd 0x8(%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_related_weight(unsigned int, H_partition*, double*, double*, unsigned int*)
uint32_t get_related_weight(uint32_t x, H_partition* hap, double* w0, double* w1, uint32_t* hap_label)
{
    (*w0) = (*w1) = 0;
    if(x >= hap->link->a.n) return 0;
    uint32_t i, a_n = hap->link->a.a[x].e.n, occ;
    hc_edge* a = hap->link->a.a[x].e.a;
    for (i = occ = 0; i < a_n; i++)
    {
        if(a[i].del) continue;
        if(hap_label && (!is_hap_set_label(a[i].uID, *hap, *hap_label))) continue;
        if(is_hap_set(a[i].uID, *hap)) occ++;
        if((hap->hap[a[i].uID] & hap->m[0])) (*w0)+= a[i].weight;
        if((hap->hap[a[i].uID] & hap->m[1])) (*w1)+= a[i].weight;
    }
    return occ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r9
xorl %eax, %eax
movq %rax, (%rcx)
movq %rax, (%rdx)
movl %edi, %edi
movq 0x30(%rsi), %rcx
cmpq %rdi, (%rcx)
jbe 0x15292c
movq 0x10(%rcx), %rcx
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
movl (%rcx,%rdi), %r10d
testq %r10, %r10
je 0x15292c
movq 0x10(%rcx,%rdi), %rdi
shlq $0x3, %r10
leaq (%r10,%r10,4), %r10
xorl %r11d, %r11d
xorl %eax, %eax
cmpb $0x0, 0x18(%rdi,%r11)
js 0x15291f
movq 0x10(%rsi), %rcx
movl 0x8(%rdi,%r11), %ebx
movl (%rcx,%rbx,4), %ebx
movl 0x18(%rsi), %r14d
movl 0x1c(%rsi), %ebp
testq %r8, %r8
je 0x1528e4
movl %ebp, %ecx
orl %r14d, %ecx
movl 0x20(%rsi), %r15d
orl %r15d, %ecx
testl %ebx, %ecx
je 0x15291f
movb 0x2c(%rsi), %cl
movl %ebx, %r12d
shrl %cl, %r12d
movl (%r8), %r13d
shrl %cl, %r13d
cmpl %r13d, %r12d
je 0x1528e8
jmp 0x15291f
movl 0x20(%rsi), %r15d
orl %r14d, %r15d
orl %ebp, %r15d
andl %ebx, %r15d
cmpl $0x1, %r15d
sbbl $-0x1, %eax
testl %ebx, %r14d
je 0x15290b
movsd (%rdi,%r11), %xmm0
addsd (%rdx), %xmm0
movsd %xmm0, (%rdx)
testl %ebx, %ebp
je 0x15291f
movsd (%rdi,%r11), %xmm0
addsd (%r9), %xmm0
movsd %xmm0, (%r9)
addq $0x28, %r11
cmpq %r11, %r10
jne 0x15289e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: reset_ambiguous_label(H_partition*, unsigned char*, unsigned int)
void reset_ambiguous_label(H_partition* hap, uint8_t* hap_label_flag, uint32_t uID)
{
    uint32_t hap_label = (uint32_t)-1;
    if(get_weightest_hap_label_from_uid(uID, hap, hap_label_flag, &hap_label, NULL)>0)
    {
        double cur_w0, cur_w1;
        get_related_weight(uID, hap, &cur_w0, &cur_w1, &hap_label);
        if(cur_w0 >= cur_w1)
        {
            hap->hap[uID] |= (hap_label | hap->m[0]);
        }
        else
        {
            hap->hap[uID] |= (hap_label | hap->m[1]);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x4(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movl %ebp, %r14d
movq %r14, %rdi
movq %rbx, %rsi
xorl %r8d, %r8d
callq 0x1532f8
testl %eax, %eax
je 0x153cb5
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x4(%rsp), %r13
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x15284f
movsd (%r15), %xmm0
xorl %eax, %eax
ucomisd (%r12), %xmm0
setb %al
movl 0x18(%rbx,%rax,4), %eax
orl (%r13), %eax
movq 0x10(%rbx), %rcx
orl %eax, (%rcx,%r14,4)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_unset_com(H_partition*, bubble_type*, ma_ug_t*, unsigned char*, unsigned int*)
uint32_t get_unset_com(H_partition* hap, bubble_type* bub, ma_ug_t *ug, uint8_t* hap_label_flag, uint32_t* max_hap_label)
{
    uint32_t max_i = get_available_com(hap, bub, ug, 1, 1, hap_label_flag, max_hap_label);

    if(max_i == (uint32_t)-1)
    {
        max_i = get_available_com(hap, bub, ug, 1, 0, hap_label_flag, max_hap_label);
        if(max_i != (uint32_t)-1)
        {
            hap->label += hap->label_add;
            (*max_hap_label) = hap->label;
        }
    }

    return max_i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movq %r8, (%rsp)
movl $0x1, %ecx
movl $0x1, %r8d
movq %r15, %r9
callq 0x15376f
cmpl $-0x1, %eax
jne 0x153d33
movq %rbx, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x15376f
cmpl $-0x1, %eax
je 0x153d2e
movl 0x24(%r14), %ecx
addl 0x28(%r14), %ecx
movl %ecx, 0x24(%r14)
movl %ecx, (%rbx)
jmp 0x153d33
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: phase_com(H_partition*, ma_ug_t*, bub_p_t_warp*, bubble_type*, unsigned int, unsigned int)
void phase_com(H_partition* hap, ma_ug_t *ug, bub_p_t_warp* b, bubble_type* bub, uint32_t bid, uint32_t max_hap_label)
{
    
    if((bid & 1) == 0) ///bubble
    {
        uint32_t beg = (uint32_t)-1, sink = (uint32_t)-1, n, *a;
        get_bubbles(bub, bid>>1, &beg, &sink, &a, &n, NULL);
        ///fprintf(stderr, "+bubble-%uth, beg: %u, sink: %u, phasing ID: %u\n", bid>>1, beg>>1, sink>>1, hap->label>>3);
        b->exist_hap_label = (uint32_t)-1;
        get_phase_path(ug, beg, sink, b, hap, max_hap_label);
        get_phase_path(ug, beg, sink, b, hap, max_hap_label);
        ///fprintf(stderr, "-bubble-%uth, beg: %u, sink: %u, phasing ID: %u\n", bid>>1, beg>>1, sink>>1, hap->label>>3);
    }
    else
    {
        double cur_w0, cur_w1;
        get_related_weight(bid>>1, hap, &cur_w0, &cur_w1, &max_hap_label);
        ///fprintf(stderr, "utg-%uth, phasing ID: %u\n", bid>>1, hap->label>>3);
        if(cur_w0 >= cur_w1)
        {
            hap->hap[bid>>1] |= (max_hap_label | hap->m[0]);
        }
        else
        {
            hap->hap[bid>>1] |= (max_hap_label | hap->m[1]);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebx
movl %r8d, %r15d
movq %rdi, %r14
movl %r9d, 0x4(%rsp)
testb $0x1, %r15b
jne 0x153db6
movq %rdx, %r12
movq %rsi, %r13
shrl %r15d
movq 0x28(%rcx), %rax
movq 0x40(%rcx), %rcx
movl (%rcx,%r15,4), %ecx
movl (%rax,%rcx,4), %ebp
movl $0xffffffff, 0x68(%rdx) # imm = 0xFFFFFFFF
movq %rsi, %rdi
movl %ebp, %esi
movq %rdx, %rcx
movq %r14, %r8
movl %ebx, %r9d
callq 0x152a42
movq %r13, %rdi
movl %ebp, %esi
movq %r12, %rcx
movq %r14, %r8
movl %ebx, %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x152a42
shrl %r15d
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x4(%rsp), %r8
movl %r15d, %edi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x15284f
movsd (%r12), %xmm0
xorl %eax, %eax
ucomisd (%r13), %xmm0
setb %al
movq 0x10(%r14), %rcx
movl 0x18(%r14,%rax,4), %eax
orl (%rcx,%r15,4), %eax
orl %ebx, %eax
movl %eax, (%rcx,%r15,4)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_cluster_weight(H_partition*, hc_links*, unsigned int*, unsigned int)
double get_cluster_weight(H_partition* hap, hc_links* link, uint32_t *h, uint32_t h_n)
{
    int o_d = 0;
    double weight = 0;
    uint32_t j, k, m;
    for (j = 0, weight = 0; j < h_n; j++)
    {
        for (k = 0; k < link->a.a[h[j]].e.n; k++)
        {
            if(link->a.a[h[j]].e.a[k].del) continue;
            for (m = 0; m < h_n; m++)
            {
                if(h[m] == link->a.a[h[j]].e.a[k].uID) break;
            }
            if(m < h_n) continue;

            o_d = get_phase_status(hap, link->a.a[h[j]].e.a[k].uID);
            if(o_d < -1) continue;
            ///if(o_d < -1) fprintf(stderr, "ERROR\n");
            weight += (o_d*link->a.a[h[j]].e.a[k].weight);
        }
    }

    return weight;
}

// Assembly:
testl %ecx, %ecx
je 0x153edb
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rsi), %rax
movl %ecx, %ecx
xorpd %xmm0, %xmm0
xorl %esi, %esi
xorl %r8d, %r8d
movl (%rdx,%r8,4), %r9d
leaq (%r9,%r9,2), %r10
shlq $0x4, %r10
movq (%rax,%r10), %r9
testq %r9, %r9
je 0x153ec8
addq %rax, %r10
movq 0x10(%r10), %r10
xorl %r11d, %r11d
leaq (%r11,%r11,4), %rbx
cmpb $0x0, 0x18(%r10,%rbx,8)
js 0x153ebd
movl 0x8(%r10,%rbx,8), %ebp
xorl %r14d, %r14d
cmpl %ebp, (%rdx,%r14,4)
je 0x153ebd
incq %r14
cmpq %r14, %rcx
jne 0x153e60
movl 0x8(%r10,%rbx,8), %r14d
movq 0x10(%rdi), %r15
movl (%r15,%r14,4), %r14d
xorl %r15d, %r15d
testl %r14d, 0x18(%rdi)
setne %r15b
movl 0x1c(%rdi), %ebp
andl %r14d, %ebp
negl %ebp
movl $0x0, %ebp
sbbl %ebp, %ebp
leal (%r15,%r15,2), %r15d
addl $-0x2, %r15d
orl %r15d, %ebp
testl %r14d, 0x20(%rdi)
cmovnel %esi, %ebp
cmpl $-0x1, %ebp
jl 0x153ebd
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
mulsd (%r10,%rbx,8), %xmm1
addsd %xmm1, %xmm0
incq %r11
movl %r11d, %ebx
cmpq %rbx, %r9
ja 0x153e4c
incq %r8
cmpq %rcx, %r8
jne 0x153e29
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_cluster_inner_weight(H_partition*, hc_links*, unsigned int*, unsigned int, unsigned int*, unsigned int)
double get_cluster_inner_weight(H_partition* hap, hc_links* link, uint32_t *h0, uint32_t h0_n, 
uint32_t *h1, uint32_t h1_n)
{
    double weight = 0;
    uint32_t j, k, m;
    for (j = 0, weight = 0; j < h0_n; j++)
    {
        for (k = 0; k < link->a.a[h0[j]].e.n; k++)
        {
            if(link->a.a[h0[j]].e.a[k].del) continue;
            for (m = 0; m < h1_n; m++)
            {
                if(h1[m] == link->a.a[h0[j]].e.a[k].uID) break;
            }
            if(m == h1_n) continue;

            weight += link->a.a[h0[j]].e.a[k].weight;
        }
    }

    return weight * 2;
}

// Assembly:
testl %ecx, %ecx
je 0x153f6f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rsi), %rax
movl %ecx, %ecx
movl %r9d, %esi
xorpd %xmm0, %xmm0
xorl %edi, %edi
movl (%rdx,%rdi,4), %r10d
leaq (%r10,%r10,2), %r11
shlq $0x4, %r11
movq (%rax,%r11), %r10
testq %r10, %r10
je 0x153f5c
addq %rax, %r11
movq 0x10(%r11), %r11
xorl %ebx, %ebx
leaq (%rbx,%rbx,4), %r14
cmpb $0x0, 0x18(%r11,%r14,8)
js 0x153f51
testl %r9d, %r9d
je 0x153f43
movl 0x8(%r11,%r14,8), %ebp
xorl %r15d, %r15d
cmpl %ebp, (%r8,%r15,4)
je 0x153f46
incq %r15
cmpq %r15, %rsi
jne 0x153f33
jmp 0x153f51
xorl %r15d, %r15d
cmpl %r9d, %r15d
je 0x153f51
addsd (%r11,%r14,8), %xmm0
incq %rbx
movl %ebx, %r14d
cmpq %r14, %r10
ja 0x153f1a
incq %rdi
cmpq %rcx, %rdi
jne 0x153efc
addsd %xmm0, %xmm0
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: update_partition_flag(H_partition*, G_partition*, hc_links*, unsigned int)
void update_partition_flag(H_partition* h, G_partition* g_p, hc_links* link, uint32_t id)
{
    uint32_t k, *h0, h0_n, *h1, h1_n, uID, flag = 0;
    int status;
    get_phased_block(g_p, NULL, id, NULL, NULL, &h0, &h0_n, &h1, &h1_n, NULL, NULL);

    status = g_p->a[id].status[0];
    if(status == 1) flag = h->m[0];
    else if(status == -1) flag = h->m[1];
    else if(status == 0) flag = h->m[2];
    else if(status == -2) flag = 0;
    for (k = 0; k < h0_n; k++)
    {
        uID = h0[k];
        h->hap[uID] >>= 3;
        h->hap[uID] <<= 3;
        h->hap[uID] |= flag;
    }

    status = g_p->a[id].status[1];
    if(status == 1) flag = h->m[0];
    else if(status == -1) flag = h->m[1];
    else if(status == 0) flag = h->m[2];
    else if(status == -2) flag = 0;
    for (k = 0; k < h1_n; k++)
    {
        uID = h1[k];
        h->hap[uID] >>= 3;
        h->hap[uID] <<= 3;
        h->hap[uID] |= flag;
    }
}

// Assembly:
movl %ecx, %eax
movq 0x10(%rsi), %rsi
leaq (%rax,%rax,8), %r8
movq 0x10(%rsi,%r8,8), %r9
movl 0x18(%rsi,%r8,8), %r10d
testq %r10, %r10
leaq (%r9,%r10,4), %rax
movl 0x1c(%rsi,%r8,8), %ecx
cmoveq %r10, %r9
testq %rcx, %rcx
cmoveq %rcx, %rax
movl 0x24(%rsi,%r8,8), %r11d
cmpl $-0x1, %r11d
je 0x153fc0
testl %r11d, %r11d
je 0x153fbb
xorl %edx, %edx
cmpl $0x1, %r11d
jne 0x153fc3
movl 0x18(%rdi), %edx
jmp 0x153fc3
movl 0x20(%rdi), %edx
jmp 0x153fc3
movl 0x1c(%rdi), %edx
pushq %rbp
pushq %r14
pushq %rbx
testq %r10, %r10
je 0x153feb
movq 0x10(%rdi), %r11
xorl %ebx, %ebx
movl (%r9,%rbx,4), %r14d
movl (%r11,%r14,4), %ebp
andl $-0x8, %ebp
orl %edx, %ebp
movl %ebp, (%r11,%r14,4)
incq %rbx
cmpq %rbx, %r10
jne 0x153fd2
movl 0x28(%rsi,%r8,8), %esi
addl $0x2, %esi
cmpl $0x3, %esi
ja 0x154019
leaq 0xe727d(%rip), %rdx     # 0x23b27c
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
xorl %edx, %edx
jmp 0x154019
movl 0x20(%rdi), %edx
jmp 0x154019
movl 0x18(%rdi), %edx
jmp 0x154019
movl 0x1c(%rdi), %edx
testq %rcx, %rcx
je 0x15403f
movq 0x10(%rdi), %rsi
xorl %edi, %edi
movl (%rax,%rdi,4), %r8d
movl (%rsi,%r8,4), %r9d
andl $-0x8, %r9d
orl %edx, %r9d
movl %r9d, (%rsi,%r8,4)
incq %rdi
cmpq %rdi, %rcx
jne 0x154024
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: if_flip(H_partition*, G_partition*, hc_links*, bubble_type*, unsigned int)
uint32_t if_flip(H_partition* h, G_partition* g_p, hc_links* link,  
bubble_type* bub, uint32_t gid)
{
    double weight = 0;
    if(h->lock[gid]) return 0;
    if(g_p->a[gid].h[0] > 0 && (g_p->a[gid].status[0] == 1 || g_p->a[gid].status[0] == -1))
    {
        weight += (g_p->a[gid].weight[0] * g_p->a[gid].status[0]);
    }

    if(g_p->a[gid].h[1] > 0 && (g_p->a[gid].status[1] == 1 || g_p->a[gid].status[1] == -1))
    {
        weight += (g_p->a[gid].weight[1] * g_p->a[gid].status[1]);
    }
    weight += g_p->a[gid].weight_convex*2;
    if(weight >= 0) return 0;
    return 1;
}

// Assembly:
movq 0x8(%rdi), %rdx
movl %r8d, %ecx
xorl %eax, %eax
cmpb $0x0, (%rdx,%rcx)
je 0x154b82
retq
movq 0x10(%rsi), %rax
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,8), %rdx
xorpd %xmm0, %xmm0
cmpl $0x0, 0x18(%rdx)
je 0x154bb2
movl 0x24(%rdx), %esi
cmpl $0x1, %esi
je 0x154ba5
cmpl $-0x1, %esi
jne 0x154bb2
cvtsi2sd %esi, %xmm1
mulsd 0x30(%rdx), %xmm1
addsd %xmm1, %xmm0
cmpl $0x0, 0x1c(%rdx)
je 0x154bd5
movl 0x28(%rdx), %esi
cmpl $0x1, %esi
je 0x154bc5
cmpl $-0x1, %esi
jne 0x154bd5
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
mulsd 0x38(%rdx), %xmm1
addsd %xmm1, %xmm0
movsd 0x40(%rax,%rcx,8), %xmm1
addsd %xmm1, %xmm1
addsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setb %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: merge_phase_group_by_chain(H_partition*, G_partition*, bubble_type*, unsigned int)
void merge_phase_group_by_chain(H_partition* hap, G_partition* g_p, bubble_type* bub, uint32_t chain_id)
{
    uint32_t i, k;
    uint32_t beg, sink, *a, n, pre_id, hap_label_id;
    uint64_t bid, uid;
    ma_utg_t *u = &(bub->b_ug->u.a[chain_id]);
    
    for (i = 0, pre_id = (uint32_t)-1; i < u->n; i++)
    {
        // fprintf(stderr, "inner i: %u, u->n: %u\n", i, (uint32_t)u->n);
        bid = u->a[i]>>33; ///here is a bubble
        // fprintf(stderr, "bid: %lu\n", bid);
        get_bubbles(bub, bid, &beg, &sink, &a, &n, NULL);
        for (k = 0; k < n; k++)
        {
            // fprintf(stderr, "k: %u, n: %u\n", k, n);
            uid = a[k]>>1;
            // fprintf(stderr, "uid: %lu\n", uid);
            if(g_p->index[uid] == (uint32_t)-1) ///mean this unitig doesn't have hap label
            {
                pre_id = (uint32_t)-1;
                continue;
            }
            hap_label_id = g_p->index[uid]>>1;
            // fprintf(stderr, "hap_label_id: %u, hap->n: %lu\n", hap_label_id, hap->n);
            if(hap_label_id == pre_id) continue;
            pre_id = hap_label_id;
            if(hap->lock[hap_label_id] == 1) continue;
            if(if_flip(hap, g_p, hap->link, bub, hap_label_id))
            {
                // fprintf(stderr, "2222222222\n");
                flip_unitig(g_p, hap->link, bub, hap_label_id);
                ///debug_flip(g_p, hap->link, bub, hap_label_id);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq 0xc0(%rdx), %rax
movq 0x10(%rax), %rax
movl %ecx, %ecx
leaq (%rcx,%rcx,4), %rsi
movl 0x10(%rax,%rsi,8), %ecx
testl %ecx, %ecx
je 0x154da8
movq %rdi, %r15
leaq (%rax,%rsi,8), %r9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r10d, %r10d
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movq %rdx, 0x8(%rsp)
movq %r9, (%rsp)
movq 0x18(%r9), %rsi
movq (%rsi,%r10,8), %r8
movq 0x40(%rdx), %rdi
shrq $0x21, %r8
movl (%rdi,%r8,4), %esi
movl 0x4(%rdi,%r8,4), %edi
subl %esi, %edi
addl $-0x2, %edi
je 0x154d9a
movq %r10, 0x10(%rsp)
movq 0x28(%rdx), %rcx
leaq (%rcx,%rsi,4), %r13
addq $0x8, %r13
movl %edi, %ebp
xorl %ebx, %ebx
movl (%r13,%rbx,4), %ecx
shrl %ecx
movq 0x18(%r14), %rdx
movl (%rdx,%rcx,4), %r12d
cmpq %r11, %r12
je 0x154d4f
shrl %r12d
cmpl %eax, %r12d
je 0x154d80
movq 0x8(%r15), %rax
cmpb $0x1, (%rax,%r12)
jne 0x154d56
movl %r12d, %eax
jmp 0x154d80
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x154d80
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %r8d
callq 0x154b72
testl %eax, %eax
je 0x154d77
movq 0x30(%r15), %rsi
movq %r14, %rdi
movl %r12d, %ecx
callq 0x154db7
movl %r12d, %eax
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
incq %rbx
cmpq %rbx, %rbp
jne 0x154d23
movq (%rsp), %r9
movl 0x10(%r9), %ecx
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %r10
incq %r10
movl %ecx, %esi
cmpq %rsi, %r10
jb 0x154cea
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: set_bubble(H_partition*, G_partition*, bubble_type*, block_phase_type*, unsigned long)
void set_bubble(H_partition* hap, G_partition* g_p, bubble_type* bub, block_phase_type* block, 
uint64_t bid)
{
    uint32_t beg, sink, k, uid, *a, n, gid;
    block->weight = 0;
    get_bubbles(bub, bid, &beg, &sink, &a, &n, NULL);
    for (k = 0; k < n; k++)
    {
        uid = a[k]>>1;
        if(g_p->index[uid] == (uint32_t)-1) continue;
        gid = g_p->index[uid]>>1;
        block->vis.a[gid] = 1;
    }
}

// Assembly:
movq $0x0, 0x18(%rcx)
movq 0x40(%rdx), %rdi
movl (%rdi,%r8,4), %eax
movl 0x4(%rdi,%r8,4), %edi
subl %eax, %edi
addl $-0x2, %edi
je 0x155059
movq 0x28(%rdx), %rdx
leaq (%rdx,%rax,4), %rax
addq $0x8, %rax
movl %edi, %edx
xorl %edi, %edi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl (%rax,%rdi,4), %r9d
shrl %r9d
movq 0x18(%rsi), %r10
movl (%r10,%r9,4), %r9d
cmpq %r8, %r9
je 0x155051
shrl %r9d
movq 0x10(%rcx), %r10
movb $0x1, (%r10,%r9)
incq %rdi
cmpq %rdi, %rdx
jne 0x155031
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_total_weight(H_partition*, G_partition*)
double get_total_weight(H_partition* h, G_partition* g_p)
{
    uint32_t i, k, uID;
    hc_links* link = h->link;
    int o_d = 0, o_f = 0;
    double w, t_w;
    for (i = 0, t_w = 0; i < h->n; i++)
    {
        if(g_p->index[i] == (uint32_t)-1) continue;
        o_f = g_p->a[g_p->index[i]>>1].status[g_p->index[i]&1];
        for (k = 0; k < link->a.a[i].e.n; k++)
        {
            if(link->a.a[i].e.a[k].del) continue;
            uID = link->a.a[i].e.a[k].uID;
            w = link->a.a[i].e.a[k].weight;
            if(g_p->index[uID] == (uint32_t)-1) continue;
            o_d = g_p->a[g_p->index[uID]>>1].status[g_p->index[uID]&1];
            t_w += (o_f*o_d*w);
        }
    }

    return t_w;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x155a95
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x30(%rdi), %rcx
movq 0x18(%rsi), %rdx
xorpd %xmm0, %xmm0
xorl %edi, %edi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl (%rdx,%rdi,4), %r11d
cmpq %r8, %r11
je 0x155a7f
movq 0x10(%rcx), %rbx
leaq (%rdi,%rdi,2), %r14
shlq $0x4, %r14
movq (%rbx,%r14), %r9
testq %r9, %r9
je 0x155a7f
movq 0x10(%rsi), %r10
movl %r11d, %r15d
shrl %r15d
andl $0x1, %r11d
leaq (%r15,%r15,8), %r15
leaq (%r10,%r15,8), %r15
movl 0x24(%r15,%r11,4), %r11d
addq %r14, %rbx
movq 0x10(%rbx), %rbx
movl $0x1, %ebp
cmpb $0x0, 0x18(%rbx)
js 0x155a71
movl 0x8(%rbx), %r14d
movl (%rdx,%r14,4), %r14d
cmpq %r8, %r14
je 0x155a71
movl %r14d, %r15d
shrl %r15d
andl $0x1, %r14d
leaq (%r15,%r15,8), %r15
leaq (%r10,%r15,8), %r15
movl 0x24(%r15,%r14,4), %r14d
imull %r11d, %r14d
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
mulsd (%rbx), %xmm1
addsd %xmm1, %xmm0
movl %ebp, %r14d
addq $0x28, %rbx
incl %ebp
cmpq %r14, %r9
ja 0x155a33
incq %rdi
movl %edi, %r9d
cmpq %r9, %rax
ja 0x1559ea
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: hap_label_fliping(H_partition*, G_partition*, bubble_type*, hc_links*, unsigned int)
void hap_label_fliping(H_partition* hap, G_partition* g_p, bubble_type* bub, hc_links* link, uint32_t chain_id)
{
    long long c_bid, c_uid, l_bid, l_uid;
    uint32_t gid;
    ma_utg_t *u = &(bub->b_ug->u.a[chain_id]);
    hap->b.bid = hap->b.uid = 0;
    while (1)
    {
        gid = next_hap_label_id(&(hap->b), g_p, bub, u, 1, &c_bid, &c_uid);
        if(gid == (uint32_t)-1) break;
        identify_best_interval(&(hap->b), hap->lock, g_p, bub, u, link, c_bid, c_uid, &l_bid, &l_uid);
        if(l_bid == -1 || l_uid == -1) continue;
        
        // fprintf(stderr, "\nbefore weight: %f\n", get_total_weight(hap, g_p));
        // identify_best_interval_debug(&(hap->b), g_p, bub, u, link, c_bid, c_uid, &l_bid, &l_uid);
        if(flip_block(&(hap->b), g_p, bub, u, link, hap->lock, c_bid, c_uid, l_bid, l_uid))
        {
            ///fprintf(stderr, "after weight +: %f\n", get_total_weight(hap, g_p));
            hap->b.bid = l_bid;
            hap->b.uid = l_uid;
            gid = next_hap_label_id(&(hap->b), g_p, bub, u, 1, &c_bid, &c_uid);
            if(gid == (uint32_t)-1) break;
        }
        ///fprintf(stderr, "after weight -: %f\n", get_total_weight(hap, g_p));
        // exit(0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x20(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq 0xc0(%rdx), %rax
movl %r8d, %ecx
leaq (%rcx,%rcx,4), %r12
shlq $0x3, %r12
addq 0x10(%rax), %r12
leaq 0x90(%rdi), %rbp
xorps %xmm0, %xmm0
movq %rdi, 0x18(%rsp)
movups %xmm0, 0xb0(%rdi)
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
leaq 0x18(%rsp), %r9
movq %rbp, %rdi
movq %r12, %rcx
movl $0x1, %r8d
pushq %rax
callq 0x15505a
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x155bf7
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbp, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %r12, %r8
movq 0x20(%rsp), %r9
leaq 0x28(%rsp), %rax
pushq %rax
leaq 0x38(%rsp), %rax
pushq %rax
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x1553fd
addq $0x20, %rsp
movq 0x30(%rsp), %rbx
cmpq $-0x1, %rbx
sete %al
movq 0x28(%rsp), %r13
cmpq $-0x1, %r13
sete %cl
orb %al, %cl
jne 0x155bd2
movq 0x18(%rsp), %rax
movq 0x8(%rax), %r9
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq 0x20(%rsp), %r8
pushq %r13
pushq %rbx
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x155809
addq $0x20, %rsp
testl %eax, %eax
je 0x155bd2
movq 0x18(%rsp), %rax
movq %rbx, 0xb0(%rax)
movq %r13, 0xb8(%rax)
subq $0x8, %rsp
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movl $0x1, %r8d
leaq 0x18(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
callq 0x15505a
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x155bf7
subq $0x8, %rsp
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movl $0x1, %r8d
leaq 0x18(%rsp), %r9
leaq 0x10(%rsp), %rax
jmp 0x155af8
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/hic.cpp
// Function: shift_block_phase_type(ma_utg_t*, G_partition*, bubble_type*, block_phase_type*, unsigned int)
uint32_t shift_block_phase_type(ma_utg_t *u, G_partition* g_p, bubble_type* bub, 
block_phase_type* b, uint32_t offset)
{
    long long c_bid, c_uid;
    uint32_t gid, occ = 0;
    b->bid = b->uid = 0;
    while (1)
    {
        if(occ == offset) break;
        gid = next_hap_label_id(b, g_p, bub, u, 1, &c_bid, &c_uid);
        if(gid == (uint32_t)-1) break;
        occ++;
    }
    return occ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rcx)
testl %r8d, %r8d
je 0x155c65
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
leaq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
movl $0x1, %r8d
leaq 0x10(%rsp), %r9
callq 0x15505a
cmpl $-0x1, %eax
je 0x155c67
incl %ebp
cmpl %ebp, %ebx
jne 0x155c31
movl %ebx, %ebp
jmp 0x155c67
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_block_phase_type(unsigned long*, G_partition*, bubble_type*, unsigned int, block_phase_type*)
void get_block_phase_type(uint64_t* chain_idx, G_partition* g_p, bubble_type* bub, uint32_t id, block_phase_type* i_b)
{
    uint64_t i;
    ma_utg_t *u = NULL;
    for (i = 0; i < bub->chain_weight.n; i++)
    {
        if(id >= chain_idx[i] && id < chain_idx[i+1]) break;
    }

    u = &(bub->b_ug->u.a[bub->chain_weight.a[i].id]);
    shift_block_phase_type(u, g_p, bub, i_b, id - chain_idx[i]);
    i_b->chainID = bub->chain_weight.a[i].id;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r8, %rbx
movl %ecx, %r8d
movq %rdx, %r14
movq 0xc8(%rdx), %rax
testq %rax, %rax
je 0x155cb1
movl %r8d, %edx
xorl %ecx, %ecx
cmpq %rdx, (%rdi,%rcx,8)
ja 0x155ca4
cmpq %rdx, 0x8(%rdi,%rcx,8)
ja 0x155cb3
incq %rcx
cmpq %rcx, %rax
jne 0x155c97
movq %rax, %rcx
jmp 0x155cb3
xorl %ecx, %ecx
movq 0xc0(%r14), %rdx
movq 0xd8(%r14), %rax
movq %rcx, %r15
shlq $0x5, %r15
movq 0x10(%rax,%r15), %rax
leaq (%rax,%rax,4), %rax
shlq $0x3, %rax
addq 0x10(%rdx), %rax
subl (%rdi,%rcx,8), %r8d
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x155c06
movq 0xd8(%r14), %rax
movq 0x10(%rax,%r15), %rax
movq %rax, 0x30(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: init_mul_block_phase_type(mul_block_phase_type*, G_partition*, bubble_type*, unsigned int, H_partition*)
void init_mul_block_phase_type(mul_block_phase_type* x, G_partition* g_p, bubble_type* bub, uint32_t n_thread, H_partition* hap)
{
    ma_utg_t *u = NULL;
    uint32_t i, n;
    block_phase_type b;
    x->bub = bub;
    x->n_thread = n_thread;
    CALLOC(x->res, x->n_thread);
    CALLOC(x->x, x->n_thread);
    for (i = 0; i < x->n_thread; i++)
    {
        kv_init(x->x[i].vis);
        kv_malloc(x->x[i].vis, hap->n); 
        x->x[i].vis.n = hap->n;
    }

    x->chain_idx_n = 0;
    MALLOC(x->chain_idx, bub->chain_weight.n+1);
    for (i = n = 0; i < bub->chain_weight.n; i++)
    {
        x->chain_idx[i] = n;
        if(bub->chain_weight.a[i].del) continue;
        u = &(bub->b_ug->u.a[bub->chain_weight.a[i].id]);
        n += shift_block_phase_type(u, g_p, bub, &b, (uint32_t)-1);
        x->chain_idx_n++;
    }
    x->chain_idx[i] = n;///index of chain
    x->chain_ele_occ = n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r14
movl %ecx, %r13d
movq %rdx, %r15
movq %rsi, 0x18(%rsp)
movq %rdi, %rbx
movq %rdx, 0x10(%rdi)
movl %ecx, 0x8(%rdi)
movl %ecx, %ebp
movl $0x38, %esi
movq %rbp, %rdi
callq 0x2120
movq %rax, 0x30(%rbx)
movl $0x38, %esi
movq %rbp, %rdi
callq 0x2120
movq %rbx, 0x8(%rsp)
movq %rax, (%rbx)
testl %r13d, %r13d
je 0x155d8d
movq %rax, %r12
movq (%r14), %r13
addq $0x10, %r12
imulq $0x38, %rbp, %rbx
xorl %r14d, %r14d
xorps %xmm0, %xmm0
movups %xmm0, -0x8(%r12,%r14)
movq %r13, -0x8(%r12,%r14)
movq %r13, %rdi
callq 0x2280
movq %rax, (%r12,%r14)
movq %r13, -0x10(%r12,%r14)
addq $0x38, %r14
cmpq %r14, %rbx
jne 0x155d65
movq 0x8(%rsp), %rbx
movq $0x0, 0x20(%rbx)
movq 0xc8(%r15), %r13
leaq 0x8(,%r13,8), %rdi
callq 0x2280
movq %rax, %r12
movq %rax, 0x18(%rbx)
xorl %ebp, %ebp
testq %r13, %r13
je 0x155e33
movq %r15, 0x10(%rsp)
movq 0xd8(%r15), %r15
movl $0x1, %ebx
xorl %r14d, %r14d
xorl %eax, %eax
movl %ebp, %ecx
movq %rcx, (%r12,%rax,8)
shlq $0x5, %rax
cmpb $0x0, 0x18(%r15,%rax)
jne 0x155e26
addq %r15, %rax
movq 0x10(%rsp), %rdx
movq 0xc0(%rdx), %rcx
movq 0x10(%rax), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x10(%rcx), %rdi
movq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x155c06
addl %eax, %ebp
incq %r14
movq 0x8(%rsp), %rax
movq %r14, 0x20(%rax)
movl %ebx, %eax
incl %ebx
cmpq %rax, %r13
ja 0x155dd2
movl %ebp, %ebp
jmp 0x155e35
xorl %eax, %eax
movq %rbp, (%r12,%rax,8)
movq 0x8(%rsp), %rax
movq %rbp, 0x28(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: destory_mul_block_phase_type(mul_block_phase_type*)
void destory_mul_block_phase_type(mul_block_phase_type* x)
{
    uint32_t i;
    free(x->res);
    free(x->chain_idx);
    for (i = 0; i < x->n_thread; i++)
    {
        kv_destroy(x->x[i].vis);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x2220
movq 0x18(%rbx), %rdi
callq 0x2220
cmpl $0x0, 0x8(%rbx)
je 0x155e95
movl $0x10, %r14d
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x2220
incq %r15
movl 0x8(%rbx), %eax
addq $0x38, %r14
cmpq %rax, %r15
jb 0x155e7a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: select_max_block_by_utg_multi_thread(H_partition*, G_partition*, bubble_type*, hc_links*, block_phase_type*, unsigned long*, unsigned int, block_res_type*)
void select_max_block_by_utg_multi_thread(H_partition* h, G_partition* g_p, bubble_type* bub, 
hc_links* link, block_phase_type* i_b, uint64_t* chain_idx, uint32_t id, block_res_type* res)
{
    long long c_bid, c_uid, l_bid, l_uid;
    uint32_t gid;
    get_block_phase_type(chain_idx, g_p, bub, id, i_b);

    ma_utg_t *u = &(bub->b_ug->u.a[i_b->chainID]);
    
    gid = next_hap_label_id(i_b, g_p, bub, u, 1, &c_bid, &c_uid);

    if(gid == (uint32_t)-1) return;
    if(identify_best_interval(i_b, h->lock, g_p, bub, u, link, c_bid, c_uid, &l_bid, &l_uid)) return;
    if(l_bid == -1 || l_uid == -1) return;

    if((res->min_w > i_b->weight) || (res->min_w == i_b->weight && id < res->min_idx))
    {
        res->min_w = i_b->weight;
        res->min_f_bid = c_bid;
        res->min_f_uid = c_uid;
        res->min_l_bid = l_bid;
        res->min_l_uid = l_uid;
        res->min_chain_id = i_b->chainID;
        res->min_idx = id;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl 0x60(%rsp), %ecx
movq %r9, %rdi
callq 0x155c78
movq 0xc0(%r15), %rax
movq 0x30(%rbx), %rcx
leaq (%rcx,%rcx,4), %rbp
shlq $0x3, %rbp
addq 0x10(%rax), %rbp
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
leaq 0x18(%rsp), %r9
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
pushq %rax
callq 0x15505a
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x155fb4
movq 0x8(%r13), %rsi
leaq 0x18(%rsp), %rax
leaq 0x20(%rsp), %r10
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %rbp, %r8
movq %r14, %r9
pushq %rax
pushq %r10
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x1553fd
addq $0x20, %rsp
testl %eax, %eax
jne 0x155fb4
movq 0x20(%rsp), %rax
cmpq $-0x1, %rax
sete %dl
movq 0x18(%rsp), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
jne 0x155fb4
movq 0x68(%rsp), %rdx
movsd 0x30(%rdx), %xmm1
movsd 0x18(%rbx), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x155f7c
movl 0x60(%rsp), %esi
jmp 0x155f8a
jne 0x155fb4
jp 0x155fb4
movl 0x60(%rsp), %esi
cmpq %rsi, 0x28(%rdx)
jle 0x155fb4
movsd %xmm0, 0x30(%rdx)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rdx)
movq 0x8(%rsp), %rdi
movq %rdi, 0x10(%rdx)
movq %rax, 0x18(%rdx)
movq %rcx, 0x20(%rdx)
movq 0x30(%rbx), %rax
movq %rax, (%rdx)
movq %rsi, 0x28(%rdx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq