// File: /workspace/github_cpp_makefile_star2_O2/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, 0x28(%rsp)
movq %rdx, %r13
movl %esi, (%rsp)
movq %rdi, %rbx
movq 0x12ef5e(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xcac32(%rip), %rsi     # 0x1eecbe
leaq 0xcac49(%rip), %rdx     # 0x1eecdc
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x22b0
movq %rbx, 0x30(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0x8(%rsp)
movl %r14d, %r12d
movq 0x28(%rsp), %rax
cmpq %r12, (%rax)
jbe 0x124108
movl (%r13,%r12,4), %eax
leal 0x1(%r12), %r14d
movl (%r13,%r14,4), %ecx
subl %eax, %ecx
imulq $0x18, %rcx, %r15
imulq $0x18, %rax, %rbp
addq 0x8(%rsp), %rbp
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x1240ab
cmpl %r12d, (%rbp,%rbx)
jne 0x1240ea
addq $0x18, %rbx
jmp 0x1240d8
movq 0x12eeef(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0xcabf5(%rip), %rdi     # 0x1eecf0
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
jmp 0x1240e4
movl (%rsp), %eax
movq %rax, 0x38(%rsp)
pushq $-0x1
popq %rax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movl %eax, 0x20(%rsp)
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
cmpq 0x38(%rsp), %rcx
je 0x124322
movq %rcx, 0x40(%rsp)
imulq $0x18, %rcx, %rcx
movq 0x30(%rsp), %rdx
leaq (%rdx,%rcx), %r9
movl 0x8(%rdx,%rcx), %ebp
movl 0xc(%rdx,%rcx), %r12d
movl (%rdx,%rcx), %r10d
movl 0x4(%rdx,%rcx), %r11d
movl 0x10(%rdx,%rcx), %edx
cmpl %edx, %eax
movq %r9, 0x8(%rsp)
movl %r10d, (%rsp)
movl %r11d, 0x4(%rsp)
jne 0x12417f
movzbl 0x14(%r9), %ecx
movl %eax, %edx
cmpl %ecx, 0x20(%rsp)
je 0x1242df
movzbl 0x14(%r9), %eax
movl %eax, 0x20(%rsp)
movl %edx, 0x24(%rsp)
movl %edx, %eax
imulq $0x28, %rax, %r14
movq 0x28(%rsp), %rax
addq 0x10(%rax), %r14
xorl %ebx, %ebx
xorl %r13d, %r13d
movl 0x10(%r14), %eax
cmpq %rax, %rbx
jae 0x1242ce
cmpq %rbx, %rbp
jne 0x1241b7
cmpl %r13d, %r10d
jne 0x124215
movq 0x18(%r14), %rax
cmpq %rbx, %r12
jne 0x1241dd
movq 0x20(%rdi), %rcx
movq (%rax,%r12,8), %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,8), %ecx
andl %r8d, %ecx
leal (%rcx,%r13), %edx
decl %edx
cmpl %edx, %r11d
jne 0x124254
movq (%rax,%rbx,8), %r15
cmpq %rbp, %rbx
setb %al
cmpq %r12, %rbx
seta %cl
orb %al, %cl
jne 0x12420d
movq 0x10(%rsi), %rax
movq %r15, %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %edx
movzbl 0x14(%r9), %ecx
cmpb %cl, %dl
jne 0x124293
addl %r15d, %r13d
incq %rbx
jmp 0x1241a0
movq 0x12edc4(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0xcaadc(%rip), %rdi     # 0x1eed02
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movl 0x4(%rsp), %r11d
movl (%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
jmp 0x1241b7
movq 0x12ed85(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xcaaa6(%rip), %rsi     # 0x1eed0b
xorl %eax, %eax
callq 0x22b0
movl 0x4(%rsp), %r11d
movl (%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x18(%r14), %rax
jmp 0x1241dd
movq 0x12ed46(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xcaa7e(%rip), %rsi     # 0x1eed22
xorl %eax, %eax
callq 0x22b0
movl 0x4(%rsp), %r11d
movl (%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
jmp 0x12420d
movq 0x40(%rsp), %rcx
incq %rcx
movl 0x24(%rsp), %eax
jmp 0x124129
movq 0x12ecfa(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0xcaa09(%rip), %rdi     # 0x1eecf9
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movl 0x4(%rsp), %r11d
movl (%rsp), %r10d
movq 0x8(%rsp), %r9
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x10(%r9), %edx
jmp 0x12417f
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq