LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: print_phase_group(G_partition*, bubble_type*, char const*)
void print_phase_group(G_partition* g_p, bubble_type* bub, const char* command)
{
    uint32_t i, k;
    partition_warp *res = NULL;
    for (i = 0; i < g_p->n; i++)
    {
        res = &(g_p->a[i]);
        fprintf(stderr, "\n%s: %u-th group: # %d = %u (weight: %f), # %d = %u (weight: %f), inner_weight: %f\n", command, i,
        res->status[0], res->h[0], res->weight[0], res->status[1], res->h[1], res->weight[1], res->weight_convex);
        for (k = 0; k < res->h[0]; k++)
        {
            fprintf(stderr, "%d: utg%.6ul\n", res->status[0], int(res->a.a[k]+1));
        }

        for (; k < res->a.n; k++)
        {
            fprintf(stderr, "%d: utg%.6ul\n", res->status[1], int(res->a.a[k]+1));
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rdi, %r14
movq 0x145173(%rip), %rbp    # 0x252fe0
leaq 0xe00ef(%rip), %r12     # 0x1edf63
xorl %r13d, %r13d
movl %r13d, %r13d
cmpq %r13, (%r14)
jbe 0x10df2d
movq 0x10(%r14), %rax
imulq $0x48, %r13, %rcx
leaq (%rax,%rcx), %r15
movq (%rbp), %rdi
movl 0x24(%rax,%rcx), %r8d
movsd 0x30(%rax,%rcx), %xmm0
movl 0x28(%rax,%rcx), %r10d
movl 0x18(%rax,%rcx), %r9d
movl 0x1c(%rax,%rcx), %r11d
movsd 0x38(%rax,%rcx), %xmm1
movsd 0x40(%rax,%rcx), %xmm2
leaq 0xe004f(%rip), %rsi     # 0x1edf0f
movq (%rsp), %rdx
movl %r13d, %ecx
movb $0x3, %al
pushq %r11
pushq %r10
callq 0x22b0
addq $0x10, %rsp
xorl %ebx, %ebx
movl 0x18(%r15), %eax
cmpq %rax, %rbx
jae 0x10df1e
movq (%rbp), %rdi
movl 0x24(%r15), %edx
movq 0x10(%r15), %rax
movl (%rax,%rbx,4), %ecx
incl %ecx
movq %r12, %rsi
xorl %eax, %eax
callq 0x22b0
incq %rbx
jmp 0x10ded8
movq (%rbp), %rdi
movl 0x28(%r15), %edx
movq 0x10(%r15), %rax
movl (%rax,%rbx,4), %ecx
incl %ecx
movq %r12, %rsi
xorl %eax, %eax
callq 0x22b0
incl %ebx
movl %ebx, %ebx
cmpq %rbx, (%r15)
ja 0x10df01
incl %r13d
jmp 0x10de77
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/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:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %r8, %rax
movq %rcx, %rbx
movq %rdx, %rdi
movq %rsi, %r14
andq $0x0, 0x18(%rcx)
andq $0x0, (%rsp)
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movq %rax, %rsi
callq 0xf6ab5
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl 0x14(%rsp), %edx
cmpq %rdx, %rax
jae 0x10dfaa
movq 0x18(%rsp), %rdx
movl (%rdx,%rax,4), %edx
shrl %edx
movq 0x18(%r14), %rsi
movl (%rsi,%rdx,4), %edx
cmpq %rcx, %rdx
je 0x10dfa5
shrl %edx
movq 0x10(%rbx), %rsi
movb $0x1, (%rsi,%rdx)
incq %rax
jmp 0x10df7c
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdi), %rax
movq 0x30(%rdi), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %edx, %edx
cmpq %rdx, %rax
jbe 0x10e993
movq 0x18(%rsi), %r8
movl (%r8,%rdx,4), %r10d
cmpq %rdi, %r10
je 0x10e98c
movq 0x10(%rsi), %r9
movl %r10d, %r11d
shrl %r11d
andl $0x1, %r10d
imulq $0x48, %r11, %r11
addq %r9, %r11
movl 0x24(%r11,%r10,4), %r10d
movq 0x10(%rcx), %rbx
imulq $0x30, %rdx, %r14
leaq (%rbx,%r14), %r11
movq (%rbx,%r14), %rbx
xorl %r14d, %r14d
movl %r14d, %r14d
cmpq %r14, %rbx
jbe 0x10e98c
movq 0x10(%r11), %r15
imulq $0x28, %r14, %r12
cmpb $0x0, 0x18(%r15,%r12)
js 0x10e987
addq %r12, %r15
movl 0x8(%r15), %r12d
movl (%r8,%r12,4), %r12d
cmpq %rdi, %r12
je 0x10e987
movl %r12d, %r13d
shrl %r13d
andl $0x1, %r12d
imulq $0x48, %r13, %r13
addq %r9, %r13
movl 0x24(%r13,%r12,4), %ebp
imull %r10d, %ebp
cvtsi2sd %ebp, %xmm1
mulsd (%r15), %xmm1
addsd %xmm1, %xmm0
incl %r14d
jmp 0x10e938
incl %edx
jmp 0x10e8ef
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
imulq $0x28, %rcx, %r13
addq 0x10(%rax), %r13
leaq 0x90(%rdi), %rbp
xorps %xmm0, %xmm0
movq %rdi, 0x8(%rsp)
movups %xmm0, 0xb0(%rdi)
subq $0x8, %rsp
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
pushq $0x1
popq %r8
leaq 0x20(%rsp), %r9
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x10dfb2
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x10eae1
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbp, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %r13, %r8
movq 0x20(%rsp), %r9
leaq 0x28(%rsp), %rax
pushq %rax
leaq 0x38(%rsp), %rax
pushq %rax
pushq 0x20(%rsp)
pushq 0x30(%rsp)
callq 0x10e378
addq $0x20, %rsp
movq 0x30(%rsp), %rbx
cmpq $-0x1, %rbx
sete %al
movq 0x28(%rsp), %r12
cmpq $-0x1, %r12
sete %cl
orb %al, %cl
jne 0x10e9df
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r9
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
movq 0x20(%rsp), %r8
pushq %r12
pushq %rbx
pushq 0x20(%rsp)
pushq 0x30(%rsp)
callq 0x10e76c
addq $0x20, %rsp
testl %eax, %eax
je 0x10e9df
movq 0x8(%rsp), %rax
movq %rbx, 0xb0(%rax)
movq %r12, 0xb8(%rax)
subq $0x8, %rsp
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
pushq $0x1
popq %r8
leaq 0x20(%rsp), %r9
leaq 0x18(%rsp), %rax
pushq %rax
callq 0x10dfb2
addq $0x10, %rsp
cmpl $-0x1, %eax
jne 0x10e9df
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/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
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rcx)
xorl %ebx, %ebx
cmpl %ebx, %ebp
je 0x10eb48
leaq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
pushq $0x1
popq %r8
leaq 0x10(%rsp), %r9
callq 0x10dfb2
cmpl $-0x1, %eax
je 0x10eb46
incl %ebx
jmp 0x10eb16
movl %ebx, %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_O2/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), %r15
movl %ecx, %edx
xorl %ecx, %ecx
cmpq %rcx, %r15
je 0x10eb8c
movq (%rdi,%rcx,8), %rax
cmpq %rdx, %rax
ja 0x10eb87
cmpq %rdx, 0x8(%rdi,%rcx,8)
ja 0x10eb92
incq %rcx
jmp 0x10eb72
movq (%rdi,%r15,8), %rax
jmp 0x10eb95
movq %rcx, %r15
movq 0xd8(%r14), %rcx
shlq $0x5, %r15
imulq $0x28, 0x10(%rcx,%r15), %rdi
movq 0xc0(%r14), %rcx
addq 0x10(%rcx), %rdi
subl %eax, %r8d
movq %r14, %rdx
movq %rbx, %rcx
callq 0x10eaf0
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_O2/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 $0x48, %rsp
movq %r8, %r12
movq %rdx, %rbx
movq %rsi, (%rsp)
movq %rdi, %r14
movq %rdx, 0x10(%rdi)
movl %ecx, 0x8(%rdi)
movl %ecx, %ebp
pushq $0x38
popq %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2120
movq %rax, 0x30(%r14)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2120
movq %rax, %r13
movq %r14, 0x8(%rsp)
movq %rax, (%r14)
imulq $0x38, %rbp, %r15
addq $0x10, %r13
xorl %r14d, %r14d
cmpq %r14, %r15
je 0x10ec5c
xorps %xmm0, %xmm0
movups %xmm0, -0x8(%r13,%r14)
movq (%r12), %rbp
movq %rbp, -0x8(%r13,%r14)
movq %rbp, %rdi
callq 0x2280
movq %rax, (%r13,%r14)
movq %rbp, -0x10(%r13,%r14)
addq $0x38, %r14
jmp 0x10ec2d
movq 0x8(%rsp), %r14
andq $0x0, 0x20(%r14)
movq 0xc8(%rbx), %rbp
leaq 0x8(,%rbp,8), %rdi
callq 0x2280
movq %rax, 0x18(%r14)
xorl %r13d, %r13d
xorl %r12d, %r12d
movq (%rsp), %r15
movl %r13d, %r13d
movl %r12d, %eax
movq 0x18(%r14), %rcx
movq %rax, (%rcx,%r13,8)
cmpq %r13, %rbp
jbe 0x10ecea
movq 0xd8(%rbx), %rax
movq %r13, %rcx
shlq $0x5, %rcx
cmpb $0x0, 0x18(%rax,%rcx)
jne 0x10ecde
addq %rcx, %rax
movq 0xc0(%rbx), %rcx
imulq $0x28, 0x10(%rax), %rdi
addq 0x10(%rcx), %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq 0x10(%rsp), %rcx
pushq $-0x1
popq %r8
callq 0x10eaf0
addl %eax, %r12d
incq 0x20(%r14)
incl %r13d
movq 0xc8(%rbx), %rbp
jmp 0x10ec88
movq %rax, 0x28(%r14)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/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
pushq $0x10
popq %r14
xorl %r15d, %r15d
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jae 0x10ed3b
movq (%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x2220
incq %r15
addq $0x38, %r14
jmp 0x10ed1e
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x10eb59
movq 0xc0(%r15), %rax
imulq $0x28, 0x30(%rbx), %rbp
addq 0x10(%rax), %rbp
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
pushq $0x1
popq %r8
leaq 0x18(%rsp), %r9
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
pushq %rax
callq 0x10dfb2
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x10ee51
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 0x10e378
addq $0x20, %rsp
testl %eax, %eax
jne 0x10ee51
movq 0x20(%rsp), %rax
cmpq $-0x1, %rax
sete %dl
movq 0x18(%rsp), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
jne 0x10ee51
movq 0x68(%rsp), %rdx
movsd 0x30(%rdx), %xmm1
movsd 0x18(%rbx), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x10ee19
movl 0x60(%rsp), %esi
jmp 0x10ee27
jne 0x10ee51
jp 0x10ee51
movl 0x60(%rsp), %esi
cmpq %rsi, 0x28(%rdx)
jle 0x10ee51
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
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: select_max_block_by_utg_multi_thread_by_chain(H_partition*, G_partition*, bubble_type*, hc_links*, block_phase_type*, unsigned int, block_res_type*)
void select_max_block_by_utg_multi_thread_by_chain(H_partition* h, G_partition* g_p, bubble_type* bub, 
hc_links* link, block_phase_type* i_b, uint32_t id, block_res_type* res)
{
    long long c_bid, c_uid, l_bid, l_uid;
    uint32_t gid;
    ma_utg_t *u = &(bub->b_ug->u.a[id]);
    i_b->bid = i_b->uid = 0; i_b->chainID = id;
    while (1)
    {
        gid = next_hap_label_id(i_b, g_p, bub, u, 1, &c_bid, &c_uid);
        if(gid == (uint32_t)-1) break;

        if(identify_best_interval(i_b, h->lock, g_p, bub, u, link, c_bid, c_uid, &l_bid, &l_uid))
        {
            break;
        }
        if(l_bid == -1 || l_uid == -1) continue;
        if(res->min_w > i_b->weight)
        {
            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 $0x38, %rsp
movq %r8, %rbx
movq %rcx, 0x20(%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq 0x70(%rsp), %r14
movq 0xc0(%rdx), %rax
movl %r9d, %ecx
imulq $0x28, %rcx, %rbp
addq 0x10(%rax), %rbp
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%r8)
movq %rcx, 0x18(%rsp)
movq %rcx, 0x30(%r8)
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
pushq $0x1
popq %r8
leaq 0x18(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
callq 0x10dfb2
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x10ef7c
movq 0x8(%r13), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %rbp, %r8
movq 0x20(%rsp), %r9
leaq 0x28(%rsp), %rax
pushq %rax
leaq 0x38(%rsp), %rax
pushq %rax
pushq 0x18(%rsp)
pushq 0x28(%rsp)
callq 0x10e378
addq $0x20, %rsp
testl %eax, %eax
jne 0x10ef7c
movq 0x30(%rsp), %rax
cmpq $-0x1, %rax
sete %dl
movq 0x28(%rsp), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
jne 0x10eea9
movsd 0x30(%r14), %xmm1
movsd 0x18(%rbx), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x10eea9
movsd %xmm0, 0x30(%r14)
movq 0x10(%rsp), %rdx
movq %rdx, 0x8(%r14)
movq 0x8(%rsp), %rdx
movq %rdx, 0x10(%r14)
movq %rax, 0x18(%r14)
movq %rcx, 0x20(%r14)
movq 0x30(%rbx), %rax
movq %rax, (%r14)
movq 0x18(%rsp), %rax
movq %rax, 0x28(%r14)
jmp 0x10eea9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: select_max_block_by_utg(H_partition*, G_partition*, bubble_type*, hc_links*, unsigned int, long long*, long long*, long long*, long long*, double*)
void select_max_block_by_utg(H_partition* hap, G_partition* g_p, bubble_type* bub, hc_links* link, uint32_t chain_id,
long long* min_f_bid, long long* min_f_uid, long long* min_l_bid, long long* min_l_uid, double* min_w)
{
    long long c_bid, c_uid, l_bid, l_uid;
    uint32_t gid;
    ma_utg_t *u = &(bub->b_ug->u.a[chain_id]);
    (*min_w) = 1;
    hap->b.bid = hap->b.uid = 0;
    (*min_f_bid) = (*min_f_uid) = (*min_l_bid) = (*min_l_uid) = -1;
    while (1)
    {
        gid = next_hap_label_id(&(hap->b), g_p, bub, u, 1, &c_bid, &c_uid);
        if(gid == (uint32_t)-1) break;

        if(identify_best_interval(&(hap->b), hap->lock, g_p, bub, u, link, c_bid, c_uid, &l_bid, &l_uid))
        {
            break;
        }
        if(l_bid == -1 || l_uid == -1) continue;
        if((*min_w) > hap->b.weight)
        {
            (*min_w) = hap->b.weight;
            (*min_f_bid) = c_bid;
            (*min_f_uid) = c_uid;
            (*min_l_bid) = l_bid;
            (*min_l_uid) = l_uid;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rsi
movq 0xc0(%r15), %rax
movl %r8d, %ecx
imulq $0x28, %rcx, %rbp
addq 0x10(%rax), %rbp
movq 0x68(%rsp), %rcx
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0xb0(%rdi)
orq $-0x1, (%rsi)
movq 0x60(%rsp), %rax
orq $-0x1, (%rcx)
leaq 0x90(%rdi), %rbx
orq $-0x1, (%rax)
movq %r9, 0x10(%rsp)
orq $-0x1, (%r9)
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
pushq $0x1
popq %r8
leaq 0x10(%rsp), %r9
leaq 0x8(%rsp), %rax
pushq %rax
callq 0x10dfb2
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x10f285
movq 0x8(%r13), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %rbp, %r8
movq %r14, %r9
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0x28(%rsp), %rax
pushq %rax
pushq 0x10(%rsp)
pushq 0x20(%rsp)
callq 0x10e378
addq $0x20, %rsp
testl %eax, %eax
jne 0x10f285
movq 0x20(%rsp), %rax
cmpq $-0x1, %rax
sete %dl
movq 0x18(%rsp), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
jne 0x10f1b0
movq 0x78(%rsp), %rdx
movsd (%rdx), %xmm1
movsd 0xa8(%r13), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x10f1b0
movsd %xmm0, (%rdx)
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %rdx, (%rsi)
movq (%rsp), %rdx
movq 0x60(%rsp), %rsi
movq %rdx, (%rsi)
movq 0x68(%rsp), %rdx
movq %rax, (%rdx)
movq 0x70(%rsp), %rax
movq %rcx, (%rax)
jmp 0x10f1b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: phasing_improvement_by_block(H_partition*, G_partition*, bubble_type*, mul_block_phase_type*)
void phasing_improvement_by_block(H_partition* h, G_partition* g_p, bubble_type* bub, mul_block_phase_type* x)
{
    long long min_u, min_f_bid, min_f_uid, min_l_bid, min_l_uid; 
    double min_w;

    memset(h->lock, 0, sizeof(uint8_t)*h->n);
    while(get_max_block_multi_thread(h, g_p, bub, x, &min_u, &min_f_bid, &min_f_uid, &min_l_bid, &min_l_uid, &min_w))
    ///while(get_max_block(h, g_p, bub, &min_u, &min_f_bid, &min_f_uid, &min_l_bid, &min_l_uid, &min_w))
    {
        ///fprintf(stderr, "\nmin_w: %f, min_u: %lld, min_f_bid: %lld, min_f_uid: %lld, min_l_bid: %lld, min_l_uid: %lld\n", min_w, min_u, min_f_bid, min_f_uid, min_l_bid, min_l_uid);
        ///fprintf(stderr, "before weight: %f\n", get_total_weight(h, g_p));
        flip_block(&(h->b), g_p, bub, &(bub->b_ug->u.a[min_u]), h->link, h->lock, min_f_bid, 
        min_f_uid, min_l_bid, min_l_uid);
        ///fprintf(stderr, "after weight: %f\n", get_total_weight(h, g_p));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rdx
movq 0x8(%rdi), %rdi
xorl %esi, %esi
callq 0x20e0
leaq 0x90(%r12), %r13
leaq 0x20(%rsp), %rbp
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rcx
leaq 0x28(%rsp), %r8
movq %rbp, %r9
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x30(%rsp), %rax
pushq %rax
callq 0x10ef8b
addq $0x20, %rsp
testl %eax, %eax
je 0x10f4f9
movq 0xc0(%r14), %rax
imulq $0x28, 0x28(%rsp), %rcx
addq 0x10(%rax), %rcx
movq 0x8(%r12), %r9
movq 0x30(%r12), %r8
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
pushq 0x8(%rsp)
pushq 0x18(%rsp)
pushq 0x28(%rsp)
pushq 0x38(%rsp)
callq 0x10e76c
addq $0x20, %rsp
jmp 0x10f484
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: get_max_unitig(H_partition*, G_partition*, hc_links*, bubble_type*)
uint32_t get_max_unitig(H_partition* h, G_partition* g_p, hc_links* link, bubble_type* bub)
{
    double min, weight;
    uint32_t i, min_i;
     
    for (i = 0, min = 1, min_i = (uint32_t)-1; i < g_p->n; i++)
    {
        if(h->lock[i]) continue;
        weight = 0;
        if(g_p->a[i].h[0] > 0 && (g_p->a[i].status[0] == 1 || g_p->a[i].status[0] == -1))
        {
            weight += (g_p->a[i].weight[0] * g_p->a[i].status[0]);
        }

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

        if(weight >= 0) continue;
        if(weight < min)
        {
            min = weight;
            min_i = i;
        }
    }
    ///fprintf(stderr, "*****************min: %f\n", min);
    return min_i;
}

// Assembly:
movq (%rsi), %rcx
pushq $-0x1
popq %rax
xorl %edx, %edx
movsd 0xd3c06(%rip), %xmm1    # 0x1e32a0
xorpd %xmm0, %xmm0
movl %edx, %r9d
cmpq %r9, %rcx
jbe 0x10f73a
movq 0x8(%rdi), %r8
cmpb $0x0, (%r8,%r9)
jne 0x10f733
movq 0x10(%rsi), %r8
imulq $0x48, %r9, %r9
leaq (%r8,%r9), %r10
xorpd %xmm2, %xmm2
cmpl $0x0, 0x18(%r8,%r9)
je 0x10f6ec
movl 0x24(%r10), %r11d
cmpl $0x1, %r11d
je 0x10f6dd
cmpl $-0x1, %r11d
jne 0x10f6ec
cvtsi2sd %r11d, %xmm2
mulsd 0x30(%r10), %xmm2
addsd %xmm0, %xmm2
cmpl $0x0, 0x1c(%r10)
je 0x10f712
movl 0x28(%r10), %r11d
cmpl $0x1, %r11d
je 0x10f703
cmpl $-0x1, %r11d
jne 0x10f712
cvtsi2sd %r11d, %xmm3
mulsd 0x38(%r10), %xmm3
addsd %xmm3, %xmm2
movsd 0x40(%r8,%r9), %xmm3
addsd %xmm3, %xmm3
addsd %xmm2, %xmm3
ucomisd %xmm0, %xmm3
jae 0x10f733
ucomisd %xmm3, %xmm1
jbe 0x10f733
movapd %xmm3, %xmm1
movl %edx, %eax
incl %edx
jmp 0x10f69e
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: flip_by_node(H_partition*, G_partition*, bubble_type*)
void flip_by_node(H_partition* h, G_partition* g_p, bubble_type* bub)
{
    uint32_t i;
    memset(h->lock, 0, sizeof(uint8_t)*h->n);
    

    double pre_w = get_total_weight(h, g_p), current_w;
    uint32_t round = 0;
    while (1)
    {
        memset(h->lock, 0, sizeof(uint8_t)*h->n);
        while (1)
        {
            i = get_max_unitig(h, g_p, h->link, bub);
            if(i == (uint32_t)-1) break;
            h->lock[i] = 1;
            flip_unitig(g_p, h->link, bub, i);
        }
        current_w = get_total_weight(h, g_p);
        ///fprintf(stderr, "[M::%s::round %u, pre_w: %f, current_w: %f]\n", __func__, round, pre_w, current_w);
        if(ceil(current_w) <= ceil(pre_w)) break;
        round++;
        pre_w = current_w;
    }
    
    ///fprintf(stderr, "[M::%s::round %u, before block flipping: %f]\n", __func__, round, get_total_weight(h, g_p));
    
    for (i = 0; i < g_p->n; i++)
    {
        update_partition_flag(h, g_p, h->link, i);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdx
movq 0x8(%rdi), %rdi
xorl %esi, %esi
callq 0x20e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10e8d3
movsd %xmm0, 0x18(%rsp)
movq (%r14), %rdx
movq 0x8(%r14), %rdi
xorl %esi, %esi
callq 0x20e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10f68a
cmpl $-0x1, %eax
je 0x10f7a0
movq 0x8(%r14), %rcx
movl %eax, %edx
movb $0x1, (%rcx,%rdx)
movq 0x30(%r14), %rsi
movq %rbx, %rdi
movl %eax, %ecx
callq 0x10dc0d
jmp 0x10f776
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10e8d3
movsd %xmm0, 0x10(%rsp)
callq 0x2040
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x2040
ucomisd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm0
jb 0x10f762
xorl %ebp, %ebp
movl %ebp, %eax
cmpq %rax, (%rbx)
jbe 0x10f7ef
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %ecx
callq 0x10c96a
incl %ebp
jmp 0x10f7d7
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: print_chain_phasing(H_partition*, ma_ug_t*, bubble_type*, unsigned int)
void print_chain_phasing(H_partition* hap, ma_ug_t *ug, bubble_type* bub, uint32_t chain_id)
{
    uint32_t i, k;
    uint32_t beg, sink, *a, n;
    uint64_t bid, uid;
    ma_utg_t *u = &(bub->b_ug->u.a[chain_id]);
    fprintf(stderr, "\n**********chain_id: %u**********\n", chain_id);
    for (i = 0; i < u->n; i++)
    {
        bid = u->a[i]>>33;
        fprintf(stderr, "(%u) chain_id: %u, u->n: %u, bid: %u\n", i, chain_id, (uint32_t)u->n, i);
        get_bubbles(bub, bid, &beg, &sink, &a, &n, NULL);
        for (k = 0; k < n; k++)
        {
            uid = a[k]>>1;
            fprintf(stderr, "utg%.6ul, hap: %u, group: %u, stats: %d\n", (int)(uid+1), hap->hap[uid], 
                        get_phase_group(hap, uid), get_phase_status(hap, uid));
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0xc0(%rdx), %rax
movl %ecx, %edx
imulq $0x28, %rdx, %rbx
addq 0x10(%rax), %rbx
movq 0x1434c7(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xde4bc(%rip), %rsi     # 0x1edfdf
movl %ecx, 0x8(%rsp)
movl %ecx, %edx
xorl %eax, %eax
callq 0x22b0
xorl %r12d, %r12d
movq %rbx, 0x10(%rsp)
movl 0x10(%rbx), %r8d
cmpq %r8, %r12
jae 0x10fc04
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %r13
shrq $0x21, %r13
movq 0x143488(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xde4a0(%rip), %rsi     # 0x1ee002
movl %r12d, %edx
movl 0x8(%rsp), %ecx
movl %r12d, %r9d
xorl %eax, %eax
callq 0x22b0
andq $0x0, (%rsp)
movq 0x18(%rsp), %rdi
movq %r13, %rsi
leaq 0x34(%rsp), %rdx
leaq 0x30(%rsp), %rcx
leaq 0x28(%rsp), %r8
leaq 0xc(%rsp), %r9
callq 0xf6ab5
xorl %r15d, %r15d
movl 0xc(%rsp), %eax
cmpq %rax, %r15
jae 0x10fbf7
movq 0x28(%rsp), %rax
movl (%rax,%r15,4), %esi
shrl %esi
movq 0x143429(%rip), %rax    # 0x252fe0
movq (%rax), %r13
leal 0x1(%rsi), %ebp
movq 0x20(%rsp), %rdi
movq 0x10(%rdi), %rax
movl (%rax,%rsi,4), %ebx
movb 0x2c(%rdi), %cl
movl %ebx, %r14d
shrl %cl, %r14d
callq 0x121555
movq %r13, %rdi
leaq 0xde447(%rip), %rsi     # 0x1ee028
movl %ebp, %edx
movl %ebx, %ecx
movl %r14d, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x22b0
incq %r15
jmp 0x10fb9c
incq %r12
movq 0x10(%rsp), %rbx
jmp 0x10fb38
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: get_specific_weight_by_chain(unsigned long*, unsigned long, unsigned long, unsigned long, hc_links*, unsigned char*, unsigned char)
double get_specific_weight_by_chain(uint64_t* ids, uint64_t beg_idx, uint64_t end_idx, uint64_t p_id,
hc_links* link, uint8_t* vis, uint8_t flag)
{
    uint64_t x, k;
    uint32_t uid;
    double w;
    for (x = beg_idx, w = 0; x <= end_idx; x++)
    {
        uid = (uint32_t)((uint32_t)ids[x])>>1;
        for (k = 0; k < link->a.a[uid].e.n; k++)
        {
            if(link->a.a[uid].e.a[k].del) continue;
            if(vis[link->a.a[uid].e.a[k].uID] != flag) continue;
            w += link->a.a[uid].e.a[k].weight;
        }
    }

    return w;
}

// Assembly:
pushq %r14
pushq %rbx
xorpd %xmm0, %xmm0
movb 0x18(%rsp), %al
cmpq %rdx, %rsi
ja 0x11045b
movl (%rdi,%rsi,8), %ecx
shrl %ecx
movq 0x10(%r8), %r10
imulq $0x30, %rcx, %r11
leaq (%r10,%r11), %rcx
movq (%r10,%r11), %r10
xorl %r11d, %r11d
subq $0x1, %r10
jb 0x110456
movq 0x10(%rcx), %rbx
cmpb $0x0, 0x18(%rbx,%r11)
js 0x110450
movl 0x8(%rbx,%r11), %r14d
cmpb %al, (%r9,%r14)
jne 0x110450
addsd (%rbx,%r11), %xmm0
addq $0x28, %r11
jmp 0x11042d
incq %rsi
jmp 0x110410
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: get_max_hap_g(bub_sort_vec*, unsigned int*)
uint32_t get_max_hap_g(bub_sort_vec* w_stack, uint32_t* require_iso)
{
    uint32_t k, max_idx = (uint32_t)-1;
    double max_w;
    for (k = require_iso? (*require_iso)+1 : 0, max_idx = (uint32_t)-1; k < w_stack->n; k++)
    {
        if(w_stack->a[k].used) continue;
        if(!require_iso)
        {
            if(w_stack->a[k].p_id == (uint32_t)-1) continue;
            if((max_idx == (uint32_t)-1) || (max_idx != (uint32_t)-1 && max_w < w_stack->a[k].weight))
            {
                max_w = w_stack->a[k].weight;
                max_idx = k;
            }
        }
        else
        {
            if(w_stack->a[k].p_id != (uint32_t)-1) continue;
            return k;
        }
    }

    if(require_iso && (*require_iso) != 0)
    {
        for (k = 0; k < w_stack->n; k++)
        {
            if(w_stack->a[k].used) continue;
            if(w_stack->a[k].p_id != (uint32_t)-1) continue;
            return k;
        }
    }

    return max_idx;
}

// Assembly:
testq %rsi, %rsi
je 0x110484
movl (%rsi), %edx
incl %edx
jmp 0x110486
xorl %edx, %edx
movq 0x8(%rdi), %rcx
pushq $-0x1
popq %rax
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl %edx, %r10d
cmpq %r10, %rcx
jbe 0x1104dc
movq (%rdi), %r9
imulq $0x28, %r10, %r10
cmpb $0x0, 0x20(%r9,%r10)
jne 0x1104d8
addq %r10, %r9
movq 0x8(%r9), %r10
testq %rsi, %rsi
je 0x1104bd
cmpq %r8, %r10
jne 0x1104d8
jmp 0x110511
cmpq %r8, %r10
je 0x1104d8
movsd (%r9), %xmm1
cmpl $-0x1, %eax
je 0x1104d2
ucomisd %xmm0, %xmm1
jbe 0x1104d8
movl %edx, %eax
movapd %xmm1, %xmm0
incl %edx
jmp 0x110493
testq %rsi, %rsi
je 0x110513
cmpl $0x0, (%rsi)
je 0x110513
xorl %edx, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, %r9d
cmpq %r9, %rcx
jbe 0x110513
movq (%rdi), %r8
imulq $0x28, %r9, %r9
cmpb $0x0, 0x20(%r8,%r9)
jne 0x11050d
addq %r9, %r8
cmpq %rsi, 0x8(%r8)
je 0x110511
incl %edx
jmp 0x1104ed
movl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: update_bub_sort_vec(unsigned long*, bub_sort_vec*, unsigned int, hc_links*, unsigned int*)
void update_bub_sort_vec(uint64_t* ids, bub_sort_vec* w_stack, uint32_t max_idx, hc_links* link,
uint32_t* set_hap)
{
    w_stack->a[max_idx].used = 1;
    uint64_t i, k;
    uint32_t uid, pid_idx;
    for (i = w_stack->a[max_idx].beg_idx; i <= w_stack->a[max_idx].end_idx; i++)
    {
        uid = (uint32_t)((uint32_t)ids[i])>>1;
        for (k = 0; k < link->a.a[uid].e.n; k++)
        {
            if(link->a.a[uid].e.a[k].del) continue;
            pid_idx = set_hap[link->a.a[uid].e.a[k].uID];
            if(pid_idx == (uint32_t)-1) continue;
            if(w_stack->a[pid_idx].used) continue;
            w_stack->a[pid_idx].weight += link->a.a[uid].e.a[k].weight;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rsi), %rax
movl %edx, %edx
imulq $0x28, %rdx, %rsi
movb $0x1, 0x20(%rax,%rsi)
movq 0x10(%rax,%rsi), %rdx
movq 0x18(%rax,%rsi), %rsi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
ja 0x1105a8
movl (%rdi,%rdx,8), %r10d
shrl %r10d
movq 0x10(%rcx), %r11
imulq $0x30, %r10, %rbx
leaq (%r11,%rbx), %r10
movq (%r11,%rbx), %r11
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpq %r11, %r14
jae 0x1105a3
movq 0x10(%r10), %r15
cmpb $0x0, 0x18(%r15,%rbx)
js 0x11059a
movl 0x8(%r15,%rbx), %r12d
movl (%r8,%r12,4), %r12d
cmpq %r9, %r12
je 0x11059a
imulq $0x28, %r12, %r12
cmpb $0x0, 0x20(%rax,%r12)
jne 0x11059a
addq %rax, %r12
movsd (%r15,%rbx), %xmm0
addsd (%r12), %xmm0
movsd %xmm0, (%r12)
incq %r14
addq $0x28, %rbx
jmp 0x11055a
incq %rdx
jmp 0x110539
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: sort_bubble_ele(G_partition*, hc_links*, bubble_type*, unsigned int)
void sort_bubble_ele(G_partition* g_p, hc_links* link, bubble_type* bub, uint32_t n_utg)
{
    double index_time = yak_realtime();
    kvec_t_u64_warp stack; kv_init(stack.a);
    bub_sort_vec w_stack; kv_init(w_stack);
    uint8_t* vis = NULL; MALLOC(vis, n_utg);
    uint32_t* set_hap = NULL; MALLOC(set_hap, n_utg); memset(set_hap, -1, sizeof(uint32_t)*n_utg);
    uint32_t i;
    
   for (i = 0; i < bub->chain_weight.n; i++)
   {
       if(bub->chain_weight.a[i].del) continue;
       sort_bubble_ele_by_chain(g_p, link, bub, &stack, &w_stack, vis, set_hap, n_utg, bub->chain_weight.a[i].id);
   }

   kv_destroy(stack.a); kv_destroy(w_stack); free(vis); free(set_hap);
   fprintf(stderr, "[M::%s::%.3f]\n", __func__, yak_realtime()-index_time);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
callq 0xefea7
movsd %xmm0, (%rsp)
xorpd %xmm0, %xmm0
leaq 0x30(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rbx, %r15
movl %ebx, %ebx
movq %rbx, %rdi
callq 0x2280
movq %rax, %r13
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbp
leaq 0x10(%rsp), %rax
xorpd %xmm0, %xmm0
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rbp, %rdi
movl $0xff, %esi
movq %rbx, %rdx
callq 0x20e0
xorl %ebx, %ebx
movl %ebx, %ebx
cmpq %rbx, 0xc8(%r14)
jbe 0x110af0
movq 0xd8(%r14), %rax
movq %rbx, %rcx
shlq $0x5, %rcx
cmpb $0x0, 0x18(%rax,%rcx)
jne 0x110aec
addq %rcx, %rax
movl 0x10(%rax), %eax
subq $0x8, %rsp
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
leaq 0x38(%rsp), %rcx
leaq 0x18(%rsp), %r8
movq %r13, %r9
pushq %rax
pushq %r15
pushq %rbp
callq 0x1105b0
addq $0x20, %rsp
incl %ebx
jmp 0x110a9d
movq 0x40(%rsp), %rdi
callq 0x2220
movq 0x10(%rsp), %rdi
callq 0x2220
movq %r13, %rdi
callq 0x2220
movq %rbp, %rdi
callq 0x2220
movq 0x1424c5(%rip), %rax    # 0x252fe0
movq (%rax), %rbx
callq 0xefea7
subsd (%rsp), %xmm0
leaq 0xdcfac(%rip), %rsi     # 0x1edadb
leaq 0xdd5d0(%rip), %rdx     # 0x1ee106
movq %rbx, %rdi
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: get_path_phasing_weight(unsigned int, unsigned int, unsigned int, bub_p_t_warp*, kv_u_trans_t*)
double get_path_phasing_weight(uint32_t query, uint32_t v0, uint32_t root, bub_p_t_warp *b, kv_u_trans_t *ta)
{
    if(v0 == root) return 0;
    uint32_t v, u;
    u_trans_t *p = NULL;
    double nw = 0;
    v = v0;
    do {
        u = b->a[v].p; // u->v
        get_u_trans_spec(ta, query>>1, v>>1, &p, NULL);
        if(p && (!p->del)) nw += p->nw;
        v = u;
    } while (v != root);

    return nw;
}

// Assembly:
xorpd %xmm0, %xmm0
cmpl %edx, %esi
je 0x110eb6
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r12d
movl %edi, %r15d
leaq 0x10(%rsp), %r13
andq $0x0, (%r13)
shrl %r15d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movl %r12d, %edx
movq (%r14), %rax
movl %r12d, %ecx
imulq $0x38, %rcx, %rcx
movl (%rax,%rcx), %r12d
shrl %edx
movq %rbx, %rdi
movl %r15d, %esi
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x8feef
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x110e9d
cmpb $0x0, 0x28(%rax)
movsd 0x8(%rsp), %xmm0
js 0x110ea3
addsd 0x20(%rax), %xmm0
jmp 0x110ea3
movsd 0x8(%rsp), %xmm0
cmpl %ebp, %r12d
jne 0x110e56
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: get_related_phasing_weight(unsigned int, kv_u_trans_t*, double*, double*, signed char*)
void get_related_phasing_weight(uint32_t x, kv_u_trans_t *ta, double* w0, double* w1, int8_t *s)
{
    (*w0) = (*w1) = 0;
    if(x >= ta->idx.n) return;
    uint32_t e_n, k;
    u_trans_t* e = u_trans_a(*ta, x);
    e_n = u_trans_n(*ta, x);
    for (k = 0; k < e_n; k++)
    {
        if(e[k].del) continue;
        if(s[e[k].tn] > 0) (*w0) += e[k].nw;
        else if(s[e[k].tn] < 0) (*w1) += e[k].nw;
    }
}

// Assembly:
andq $0x0, (%rcx)
andq $0x0, (%rdx)
movl %edi, %eax
cmpq %rax, 0x18(%rsi)
jbe 0x110f24
movq 0x10(%rsi), %rdi
movq 0x28(%rsi), %rsi
movq (%rsi,%rax,8), %rax
movl %eax, %esi
movq %rax, %r9
shrq $0x20, %r9
imulq $0x30, %rsi, %rax
imulq $0x30, %r9, %rsi
addq %rdi, %rsi
addq $0x28, %rsi
xorl %edi, %edi
cmpq %rdi, %rax
je 0x110f24
cmpb $0x0, (%rsi,%rdi)
js 0x110f1e
movl -0x14(%rsi,%rdi), %r9d
cmpb $0x0, (%r8,%r9)
movq %rdx, %r9
jle 0x110f19
movsd -0x8(%rsi,%rdi), %xmm0
addsd (%r9), %xmm0
movsd %xmm0, (%r9)
jmp 0x110f1e
movq %rcx, %r9
js 0x110f07
addq $0x30, %rdi
jmp 0x110eed
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: set_phase_path(bub_p_t_warp*, unsigned int, kv_u_trans_t*, ps_t*)
void set_phase_path(bub_p_t_warp *b, uint32_t root, kv_u_trans_t *ta, ps_t *s)
{
    int8_t f;
    uint32_t v, u;
    double z[2], cur_w[2];
    z[0] = z[1] = 0;

    v = b->S.a[0];
    do {
        u = b->a[v].p; // u->v
        if(v != b->S.a[0]) 
        {
            get_related_phasing_weight(v>>1, ta, &cur_w[0], &cur_w[1], s->s);
            z[0] += cur_w[0]; z[1] += cur_w[1];
        }
        v = u;
    } while (v != root);

    if(z[0] - z[1] < 0)
    {
        f = 1;
    }
    else if(z[0] - z[1] > 0)
    {
        f = -1;
    }
    else
    {
        s->xs = kr_splitmix64(s->xs);
        f = s->xs&1? 1 : -1;
    }

    v = b->S.a[0];
    do {
        u = b->a[v].p; // u->v
        if(v != b->S.a[0]) s->s[v>>1] = f;
        v = u;
    } while (v != root);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movq 0x18(%rdi), %rax
movl (%rax), %edi
xorpd %xmm1, %xmm1
movq %rsp, %r13
movl %edi, %eax
imulq $0x38, %rax, %rax
movq (%r14), %rcx
movq 0x18(%r14), %rdx
movl (%rcx,%rax), %r12d
cmpl (%rdx), %edi
je 0x110f86
shrl %edi
movq (%rbx), %r8
movq %r15, %rsi
movq %r13, %rdx
leaq 0x8(%rsp), %rcx
movapd %xmm1, 0x10(%rsp)
callq 0x110eb7
movapd 0x10(%rsp), %xmm1
addpd (%rsp), %xmm1
movl %r12d, %edi
cmpl %ebp, %r12d
jne 0x110f4b
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
subsd %xmm0, %xmm1
movb $0x1, %cl
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x110fc9
movb $-0x1, %cl
ucomisd %xmm0, %xmm1
ja 0x110fc9
movq 0x8(%rbx), %rdi
callq 0x111000
movq %rax, 0x8(%rbx)
andl $0x1, %eax
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
orb $0x1, %cl
movq 0x18(%r14), %rax
movl (%rax), %eax
movl %eax, %edx
imulq $0x38, %rdx, %rdx
movq (%r14), %rsi
movq 0x18(%r14), %rdi
movl (%rsi,%rdx), %edx
cmpl (%rdi), %eax
je 0x110feb
movq (%rbx), %rsi
shrl %eax
movb %cl, (%rsi,%rax)
movl %edx, %eax
cmpl %ebp, %edx
jne 0x110fcf
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/./rcut.h
// Function: kr_splitmix64(unsigned long)
static inline uint64_t kr_splitmix64(uint64_t x)
{
	uint64_t z = (x += 0x9E3779B97F4A7C15ULL);
	z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9ULL;
	z = (z ^ (z >> 27)) * 0x94D049BB133111EBULL;
	return z ^ (z >> 31);
}

// Assembly:
movabsq $-0x61c8864680b583eb, %rax # imm = 0x9E3779B97F4A7C15
addq %rdi, %rax
movq %rax, %rcx
shrq $0x1e, %rcx
xorq %rax, %rcx
movabsq $-0x40a7b892e31b1a47, %rax # imm = 0xBF58476D1CE4E5B9
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $-0x6b2fb644ecceee15, %rdx # imm = 0x94D049BB133111EB
imulq %rcx, %rdx
movq %rdx, %rax
shrq $0x1f, %rax
xorq %rdx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: get_specific_hic_weight_by_chain(unsigned int, kv_u_trans_t*, unsigned char*, unsigned char)
double get_specific_hic_weight_by_chain(uint32_t uid, kv_u_trans_t *ta, uint8_t* vis, uint8_t flag)
{
    u_trans_t *e = u_trans_a(*ta, uid);
    uint64_t k, e_n = u_trans_n(*ta, uid);
    double w = 0;
    
    for (k = 0; k < e_n; k++)
    {
        if(e[k].del) continue;
        if(vis[e[k].tn] != flag) continue;
        w += (e[k].nw>=0?e[k].nw:-e[k].nw);
    }
    return w;
}

// Assembly:
movq 0x10(%rsi), %r8
movq 0x28(%rsi), %rax
movl %edi, %esi
movq (%rax,%rsi,8), %rax
movl %eax, %esi
movq %rax, %rdi
shrq $0x20, %rdi
imulq $0x30, %rsi, %rax
imulq $0x30, %rdi, %rsi
addq %r8, %rsi
addq $0x28, %rsi
xorpd %xmm0, %xmm0
xorl %edi, %edi
movapd 0xd7aa8(%rip), %xmm1    # 0x1ed0c0
cmpq %rdi, %rax
je 0x11565b
cmpb $0x0, (%rsi,%rdi)
js 0x115655
movl -0x14(%rsi,%rdi), %r8d
cmpb %cl, (%rdx,%r8)
jne 0x115655
movsd -0x8(%rsi,%rdi), %xmm2
movapd %xmm2, %xmm3
xorpd %xmm1, %xmm3
movapd %xmm3, %xmm4
cmpnlesd %xmm2, %xmm4
andpd %xmm4, %xmm3
andnpd %xmm2, %xmm4
orpd %xmm3, %xmm4
addsd %xmm4, %xmm0
addq $0x30, %rdi
jmp 0x115618
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: update_bubble_weight(bub_sort_vec*, unsigned int, kv_u_trans_t*, unsigned char*, unsigned int)
void update_bubble_weight(bub_sort_vec* w_stack, uint32_t idx, kv_u_trans_t *ta, uint8_t* vis, uint32_t flag_cur)
{
    w_stack->a[idx].used = 1;
    uint32_t k, m, uid = w_stack->a[idx].p_id>>1;
    u_trans_t *e = u_trans_a(*ta, uid);
    uint32_t e_n = u_trans_n(*ta, uid);
    for (k = 0; k < e_n; k++)
    {
        if(e[k].del) continue;
        if(vis[e[k].tn] != flag_cur) continue;
        for (m = 0; m < w_stack->n; m++)
        {
            if(e[k].tn == (w_stack->a[m].p_id>>1)) break;
        }
        if(m >= w_stack->n) continue;
        if(w_stack->a[m].used) continue;
        w_stack->a[m].weight += (e[k].nw>=0?e[k].nw:-e[k].nw);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rax
movl %esi, %esi
imulq $0x28, %rsi, %rsi
movb $0x1, 0x20(%rax,%rsi)
movq 0x28(%rdx), %r9
movabsq $0x1fffffffe, %r10      # imm = 0x1FFFFFFFE
andq 0x8(%rax,%rsi), %r10
movq (%r9,%r10,4), %r9
movl %r9d, %esi
shrq $0x20, %r9
imulq $0x30, %r9, %r9
addq 0x10(%rdx), %r9
xorl %edx, %edx
movapd 0xd7a1e(%rip), %xmm0    # 0x1ed0c0
cmpq %rsi, %rdx
je 0x115726
imulq $0x30, %rdx, %r10
cmpb $0x0, 0x28(%r9,%r10)
js 0x11571e
addq %r9, %r10
movl 0x14(%r10), %ebx
movzbl (%rcx,%rbx), %r11d
cmpl %r8d, %r11d
jne 0x11571e
movq 0x8(%rdi), %r14
xorl %ebp, %ebp
movl %ebp, %r15d
cmpq %r15, %r14
jbe 0x11571e
imulq $0x28, %r15, %r11
movq 0x8(%rax,%r11), %r12
shrq %r12
leal 0x1(%r15), %ebp
cmpq %rbx, %r12
jne 0x1156ca
cmpb $0x0, 0x20(%rax,%r11)
jne 0x11571e
movsd 0x20(%r10), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movapd %xmm2, %xmm3
cmpnlesd %xmm1, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm1, %xmm3
orpd %xmm2, %xmm3
addsd (%rax,%r11), %xmm3
movsd %xmm3, (%rax,%r11)
incq %rdx
jmp 0x1156a2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: reorder_bubbles(bubble_type*, kv_u_trans_t*, unsigned int)
void reorder_bubbles(bubble_type* bub, kv_u_trans_t *ta, uint32_t n_utg)
{
    // double index_time = yak_realtime();
    uint8_t* vis = NULL; MALLOC(vis, n_utg);
    bub_sort_vec w_stack; kv_init(w_stack);
    uint32_t i;

    for (i = 0; i < bub->chain_weight.n; i++)
    {
        if(bub->chain_weight.a[i].del) continue;
        reorder_bubbble_chain(ta, bub, &w_stack, vis, n_utg, bub->chain_weight.a[i].id);
    }

    free(vis); kv_destroy(w_stack);
    // fprintf(stderr, "[M::%s::%.3f]\n", __func__, yak_realtime()-index_time);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %edi
callq 0x2280
movq %rax, %r12
xorps %xmm0, %xmm0
movq %rsp, %r13
movaps %xmm0, (%r13)
andq $0x0, 0x10(%r13)
xorl %ebp, %ebp
movl %ebp, %ebp
cmpq %rbp, 0xc8(%r15)
jbe 0x115ab5
movq 0xd8(%r15), %rax
movq %rbp, %rcx
shlq $0x5, %rcx
cmpb $0x0, 0x18(%rax,%rcx)
jne 0x115ab1
addq %rcx, %rax
movl 0x10(%rax), %r9d
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %rcx
movl %ebx, %r8d
callq 0x11572f
incl %ebp
jmp 0x115a76
movq %r12, %rdi
callq 0x2220
movq (%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: destory_contig_partition(H_partition*)
void destory_contig_partition(H_partition* hap)
{
    free(hap->lock);
    free(hap->hap);
    destory_G_partition(&(hap->g_p));
    destory_G_partition(&(hap->group_g_p));
    kv_destroy(hap->label_buffer);
    kv_destroy(hap->b.vis);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2220
movq 0x10(%rbx), %rdi
callq 0x2220
leaq 0x38(%rbx), %rdi
callq 0x10191d
leaq 0x58(%rbx), %rdi
callq 0x10191d
movq 0x88(%rbx), %rdi
callq 0x2220
movq 0xa0(%rbx), %rdi
popq %rbx
jmp 0x2220