// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, 0xc(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
movl 0xa0(%rdi), %edx
leaq 0xd4a9b(%rip), %rsi     # 0x15504e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x45f0
cmpl $0x0, 0xa0(%r15)
jle 0x8069b
leaq 0xdddb8(%rip), %r12     # 0x15e38a
leaq 0xd3045(%rip), %r13     # 0x15361e
xorl %ebp, %ebp
movq 0x60(%r15), %rax
movq 0xc0(%r15), %rcx
movslq (%rcx,%rbp,4), %rcx
movq (%rax,%rcx,8), %rax
movq 0xc8(%r15), %rcx
movslq (%rcx,%rbp,4), %rcx
leaq (,%rcx,4), %rdx
shlq $0x5, %rcx
movsd (%rax,%rcx), %xmm0
leal 0x1(%rdx), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
leal 0x2(%rdx), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
orl $0x3, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm3
movq %rbx, %rdi
leaq 0xd4a2b(%rip), %rsi     # 0x155060
movl %ebp, %edx
movb $0x4, %al
callq 0x45f0
movq 0xb0(%r15), %rax
cmpl $0x0, (%rax,%rbp,4)
jle 0x8067d
xorl %r14d, %r14d
movq 0x88(%r15), %rax
movq (%rax,%rbp,8), %rax
movl (%rax,%r14,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x45f0
incq %r14
movq 0xb0(%r15), %rax
movslq (%rax,%rbp,4), %rax
cmpq %rax, %r14
jl 0x8064e
movq %r13, %rdi
movq %rbx, %rsi
callq 0x44b0
incq %rbp
movslq 0xa0(%r15), %rax
cmpq %rax, %rbp
jl 0x805db
leaq 0xd49cd(%rip), %rdi     # 0x15506f
movq %rbx, %rsi
callq 0x44b0
movl 0xa0(%r15), %ecx
testl %ecx, %ecx
jle 0x80907
movq 0xa8(%r15), %rax
xorl %r8d, %r8d
movq %rbx, 0x10(%rsp)
cmpl $0x0, (%rax,%r8,4)
jle 0x808f8
movq 0x60(%r15), %rcx
movq 0xc0(%r15), %rdx
movslq (%rdx,%r8,4), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0xc8(%r15), %rdx
movslq (%rdx,%r8,4), %rdx
leaq (,%rdx,4), %rsi
shlq $0x5, %rdx
movsd (%rcx,%rdx), %xmm0
movsd %xmm0, 0x30(%rsp)
leal 0x1(%rsi), %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x28(%rsp)
orl $0x2, %esi
movslq %esi, %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movl $0x8, %ecx
movq %rcx, 0x18(%rsp)
xorl %r12d, %r12d
movq %r8, (%rsp)
movq 0x80(%r15), %rcx
movq 0x98(%r15), %rdx
movq (%rdx,%r8,8), %rdx
movl (%rdx,%r12,4), %ebp
movl %ebp, %ebx
shrl $0x10, %ebx
addl $-0x7f, %ebx
movl %ebp, %r13d
shrl $0x8, %r13d
movl $0xff, %edx
andl %edx, %r13d
addl $-0x7f, %r13d
andl %edx, %ebp
addl $-0x7f, %ebp
movq (%rcx,%r8,8), %rcx
movslq (%rcx,%r12,4), %rcx
cmpb $0x0, 0xc(%rsp)
je 0x80796
cmpq %rcx, %r8
jle 0x80796
testl %ebx, %ebx
jne 0x80796
testl %r13d, %r13d
jne 0x80796
testl %ebp, %ebp
je 0x808db
movq 0x10(%rsp), %rdi
movq %r15, %r14
movq %rdi, %r15
leaq 0xd48d5(%rip), %rsi     # 0x15507d
movl %r8d, %edx
xorl %eax, %eax
callq 0x45f0
movq 0x90(%r14), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rsp), %rcx
movsd -0x8(%rax,%rcx), %xmm1
movsd (%rax,%rcx), %xmm0
movq %r15, %rdi
movq %r14, %r15
leaq 0xd488a(%rip), %rsi     # 0x155068
movb $0x2, %al
callq 0x45f0
movq 0xc0(%r14), %rax
movq 0x60(%r14), %rcx
movq 0x80(%r14), %rdx
movq (%rsp), %rsi
movq (%rdx,%rsi,8), %rdx
movslq (%rdx,%r12,4), %rdx
movslq (%rax,%rdx,4), %rax
movq (%rcx,%rax,8), %rax
movq 0xc8(%r14), %rcx
movslq (%rcx,%rdx,4), %rdx
leaq (,%rdx,4), %rcx
shlq $0x5, %rdx
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
mulsd (%r14), %xmm1
addsd (%rax,%rdx), %xmm1
cvtsi2sd %r13d, %xmm2
movsd 0x8(%r14), %xmm3
mulsd %xmm2, %xmm3
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
addsd %xmm1, %xmm3
movsd 0x18(%r14), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm3, %xmm1
subsd 0x30(%rsp), %xmm1
leal 0x1(%rcx), %edx
mulsd 0x10(%r14), %xmm2
movslq %edx, %rdx
addsd (%rax,%rdx,8), %xmm2
movsd 0x20(%r14), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
orl $0x2, %ecx
movslq %ecx, %rcx
mulsd 0x28(%r14), %xmm0
addsd (%rax,%rcx,8), %xmm0
subsd 0x28(%rsp), %xmm3
subsd 0x20(%rsp), %xmm0
mulsd %xmm3, %xmm3
mulsd %xmm1, %xmm1
addsd %xmm3, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movq 0x10(%rsp), %rdi
leaq 0xd47c5(%rip), %rsi     # 0x155086
movl %ebx, %edx
movl %r13d, %ecx
movl %ebp, %r8d
movb $0x1, %al
callq 0x45f0
movq (%rsp), %r8
movq 0xa8(%r14), %rax
incq %r12
movslq (%rax,%r8,4), %rcx
addq $0x10, 0x18(%rsp)
cmpq %rcx, %r12
jl 0x8073b
movl 0xa0(%r15), %ecx
incq %r8
movslq %ecx, %rdx
cmpq %rdx, %r8
jl 0x806c8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq