// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: print_debug_scaffold_nodes(ug_opt_t*, usc_t*, unsigned int, asg_t*)
void print_debug_scaffold_nodes(ug_opt_t *uopt, usc_t *a, uint32_t a_n, asg_t *ng)
{
    uint32_t i, k, z, qn, tn, rl, hrl; usc_t *psa = NULL; ma_hit_t_alloc *s = NULL;
    UC_Read r0, r1; init_UC_Read(&r0); init_UC_Read(&r1);
    fprintf(stderr, "[M::%s] a_n::%u\n", __func__, a_n);
    for (i = 0; i < a_n; i++) {
        psa = &(a[i]);
        s = &(uopt->sources[psa->nid]);
        fprintf(stderr, "[M::%s::%u]%.*s(id::%u)\tlen::%lu\tulid::%u\trev::%u\tdel::%u\n", 
        __func__, i, (int32_t)Get_NAME_LENGTH(R_INF, psa->nid), 
        Get_NAME(R_INF, psa->nid), psa->nid, Get_READ_LENGTH(R_INF, psa->nid), psa->ulid>>1, psa->ulid&1, 
        ng->seq[psa->nid].del);

        recover_UC_Read(&r0, &R_INF, psa->nid);
        fprintf(stderr, "%.*s\n", (int32_t)Get_READ_LENGTH(R_INF, psa->nid), r0.seq);

        for (k = 0; k < s->length; k++) {
            qn = Get_qn(s->buffer[k]); tn = Get_tn(s->buffer[k]); assert(qn == psa->nid);
            fprintf(stderr, "q::[%u, %u)\t%c\tt::[%u, %u)\t%.*s(id::%u)\tlen::%lu\n", 
            Get_qs(s->buffer[k]), Get_qe(s->buffer[k]), "+-"[s->buffer[k].rev], 
            Get_ts(s->buffer[k]), Get_te(s->buffer[k]),
            (int32_t)Get_NAME_LENGTH(R_INF, tn), Get_NAME(R_INF, tn), tn, Get_READ_LENGTH(R_INF, tn));
            if(psa->raw_eof >= psa->raw_sof) {
                resize_UC_Read(&r0, Get_qe(s->buffer[k])-Get_qs(s->buffer[k]));
                recover_UC_Read_sub_region(r0.seq, Get_qs(s->buffer[k]), Get_qe(s->buffer[k])-Get_qs(s->buffer[k]), 0, &R_INF, qn);
                
                resize_UC_Read(&r1, Get_te(s->buffer[k])-Get_ts(s->buffer[k]));
                recover_UC_Read_sub_region(r1.seq, Get_ts(s->buffer[k]), Get_te(s->buffer[k])-Get_ts(s->buffer[k]), 0, &R_INF, tn);
                
                assert(Get_te(s->buffer[k])-Get_ts(s->buffer[k]) == Get_qe(s->buffer[k])-Get_qs(s->buffer[k]));
                rl = Get_te(s->buffer[k])-Get_ts(s->buffer[k]);
                if(s->buffer[k].rev) {
                    char t; hrl = rl>>1;
                    for (z = 0; z < hrl; z++) {
                        t = r1.seq[rl-z-1];
                        r1.seq[rl-z-1] = RC_CHAR(r1.seq[z]);
                        r1.seq[z] = RC_CHAR(t);
                    }
                    if(rl&1) r1.seq[z] = RC_CHAR(r1.seq[z]);
                }
                assert(memcmp(r0.seq, r1.seq, rl) == 0);
            }
        }
    }
    destory_UC_Read(&r0); destory_UC_Read(&r1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x68(%rsp)
movl %edx, %ebx
movq %rsi, (%rsp)
movq %rdi, 0x60(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x32e2d
leaq 0x18(%rsp), %rdi
callq 0x32e2d
movq 0x269103(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
leaq 0x21dd01(%rip), %rsi    # 0x249be8
leaq 0x21dd0b(%rip), %rdx    # 0x249bf9
movl %ebx, %ecx
xorl %eax, %eax
callq 0x22b0
testl %ebx, %ebx
je 0x2c26a
movl %ebx, %eax
movq %rax, 0x58(%rsp)
xorl %ebx, %ebx
imulq $0x18, %rbx, %r14
movq 0x60(%rsp), %rax
movq 0x8(%rax), %r11
movq (%rsp), %rax
movl (%rax,%r14), %r10d
movl 0x4(%rax,%r14), %r15d
imulq $0x18, %r10, %rax
movq %rax, 0x10(%rsp)
movq 0x2690ae(%rip), %rbp    # 0x294fe0
movq (%rbp), %rdi
leaq 0x26a2f3(%rip), %rbp    # 0x296230
movq 0x18(%rbp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rbp), %rax
leal 0x1(%r10), %ecx
movl (%rax,%rcx,8), %r8d
movq (%rax,%r10,8), %r9
subl %r9d, %r8d
addq 0x8(%rbp), %r9
movl %r15d, %r12d
shrl %r12d
andl $0x1, %r15d
movq 0x68(%rsp), %rax
movq 0x20(%rax), %rax
movl (%rax,%r10,8), %r13d
shrl $0x1f, %r13d
subq $0x8, %rsp
leaq 0x21dc91(%rip), %rsi    # 0x249c14
leaq 0x21dc6f(%rip), %rdx    # 0x249bf9
movq %rbx, 0x78(%rsp)
movl %ebx, %ecx
xorl %eax, %eax
pushq %r13
movq %r11, %r13
pushq %r15
pushq %r12
movq 0x28(%rsp), %r11
pushq (%r11,%r10,8)
pushq %r10
callq 0x22b0
addq $0x30, %rsp
movq (%rsp), %rbx
movl (%rbx,%r14), %edx
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x333e0
movq 0x269014(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movq 0x18(%rbp), %rax
movl (%rbx,%r14), %ecx
movq %r14, %rbp
movl (%rax,%rcx,8), %edx
movq 0x38(%rsp), %rcx
leaq 0x21a1b1(%rip), %rsi    # 0x24619a
xorl %eax, %eax
callq 0x22b0
movq 0x10(%rsp), %rax
cmpl $0x0, 0xc(%r13,%rax)
je 0x2c257
addq (%rsp), %rbp
addq %rax, %r13
xorl %ecx, %ecx
movq %r13, 0x78(%rsp)
movq (%r13), %rax
movl %ecx, %ecx
movq %rcx, 0x10(%rsp)
imulq $0x28, %rcx, %r12
movq (%rax,%r12), %rdx
movq %rdx, %rbx
shrq $0x20, %rbx
cmpl %ebx, (%rbp)
jne 0x2c290
addq %r12, %rax
movl 0x8(%rax), %ecx
movl 0xc(%rax), %r10d
movq 0x268f9d(%rip), %rsi    # 0x294fe0
movq (%rsi), %rdi
movl 0x18(%rax), %esi
shrl $0x1f, %esi
leaq 0x206280(%rip), %r8     # 0x2322d3
movsbl (%rsi,%r8), %r8d
movl 0x10(%rax), %r9d
movl 0x14(%rax), %eax
movq %rax, 0x8(%rsp)
leaq 0x26a1c5(%rip), %r13    # 0x296230
movq 0x18(%r13), %r11
movq 0x40(%r13), %rax
leal 0x1(%r10), %esi
movl (%rax,%rsi,8), %r15d
movq (%rax,%r10,8), %r14
subl %r14d, %r15d
addq 0x8(%r13), %r14
subq $0x8, %rsp
leaq 0x21dc15(%rip), %rsi    # 0x249ca6
xorl %eax, %eax
pushq (%r11,%r10,8)
movq %r10, 0x90(%rsp)
pushq %r10
pushq %r14
pushq %r15
pushq 0x30(%rsp)
callq 0x22b0
addq $0x30, %rsp
movl 0x14(%rbp), %eax
cmpl 0x10(%rbp), %eax
movq 0x78(%rsp), %r13
jb 0x2c246
movq (%r13), %rax
movl 0x8(%rax,%r12), %r15d
movq (%rax,%r12), %rax
subl %eax, %r15d
movq 0x38(%rsp), %rdi
cmpq %r15, 0x48(%rsp)
jge 0x2c108
movq %r15, %rsi
callq 0x2370
movq %rax, %rdi
movq %rax, 0x38(%rsp)
movq %r15, 0x48(%rsp)
movq (%r13), %rax
movq (%rax,%r12), %rcx
movl %ecx, %esi
movl 0x8(%rax,%r12), %r15d
subl %ecx, %r15d
jmp 0x2c10a
movl %eax, %esi
movq %r15, %rdx
xorl %ecx, %ecx
leaq 0x26a11a(%rip), %r8     # 0x296230
movq %rbx, %r9
callq 0x32ef8
movq (%r13), %rcx
movl 0x10(%rcx,%r12), %eax
movl 0x14(%rcx,%r12), %ebx
subl %eax, %ebx
movq 0x18(%rsp), %rdi
cmpq %rbx, 0x28(%rsp)
jge 0x2c15f
movq %rbx, %rsi
callq 0x2370
movq %rax, %rdi
movq %rax, 0x18(%rsp)
movq %rbx, 0x28(%rsp)
movq (%r13), %rcx
movl 0x10(%rcx,%r12), %eax
movl 0x14(%rcx,%r12), %ebx
subl %eax, %ebx
movl %eax, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
leaq 0x26a0c3(%rip), %r8     # 0x296230
movq 0x80(%rsp), %r9
callq 0x32ef8
movq (%r13), %rdx
movl 0x14(%rdx,%r12), %esi
movl 0x8(%rdx,%r12), %edi
movl 0x10(%rdx,%r12), %ecx
movl %esi, %eax
subl %ecx, %eax
subl (%rdx,%r12), %edi
cmpl %edi, %eax
jne 0x2c2af
addq %r12, %rdx
testb $-0x80, 0x1b(%rdx)
je 0x2c22d
cmpl $0x2, %eax
jae 0x2c1b3
xorl %edx, %edx
jmp 0x2c206
movl %eax, %edx
shrl %edx
notl %ecx
addl %esi, %ecx
xorl %esi, %esi
leaq 0x26946c(%rip), %r11    # 0x295630
leaq 0x26956a(%rip), %rbx    # 0x295735
movq 0x18(%rsp), %rdi
movl %ecx, %r8d
movzbl (%rdi,%r8), %r9d
movzbl (%rdi,%rsi), %r10d
movzbl (%r11,%r10), %r10d
movb (%rbx,%r10), %r10b
movb %r10b, (%rdi,%r8)
movzbl (%r11,%r9), %edi
movb (%rbx,%rdi), %dil
movq 0x18(%rsp), %r8
movb %dil, (%r8,%rsi)
incq %rsi
decl %ecx
cmpq %rsi, %rdx
jne 0x2c1cb
testb $0x1, %al
je 0x2c22d
movq 0x18(%rsp), %rcx
movzbl (%rcx,%rdx), %esi
leaq 0x269416(%rip), %rdi    # 0x295630
movzbl (%rdi,%rsi), %esi
leaq 0x269510(%rip), %rdi    # 0x295735
movb (%rdi,%rsi), %sil
movb %sil, (%rcx,%rdx)
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %eax, %edx
callq 0x21a0
testl %eax, %eax
jne 0x2c2ce
movq 0x10(%rsp), %rcx
incl %ecx
cmpl 0xc(%r13), %ecx
jb 0x2c00f
movq 0x70(%rsp), %rbx
incq %rbx
cmpq 0x58(%rsp), %rbx
jne 0x2bf08
leaq 0x38(%rsp), %rdi
callq 0x32d68
leaq 0x18(%rsp), %rdi
callq 0x32d68
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21d9b8(%rip), %rdi    # 0x249c4f
leaq 0x21936b(%rip), %rsi    # 0x245609
leaq 0x21d9b9(%rip), %rcx    # 0x249c5e
movl $0x3ae5, %edx           # imm = 0x3AE5
callq 0x2110
leaq 0x21da22(%rip), %rdi    # 0x249cd8
leaq 0x21934c(%rip), %rsi    # 0x245609
leaq 0x21d99a(%rip), %rcx    # 0x249c5e
movl $0x3af1, %edx           # imm = 0x3AF1
callq 0x2110
leaq 0x21da5a(%rip), %rdi    # 0x249d2f
leaq 0x21932d(%rip), %rsi    # 0x245609
leaq 0x21d97b(%rip), %rcx    # 0x249c5e
movl $0x3afc, %edx           # imm = 0x3AFC
callq 0x2110