// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
movq %r8, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x2dce4b
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x28, -0x50(%rbp), %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x78(%rbp)
movq 0xe74d1(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x50(%rbp), %rdx
addq %rdx, %rax
movl 0x8(%rax), %r8d
shrl %r8d
addl $0x1, %r8d
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x28, -0x50(%rbp), %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
shrl %edx
movl %edx, %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0xa879e(%rip), %rax     # 0x385303
movsbl (%rax,%rdx), %r9d
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x50(%rbp), %rdx
addq %rdx, %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0xa6311(%rip), %rax     # 0x382e9b
movsbl (%rax,%rdx), %r12d
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x28, -0x50(%rbp), %rsi
addq %rsi, %rdx
movslq (%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rax
movl 0x4(%rax), %r15d
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x28, -0x50(%rbp), %rsi
addq %rsi, %rdx
movslq (%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rax
movl 0x8(%rax), %r14d
movq -0x40(%rbp), %rax
movl 0x18(%rax), %ebx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x28, -0x50(%rbp), %rsi
addq %rsi, %rdx
movslq (%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rax
movl 0x10(%rax), %r11d
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x28, -0x50(%rbp), %rsi
addq %rsi, %rdx
movslq (%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rax
movl 0x14(%rax), %r10d
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x28, -0x50(%rbp), %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
shrl %edx
movl %edx, %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0xb7241(%rip), %rsi     # 0x393e9a
leaq 0xb729b(%rip), %rdx     # 0x393efb
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x58(%rbp)
jl 0x2dce38
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
cmpq -0x70(%rbp), %rax
jae 0x2dccf8
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpq -0x60(%rbp), %rax
jae 0x2dcd26
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq -0x78(%rbp), %rax
jbe 0x2dcd54
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x68(%rbp), %rax
jbe 0x2dcd82
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x68(%rbp)
movq 0xe7257(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x58(%rbp), %rcx
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x4(%rax), %r8d
shll %r8d
shrl %r8d
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x10(%rax), %r10d
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x14(%rax), %eax
leaq 0xb7127(%rip), %rsi     # 0x393f0f
leaq 0xb710c(%rip), %rdx     # 0x393efb
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
jne 0x2dce1d
movq $-0x1, -0x58(%rbp)
jmp 0x2dce33
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x58(%rbp)
jmp 0x2dccb3
jmp 0x2dce3a
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2dca9e
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)