// File: icemiliang[P]vot/src/vot/container_prd.cc
// Function: voro::container_periodic_base::container_periodic_base(double, double, double, double, double, double, int, int, int, int, int)
container_periodic_base::container_periodic_base(double bx_,double bxy_,double by_,
		double bxz_,double byz_,double bz_,int nx_,int ny_,int nz_,int init_mem_,int ps_)
	: unitcell(bx_,bxy_,by_,bxz_,byz_,bz_), voro_base(nx_,ny_,nz_,bx_/nx_,by_/ny_,bz_/nz_),
	ey(int(max_uv_y*ysp+1)), ez(int(max_uv_z*zsp+1)), wy(ny+ey), wz(nz+ez),
	oy(ny+2*ey), oz(nz+2*ez), oxyz(nx*oy*oz), id(new int*[oxyz]), p(new double*[oxyz]),
	co(new int[oxyz]), mem(new int[oxyz]), img(new char[oxyz]), init_mem(init_mem_), ps(ps_) {
	int i,j,k,l;

	// Clear the global arrays
	int *pp=co;while(pp<co+oxyz) *(pp++)=0;
	pp=mem;while(pp<mem+oxyz) *(pp++)=0;
	char *cp=img;while(cp<img+oxyz) *(cp++)=0;

	// Set up memory for the blocks in the primary domain
	for(k=ez;k<wz;k++) for(j=ey;j<wy;j++) for(i=0;i<nx;i++) {
		l=i+nx*(j+oy*k);
		mem[l]=init_mem;
		id[l]=new int[init_mem];
		p[l]=new double[ps*init_mem];
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movsd %xmm3, -0x28(%rbp)
movsd %xmm4, -0x30(%rbp)
movsd %xmm5, -0x38(%rbp)
movl %esi, -0x3c(%rbp)
movl %edx, -0x40(%rbp)
movl %ecx, -0x44(%rbp)
movl %r8d, -0x48(%rbp)
movl %r9d, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd -0x20(%rbp), %xmm2
movsd -0x28(%rbp), %xmm3
movsd -0x30(%rbp), %xmm4
movsd -0x38(%rbp), %xmm5
callq 0x8a140
movq -0x88(%rbp), %rdi
addq $0xe0, %rdi
movl -0x3c(%rbp), %esi
movl -0x40(%rbp), %edx
movl -0x44(%rbp), %ecx
movsd -0x10(%rbp), %xmm0
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
movsd -0x20(%rbp), %xmm1
cvtsi2sd %edx, %xmm2
divsd %xmm2, %xmm1
movsd -0x38(%rbp), %xmm2
cvtsi2sd %ecx, %xmm3
divsd %xmm3, %xmm2
callq 0x84680
jmp 0x852c1
movq -0x88(%rbp), %rax
movsd 0xd0(%rax), %xmm0
movsd 0x118(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd 0x8ad4(%rip), %xmm1     # 0x8ddb8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x130(%rax)
movsd 0xd8(%rax), %xmm0
movsd 0x120(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x134(%rax)
movl 0xe4(%rax), %ecx
movl 0x130(%rax), %edx
addl %edx, %ecx
movl %ecx, 0x138(%rax)
movl 0xe8(%rax), %ecx
movl 0x134(%rax), %edx
addl %edx, %ecx
movl %ecx, 0x13c(%rax)
movl 0xe4(%rax), %esi
movl 0x130(%rax), %ecx
movl %ecx, %edx
movl %esi, %ecx
leal (%rcx,%rdx,2), %ecx
movl %ecx, 0x140(%rax)
movl 0xe8(%rax), %esi
movl 0x134(%rax), %ecx
movl %ecx, %edx
movl %esi, %ecx
leal (%rcx,%rdx,2), %ecx
movl %ecx, 0x144(%rax)
movl 0xe0(%rax), %ecx
movl 0x140(%rax), %edx
imull %edx, %ecx
movl 0x144(%rax), %edx
imull %edx, %ecx
movl %ecx, 0x148(%rax)
movq %rax, %rcx
addq $0x150, %rcx            # imm = 0x150
movq %rcx, -0x98(%rbp)
movslq 0x148(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xa030
movq %rax, -0x90(%rbp)
jmp 0x853c8
movq -0x88(%rbp), %rax
movq -0x98(%rbp), %rcx
movq -0x90(%rbp), %rdx
movq %rdx, (%rcx)
movq %rax, %rcx
addq $0x158, %rcx            # imm = 0x158
movq %rcx, -0xa8(%rbp)
movslq 0x148(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xa030
movq %rax, -0xa0(%rbp)
jmp 0x8541c
movq -0x88(%rbp), %rax
movq -0xa8(%rbp), %rcx
movq -0xa0(%rbp), %rdx
movq %rdx, (%rcx)
movq %rax, %rcx
addq $0x160, %rcx            # imm = 0x160
movq %rcx, -0xb8(%rbp)
movslq 0x148(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xa030
movq %rax, -0xb0(%rbp)
jmp 0x85470
movq -0x88(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq -0xb0(%rbp), %rdx
movq %rdx, (%rcx)
movq %rax, %rcx
addq $0x168, %rcx            # imm = 0x168
movq %rcx, -0xc8(%rbp)
movslq 0x148(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xa030
movq %rax, -0xc0(%rbp)
jmp 0x854c4
movq -0x88(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq -0xc0(%rbp), %rdx
movq %rdx, (%rcx)
movq %rax, %rcx
addq $0x170, %rcx            # imm = 0x170
movq %rcx, -0xd8(%rbp)
movslq 0x148(%rax), %rdi
callq 0xa030
movq %rax, -0xd0(%rbp)
jmp 0x85502
movq -0x88(%rbp), %rax
movq -0xd8(%rbp), %rcx
movq -0xd0(%rbp), %rdx
movq %rdx, (%rcx)
movl -0x48(%rbp), %ecx
movl %ecx, 0x178(%rax)
movl -0x4c(%rbp), %ecx
movl %ecx, 0x17c(%rax)
movq 0x160(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x88(%rbp), %rdx
movq -0x78(%rbp), %rax
movq 0x160(%rdx), %rcx
movslq 0x148(%rdx), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x855a8
movq -0x78(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x78(%rbp)
movl $0x0, (%rax)
jmp 0x85537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x857b6
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
addq $0xe0, %rdi
callq 0x58720
jmp 0x857b6
movq -0x88(%rbp), %rax
movq 0x168(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x88(%rbp), %rdx
movq -0x78(%rbp), %rax
movq 0x168(%rdx), %rcx
movslq 0x148(%rdx), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x855f6
movq -0x78(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x78(%rbp)
movl $0x0, (%rax)
jmp 0x855ba
movq -0x88(%rbp), %rax
movq 0x170(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rdx
movq -0x80(%rbp), %rax
movq 0x170(%rdx), %rcx
movslq 0x148(%rdx), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x8563d
movq -0x80(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x80(%rbp)
movb $0x0, (%rax)
jmp 0x85608
movq -0x88(%rbp), %rax
movl 0x134(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x88(%rbp), %rcx
movl -0x68(%rbp), %eax
cmpl 0x13c(%rcx), %eax
jge 0x857ad
movq -0x88(%rbp), %rax
movl 0x130(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x88(%rbp), %rcx
movl -0x64(%rbp), %eax
cmpl 0x138(%rcx), %eax
jge 0x8579d
movl $0x0, -0x60(%rbp)
movq -0x88(%rbp), %rcx
movl -0x60(%rbp), %eax
cmpl 0xe0(%rcx), %eax
jge 0x8578d
movq -0x88(%rbp), %rax
movl -0x60(%rbp), %ecx
movl -0x64(%rbp), %esi
movl 0xe0(%rax), %edx
movl 0x140(%rax), %edi
movl -0x68(%rbp), %r8d
imull %r8d, %edi
addl %edi, %esi
imull %esi, %edx
addl %edx, %ecx
movl %ecx, -0x6c(%rbp)
movl 0x178(%rax), %esi
movq 0x168(%rax), %rcx
movslq -0x6c(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movslq 0x178(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xa030
movq %rax, -0xe0(%rbp)
jmp 0x85710
movq -0x88(%rbp), %rax
movq -0xe0(%rbp), %rsi
movq 0x150(%rax), %rcx
movslq -0x6c(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movl 0x178(%rax), %ecx
movl 0x17c(%rax), %eax
imull %ecx, %eax
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xa030
movq %rax, -0xe8(%rbp)
jmp 0x85762
movq -0xe8(%rbp), %rdx
movq -0x88(%rbp), %rax
movq 0x158(%rax), %rax
movslq -0x6c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x85690
jmp 0x8578f
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x85673
jmp 0x8579f
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x8564d
addq $0xf0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x892e0
movq -0x58(%rbp), %rdi
callq 0xa950
nopl (%rax,%rax)