// File: CK7[P]abawaca/src/abawaca-build.cpp
// Function: Links::write_connections(std::basic_ofstream<char, std::char_traits<char>>&) const
void Links::write_connections(ofstream& os) const
{
	set<Links::Link*> links_to_write;

	for(auto it=links.begin(); it!=links.end(); it++) {
		for(auto sit=it->second.begin(); sit!=it->second.end(); sit++) {
			links_to_write.insert(sit->second);
		}
	}

	for(auto sit=links_to_write.begin(); sit!=links_to_write.end(); sit++)
		os << (*sit)->side1.seq << '\t' << (*sit)->side1.end << '\t' << (*sit)->side2.seq << '\t' << (*sit)->side2.end << '\t' << (*sit)->count << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10c00
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
callq 0x10fb0
movq %rax, -0x48(%rbp)
movq -0xb0(%rbp), %rdi
addq $0x8, %rdi
callq 0x11010
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x10fe0
testb $0x1, %al
jne 0xc755
jmp 0xc81d
leaq -0x48(%rbp), %rdi
callq 0x11040
movq %rax, %rdi
addq $0x28, %rdi
callq 0x11070
movq %rax, -0x58(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x11040
movq %rax, %rdi
addq $0x28, %rdi
callq 0x110d0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x110a0
testb $0x1, %al
jne 0xc79a
jmp 0xc804
leaq -0x58(%rbp), %rdi
callq 0x11100
movq %rax, %rsi
addq $0x28, %rsi
leaq -0x40(%rbp), %rdi
callq 0x10d60
movb %dl, -0xb9(%rbp)
movq %rax, -0xb8(%rbp)
jmp 0xc7c2
movb -0xb9(%rbp), %al
movq -0xb8(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movb %al, -0x78(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x11130
movq %rax, -0x88(%rbp)
jmp 0xc76e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10f70
jmp 0xc9d3
jmp 0xc806
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x11170
movq %rax, -0x90(%rbp)
jmp 0xc72b
leaq -0x40(%rbp), %rdi
callq 0x10e50
movq %rax, -0x98(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10eb0
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x10e80
testb $0x1, %al
jne 0xc859
jmp 0xc9c1
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x10ee0
movq -0xd0(%rbp), %rdi
movq (%rax), %rsi
callq 0x4290
movq %rax, -0xc8(%rbp)
jmp 0xc888
movq -0xc8(%rbp), %rdi
movl $0x9, %esi
callq 0x43a0
movq %rax, -0xd8(%rbp)
jmp 0xc8a2
leaq -0x98(%rbp), %rdi
callq 0x10ee0
movq -0xd8(%rbp), %rdi
movq (%rax), %rax
movq 0x20(%rax), %rsi
callq 0x40d0
movq %rax, -0xe0(%rbp)
jmp 0xc8ca
movq -0xe0(%rbp), %rdi
movl $0x9, %esi
callq 0x43a0
movq %rax, -0xe8(%rbp)
jmp 0xc8e4
leaq -0x98(%rbp), %rdi
callq 0x10ee0
movq -0xe8(%rbp), %rdi
movq (%rax), %rsi
addq $0x28, %rsi
callq 0x4290
movq %rax, -0xf0(%rbp)
jmp 0xc90c
movq -0xf0(%rbp), %rdi
movl $0x9, %esi
callq 0x43a0
movq %rax, -0xf8(%rbp)
jmp 0xc926
leaq -0x98(%rbp), %rdi
callq 0x10ee0
movq -0xf8(%rbp), %rdi
movq (%rax), %rax
movq 0x48(%rax), %rsi
callq 0x40d0
movq %rax, -0x100(%rbp)
jmp 0xc94e
movq -0x100(%rbp), %rdi
movl $0x9, %esi
callq 0x43a0
movq %rax, -0x108(%rbp)
jmp 0xc968
leaq -0x98(%rbp), %rdi
callq 0x10ee0
movq -0x108(%rbp), %rdi
movq (%rax), %rax
movq 0x50(%rax), %rsi
callq 0x40d0
movq %rax, -0x110(%rbp)
jmp 0xc990
movq -0x110(%rbp), %rdi
movq 0x2561a(%rip), %rsi     # 0x31fb8
callq 0x4340
jmp 0xc9a5
jmp 0xc9a7
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x10f30
movq %rax, -0xa8(%rbp)
jmp 0xc82d
leaq -0x40(%rbp), %rdi
callq 0x10f70
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x45c0
nopl (%rax)