// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %rcx, %r14
movq %rdx, %r13
movl %esi, 0x10(%rsp)
movq %rdi, 0x30(%rsp)
movq 0x26c334(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x212ef8(%rip), %rsi    # 0x230bae
leaq 0x212f0f(%rip), %rdx    # 0x230bcc
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x22b0
movq %r14, 0x38(%rsp)
cmpq $0x0, (%r14)
je 0x1dd39
movq 0x30(%rsp), %rax
leaq 0x10(%rax), %r14
xorl %eax, %eax
movl %ebx, %r15d
movl (%r13,%rax,4), %eax
leal 0x1(%r15), %ebx
movl (%r13,%rbx,4), %r12d
cmpl %eax, %r12d
jne 0x1dd00
movl %ebx, %eax
movq 0x38(%rsp), %rcx
cmpq %rax, (%rcx)
ja 0x1dcdc
jmp 0x1dd39
subl %eax, %r12d
imulq $0x18, %rax, %rbp
addq %r14, %rbp
cmpl %r15d, (%rbp)
jne 0x1dd1b
addq $0x18, %rbp
decq %r12
jne 0x1dd0a
jmp 0x1dcf2
movq 0x26c2be(%rip), %rax    # 0x289fe0
movq (%rax), %rcx
leaq 0x212eb4(%rip), %rdi    # 0x230be0
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
jmp 0x1dd10
movl 0x10(%rsp), %eax
testl %eax, %eax
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdi
je 0x1df66
movl %eax, %eax
movq %rax, 0x40(%rsp)
pushq $-0x1
popq %rdx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %eax, %eax
movl %edx, 0x2c(%rsp)
movq %rax, 0x50(%rsp)
imulq $0x18, %rax, %rax
movq 0x30(%rsp), %rcx
leaq (%rcx,%rax), %r9
movl 0x8(%rcx,%rax), %r12d
movl 0xc(%rcx,%rax), %r13d
movl (%rcx,%rax), %r10d
movl 0x4(%rcx,%rax), %r11d
cmpl 0x10(%rcx,%rax), %edx
movq %r9, 0x10(%rsp)
movl %r10d, 0xc(%rsp)
movl %r11d, 0x8(%rsp)
jne 0x1ddae
movzbl 0x14(%r9), %eax
cmpl %eax, 0x2c(%rsp)
je 0x1df26
movzbl 0x14(%r9), %eax
movl %eax, 0x2c(%rsp)
movl 0x10(%r9), %ecx
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rbp
movq %rcx, 0x48(%rsp)
imulq $0x28, %rcx, %rax
cmpl $0x0, 0x10(%rbp,%rax)
je 0x1df0c
addq %rax, %rbp
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpq %r14, %r12
jne 0x1ddea
cmpl %ebx, %r10d
jne 0x1de54
cmpq %r14, %r13
jne 0x1de13
movq 0x20(%rdi), %rax
movq 0x18(%rbp), %rcx
movq (%rcx,%r14,8), %rcx
shrq $0x21, %rcx
movl (%rax,%rcx,8), %eax
andl %r8d, %eax
leal (%rbx,%rax), %edx
decl %edx
cmpl %edx, %r11d
jne 0x1de94
movq 0x18(%rbp), %rax
movq (%rax,%r14,8), %r15
cmpq %r12, %r14
jb 0x1de41
cmpq %r13, %r14
ja 0x1de41
movq 0x10(%rsi), %rax
movq %r15, %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %edx
movzbl 0x14(%r9), %ecx
cmpb %cl, %dl
jne 0x1ded0
addl %r15d, %ebx
incq %r14
movl 0x10(%rbp), %eax
cmpq %rax, %r14
jb 0x1dde0
jmp 0x1df0c
movq 0x26c185(%rip), %rax    # 0x289fe0
movq (%rax), %rcx
leaq 0x212d8d(%rip), %rdi    # 0x230bf2
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movl 0x8(%rsp), %r11d
movl 0xc(%rsp), %r10d
movq 0x10(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
jmp 0x1ddea
movq 0x26c145(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x212d56(%rip), %rsi    # 0x230bfb
xorl %eax, %eax
callq 0x22b0
movl 0x8(%rsp), %r11d
movl 0xc(%rsp), %r10d
movq 0x10(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
jmp 0x1de13
movq 0x26c109(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x212d31(%rip), %rsi    # 0x230c12
xorl %eax, %eax
callq 0x22b0
movl 0x8(%rsp), %r11d
movl 0xc(%rsp), %r10d
movq 0x10(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
jmp 0x1de41
movq 0x50(%rsp), %rax
incq %rax
cmpq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
jne 0x1dd65
jmp 0x1df66
movq 0x26c0b3(%rip), %rax    # 0x289fe0
movq (%rax), %rcx
leaq 0x212cb2(%rip), %rdi    # 0x230be9
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movl 0x8(%rsp), %r11d
movl 0xc(%rsp), %r10d
movq 0x10(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
jmp 0x1ddae
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq