// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x30(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0xf18fd
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0xf18ed
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x4c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq 0x40(%rcx), %rcx
movl -0x4c(%rbp), %edx
subq (%rcx,%rdx,8), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x4c(%rbp), %esi
addq (%rax,%rsi,8), %rcx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x4c(%rbp), %esi
movl (%rax,%rsi,8), %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
leaq 0x2958d0(%rip), %rsi    # 0x3871b6
movb $0x0, %al
callq 0x22a0
jmp 0xf18ef
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xf185b
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x30(%rbp), %rcx
movl 0x4(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0xf1bf6
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xf1ad1
movq -0x40(%rbp), %rax
movq -0x58(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x21, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rax
movq -0x58(%rbp), %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x21, %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq (%rdx), %rdx
shrq $0x21, %rdx
subq (%rcx,%rdx,8), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rsi
movq (%rsi), %rsi
shrq $0x21, %rsi
addq (%rax,%rsi,8), %rcx
movq -0x60(%rbp), %rax
movl (%rax), %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
addl $0x1, %r8d
movq -0x60(%rbp), %rax
movl 0x4(%rax), %r9d
movq -0x58(%rbp), %rax
movq (%rax), %rsi
shrq $0x20, %rsi
andq $0x1, %rsi
leaq 0x2914a6(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r13d
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rsi
movl 0x8(%rsi), %esi
shrl %esi
addl $0x1, %esi
movl %esi, %esi
movq (%rax,%rsi,8), %rax
movq -0x38(%rbp), %rsi
movq 0x40(%rsi), %rsi
movq -0x58(%rbp), %r10
movl 0x8(%r10), %r10d
shrl %r10d
movl %r10d, %r10d
subq (%rsi,%r10,8), %rax
movl %eax, %r12d
movq -0x38(%rbp), %rax
movq 0x8(%rax), %r15
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rsi
movl 0x8(%rsi), %esi
shrl %esi
movl %esi, %esi
addq (%rax,%rsi,8), %r15
movq -0x68(%rbp), %rax
movl (%rax), %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
addl $0x1, %r14d
movq -0x68(%rbp), %rax
movl 0x4(%rax), %ebx
movq -0x58(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x29141d(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r11d
movq -0x58(%rbp), %rax
movl 0xc(%rax), %r10d
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movq -0x58(%rbp), %rax
movq (%rax), %rax
leaq 0x295728(%rip), %rsi    # 0x3871c8
movl %r13d, (%rsp)
movl %r12d, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movl %r14d, 0x18(%rsp)
movl %ebx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movl %r10d, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xf1be6
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x21, %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq (%rdx), %rdx
shrq $0x21, %rdx
subq (%rcx,%rdx,8), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rsi
movq (%rsi), %rsi
shrq $0x21, %rsi
addq (%rax,%rsi,8), %rcx
movq -0x58(%rbp), %rax
movq (%rax), %rsi
shrq $0x20, %rsi
andq $0x1, %rsi
leaq 0x291360(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r8d
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rsi
movl 0x8(%rsi), %esi
shrl %esi
addl $0x1, %esi
movl %esi, %esi
movq (%rax,%rsi,8), %rax
movq -0x38(%rbp), %rsi
movq 0x40(%rsi), %rsi
movq -0x58(%rbp), %r9
movl 0x8(%r9), %r9d
shrl %r9d
movl %r9d, %r9d
subq (%rsi,%r9,8), %rax
movl %eax, %r9d
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rbx
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x58(%rbp), %rsi
movl 0x8(%rsi), %esi
shrl %esi
movl %esi, %esi
addq (%rax,%rsi,8), %rbx
movq -0x58(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x2912f0(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r11d
movq -0x58(%rbp), %rax
movl 0xc(%rax), %r10d
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movq -0x58(%rbp), %rax
movq (%rax), %rax
leaq 0x295626(%rip), %rsi    # 0x3871f3
movq %rbx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xf1be8
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xf1904
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)