// File: /workspace/github_cpp_makefile_star2_O1/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 0x3372c
leaq 0x18(%rsp), %rdi
callq 0x3372c
movq 0x25d696(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x210fb0(%rip), %rsi    # 0x23d904
leaq 0x210fba(%rip), %rdx    # 0x23d915
movl %ebx, %ecx
xorl %eax, %eax
callq 0x22b0
testl %ebx, %ebx
je 0x2cccf
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 0x25d641(%rip), %rbp    # 0x289fe0
movq (%rbp), %rdi
leaq 0x25e886(%rip), %rbp    # 0x28b230
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 0x210f40(%rip), %rsi    # 0x23d930
leaq 0x210f1e(%rip), %rdx    # 0x23d915
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 0x33cf8
movq 0x25d5a7(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
movq 0x18(%rbp), %rax
movl (%rbx,%r14), %ecx
movq %r14, %rbp
movl (%rax,%rcx,8), %edx
movq 0x38(%rsp), %rcx
leaq 0x20d460(%rip), %rsi    # 0x239eb6
xorl %eax, %eax
callq 0x22b0
movq 0x10(%rsp), %rax
cmpl $0x0, 0xc(%r13,%rax)
je 0x2ccbc
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 0x2ccf5
addq %r12, %rax
movl 0x8(%rax), %ecx
movl 0xc(%rax), %r10d
movq 0x25d530(%rip), %rsi    # 0x289fe0
movq (%rsi), %rdi
movl 0x18(%rax), %esi
shrl $0x1f, %esi
leaq 0x1f9703(%rip), %r8     # 0x2261c3
movsbl (%rsi,%r8), %r8d
movl 0x10(%rax), %r9d
movl 0x14(%rax), %eax
movq %rax, 0x8(%rsp)
leaq 0x25e758(%rip), %r13    # 0x28b230
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 0x210ec4(%rip), %rsi    # 0x23d9c2
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 0x2ccab
movq (%r13), %rax
movl 0x8(%rax,%r12), %r15d
subl (%rax,%r12), %r15d
cmpq %r15, 0x48(%rsp)
jge 0x2cb5b
movq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x2370
movq %rax, 0x38(%rsp)
movq %r15, 0x48(%rsp)
movq 0x38(%rsp), %rdi
movq (%r13), %rax
movq (%rax,%r12), %rcx
movl %ecx, %esi
movl 0x8(%rax,%r12), %edx
subl %ecx, %edx
xorl %ecx, %ecx
leaq 0x25e6b6(%rip), %r8     # 0x28b230
movq %rbx, %r9
callq 0x337f7
movq (%r13), %rax
movl 0x14(%rax,%r12), %ebx
subl 0x10(%rax,%r12), %ebx
cmpq %rbx, 0x28(%rsp)
jge 0x2cbae
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x2370
movq %rax, 0x18(%rsp)
movq %rbx, 0x28(%rsp)
movq 0x18(%rsp), %rdi
movq (%r13), %rax
movl 0x10(%rax,%r12), %esi
movl 0x14(%rax,%r12), %edx
subl %esi, %edx
xorl %ecx, %ecx
leaq 0x25e664(%rip), %r8     # 0x28b230
movq 0x80(%rsp), %r9
callq 0x337f7
movq (%r13), %rsi
movl 0x14(%rsi,%r12), %edx
movl 0x8(%rsi,%r12), %edi
movl 0x10(%rsi,%r12), %ecx
movl %edx, %eax
subl %ecx, %eax
subl (%rsi,%r12), %edi
cmpl %edi, %eax
jne 0x2cd14
addq %r12, %rsi
testb $-0x80, 0x1b(%rsi)
je 0x2cc92
cmpl $0x2, %eax
jae 0x2cc12
xorl %edx, %edx
jmp 0x2cc6b
movl %eax, %esi
shrl %esi
cmpl $0x1, %esi
adcl $0x0, %esi
notl %ecx
addl %edx, %ecx
xorl %edx, %edx
leaq 0x25da07(%rip), %r11    # 0x28a630
leaq 0x25db05(%rip), %rbx    # 0x28a735
movq 0x18(%rsp), %rdi
movl %ecx, %r8d
movzbl (%rdi,%r8), %r9d
movzbl (%rdi,%rdx), %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,%rdx)
incq %rdx
decl %ecx
cmpq %rdx, %rsi
jne 0x2cc30
testb $0x1, %al
je 0x2cc92
movq 0x18(%rsp), %rcx
movzbl (%rcx,%rdx), %esi
leaq 0x25d9b1(%rip), %rdi    # 0x28a630
movzbl (%rdi,%rsi), %esi
leaq 0x25daab(%rip), %rdi    # 0x28a735
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 0x2cd33
movq 0x10(%rsp), %rcx
incl %ecx
cmpl 0xc(%r13), %ecx
jb 0x2ca7c
movq 0x70(%rsp), %rbx
incq %rbx
cmpq 0x58(%rsp), %rbx
jne 0x2c975
leaq 0x38(%rsp), %rdi
callq 0x33667
leaq 0x18(%rsp), %rdi
callq 0x33667
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x210c6f(%rip), %rdi    # 0x23d96b
leaq 0x20c622(%rip), %rsi    # 0x239325
leaq 0x210c70(%rip), %rcx    # 0x23d97a
movl $0x3ae5, %edx           # imm = 0x3AE5
callq 0x2110
leaq 0x210cd9(%rip), %rdi    # 0x23d9f4
leaq 0x20c603(%rip), %rsi    # 0x239325
leaq 0x210c51(%rip), %rcx    # 0x23d97a
movl $0x3af1, %edx           # imm = 0x3AF1
callq 0x2110
leaq 0x210d11(%rip), %rdi    # 0x23da4b
leaq 0x20c5e4(%rip), %rsi    # 0x239325
leaq 0x210c32(%rip), %rcx    # 0x23d97a
movl $0x3afc, %edx           # imm = 0x3AFC
callq 0x2110