// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: print_ru_raw_chains(kv_ul_ov_t*, kv_ul_ov_t*, vec_mg_lchain_t*, ul_vec_t*, ma_ug_t*)
void print_ru_raw_chains(kv_ul_ov_t *raw_idx, kv_ul_ov_t *raw_chn, vec_mg_lchain_t *gch, ul_vec_t *rch, ma_ug_t *ug)
{
	int64_t k, i; uint64_t ts, te, qs, qe;
	for (k = 0; k < (int64_t)gch->n; k++) {
		i = raw_idx->a[gch->a[k].off].qn;
		qs = ((raw_chn->a[i].qs<<1)>>1); qe = raw_chn->a[i].qe;
		fprintf(stderr, "\n[M::%s->overall chain (%ld)] utg%.6d%c(%c), qs->%u, qe->%u, qlen->%u, ts->%u, te->%u, tlen->%u\n", __func__, k, 
		(int32_t)(gch->a[k].v>>1)+1, "lc"[ug->u.a[(gch->a[k].v>>1)].circ], "+-"[(gch->a[k].v&1)],
		raw_idx->a[gch->a[k].off].qs, raw_idx->a[gch->a[k].off].qe, rch->rlen,
		raw_idx->a[gch->a[k].off].ts, raw_idx->a[gch->a[k].off].te, ug->u.a[(gch->a[k].v>>1)].len);
		ts = raw_chn->a[i].ts; te = raw_chn->a[i].te;
		for (;i>=0;) {
			if(((raw_chn->a[i].qs<<1)>>1) < qs) qs = ((raw_chn->a[i].qs<<1)>>1);
			if(raw_chn->a[i].ts < ts) ts = raw_chn->a[i].ts;
			if(raw_chn->a[i].qe > qe) qe = raw_chn->a[i].qe;
			if(raw_chn->a[i].te > te) te = raw_chn->a[i].te;

			fprintf(stderr, "[M::%s->chain pieces (%ld)] qs->%u, qe->%u, ts->%u, te->%u\n", __func__, i, 
			((raw_chn->a[i].qs<<1)>>1), raw_chn->a[i].qe, raw_chn->a[i].ts, raw_chn->a[i].te);

			if(raw_chn->a[i].tn == (uint32_t)-1) i = -1;
			else i = raw_chn->a[i].tn;
		}

	}
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
cmpq $0x0, 0x8(%rdx)
jle 0x1cbacf
movq %rsi, %r12
movq 0xbe66a(%rip), %r15     # 0x289fe0
leaq 0x6b6da(%rip), %rbp     # 0x237057
xorl %r14d, %r14d
movq %rdx, (%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rdx), %rdx
leaq (%r14,%r14,4), %rsi
movslq (%rdx,%rsi,8), %rdi
leaq (%rdi,%rdi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdi, %rcx
movl (%rax,%rcx), %r13d
movl 0x4(%rax,%rcx), %edi
movq %rdi, 0x30(%rsp)
movq (%r15), %rdi
movl 0x8(%rdx,%rsi,8), %edx
movl %edx, %esi
shrl %esi
leaq (%rsi,%rsi,4), %r9
movl %esi, %r8d
incl %r8d
movq 0x18(%rsp), %rsi
movq 0x10(%rsi), %rsi
movl (%rsi,%r9,8), %ebx
movl %ebx, %esi
shrl $0x1f, %esi
leaq 0x5cc4e(%rip), %r9      # 0x22862b
movsbl (%rsi,%r9), %r9d
andl $0x1, %edx
leaq 0x5a7d7(%rip), %rsi     # 0x2261c3
movsbl (%rdx,%rsi), %edx
movq %rdx, 0x28(%rsp)
movl 0x8(%rax,%rcx), %edx
movq %rdx, 0x20(%rsp)
movq %rbp, %rdx
movq %r15, %rbp
movl 0x10(%rax,%rcx), %r15d
movl 0x14(%rax,%rcx), %r10d
movq 0x10(%rsp), %rax
movl 0x18(%rax), %r11d
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
subq $0x8, %rsp
leaq 0x6b5ce(%rip), %rsi     # 0x236ff6
movq %r14, %rcx
xorl %eax, %eax
pushq %rbx
pushq %r10
pushq %r15
movq %rbp, %r15
movq %rdx, %rbp
pushq %r11
pushq 0x48(%rsp)
pushq 0x60(%rsp)
pushq 0x60(%rsp)
callq 0x22b0
addq $0x40, %rsp
movq (%r12), %rax
movq (%r15), %rdi
leaq (,%r13,8), %rcx
addq %r13, %rcx
leaq (%rcx,%rcx,2), %rbx
addq %r13, %rbx
movl 0x4(%rax,%rbx), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movl 0x8(%rax,%rbx), %r9d
movl 0x10(%rax,%rbx), %r10d
movl 0x14(%rax,%rbx), %r11d
leaq 0x6b5e0(%rip), %rsi     # 0x23706b
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
addq $0x10, %rsp
movq (%r12), %rax
movl 0xc(%rax,%rbx), %r13d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r13
movq $-0x1, %rax
cmoveq %rax, %r13
jne 0x1cba4f
incq %r14
movq (%rsp), %rdx
cmpq 0x8(%rdx), %r14
jl 0x1cb984
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq