// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsd (%rsi), %xmm1
movsd %xmm1, (%rdi)
movsd 0x8(%rsi), %xmm2
movsd %xmm2, 0x8(%rdi)
movsd 0x10(%rsi), %xmm2
movsd %xmm2, 0x10(%rdi)
movsd 0x18(%rsi), %xmm3
movsd %xmm3, 0x18(%rdi)
movsd 0x20(%rsi), %xmm3
movsd %xmm3, 0x20(%rdi)
movsd 0x28(%rsi), %xmm3
movsd %xmm3, 0x28(%rdi)
movl 0x128(%rsi), %eax
movl %eax, 0x30(%rdi)
movl 0x12c(%rsi), %ecx
movl %ecx, 0x34(%rdi)
movl 0x130(%rsi), %edx
movl %edx, 0x38(%rdi)
cvtsi2sd %ecx, %xmm4
imull %eax, %ecx
imull %edx, %ecx
cvtsi2sd %eax, %xmm5
movl %ecx, 0x3c(%rdi)
divsd %xmm1, %xmm5
movsd %xmm5, 0x40(%rdi)
divsd %xmm2, %xmm4
movsd %xmm4, 0x48(%rdi)
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
divsd %xmm3, %xmm1
movsd %xmm1, 0x50(%rdi)
movsd %xmm0, 0x58(%rdi)
movslq %ecx, %rax
leaq (,%rax,8), %r14
testl %eax, %eax
movq $-0x1, %r13
cmovsq %r13, %r14
leaq (,%rax,4), %r15
cmovsq %r13, %r15
movq %r14, %rdi
callq 0x4030
movq %rax, 0x60(%rbx)
movq %r14, %rdi
callq 0x4030
movq %rax, 0x68(%rbx)
movq %r15, %rdi
callq 0x4030
movq %rax, 0x70(%rbx)
movq %r15, %rdi
callq 0x4030
movq %rax, 0x78(%rbx)
movl 0x3c(%rbx), %r12d
testl %r12d, %r12d
jle 0x8249d
xorl %r14d, %r14d
movl $0x800, %edi            # imm = 0x800
callq 0x4030
movq 0x60(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movl $0x100, %edi            # imm = 0x100
callq 0x4030
movq 0x68(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq 0x70(%rbx), %rax
movl $0x0, (%rax,%r14,4)
movq 0x78(%rbx), %rax
movl $0x40, (%rax,%r14,4)
incq %r14
movslq 0x3c(%rbx), %r12
cmpq %r12, %r14
jl 0x82455
movl $0x0, 0xa0(%rbx)
movl %r12d, %ebp
shll $0x6, %ebp
movl %ebp, 0xa4(%rbx)
movslq %ebp, %r14
leaq (,%r14,8), %r15
shlq $0x2, %r14
testl %r12d, %r12d
cmovsq %r13, %r15
cmovsq %r13, %r14
movq %r15, %rdi
callq 0x4030
movq %rax, 0x80(%rbx)
movq %r15, %rdi
callq 0x4030
movq %rax, 0x88(%rbx)
movq %r15, %rdi
callq 0x4030
movq %rax, 0x98(%rbx)
movq %r15, %rdi
callq 0x4030
movq %rax, 0x90(%rbx)
movq %r14, %rdi
callq 0x4030
movq %rax, 0xa8(%rbx)
movq %r14, %rdi
callq 0x4030
movq %rax, 0xb0(%rbx)
movq %r14, %rdi
callq 0x4030
movq %rax, 0xb8(%rbx)
movq %r14, %rdi
callq 0x4030
movq %rax, 0xc0(%rbx)
movq %r14, %rdi
callq 0x4030
movq %rax, 0xc8(%rbx)
testl %r12d, %r12d
jle 0x825a0
cmpl $0x2, %ebp
movl $0x1, %r14d
cmovgel %ebp, %r14d
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x4030
movq 0x80(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x80(%rbx), %rax
movq 0x88(%rbx), %rcx
movq (%rax,%r15,8), %rax
addq $0x10, %rax
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x82569
testl %r12d, %r12d
jle 0x825d2
cmpl $0x2, %ebp
movl $0x1, %r14d
cmovgel %ebp, %r14d
xorl %r15d, %r15d
movl $0x40, %edi
callq 0x4030
movq 0x90(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x825b5
testl %r12d, %r12d
jle 0x82604
cmpl $0x2, %ebp
movl $0x1, %r14d
cmovgel %ebp, %r14d
xorl %r15d, %r15d
movl $0x10, %edi
callq 0x4030
movq 0x98(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x825e7
cmpl $0x0, 0xa4(%rbx)
jle 0x82642
movq 0xa8(%rbx), %rax
movq 0xb0(%rbx), %rcx
movq 0xb8(%rbx), %rdx
xorl %esi, %esi
xorl %edi, %edi
movl %esi, (%rcx,%rdi,4)
movl %esi, (%rax,%rdi,4)
movl $0x4, (%rdx,%rdi,4)
incq %rdi
movslq 0xa4(%rbx), %r8
cmpq %r8, %rdi
jl 0x82626
movl $0x1000, %edi           # imm = 0x1000
callq 0x4030
movq %rax, 0xd0(%rbx)
movl $0x100, 0xd8(%rbx)      # imm = 0x100
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq