// File: /workspace/github_cpp_makefile_star2_O3/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, 0x68(%rsp)
cmpq $0x0, (%rdi)
je 0xdc2a7
movl $0x1, %r10d
xorl %r13d, %r13d
leaq 0x15b745(%rip), %r14    # 0x237744
leaq 0x15b743(%rip), %r15    # 0x237749
xorl %eax, %eax
movq %rdi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %r8, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %r9, 0x38(%rsp)
movq %r14, %r11
movq 0x10(%rdi), %rbp
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq (%rdx), %r14
movl 0x8(%rbp,%rax), %edi
movl 0x14(%rbp,%rax), %r12d
cmpq %r14, %r12
movl $0x2, %esi
sbbl %r13d, %esi
movq %rsi, 0x80(%rsp)
cmpq %r14, %r12
movl %r14d, %esi
cmovbl %r13d, %esi
movl %esi, 0x10(%rsp)
cmpq %r14, %rdi
movl $0x2, %esi
sbbl $0x0, %esi
movl %esi, 0x18(%rsp)
movq %rdi, %rsi
movl %r14d, %ebx
subq %r14, %rsi
cmovbl %r13d, %ebx
movl %ebx, 0x8(%rsp)
jae 0xdc08d
leaq (%rdi,%rdi,4), %r13
shlq $0x3, %r13
addq 0x10(%rdx), %r13
jmp 0xdc099
leaq (%rsi,%rsi,4), %r13
shlq $0x3, %r13
addq 0x10(%r8), %r13
addq %rax, %rbp
movq %r12, %rax
subq %r14, %rax
movq %rdi, 0x50(%rsp)
movl %r10d, 0x1c(%rsp)
jae 0xdc0cb
leaq (%r12,%r12,4), %rbx
shlq $0x3, %rbx
addq 0x10(%rdx), %rbx
movq %r11, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
jmp 0xdc0e6
leaq (%rax,%rax,4), %rbx
shlq $0x3, %rbx
addq 0x10(%r8), %rbx
movq %r15, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %r9, 0x20(%rsp)
movq 0x1b8ef3(%rip), %r15    # 0x294fe0
movq (%r15), %rcx
movl $0xd, %esi
movl $0x1, %edx
leaq 0x15c6e2(%rip), %rdi    # 0x2387e3
callq 0x2410
movq (%r15), %rdi
movq 0x50(%rsp), %rax
movl %eax, %r8d
subl 0x8(%rsp), %r8d
incl %r8d
movl (%r13), %r10d
movl %r10d, %eax
shrl $0x1f, %eax
leaq 0x158611(%rip), %rcx    # 0x23473b
movsbl (%rax,%rcx), %r9d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %r10d
movl (%rbp), %eax
movq %rax, 0x8(%rsp)
movl 0x4(%rbp), %eax
movq %rax, 0x78(%rsp)
movzbl 0x28(%rbp), %r11d
btl $0x6, %r11d
leaq 0x15617b(%rip), %rax    # 0x2322d3
adcq $0x0, %rax
movsbl (%rax), %eax
movq %rax, 0x70(%rsp)
subl 0x10(%rsp), %r12d
incl %r12d
movl (%rbx), %ebx
movl %ebx, %eax
shrl $0x1f, %eax
movsbl (%rax,%rcx), %eax
movq %rax, 0x10(%rsp)
andl %edx, %ebx
movl 0xc(%rbp), %r13d
movl 0x10(%rbp), %r15d
movsd 0x20(%rbp), %xmm0
andl $0x3f, %r11d
subq $0x8, %rsp
leaq 0x15b7a5(%rip), %rsi    # 0x23793f
leaq 0x15b7e0(%rip), %rdx    # 0x237981
movl 0x20(%rsp), %ecx
movb $0x1, %al
pushq %r11
pushq %r15
pushq %r13
pushq %rbx
pushq 0x38(%rsp)
pushq %r12
pushq 0xb8(%rsp)
pushq 0xb0(%rsp)
pushq 0xc0(%rsp)
pushq 0x58(%rsp)
pushq %r10
callq 0x22b0
addq $0x60, %rsp
movl 0x8(%rbp), %ecx
movq 0x58(%rsp), %r15
movq (%r15), %rax
cmpq %rcx, %rax
movl $0x0, %r13d
cmoval %r13d, %eax
subl %eax, %ecx
cmpq %r14, 0x50(%rsp)
movq 0x38(%rsp), %rsi
cmovbq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
cmovbq %r15, %rdx
movl (%rbp), %r8d
movl 0x4(%rbp), %r9d
leaq 0x15b52f(%rip), %r12    # 0x237749
movq %r12, %rax
leaq 0x15b520(%rip), %r14    # 0x237744
cmovbq %r14, %rax
movq 0x68(%rsp), %rbx
movq %rbx, %rdi
movl $0x3, %r10d
pushq %r10
pushq %rax
callq 0xdbde1
addq $0x10, %rsp
movl 0x14(%rbp), %ecx
movq (%r15), %rax
cmpq %rcx, %rax
cmoval %r13d, %eax
subl %eax, %ecx
movl 0xc(%rbp), %r8d
movl 0x10(%rbp), %r9d
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movl $0x3, %eax
pushq %rax
pushq 0x38(%rsp)
callq 0xdbde1
addq $0x10, %rsp
movl 0x1c(%rsp), %r10d
movl %r10d, %eax
incl %r10d
movq 0x60(%rsp), %rdi
cmpq %rax, (%rdi)
movq 0x38(%rsp), %r9
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %rcx
movq %r15, %rdx
movq %r12, %r15
ja 0xdc021
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq