// File: Luthaf[P]zeopp/v_network.cc
// Function: voronoi_network::print_network(_IO_FILE*, bool)
void voronoi_network::print_network(FILE *fp,bool reverse_remove) {
	int ai,aj,ak,j,l,ll,q;
	double x,y,z,x2,y2,z2,*ptsp;

	// Print the vertex table
	fprintf(fp,"Vertex table:\n%d\n",edc);
	//os << edc << "\n";
	for(l=0;l<edc;l++) {
		ptsp=pts[reg[l]];j=4*regp[l];
		fprintf(fp,"%d %g %g %g %g",l,ptsp[j],ptsp[j+1],ptsp[j+2],ptsp[j+3]);
		for(ll=0;ll<nec[l];ll++) fprintf(fp," %d",ne[l][ll]);
		fputs("\n",fp);
	}
	
	// Print out the edge table, loop over vertices
	fputs("\nEdge table:\n",fp);
	for(l=0;l<edc;l++) {
		
		// Store the position of this vertex
		ptsp=pts[reg[l]];j=4*regp[l];
		x=ptsp[j];y=ptsp[j+1];z=ptsp[j+2];

		// Loop over edges of this vertex
		for(q=0;q<nu[l];q++) {

			unpack_periodicity(pered[l][q],ai,aj,ak);

			// If this option is enabled, then the code will not
			// print edges from i to j for j<i.
			if(reverse_remove) if(ed[l][q]<l&&ai==0&&aj==0&&ak==0) continue;
			
			fprintf(fp,"%d -> %d",l,ed[l][q]);
			raded[l][q].print(fp);
			
			// Compute and print the length of the edge 
			ptsp=pts[reg[ed[l][q]]];j=4*regp[ed[l][q]];
			x2=ptsp[j]+ai*bx+aj*bxy+ak*bxz-x;
			y2=ptsp[j+1]+aj*by+ak*byz-y;
			z2=ptsp[j+2]+ak*bz-z;
			fprintf(fp," %d %d %d %g\n",ai,aj,ak,sqrt(x2*x2+y2*y2+z2*z2));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movl 0xa0(%rax), %edx
leaq 0x11792e(%rip), %rsi    # 0x1fbc81
movb $0x0, %al
callq 0x5750
movl $0x0, -0x28(%rbp)
movq -0x70(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0xa0(%rcx), %eax
jge 0xe4472
movq -0x70(%rbp), %rax
movq 0x60(%rax), %rcx
movq 0xc0(%rax), %rdx
movslq -0x28(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, -0x68(%rbp)
movq 0xc8(%rax), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shll $0x2, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %edx
movq -0x68(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x68(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x68(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x68(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm3
leaq 0x11789b(%rip), %rsi    # 0x1fbc93
movb $0x4, %al
callq 0x5750
movl $0x0, -0x2c(%rbp)
movq -0x70(%rbp), %rcx
movl -0x2c(%rbp), %eax
movq 0xb0(%rcx), %rcx
movslq -0x28(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xe4454
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rdi
movq 0x88(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x125fa4(%rip), %rsi    # 0x20a3e6
movb $0x0, %al
callq 0x5750
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xe4406
movq -0x10(%rbp), %rsi
leaq 0x1151c6(%rip), %rdi    # 0x1f9625
callq 0x5610
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xe4361
movq -0x10(%rbp), %rsi
leaq 0x117825(%rip), %rdi    # 0x1fbca2
callq 0x5610
movl $0x0, -0x28(%rbp)
movq -0x70(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0xa0(%rcx), %eax
jge 0xe4790
movq -0x70(%rbp), %rax
movq 0x60(%rax), %rcx
movq 0xc0(%rax), %rdx
movslq -0x28(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, -0x68(%rbp)
movq 0xc8(%rax), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shll $0x2, %eax
movl %eax, -0x24(%rbp)
movq -0x68(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x68(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x68(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x70(%rbp), %rcx
movl -0x30(%rbp), %eax
movq 0xa8(%rcx), %rcx
movslq -0x28(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xe4780
movq -0x70(%rbp), %rdi
movq 0x98(%rdi), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq -0x18(%rbp), %rdx
leaq -0x1c(%rbp), %rcx
leaq -0x20(%rbp), %r8
callq 0xe52b0
testb $0x1, -0x11(%rbp)
je 0xe459a
movq -0x70(%rbp), %rax
movq 0x80(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x28(%rbp), %eax
jge 0xe4598
cmpl $0x0, -0x18(%rbp)
jne 0xe4598
cmpl $0x0, -0x1c(%rbp)
jne 0xe4598
cmpl $0x0, -0x20(%rbp)
jne 0xe4598
jmp 0xe4772
jmp 0xe459a
movq -0x70(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %edx
movq 0x80(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
leaq 0x1176ee(%rip), %rsi    # 0x1fbcb0
movb $0x0, %al
callq 0x5750
movq -0x70(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0xe5330
movq -0x70(%rbp), %rax
movq 0x60(%rax), %rcx
movq 0xc0(%rax), %rdx
movq 0x80(%rax), %rsi
movslq -0x28(%rbp), %rdi
movq (%rsi,%rdi,8), %rsi
movslq -0x30(%rbp), %rdi
movslq (%rsi,%rdi,4), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, -0x68(%rbp)
movq 0xc8(%rax), %rcx
movq 0x80(%rax), %rdx
movslq -0x28(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq -0x30(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movl (%rcx,%rdx,4), %ecx
shll $0x2, %ecx
movl %ecx, -0x24(%rbp)
movq -0x68(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm1
cvtsi2sdl -0x18(%rbp), %xmm0
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
movsd 0x8(%rax), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsi2sdl -0x20(%rbp), %xmm0
movsd 0x18(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x68(%rbp), %rcx
movl -0x24(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
movsd 0x10(%rax), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsi2sdl -0x20(%rbp), %xmm0
movsd 0x20(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x68(%rbp), %rcx
movl -0x24(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm1
cvtsi2sdl -0x20(%rbp), %xmm0
movsd 0x28(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x74(%rbp)
movsd -0x50(%rbp), %xmm1
movsd -0x50(%rbp), %xmm2
movsd -0x58(%rbp), %xmm0
mulsd -0x58(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
movsd -0x60(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x53f0
movq -0x88(%rbp), %rdi
movl -0x7c(%rbp), %edx
movl -0x78(%rbp), %ecx
movl -0x74(%rbp), %r8d
leaq 0x11754e(%rip), %rsi    # 0x1fbcb9
movb $0x1, %al
callq 0x5750
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xe4516
jmp 0xe4782
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xe4489
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)