LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mb_svaux_init(mb_g_t const*, unsigned long)
mb_svaux_t *mb_svaux_init(const mb_g_t *mg, uint64_t x)
{
	uint32_t st, i, max_cc = 0;
	mb_match_t *ma = mg->e;
	mb_svaux_t *b;
	CALLOC(b, 1);
	b->x = x;
	for (st = 0, i = 1; i <= ma->n_seq; ++i)
		if (i == ma->n_seq || ma->cc[st]>>32 != ma->cc[i]>>32)
			max_cc = max_cc > i - st? max_cc : i - st, st = i;
	kv_init(b->cc_edge);
	MALLOC(b->cc_node, max_cc);

	b->u = mg->u->u.a;
	CALLOC(b->u_opt, ma->n_seq);

	MALLOC(b->bfs, ma->n_seq);
	MALLOC(b->bfs_mark, ma->n_seq); 
	memset(b->bfs_mark, -1, ma->n_seq*sizeof(uint32_t));
	
	CALLOC(b->f, ma->n_seq);
	return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x1, %edi
movl $0x58, %esi
callq 0x2140
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x38(%rcx), %eax
ja 0x21bd99
movl -0x18(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x38(%rcx), %eax
je 0x21bd62
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x18(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0x21bd8c
movl -0x1c(%rbp), %eax
movl -0x18(%rbp), %ecx
subl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x21bd77
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x21bd80
movl -0x18(%rbp), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x21bd8e
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x21bd1f
movq -0x30(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x20(%rax)
movl -0x1c(%rbp), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edx
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x2100
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mb_svaux_destroy(mb_svaux_t*)
void mb_svaux_destroy(mb_svaux_t *b)
{
	b->u = NULL;
	kv_destroy(b->cc_edge); free(b->cc_node);
	free(b->u); free(b->u_opt);
	free(b->bfs); free(b->bfs_mark);
	free(b->f);
	free(b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rdi
callq 0x2210
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: destroy_mc_svaux_t_mul(mc_svaux_t_mul*)
void destroy_mc_svaux_t_mul(mc_svaux_t_mul *b)
{
	uint32_t i;
	kv_destroy(b->cc_edge);
	free(b->bfs_mark);
	free(b->s_opt);
	free(b->z);
	free(b->z_opt);
	b->s = NULL;
	for (i = 0; i < b->bs.n; i++)
	{
		kv_destroy(b->bs.a[i].cc_node);
		kv_destroy(b->bs.a[i].bfs);
	}
	kv_destroy(b->bs);
	free(b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x21c32d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rdi
callq 0x2210
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x21c2e0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2210
movq -0x8(%rbp), %rdi
callq 0x2210
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_best(mc_match_t const*, mc_svaux_t*)
uint32_t mc_best(const mc_match_t *ma, mc_svaux_t *b)
{
	uint32_t i, max_i = (uint32_t)-1;
	t_w_t w, max_w;
	for (i = 0, max_w = -1; i < b->cc_size; ++i) {
		uint32_t k = (uint32_t)ma->cc[b->cc_off + i];///uid
		if(b->f[k] || b->s[k] == 0) continue;
		///z += -((t_w_t)(b->s[k])) * (b->z[k].z[0] - b->z[k].z[1]);
		///-((t_w_t)(b->s[k])) * (b->z[k].z[0] - b->z[k].z[1]) current
		///((t_w_t)(b->s[k])) * (b->z[k].z[0] - b->z[k].z[1]) flipped
		w = ((t_w_t)(b->s[k])) * (b->z[k].z[0] - b->z[k].z[1]) * 2;
		if(w <= 0) continue;
		if(w > max_w)
		{
			w = max_w; max_i = k;
		}
	}

	return max_i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x14(%rbp)
movsd 0x165f06(%rip), %xmm0   # 0x382278
movsd %xmm0, -0x28(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x21c456
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x2c(%rbp), %ecx
cmpb $0x0, (%rax,%rcx)
jne 0x21c3c7
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x2c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x21c3c9
jmp 0x21c448
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x2c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd 0x165ed3(%rip), %xmm1   # 0x3822e8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
jb 0x21c42a
jmp 0x21c448
movsd -0x20(%rbp), %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x21c446
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x21c448
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21c377
movl -0x18(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mb_score(mb_g_t*, mb_svaux_t*)
t_w_t mb_score(mb_g_t *mbg, mb_svaux_t *b)
{
	uint32_t i;
	t_w_t z = 0;
	mb_match_t *ma = mbg->e;
	for (i = 0; i < b->cc_size; ++i) {
		uint32_t k = (uint32_t)ma->cc[b->cc_off + i];///uid
		///a[0]
		z += -(t_w_t)(mbg->u->u.a[k].s[0]) * (mbg->u->u.a[k].z[0] - mbg->u->u.a[k].z[1]);
		///a[1]
		z += -(t_w_t)(mbg->u->u.a[k].s[1]) * (mbg->u->u.a[k].z[2] - mbg->u->u.a[k].z[3]);
	}
	return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x21c574
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl -0x14(%rbp), %edx
addl %edx, %ecx
movl (%rax,%rcx,8), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
movsbl 0x10(%rax,%rcx), %edx
cvtsi2sd %edx, %xmm1
movsd 0x18(%rax,%rcx), %xmm2
movsd 0x20(%rax,%rcx), %xmm0
subsd %xmm0, %xmm2
movsd -0x20(%rbp), %xmm0
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
movsbl 0x11(%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x28(%rax), %xmm2
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
subsd 0x30(%rax), %xmm2
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21c487
movsd -0x20(%rbp), %xmm0
popq %rbp
retq
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_score(mc_match_t const*, mc_svaux_t*)
t_w_t mc_score(const mc_match_t *ma, mc_svaux_t *b)
{
	uint32_t i;
	t_w_t z = 0;
	for (i = 0; i < b->cc_size; ++i) {
		uint32_t k = (uint32_t)ma->cc[b->cc_off + i];///uid
		z += -((t_w_t)(b->s[k])) * (b->z[k].z[0] - b->z[k].z[1]);
	}
	return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x21c63c
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl -0x14(%rbp), %edx
addl %edx, %ecx
movl (%rax,%rcx,8), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x24(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm2
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm2
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21c59b
movsd -0x20(%rbp), %xmm0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_score_all(mc_match_t const*, mc_svaux_t*)
t_w_t mc_score_all(const mc_match_t *ma, mc_svaux_t *b)
{
	uint32_t k;
	t_w_t z = 0;
	for (k = 0; k < ma->n_seq; ++k) 
	{
		z += -((t_w_t)(b->s[k])) * (b->z[k].z[0] - b->z[k].z[1]);
	}
	return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jae 0x21c6eb
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x14(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm2
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm2
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21c66b
movsd -0x20(%rbp), %xmm0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_reset_z(mc_match_t const*, mc_svaux_t*)
void mc_reset_z(const mc_match_t *ma, mc_svaux_t *b)
{
	uint32_t i;
	for (i = 0; i < b->cc_size; ++i) {
		uint32_t k = (uint32_t)ma->cc[b->cc_off + i];///uid
		uint32_t o = ma->idx.a[k] >> 32;
		uint32_t j, n = (uint32_t)ma->idx.a[k];
		b->z[k].z[0] = b->z[k].z[1] = 0;
		for (j = 0; j < n; ++j) {
			const mc_edge_t *e = &ma->ma.a[o + j];
			uint32_t t = ma_y(*e);
			if (b->s[t] > 0) b->z[k].z[0] += e->w;
			else if (b->s[t] < 0) b->z[k].z[1] += e->w;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x21c865
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x18(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x18(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x18(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x18(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x21c855
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x34(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x21c80a
movq -0x30(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x18(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x21c845
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x34(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jge 0x21c843
movq -0x30(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x18(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0x21c845
jmp 0x21c847
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x21c7a0
jmp 0x21c857
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21c713
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_best_flip(mc_match_t const*, mc_svaux_t*)
void mc_best_flip(const mc_match_t *ma, mc_svaux_t *b)
{
	uint32_t idx;
	for (idx = 0; idx < b->cc_size; ++idx) {
		b->f[(uint32_t)ma->cc[b->cc_off + idx]] = 0;
        ///uint32_t k = (uint32_t)ma->cc[b->cc_off + idx];///uid
	}
	while (1)
	{
		idx = mc_best(ma, b);
		if(idx == (uint32_t)-1) break;
		mc_set_spin(ma, b, idx, -b->s[idx]);
		b->f[idx] = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x21d414
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
movq -0x10(%rbp), %rdx
movl 0x8(%rdx), %edx
addl -0x14(%rbp), %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21d3d7
jmp 0x21d416
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x21c350
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x21d42e
jmp 0x21d465
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x14(%rbp), %ecx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
subl %ecx, %eax
movsbl %al, %ecx
callq 0x21d470
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x14(%rbp), %ecx
movb $0x1, (%rax,%rcx)
jmp 0x21d416
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_set_spin(mc_match_t const*, mc_svaux_t*, unsigned int, signed char)
static void mc_set_spin(const mc_match_t *ma, mc_svaux_t *b, uint32_t k, int8_t s)
{
	uint32_t o, j, n;
	int8_t s0 = b->s[k];
	if (s0 == s) return;
	o = ma->idx.a[k] >> 32;
	n = (uint32_t)ma->idx.a[k];
	for (j = 0; j < n; ++j) {
		const mc_edge_t *e = &ma->ma.a[o + j];
		uint32_t t = ma_y(*e);///1->z[0]; (-1)->z[1];
		if (s0 != 0) b->z[t].z[(s0 < 0)] -= e->w; 
		if (s  != 0) b->z[t].z[(s  < 0)] += e->w;
	}
	b->s[k] = s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x14(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x25(%rbp)
movsbl -0x25(%rbp), %eax
movsbl -0x15(%rbp), %ecx
cmpl %ecx, %eax
jne 0x21d4a6
jmp 0x21d5a7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x21d596
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x34(%rbp)
movsbl -0x25(%rbp), %eax
cmpl $0x0, %eax
je 0x21d548
movq -0x30(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsbl -0x25(%rbp), %ecx
cmpl $0x0, %ecx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
movsd (%rax,%rcx,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsbl -0x15(%rbp), %eax
cmpl $0x0, %eax
je 0x21d586
movq -0x30(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsbl -0x15(%rbp), %ecx
cmpl $0x0, %ecx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x21d588
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x21d4d5
movb -0x15(%rbp), %dl
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x14(%rbp), %ecx
movb %dl, (%rax,%rcx)
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: reset_mc_bp_iter(mc_bp_t*, mc_bp_iter*, unsigned long)
void reset_mc_bp_iter(mc_bp_t* bp, mc_bp_iter *x, uint64_t id)
{
	ma_utg_t *u = NULL;
	uint32_t i, n, occ;
	for (i = 0; i < bp->idx_n; i++)
	{
		if(id >= bp->idx[i]) break;
	}

	id -= bp->idx[i];
	x->chain_id = bp->b_b->chain_weight.a[i].id;
	u = &(bp->b_b->b_ug->u.a[x->chain_id]);
	for (i = occ = 0; i < u->n; i++)
	{
		get_bubbles(bp->b_b, u->a[i]>>33, NULL, NULL, NULL, &n, NULL);
		occ += n;
		if(id < occ)
		{
			x->bid = i;
			x->uid = id - (occ -n);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x21d664
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl -0x24(%rbp), %edx
cmpq (%rcx,%rdx,8), %rax
jb 0x21d657
jmp 0x21d664
jmp 0x21d659
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x21d633
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0xd8(%rax), %rax
movl -0x24(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0xc0(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
imulq $0x28, (%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x21d761
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
shrq $0x21, %rsi
xorl %eax, %eax
movl %eax, %r8d
leaq -0x28(%rbp), %r9
movq %r8, %rdx
movq %r8, %rcx
movq $0x0, (%rsp)
callq 0x1c4b20
movl -0x28(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x21d751
movl -0x24(%rbp), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movl -0x2c(%rbp), %eax
subl -0x28(%rbp), %eax
movl %eax, %eax
subq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x21d761
jmp 0x21d753
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x21d6d0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: incre_weight(mc_svaux_t*, mc_match_t*, unsigned char*, unsigned int)
t_w_t incre_weight(mc_svaux_t *b_aux, mc_match_t *ma, uint8_t* vis, uint32_t uid)
{
	mc_edge_t *o = NULL;
	uint32_t n, i, t;
	t_w_t w = ((t_w_t)(b_aux->s[uid])) * (b_aux->z[uid].z[0] - b_aux->z[uid].z[1]) * 2;
	t_w_t w_off = 0;
	o = pt_a(*ma, uid);
	n = pt_n(*ma, uid);
	for (i = 0; i < n; ++i) 
	{
		t = ma_y(o[i]);
		if(vis[t] == 0) continue;
        if(t == uid) continue;
		w_off += (b_aux->s[uid]*b_aux->s[t]*o[i].w);
	}
	return w - (w_off*4);//2 for self; 4 for both directions
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd 0x164b11(%rip), %xmm1   # 0x3822e8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x1c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jae 0x21d8bb
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x21d859
jmp 0x21d8ad
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x21d863
jmp 0x21d8ad
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rcx
movl -0x34(%rbp), %edx
movsbl (%rcx,%rdx), %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x21d827
movsd -0x40(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x16ffdc(%rip), %xmm2   # 0x38d8c0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
popq %rbp
retq
nop
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: best_bp(mc_bp_t*, mc_bp_res*)
uint32_t best_bp(mc_bp_t *bp, mc_bp_res *res)
{
	uint32_t i;
	clean_mc_bp_res(res);
	for (i = 0; i < bp->n_thread; i++)
	{
		clean_mc_bp_res(&(bp->res[i]));
	} 
	kt_for(bp->n_thread, worker_for_min_bp, bp, bp->occ);
	
	for (i = 0; i < bp->n_thread; i++)
	{
		if(bp->res[i].chain_id == (uint32_t)-1) continue;
		if(bp->res[i].w <= 0) continue;
		if((bp->res[i].w > res->w) || (bp->res[i].w == res->w && bp->res[i].id < res->id))
		{
			(*res) = bp->res[i];
		}
	}
	if(res->chain_id != (uint32_t)-1) return 1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x21d5b0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x21db2f
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0x1c(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x21d5b0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x21db00
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
leaq 0x124(%rip), %rsi       # 0x21dc70
callq 0x16d710
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x21dc4e
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $-0x1, (%rax)
jne 0x21db85
jmp 0x21dc40
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
ucomisd 0x18(%rax), %xmm0
jb 0x21dba6
jmp 0x21dc40
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movq -0x18(%rbp), %rax
ucomisd 0x18(%rax), %xmm0
ja 0x21dc0a
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movq -0x18(%rbp), %rax
ucomisd 0x18(%rax), %xmm0
jne 0x21dc3e
jp 0x21dc3e
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jae 0x21dc3e
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movl -0x1c(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x21dc40
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x21db58
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x21dc60
movl $0x1, -0x4(%rbp)
jmp 0x21dc67
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_solve_bp_cc(mc_bp_t*)
t_w_t mc_solve_bp_cc(mc_bp_t *bp)
{
	mc_bp_res res;
	memset(bp->lock, 0, bp->b_b->ug->g->n_seq);
	while (best_bp(bp, &res))
	{
		mc_set_bp_spin(bp->b_b, bp->ma, bp->b_aux, bp, bp->lock, &(bp->vis[0]), &res);
	}

	return mc_score_all(bp->ma, bp->b_aux);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x2100
movq -0x8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x21dae0
cmpl $0x0, %eax
je 0x21df02
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x48(%rax), %r9
leaq -0x28(%rbp), %rax
movq %rax, (%rsp)
callq 0x21dcf0
jmp 0x21deb6
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x21c650
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_reset_z_all(mc_match_t const*, mc_svaux_t*)
void mc_reset_z_all(const mc_match_t *ma, mc_svaux_t *b)
{
	// t_w_t z[2];
	uint32_t k;
	for (k = 0; k < ma->n_seq; ++k) 
	{
		uint32_t o = ma->idx.a[k] >> 32;
        uint32_t j, n = (uint32_t)ma->idx.a[k];
		// z[0] = b->z[k].z[0]; z[1] = b->z[k].z[1];
        b->z[k].z[0] = b->z[k].z[1] = 0;
        for (j = 0; j < n; ++j) {
            const mc_edge_t *e = &ma->ma.a[o + j];
            uint32_t t = ma_y(*e);
            if (b->s[t] > 0) b->z[k].z[0] += e->w;
            else if (b->s[t] < 0) b->z[k].z[1] += e->w;
        }
		// if(z[0] != b->z[k].z[0]) fprintf(stderr, "ERROR1-all\n");
        // if(z[1] != b->z[k].z[1]) fprintf(stderr, "ERROR2-all\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jae 0x21e06a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x21e05a
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x18(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x2c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x21e00f
movq -0x28(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x21e04a
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x2c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jge 0x21e048
movq -0x28(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0x21e04a
jmp 0x21e04c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x21dfa5
jmp 0x21e05c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21df33
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_solve_bp(mc_bp_t*)
void mc_solve_bp(mc_bp_t *bp)
{
	double index_time = yak_realtime();
	uint32_t r = 1;
	t_w_t sc_opt, sc;
	mc_reset_z_all(bp->ma, bp->b_aux);
	sc_opt = mc_score_all(bp->ma, bp->b_aux);

	while (1)
	{
		sc = mc_solve_bp_cc(bp);
		// fprintf(stderr, "[M::%s::# round: %u] sc_opt: %ld, sc: %ld\n", __func__, r, sc_opt, sc);
		fprintf(stderr, "[M::%s::# round: %u] sc_opt: %f, sc: %f\n", __func__, r, sc_opt, sc);
		if(sc <= sc_opt) break;
		sc_opt = sc;
		r++;
	}
	fprintf(stderr, "[M::%s::%.3f] ==> round %u\n", __func__, yak_realtime()-index_time, r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
callq 0x1b7ca0
movsd %xmm0, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x21df20
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x21c650
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x21de80
movsd %xmm0, -0x28(%rbp)
movq 0x1a5f0f(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x14(%rbp), %ecx
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
leaq 0x16fab2(%rip), %rsi    # 0x38db9a
leaq 0x16fad4(%rip), %rdx    # 0x38dbc3
movb $0x2, %al
callq 0x22a0
movsd -0x28(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x21e108
jmp 0x21e11d
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21e0bc
movq 0x1a5ebc(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x1b7ca0
movq -0x30(%rbp), %rdi
subsd -0x10(%rbp), %xmm0
movl -0x14(%rbp), %ecx
leaq 0x16fa8c(%rip), %rsi    # 0x38dbcf
leaq 0x16fa79(%rip), %rdx    # 0x38dbc3
movb $0x1, %al
callq 0x22a0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_score_all_advance(mc_match_t const*, signed char*)
t_w_t mc_score_all_advance(const mc_match_t *ma, int8_t *s)
{
	uint32_t k;
	t_w_t z[2], zt = 0;
	for (k = 0; k < ma->n_seq; ++k) 
	{
		uint32_t o = ma->idx.a[k] >> 32;
        uint32_t j, n = (uint32_t)ma->idx.a[k];
		z[0] = z[1] = 0;
		for (j = 0; j < n; ++j) {
            const mc_edge_t *e = &ma->ma.a[o + j];
            uint32_t t = ma_y(*e);
            if (s[t] > 0) z[0] += e->w;
            else if (s[t] < 0) z[1] += e->w;
        }
		zt += -((t_w_t)(s[k])) * (z[0] - z[1]);
	}
	return zt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jae 0x21e2a1
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x44(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x44(%rbp), %eax
jae 0x21e251
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x3c(%rbp), %ecx
addl -0x40(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movl -0x54(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x21e21c
movq -0x50(%rbp), %rax
movsd 0x8(%rax), %xmm0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x21e241
movq -0x10(%rbp), %rax
movl -0x54(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jge 0x21e23f
movq -0x50(%rbp), %rax
movsd 0x8(%rax), %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x21e241
jmp 0x21e243
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x21e1ca
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0x30(%rbp), %xmm2
subsd -0x28(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21e17b
movsd -0x38(%rbp), %xmm0
popq %rbp
retq
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_status_all(mc_match_t const*, signed char*)
void mc_status_all(const mc_match_t *ma, int8_t *s)
{
	t_w_t tt_w = mc_score_all_advance(ma, s);
	uint64_t k, nn = 0, ne = 0;
	for (k = 0; k < ma->n_seq; ++k) {
		if((uint32_t)ma->idx.a[k]) nn++;
		ne += (uint32_t)ma->idx.a[k];
	}
	fprintf(stderr, "[M::%s::] ==> # nodes: %lu, # edges: %lu, weight: %f\n", __func__, nn, ne, tt_w);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x21e160
movsd %xmm0, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x38(%rcx), %ecx
cmpq %rcx, %rax
jae 0x21e343
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, %eax
je 0x21e31b
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x21e2ea
movq 0x1a5c96(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movsd -0x18(%rbp), %xmm0
leaq 0x16f88a(%rip), %rsi    # 0x38dbeb
leaq 0x16f8b9(%rip), %rdx    # 0x38dc21
movb $0x1, %al
callq 0x22a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_optimize_local(mc_opt_t const*, mc_match_t const*, mc_svaux_t*, unsigned int*)
static t_w_t mc_optimize_local(const mc_opt_t *opt, const mc_match_t *ma, mc_svaux_t *b, uint32_t *n_iter)
{
	uint32_t i, n_flip = 0;
	int32_t n_iter_local = 0;
	while (n_iter_local < opt->max_iter) {
		++(*n_iter);
		ks_shuffle_uint32_t(b->cc_size, b->cc_node, &b->x);
		for (i = n_flip = 0; i < b->cc_size; ++i) {
			uint32_t k = b->cc_node[i];///uid
			int8_t s;
			if (b->z[k].z[0] == b->z[k].z[1]) continue;
			s = b->z[k].z[0] > b->z[k].z[1]? -1 : 1;
			if (b->s[k] != s) {
				// fprintf(stderr, "utg%.6dl, s[k]::%d, s::%d\n", (int32_t)(k)+1, b->s[k], s);
				mc_set_spin(ma, b, k, s);///no need to change the score of k itself
				++n_flip;
			}
		}
		++n_iter_local;
		if (n_flip == 0) break;
	}

	// if(n_flip != 0) mc_best_flip(ma, b);
	return mc_score(ma, b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x21f007
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x22c0c0
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x21eff1
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
ucomisd 0x8(%rax), %xmm0
jne 0x21ef6c
jp 0x21ef6c
jmp 0x21efe3
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm1
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
movb %al, -0x31(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x30(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movsbl -0x31(%rbp), %ecx
cmpl %ecx, %eax
je 0x21efe1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x30(%rbp), %edx
movsbl -0x31(%rbp), %ecx
callq 0x21d470
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x21efe3
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x21ef18
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x21f002
jmp 0x21f007
jmp 0x21eed6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x21c580
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_perturb(mc_opt_t const*, mc_match_t const*, mc_svaux_t*)
static void mc_perturb(const mc_opt_t *opt, const mc_match_t *ma, mc_svaux_t *b)
{
	uint32_t i;
	for (i = 0; i < b->cc_size; ++i) {
		uint32_t k = (uint32_t)ma->cc[b->cc_off + i];///node id
		double y;
		y = kr_drand_r(&b->x);
		if (y < opt->f_perturb)
			mc_set_spin(ma, b, k, -b->s[k]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x21f0b7
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x22c1a0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm1
movq -0x8(%rbp), %rax
movsd 0x10(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x21f0aa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x20(%rbp), %ecx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
subl %ecx, %eax
movsbl %al, %ecx
callq 0x21d470
jmp 0x21f0ac
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x21f03b
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_perturb_node(mc_opt_t const*, mc_match_t const*, mc_svaux_t*, int)
static void mc_perturb_node(const mc_opt_t *opt, const mc_match_t *ma, mc_svaux_t *b, int32_t bfs_round)
{
	uint32_t i, k, n_bfs = 0;
	k = (uint32_t)(kr_drand_r(&b->x) * b->cc_size + .499);
	if(k >= b->cc_size) k = b->cc_size - 1;
	k = (uint32_t)ma->cc[b->cc_off + k];///node id
	n_bfs = mc_bfs(ma, b, k, bfs_round, (int32_t)(b->cc_size * opt->f_perturb));
	for (i = 0; i < n_bfs; ++i)
		mc_set_spin(ma, b, b->bfs[i], -b->s[b->bfs[i]]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x22c1a0
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
movsd 0x15ff41(%rip), %xmm1   # 0x37f040
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jb 0x21f124
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl -0x24(%rbp), %edx
addl %edx, %ecx
movl (%rax,%rcx,8), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl 0xc(%rsi), %eax
cvtsi2sd %rax, %xmm0
movq -0x8(%rbp), %rax
mulsd 0x10(%rax), %xmm0
cvttsd2si %xmm0, %r8d
callq 0x22c200
movl %eax, -0x28(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jae 0x21f1c2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x20(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x20(%rbp), %r8d
movl (%rcx,%r8,4), %ecx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
subl %ecx, %eax
movsbl %al, %ecx
callq 0x21d470
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x21f171
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: prt_bub(unsigned int*, unsigned int, char const*)
void prt_bub(uint32_t *a, uint32_t a_n, const char *cmd) 
{
	uint32_t k;
	fprintf(stderr, "%s\n", cmd);
	for (k = 0; k < a_n; k++) {
		fprintf(stderr, "utg%.6dl\t", (int32_t)a[k]+1);
	}
	fprintf(stderr, "\n");
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq 0x1a46e6(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x16d6a6(%rip), %rsi    # 0x38cfae
movb $0x0, %al
callq 0x22a0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x21f94e
movq 0x1a46bb(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x16e409(%rip), %rsi    # 0x38dd45
movb $0x0, %al
callq 0x22a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x21f916
movq 0x1a468b(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x1670c9(%rip), %rsi    # 0x386a28
movb $0x0, %al
callq 0x22a0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: clus_weight(mc_svaux_t*, mc_match_t*, bits_p*, unsigned int)
t_w_t clus_weight(mc_svaux_t *b_aux, mc_match_t *ma, bits_p *vis, uint32_t uid)
{
	mc_edge_t *o = NULL;
	uint32_t n, i, t;
	t_w_t w = ((t_w_t)(b_aux->s[uid])) * (b_aux->z[uid].z[0] - b_aux->z[uid].z[1]) * 2;
	t_w_t w_off = 0;
	o = pt_a(*ma, uid);
	n = pt_n(*ma, uid);
	for (i = 0; i < n; ++i) {
		t = ma_y(o[i]);
		if(!(is_set_bits_p((*vis), t))) continue;
		// if(vis[t] == 0) continue;
        if(t == uid) continue;
		w_off += (b_aux->s[uid]*b_aux->s[t]*o[i].w);
	}
	return w - (w_off*4);//2 for self; 4 for both directions
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd 0x160631(%rip), %xmm1   # 0x3822e8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x1c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jae 0x221daf
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x34(%rbp), %ecx
andl $0x7, %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x221d4d
jmp 0x221da1
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x221d57
jmp 0x221da1
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rcx
movl -0x34(%rbp), %edx
movsbl (%rcx,%rdx), %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movq -0x28(%rbp), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x221d07
movsd -0x40(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x16bae8(%rip), %xmm2   # 0x38d8c0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: chhylp123[P]hifiasm/rcut.cpp
// Function: worker_cal_clus_sc(void*, long, int)
static void worker_cal_clus_sc(void *data, long i, int tid) // callback for kt_for()
{
	mc_clus_t *bc = (mc_clus_t *)data;
	uint32_t *a = bc->cc.nn.a, a_n = bc->cc.nn.n;
	if(a[i] == (uint32_t)-1) return;
	cal_clus_sc0(bc->mg->e, bc->baux, bc, bc->lock, bc->lock_max, a, a_n, i, &(bc->aux[tid]), tid);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x58, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
jne 0x222252
jmp 0x2222b8
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rsi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x28(%rbp), %rax
movb 0x50(%rax), %r8b
movq -0x30(%rbp), %r9
movl -0x34(%rbp), %ebx
movq -0x18(%rbp), %rax
movl %eax, %r11d
movq -0x28(%rbp), %rax
movq 0x60(%rax), %r10
movslq -0x1c(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %r10
movl -0x1c(%rbp), %eax
movzbl %r8b, %r8d
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x221df0
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
nop