LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0xc0(%rdx), %rax
movl %r9d, %ecx
leaq (%rcx,%rcx,4), %r13
shlq $0x3, %r13
addq 0x10(%rax), %r13
movq %rdi, %rbp
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%r8)
movq %rcx, 0x18(%rsp)
movq %rcx, 0x30(%r8)
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
leaq 0x18(%rsp), %r9
movq %r8, %rdi
movq %r13, %rcx
movl $0x1, %r8d
pushq %rax
callq 0x15505a
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x156109
movq 0x70(%rsp), %r14
movq 0x8(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq %r13, %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
testl %eax, %eax
jne 0x156109
movq 0x30(%rsp), %rax
cmpq $-0x1, %rax
sete %dl
movq 0x28(%rsp), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
jne 0x1560d6
movsd 0x30(%r14), %xmm1
movsd 0x18(%rbx), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1560d6
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)
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
movl $0x1, %r8d
leaq 0x18(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
callq 0x15505a
addq $0x10, %rsp
cmpl $-0x1, %eax
jne 0x15603d
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: 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 0x68(%rsp), %rdi
movq 0x60(%rsp), %r10
movq 0xc0(%r15), %rax
movl %r8d, %ecx
leaq (%rcx,%rcx,4), %rbp
shlq $0x3, %rbp
addq 0x10(%rax), %rbp
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%rdx)
leaq 0x90(%r13), %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0xb0(%r13)
movq $-0x1, %rax
movq %rax, (%rsi)
movq %rax, (%rdi)
movq %rax, (%r10)
movq %r9, 0x10(%rsp)
movq %rax, (%r9)
subq $0x8, %rsp
leaq 0x8(%rsp), %rax
leaq 0x10(%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 0x156444
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 0x1553fd
addq $0x20, %rsp
testl %eax, %eax
jne 0x156444
movq 0x20(%rsp), %rax
cmpq $-0x1, %rax
sete %dl
movq 0x18(%rsp), %rcx
cmpq $-0x1, %rcx
sete %sil
orb %dl, %sil
jne 0x15641f
movq 0x78(%rsp), %rdx
movsd (%rdx), %xmm1
movsd 0xa8(%r13), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x15641f
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)
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
leaq 0x10(%rsp), %r9
leaq 0x8(%rsp), %rax
jmp 0x156371
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/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 0x30(%rsp), %rax
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %r10
leaq 0x18(%rsp), %r11
leaq 0x28(%rsp), %r8
leaq 0x20(%rsp), %r9
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rcx
pushq %rax
pushq %rdx
pushq %r10
pushq %r11
callq 0x156118
addq $0x20, %rsp
testl %eax, %eax
je 0x15670a
leaq 0x90(%r12), %r13
leaq 0x20(%rsp), %rbp
movq 0xc0(%r14), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x3, %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 0x155809
addq $0x20, %rsp
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 0x156118
addq $0x20, %rsp
testl %eax, %eax
jne 0x156690
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: 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
testq %rcx, %rcx
je 0x156975
movq 0x8(%rdi), %rdx
movsd 0xdaa4c(%rip), %xmm0    # 0x231310
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x40, %edi
xorl %r8d, %r8d
xorpd %xmm1, %xmm1
cmpb $0x0, (%rdx,%r8)
jne 0x156961
movq 0x10(%rsi), %r9
xorpd %xmm2, %xmm2
cmpl $0x0, -0x28(%r9,%rdi)
je 0x156914
movl -0x1c(%r9,%rdi), %r10d
cmpl $0x1, %r10d
je 0x156901
cmpl $-0x1, %r10d
jne 0x156914
xorps %xmm2, %xmm2
cvtsi2sd %r10d, %xmm2
mulsd -0x10(%r9,%rdi), %xmm2
addsd %xmm1, %xmm2
cmpl $0x0, -0x24(%r9,%rdi)
je 0x156940
movl -0x18(%r9,%rdi), %r10d
cmpl $0x1, %r10d
je 0x15692d
cmpl $-0x1, %r10d
jne 0x156940
xorps %xmm3, %xmm3
cvtsi2sd %r10d, %xmm3
mulsd -0x8(%r9,%rdi), %xmm3
addsd %xmm3, %xmm2
movsd (%r9,%rdi), %xmm3
addsd %xmm3, %xmm3
addsd %xmm2, %xmm3
ucomisd %xmm1, %xmm3
jae 0x156961
ucomisd %xmm3, %xmm0
jbe 0x156961
movapd %xmm3, %xmm0
movl %r8d, %eax
incq %r8
movl %r8d, %r9d
addq $0x48, %rdi
cmpq %r9, %rcx
ja 0x1568d5
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
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 0x1559c4
movsd %xmm0, 0x18(%rsp)
movq (%r14), %rdx
movq 0x8(%r14), %rdi
xorl %esi, %esi
callq 0x20e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1568ac
cmpl $-0x1, %eax
je 0x1569e1
movq 0x8(%r14), %rcx
movl %eax, %edx
movb $0x1, (%rcx,%rdx)
movq 0x30(%r14), %rsi
movq %rbx, %rdi
movl %eax, %ecx
callq 0x154db7
jmp 0x1569b7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1559c4
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 0x1569a3
cmpq $0x0, (%rbx)
je 0x156a35
xorl %r15d, %r15d
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %ecx
callq 0x153f73
incl %r15d
cmpq %r15, (%rbx)
ja 0x156a1f
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
xorpd %xmm0, %xmm0
cmpq %rdx, %rsi
ja 0x15730d
movb 0x8(%rsp), %al
movq 0x10(%r8), %rcx
movl (%rdi,%rsi,8), %r8d
shrl %r8d
leaq (%r8,%r8,2), %r10
shlq $0x4, %r10
movq (%rcx,%r10), %r8
testq %r8, %r8
je 0x157305
addq %rcx, %r10
movq 0x10(%r10), %r10
cmpb $0x0, 0x18(%r10)
js 0x1572fc
movl 0x8(%r10), %r11d
cmpb %al, (%r9,%r11)
jne 0x1572fc
addsd (%r10), %xmm0
addq $0x28, %r10
decq %r8
jne 0x1572e6
incq %rsi
cmpq %rdx, %rsi
jbe 0x1572c7
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x157333
movl (%rsi), %eax
incl %eax
jmp 0x157335
xorl %eax, %eax
movq 0x8(%rdi), %rcx
movl %eax, %r10d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %r10, %rcx
jbe 0x157394
movq (%rdi), %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq (%r10,%r10,4), %r10
cmpb $0x0, 0x20(%r8,%r10,8)
jne 0x15738a
leaq (%r8,%r10,8), %r10
movq 0x8(%r10), %r11
testq %rsi, %rsi
je 0x15736f
cmpq %r9, %r11
jne 0x15738a
jmp 0x1573d4
cmpq %r9, %r11
je 0x15738a
movsd (%r10), %xmm1
cmpl $-0x1, %edx
je 0x157384
ucomisd %xmm0, %xmm1
jbe 0x15738a
movl %eax, %edx
movapd %xmm1, %xmm0
incl %eax
movq %rax, %r10
cmpq %rax, %rcx
ja 0x15734f
testq %rsi, %rsi
je 0x1573d2
cmpl $0x0, (%rsi)
sete %al
testq %rcx, %rcx
sete %sil
orb %al, %sil
jne 0x1573d2
movq (%rdi), %rsi
xorl %eax, %eax
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
leaq (%rax,%rax,4), %r8
cmpb $0x0, 0x20(%rsi,%r8,8)
jne 0x1573cb
leaq (%rsi,%r8,8), %r8
cmpq %rdi, 0x8(%r8)
je 0x1573d4
incl %eax
cmpq %rax, %rcx
ja 0x1573b5
movl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq (%rsi), %rax
movl %edx, %edx
leaq (%rdx,%rdx,4), %rsi
movb $0x1, 0x20(%rax,%rsi,8)
movq 0x10(%rax,%rsi,8), %rdx
movq 0x18(%rax,%rsi,8), %rsi
cmpq %rsi, %rdx
ja 0x15745d
movq 0x10(%rcx), %rcx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl (%rdi,%rdx,8), %r10d
shrl %r10d
leaq (%r10,%r10,2), %r11
shlq $0x4, %r11
movq (%rcx,%r11), %r10
testq %r10, %r10
je 0x157455
addq %rcx, %r11
movq 0x10(%r11), %r11
cmpb $0x0, 0x18(%r11)
js 0x15744c
movl 0x8(%r11), %ebx
movl (%r8,%rbx,4), %ebx
cmpq %r9, %rbx
je 0x15744c
leaq (%rbx,%rbx,4), %rbx
cmpb $0x0, 0x20(%rax,%rbx,8)
jne 0x15744c
leaq (%rax,%rbx,8), %rbx
movsd (%r11), %xmm0
addsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
addq $0x28, %r11
decq %r10
jne 0x15741c
incq %rdx
cmpq %rsi, %rdx
jbe 0x1573fd
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1579ed
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
movq $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 0xcba40
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x1579d4
cmpb $0x0, 0x28(%rax)
movsd 0x8(%rsp), %xmm0
js 0x1579da
addsd 0x20(%rax), %xmm0
jmp 0x1579da
movsd 0x8(%rsp), %xmm0
cmpl %ebp, %r12d
jne 0x15798d
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_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:
xorl %eax, %eax
movq %rax, (%rcx)
movq %rax, (%rdx)
movl %edi, %eax
cmpq %rax, 0x18(%rsi)
jbe 0x157a66
movq 0x28(%rsi), %rdi
movq (%rdi,%rax,8), %rax
testl %eax, %eax
je 0x157a66
movq 0x10(%rsi), %rsi
movq %rax, %rdi
shrq $0x20, %rdi
movl %eax, %r9d
leaq (%rdi,%rdi,2), %rax
shlq $0x4, %rax
addq %rsi, %rax
addq $0x28, %rax
shlq $0x4, %r9
leaq (%r9,%r9,2), %rsi
xorl %edi, %edi
cmpb $0x0, (%rax,%rdi)
js 0x157a5d
movl -0x14(%rax,%rdi), %r9d
cmpb $0x0, (%r8,%r9)
movq %rdx, %r9
jle 0x157a58
movsd -0x8(%rax,%rdi), %xmm0
addsd (%r9), %xmm0
movsd %xmm0, (%r9)
jmp 0x157a5d
movq %rcx, %r9
js 0x157a46
addq $0x30, %rdi
cmpq %rdi, %rsi
jne 0x157a31
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x157ac8
shrl %edi
movq (%rbx), %r8
movq %r15, %rsi
movq %r13, %rdx
leaq 0x8(%rsp), %rcx
movapd %xmm1, 0x10(%rsp)
callq 0x1579ee
movapd 0x10(%rsp), %xmm1
addpd (%rsp), %xmm1
movl %r12d, %edi
cmpl %ebp, %r12d
jne 0x157a8d
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
subsd %xmm0, %xmm1
movb $0x1, %al
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x157b49
movb $-0x1, %al
ucomisd %xmm0, %xmm1
ja 0x157b49
movabsq $-0x61c8864680b583eb, %rax # imm = 0x9E3779B97F4A7C15
addq 0x8(%rbx), %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, %rax # imm = 0x94D049BB133111EB
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x1f, %rcx
xorq %rax, %rcx
movq %rcx, 0x8(%rbx)
andl $0x1, %ecx
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
orb $0x1, %al
movq 0x18(%r14), %rcx
movl (%rcx), %ecx
movl %ecx, %edx
imulq $0x38, %rdx, %rdx
movq (%r14), %rsi
movq 0x18(%r14), %rdi
movl (%rsi,%rdx), %edx
cmpl (%rdi), %ecx
je 0x157b6b
movq (%rbx), %rsi
shrl %ecx
movb %al, (%rsi,%rcx)
movl %edx, %ecx
cmpl %ebp, %edx
jne 0x157b4f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: delete_sg_e_by_ug(asg_t*, ma_ug_t*, unsigned int, unsigned int)
void delete_sg_e_by_ug(asg_t* rg, ma_ug_t* ug, uint32_t v, uint32_t w)
{
    uint32_t vx, wx;
    vx = (v&1?((ug->u.a[v>>1].a[0]>>32)^1):(ug->u.a[v>>1].a[ug->u.a[v>>1].n-1]>>32));
    wx = (w&1?((ug->u.a[w>>1].a[ug->u.a[w>>1].n-1]>>32)^1):(ug->u.a[w>>1].a[0]>>32));
    asg_arc_del(rg, vx, wx, 1); asg_arc_del(rg, wx^1, vx^1, 1);
}

