// File: chhylp123[P]hifiasm/rcut.cpp
// Function: debug_mc_interval_t(mc_interval_t*, unsigned int, unsigned int*, ma_ug_t*, asg_t*, trans_chain*)
void debug_mc_interval_t(mc_interval_t *p, uint32_t p_n, uint32_t *p_idx, ma_ug_t *ug, asg_t *rg, 
trans_chain* t_ch)
{
	fprintf(stderr, "0----------[M::%s]----------\n", __func__);
	uint32_t i, offset, v, sid, eid, spos, epos, p_status, p_uid, occ;
    ma_utg_t *u = NULL;
	mc_interval_t *a = NULL, *t = NULL;

	for (v = 0; v < ug->u.n; v++)
    {
		a = p + p_idx[v]; 
		occ = p_idx[v+1] - p_idx[v];
        for (i = 0; i < occ; i++)
        {
            if(a[i].uID != v) fprintf(stderr, "ERROR-s\n");
        }
    }

    for (v = 0, p_status = (uint32_t)-1, p_uid = (uint32_t)-1; v < p_n; v++)
    {
        t = &(p[v]);
        sid = t->nS;
        eid = t->nE;
        spos = t->bS;
        epos = t->bE;
        if(p_uid == t->uID && p_status == t->hs)
        {
            fprintf(stderr, "ERROR-a\n");
        } 
        p_status = t->hs;
        p_uid = t->uID;
        u = &(ug->u.a[t->uID]);
        for (i = offset = 0; i < u->n; i++)
        {
            if(i == sid)
            {
                if(spos != offset)
                {
                    fprintf(stderr, "ERROR-b\n");
                }
            }

            if(i == eid)
            {
                if(epos != (offset+rg->seq[u->a[i]>>33].len - 1))
                {
                    fprintf(stderr, "ERROR-c, real end: %u\n", 
                                    (uint32_t)(offset+rg->seq[u->a[i]>>33].len - 1));
                }
            }

            offset += (uint32_t)u->a[i];
            if(i >= sid && i <= eid)
            {
                if(t_ch->ir_het[u->a[i]>>33] != t->hs)
                {
                    fprintf(stderr, "ERROR-d: is_r_het: %u, h_status: %u\n", t_ch->ir_het[u->a[i]>>33], t->hs);
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq 0x1aa91a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x17434e(%rip), %rsi    # 0x38da1e
leaq 0x174365(%rip), %rdx    # 0x38da3c
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x21979c
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x3c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq -0x18(%rbp), %rcx
movl -0x3c(%rbp), %edx
subl (%rcx,%rdx,4), %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x58(%rbp), %eax
jae 0x21978c
movq -0x68(%rbp), %rax
movl -0x34(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpl -0x3c(%rbp), %eax
je 0x21977f
movq 0x1aa872(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x1742d8(%rip), %rsi    # 0x38da50
movb $0x0, %al
callq 0x22a0
jmp 0x219781
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x219749
jmp 0x21978e
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x2196fd
movl $0x0, -0x3c(%rbp)
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x54(%rbp) # imm = 0xFFFFFFFF
movl -0x3c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x2199d1
movq -0x8(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x70(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x70(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x54(%rbp), %eax
movq -0x70(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x219829
movl -0x50(%rbp), %eax
movq -0x70(%rbp), %rcx
movzbl 0x14(%rcx), %ecx
cmpl %ecx, %eax
jne 0x219829
movq 0x1aa7c8(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x174237(%rip), %rsi    # 0x38da59
movb $0x0, %al
callq 0x22a0
movq -0x70(%rbp), %rax
movzbl 0x14(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x70(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x70(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x2199c1
movl -0x34(%rbp), %eax
cmpl -0x40(%rbp), %eax
jne 0x2198a0
movl -0x48(%rbp), %eax
cmpl -0x38(%rbp), %eax
je 0x21989e
movq 0x1aa753(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x1741cb(%rip), %rsi    # 0x38da62
movb $0x0, %al
callq 0x22a0
jmp 0x2198a0
movl -0x34(%rbp), %eax
cmpl -0x44(%rbp), %eax
jne 0x219920
movl -0x4c(%rbp), %eax
movl -0x38(%rbp), %ecx
movq -0x28(%rbp), %rdx
movq 0x20(%rdx), %rdx
movq -0x60(%rbp), %rsi
movq 0x18(%rsi), %rsi
movl -0x34(%rbp), %edi
movq (%rsi,%rdi,8), %rsi
shrq $0x21, %rsi
movl (%rdx,%rsi,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x21991e
movq 0x1aa6fe(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x38(%rbp), %edx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x60(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x34(%rbp), %esi
movq (%rcx,%rsi,8), %rcx
shrq $0x21, %rcx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addl %eax, %edx
subl $0x1, %edx
leaq 0x174154(%rip), %rsi    # 0x38da6b
movb $0x0, %al
callq 0x22a0
jmp 0x219920
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x40(%rbp), %eax
jb 0x2199b1
movl -0x34(%rbp), %eax
cmpl -0x44(%rbp), %eax
ja 0x2199b1
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x34(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
movq -0x70(%rbp), %rcx
movzbl 0x14(%rcx), %ecx
cmpl %ecx, %eax
je 0x2199af
movq 0x1aa669(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x34(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %edx
movq -0x70(%rbp), %rax
movzbl 0x14(%rax), %ecx
leaq 0x1740da(%rip), %rsi    # 0x38da82
movb $0x0, %al
callq 0x22a0
jmp 0x2199b1
jmp 0x2199b3
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x219866
jmp 0x2199c3
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x2197b1
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)