// File: 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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
callq 0x2510
movsd %xmm0, -0x28(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq 0x262209(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x227dcf(%rip), %rsi    # 0x389bb0
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x162108
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jge 0x1620f5
movq -0x8(%rbp), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl -0x48(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0x48(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0xce1b0
movq %rax, -0x40(%rbp)
cmpq $-0x1, -0x40(%rbp)
jne 0x161ea7
movq 0x262155(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x44(%rbp), %edx
movl -0x48(%rbp), %ecx
leaq 0x227d1d(%rip), %rsi    # 0x389bb8
movb $0x0, %al
callq 0x22a0
jmp 0x1620e4
movq -0x8(%rbp), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
movq -0x8(%rbp), %rcx
movl -0x48(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
shrq $0x3f, %rcx
cmpl %ecx, %eax
je 0x161f09
movq 0x2620ee(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x44(%rbp), %edx
movl -0x48(%rbp), %ecx
leaq 0x227ccf(%rip), %rsi    # 0x389bd1
movb $0x0, %al
callq 0x22a0
movq -0x8(%rbp), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rdi
movq -0x50(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x50(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x58(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x58(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x1c(%rbp), %ecx
leaq 0x26286c(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl -0x20(%rbp), %r8d
leaq -0x80(%rbp), %r9
callq 0xd0300
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rdi
movq -0x50(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x50(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x58(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x58(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x1c(%rbp), %ecx
leaq 0x2627cf(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl -0x20(%rbp), %r8d
leaq -0x98(%rbp), %r9
callq 0xd0300
movl %eax, -0x68(%rbp)
movl $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movl $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
cmpl $0x0, -0x64(%rbp)
jge 0x162076
cmpl $0x0, -0x68(%rbp)
jge 0x162076
jmp 0x1620e4
movq -0x80(%rbp), %rax
shrq $0x20, %rax
movl -0x90(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0x1620ac
movq 0x261f4b(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x44(%rbp), %edx
movl -0x48(%rbp), %ecx
leaq 0x227b45(%rip), %rsi    # 0x389bea
movb $0x0, %al
callq 0x22a0
movq -0x98(%rbp), %rax
shrq $0x20, %rax
movl -0x78(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0x1620e2
movq 0x261f15(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x44(%rbp), %edx
movl -0x48(%rbp), %ecx
leaq 0x227b28(%rip), %rsi    # 0x389c03
movb $0x0, %al
callq 0x22a0
jmp 0x1620e4
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x161e06
jmp 0x1620f7
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x161df0
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)