// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movl %r8d, (%rsp)
movl %ecx, 0x4(%rsp)
movq %rdx, %rbx
movq %rsi, 0x20(%rsp)
movq %rdi, %r14
callq 0x2f3fc
movq 0x286174(%rip), %rax    # 0x294fe0
movq (%rax), %rcx
leaq 0x22a10f(%rip), %rdi    # 0x238f85
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movq %rbx, 0x28(%rsp)
testq %rbx, %rbx
jle 0xf22e
movq %r14, %rbx
xorl %eax, %eax
movq %r14, 0x38(%rsp)
movq %rax, 0x30(%rsp)
imulq $0x18, %rax, %r12
cmpl $0x0, 0xc(%rbx,%r12)
je 0xf21b
addq %rbx, %r12
xorl %edx, %edx
movq %r12, 0x18(%rsp)
movq (%r12), %rcx
movq %rdx, 0x40(%rsp)
imulq $0x28, %rdx, %r15
movq (%rcx,%r15), %rax
movq %rax, %r13
shrq $0x20, %r13
movl 0xc(%rcx,%r15), %r14d
imulq $0x18, %r14, %rbp
movl 0xc(%rbx,%rbp), %edi
leaq 0x22a0a9(%rip), %rsi    # 0x238f8d
testq %rdi, %rdi
je 0xf1b1
addq %rbx, %rbp
movq (%rbp), %rdx
imulq $0x28, %rdi, %rsi
xorl %r12d, %r12d
cmpl %r13d, 0xc(%rdx,%r12)
jne 0xef09
cmpl 0x4(%rdx,%r12), %r14d
je 0xef23
addq $0x28, %r12
cmpq %r12, %rsi
jne 0xeefb
leaq 0x22a074(%rip), %rsi    # 0x238f8d
movq 0x18(%rsp), %r12
jmp 0xf1b1
movq 0x18(%rdx,%r12), %rdx
xorq 0x18(%rcx,%r15), %rdx
movq %r14, %rdx
movq %r13, %rsi
js 0xf1e0
leaq (%rcx,%r15), %r8
imulq $0xc, %rsi, %rsi
imulq $0xc, %rdx, %rdi
movq 0x20(%rsp), %r10
movl 0x4(%r10,%rsi), %edx
movl (%r10,%rsi), %r9d
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
andl %r11d, %r9d
movl 0x4(%r10,%rdi), %esi
movl (%r10,%rdi), %edi
andl %r11d, %edi
subl %edi, %esi
leaq 0x2867e7(%rip), %rdi    # 0x295758
movss 0x158(%rdi), %xmm0
testb $-0x80, 0x1b(%rcx,%r15)
jne 0xef93
movl 0x10(%r8), %r15d
movl 0x14(%r8), %r10d
subl %r10d, %esi
movl %esi, %edi
movl %r15d, %esi
jmp 0xefa1
movl 0x10(%r8), %r15d
movl 0x14(%r8), %r10d
subl %r10d, %esi
movl %r15d, %edi
subl %r9d, %edx
cmpl %eax, %esi
movq %rax, 0x8(%rsp)
movl %eax, %ebx
cmovll %esi, %ebx
movl 0x8(%r8), %eax
movl %edx, %r11d
movl %eax, 0x14(%rsp)
subl %eax, %r11d
cmpl %edi, %r11d
movl %edi, %r9d
cmovll %r11d, %r9d
pushq $-0x1
popq %r8
movl %r8d, %ecx
cmpl 0x4(%rsp), %ebx
jg 0xf061
movl %r8d, %ecx
cmpl 0x4(%rsp), %r9d
jg 0xf061
movl 0x14(%rsp), %eax
subl 0x8(%rsp), %eax
cvtsi2ss %rax, %xmm1
addl %ebx, %eax
addl %r9d, %eax
cvtsi2ss %rax, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
movl %r8d, %ecx
ja 0xf061
subl %r15d, %r10d
cvtsi2ss %r10, %xmm1
addl %ebx, %r9d
addl %r10d, %r9d
cvtsi2ss %r9, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
movl %r8d, %ecx
ja 0xf061
cmpl %esi, 0x8(%rsp)
jg 0xf033
pushq $-0x2
popq %rcx
cmpl %edi, %r11d
jle 0xf061
cmpl %esi, 0x8(%rsp)
jl 0xf041
pushq $-0x3
popq %rcx
cmpl %edi, %r11d
jge 0xf061
pushq $-0x4
popq %rcx
cmpl (%rsp), %eax
jl 0xf061
cmpl (%rsp), %r9d
jl 0xf061
addl 0x14(%rsp), %edi
subl %edi, %edx
movq 0x8(%rsp), %rax
subl %esi, %eax
cmovlel %edx, %eax
movl %eax, %ecx
movl %ecx, 0x8(%rsp)
movq (%rbp), %rcx
movq (%rcx,%r12), %rax
movq %rax, %rdx
shrq $0x20, %rdx
imulq $0xc, %rdx, %rsi
movl 0xc(%rcx,%r12), %edx
imulq $0xc, %rdx, %rdi
movq 0x20(%rsp), %r9
movl 0x4(%r9,%rsi), %edx
movl (%r9,%rsi), %r8d
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
andl %r10d, %r8d
movl 0x4(%r9,%rdi), %esi
movl (%r9,%rdi), %edi
andl %r10d, %edi
subl %edi, %esi
testb $-0x80, 0x1b(%rcx,%r12)
jne 0xf0c1
movl 0x10(%rcx,%r12), %ebp
movl 0x14(%rcx,%r12), %r10d
subl %r10d, %esi
movl %esi, %edi
movl %ebp, %esi
jmp 0xf0d0
movl 0x10(%rcx,%r12), %ebp
movl 0x14(%rcx,%r12), %r10d
subl %r10d, %esi
movl %ebp, %edi
subl %r8d, %edx
cmpl %eax, %esi
movl %eax, %ebx
cmovll %esi, %ebx
movl 0x8(%rcx,%r12), %r8d
movl %edx, %r11d
subl %r8d, %r11d
cmpl %edi, %r11d
movl %edi, %r9d
cmovll %r11d, %r9d
pushq $-0x1
popq %r12
movl %r12d, %r15d
cmpl 0x4(%rsp), %ebx
jg 0xf17b
movl %r12d, %r15d
cmpl 0x4(%rsp), %r9d
jg 0xf17b
movl %r8d, %ecx
subl %eax, %ecx
cvtsi2ss %rcx, %xmm1
addl %ebx, %ecx
addl %r9d, %ecx
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
movl %r12d, %r15d
ja 0xf17b
subl %ebp, %r10d
cvtsi2ss %r10, %xmm1
addl %ebx, %r9d
addl %r10d, %r9d
cvtsi2ss %r9, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
movl %r12d, %r15d
ja 0xf17b
cmpl %esi, %eax
jg 0xf152
pushq $-0x2
popq %r15
cmpl %edi, %r11d
jle 0xf17b
cmpl %esi, %eax
jl 0xf15f
pushq $-0x3
popq %r15
cmpl %edi, %r11d
jge 0xf17b
pushq $-0x4
popq %r15
cmpl (%rsp), %ecx
jl 0xf17b
cmpl (%rsp), %r9d
jl 0xf17b
addl %r8d, %edi
subl %edi, %edx
subl %esi, %eax
cmovlel %edx, %eax
movl %eax, %r15d
testl %r15d, 0x8(%rsp)
movq 0x38(%rsp), %rbx
movq 0x18(%rsp), %r12
js 0xf1c8
movq 0x285e4d(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x229e22(%rip), %rsi    # 0x238fbf
movl %r13d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x22b0
leaq 0x229e27(%rip), %rsi    # 0x238fd8
movq 0x285e28(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movl %r13d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x22b0
movq 0x40(%rsp), %rdx
incq %rdx
movl 0xc(%r12), %eax
cmpq %rax, %rdx
jb 0xeeb8
jmp 0xf21b
movq 0x285df9(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x229db5(%rip), %rsi    # 0x238fa6
movl %r13d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x22b0
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq (%rcx,%r15), %rax
movl 0xc(%rcx,%r15), %edx
movq %rax, %rsi
shrq $0x20, %rsi
jmp 0xef39
movq 0x30(%rsp), %rax
incq %rax
cmpq 0x28(%rsp), %rax
jne 0xee99
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq