// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, (%rsp)
leaq 0x16a9fd(%rip), %r13    # 0x1e8688
xorl %ebx, %ebx
movq (%rsp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rbx
jae 0x7dcd5
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl (%rax,%rbx,8), %r8d
testl %r8d, %r8d
js 0x7dcd0
movq 0x40(%r15), %rax
movl 0x8(%rax,%rbx,8), %edx
movq (%rax,%rbx,8), %rcx
subl %ecx, %edx
addq 0x8(%r15), %rcx
movq 0x8(%rsp), %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x22b0
incq %rbx
jmp 0x7dc8d
pushq $0xc
popq %r13
xorl %ebp, %ebp
movq %r15, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq (%rsp), %rax
movl 0x4(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rbp
jae 0x7de80
movq (%rsp), %rax
movq 0x8(%rax), %rax
testq %r12, %r12
je 0x7ddf2
movq -0xc(%rax,%r13), %r11
movq %r11, %rcx
shrq $0x21, %rcx
imulq $0xc, %rcx, %r9
movl -0x4(%rax,%r13), %esi
movl %esi, %r14d
shrl %r14d
imulq $0xc, %r14, %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 %rbp, 0x30(%rsp)
movq %r12, %rbp
movl (%r12,%r9), %r8d
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
andl %ebx, %r8d
incl %r8d
btq $0x20, %r11
movl 0x8(%r15,%r14,8), %ebx
movq (%r15,%r14,8), %r14
leaq 0x1664b2(%rip), %r12    # 0x1e4223
movq %r12, %r15
adcq $0x0, %r15
movl 0x4(%rbp,%r9), %r9d
movsbl (%r15), %r15d
movq %r15, 0x28(%rsp)
subl %r14d, %ebx
addq %r14, %r10
movl (%rbp,%rdi), %r14d
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
andl %r15d, %r14d
incl %r14d
movl 0x4(%rbp,%rdi), %edi
movq %rdi, 0x20(%rsp)
andl $0x1, %esi
movsbl (%rsi,%r12), %r12d
movl (%rax,%r13), %ebp
andl %r15d, %ebp
movq 0x8(%rsp), %rdi
leaq 0x16a8d9(%rip), %rsi    # 0x1e869a
xorl %eax, %eax
pushq %r11
pushq %rbp
movq 0x40(%rsp), %rbp
pushq %r12
movq 0x30(%rsp), %r12
movq 0x28(%rsp), %r15
pushq 0x38(%rsp)
pushq %r14
pushq %r10
pushq %rbx
pushq 0x60(%rsp)
callq 0x22b0
addq $0x40, %rsp
jmp 0x7de74
movq 0x8(%r15), %r10
movq 0x40(%r15), %rsi
movq -0xc(%rax,%r13), %r11
movq %r11, %rcx
shrq $0x21, %rcx
movl 0x8(%rsi,%rcx,8), %edx
movq (%rsi,%rcx,8), %rcx
subl %ecx, %edx
addq %r10, %rcx
btq $0x20, %r11
leaq 0x166404(%rip), %r14    # 0x1e4223
movq %r14, %rdi
adcq $0x0, %rdi
movsbl (%rdi), %r8d
movl -0x4(%rax,%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 (%rax,%r13), %r14d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r14d
movq 0x8(%rsp), %rdi
leaq 0x16a863(%rip), %rsi    # 0x1e86c5
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %rbx
pushq %r10
callq 0x22b0
addq $0x20, %rsp
incq %rbp
addq $0x18, %r13
jmp 0x7dce5
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq