// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movq %r8, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
cmpq $0x0, 0x8(%rdx)
jle 0x1d5a63
movq 0xbf6d1(%rip), %r12     # 0x294fe0
leaq 0x6da11(%rip), %r13     # 0x243327
xorl %r14d, %r14d
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x18(%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), %ebx
movl 0x4(%rax,%rcx), %edi
movq %rdi, 0x40(%rsp)
movq (%r12), %rdi
movl 0x8(%rdx,%rsi,8), %edx
movl %edx, %esi
shrl %esi
leaq (%rsi,%rsi,4), %r9
movl %esi, %r8d
incl %r8d
movq 0x28(%rsp), %rsi
movq 0x10(%rsi), %rsi
movq %r13, %r11
movl (%rsi,%r9,8), %r13d
movl %r13d, %esi
shrl $0x1f, %esi
leaq 0x5edbb(%rip), %r9      # 0x23473b
movsbl (%rsi,%r9), %r9d
andl $0x1, %edx
leaq 0x5c944(%rip), %rsi     # 0x2322d3
movsbl (%rdx,%rsi), %edx
movq %rdx, 0x38(%rsp)
movl 0x8(%rax,%rcx), %edx
movq %rdx, 0x30(%rsp)
movl 0x10(%rax,%rcx), %r15d
movl 0x14(%rax,%rcx), %r10d
movq 0x20(%rsp), %rax
movq %r12, %rbp
movl 0x18(%rax), %r12d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
subq $0x8, %rsp
leaq 0x6d8fd(%rip), %rsi     # 0x2432c6
movq %r11, %rdx
movq %r14, %rcx
xorl %eax, %eax
pushq %r13
movq %r11, %r13
pushq %r10
pushq %r15
movq 0x28(%rsp), %r15
pushq %r12
movq %rbp, %r12
pushq 0x58(%rsp)
pushq 0x70(%rsp)
pushq 0x70(%rsp)
callq 0x22b0
addq $0x40, %rsp
movq (%r15), %rax
leaq 0x6d938(%rip), %rbp     # 0x24333b
movl %ebx, %ecx
movq (%r12), %rdi
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rbx
addq %rcx, %rbx
movl 0x4(%rax,%rbx), %r8d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %r8d
movl 0x8(%rax,%rbx), %r9d
movl 0x10(%rax,%rbx), %r10d
movl 0x14(%rax,%rbx), %r11d
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
addq $0x10, %rsp
movq (%r15), %rax
movl 0xc(%rax,%rbx), %ebx
cmpl $-0x1, %ebx
jne 0x1d5a03
incq %r14
movq 0x10(%rsp), %rdx
cmpq 0x8(%rdx), %r14
jl 0x1d5923
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq