// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: prt_scf_dbg_nds(u_trans_t*, unsigned int*, unsigned int*, unsigned int, ma_ug_t*, ma_ug_t*, ma_ug_t*, unsigned long, unsigned long, char const*)
void prt_scf_dbg_nds(u_trans_t *z, uint32_t *za, uint32_t *zd, uint32_t zn, ma_ug_t *ref, ma_ug_t *hu1, ma_ug_t *hu2, uint64_t s_end, uint64_t e_end, const char *cmd)
{
    uint64_t k, id, rev, ui, uid; ma_utg_t *u;

    id = z->tn; rev = z->rev;
    u = ((id<hu1->u.n)?&(hu1->u.a[id]):&(hu2->u.a[id-hu1->u.n]));
    ui = ((id<hu1->u.n)?1:2); uid = ((id<hu1->u.n)?(id):(id-hu1->u.n));

    fprintf(stderr, "\nCMD::%s[M::%s] h%lutg%.6lu%c(%c)\ts::%u\te::%u\ts_end::%lu\te_end::%lu\tref_n::%u\n", cmd, __func__,
    ui, uid+1, "lc"[u->circ], "+-"[rev], z->ts, z->te, s_end, e_end, (uint32_t)ref->u.n);
    for (k = 0; k < zn; k++) {
        fprintf(stderr, "[%u|%u]", (za[k]>>1), (za[k]&1));
        fprintf(stderr, "utg%.6u%c(%c)(d::%u),", (za[k]>>1)+1, "lc"[ref->u.a[(za[k]>>1)].circ], "+-"[za[k]&1], zd[k]);
    }
    fprintf(stderr, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x28(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movl %ecx, -0x3c(%rbp)
movq %r8, -0x48(%rbp)
movq %r9, -0x50(%rbp)
movq -0x28(%rbp), %rax
movl 0x14(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movb 0x28(%rax), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12c9ed
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x60(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x12ca0e
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movq -0x50(%rbp), %rdx
subq (%rdx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rdx
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movl $0x2, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovbl %ecx, %eax
cltq
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12ca54
movq -0x60(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x12ca66
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x297568(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq 0x28(%rbp), %rdx
movq -0x70(%rbp), %r8
movq -0x78(%rbp), %r9
addq $0x1, %r9
movq -0x80(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x258864(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %r12d
movq -0x68(%rbp), %rcx
leaq 0x2563ec(%rip), %rax    # 0x382e9b
movsbl (%rax,%rcx), %r15d
movq -0x28(%rbp), %rax
movl 0xc(%rax), %r14d
movq -0x28(%rbp), %rax
movl 0x10(%rax), %ebx
movq 0x18(%rbp), %r11
movq 0x20(%rbp), %r10
movq -0x48(%rbp), %rax
movq (%rax), %rax
leaq 0x25bb88(%rip), %rsi    # 0x388661
leaq 0x25bbd0(%rip), %rcx    # 0x3886b0
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x12cbe7
movq 0x2974ba(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %edx
shrl %edx
movq -0x30(%rbp), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
andl $0x1, %ecx
leaq 0x25bb75(%rip), %rsi    # 0x3886c0
movb $0x0, %al
callq 0x22a0
movq 0x297487(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %edx
shrl %edx
addl $0x1, %edx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq -0x58(%rbp), %rsi
movl (%rcx,%rsi,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x258769(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %ecx
movq -0x30(%rbp), %rax
movq -0x58(%rbp), %rsi
movl (%rax,%rsi,4), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x2562e4(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r8d
movq -0x38(%rbp), %rax
movq -0x58(%rbp), %rsi
movl (%rax,%rsi,4), %r9d
leaq 0x25baf9(%rip), %rsi    # 0x3886c8
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x12cb0f
movq 0x2973f2(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x259e30(%rip), %rsi    # 0x386a28
movb $0x0, %al
callq 0x22a0
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop