// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: prt_scaf_res_t(ma_ug_t*, scaf_res_t*, ma_ug_t*, unsigned int, unsigned int, unsigned int, char const*, unsigned int)
void prt_scaf_res_t(ma_ug_t *ref, scaf_res_t *cp, ma_ug_t *ug, uint32_t uid, uint32_t s, uint32_t e, const char *pfx, uint32_t bw)
{
    uint32_t in, rs, re, rn, z; uc_block_t *ra;

    in = 0;
    while (get_scaf_res_t(cp, uid, s, e, &in, &rs, &re, &rn, &ra)) {
        fprintf(stderr, "%s%.6u%c\t%u\t%u\t%u\tn(%u)\n", pfx, uid+1, "lc"[ug->u.a[uid].circ], ug->u.a[uid].len, rs, re, rn);
        if(rn <= (bw<<1)) {
            for (z = 0; z < rn; z++) fprintf(stderr, "utg%.6u%c,", (ra[z].hid)+1, "lc"[ref->u.a[ra[z].hid].circ]);
        } else {
            for (z = 0; z < bw; z++) fprintf(stderr, "utg%.6u%c,", (ra[z].hid)+1, "lc"[ref->u.a[ra[z].hid].circ]);
            fprintf(stderr, "......,");
            for (z = rn-bw; z < rn; z++) fprintf(stderr, "utg%.6u%c,", (ra[z].hid)+1, "lc"[ref->u.a[ra[z].hid].circ]);
        }
        fprintf(stderr, "\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq -0x28(%rbp), %r8
leaq -0x2c(%rbp), %r9
leaq -0x30(%rbp), %r11
leaq -0x34(%rbp), %r10
leaq -0x40(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x128010
cmpl $0x0, %eax
je 0x128529
movq 0x29bcdf(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq 0x10(%rbp), %rdx
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %esi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x25cfd3(%rip), %rax    # 0x385303
movsbl (%rax,%rsi), %r8d
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %esi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movl -0x2c(%rbp), %r11d
movl -0x30(%rbp), %r10d
movl -0x34(%rbp), %eax
leaq 0x2601a6(%rip), %rsi    # 0x388509
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x22a0
movl -0x34(%rbp), %eax
movl 0x18(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
ja 0x128400
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x1283fb
movq 0x29bc47(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movl -0x38(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rcx
movl (%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x25cf25(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %ecx
leaq 0x260103(%rip), %rsi    # 0x3884ec
movb $0x0, %al
callq 0x22a0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x12838a
jmp 0x12850c
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl 0x18(%rbp), %eax
jae 0x128478
movq 0x29bbca(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movl -0x38(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rcx
movl (%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x25cea8(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %ecx
leaq 0x260086(%rip), %rsi    # 0x3884ec
movb $0x0, %al
callq 0x22a0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x128407
movq 0x29bb61(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x260099(%rip), %rsi    # 0x388522
movb $0x0, %al
callq 0x22a0
movl -0x34(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x12850a
movq 0x29bb38(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
addl $0x1, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movl -0x38(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rcx
movl (%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x25ce16(%rip), %rax    # 0x385303
movsbl (%rax,%rcx), %ecx
leaq 0x25fff4(%rip), %rsi    # 0x3884ec
movb $0x0, %al
callq 0x22a0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x128499
jmp 0x12850c
movq 0x29bacd(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x25e50b(%rip), %rsi    # 0x386a28
movb $0x0, %al
callq 0x22a0
jmp 0x1282bd
addq $0x60, %rsp
popq %rbp
retq
nop