// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: debug_ma_hit_t(ma_hit_t_alloc*, ma_sub_t*, long long, int, int)
void debug_ma_hit_t(ma_hit_t_alloc* sources, ma_sub_t *coverage_cut, long long num_sources,
int max_hang, int min_ovlp)
{
    double startTime = Get_T();

    long long i, j, index;
    uint32_t qn, tn;
    ma_sub_t *sq = NULL;
    ma_sub_t *st = NULL;
    ma_hit_t *h = NULL;
    int32_t r_0, r_1;
    asg_arc_t t_0, t_1;
    fprintf(stderr, "start!\n");

    for (i = 0; i < num_sources; i++)
    {

        for (j = 0; j < sources[i].length; j++)
        {
            qn = Get_qn(sources[i].buffer[j]);
            tn = Get_tn(sources[i].buffer[j]);


            ///if(sources[i].buffer[j].del) continue;

            index = get_specific_overlap(&(sources[tn]), tn, qn);
            if(index == -1)
            {
                fprintf(stderr, "ERROR 0: qn: %u, tn: %u\n", qn, tn);
                continue;
            } 



            if(sources[i].buffer[j].del != sources[tn].buffer[index].del)
            {
                fprintf(stderr, "ERROR 2: qn: %u, tn: %u\n", qn, tn);
            }

            h = &(sources[i].buffer[j]);
            sq = &(coverage_cut[Get_qn(*h)]);
            st = &(coverage_cut[Get_tn(*h)]);
            r_0 = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                asm_opt.max_hang_rate, min_ovlp, &t_0);


            h = &(sources[tn].buffer[index]);
            sq = &(coverage_cut[Get_qn(*h)]);
            st = &(coverage_cut[Get_tn(*h)]);
            r_1 = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                asm_opt.max_hang_rate, min_ovlp, &t_1);
            t_0.ul=t_0.v=t_1.ul=t_1.v = 0;
            if(r_0 < 0 && r_1 < 0) continue;
            if((t_0.ul>>32) != (t_1.v^1)) fprintf(stderr, "ERROR 3: qn: %u, tn: %u\n", qn, tn);
            if((t_1.ul>>32) != (t_0.v^1)) fprintf(stderr, "ERROR 4: qn: %u, tn: %u\n", qn, tn);
        }
    }

    if(VERBOSE >= 1)
    {
        fprintf(stderr, "[M::%s] takes %0.2fs\n\n", __func__, Get_T()-startTime);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r8d, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movq %rdx, %rbx
movq %rsi, 0x28(%rsp)
movq %rdi, (%rsp)
callq 0x300fc
movq 0x27b213(%rip), %rax    # 0x289fe0
movq (%rax), %rcx
leaq 0x21dfbe(%rip), %rdi    # 0x22cd95
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movq %rbx, 0x18(%rsp)
testq %rbx, %rbx
jle 0xf000
xorl %eax, %eax
movq %rax, 0x20(%rsp)
imulq $0x18, %rax, %r15
movq (%rsp), %rax
cmpl $0x0, 0xc(%rax,%r15)
je 0xefed
addq (%rsp), %r15
xorl %r12d, %r12d
movq %r15, 0x30(%rsp)
movq (%r15), %rax
imulq $0x28, %r12, %rbx
movl 0x4(%rax,%rbx), %r13d
movl 0xc(%rax,%rbx), %r14d
imulq $0x18, %r14, %rcx
movq (%rsp), %rdx
leaq (%rdx,%rcx), %rdi
movl 0xc(%rdx,%rcx), %edx
pushq $-0x1
popq %rcx
testq %rdx, %rdx
je 0xee60
movq (%rdi), %rsi
xorl %ecx, %ecx
cmpl %r13d, 0xc(%rsi)
jne 0xee51
cmpl 0x4(%rsi), %r14d
je 0xee60
incq %rcx
addq $0x28, %rsi
cmpq %rcx, %rdx
jne 0xee45
pushq $-0x1
popq %rcx
leaq 0x21df36(%rip), %rsi    # 0x22cd9d
cmpq $-0x1, %rcx
je 0xefd4
movq %r12, 0x40(%rsp)
movq (%rdi), %rdx
imulq $0x28, %rcx, %rbp
movq 0x18(%rdx,%rbp), %rcx
xorq 0x18(%rax,%rbx), %rcx
movq %rdi, 0x38(%rsp)
js 0xef8c
movq (%r15), %rax
leaq (%rax,%rbx), %rdi
movl 0x4(%rax,%rbx), %ecx
movl 0xc(%rax,%rbx), %eax
imulq $0xc, %rcx, %rcx
imulq $0xc, %rax, %rax
movq 0x28(%rsp), %r12
movl 0x4(%r12,%rcx), %esi
movl (%r12,%rcx), %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %ecx
subl %ecx, %esi
movl 0x4(%r12,%rax), %edx
movl (%r12,%rax), %eax
andl %r8d, %eax
subl %eax, %edx
leaq 0x27b881(%rip), %rax    # 0x28a758
movss 0x158(%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movl 0x8(%rsp), %ebx
movl %ebx, %ecx
movl 0xc(%rsp), %r15d
movl %r15d, %r8d
leaq 0x60(%rsp), %r9
callq 0xa159b
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
leaq (%rax,%rbp), %rdi
movl 0x4(%rax,%rbp), %ecx
movl 0xc(%rax,%rbp), %eax
imulq $0xc, %rcx, %rcx
imulq $0xc, %rax, %rax
movl 0x4(%r12,%rcx), %esi
movl (%r12,%rcx), %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %ecx
subl %ecx, %esi
movl 0x4(%r12,%rax), %edx
movl (%r12,%rax), %eax
andl %r8d, %eax
subl %eax, %edx
movl %ebx, %ecx
movss 0x10(%rsp), %xmm0
movl %r15d, %r8d
movq 0x30(%rsp), %r15
leaq 0x48(%rsp), %r9
callq 0xa159b
andl $0x0, 0x50(%rsp)
andq $0x0, 0x48(%rsp)
andl $0x0, 0x68(%rsp)
andq $0x0, 0x60(%rsp)
testl %eax, 0x14(%rsp)
movq 0x40(%rsp), %r12
jns 0xefaf
incq %r12
movl 0xc(%r15), %eax
cmpq %rax, %r12
jb 0xee17
jmp 0xefed
movq 0x27b04d(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x21de19(%rip), %rsi    # 0x22cdb6
movl %r13d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x22b0
jmp 0xee92
movq 0x27b02a(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x21de0f(%rip), %rsi    # 0x22cdcf
movl %r13d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x22b0
leaq 0x21de14(%rip), %rsi    # 0x22cde8
movq 0x27b005(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
movl %r13d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x22b0
jmp 0xef7a
movq 0x20(%rsp), %rax
incq %rax
cmpq 0x18(%rsp), %rax
jne 0xedf2
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq