// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, %r13
movl %esi, 0x8(%rsp)
movq %rdi, 0x28(%rsp)
movq 0x2780d6(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x21feea(%rip), %rsi    # 0x23cdfe
leaq 0x21ff01(%rip), %rdx    # 0x23ce1c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x22b0
movq %r14, 0x30(%rsp)
movq (%r14), %rax
testq %rax, %rax
je 0x1cf96
movq 0x28(%rsp), %rcx
leaq 0x10(%rcx), %r14
movl %ebx, %r15d
movl (%r13,%rbx,4), %ecx
leal 0x1(%r15), %ebx
movl (%r13,%rbx,4), %r12d
cmpl %ecx, %r12d
je 0x1cf91
subl %ecx, %r12d
imulq $0x18, %rcx, %rbp
addq %r14, %rbp
cmpl %r15d, (%rbp)
jne 0x1cf6b
addq $0x18, %rbp
decq %r12
jne 0x1cf5a
jmp 0x1cf89
movq 0x27806e(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
leaq 0x21feb4(%rip), %rdi    # 0x23ce30
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
jmp 0x1cf60
movq 0x30(%rsp), %rax
movq (%rax), %rax
cmpq %rbx, %rax
ja 0x1cf3a
movl 0x8(%rsp), %eax
testl %eax, %eax
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
je 0x1d1c8
movl %eax, %eax
movq %rax, 0x38(%rsp)
pushq $-0x1
popq %rax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movl %eax, 0x20(%rsp)
movq %rcx, 0x40(%rsp)
imulq $0x18, %rcx, %rcx
movq 0x28(%rsp), %rdx
leaq (%rdx,%rcx), %r9
movl 0x8(%rdx,%rcx), %r12d
movl 0xc(%rdx,%rcx), %r13d
movl (%rdx,%rcx), %r10d
movl 0x4(%rdx,%rcx), %r11d
movl 0x10(%rdx,%rcx), %edx
cmpl %edx, %eax
movq %r9, 0x8(%rsp)
movl %r10d, 0x4(%rsp)
movl %r11d, (%rsp)
jne 0x1d00e
movzbl 0x14(%r9), %ecx
movl %eax, %edx
cmpl %ecx, 0x20(%rsp)
je 0x1d185
movzbl 0x14(%r9), %eax
movl %eax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rbp
movl %edx, 0x24(%rsp)
movl %edx, %eax
imulq $0x28, %rax, %rax
cmpl $0x0, 0x10(%rbp,%rax)
je 0x1d16c
addq %rax, %rbp
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpq %r14, %r12
jne 0x1d047
cmpl %ebx, %r10d
jne 0x1d0b3
movq 0x18(%rbp), %rax
cmpq %r14, %r13
jne 0x1d070
movq 0x20(%rdi), %rcx
movq (%rax,%r13,8), %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,8), %ecx
andl %r8d, %ecx
leal (%rbx,%rcx), %edx
decl %edx
cmpl %edx, %r11d
jne 0x1d0f2
movq (%rax,%r14,8), %r15
cmpq %r12, %r14
setb %al
cmpq %r13, %r14
seta %cl
orb %al, %cl
jne 0x1d0a0
movq 0x10(%rsi), %rax
movq %r15, %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %edx
movzbl 0x14(%r9), %ecx
cmpb %cl, %dl
jne 0x1d131
addl %r15d, %ebx
incq %r14
movl 0x10(%rbp), %eax
cmpq %rax, %r14
jb 0x1d03d
jmp 0x1d16c
movq 0x277f26(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
leaq 0x21fd7e(%rip), %rdi    # 0x23ce42
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movl (%rsp), %r11d
movl 0x4(%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
jmp 0x1d047
movq 0x277ee7(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x21fd48(%rip), %rsi    # 0x23ce4b
xorl %eax, %eax
callq 0x22b0
movl (%rsp), %r11d
movl 0x4(%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x18(%rbp), %rax
jmp 0x1d070
movq 0x277ea8(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x21fd20(%rip), %rsi    # 0x23ce62
xorl %eax, %eax
callq 0x22b0
movl (%rsp), %r11d
movl 0x4(%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
jmp 0x1d0a0
movq 0x40(%rsp), %rcx
incq %rcx
movl 0x24(%rsp), %eax
cmpq 0x38(%rsp), %rcx
jne 0x1cfc2
jmp 0x1d1c8
movq 0x277e54(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
leaq 0x21fca3(%rip), %rdi    # 0x23ce39
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movl (%rsp), %r11d
movl 0x4(%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x10(%r9), %edx
jmp 0x1d00e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq