// File: chhylp123[P]hifiasm/rcut.cpp
// Function: print_mc_node(mc_match_t const*, mc_svaux_t*, unsigned int)
void print_mc_node(const mc_match_t *ma, mc_svaux_t *b, uint32_t id)
{
	fprintf(stderr, "[M::%s::utg%.6ul-hap%u]\n", __func__, id, b->s[id]>0?1:b->s[id]<0?2:0);
	w_t w[128], z[4];
	uint32_t o, n, i, hn = 4;
	int8_t s;
	for (i = 0; i < hn; i++) w[i] = 0;
	o = ma->idx.a[id] >> 32;
    n = (uint32_t)ma->idx.a[id];
	for (i = 0; i < n; ++i)
	{
		s = b->s[ma_y(ma->ma.a[o + i])];
		w[s>0?1:s<0?2:0] += ma->ma.a[o + i].w;
	}	
	z[0] = z[3] = 0; z[1] = b->z[id].z[0]; z[2] = b->z[id].z[1];
	for (i = 0; i < hn; i++) fprintf(stderr, "w[%u]-%f, z[%u]-%f\n", i, w[i], i, z[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq 0x1a59c3(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x460(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x458(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x14(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x21e651
movl $0x1, %eax
movl %eax, -0x464(%rbp)
jmp 0x21e673
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x14(%rbp), %ecx
movsbl (%rax,%rcx), %edx
xorl %eax, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovll %ecx, %eax
movl %eax, -0x464(%rbp)
movl -0x458(%rbp), %ecx
movq -0x460(%rbp), %rdi
movl -0x464(%rbp), %r8d
leaq 0x16f5d6(%rip), %rsi    # 0x38dc64
leaq 0x16f5e8(%rip), %rdx    # 0x38dc7d
movb $0x0, %al
callq 0x22a0
movl $0x4, -0x450(%rbp)
movl $0x0, -0x44c(%rbp)
movl -0x44c(%rbp), %eax
cmpl -0x450(%rbp), %eax
jae 0x21e6e1
movl -0x44c(%rbp), %eax
xorps %xmm0, %xmm0
movsd %xmm0, -0x420(%rbp,%rax,8)
movl -0x44c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44c(%rbp)
jmp 0x21e6b0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x444(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x448(%rbp)
movl $0x0, -0x44c(%rbp)
movl -0x44c(%rbp), %eax
cmpl -0x448(%rbp), %eax
jae 0x21e7f1
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x444(%rbp), %edx
addl -0x44c(%rbp), %edx
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x451(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x444(%rbp), %ecx
addl -0x44c(%rbp), %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x470(%rbp)
movsbl -0x451(%rbp), %eax
cmpl $0x0, %eax
jle 0x21e7a1
movl $0x1, %eax
movl %eax, -0x474(%rbp)
jmp 0x21e7bb
movsbl -0x451(%rbp), %edx
xorl %eax, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovll %ecx, %eax
movl %eax, -0x474(%rbp)
movsd -0x470(%rbp), %xmm0
movl -0x474(%rbp), %eax
cltq
addsd -0x420(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x420(%rbp,%rax,8)
movl -0x44c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44c(%rbp)
jmp 0x21e719
xorps %xmm0, %xmm0
movsd %xmm0, -0x428(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x440(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x438(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x430(%rbp)
movl $0x0, -0x44c(%rbp)
movl -0x44c(%rbp), %eax
cmpl -0x450(%rbp), %eax
jae 0x21e8af
movq 0x1a577d(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x44c(%rbp), %edx
movl -0x44c(%rbp), %eax
movsd -0x420(%rbp,%rax,8), %xmm0
movl -0x44c(%rbp), %ecx
movl -0x44c(%rbp), %eax
movsd -0x440(%rbp,%rax,8), %xmm1
leaq 0x16f3f4(%rip), %rsi    # 0x38dc8b
movb $0x2, %al
callq 0x22a0
movl -0x44c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44c(%rbp)
jmp 0x21e84e
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
nopl (%rax,%rax)