// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %r12
movq %rdi, (%rsp)
movq 0xc9f6d(%rip), %r13     # 0x252fe0
xorl %ebx, %ebx
movq %rdx, 0x8(%rsp)
cmpq 0x8(%rdx), %rbx
jge 0x1891c4
movq (%rsp), %rax
movq (%rax), %rax
movq (%rdx), %rcx
imulq $0x28, %rbx, %rdx
movslq (%rcx,%rdx), %rsi
imulq $0x1c, %rsi, %rsi
movl (%rax,%rsi), %r14d
movl 0x4(%rax,%rsi), %edi
movq %rdi, 0x30(%rsp)
movq (%r13), %rdi
movl 0x8(%rcx,%rdx), %ecx
movl %ecx, %edx
shrl %edx
imulq $0x28, %rdx, %r9
movl %edx, %r8d
incl %r8d
movq 0x18(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq %r13, %rbp
movl (%rdx,%r9), %r13d
movl %r13d, %edx
shrl $0x1f, %edx
leaq 0x5d5b1(%rip), %r9      # 0x1e668b
movsbl (%rdx,%r9), %r9d
andl $0x1, %ecx
leaq 0x5b13a(%rip), %rdx     # 0x1e4223
movsbl (%rcx,%rdx), %ecx
movq %rcx, 0x28(%rsp)
movl 0x8(%rax,%rsi), %ecx
movq %rcx, 0x20(%rsp)
movl 0x10(%rax,%rsi), %r15d
movl 0x14(%rax,%rsi), %r10d
movq 0x10(%rsp), %rax
movq %r12, %r11
movl 0x18(%rax), %r12d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
subq $0x8, %rsp
leaq 0x6c06b(%rip), %rsi     # 0x1f518e
leaq 0x6c0c5(%rip), %rdx     # 0x1f51ef
movq %rbx, %rcx
xorl %eax, %eax
pushq %r13
movq %rbp, %r13
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
pushq %r10
pushq %r15
pushq %r12
movq %r11, %r12
pushq 0x48(%rsp)
pushq 0x60(%rsp)
pushq 0x60(%rsp)
callq 0x22b0
addq $0x40, %rsp
testq %r14, %r14
js 0x1891b7
movq (%r12), %rax
movq (%r13), %rdi
imulq $0x1c, %r14, %r15
movl 0x4(%rax,%r15), %r8d
andl %ebp, %r8d
movl 0x8(%rax,%r15), %r9d
movl 0x10(%rax,%r15), %r10d
movl 0x14(%rax,%r15), %r11d
leaq 0x6c07d(%rip), %rsi     # 0x1f5203
leaq 0x6c062(%rip), %rdx     # 0x1f51ef
movq %r14, %rcx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
movq (%r12), %rax
movl 0xc(%rax,%r15), %r14d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r14
pushq $-0x1
popq %rax
cmoveq %rax, %r14
jmp 0x189157
incq %rbx
movq 0x8(%rsp), %rdx
jmp 0x18907a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq