// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0x30(%rcx), %rax
jae 0x224622
movq 0x19fbba(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
movl %eax, %ecx
leaq 0x169a4a(%rip), %rsi    # 0x38de8a
movb $0x0, %al
callq 0x22a0
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x40(%rbp), %rdx
leaq -0x28(%rbp), %rcx
leaq -0x4a(%rbp), %r8
leaq -0x40(%rbp), %r9
addq $0x8, %r9
leaq -0x28(%rbp), %r10
addq $0x4, %r10
leaq -0x4a(%rbp), %rax
addq $0x1, %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x22d100
movl $0x0, -0x48(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jae 0x224521
movq -0x40(%rbp), %rax
movl -0x20(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x44(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movsbl -0x4a(%rbp), %ecx
cmpl %ecx, %eax
jne 0x2244c5
movl $0x1, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x44(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x2244db
jmp 0x224513
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x44(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movsbl -0x4a(%rbp), %ecx
cmpl %ecx, %eax
je 0x224511
movq 0x19fae7(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x1693fd(%rip), %rsi    # 0x38d900
leaq 0x169998(%rip), %rdx    # 0x38dea2
movb $0x0, %al
callq 0x22a0
jmp 0x224513
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x22448e
cmpl $0x0, -0x48(%rbp)
jne 0x224546
movq 0x19fab2(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x169974(%rip), %rsi    # 0x38deac
leaq 0x169963(%rip), %rdx    # 0x38dea2
movb $0x0, %al
callq 0x22a0
movl $0x0, -0x48(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x2245e7
movq -0x38(%rbp), %rax
movl -0x20(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x44(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movsbl -0x49(%rbp), %ecx
cmpl %ecx, %eax
jne 0x22458b
movl $0x1, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x44(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x2245a1
jmp 0x2245d9
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x44(%rbp), %ecx
movsbl (%rax,%rcx), %eax
movsbl -0x49(%rbp), %ecx
cmpl %ecx, %eax
je 0x2245d7
movq 0x19fa21(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x169359(%rip), %rsi    # 0x38d922
leaq 0x1698d2(%rip), %rdx    # 0x38dea2
movb $0x0, %al
callq 0x22a0
jmp 0x2245d9
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x224554
cmpl $0x0, -0x48(%rbp)
jne 0x224612
cmpl $0x0, -0x24(%rbp)
jbe 0x224612
movq 0x19f9e6(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x1698b7(%rip), %rsi    # 0x38debb
leaq 0x169897(%rip), %rdx    # 0x38dea2
movb $0x0, %al
callq 0x22a0
jmp 0x224614
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x22440b
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)