LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: mc_svaux_init(mc_g_t const*, unsigned long)
mc_svaux_t *mc_svaux_init(const mc_g_t *mg, uint64_t x)
{
	uint32_t st, i, max_cc = 0;
	mc_match_t *ma = mg->e;
	mc_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);
	///CALLOC(b->s, ma->n_seq);
	b->s = mg->s.a;
	CALLOC(b->s_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->z, ma->n_seq);
	CALLOC(b->z_opt, ma->n_seq);
	CALLOC(b->f, ma->n_seq);
	return b;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x28(%rdi), %r12
movl $0x1, %r13d
movl $0x1, %edi
movl $0x68, %esi
callq 0x2120
movq %rax, %rbx
movq %r14, (%rax)
movl 0x38(%r12), %r14d
xorl %edi, %edi
testq %r14, %r14
je 0x16301b
leal 0x1(%r14), %ecx
cmpl $0x3, %ecx
movl $0x2, %eax
cmovael %ecx, %eax
xorl %ecx, %ecx
cmpq %r13, %r14
je 0x163000
movq 0x30(%r12), %rdx
movl %edi, %esi
movq (%rdx,%r13,8), %r8
xorq (%rdx,%rsi,8), %r8
shrq $0x20, %r8
je 0x16300d
movl %r13d, %edx
subl %edi, %edx
cmpl %edx, %ecx
cmovbel %edx, %ecx
movl %r13d, %edi
incq %r13
cmpq %r13, %rax
jne 0x162fe6
movl %ecx, %edi
shlq $0x2, %rdi
callq 0x2280
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
movq %rax, 0x28(%rbx)
movq 0x10(%r15), %rax
movq %rax, 0x50(%rbx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x58(%rbx)
shlq $0x2, %r14
movq %r14, %rdi
callq 0x2280
movq %rax, 0x30(%rbx)
movq %r14, %rdi
callq 0x2280
movq %rax, 0x38(%rbx)
movq %rax, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x20e0
movl 0x38(%r12), %r14d
movl $0x10, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x40(%rbx)
movl $0x10, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x48(%rbx)
movl $0x1, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x60(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: mc_svaux_destroy(mc_svaux_t*)
void mc_svaux_destroy(mc_svaux_t *b)
{
	b->s = NULL;
	kv_destroy(b->cc_edge); free(b->cc_node);
	free(b->s); free(b->s_opt);
	free(b->z); free(b->z_opt);
	free(b->bfs); free(b->bfs_mark);
	free(b->f);
	free(b);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x0, 0x50(%rdi)
movq 0x20(%rdi), %rdi
callq 0x2220
movq 0x28(%rbx), %rdi
callq 0x2220
movq 0x50(%rbx), %rdi
callq 0x2220
movq 0x58(%rbx), %rdi
callq 0x2220
movq 0x40(%rbx), %rdi
callq 0x2220
movq 0x48(%rbx), %rdi
callq 0x2220
movq 0x30(%rbx), %rdi
callq 0x2220
movq 0x38(%rbx), %rdi
callq 0x2220
movq 0x60(%rbx), %rdi
callq 0x2220
movq %rbx, %rdi
popq %rbx
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %r12
movl $0x1, %r13d
movl $0x1, %edi
movl $0x58, %esi
callq 0x2120
movq %rax, %rbx
movq %r14, (%rax)
movl 0x38(%r12), %r14d
xorl %edi, %edi
testq %r14, %r14
je 0x1631a3
leal 0x1(%r14), %ecx
cmpl $0x3, %ecx
movl $0x2, %eax
cmovael %ecx, %eax
xorl %ecx, %ecx
cmpq %r13, %r14
je 0x163188
movq 0x30(%r12), %rdx
movl %edi, %esi
movq (%rdx,%r13,8), %r8
xorq (%rdx,%rsi,8), %r8
shrq $0x20, %r8
je 0x163195
movl %r13d, %edx
subl %edi, %edx
cmpl %edx, %ecx
cmovbel %edx, %ecx
movl %r13d, %edi
incq %r13
cmpq %r13, %rax
jne 0x16316e
movl %ecx, %edi
shlq $0x2, %rdi
callq 0x2280
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
movq %rax, 0x28(%rbx)
movq (%r15), %rax
movq 0x40(%rax), %rax
movq %rax, 0x40(%rbx)
movl $0x38, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x48(%rbx)
shlq $0x2, %r14
movq %r14, %rdi
callq 0x2280
movq %rax, 0x30(%rbx)
movq %r14, %rdi
callq 0x2280
movq %rax, 0x38(%rbx)
movq %rax, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x20e0
movl 0x38(%r12), %edi
movl $0x1, %esi
callq 0x2120
movq %rax, 0x50(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movq $0x0, 0x40(%rdi)
movq 0x20(%rdi), %rdi
callq 0x2220
movq 0x28(%rbx), %rdi
callq 0x2220
movq 0x40(%rbx), %rdi
callq 0x2220
movq 0x48(%rbx), %rdi
callq 0x2220
movq 0x30(%rbx), %rdi
callq 0x2220
movq 0x38(%rbx), %rdi
callq 0x2220
movq 0x50(%rbx), %rdi
callq 0x2220
movq %rbx, %rdi
popq %rbx
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: init_mc_svaux_t_mul(mc_g_t const*, unsigned long)
mc_svaux_t_mul *init_mc_svaux_t_mul(const mc_g_t *mg, uint64_t n_threads)
{
	uint32_t st, i;
	mc_match_t *ma = mg->e;
	mc_svaux_t_mul *b; CALLOC(b, 1);
	for (st = 0, i = 1, b->n_t = 0; i <= ma->n_seq; ++i)
	{
		if (i == ma->n_seq || ma->cc[st]>>32 != ma->cc[i]>>32)
		{
			b->n_t++;
		}
	}
	b->n_g = b->n_t;
	if(n_threads < b->n_t) b->n_t = n_threads;
	
	kv_init(b->cc_edge);
	MALLOC(b->bfs_mark, ma->n_seq);
	memset(b->bfs_mark, -1, ma->n_seq*sizeof(uint32_t));
	CALLOC(b->s_opt, ma->n_seq);
	CALLOC(b->z, ma->n_seq);
	CALLOC(b->z_opt, ma->n_seq);
	b->s = mg->s.a;

	kv_init(b->bs); CALLOC(b->bs.a, b->n_t); 
	b->bs.n = b->bs.m = b->n_t;
	for (i = 0; i < b->bs.n; i++)
	{
		kv_init(b->bs.a[i].cc_node);
		kv_init(b->bs.a[i].bfs);
		b->bs.a[i].bfs_mark = b->bfs_mark;
		b->bs.a[i].z = b->z;
		b->bs.a[i].z_opt = b->z_opt;
		b->bs.a[i].s = b->s;
		b->bs.a[i].s_opt = b->s_opt;
	}
	return b;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movq 0x28(%rdi), %r13
movl $0x1, %ebp
movl $0x1, %edi
movl $0x60, %esi
callq 0x2120
movq %rax, %rbx
movl $0x0, 0x58(%rax)
movl 0x38(%r13), %r12d
testq %r12, %r12
je 0x1632e4
leal 0x1(%r12), %ecx
cmpl $0x3, %ecx
movl $0x2, %eax
cmovael %ecx, %eax
cmpq %rbp, %r12
je 0x1632d9
movq 0x30(%r13), %rcx
movq (%rcx,%rbp,8), %rdx
xorq (%rcx), %rdx
shrq $0x20, %rdx
je 0x1632dc
incl 0x58(%rbx)
incq %rbp
cmpq %rbp, %rax
jne 0x1632c3
movl 0x58(%rbx), %eax
movl %eax, 0x5c(%rbx)
cmpq %r15, %rax
jbe 0x1632f3
movl %r15d, 0x58(%rbx)
shlq $0x2, %r12
movq %r12, %rdi
callq 0x2280
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
xorl %eax, %eax
movq %rax, 0x28(%rbx)
movq %r15, 0x30(%rbx)
movq %r15, %rdi
movl $0xff, %esi
movq %r12, %rdx
callq 0x20e0
movl 0x38(%r13), %ebp
movl $0x1, %esi
movq %rbp, %rdi
callq 0x2120
movq %rax, %r12
movq %rax, 0x50(%rbx)
movl $0x10, %esi
movq %rbp, %rdi
callq 0x2120
movq %rax, %r13
movq %rax, 0x38(%rbx)
movl $0x10, %esi
movq %rbp, %rdi
callq 0x2120
movq %rax, %rbp
movq %rax, 0x40(%rbx)
movq 0x10(%r14), %r14
movq %r14, 0x48(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl 0x58(%rbx), %edi
movq %rdi, (%rsp)
movl $0x68, %esi
callq 0x2120
movq (%rsp), %rcx
xorps %xmm0, %xmm0
movq %rax, 0x10(%rbx)
movq %rcx, 0x8(%rbx)
movq %rcx, (%rbx)
testq %rcx, %rcx
je 0x1633d9
addq $0x60, %rax
imulq $0x68, %rcx, %rcx
xorl %edx, %edx
movups %xmm0, -0x30(%rax,%rdx)
movups %xmm0, -0x40(%rax,%rdx)
movups %xmm0, -0x50(%rax,%rdx)
movq %r15, -0x20(%rax,%rdx)
movq %r13, -0x18(%rax,%rdx)
movq %rbp, -0x10(%rax,%rdx)
movq %r14, -0x8(%rax,%rdx)
movq %r12, (%rax,%rdx)
addq $0x68, %rdx
cmpq %rdx, %rcx
jne 0x1633a9
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x2220
movq 0x30(%rbx), %rdi
callq 0x2220
movq 0x50(%rbx), %rdi
callq 0x2220
movq 0x38(%rbx), %rdi
callq 0x2220
movq 0x40(%rbx), %rdi
callq 0x2220
movq $0x0, 0x48(%rbx)
cmpq $0x0, (%rbx)
je 0x16345d
movl $0x1, %ebp
xorl %eax, %eax
movq 0x10(%rbx), %rcx
imulq $0x68, %rax, %r14
movq 0x20(%rcx,%r14), %rdi
callq 0x2220
movq 0x10(%rbx), %rax
movq 0x38(%rax,%r14), %rdi
callq 0x2220
movl %ebp, %eax
incl %ebp
cmpq %rax, (%rbx)
ja 0x163434
movq 0x10(%rbx), %rdi
callq 0x2220
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0xc(%rsi), %ecx
testq %rcx, %rcx
je 0x1634f6
movq 0x30(%rdi), %rdx
movl 0x8(%rsi), %edi
movq 0x60(%rsi), %r8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
movsd 0xc20a2(%rip), %xmm1    # 0x225538
movl %edi, %r9d
movq (%rdx,%r9,8), %r9
movl %r9d, %r10d
cmpb $0x0, (%r8,%r10)
je 0x1634b0
incl %edi
decq %rcx
jne 0x163496
jmp 0x1634fb
movq 0x50(%rsi), %r11
movb (%r11,%r10), %r11b
testb %r11b, %r11b
je 0x1634a7
movsbl %r11b, %r11d
xorps %xmm3, %xmm3
cvtsi2sd %r11d, %xmm3
movq 0x40(%rsi), %r11
shlq $0x4, %r10
movsd (%r11,%r10), %xmm2
subsd 0x8(%r11,%r10), %xmm2
mulsd %xmm3, %xmm2
addsd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jae 0x1634a7
ucomisd %xmm1, %xmm2
cmoval %r9d, %eax
jmp 0x1634a7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0xc(%rsi), %eax
testq %rax, %rax
je 0x16356f
movq (%rdi), %r8
movq 0x8(%rdi), %rcx
movq 0x30(%rcx), %rcx
movl 0x8(%rsi), %edx
movq 0x40(%r8), %rsi
xorpd %xmm0, %xmm0
movl %edx, %edi
movl (%rcx,%rdi,8), %edi
imulq $0x38, %rdi, %rdi
movsbl 0x10(%rsi,%rdi), %r8d
xorps %xmm1, %xmm1
cvtsi2sd %r8d, %xmm1
movsd 0x18(%rsi,%rdi), %xmm2
subsd 0x20(%rsi,%rdi), %xmm2
movsd 0x28(%rsi,%rdi), %xmm3
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsbl 0x11(%rsi,%rdi), %r8d
xorps %xmm1, %xmm1
cvtsi2sd %r8d, %xmm1
subsd 0x30(%rsi,%rdi), %xmm3
mulsd %xmm1, %xmm3
subsd %xmm3, %xmm0
incl %edx
decq %rax
jne 0x16351a
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0xc(%rsi), %eax
testq %rax, %rax
je 0x1635c3
movq 0x30(%rdi), %rcx
movl 0x8(%rsi), %edx
movq 0x50(%rsi), %rdi
movq 0x40(%rsi), %rsi
xorpd %xmm0, %xmm0
movl %edx, %r8d
movl (%rcx,%r8,8), %r8d
movsbl (%rdi,%r8), %r9d
xorps %xmm1, %xmm1
cvtsi2sd %r9d, %xmm1
shlq $0x4, %r8
movsd (%rsi,%r8), %xmm2
subsd 0x8(%rsi,%r8), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
incl %edx
decq %rax
jne 0x16358e
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0x38(%rdi), %eax
testq %rax, %rax
je 0x16360a
movq 0x40(%rsi), %rcx
movq 0x50(%rsi), %rdx
addq $0x8, %rcx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsbl (%rdx,%rsi), %edi
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
movsd -0x8(%rcx), %xmm2
subsd (%rcx), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
incq %rsi
addq $0x10, %rcx
cmpq %rsi, %rax
jne 0x1635e1
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, -0x8(%rsp)
movl 0xc(%rsi), %eax
testq %rax, %rax
je 0x1636bc
movq -0x8(%rsp), %rcx
movq 0x10(%rcx), %rdi
movq 0x30(%rcx), %rdx
movl 0x8(%rsi), %r8d
movq 0x40(%rsi), %r9
xorl %r10d, %r10d
xorps %xmm0, %xmm0
leal (%r8,%r10), %ecx
movl (%rdx,%rcx,8), %ecx
movq (%rdi,%rcx,8), %r13
shlq $0x4, %rcx
movups %xmm0, (%r9,%rcx)
testl %r13d, %r13d
je 0x1636b4
movq %r13, %rbx
shrq $0x20, %rbx
leaq (%r9,%rcx), %r14
addq $0x8, %r14
addq %r9, %rcx
movq -0x8(%rsp), %r11
movq 0x28(%r11), %r15
movq 0x50(%rsi), %r12
movl %r13d, %r13d
movl %ebx, %ebp
shlq $0x4, %rbp
movl (%r15,%rbp), %r11d
cmpb $0x0, (%r12,%r11)
movq %rcx, %r11
jle 0x1636a7
addq %r15, %rbp
movsd 0x8(%rbp), %xmm1
addsd (%r11), %xmm1
movsd %xmm1, (%r11)
jmp 0x1636ac
movq %r14, %r11
js 0x163693
incq %rbx
decq %r13
jne 0x16367f
incq %r10
cmpq %rax, %r10
jne 0x163644
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: mc_reset_z_debug(mc_match_t const*, mc_svaux_t*)
void mc_reset_z_debug(const mc_match_t *ma, mc_svaux_t *b)
{
	uint32_t i;
	t_w_t z[2];
	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];
		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\n");
		if(z[1] != b->z[k].z[1]) fprintf(stderr, "ERROR2\n");
	}
}

// Assembly:
cmpl $0x0, 0xc(%rsi)
je 0x1637b7
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
xorps %xmm2, %xmm2
movq 0x10(%r14), %rax
movq 0x30(%r14), %rcx
movl 0x8(%rbx), %edx
addl %ebp, %edx
movl (%rcx,%rdx,8), %r15d
movq (%rax,%r15,8), %r8
movq 0x40(%rbx), %rdi
shlq $0x4, %r15
leaq (%rdi,%r15), %rax
movsd (%rdi,%r15), %xmm0
movsd 0x8(%rdi,%r15), %xmm3
movups %xmm2, (%rdi,%r15)
testl %r8d, %r8d
je 0x16376b
movq %r8, %rcx
shrq $0x20, %rcx
movq 0x28(%r14), %rdx
movq 0x50(%rbx), %rsi
addq %r15, %rdi
addq $0x8, %rdi
movl %r8d, %r8d
movl %ecx, %r9d
shlq $0x4, %r9
movl (%rdx,%r9), %r10d
cmpb $0x0, (%rsi,%r10)
movq %rax, %r10
jle 0x16375e
addq %rdx, %r9
movsd 0x8(%r9), %xmm1
addsd (%r10), %xmm1
movsd %xmm1, (%r10)
jmp 0x163763
movq %rdi, %r10
js 0x163749
incq %rcx
decq %r8
jne 0x163734
ucomisd (%rax), %xmm0
jne 0x16378f
jp 0x16378f
movq 0x40(%rbx), %rax
ucomisd 0x8(%rax,%r15), %xmm3
jne 0x1637a3
jp 0x1637a3
incl %ebp
cmpl 0xc(%rbx), %ebp
jb 0x1636e3
jmp 0x1637ad
movsd %xmm3, (%rsp)
callq 0x1ff16
movsd (%rsp), %xmm3
xorps %xmm2, %xmm2
jmp 0x163773
callq 0x1ff32
xorps %xmm2, %xmm2
jmp 0x163782
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0xc(%rsi)
je 0x163d0f
xorl %eax, %eax
movq 0x60(%rbx), %rcx
movq 0x30(%r14), %rdx
movl 0x8(%rbx), %esi
addl %eax, %esi
movl (%rdx,%rsi,8), %edx
movb $0x0, (%rcx,%rdx)
incl %eax
cmpl 0xc(%rbx), %eax
jb 0x163ccc
jmp 0x163d0f
movq 0x50(%rbx), %rcx
movl %eax, %r15d
xorl %edx, %edx
subb (%rcx,%r15), %dl
movsbl %dl, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x163d25
movq 0x60(%rbx), %rax
movb $0x1, (%rax,%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x163472
cmpl $-0x1, %eax
jne 0x163ce9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movq 0x50(%rsi), %rax
movl %edx, %edx
movzbl (%rax,%rdx), %r8d
cmpb %cl, %r8b
je 0x163dcc
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x10(%rdi), %r9
movq (%r9,%rdx,8), %rbx
testl %ebx, %ebx
je 0x163dc2
movq %rbx, %r9
shrq $0x20, %r9
movq 0x28(%rdi), %rdi
movl %r8d, %r10d
shrl $0x7, %r10d
movl %ecx, %r11d
shrb $0x7, %r11b
movzbl %r11b, %r11d
movl %ebx, %ebx
movl %r9d, %r14d
shlq $0x4, %r14
leaq (%rdi,%r14), %r15
movl (%rdi,%r14), %r14d
testq %r8, %r8
je 0x163d9c
movq %r14, %r12
shlq $0x4, %r12
addq 0x40(%rsi), %r12
movsd (%r12,%r10,8), %xmm0
subsd 0x8(%r15), %xmm0
movsd %xmm0, (%r12,%r10,8)
testb %cl, %cl
je 0x163dba
shlq $0x4, %r14
addq 0x40(%rsi), %r14
movsd 0x8(%r15), %xmm0
addsd (%r14,%r11,8), %xmm0
movsd %xmm0, (%r14,%r11,8)
incq %r9
decq %rbx
jne 0x163d6b
movb %cl, (%rax,%rdx)
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %r15
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x163e25
movq 0x8(%r15), %rdx
movl $0x1, %edi
xorl %eax, %eax
cmpq %rbx, (%rdx,%rax,8)
jbe 0x163e27
movl %edi, %eax
incl %edi
cmpq %rax, %rcx
ja 0x163e14
jmp 0x163e27
xorl %eax, %eax
movq (%r15), %rcx
movq 0x8(%r15), %rdx
movq 0xd8(%rcx), %rdi
subq (%rdx,%rax,8), %rbx
shlq $0x5, %rax
movq 0x10(%rdi,%rax), %rdx
movq %rsi, 0x10(%rsp)
movq %rdx, (%rsi)
movq 0xc0(%rcx), %rax
movq 0x10(%rax), %rax
leaq (%rdx,%rdx,4), %rcx
cmpl $0x0, 0x10(%rax,%rcx,8)
je 0x163ec4
leaq (%rax,%rcx,8), %rbp
xorl %r13d, %r13d
leaq 0xc(%rsp), %r12
xorl %r14d, %r14d
movq (%r15), %rdi
movq 0x18(%rbp), %rax
movq (%rax,%r13,8), %rsi
shrq $0x21, %rsi
movq $0x0, (%rsp)
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x13812e
movl 0xc(%rsp), %eax
addl %r14d, %eax
cmpq %rax, %rbx
jb 0x163eb1
incq %r13
movl 0x10(%rbp), %ecx
movl %eax, %r14d
cmpq %rcx, %r13
jb 0x163e6f
jmp 0x163ec4
movq 0x10(%rsp), %rcx
movq %r13, 0x8(%rcx)
movl %r14d, %eax
subq %rax, %rbx
movq %rbx, 0x10(%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movq 0x40(%rdi), %r9
movq 0x50(%rdi), %rdi
movl %ecx, %r10d
movsbl (%rdi,%r10), %eax
movq 0x10(%rsi), %r8
movq (%r8,%r10,8), %r8
shlq $0x4, %r10
movsd (%r9,%r10), %xmm1
movsd 0x8(%r9,%r10), %xmm2
testl %r8d, %r8d
je 0x163f69
movq 0x28(%rsi), %r9
movq %r8, %r10
shrq $0x20, %r10
movl %r8d, %esi
shlq $0x4, %r10
leaq (%r10,%r9), %r8
addq $0x8, %r8
shlq $0x4, %rsi
xorpd %xmm0, %xmm0
xorl %r9d, %r9d
movq -0x8(%r8,%r9), %r11
movl %r11d, %r10d
cmpb $0x0, (%rdx,%r10)
sete %bl
cmpl %ecx, %r11d
sete %r11b
orb %bl, %r11b
jne 0x163f5e
movsbl (%rdi,%r10), %r10d
imull %eax, %r10d
xorps %xmm3, %xmm3
cvtsi2sd %r10d, %xmm3
mulsd (%r8,%r9), %xmm3
addsd %xmm3, %xmm0
addq $0x10, %r9
cmpq %r9, %rsi
jne 0x163f27
jmp 0x163f6d
xorpd %xmm0, %xmm0
subsd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm2
mulsd 0xccac8(%rip), %xmm0    # 0x230a50
addsd %xmm2, %xmm0
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rsi)
movq $-0x1, 0x10(%rsi)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x18(%rsi)
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x16425e
movl $0x1, %ecx
xorl %edx, %edx
movq 0x28(%r14), %rsi
shlq $0x5, %rdx
movdqu %xmm0, (%rsi,%rdx)
movq $-0x1, 0x10(%rsi,%rdx)
movq %rax, 0x18(%rsi,%rdx)
movl %ecx, %edx
movq 0x20(%r14), %rdi
incl %ecx
cmpq %rdx, %rdi
ja 0x164236
movq 0x18(%r14), %rcx
leaq 0x73(%rip), %rsi        # 0x1642dc
movq %r14, %rdx
callq 0x1047b4
cmpq $0x0, 0x20(%r14)
je 0x1642cc
movl $0x1, %eax
xorl %edx, %edx
pxor %xmm0, %xmm0
movq 0x28(%r14), %rcx
shlq $0x5, %rdx
cmpl $-0x1, (%rcx,%rdx)
je 0x1642c2
addq %rdx, %rcx
movsd 0x18(%rcx), %xmm1
ucomisd %xmm1, %xmm0
jae 0x1642c2
ucomisd 0x18(%rbx), %xmm1
ja 0x1642b2
jne 0x1642c2
jp 0x1642c2
movl 0x14(%rcx), %edx
cmpl 0x14(%rbx), %edx
jae 0x1642c2
movupd (%rcx), %xmm1
movups 0x10(%rcx), %xmm2
movups %xmm2, 0x10(%rbx)
movupd %xmm1, (%rbx)
movl %eax, %edx
incl %eax
cmpq %rdx, 0x20(%r14)
ja 0x164283
xorl %eax, %eax
cmpl $-0x1, (%rbx)
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x30(%rdi), %rdi
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %esi, %esi
callq 0x20e0
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1641fe
testl %eax, %eax
je 0x1645b2
movq 0x40(%rbx), %rsi
movq 0x38(%rbx), %rdx
movq (%rbx), %rdi
movq 0x30(%rbx), %r8
movq 0x48(%rbx), %r9
movq %r14, (%rsp)
callq 0x16431a
jmp 0x164585
movq 0x40(%rbx), %rax
movl 0x38(%rax), %eax
testq %rax, %rax
je 0x1645fe
movq 0x38(%rbx), %rdx
movq 0x40(%rdx), %rcx
movq 0x50(%rdx), %rdx
addq $0x8, %rcx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsbl (%rdx,%rsi), %edi
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
movsd -0x8(%rcx), %xmm2
subsd (%rcx), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
incq %rsi
addq $0x10, %rcx
cmpq %rsi, %rax
jne 0x1645d4
jmp 0x164602
xorpd %xmm0, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0x38(%rdi), %eax
testq %rax, %rax
je 0x1646aa
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x10(%rdi), %rcx
movq 0x40(%rsi), %rdx
xorl %r8d, %r8d
xorps %xmm0, %xmm0
movq (%rcx,%r8,8), %r15
movq %r8, %r9
shlq $0x4, %r9
movups %xmm0, (%rdx,%r9)
testl %r15d, %r15d
je 0x164699
movq %r15, %r10
shrq $0x20, %r10
leaq (%rdx,%r9), %r11
addq $0x8, %r11
addq %rdx, %r9
movq 0x28(%rdi), %rbx
movq 0x50(%rsi), %r14
movl %r15d, %r15d
movl %r10d, %r12d
shlq $0x4, %r12
movl (%rbx,%r12), %r13d
cmpb $0x0, (%r14,%r13)
movq %r9, %r13
jle 0x16468c
addq %rbx, %r12
movsd 0x8(%r12), %xmm1
addsd (%r13), %xmm1
movsd %xmm1, (%r13)
jmp 0x164691
movq %r11, %r13
js 0x164674
incq %r10
decq %r15
jne 0x16465f
incq %r8
cmpq %rax, %r8
jne 0x16462d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0x38(%rdi), %eax
testq %rax, %rax
je 0x16472d
pushq %rbx
movq 0x10(%rdi), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movq (%rcx,%rdx,8), %r10
xorpd %xmm1, %xmm1
testl %r10d, %r10d
je 0x16470e
movq %r10, %r8
shrq $0x20, %r8
movq 0x28(%rdi), %r9
movl %r10d, %r10d
xorpd %xmm2, %xmm2
movl %r8d, %ebx
shlq $0x4, %rbx
leaq (%r9,%rbx), %r11
movl (%r9,%rbx), %ebx
cmpb $0x0, (%rsi,%rbx)
jle 0x1646fa
addsd 0x8(%r11), %xmm1
jmp 0x164702
jns 0x164702
addsd 0x8(%r11), %xmm2
incq %r8
decq %r10
jne 0x1646dd
subsd %xmm2, %xmm1
movsbl (%rsi,%rdx), %r8d
xorps %xmm2, %xmm2
cvtsi2sd %r8d, %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
incq %rdx
cmpq %rax, %rdx
jne 0x1646be
popq %rbx
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: mb_score_all_advance(mc_match_t const*, mb_g_t*)
t_w_t mb_score_all_advance(const mc_match_t *ma, mb_g_t *mbg)
{
	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 (mbg->u->u.a[mbg->u->idx.a[t]>>1].s[mbg->u->idx.a[t]&1] > 0) z[0] += e->w;
            else if (mbg->u->u.a[mbg->u->idx.a[t]>>1].s[mbg->u->idx.a[t]&1] < 0) z[1] += e->w;
        }
		zt += -((t_w_t)(mbg->u->u.a[mbg->u->idx.a[k]>>1].s[mbg->u->idx.a[k]&1])) * (z[0] - z[1]);
	}
	return zt;
}

// Assembly:
movl 0x38(%rdi), %eax
testq %rax, %rax
je 0x164812
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x10(%rdi), %rcx
movq (%rsi), %r8
movq 0x28(%r8), %rdx
movq 0x40(%r8), %r8
xorpd %xmm0, %xmm0
xorl %r9d, %r9d
movq (%rcx,%r9,8), %r15
xorpd %xmm1, %xmm1
testl %r15d, %r15d
je 0x1647d0
movq %r15, %r10
shrq $0x20, %r10
movq 0x28(%rdi), %r11
movq (%rsi), %r14
movq 0x28(%r14), %rbx
movq 0x40(%r14), %r14
movl %r15d, %r15d
xorpd %xmm2, %xmm2
movl %r10d, %r13d
shlq $0x4, %r13
leaq (%r11,%r13), %r12
movl (%r11,%r13), %r13d
movl (%rbx,%r13,4), %r13d
movl %r13d, %ebp
shrl %ebp
andl $0x1, %r13d
imulq $0x38, %rbp, %rbp
addq %r14, %rbp
cmpb $0x0, 0x10(%r13,%rbp)
jle 0x1647bb
addsd 0x8(%r12), %xmm1
jmp 0x1647c4
jns 0x1647c4
addsd 0x8(%r12), %xmm2
incq %r10
decq %r15
jne 0x164787
subsd %xmm2, %xmm1
movl (%rdx,%r9,4), %r10d
movl %r10d, %r11d
shrl %r11d
andl $0x1, %r10d
imulq $0x38, %r11, %r11
addq %r8, %r11
movsbl 0x10(%r10,%r11), %r10d
xorps %xmm2, %xmm2
cvtsi2sd %r10d, %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
incq %r9
cmpq %rax, %r9
jne 0x16475d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
xorl %ebp, %ebp
cmpl (%r12), %ebp
jge 0x164b97
movq (%rsp), %rax
incl (%rax)
movl 0xc(%rbx), %edi
movq 0x28(%rbx), %rsi
movq %rbx, %rdx
callq 0x16ba4c
cmpl $0x0, 0xc(%rbx)
je 0x164b8b
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq 0x40(%rbx), %rcx
movl (%rax,%r13,4), %edx
movq %rdx, %rax
shlq $0x4, %rax
movsd (%rcx,%rax), %xmm0
ucomisd 0x8(%rcx,%rax), %xmm0
jne 0x164b57
jnp 0x164b78
seta %al
negb %al
orb $0x1, %al
movq 0x50(%rbx), %rcx
cmpb %al, (%rcx,%rdx)
je 0x164b78
movsbl %al, %ecx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x163d25
incl %r14d
incq %r13
movl 0xc(%rbx), %eax
cmpq %rax, %r13
jb 0x164b35
testl %r14d, %r14d
sete %al
jmp 0x164b8d
movb $0x1, %al
incl %ebp
testb %al, %al
je 0x164b0a
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x163573
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0xc(%rdx)
je 0x164ca5
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
xorl %ebp, %ebp
movabsq $-0x61c8864680b583eb, %rsi # imm = 0x9E3779B97F4A7C15
movabsq $-0x40a7b892e31b1a47, %rdi # imm = 0xBF58476D1CE4E5B9
movabsq $-0x6b2fb644ecceee15, %r15 # imm = 0x94D049BB133111EB
movabsq $0x3ff0000000000000, %r12 # imm = 0x3FF0000000000000
movsd 0xc0938(%rip), %xmm2    # 0x225538
movq 0x30(%r13), %rax
movl 0x8(%rbx), %ecx
addl %ebp, %ecx
movl (%rax,%rcx,8), %edx
movq (%rbx), %rax
addq %rsi, %rax
movq %rax, %rcx
shrq $0x1e, %rcx
xorq %rax, %rcx
imulq %rdi, %rcx
movq %rcx, %rax
shrq $0x1b, %rax
xorq %rcx, %rax
imulq %r15, %rax
movq %rax, %rcx
shrq $0x1f, %rcx
xorq %rax, %rcx
movq %rcx, (%rbx)
shrq $0xc, %rcx
orq %r12, %rcx
movq %rcx, %xmm0
addsd %xmm2, %xmm0
movsd 0x10(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x164c8c
movq 0x50(%rbx), %rax
movb (%rax,%rdx), %al
xorl %ecx, %ecx
subb %al, %cl
movsbl %cl, %ecx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x163d25
movsd 0xc08c0(%rip), %xmm2    # 0x225538
movabsq $-0x40a7b892e31b1a47, %rdi # imm = 0xBF58476D1CE4E5B9
movabsq $-0x61c8864680b583eb, %rsi # imm = 0x9E3779B97F4A7C15
incl %ebp
cmpl 0xc(%rbx), %ebp
jb 0x164c00
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movabsq $-0x61c8864680b583eb, %rax # imm = 0x9E3779B97F4A7C15
addq (%rdx), %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, (%rdx)
shrq $0xc, %rcx
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
orq %rcx, %rax
movq %rax, %xmm0
addsd 0xc081c(%rip), %xmm0    # 0x225538
movq %rsi, %r14
movl 0xc(%rdx), %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
addsd 0xbd2dd(%rip), %xmm0    # 0x222010
cvttsd2si %xmm0, %rcx
leal -0x1(%rax), %esi
cmpl %ecx, %eax
cmoval %ecx, %esi
movq 0x30(%r14), %rax
addl 0x8(%rdx), %esi
movq (%rax,%rsi,8), %rax
movl %eax, %ecx
mulsd 0x10(%rdi), %xmm1
cvttsd2si %xmm1, %esi
movl %esi, 0xc(%rsp)
movq 0x30(%rdx), %r9
movl %eax, (%r9)
movq %rdx, 0x10(%rsp)
movq 0x38(%rdx), %rsi
movl %eax, (%rsi,%rcx,4)
xorl %ebx, %ebx
movl $0x1, %r8d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl %r8d, 0x8(%rsp)
cmpl %r8d, %ebx
jae 0x164dd9
movq 0x10(%r14), %r11
movl %ebx, %r15d
movl 0x8(%rsp), %r8d
movl %r8d, %r12d
movl (%r9,%r15,4), %ecx
movq (%r11,%rcx,8), %r13
movq %r13, %rbp
andq %rdi, %rbp
je 0x164dd1
shrq $0x20, %r13
movq 0x28(%r14), %rbx
movl %r13d, %ecx
shlq $0x4, %rcx
movl (%rbx,%rcx), %ecx
cmpl %eax, (%rsi,%rcx,4)
je 0x164dc9
movl %r8d, %r10d
incl %r8d
movl %ecx, (%r9,%r10,4)
movl %eax, (%rsi,%rcx,4)
incq %r13
decq %rbp
jne 0x164dad
incq %r15
cmpq %r12, %r15
jne 0x164d95
movl 0xc(%rsp), %r10d
testl %r10d, %r10d
setne %cl
cmpl %r10d, %r8d
seta %r10b
testb %r10b, %cl
jne 0x164dfb
incl %edx
movl 0x8(%rsp), %ebx
cmpl $0x3, %edx
jne 0x164d7c
testl %r8d, %r8d
movq 0x10(%rsp), %r12
je 0x164e34
movl %r8d, %ebx
xorl %r15d, %r15d
movq 0x30(%r12), %rax
movq 0x50(%r12), %rcx
movl (%rax,%r15,4), %edx
xorl %eax, %eax
subb (%rcx,%rdx), %al
movsbl %al, %ecx
movq %r14, %rdi
movq %r12, %rsi
callq 0x163d25
incq %r15
cmpq %r15, %rbx
jne 0x164e0b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movl %ecx, %eax
movq 0x40(%rdi), %r9
movq 0x50(%rdi), %r8
movl %ecx, %r10d
movsbl (%r8,%r10), %edi
movq 0x10(%rsi), %rcx
movq (%rcx,%r10,8), %rcx
shlq $0x4, %r10
movsd (%r9,%r10), %xmm1
movsd 0x8(%r9,%r10), %xmm2
testl %ecx, %ecx
je 0x1664f2
movq 0x28(%rsi), %r9
movq %rcx, %r10
shrq $0x20, %r10
movq 0x10(%rdx), %rdx
movl %ecx, %esi
shlq $0x4, %r10
addq %r10, %r9
addq $0x8, %r9
shlq $0x4, %rsi
xorpd %xmm0, %xmm0
xorl %r10d, %r10d
movq -0x8(%r9,%r10), %r11
movl %r11d, %ecx
andb $0x7, %cl
movl $0x1, %ebx
shll %cl, %ebx
cmpl %eax, %r11d
je 0x1664e7
movl %r11d, %ecx
shrl $0x3, %ecx
movzbl (%rdx,%rcx), %ecx
andl %ecx, %ebx
je 0x1664e7
movl %r11d, %ecx
movsbl (%r8,%rcx), %ecx
imull %edi, %ecx
xorps %xmm3, %xmm3
cvtsi2sd %ecx, %xmm3
mulsd (%r9,%r10), %xmm3
addsd %xmm3, %xmm0
addq $0x10, %r10
cmpq %r10, %rsi
jne 0x1664a6
jmp 0x1664f6
xorpd %xmm0, %xmm0
subsd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm2
mulsd 0xca53f(%rip), %xmm0    # 0x230a50
addsd %xmm2, %xmm0
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: gen_best_clus(mc_clus_t*, unsigned int*, unsigned int*, double*)
uint32_t gen_best_clus(mc_clus_t *bc, uint32_t *off, uint32_t *occ, double *rw)
{
	uint32_t i; (*off) = (*occ) = (uint32_t)-1; (*rw) = -1;
	for (i = 0; i < bc->n_thread; i++) clean_clus_flip_aux(&(bc->aux[i]));
	
	kt_for(bc->n_thread, worker_cal_clus_sc, bc, bc->cc.nn.n);
	
	for (i = 0; i < bc->n_thread; i++) {
		if(bc->aux[i].off == (uint32_t)-1) continue;
		if(bc->aux[i].w < 0) continue;

		if((bc->aux[i].w > (*rw)) || (bc->aux[i].w == (*rw) && bc->aux[i].off < (*off))) {
			(*off) = bc->aux[i].off; (*occ) = bc->aux[i].occ; (*rw) = bc->aux[i].w;
		}
	}
	if((*off) != (uint32_t)-1) return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%rdx)
movl %eax, (%rsi)
movabsq $-0x4010000000000000, %r13 # imm = 0xBFF0000000000000
movq %r13, (%rcx)
movl 0x58(%rdi), %edi
testl %edi, %edi
je 0x166798
movq %r15, (%rsp)
movl $0x24, %ebp
xorl %r15d, %r15d
movq 0x60(%r12), %rax
movq %r13, -0xc(%rax,%rbp)
movq $-0x1, -0x4(%rax,%rbp)
movq -0x24(%rax,%rbp), %rdx
movq -0x14(%rax,%rbp), %rdi
xorl %esi, %esi
callq 0x20e0
incq %r15
movl 0x58(%r12), %edi
addq $0x28, %rbp
cmpq %rdi, %r15
jb 0x16675f
movq (%rsp), %r15
movq (%r12), %rcx
leaq 0x7c(%rip), %rsi        # 0x16681f
movq %r12, %rdx
callq 0x1047b4
cmpl $0x0, 0x58(%r12)
je 0x166808
movq 0x60(%r12), %rax
addq $0x18, %rax
xorl %ecx, %ecx
xorpd %xmm0, %xmm0
movl 0x8(%rax), %edx
cmpl $-0x1, %edx
je 0x1667f7
movsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
ja 0x1667f7
ucomisd (%r14), %xmm1
ja 0x1667e3
jne 0x1667f7
jp 0x1667f7
cmpl (%rbx), %edx
jae 0x1667f7
movl 0x8(%rax), %edx
movl %edx, (%rbx)
movl 0xc(%rax), %edx
movl %edx, (%r15)
movsd (%rax), %xmm1
movsd %xmm1, (%r14)
incq %rcx
movl 0x58(%r12), %edx
addq $0x28, %rax
cmpq %rdx, %rcx
jb 0x1667c2
xorl %eax, %eax
cmpl $-0x1, (%rbx)
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/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:
movq 0x10(%rdi), %r9
cmpl $-0x1, (%r9,%rsi,4)
je 0x16686a
pushq %rax
movq %rsi, %rax
movl (%rdi), %r11d
movq 0x40(%rdi), %rcx
movq 0x28(%rcx), %r10
movq 0x68(%rdi), %rsi
movq 0x48(%rdi), %rcx
movzbl 0x50(%rdi), %r8d
movslq %edx, %rdx
leaq (%rdx,%rdx,4), %rdx
shlq $0x3, %rdx
addq 0x60(%rdi), %rdx
subq $0x8, %rsp
movq %r10, %rdi
pushq %rdx
pushq %rax
pushq %r11
callq 0x166517
addq $0x20, %rsp
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: flip_chain(mc_match_t const*, mc_svaux_t*, unsigned int*, unsigned int, unsigned int, unsigned int, bits_p*, unsigned char*, unsigned char)
double flip_chain(const mc_match_t *ma, mc_svaux_t *b, uint32_t *a, uint32_t a_n, uint32_t off, uint32_t occ, 
bits_p *vis, uint8_t *lock, uint8_t lock_max)
{
	uint32_t k, kn = off + occ;
	for (k = off; k < kn; k++) {
		vis->a[a[k]>>3] = 0;
		// if(occ == 4 && a[off] == 11279) dbg = 1;
	}
	for (k = off; k < kn; k++) {
		if(lock[a[k]] >= lock_max) continue;
		if(is_set_bits_p((*vis), a[k])) continue;
		set_bits_p((*vis), a[k]); lock[a[k]]++;
		// if(dbg) fprintf(stderr, "[M::%s::] a[%u]::%u, s::%d\n", __func__, k, a[k], b->s[a[k]]);
		mc_set_spin(ma, b, a[k], -b->s[a[k]]);
	}
	return mc_score(ma, b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movb 0x60(%rsp), %bpl
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %r13
addl %r8d, %r9d
movl %r8d, %r15d
movl %r9d, %ebx
cmpl %r8d, %r9d
jbe 0x1668bd
movq %r15, %rax
movq 0x10(%r13), %rcx
movl (%r14,%rax,4), %edx
shrl $0x3, %edx
movb $0x0, (%rcx,%rdx)
incq %rax
cmpq %rax, %rbx
jne 0x1668a6
cmpl %r8d, %r9d
jbe 0x166925
movl (%r14,%r15,4), %edx
cmpb %bpl, (%r12,%rdx)
jae 0x16691d
movq 0x10(%r13), %rax
movl %edx, %esi
movl %edx, %ecx
andb $0x7, %cl
movl $0x1, %edi
shll %cl, %edi
shrl $0x3, %esi
movzbl (%rax,%rsi), %ecx
andl $0x7, %edx
btl %edx, %ecx
jb 0x16691d
orb %cl, %dil
movb %dil, (%rax,%rsi)
movl (%r14,%r15,4), %eax
incb (%r12,%rax)
movl (%r14,%r15,4), %edx
movq 0x10(%rsp), %rsi
movq 0x50(%rsi), %rax
movb (%rax,%rdx), %al
xorl %ecx, %ecx
subb %al, %cl
movsbl %cl, %ecx
movq 0x8(%rsp), %rdi
callq 0x163d25
incq %r15
cmpq %r15, %rbx
jne 0x1668c2
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x163573
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: mc_solve_clus(mc_clus_t*)
t_w_t mc_solve_clus(mc_clus_t *bc)
{
	uint32_t off, occ/**, r = 0**/; double rw, sc, sc_opt = mc_score(bc->mg->e, bc->baux);
	memset(bc->lock, 0, bc->n*sizeof(*(bc->lock)));
	while (gen_best_clus(bc, &off, &occ, &rw)) {
		sc = flip_chain(bc->mg->e, bc->baux, bc->cc.nn.a, bc->cc.nn.n, off, occ, &(bc->aux[0].vis), bc->lock, bc->lock_max);
		// if(r%10000) {
		// 	fprintf(stderr, "[M::%s::] rw::%f, sc_opt::%f, sc::%f, off::%u, occ::%u, r::%u\n", 
		// 	__func__, rw, sc_opt, sc, off, occ, r);
		// }
		if(sc < sc_opt) {
			fprintf(stderr, "\nwrong::[M::%s::] rw::%f, sc_opt::%f, sc::%f, off::%u, occ::%u\n", 
			__func__, rw, sc_opt, sc, off, occ);
			// if(occ == 2) {
			// uint32_t k;
			// 	for (k = off; k < off + occ; k++) {
			// 		fprintf(stderr, "[M::%s::] a[%u]::%u, s::%d\n", __func__, k, bc->cc.nn.a[k], bc->baux->s[bc->cc.nn.a[k]]);
			// 	}
			// 	test_flip_sc(bc->mg->e, bc->baux, bc->cc.nn.a+off, occ, &(bc->aux[0].vis));
			// }
		}
		sc_opt = sc; //r++;
	}
	return sc_opt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x68(%rdi), %rsi
movq 0x28(%rax), %rdi
callq 0x163573
movsd %xmm0, 0x10(%rsp)
movq 0x48(%rbx), %rdi
movl 0x54(%rbx), %edx
xorl %esi, %esi
callq 0x20e0
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbx, %rdi
callq 0x16671f
testl %eax, %eax
je 0x166a46
leaq 0xc(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x20(%rsp), %rbp
movq 0x10(%rbx), %rdx
movq 0x40(%rbx), %rax
movq 0x28(%rax), %rdi
movq 0x68(%rbx), %rsi
movl 0xc(%rsp), %r14d
movl 0x8(%rsp), %r15d
movzbl 0x50(%rbx), %eax
subq $0x8, %rsp
movl %r14d, %r8d
movl %r15d, %r9d
pushq %rax
pushq 0x48(%rbx)
pushq 0x60(%rbx)
callq 0x16686b
addq $0x20, %rsp
movsd 0x10(%rsp), %xmm1
movsd %xmm0, 0x18(%rsp)
ucomisd %xmm0, %xmm1
ja 0x166a13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x16671f
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
testl %eax, %eax
jne 0x1669a6
jmp 0x166a4c
movq 0x1235c6(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
movsd 0x20(%rsp), %xmm0
leaq 0xca5a2(%rip), %rsi     # 0x230fcc
leaq 0xca5db(%rip), %rdx     # 0x23100c
movsd 0x18(%rsp), %xmm2
movl %r14d, %ecx
movl %r15d, %r8d
movb $0x3, %al
callq 0x22b0
jmp 0x1669f0
movsd 0x10(%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: mc_clus_cc(mc_clus_t*)
t_w_t mc_clus_cc(mc_clus_t *bc)
{
	// fprintf(stderr, "+[M::%s::]\n", __func__);
	// double index_time = yak_realtime();
    // uint32_t r = 1;
    t_w_t sc_opt, sc;
	// fprintf(stderr, "-[M::%s::]\n", __func__);
	mc_reset_z(bc->mg->e, bc->baux);
	// fprintf(stderr, "*[M::%s::]\n", __func__);
	sc_opt = mc_score(bc->mg->e, bc->baux); 
	// fprintf(stderr, "[M::%s::] sc_opt: %f\n", __func__, sc_opt);
	while (1) {
        sc = mc_solve_clus(bc);
        // fprintf(stderr, "[M::%s::# round: %u] sc_opt: %f, sc: %f\n", __func__, r, sc_opt, sc);
        if(sc <= (sc_opt+0.0000001)) break;
        sc_opt = sc; //r++;
    }
    // fprintf(stderr, "[M::%s::%.3f] ==> round %u\n", __func__, yak_realtime()-index_time, r);
	return sc;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x68(%rdi), %rsi
movq 0x28(%rax), %rdi
callq 0x16360e
movq 0x40(%rbx), %rax
movq 0x68(%rbx), %rsi
movq 0x28(%rax), %rdi
callq 0x163573
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x166942
movsd 0x8(%rsp), %xmm1
addsd 0xc9fc7(%rip), %xmm1    # 0x230a68
ucomisd %xmm0, %xmm1
jb 0x166a85
addq $0x10, %rsp
popq %rbx
retq