// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %r13d
movsd %xmm5, 0x10(%rsp)
movsd %xmm2, 0x20(%rsp)
movsd %xmm0, (%rsp)
movq %rdi, %rbx
callq 0x3c03c
cvtsi2sd %r13d, %xmm1
leaq 0xe0(%rbx), %rdi
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
cvtsi2sd %r12d, %xmm2
movsd 0x20(%rsp), %xmm1
divsd %xmm2, %xmm1
cvtsi2sd %r15d, %xmm3
movsd 0x10(%rsp), %xmm2
divsd %xmm3, %xmm2
movq %rdi, (%rsp)
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x38a50
movupd 0xd0(%rbx), %xmm0
movupd 0x118(%rbx), %xmm1
mulpd %xmm0, %xmm1
addpd 0xc003(%rip), %xmm1     # 0x45080
cvttpd2dq %xmm1, %xmm2
movq 0xe4(%rbx), %xmm0
movapd %xmm2, %xmm1
paddd %xmm2, %xmm1
paddd %xmm0, %xmm1
movdqa %xmm0, %xmm3
paddd %xmm2, %xmm3
movaps %xmm2, 0x10(%rsp)
movdqa %xmm2, %xmm0
movdqa %xmm3, 0x20(%rsp)
punpcklqdq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0]
movdqu %xmm0, 0x130(%rbx)
movq %xmm1, 0x140(%rbx)
movl 0xe0(%rbx), %r12d
movd %xmm1, %eax
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
movd %xmm0, %ecx
imull %r12d, %eax
imull %ecx, %eax
movl %eax, 0x148(%rbx)
cltq
leaq (,%rax,8), %r15
movq %rax, %rbp
testl %eax, %eax
pushq $-0x1
popq %rax
cmovsq %rax, %r15
movq %r15, %rdi
callq 0x7030
movq %rax, 0x150(%rbx)
movq %r15, %rdi
callq 0x7030
movq %rbp, %rcx
leaq (,%rbp,4), %r13
testl %ecx, %ecx
movq %rax, 0x158(%rbx)
pushq $-0x1
popq %rax
cmovsq %rax, %r13
movq %r13, %rdi
callq 0x7030
movq %rax, %r15
movq %rax, 0x160(%rbx)
movq %r13, %rdi
callq 0x7030
movq %rax, %r13
movq %rax, 0x168(%rbx)
movq %rbp, %rdi
callq 0x7030
movq %rax, 0x170(%rbx)
movl %r14d, 0x178(%rbx)
movl 0xc(%rsp), %ecx
movl %ecx, 0x17c(%rbx)
leaq (%r15,%rbp,4), %rcx
movq %rbx, %r8
cmpq %rcx, %r15
jae 0x39183
andl $0x0, (%r15)
addq $0x4, %r15
jmp 0x39174
leaq (,%rbp,4), %rcx
addq %r13, %rcx
cmpq %rcx, %r13
jae 0x3919e
andl $0x0, (%r13)
addq $0x4, %r13
jmp 0x3918e
movq %rax, %rsi
addq %rbp, %rsi
movdqa 0x20(%rsp), %xmm0
movd %xmm0, %ecx
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %edx
pshufd $0x55, 0x10(%rsp), %xmm0 # xmm0 = mem[1,1,1,1]
movd %xmm0, %edi
cmpq %rsi, %rax
jae 0x391cf
movb $0x0, (%rax)
incq %rax
jmp 0x391c2
pushq $-0x1
popq %r15
cmpl %edx, %edi
jge 0x392ab
movl 0x130(%r8), %edx
movl %edi, 0x10(%rsp)
cmpl %ecx, %edx
jge 0x3929d
xorl %r9d, %r9d
cmpl %r12d, %r9d
jge 0x3928f
movq 0x168(%r8), %rax
movl 0x140(%r8), %ecx
imull %edi, %ecx
movl %edx, %ebx
addl %edx, %ecx
imull %ecx, %r12d
movslq %r12d, %r12
movq %r9, %r13
addq %r9, %r12
movl %r14d, (%rax,%r12,4)
movslq 0x178(%r8), %rbp
leaq (,%rbp,4), %rdi
testq %rbp, %rbp
cmovsq %r15, %rdi
movq %r8, %r14
callq 0x7030
movq 0x150(%r14), %rcx
movq %rax, (%rcx,%r12,8)
movslq 0x17c(%r14), %rax
imulq %rbp, %rax
movq %rax, %rdi
shlq $0x3, %rdi
testl %eax, %eax
cmovsq %r15, %rdi
callq 0x7030
movq 0x158(%r14), %rcx
movq %rax, (%rcx,%r12,8)
movl 0xe0(%r14), %r12d
movq %r13, %r9
incq %r9
movl 0x10(%rsp), %edi
movl %ebx, %edx
movq %r14, %r8
movq %rbp, %r14
jmp 0x391f1
incl %edx
movl 0x138(%r8), %ecx
jmp 0x391e6
incl %edi
movl 0x13c(%r8), %edx
jmp 0x391d3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x392d0
jmp 0x392c4
movq %r14, %rbx
movq %rax, %r14
movq (%rsp), %rdi
callq 0x223ae
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x16e1a
movq %r14, %rdi
callq 0x76c0