// File: Luthaf[P]zeopp/v_network.cc
// Function: voronoi_network::voronoi_network<voro::container_periodic>(voro::container_periodic&, double)
voronoi_network::voronoi_network(c_class &c,double net_tol_) :
	bx(c.bx), bxy(c.bxy), by(c.by), bxz(c.bxz), byz(c.byz), bz(c.bz),
	nx(c.nx), ny(c.ny), nz(c.nz), nxyz(nx*ny*nz),
	xsp(nx/bx), ysp(ny/by), zsp(nz/bz), net_tol(net_tol_) {
	int l;

	// Allocate memory for vertex structure
	pts=new double*[nxyz];
	idmem=new int*[nxyz];
	ptsc=new int[nxyz];
	ptsmem=new int[nxyz];
	for(l=0;l<nxyz;l++) {
		pts[l]=new double[4*init_network_vertex_memory];
		idmem[l]=new int[init_network_vertex_memory];
		ptsc[l]=0;ptsmem[l]=init_network_vertex_memory;
	}

	// Allocate memory for network edges and related statistics 
	edc=0;edmem=init_network_vertex_memory*nxyz;
	ed=new int*[edmem];
	ne=new int*[edmem];
	pered=new unsigned int*[edmem];
	raded=new block*[edmem];
	nu=new int[edmem];
	nec=new int[edmem];
	numem=new int[edmem];

	// Allocate memory for back pointers
	reg=new int[edmem];
	regp=new int[edmem];

	// Allocate edge memory
	for(l=0;l<edmem;l++) {
		ed[l]=new int[2*init_network_edge_memory];
		ne[l]=ed[l]+init_network_edge_memory;
	}
	for(l=0;l<edmem;l++) raded[l]=new block[init_network_edge_memory];
	for(l=0;l<edmem;l++) pered[l]=new unsigned int[init_network_edge_memory];
	for(l=0;l<edmem;l++) {nu[l]=nec[l]=0;numem[l]=init_network_edge_memory;}

	// vertices
	vmap=new int[4*init_vertices];
	map_mem=init_vertices;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rcx
movsd 0x8(%rcx), %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rcx
movsd 0x10(%rcx), %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rcx
movsd 0x18(%rcx), %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rcx
movsd 0x20(%rcx), %xmm0
movsd %xmm0, 0x20(%rax)
movq -0x10(%rbp), %rcx
movsd 0x28(%rcx), %xmm0
movsd %xmm0, 0x28(%rax)
movq -0x10(%rbp), %rcx
movl 0x128(%rcx), %ecx
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movl 0x12c(%rcx), %ecx
movl %ecx, 0x34(%rax)
movq -0x10(%rbp), %rcx
movl 0x130(%rcx), %ecx
movl %ecx, 0x38(%rax)
movl 0x30(%rax), %ecx
imull 0x34(%rax), %ecx
imull 0x38(%rax), %ecx
movl %ecx, 0x3c(%rax)
cvtsi2sdl 0x30(%rax), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, 0x40(%rax)
cvtsi2sdl 0x34(%rax), %xmm0
divsd 0x10(%rax), %xmm0
movsd %xmm0, 0x48(%rax)
cvtsi2sdl 0x38(%rax), %xmm0
divsd 0x28(%rax), %xmm0
movsd %xmm0, 0x50(%rax)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x58(%rax)
movslq 0x3c(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x60(%rax)
movslq 0x3c(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x68(%rax)
movslq 0x3c(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x70(%rax)
movslq 0x3c(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x3c(%rcx), %eax
jge 0xe5600
movl $0x800, %edi            # imm = 0x800
callq 0x5030
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x100, %edi            # imm = 0x100
callq 0x5030
movq %rax, %rsi
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x70(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
movq 0x78(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl $0x40, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe5591
movq -0x28(%rbp), %rax
movl $0x0, 0xa0(%rax)
movl 0x3c(%rax), %ecx
shll $0x6, %ecx
movl %ecx, 0xa4(%rax)
movslq 0xa4(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x80(%rax)
movslq 0xa4(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x88(%rax)
movslq 0xa4(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x98(%rax)
movslq 0xa4(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x90(%rax)
movslq 0xa4(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xa8(%rax)
movslq 0xa4(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xb0(%rax)
movslq 0xa4(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xb8(%rax)
movslq 0xa4(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xc0(%rax)
movslq 0xa4(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xc8(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0xa4(%rcx), %eax
jge 0xe5863
movl $0x20, %edi
callq 0x5030
movq %rax, %rsi
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x80(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rdx
addq $0x10, %rdx
movq 0x88(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe5807
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0xa4(%rcx), %eax
jge 0xe58a4
movl $0x40, %edi
callq 0x5030
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe586a
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0xa4(%rcx), %eax
jge 0xe58e5
movl $0x10, %edi
callq 0x5030
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq 0x98(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe58ab
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0xa4(%rcx), %eax
jge 0xe5940
movq -0x28(%rbp), %rax
movq 0xb0(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
movq 0xa8(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movl $0x0, (%rcx,%rdx,4)
movq 0xb8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl $0x4, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe58ec
movl $0x1000, %edi           # imm = 0x1000
callq 0x5030
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xd0(%rax)
movl $0x100, 0xd8(%rax)      # imm = 0x100
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)