// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/rcut.cpp
// Function: debug_mbg(mb_g_t*, mc_g_t*, mc_svaux_t*)
void debug_mbg(mb_g_t *mbg, mc_g_t *mg, mc_svaux_t *b)
{
	uint32_t i, k, a_n[2], *a[2], qn, found;
	int8_t s[2];
	for (i = 0; i < mbg->u->u.n; i++)///each block
	{
		fprintf(stderr, "i: %u, mbg->u->u.n: %u\n", i, (uint32_t)mbg->u->u.n);
		decode_mb_node(mbg, i, &(a[0]), &(a_n[0]), &(s[0]), &(a[1]), &(a_n[1]), &(s[1]));

		found = 0;
		for (k = 0; k < a_n[0]; k++)
        {
            qn = a[0][k];
			if(b->s[qn] == s[0]) found = 1;
			if(b->s[qn] == 0) continue;
			if(b->s[qn] != s[0]) fprintf(stderr, "ERROR-0-::%s\n", __func__);
		}
		if(found == 0) fprintf(stderr, "ERROR-0-*::%s\n", __func__);

		found = 0;
		for (k = 0; k < a_n[1]; k++)
        {
            qn = a[1][k];
			if(b->s[qn] == s[1]) found = 1;
			if(b->s[qn] == 0) continue;
			if(b->s[qn] != s[1]) fprintf(stderr, "ERROR-1-::%s\n", __func__);
		}
		if(found == 0 && a_n[1] > 0) fprintf(stderr, "ERROR-1-*::%s\n", __func__);
	}

	// t_w_t mcw = mc_score_all(mg->e, b);
	// t_w_t mbw = 0;
	// mb_match_t *ma = mbg->e;
	// for (k = 0; k < ma->n_seq; ++k) {
	// 	///a[0]
	// 	mbw += -(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]
	// 	mbw += -(t_w_t)(mbg->u->u.a[k].s[1]) * (mbg->u->u.a[k].z[2] - mbg->u->u.a[k].z[3]);
	// }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rdi, %r14
pushq $0x1
popq %rbp
xorl %r15d, %r15d
movl %r15d, %eax
movq (%r14), %rcx
movq 0x30(%rcx), %rcx
cmpq %rax, %rcx
jbe 0x129c10
movq 0x12952a(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
xorl %r13d, %r13d
leaq 0xc5667(%rip), %rsi     # 0x1ef12a
movl %r15d, %edx
xorl %eax, %eax
callq 0x22b0
movq %r14, %rdi
movl %r15d, %esi
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x6(%rsp), %r8
leaq 0x18(%rsp), %r9
leaq 0x7(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x12e939
addq $0x10, %rsp
xorl %r12d, %r12d
movl 0x8(%rsp), %eax
cmpq %rax, %r13
jae 0x129b54
movq 0x10(%rsp), %rax
movl (%rax,%r13,4), %eax
movq 0x50(%rbx), %rcx
movb (%rcx,%rax), %al
cmpb 0x6(%rsp), %al
sete %cl
cmovel %ebp, %r12d
testb %al, %al
sete %al
orb %cl, %al
testb $0x1, %al
je 0x129b33
incq %r13
jmp 0x129aff
movq 0x1294a6(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xc505c(%rip), %rsi     # 0x1eeba0
leaq 0xc55f7(%rip), %rdx     # 0x1ef142
xorl %eax, %eax
callq 0x22b0
jmp 0x129b2e
testl %r12d, %r12d
je 0x129bcb
xorl %r13d, %r13d
xorl %r12d, %r12d
movl 0xc(%rsp), %eax
cmpq %rax, %r13
jae 0x129bb4
movq 0x18(%rsp), %rax
movl (%rax,%r13,4), %eax
movq 0x50(%rbx), %rcx
movb (%rcx,%rax), %al
cmpb 0x7(%rsp), %al
sete %cl
cmovel %ebp, %r12d
testb %al, %al
sete %al
orb %cl, %al
testb $0x1, %al
je 0x129b93
incq %r13
jmp 0x129b5f
movq 0x129446(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xc501e(%rip), %rsi     # 0x1eebc2
leaq 0xc5597(%rip), %rdx     # 0x1ef142
xorl %eax, %eax
callq 0x22b0
jmp 0x129b8e
testl %r12d, %r12d
setne %cl
testl %eax, %eax
sete %al
orb %cl, %al
je 0x129bef
incl %r15d
jmp 0x129a9c
movq 0x12940e(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xc5570(%rip), %rsi     # 0x1ef14c
leaq 0xc555f(%rip), %rdx     # 0x1ef142
xorl %eax, %eax
callq 0x22b0
jmp 0x129b59
movq 0x1293ea(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xc555b(%rip), %rsi     # 0x1ef15b
leaq 0xc553b(%rip), %rdx     # 0x1ef142
xorl %eax, %eax
callq 0x22b0
jmp 0x129bc3
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq