// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: print_ctg_trans_ovlp(kv_u_trans_t*, ma_ug_t*, ma_ug_t*, scaf_res_t*, ma_ug_t*, scaf_res_t*)
void print_ctg_trans_ovlp(kv_u_trans_t *os, ma_ug_t *ref, ma_ug_t *hu1, scaf_res_t *cp1, ma_ug_t *hu2, scaf_res_t *cp2)
{
    u_trans_t *p = NULL; uint32_t i, qui, tui, qid, tid; ma_utg_t *uq, *ut; 
    for (i = 0; i < os->n; i++) {
        p = &(os->a[i]); 
        qui = p->qn<hu1->u.n?1:2; qid = ((p->qn<hu1->u.n)?p->qn:p->qn-hu1->u.n);
        tui = p->tn<hu1->u.n?1:2; tid = ((p->tn<hu1->u.n)?p->tn:p->tn-hu1->u.n);
        uq = ((p->qn<hu1->u.n)?&(hu1->u.a[p->qn]):&(hu2->u.a[p->qn-hu1->u.n]));
        ut = ((p->tn<hu1->u.n)?&(hu1->u.a[p->tn]):&(hu2->u.a[p->tn-hu1->u.n]));
        fprintf(stderr, "************\n");
        fprintf(stderr, "[M::%s] h%utg%.6u%c\t%u\t%u\t%u\t%c\th%utg%.6u%c\t%u\t%u\t%u\tw(%f)\tf(%u)\n", __func__,
        qui, qid+1, "lc"[uq->circ], uq->len, p->qs, p->qe, "+-"[p->rev],
        tui, tid+1, "lc"[ut->circ], ut->len, p->ts, p->te, p->nw, p->f);

        prt_scaf_res_t(ref, qui==1?cp1:cp2, qui==1?hu1:hu2, (p->qn<hu1->u.n)?p->qn:p->qn-hu1->u.n, p->qs, p->qe, qui==1?"h1tg":"h2tg", 3);
        prt_scaf_res_t(ref, tui==1?cp1:cp2, tui==1?hu1:hu2, (p->tn<hu1->u.n)?p->tn:p->tn-hu1->u.n, p->ts, p->te, tui==1?"h1tg":"h2tg", 3);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0x58(%rsp)
xorl %r15d, %r15d
leaq 0x14acfd(%rip), %r12    # 0x1e9644
xorl %ebx, %ebx
movq %rdi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r9, 0x30(%rsp)
movl %ebx, %ebx
cmpq %rbx, (%rdi)
jbe 0x9ebd4
movq %r12, %r10
movq 0x10(%rdi), %rbp
imulq $0x30, %rbx, %rax
movq (%rdx), %r14
movl 0x8(%rbp,%rax), %r13d
movl 0x14(%rbp,%rax), %r12d
cmpq %r14, %r12
pushq $0x2
popq %r11
movl %r11d, %esi
sbbl %r15d, %esi
movq %rsi, 0x78(%rsp)
cmpq %r14, %r12
movl %r14d, %esi
cmovbl %r15d, %esi
movl %esi, 0x8(%rsp)
cmpq %r14, %r13
sbbl $0x0, %r11d
movl %r11d, 0x14(%rsp)
movq %r13, %rsi
movl %r14d, %r11d
subq %r14, %rsi
cmovbl %r15d, %r11d
movl %r11d, (%rsp)
jae 0x9e9ce
imulq $0x28, %r13, %r15
addq 0x10(%rdx), %r15
jmp 0x9e9d6
imulq $0x28, %rsi, %r15
addq 0x10(%r8), %r15
addq %rax, %rbp
movq %r12, %rax
movq %r14, 0x80(%rsp)
subq %r14, %rax
jae 0x9ea02
imulq $0x28, %r12, %r14
addq 0x10(%rdx), %r14
movq %r10, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
jmp 0x9ea20
imulq $0x28, %rax, %r14
addq 0x10(%r8), %r14
leaq 0x14ac38(%rip), %rax    # 0x1e9649
movq %rax, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movq 0x1b45b9(%rip), %rax    # 0x252fe0
movq (%rax), %rcx
leaq 0x14bcb2(%rip), %rdi    # 0x1ea6e3
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
callq 0x2410
movq 0x1b459d(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movq %r13, 0x70(%rsp)
movl %r13d, %r8d
subl (%rsp), %r8d
incl %r8d
movl (%r15), %r10d
movl %r10d, %eax
shrl $0x1f, %eax
leaq 0x147c26(%rip), %rcx    # 0x1e668b
movsbl (%rax,%rcx), %r9d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %r10d
movl (%rbp), %eax
movq %rax, (%rsp)
movl 0x4(%rbp), %eax
movq %rax, 0x68(%rsp)
movzbl 0x28(%rbp), %r11d
btl $0x6, %r11d
leaq 0x145791(%rip), %rax    # 0x1e4223
adcq $0x0, %rax
movsbl (%rax), %eax
movq %rax, 0x60(%rsp)
subl 0x8(%rsp), %r12d
incl %r12d
movl (%r14), %r14d
movl %r14d, %eax
shrl $0x1f, %eax
movsbl (%rax,%rcx), %eax
movq %rax, 0x8(%rsp)
andl %edx, %r14d
movl 0xc(%rbp), %r15d
movl 0x10(%rbp), %r13d
movsd 0x20(%rbp), %xmm0
andl $0x3f, %r11d
subq $0x8, %rsp
leaq 0x14ad68(%rip), %rsi    # 0x1e983f
leaq 0x14ada3(%rip), %rdx    # 0x1e9881
movl 0x1c(%rsp), %ecx
movb $0x1, %al
pushq %r11
pushq %r13
pushq %r15
pushq %r14
pushq 0x30(%rsp)
pushq %r12
pushq 0xb0(%rsp)
pushq 0xa0(%rsp)
pushq 0xb0(%rsp)
pushq 0x50(%rsp)
pushq %r10
callq 0x22b0
addq $0x60, %rsp
movl 0x8(%rbp), %ecx
movq 0x48(%rsp), %r13
movq (%r13), %rax
cmpq %rcx, %rax
movl $0x0, %r15d
cmoval %r15d, %eax
subl %eax, %ecx
movq 0x70(%rsp), %rax
cmpq 0x80(%rsp), %rax
movq 0x30(%rsp), %rsi
cmovbq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
cmovbq %r13, %rdx
movl (%rbp), %r8d
movl 0x4(%rbp), %r9d
leaq 0x14aae8(%rip), %rax    # 0x1e9649
leaq 0x14aadc(%rip), %r12    # 0x1e9644
cmovbq %r12, %rax
movq 0x58(%rsp), %r14
movq %r14, %rdi
pushq $0x3
popq %r10
pushq %r10
pushq %rax
callq 0x9e6bb
popq %rax
popq %rcx
movl 0x14(%rbp), %ecx
movq (%r13), %rax
cmpq %rcx, %rax
cmoval %r15d, %eax
subl %eax, %ecx
movl 0xc(%rbp), %r8d
movl 0x10(%rbp), %r9d
movq %r14, %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
pushq $0x3
popq %rax
pushq %rax
pushq 0x30(%rsp)
callq 0x9e6bb
popq %rax
popq %rcx
incl %ebx
movq 0x30(%rsp), %r9
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %rcx
movq %r13, %rdx
movq 0x50(%rsp), %rdi
jmp 0x9e962
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq