// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: dbg_prt_utg_extra_trans(kv_u_trans_t*, ma_ug_t*, char const*)
void dbg_prt_utg_extra_trans(kv_u_trans_t *ta, ma_ug_t *ug, const char *o_n)
{
    char* gfa_name = (char*)malloc(strlen(o_n)+100); 
    FILE *fn = NULL; sprintf(gfa_name, "%s.tran.dbg.ovlp.log", o_n);
    u_trans_t *p = NULL; uint32_t i; fn = fopen(gfa_name, "w");
    double nw[2], ml, uml, sec, fw;
    for (i = 0; i < ta->n; i++) {
        p = &(ta->a[i]);
        if((p->f == RC_0) || (p->f == RC_1)) continue;

        sec = ((p->qe-p->qs)*asm_opt.trans_base_rate);
        if(sec < ((p->te-p->ts)*asm_opt.trans_base_rate)) {
            sec = ((p->te-p->ts)*asm_opt.trans_base_rate);
        }
        ml = p->qe - p->qs; uml = sec; ml -= uml;
        nw[0] = (ml*CHAIN_MATCH) - (uml*CHAIN_UNMATCH);
        ml = p->te - p->ts; uml = sec; ml -= uml;
        nw[1] = (ml*CHAIN_MATCH) - (uml*CHAIN_UNMATCH);
        fw = MIN(nw[0], nw[1]);
        if(fw <= p->nw) continue;

        fprintf(fn, "utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\tw(%f)\tf(%u)\n", 
        p->qn+1, "lc"[ug->u.a[p->qn].circ], ug->u.a[p->qn].len, p->qs, p->qe, "+-"[p->rev],
        p->tn+1, "lc"[ug->u.a[p->tn].circ], ug->u.a[p->tn].len, p->ts, p->te, p->nw, p->f);
    }
    fclose(fn); free(gfa_name); fprintf(stderr, "[M::%s::] done\n", __func__);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
movq %rdx, %rdi
callq 0x2090
leaq 0x64(%rax), %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x15fd6e(%rip), %rsi    # 0x1e8ba2
xorl %ebp, %ebp
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0x171857(%rip), %rsi    # 0x1fa6a1
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0x2210
movq %rax, (%rsp)
leaq 0x1ca8f6(%rip), %rdi    # 0x253758
movsd 0x15ee0e(%rip), %xmm4   # 0x1e7c78
movl %ebp, %ebp
cmpq %rbp, (%r14)
jbe 0x88fc2
movq 0x10(%r14), %rcx
imulq $0x30, %rbp, %rdx
movzbl 0x28(%rcx,%rdx), %eax
movl %eax, %r11d
andl $0x3f, %r11d
cmpb $0x2, %r11b
jb 0x88fbb
addq %rdx, %rcx
movl (%rcx), %r9d
movl 0x4(%rcx), %r10d
movl %r10d, %edx
subl %r9d, %edx
cvtsi2ss %rdx, %xmm0
movss 0x170(%rdi), %xmm1
mulss %xmm1, %xmm0
movl 0x10(%rcx), %r15d
movl 0xc(%rcx), %r12d
movl %r15d, %esi
subl %r12d, %esi
cvtsi2ss %rsi, %xmm2
mulss %xmm1, %xmm2
maxss %xmm0, %xmm2
cvtss2sd %xmm2, %xmm0
cvtsi2sd %rdx, %xmm1
subsd %xmm0, %xmm1
cvtsi2sd %rsi, %xmm2
subsd %xmm0, %xmm2
mulsd %xmm4, %xmm0
addsd %xmm0, %xmm1
addsd %xmm0, %xmm2
movapd %xmm1, %xmm3
cmplesd %xmm2, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm2, %xmm3
orpd %xmm1, %xmm3
movsd 0x20(%rcx), %xmm0
ucomisd %xmm3, %xmm0
jae 0x88fbb
movl 0x8(%rcx), %esi
movl 0x14(%rcx), %edi
leal 0x1(%rsi), %edx
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %r13
imulq $0x28, %rsi, %rcx
movl (%r13,%rcx), %r8d
movl %r8d, %ecx
shrl $0x1f, %ecx
leaq 0x15d74e(%rip), %rsi    # 0x1e668b
movsbl (%rcx,%rsi), %ecx
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
andl %ebx, %r8d
btl $0x6, %eax
leaq 0x15b2cf(%rip), %rax    # 0x1e4223
adcq $0x0, %rax
movsbl (%rax), %eax
movq %rax, 0x20(%rsp)
leal 0x1(%rdi), %eax
movq %rax, 0x18(%rsp)
imulq $0x28, %rdi, %rax
movl (%r13,%rax), %r13d
movl %r13d, %eax
shrl $0x1f, %eax
movsbl (%rax,%rsi), %ebx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r13d
movq (%rsp), %rdi
leaq 0x15fc29(%rip), %rsi    # 0x1e8bb7
movb $0x1, %al
pushq %r11
pushq %r15
pushq %r12
pushq %r13
pushq %rbx
pushq 0x40(%rsp)
pushq 0x50(%rsp)
pushq %r10
callq 0x22b0
movsd 0x15ecc8(%rip), %xmm4   # 0x1e7c78
leaq 0x1ca7a1(%rip), %rdi    # 0x253758
addq $0x40, %rsp
incl %ebp
jmp 0x88e6a
movq (%rsp), %rdi
callq 0x2190
movq 0x8(%rsp), %rdi
callq 0x2220
movq 0x1ca004(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0x15fc07(%rip), %rsi    # 0x1e8bed
leaq 0x15fc94(%rip), %rdx    # 0x1e8c81
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0