// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: debug_ul_vec_t_chain(void*, asg_t const*, ul_vec_t*, st_mt_t*, vec_sp_node_t*)
void debug_ul_vec_t_chain(void *km, const asg_t *g, ul_vec_t *rch, st_mt_t *dst_done, vec_sp_node_t *out)
{
	if(rch->dd == 0) return;
	uint64_t k, i, v, w, nv; int64_t dd; asg_arc_t *av; 
	mg_path_dst_t dst; uint64_t dst_group; uc_block_t *a = rch->bb.a;
	for (k = 0; k < rch->bb.n; k++) {
		if(a[k].pidx != (uint32_t)-1) assert(a[a[k].pidx].aidx == k);
		if(a[k].aidx != (uint32_t)-1) assert(a[a[k].aidx].pidx == k);
		if(a[k].pidx == (uint32_t)-1) continue;

		v = (a[k].hid<<1)|a[k].rev; v ^= 1;
		w = (a[a[k].pidx].hid<<1)|a[a[k].pidx].rev; w ^= 1;
		
		nv = asg_arc_n(g, v); av = asg_arc_a(g, v);
		for (i = 0; i < nv; i++) {
			if(av[i].v == w) break;
		}
		// if(i >= nv) {
		// 	// fprintf(stderr, "[M::%s::]\n", __func__);
		// 	fprintf(stderr, "[M::%s::]\tutg%.6dl(%c)\t->\tutg%.6dl(%c)\n", __func__, (int32_t)(v>>1)+1, "+-"[v&1], (int32_t)(w>>1)+1, "+-"[w&1]);
		// }
		if(i < nv) {
			dd = (int64_t)((uint32_t)(av[i].ul));
		} else {
			memset(&dst, 0, sizeof(dst));
            dst.v = w; 
            dst.target_dist = a[k].pdis;
            dst.target_hash = 0; dst.check_hash = 0;
			hc_shortest_k(km, g, v, 1, &dst, dst.target_dist, MG_MAX_SHORT_K, dst_done, &dst_group, out, NULL, 1, 0, 0);
			dd = dst.dist;
		}
		if(a[k].pdis != dd) {
			fprintf(stderr, "[M::%s::]\tutg%.6dl(%c)\t->\tutg%.6dl(%c)\tdist_pre:%d\td:%ld\n", __func__, (int32_t)(v>>1)+1, "+-"[v&1], 
			(int32_t)(w>>1)+1, "+-"[w&1], a[k].pdis, dd);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
cmpb $0x0, 0x50(%rdx)
je 0x1a7d87
movq %rsi, 0x28(%rsp)
cmpq $0x0, 0x20(%rdx)
je 0x1a7d87
movq 0x30(%rdx), %r13
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq %rdx, (%rsp)
leaq (%r15,%r15,8), %rcx
movl 0x14(%r13,%rcx,4), %eax
cmpq %r8, %rax
je 0x1a7bd6
leaq (%rax,%rax,8), %rsi
movl 0x1c(%r13,%rsi,4), %esi
cmpq %rsi, %r15
jne 0x1a7db5
leaq (,%rcx,4), %r12
addq %r13, %r12
movl 0x1c(%r12), %ecx
cmpq %r8, %rcx
je 0x1a7bfd
leaq (%rcx,%rcx,8), %rcx
movl 0x14(%r13,%rcx,4), %ecx
cmpq %rcx, %r15
jne 0x1a7d96
cmpl $-0x1, %eax
je 0x1a7d0b
movl (%r12), %esi
movl 0x20(%r12), %ecx
shrl $0x5, %ecx
andl $0x1, %ecx
movq %rsi, 0x20(%rsp)
leal (%rcx,%rsi,2), %r14d
xorl $0x1, %r14d
leaq (%rax,%rax,8), %rax
movl (%r13,%rax,4), %ebx
movl 0x20(%r13,%rax,4), %eax
shrl $0x5, %eax
andl $0x1, %eax
leal (%rax,%rbx,2), %ebp
xorl $0x1, %ebp
movq 0x28(%rsp), %rsi
movq 0x28(%rsi), %rax
movq (%rax,%r14,8), %rcx
movq %rcx, %rdi
andq %r8, %rdi
je 0x1a7c7f
movq 0x8(%rsi), %rax
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %r8
addq $0x8, %r8
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
xorl %r9d, %r9d
cmpl %ebp, (%r8,%r9)
je 0x1a7cf3
addq $0x18, %r9
cmpq %r9, %rdi
jne 0x1a7c70
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movl %ebp, 0x30(%rsp)
movl 0x18(%r12), %r9d
movl %r9d, 0x34(%rsp)
movl $0x0, 0x38(%rsp)
andb $-0x41, 0x3f(%rsp)
subq $0x8, %rsp
xorps %xmm0, %xmm0
movq 0x10(%rsp), %rdi
movl %r14d, %edx
movl $0x1, %ecx
leaq 0x38(%rsp), %r8
xorl %eax, %eax
pushq %rax
pushq $0x1
pushq %rax
pushq 0x38(%rsp)
leaq 0x88(%rsp), %rax
pushq %rax
pushq 0x40(%rsp)
pushq $0xf
callq 0x1a7dd4
movq 0x40(%rsp), %rdx
addq $0x40, %rsp
movslq 0x4c(%rsp), %r10
jmp 0x1a7cfb
leaq (%rax,%rcx,8), %rax
movl (%r9,%rax), %r10d
movl 0x18(%r12), %r11d
cmpq %r11, %r10
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
jne 0x1a7d1a
incq %r15
cmpq 0x20(%rdx), %r15
jb 0x1a7bb6
jmp 0x1a7d87
movq 0xe22bf(%rip), %rax     # 0x289fe0
movq (%rax), %rdi
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x20(%rsp), %r9
andl %eax, %r9d
incl %r9d
andl $0x1, %r14d
leaq 0x7e484(%rip), %rcx     # 0x2261c3
movsbl (%r14,%rcx), %r8d
andl %eax, %ebx
incl %ebx
andl $0x1, %ebp
movsbl (%rbp,%rcx), %r14d
subq $0x8, %rsp
leaq 0x8d079(%rip), %rsi     # 0x234dd5
leaq 0x8d0ac(%rip), %rdx     # 0x234e0f
movl %r9d, %ecx
movl %ebx, %r9d
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r14
callq 0x22b0
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rdx
addq $0x20, %rsp
jmp 0x1a7d0b
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8d021(%rip), %rdi     # 0x234dbe
leaq 0x8bbe7(%rip), %rsi     # 0x23398b
leaq 0x8cfba(%rip), %rcx     # 0x234d65
movl $0x13e3, %edx           # imm = 0x13E3
callq 0x2110
leaq 0x8cf92(%rip), %rdi     # 0x234d4e
leaq 0x8bbc8(%rip), %rsi     # 0x23398b
leaq 0x8cf9b(%rip), %rcx     # 0x234d65
movl $0x13e2, %edx           # imm = 0x13E2
callq 0x2110