// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: print_raw_u2rgfa_seq(all_ul_t*, R_to_U*, unsigned int)
void print_raw_u2rgfa_seq(all_ul_t *aln, R_to_U* rI, uint32_t is_detail)
{
	uint64_t id, a_n, k, z; uc_block_t *a = NULL; 
	kvec_t(uint8_t) ff; kv_init(ff);
	for (id = 0; id < aln->n; id++) {
		a = aln->a[id].bb.a; a_n = aln->a[id].bb.n;
		if(a_n == 0) continue;
		fprintf(stderr,"\n%.*s\tid::%lu\trlen::%u", (int32_t)aln->nid.a[id].n, aln->nid.a[id].a, id, aln->a[id].rlen);
		kv_resize(uint8_t, ff, a_n); memset(ff.a, 0, a_n*sizeof((*(ff.a))));
		if(is_detail) {
			fprintf(stderr, "\n");
			for (k = 0; k < a_n; k++) {
				if(ff.a[k]) continue;
				for (z = k; z != (uint32_t)-1; z = a[z].aidx) {
					fprintf(stderr, "%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tid::%u\ttl::%lu\tc::%u\n", 
					(int)Get_NAME_LENGTH(R_INF, a[z].hid), Get_NAME(R_INF, a[z].hid), "+-"[a[z].rev],
					a[z].qs, a[z].qe, a[z].ts, a[z].te, a[z].hid, Get_READ_LENGTH(R_INF, a[z].hid),
                    rI?is_contain_r((*rI), a[z].hid):0);
					assert(ff.a[z] == 0);
					ff.a[z] = 1;
				}
				fprintf(stderr, "************\n");
			}
		} else {
			fprintf(stderr, "\t");
			for (k = 0; k < a_n; k++) {
				if(ff.a[k]) continue;
				for (z = k; z != (uint32_t)-1; z = a[z].aidx) {
					fprintf(stderr, "%.*s\t", 
					(int)Get_NAME_LENGTH(R_INF, a[z].hid), Get_NAME(R_INF, a[z].hid));
					assert(ff.a[z] == 0);
					ff.a[z] = 1;
				}
				fprintf(stderr, "\n");
			}
		}
	}
	kv_destroy(ff);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, 0x1c(%rsp)
movq %rsi, %r15
movq %rdi, %r14
xorl %r13d, %r13d
movq $0x0, 0x20(%rsp)
xorl %r8d, %r8d
movq %rsi, 0x40(%rsp)
movq %rdi, 0x28(%rsp)
cmpq 0x50(%r14), %r8
jae 0x1ae958
movq 0x48(%r14), %rax
imulq $0x58, %r8, %rcx
movq 0x20(%rax,%rcx), %rdx
testq %rdx, %rdx
jne 0x1ae697
incq %r8
jmp 0x1ae676
movq %rdx, 0x8(%rsp)
leaq (%rax,%rcx), %rsi
movq 0x30(%rax,%rcx), %rax
movq %rax, 0x30(%rsp)
movq 0xa492f(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movq 0x10(%r14), %rax
movq %r8, %rcx
shlq $0x4, %rcx
movl 0x8(%rax,%rcx), %edx
movq (%rax,%rcx), %rcx
movl 0x18(%rsi), %r9d
leaq 0x49543(%rip), %rsi     # 0x1f7c15
movq %r8, 0x10(%rsp)
xorl %eax, %eax
callq 0x22b0
movq 0x8(%rsp), %rbx
cmpq %rbx, 0x20(%rsp)
jae 0x1ae732
leaq -0x1(%rbx), %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %r13, %rdi
movq %rsi, 0x20(%rsp)
callq 0x2370
movq %rax, %r13
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x20e0
movq 0xa489a(%rip), %rax     # 0x252fe0
movq (%rax), %rsi
cmpl $0x0, 0x1c(%rsp)
je 0x1ae8a2
pushq $0xa
popq %rdi
callq 0x2270
xorl %ecx, %ecx
movq 0x10(%rsp), %r8
movq %r13, 0x48(%rsp)
movq 0x8(%rsp), %rax
cmpq %rax, %rcx
je 0x1ae692
cmpb $0x0, (%r13,%rcx)
je 0x1ae783
incq %rcx
jmp 0x1ae76d
movq %rcx, 0x38(%rsp)
movq %rcx, %r14
movq 0x30(%rsp), %rbp
movq 0xa4849(%rip), %rax     # 0x252fe0
movq (%rax), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %r14
je 0x1ae874
imulq $0x24, %r14, %rbx
movl (%rbp,%rbx), %r10d
movzbl 0x20(%rbp,%rbx), %ecx
btl $0x5, %ecx
leaq 0x35a62(%rip), %rsi     # 0x1e4223
adcq $0x0, %rsi
xorl %r11d, %r11d
testq %r15, %r15
je 0x1ae7e7
cmpq %r10, (%r15)
jbe 0x1ae7e7
movq 0x8(%r15), %rcx
movl (%rcx,%r10,4), %ecx
cmpl $-0x1, %ecx
je 0x1ae7e7
notl %ecx
shrl $0x1f, %ecx
movl %ecx, %r11d
leaq 0xa5a42(%rip), %rdi     # 0x254230
movq 0x18(%rdi), %rcx
movq %rcx, 0x50(%rsp)
movq 0x40(%rdi), %rcx
movl 0x4(%rbp,%rbx), %r9d
leal 0x1(%r10), %edx
movl (%rcx,%rdx,8), %edx
movq (%rcx,%r10,8), %rcx
subl %ecx, %edx
addq 0x8(%rdi), %rcx
movsbl (%rsi), %r8d
movl 0x8(%rbp,%rbx), %r13d
movl 0xc(%rbp,%rbx), %r12d
movl 0x10(%rbp,%rbx), %r15d
movq %rax, %rdi
leaq 0x493fe(%rip), %rsi     # 0x1f7c2c
xorl %eax, %eax
pushq %r11
movq 0x58(%rsp), %r11
pushq (%r11,%r10,8)
pushq %r10
pushq %r15
pushq %r12
pushq %r13
callq 0x22b0
addq $0x30, %rsp
movq 0x48(%rsp), %r13
cmpb $0x0, (%r13,%r14)
jne 0x1ae96e
addq %rbp, %rbx
movb $0x1, (%r13,%r14)
movl 0x1c(%rbx), %r14d
movq 0x40(%rsp), %r15
jmp 0x1ae790
leaq 0x3be68(%rip), %rdi     # 0x1ea6e3
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x2410
movq 0x28(%rsp), %r14
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rax
movq 0x38(%rsp), %rcx
jmp 0x1ae77e
pushq $0x9
popq %rdi
callq 0x2270
xorl %ebx, %ebx
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rax
cmpq %rax, %rbx
je 0x1ae692
cmpb $0x0, (%r13,%rbx)
jne 0x1ae950
movq %rbx, %r14
movq 0x30(%rsp), %r8
movq 0xa4706(%rip), %rax     # 0x252fe0
movq (%rax), %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r14
je 0x1ae939
leaq 0xa5942(%rip), %rdi     # 0x254230
movq 0x40(%rdi), %rax
imulq $0x24, %r14, %r12
movl (%r8,%r12), %ecx
leal 0x1(%rcx), %edx
movl (%rax,%rdx,8), %edx
movq (%rax,%rcx,8), %rcx
subl %ecx, %edx
addq 0x8(%rdi), %rcx
movq %rsi, %rdi
leaq 0x41c99(%rip), %rsi     # 0x1f05ad
xorl %eax, %eax
movq %r8, %rbp
callq 0x22b0
cmpb $0x0, (%r13,%r14)
jne 0x1ae98d
addq %rbp, %r12
movb $0x1, (%r13,%r14)
movl 0x1c(%r12), %r14d
movq %rbp, %r8
jmp 0x1ae8d3
pushq $0xa
popq %rdi
callq 0x2270
movq 0x28(%rsp), %r14
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rax
incq %rbx
jmp 0x1ae8b6
movq %r13, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220
leaq 0x492ed(%rip), %rdi     # 0x1f7c62
leaq 0x48b5d(%rip), %rsi     # 0x1f74d9
leaq 0x492ec(%rip), %rcx     # 0x1f7c6f
movl $0xbae, %edx            # imm = 0xBAE
callq 0x2110
leaq 0x492ce(%rip), %rdi     # 0x1f7c62
leaq 0x48b3e(%rip), %rsi     # 0x1f74d9
leaq 0x492cd(%rip), %rcx     # 0x1f7c6f
movl $0xbba, %edx            # imm = 0xBBA
callq 0x2110