// File: /workspace/github_cpp_makefile_star2_O2/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, 0x20(%rsp)
movl %edx, %ebx
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x6bd1
leaq 0x48(%rsp), %rdi
callq 0x6bd1
movq 0x7efae(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
leaq 0x27b6b(%rip), %rsi     # 0x1fbba7
leaq 0x27b75(%rip), %rdx     # 0x1fbbb8
movl %ebx, %ecx
xorl %eax, %eax
callq 0x22b0
movl %ebx, %eax
xorl %ecx, %ecx
movq %rax, 0x8(%rsp)
cmpq %rax, %rcx
je 0x1d4346
imulq $0x18, %rcx, %rbx
movq 0x18(%rsp), %r15
leaq (%r15,%rbx), %rax
movq %rax, 0x38(%rsp)
movl (%r15,%rbx), %r10d
imulq $0x18, %r10, %r14
movq 0x10(%rsp), %rax
addq 0x8(%rax), %r14
movl 0x4(%r15,%rbx), %r12d
movq 0x7ef53(%rip), %r13     # 0x252fe0
movq (%r13), %rdi
leaq 0x80198(%rip), %r13     # 0x254230
movq 0x18(%r13), %rax
movq %rax, (%rsp)
movq 0x40(%r13), %rax
leal 0x1(%r10), %edx
movl (%rax,%rdx,8), %r8d
movq (%rax,%r10,8), %r9
subl %r9d, %r8d
addq 0x8(%r13), %r9
movl %r12d, %ebp
shrl %ebp
andl $0x1, %r12d
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movl (%rax,%r10,8), %r11d
shrl $0x1f, %r11d
subq $0x8, %rsp
leaq 0x27af7(%rip), %rsi     # 0x1fbbd3
leaq 0x27ad5(%rip), %rdx     # 0x1fbbb8
movq %rcx, 0x30(%rsp)
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %rbp
movq 0x20(%rsp), %r11
pushq (%r11,%r10,8)
pushq %r10
callq 0x22b0
addq $0x30, %rsp
movl (%r15,%rbx), %edx
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
callq 0x715e
movq 0x7eec5(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movq 0x18(%r13), %rax
movl (%r15,%rbx), %ecx
movl (%rax,%rcx,8), %edx
movq 0x68(%rsp), %rcx
leaq 0x23f35(%rip), %rsi     # 0x1f806a
xorl %eax, %eax
callq 0x22b0
xorl %ecx, %ecx
movq %r14, 0x30(%rsp)
cmpl 0xc(%r14), %ecx
jae 0x1d4334
movq (%r14), %rax
movl %ecx, (%rsp)
movl %ecx, %ecx
imulq $0x28, %rcx, %rbp
movq (%rax,%rbp), %rdx
movq %rdx, %r12
shrq $0x20, %r12
movq 0x38(%rsp), %r14
cmpl %r12d, (%r14)
jne 0x1d436c
addq %rbp, %rax
movl 0x8(%rax), %r10d
movl 0xc(%rax), %ebx
movq 0x7ee5d(%rip), %rsi     # 0x252fe0
movq (%rsi), %rdi
movl 0x18(%rax), %esi
shrl $0x1f, %esi
leaq 0x10090(%rip), %r8      # 0x1e4223
movsbl (%rsi,%r8), %r8d
movl 0x10(%rax), %r9d
movl 0x14(%rax), %eax
movq %rax, 0x40(%rsp)
leaq 0x80085(%rip), %rcx     # 0x254230
movq 0x18(%rcx), %r11
movq 0x40(%rcx), %rax
leal 0x1(%rbx), %esi
movl (%rax,%rsi,8), %r13d
movq (%rax,%rbx,8), %r15
subl %r15d, %r13d
addq 0x8(%rcx), %r15
subq $0x8, %rsp
leaq 0x27a95(%rip), %rsi     # 0x1fbc65
movl %r10d, %ecx
xorl %eax, %eax
pushq (%r11,%rbx,8)
pushq %rbx
pushq %r15
pushq %r13
pushq 0x68(%rsp)
callq 0x22b0
addq $0x30, %rsp
movl 0x14(%r14), %eax
cmpl 0x10(%r14), %eax
movq 0x30(%rsp), %r14
jb 0x1d432a
movq (%r14), %rax
movl 0x8(%rax,%rbp), %esi
subl (%rax,%rbp), %esi
leaq 0x68(%rsp), %rdi
callq 0x562fa
movq 0x68(%rsp), %rdi
movq (%r14), %rax
movq (%rax,%rbp), %rcx
movl %ecx, %esi
movl 0x8(%rax,%rbp), %edx
subl %ecx, %edx
xorl %ecx, %ecx
leaq 0x80001(%rip), %r15     # 0x254230
movq %r15, %r8
movq %r12, %r9
callq 0x6c9e
movq (%r14), %rax
movl 0x14(%rax,%rbp), %esi
subl 0x10(%rax,%rbp), %esi
leaq 0x48(%rsp), %rdi
callq 0x562fa
movq 0x48(%rsp), %rdi
movq (%r14), %rax
movl 0x10(%rax,%rbp), %esi
movl 0x14(%rax,%rbp), %edx
subl %esi, %edx
xorl %ecx, %ecx
movq %r15, %r8
movq %rbx, %r9
callq 0x6c9e
movq (%r14), %rdx
movl 0x14(%rdx,%rbp), %esi
movl 0x8(%rdx,%rbp), %edi
movl 0x10(%rdx,%rbp), %ecx
movl %esi, %eax
subl %ecx, %eax
subl (%rdx,%rbp), %edi
cmpl %edi, %eax
jne 0x1d438b
addq %rbp, %rdx
testb $-0x80, 0x1b(%rdx)
je 0x1d4311
movl %eax, %edx
shrl %edx
notl %ecx
addl %esi, %ecx
xorl %esi, %esi
leaq 0x7f38a(%rip), %r11     # 0x253630
leaq 0x7f488(%rip), %rbx     # 0x253735
cmpq %rsi, %rdx
je 0x1d42ea
movq 0x48(%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 0x48(%rsp), %r8
movb %dil, (%r8,%rsi)
incq %rsi
decl %ecx
jmp 0x1d42ad
testb $0x1, %al
je 0x1d4311
movq 0x48(%rsp), %rcx
movzbl (%rcx,%rdx), %esi
leaq 0x7f332(%rip), %rdi     # 0x253630
movzbl (%rdi,%rsi), %esi
leaq 0x7f42c(%rip), %rdi     # 0x253735
movb (%rdi,%rsi), %sil
movb %sil, (%rcx,%rdx)
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl %eax, %edx
callq 0x21a0
testl %eax, %eax
jne 0x1d43aa
movl (%rsp), %ecx
incl %ecx
jmp 0x1d4143
movq 0x28(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %rax
jmp 0x1d4055
leaq 0x68(%rsp), %rdi
callq 0x6b07
leaq 0x48(%rsp), %rdi
callq 0x6b07
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2789b(%rip), %rdi     # 0x1fbc0e
leaq 0x2315f(%rip), %rsi     # 0x1f74d9
leaq 0x2789c(%rip), %rcx     # 0x1fbc1d
movl $0x3ae5, %edx           # imm = 0x3AE5
callq 0x2110
leaq 0x27905(%rip), %rdi     # 0x1fbc97
leaq 0x23140(%rip), %rsi     # 0x1f74d9
leaq 0x2787d(%rip), %rcx     # 0x1fbc1d
movl $0x3af1, %edx           # imm = 0x3AF1
callq 0x2110
leaq 0x2793d(%rip), %rdi     # 0x1fbcee
leaq 0x23121(%rip), %rsi     # 0x1f74d9
leaq 0x2785e(%rip), %rcx     # 0x1fbc1d
movl $0x3afc, %edx           # imm = 0x3AFC
callq 0x2110