// Assembly:
movl %edx, %eax
shrl %eax
movq 0x10(%rsi), %rsi
leaq (%rax,%rax,4), %rax
testb $0x1, %dl
jne 0x159d28
movq 0x18(%rsi,%rax,8), %rdx
movl 0x10(%rsi,%rax,8), %eax
decl %eax
movl 0x4(%rdx,%rax,8), %eax
jmp 0x159d34
movq 0x18(%rsi,%rax,8), %rax
movl 0x4(%rax), %eax
xorq $0x1, %rax
movl %ecx, %edx
shrl %edx
testb $0x1, %cl
jne 0x159d4b
leaq (%rdx,%rdx,4), %rcx
movq 0x18(%rsi,%rcx,8), %rcx
movl 0x4(%rcx), %ecx
jmp 0x159d62
leaq (%rdx,%rdx,4), %rcx
movq 0x18(%rsi,%rcx,8), %rdx
movl 0x10(%rsi,%rcx,8), %ecx
decl %ecx
movl 0x4(%rdx,%rcx,8), %ecx
xorq $0x1, %rcx
movq 0x8(%rdi), %rsi
movq 0x28(%rdi), %r8
movq (%r8,%rax,8), %r9
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r9, %r10
andq %rdx, %r10
je 0x159db4
shrq $0x20, %r9
shlq $0x3, %r10
leaq (%r10,%r10,2), %r8
leaq (%r9,%r9,2), %r9
leaq (%rsi,%r9,8), %rsi
addq $0xc, %rsi
xorl %r9d, %r9d
cmpl %ecx, -0x4(%rsi,%r9)
jne 0x159da3
orb $-0x80, 0x3(%rsi,%r9)
addq $0x18, %r9
cmpq %r9, %r8
jne 0x159d96
movq 0x8(%rdi), %rsi
movq 0x28(%rdi), %r8
xorq $0x1, %rcx
movq (%r8,%rcx,8), %rdi
andq %rdi, %rdx
je 0x159df4
shrq $0x20, %rdi
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rcx
leaq (%rdi,%rdi,2), %rdx
leaq (%rsi,%rdx,8), %rdx
addq $0xc, %rdx
xorl %esi, %esi
movl -0x4(%rdx,%rsi), %edi
xorl %eax, %edi
cmpl $0x1, %edi
jne 0x159deb
orb $-0x80, 0x3(%rdx,%rsi)
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0x159ddb
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x28(%rsi), %rax
movl %edi, %edi
movq (%rax,%rdi,8), %rdi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rdi, %rax
je 0x15b9a7
movq 0x10(%rsi), %rsi
shrq $0x20, %rdi
shlq $0x4, %rax
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rdi, %rsi
addq $0x28, %rsi
xorpd %xmm0, %xmm0
xorl %edi, %edi
movapd 0xdf86b(%rip), %xmm1    # 0x23b1d0
cmpb $0x0, (%rsi,%rdi)
js 0x15b99d
movl -0x14(%rsi,%rdi), %r8d
cmpb %cl, (%rdx,%r8)
jne 0x15b99d
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
cmpq %rdi, %rax
jne 0x15b965
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq (%rdi), %rax
movl %esi, %esi
leaq (%rsi,%rsi,4), %rsi
movb $0x1, 0x20(%rax,%rsi,8)
movq 0x28(%rdx), %r9
movabsq $0x1fffffffe, %r10      # imm = 0x1FFFFFFFE
andq 0x8(%rax,%rsi,8), %r10
movq (%r9,%r10,4), %r9
testl %r9d, %r9d
je 0x15ba92
movq %r9, %rsi
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %rsi
shlq $0x4, %rsi
addq 0x10(%rdx), %rsi
movl %r9d, %edx
xorl %r9d, %r9d
movapd 0xdf7d0(%rip), %xmm0    # 0x23b1d0
leaq (%r9,%r9,2), %r10
shlq $0x4, %r10
cmpb $0x0, 0x28(%rsi,%r10)
js 0x15ba86
addq %rsi, %r10
movl 0x14(%r10), %r11d
movzbl (%rcx,%r11), %ebx
cmpl %r8d, %ebx
jne 0x15ba86
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x15ba86
movl $0x1, %ebp
xorl %r14d, %r14d
leaq (%r14,%r14,4), %r14
movq 0x8(%rax,%r14,8), %r15
shrq %r15
cmpq %r11, %r15
je 0x15ba4f
movl %ebp, %r14d
incl %ebp
cmpq %r14, %rbx
ja 0x15ba32
jmp 0x15ba86
cmpb $0x0, 0x20(%rax,%r14,8)
jne 0x15ba86
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,%r14,8), %xmm3
movsd %xmm3, (%rax,%r14,8)
incq %r9
cmpq %rdx, %r9
jne 0x15ba00
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %edi
callq 0x2280
movq %rax, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0xc8(%r15), %rax
testq %rax, %rax
je 0x15be6e
movl $0x1, %r13d
xorl %ecx, %ecx
movq %rsp, %r12
movq 0xd8(%r15), %rdx
shlq $0x5, %rcx
cmpb $0x0, 0x18(%rdx,%rcx)
jne 0x15be5d
addq %rcx, %rdx
movl 0x10(%rdx), %r9d
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x15ba99
movq 0xc8(%r15), %rax
movl %r13d, %ecx
incl %r13d
cmpq %rcx, %rax
ja 0x15be29
movq (%rsp), %r14
jmp 0x15be71
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x2220
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/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 0x149558
leaq 0x58(%rbx), %rdi
callq 0x149558
movq 0x88(%rbx), %rdi
callq 0x2220
movq 0xa0(%rbx), %rdi
popq %rbx
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: label_unitigs_sm(signed char*, mc_gg_status*, ma_ug_t*)
void label_unitigs_sm(int8_t *s, mc_gg_status *sa, ma_ug_t* ug)
{
    memset(R_INF.trio_flag, AMBIGU, R_INF.total_reads * sizeof(uint8_t));
    uint32_t i, k, flag = AMBIGU;
    ma_utg_t *u = NULL;

    for (i = 0; i < ug->g->n_seq; i++)
    {
        if(ug->g->seq[i].del) continue;
        flag = 0;
        if(s)
        {
            if(s[i] == 0) continue;
            flag = (s[i] > 0? FATHER:MOTHER);
        }

        if(sa)
        {
            if(sa[i].s != 1 && sa[i].s != 2) continue;
            flag = sa[i].s;
        }
        
        u = &ug->u.a[i];
        if(u->m == 0) continue;
        for (k = 0; k < u->n; k++)
        {
            R_INF.trio_flag[u->a[k]>>33] = flag;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x139c68(%rip), %r12    # 0x296230
movq 0x28(%r12), %rdi
movq 0x50(%r12), %rdx
xorl %esi, %esi
callq 0x20e0
movq 0x18(%rbx), %rcx
testl $0x7fffffff, 0x14(%rcx) # imm = 0x7FFFFFFF
je 0x15c67a
xorl %eax, %eax
movq 0x20(%rcx), %rdx
cmpl $0x0, (%rdx,%rax,8)
js 0x15c665
testq %r15, %r15
je 0x15c60c
cmpb $0x0, (%r15,%rax)
je 0x15c665
setle %dl
movzbl %dl, %edx
incl %edx
jmp 0x15c60e
xorl %edx, %edx
testq %r14, %r14
je 0x15c626
movq %rax, %rdx
shlq $0x5, %rdx
movl (%r14,%rdx), %edx
leal -0x1(%rdx), %esi
cmpl $0x1, %esi
ja 0x15c665
movq 0x10(%rbx), %rsi
leaq (%rax,%rax,4), %rdi
cmpl $0x0, 0xc(%rsi,%rdi,8)
je 0x15c665
leaq (%rsi,%rdi,8), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x15c665
xorl %ecx, %ecx
movq 0x28(%r12), %rdi
movq 0x18(%rsi), %r8
movq (%r8,%rcx,8), %r8
shrq $0x21, %r8
movb %dl, (%rdi,%r8)
incq %rcx
movl 0x10(%rsi), %edi
cmpq %rdi, %rcx
jb 0x15c641
movq 0x18(%rbx), %rcx
incq %rax
movl 0x14(%rcx), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpq %rdx, %rax
jb 0x15c5ec
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: print_debug_bubble_graph(bubble_type*, ma_ug_t*, char const*)
void print_debug_bubble_graph(bubble_type* bub, ma_ug_t* ug, const char *fn)
{
    char *buf = (char*)calloc(strlen(fn) + 25, 1);
    sprintf(buf, "%s.bub.gfa", fn);
    FILE* fp = fopen(buf, "w");

    print_bubble_utg(bub, ug, "btg", fp);

    fclose(fp);
    free(buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x2090
leaq 0x19(%rax), %rdi
movl $0x1, %esi
callq 0x2120
movq %rax, %r12
leaq 0xdf507(%rip), %rsi     # 0x23c41c
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xeb7b9(%rip), %rsi     # 0x2486e2
movq %r12, %rdi
callq 0x2210
movq %rax, %r15
leaq 0xdf4ec(%rip), %rdx     # 0x23c427
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rcx
callq 0x15cab4
movq %r15, %rdi
callq 0x2190
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: print_bubble_chain(bubble_type*)
void print_bubble_chain(bubble_type* bub)
{
    uint32_t m, i, k;
    uint32_t beg, sink, *a = NULL, n;
    uint64_t bid;
    ma_utg_t *u = NULL; 
    for (m = 0; m < bub->chain_weight.n; m++)
    {
        if(bub->chain_weight.a[m].del) continue;
        u = &(bub->b_ug->u.a[bub->chain_weight.a[m].id]);
        fprintf(stderr, "\nChain_id=%lu\n", bub->chain_weight.a[m].id);
        for (i = 0; i < u->n; i++)
        {
            bid = u->a[i]>>33;
            get_bubbles(bub, bid, &beg, &sink, &a, &n, NULL);
            fprintf(stderr, "btg%.6lu%c, beg-utg%.6ul, sink-utg%.6ul\n", 
                        bid, "fb"[bid<bub->f_bub?0:1], (beg>>1)+1, (sink>>1)+1);
            for (k = 0; k < n; k++)
            {
                if(k != 0 && (k%5)==0) fprintf(stderr, "\n");
                fprintf(stderr, "m-utg%.6ul\t", (a[k]>>1)+1);
            }
            fprintf(stderr, "\n");
            
        }
    }
}

// Assembly:
cmpq $0x0, 0xc8(%rdi)
je 0x15d0ad
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x138056(%rip), %r13    # 0x294fe0
xorl %eax, %eax
xorl %r14d, %r14d
movq 0xd8(%rbx), %rcx
shlq $0x5, %rax
cmpb $0x0, 0x18(%rcx,%rax)
je 0x15cfb5
incl %r14d
movq %r14, %rax
cmpq %r14, 0xc8(%rbx)
ja 0x15cf8f
jmp 0x15d09f
addq %rax, %rcx
movq 0xc0(%rbx), %rax
movq 0x10(%rax), %r15
movq 0x10(%rcx), %rdx
leaq (%rdx,%rdx,4), %r12
movq (%r13), %rdi
leaq 0xdf455(%rip), %rsi     # 0x23c42b
xorl %eax, %eax
callq 0x22b0
cmpl $0x0, 0x10(%r15,%r12,8)
je 0x15cfa1
leaq (%r15,%r12,8), %rax
xorl %r15d, %r15d
movq %rax, 0x10(%rsp)
movq 0x18(%rax), %rax
movq (%rax,%r15,8), %rdx
shrq $0x21, %rdx
movq 0x28(%rbx), %rcx
movq 0x40(%rbx), %rax
movq %r13, %r12
movl (%rax,%rdx,4), %r13d
movl 0x4(%rax,%rdx,4), %ebp
subl %r13d, %ebp
movl (%rcx,%r13,4), %r8d
leal 0x1(%r13), %eax
movq %rcx, 0x8(%rsp)
movl (%rcx,%rax,4), %r9d
movq (%r12), %rdi
cmpq 0x80(%rbx), %rdx
leaq 0xde99c(%rip), %rax     # 0x23b9d2
sbbq $-0x1, %rax
movsbl (%rax), %ecx
shrl %r8d
incl %r8d
shrl %r9d
incl %r9d
leaq 0xdf3ea(%rip), %rsi     # 0x23c43a
xorl %eax, %eax
callq 0x22b0
addl $-0x2, %ebp
jne 0x15d089
movq (%r12), %rsi
movl $0xa, %edi
callq 0x2270
incq %r15
movq 0x10(%rsp), %rcx
movl 0x10(%rcx), %eax
cmpq %rax, %r15
movq %r12, %r13
movq %rcx, %rax
jb 0x15cff1
jmp 0x15cfa1
movq 0x8(%rsp), %rax
leaq (%rax,%r13,4), %rsi
addq $0x8, %rsi
movl %ebp, %edi
callq 0x1cc14
jmp 0x15d05c
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: reset_H_partition(H_partition*, unsigned int)
void reset_H_partition(H_partition* hap, uint32_t is_init)
{
    if(!is_init)
    {
        hap->n = 0;
        free(hap->lock);
        free(hap->hap);
        hap->m[0] = hap->m[1] = hap->m[2] = (uint32_t)-1;
        hap->label = hap->label_add = hap->label_shift = (uint32_t)-1;
        destory_G_partition(&(hap->g_p)); memset(&(hap->g_p), 0, sizeof(G_partition));
        destory_G_partition(&(hap->group_g_p)); memset(&(hap->group_g_p), 0, sizeof(G_partition));
        kv_destroy(hap->label_buffer); kv_init(hap->label_buffer);
        kv_destroy(hap->b.vis); kv_init(hap->b.vis); memset(&(hap->b), 0, sizeof(block_phase_type));
    }

    memset(hap, 0, sizeof(H_partition));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
jne 0x15d5ec
xorl %r14d, %r14d
movq %r14, (%rbx)
movq 0x8(%rbx), %rdi
callq 0x2220
movq 0x10(%rbx), %rdi
callq 0x2220
leaq 0x38(%rbx), %rdi
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x18(%rbx)
movq $-0x1, 0x28(%rbx)
callq 0x149558
pxor %xmm0, %xmm0
movdqu %xmm0, 0x48(%rbx)
movdqu %xmm0, 0x38(%rbx)
leaq 0x58(%rbx), %rdi
callq 0x149558
pxor %xmm0, %xmm0
movdqu %xmm0, 0x68(%rbx)
movdqu %xmm0, 0x58(%rbx)
movq 0x88(%rbx), %rdi
callq 0x2220
movq %r14, 0x88(%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x78(%rbx)
movq 0xa0(%rbx), %rdi
callq 0x2220
movl $0xc8, %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: alignment_worker_pipeline(sldat_t*, enzyme const*, enzyme const*)
int alignment_worker_pipeline(sldat_t* sl, const enzyme *fn1, const enzyme *fn2)
{
    double index_time = yak_realtime();
    int i;
    for (i = 0; i < fn1->n && i < fn2->n; i++)
    {
        gzFile fp1, fp2;
        if ((fp1 = gzopen(fn1->a[i], "r")) == 0) return 0;
        if ((fp2 = gzopen(fn2->a[i], "r")) == 0) return 0;
        sl->ks1 = kseq_init(fp1);
        sl->ks2 = kseq_init(fp2);

        kt_pipeline(3, worker_pipeline, sl, 3);
        
        kseq_destroy(sl->ks1);
        kseq_destroy(sl->ks2);
        gzclose(fp1);
        gzclose(fp2);
    }
    fprintf(stderr, "[M::%s::%.3f] ==> Qualification\n", __func__, yak_realtime()-index_time);

    dedup_hits(&(sl->hits), 1);    
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, (%rsp)
callq 0x1365ef
movsd %xmm0, 0x8(%rsp)
cmpl $0x0, 0x8(%r12)
jle 0x15d700
xorl %r14d, %r14d
leaq 0xe21bc(%rip), %r15     # 0x23f7f7
movq %r12, 0x10(%rsp)
movslq 0x8(%r13), %rax
cmpq %rax, %r14
jge 0x15d700
movq 0x10(%r12), %rax
movq (%rax,%r14,8), %rdi
movq %r15, %rsi
callq 0x22d0
xorl %r12d, %r12d
testq %rax, %rax
je 0x15d715
movq %rax, %rbp
movq %r15, %rsi
movq %r13, %rbx
movq 0x10(%r13), %rax
movq (%rax,%r14,8), %rdi
callq 0x22d0
testq %rax, %rax
je 0x15d715
movq %rax, %r13
movq %rbp, %rdi
callq 0x13d88c
movq (%rsp), %r12
movq %rax, 0x8(%r12)
movq %r13, %rdi
callq 0x13d88c
movq %rax, 0x10(%r12)
movl $0x3, %edi
leaq 0x71(%rip), %rsi        # 0x15d727
movq %r12, %rdx
movl $0x3, %ecx
callq 0x1090f4
movq 0x8(%r12), %rdi
callq 0x13dc3f
movq 0x10(%r12), %rdi
callq 0x13dc3f
movq %rbp, %rdi
callq 0x2390
movq %r13, %rdi
callq 0x2390
incq %r14
movq 0x10(%rsp), %r12
movslq 0x8(%r12), %rax
cmpq %rax, %r14
movq %rbx, %r13
jl 0x15d640
movsd 0x8(%rsp), %xmm0
movq (%rsp), %rdi
callq 0x1cc88
movl $0x1, %r12d
movl %r12d, %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: debug_gfa_space(ha_ug_index*, ma_ug_t*, trans_chain*, kv_u_trans_t*)
void debug_gfa_space(ha_ug_index* idx, ma_ug_t* ug, trans_chain* t_ch, kv_u_trans_t *ref)
{
    bubble_type bub; 
    memset(&bub, 0, sizeof(bubble_type));
    bub.round_id = 0; bub.n_round = 2;

    identify_bubbles(ug, &bub, t_ch->ir_het, ref);

    hc_links link;
    init_hc_links(&link, ug->g->n_seq, t_ch);

    measure_distance(idx, ug, NULL, &link, &bub, &(t_ch->k_trans));

    // uint32_t i, k;
    // for (i = 0; i < link.a.n; ++i) 
    // {
    //     for (k = 0; k < link.a.a[i].e.n; k++)
    //     {
    //         if(link.a.a[i].e.a[k].del || link.a.a[i].e.a[k].dis == (uint64_t)-1) continue;
    //         fprintf(stderr, "s-utg%.6dl\td-utg%.6dl\t%lu\n", 
    //             (int)(i+1), (int)(link.a.a[i].e.a[k].uID+1), 
    //             link.a.a[i].e.a[k].dis == (uint64_t)-1? (uint64_t)-1 : link.a.a[i].e.a[k].dis>>3);
    //     }
    // }



    destory_bubbles(&bub);
    destory_hc_links(&link);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
leaq 0x38(%rsp), %rbx
movl $0x110, %edx            # imm = 0x110
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20e0
movl $0x2, 0xc(%rbx)
movq 0x10(%r14), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rcx
callq 0x13e8a1
movq 0x18(%r15), %rax
movl 0x14(%rax), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0xbf70f
addq $0x138, %r14            # imm = 0x138
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
movq %rbx, %r8
movq %r14, %r9
callq 0x1456f7
movq %rbx, %rdi
callq 0x13dea7
movq %r12, %rdi
callq 0xbf835
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_u_trans_spec_idx(kv_u_trans_t*, unsigned int, unsigned int, u_trans_t**, unsigned int*, unsigned int*)
uint32_t get_u_trans_spec_idx(kv_u_trans_t *ta, uint32_t qn, uint32_t tn, u_trans_t **r_a, uint32_t *occ, uint32_t *idx)
{
    if(r_a) (*r_a) = NULL; 
    if(occ) (*occ) = 0;
    if(idx) (*idx) = (uint32_t)-1;
    u_trans_t *a = NULL;
    uint32_t n, st, i;
    a = u_trans_a(*ta, qn);
    n = u_trans_n(*ta, qn);
    for (st = 0, i = 1; i <= n; ++i)
    {
        if (i == n || a[i].tn != a[st].tn)
        {
            if(a[st].tn == tn)
            {
                if(r_a) (*r_a) = a + st;
                if(occ) (*occ) = i - st;
                if(idx) (*idx) = st + ((*ta).idx.a[(qn)]>>32);
                return 1;
            }
            st = i;
        }
    }
    return 0;
}

// Assembly:
testq %rcx, %rcx
je 0x15db2d
movq $0x0, (%rcx)
testq %r8, %r8
je 0x15db39
movl $0x0, (%r8)
testq %r9, %r9
je 0x15db45
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x28(%rdi), %rax
movl %esi, %esi
movq (%rax,%rsi,8), %rbx
testl %ebx, %ebx
je 0x15dbc0
movq %rbx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %r11
shlq $0x4, %r11
addq 0x10(%rdi), %r11
xorl %r10d, %r10d
movl $0x1, %eax
movl %r10d, %r14d
cmpl %eax, %ebx
jne 0x15db8c
leaq (%r14,%r14,2), %r15
shlq $0x4, %r15
movl 0x14(%r11,%r15), %ebp
jmp 0x15dbb0
movl %eax, %r15d
leaq (%r15,%r15,2), %r15
shlq $0x4, %r15
leaq (%r14,%r14,2), %r12
shlq $0x4, %r12
movl 0x14(%r11,%r12), %ebp
cmpl %ebp, 0x14(%r11,%r15)
jne 0x15dbb0
movl %r10d, %r15d
jmp 0x15dbb7
movl %eax, %r15d
cmpl %edx, %ebp
je 0x15dbcb
incl %eax
movl %r15d, %r10d
cmpl %ebx, %eax
jbe 0x15db76
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %rcx, %rcx
je 0x15dbde
leaq (%r14,%r14,2), %rdx
shlq $0x4, %rdx
addq %rdx, %r11
movq %r11, (%rcx)
testq %r8, %r8
je 0x15dbe9
subl %r10d, %eax
movl %eax, (%r8)
movl $0x1, %eax
testq %r9, %r9
je 0x15dbc2
movq 0x28(%rdi), %rcx
addl 0x4(%rcx,%rsi,8), %r10d
movl %r10d, (%r9)
jmp 0x15dbc2
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: interpr_hit(ha_ug_index*, unsigned long, unsigned int, unsigned int*, unsigned int*, unsigned int*)
void interpr_hit(ha_ug_index* idx, uint64_t x, uint32_t rLen, uint32_t *uid, uint32_t *beg, uint32_t *end)
{
    if(uid) (*uid) = ((x<<1)>>(64 - idx->uID_bits)); 
    uint32_t rev = (x>>63);
    long long ref_p = x & idx->pos_mode;
    long long p_beg, p_end;

    if(rev)
    {
        p_end = ref_p;
        p_beg = p_end + 1 - rLen;
    }
    else
    {
        p_beg = ref_p; 
        p_end = p_beg + rLen - 1;
    }
    if(p_beg < 0) p_beg = 0;
    if(p_end < 0) p_end = 0;
    if(beg) (*beg) = p_beg; 
    if(end) (*end) = p_end + 1;
}

// Assembly:
testq %rcx, %rcx
je 0x15dd05
movq %rcx, %rax
leaq (%rsi,%rsi), %r10
xorl %ecx, %ecx
subb 0x18(%rdi), %cl
shrq %cl, %r10
movl %r10d, (%rax)
movq 0x30(%rdi), %rcx
andq %rsi, %rcx
movl %edx, %edx
leaq -0x1(%rdx), %rax
xorl %edi, %edi
testq %rsi, %rsi
cmovsq %rdi, %rax
addq %rcx, %rax
testq %rax, %rax
cmovleq %rdi, %rax
testq %r8, %r8
je 0x15dd45
negq %rdx
testq %rsi, %rsi
leaq 0x1(%rcx,%rdx), %rdx
cmovnsq %rcx, %rdx
xorl %ecx, %ecx
testq %rdx, %rdx
cmovgq %rdx, %rcx
movl %ecx, (%r8)
testq %r9, %r9
je 0x15dd4f
incl %eax
movl %eax, (%r9)
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: merge_u_trans_list(u_trans_t*, unsigned int)
double merge_u_trans_list(u_trans_t* a, uint32_t a_n)
{
    radix_sort_u_trans_occ(a, a + a_n);
    uint32_t k, l, i;
    double weight, w = 0;
    for (k = 1, l = 0; k <= a_n; ++k) 
    {   
        if (k == a_n || a[k].occ != a[l].occ) 
        {
            for (i = l, weight = 0; i < k; i++)
            {
                weight += a[i].nw;
            }
            
            /*******************************for debug************************************/
            // w += (weight/(double)(a[l].occ));
            w += weight;
            /*******************************for debug************************************/
            l = k;
        }
    }
    return w;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, %r14d
leaq (%r14,%r14,2), %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x136dab
testl %ebp, %ebp
je 0x15f96d
incl %ebp
cmpl $0x3, %ebp
movl $0x2, %eax
cmovael %ebp, %eax
xorl %esi, %esi
xorpd %xmm0, %xmm0
movl $0x1, %ecx
movq $-0x30, %rdx
cmpq %r14, %rcx
jne 0x15f918
movl %esi, %edi
jmp 0x15f936
leaq (%rcx,%rcx,2), %rdi
shlq $0x4, %rdi
movl 0x18(%rbx,%rdi), %r8d
movl %esi, %edi
leaq (%rdi,%rdi,2), %r9
shlq $0x4, %r9
cmpl 0x18(%rbx,%r9), %r8d
je 0x15f95f
xorpd %xmm1, %xmm1
cmpq %rcx, %rdi
jae 0x15f959
shlq $0x4, %rdi
leaq (%rdi,%rdi,2), %rsi
addsd 0x20(%rbx,%rsi), %xmm1
addq $0x30, %rsi
movq %rdx, %rdi
addq %rsi, %rdi
jne 0x15f947
addsd %xmm1, %xmm0
movl %ecx, %esi
incq %rcx
addq $-0x30, %rdx
cmpq %rax, %rcx
jne 0x15f90f
jmp 0x15f971
xorpd %xmm0, %xmm0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: is_hom_map(unsigned long, unsigned int, mc_interval_t*, unsigned int*, ha_ug_index*)
uint32_t is_hom_map(uint64_t x, uint32_t len, mc_interval_t *p, uint32_t *p_idx, ha_ug_index* idx)
{
    mc_interval_t *a = NULL;
    uint32_t uid, qs, qe, as, ae, occ, k;
    uint64_t oLen;
    interpr_hit(idx, x, len, &uid, &qs, &qe);

    a = p + p_idx[uid]; 
    occ = p_idx[uid+1] - p_idx[uid];
    for (k = 0; k < occ; k++)
    {
        as = a[k].bS;
        ae = a[k].bE;
        oLen = ((MIN(qe, ae) >= MAX(qs, as))? MIN(qe, ae) - MAX(qs, as) + 1 : 0);
        if(oLen == 0) continue;
        if(oLen > len*0.2) return 1;
    }
    return 0;
}

// Assembly:
movq %rcx, %r9
leaq (%rdi,%rdi), %r10
xorl %eax, %eax
movb 0x18(%r8), %r11b
xorl %ecx, %ecx
subb %r11b, %cl
shrq %cl, %r10
movq 0x30(%r8), %r11
andq %rdi, %r11
movl %esi, %r8d
movq %r11, %rcx
subq %r8, %rcx
leaq -0x1(%r8), %rsi
incq %rcx
testq %rdi, %rdi
cmovsq %rax, %rsi
cmovnsq %r11, %rcx
addq %r11, %rsi
testq %rsi, %rsi
cmovleq %rax, %rsi
testq %rcx, %rcx
cmovleq %rax, %rcx
movl %r10d, %edi
movl (%r9,%rdi,4), %r11d
incl %r10d
movl (%r9,%r10,4), %edi
cmpl %r11d, %edi
je 0x15fa8b
incl %esi
subl %r11d, %edi
cvtsi2sd %r8, %xmm0
mulsd 0xd1b35(%rip), %xmm0    # 0x231580
leaq (%r11,%r11,2), %r8
leaq (%rdx,%r8,8), %rdx
addq $0x4, %rdx
movl -0x4(%rdx), %r9d
movl (%rdx), %r8d
cmpl %r8d, %esi
cmovbl %esi, %r8d
cmpl %r9d, %ecx
cmoval %ecx, %r9d
subl %r9d, %r8d
jb 0x15fa82
incl %r8d
xorps %xmm1, %xmm1
cvtsi2sd %r8, %xmm1
ucomisd %xmm0, %xmm1
ja 0x15fa8c
addq $0x18, %rdx
decq %rdi
jne 0x15fa57
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: write_ps_t(ps_t*, char const*)
void write_ps_t(ps_t *s, const char *fn)
{
    char *buf = (char*)calloc(strlen(fn) + 25, 1);
    sprintf(buf, "%s.hic.pst.bin", fn);
    FILE* fp = fopen(buf, "w");

    fwrite(&(s->xs), sizeof(s->xs), 1, fp);
    fwrite(&(s->n), sizeof(s->n), 1, fp);
    fwrite(s->s, sizeof(int8_t), s->n, fp);

    fclose(fp);
    free(buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2090
leaq 0x19(%rax), %rdi
movl $0x1, %esi
callq 0x2120
movq %rax, %r14
leaq 0xdc182(%rip), %rsi     # 0x23c6cb
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xe8185(%rip), %rsi     # 0x2486e2
movq %r14, %rdi
callq 0x2210
movq %rax, %r15
leaq 0x8(%rbx), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2410
leaq 0x10(%rbx), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
movq (%rbx), %rdi
movq 0x10(%rbx), %rdx
movl $0x1, %esi
movq %r15, %rcx
callq 0x2410
movq %r15, %rdi
callq 0x2190
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220