// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: ma_sg_print(asg_t const*, All_reads const*, ma_sub_t const*, _IO_FILE*)
void ma_sg_print(const asg_t *g, const All_reads *RNF, const ma_sub_t *sub, FILE *fp)
{
	uint32_t i;
    for (i = 0; i < g->n_seq; ++i) 
    {
        if(!g->seq[i].del)
        {
             fprintf(fp, 
             "S\t%.*s\t*\tLN:i:%u\n",
             (int)Get_NAME_LENGTH((*RNF), i), 
             Get_NAME((*RNF), i),
             g->seq[i].len);
        }
    }

	for (i = 0; i < g->n_arc; ++i) {
		const asg_arc_t *p = &g->arc[i];
		if (sub) {
			const ma_sub_t *sq = &sub[p->ul>>33], *st = &sub[p->v>>1];

            fprintf(fp, 
            "L\t%.*s:%d-%d\t%c\t%.*s:%d-%d\t%c\t%d:\tL1:i:%u\n", 
            (int)Get_NAME_LENGTH((*RNF), p->ul>>33), 
            Get_NAME((*RNF), p->ul>>33),
            sq->s + 1, sq->e, "+-"[p->ul>>32&1],
            (int)Get_NAME_LENGTH((*RNF), p->v>>1), 
            Get_NAME((*RNF), p->v>>1),
            st->s + 1, st->e, "+-"[p->v&1], p->ol, (uint32_t)p->ul);
            

		} 
        else 
        {
           fprintf(fp, "L\t%.*s\t%c\t%.*s\t%c\t%d:\tL1:i:%u\n", 
            (int)Get_NAME_LENGTH((*RNF), p->ul>>33), 
            Get_NAME((*RNF), p->ul>>33),
            "+-"[p->ul>>32&1],
            (int)Get_NAME_LENGTH((*RNF), p->v>>1), 
            Get_NAME((*RNF), p->v>>1),
            "+-"[p->v&1], p->ol, (uint32_t)p->ul);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, (%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %r15
movq %rdi, %r14
testl $0x7fffffff, 0x14(%rdi) # imm = 0x7FFFFFFF
je 0xb7d76
leaq 0x172862(%rip), %r13    # 0x22a598
xorl %ebx, %ebx
movq 0x20(%r14), %rax
movl (%rax,%rbx,8), %r8d
testl %r8d, %r8d
js 0xb7d65
movq 0x40(%r15), %rax
movl 0x8(%rax,%rbx,8), %edx
movq (%rax,%rbx,8), %rcx
subl %ecx, %edx
addq 0x8(%r15), %rcx
movq (%rsp), %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x22b0
incq %rbx
movl 0x14(%r14), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rbx
jb 0xb7d38
testl $0x7fffffff, 0x4(%r14)  # imm = 0x7FFFFFFF
je 0xb7f36
movl $0xc, %r13d
xorl %ebp, %ebp
movq %r15, 0x10(%rsp)
movq %r14, 0x20(%rsp)
movq 0x8(%r14), %r11
cmpq $0x0, 0x18(%rsp)
je 0xb7e97
movq -0xc(%r11,%r13), %rax
movq %rax, %rcx
movq %rax, 0x28(%rsp)
shrq $0x21, %rcx
leaq (%rcx,%rcx,2), %r9
movl -0x4(%r11,%r13), %esi
movl %esi, %r14d
shrl %r14d
leaq (%r14,%r14,2), %rdi
movq 0x8(%r15), %r10
movq 0x10(%rsp), %rdx
movq 0x40(%rdx), %r15
movl 0x8(%r15,%rcx,8), %edx
movq (%r15,%rcx,8), %rcx
subl %ecx, %edx
addq %r10, %rcx
movq 0x18(%rsp), %r12
movl (%r12,%r9,4), %r8d
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
andl %ebx, %r8d
incl %r8d
btq $0x20, %rax
movl 0x8(%r15,%r14,8), %ebx
movq (%r15,%r14,8), %r14
leaq 0x16e3b5(%rip), %rax    # 0x2261c3
movq %rax, %r15
adcq $0x0, %r15
movl 0x4(%r12,%r9,4), %r9d
movl %r9d, 0xc(%rsp)
movsbl (%r15), %r15d
movq %r15, 0x40(%rsp)
subl %r14d, %ebx
addq %r14, %r10
movl (%r12,%rdi,4), %r14d
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
andl %r9d, %r14d
incl %r14d
movl 0x4(%r12,%rdi,4), %edi
movq %rdi, 0x38(%rsp)
andl $0x1, %esi
movsbl (%rsi,%rax), %esi
movq %rsi, 0x30(%rsp)
movl (%r11,%r13), %r12d
andl %r9d, %r12d
movq (%rsp), %rdi
leaq 0x172744(%rip), %rsi    # 0x22a5aa
movl 0xc(%rsp), %r9d
xorl %eax, %eax
pushq 0x28(%rsp)
pushq %r12
movq 0x20(%rsp), %r15
pushq 0x40(%rsp)
pushq 0x50(%rsp)
pushq %r14
pushq %r10
pushq %rbx
pushq 0x78(%rsp)
callq 0x22b0
addq $0x40, %rsp
jmp 0xb7f18
movq 0x8(%r15), %r10
movq 0x40(%r15), %rsi
movq -0xc(%r11,%r13), %r12
movq %r12, %rcx
shrq $0x21, %rcx
movl 0x8(%rsi,%rcx,8), %edx
movq (%rsi,%rcx,8), %rcx
subl %ecx, %edx
addq %r10, %rcx
btq $0x20, %r12
leaq 0x16e2ff(%rip), %r14    # 0x2261c3
movq %r14, %rdi
adcq $0x0, %rdi
movsbl (%rdi), %r8d
movl -0x4(%r11,%r13), %edi
movl %edi, %ebx
shrl %ebx
movl 0x8(%rsi,%rbx,8), %r9d
movq (%rsi,%rbx,8), %rsi
subl %esi, %r9d
addq %rsi, %r10
andl $0x1, %edi
movsbl (%rdi,%r14), %ebx
movl (%r11,%r13), %r14d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r14d
movq (%rsp), %rdi
leaq 0x1726cf(%rip), %rsi    # 0x22a5d5
xorl %eax, %eax
pushq %r12
pushq %r14
pushq %rbx
pushq %r10
callq 0x22b0
addq $0x20, %rsp
incq %rbp
movq 0x20(%rsp), %r14
movl 0x4(%r14), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq $0x18, %r13
cmpq %rax, %rbp
jb 0xb7d96
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq