// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/voro++/src/v_base.cc
// Function: voro::voro_base::voro_base(int, int, int, double, double, double)
voro_base::voro_base(int nx_,int ny_,int nz_,double boxx_,double boxy_,double boxz_) :
	nx(nx_), ny(ny_), nz(nz_), nxy(nx_*ny_), nxyz(nxy*nz_), boxx(boxx_), boxy(boxy_), boxz(boxz_),
	xsp(1/boxx_), ysp(1/boxy_), zsp(1/boxz_), mrad(new double[wl_hgridcu*wl_seq_length]) {
	const unsigned int b1=1<<21,b2=1<<22,b3=1<<24,b4=1<<25,b5=1<<27,b6=1<<28;
	const double xstep=boxx/wl_fgrid,ystep=boxy/wl_fgrid,zstep=boxz/wl_fgrid;
	int i,j,k,lx,ly,lz,q;
	unsigned int f,*e=const_cast<unsigned int*> (wl);
	double xlo,ylo,zlo,xhi,yhi,zhi,minr,*radp=mrad;
	for(zlo=0,zhi=zstep,lz=0;lz<wl_hgrid;zlo=zhi,zhi+=zstep,lz++) {
		for(ylo=0,yhi=ystep,ly=0;ly<wl_hgrid;ylo=yhi,yhi+=ystep,ly++) {
			for(xlo=0,xhi=xstep,lx=0;lx<wl_hgrid;xlo=xhi,xhi+=xstep,lx++) {
				minr=large_number;
				for(q=e[0]+1;q<wl_seq_length;q++) {
					f=e[q];
					i=(f&127)-64;
					j=(f>>7&127)-64;
					k=(f>>14&127)-64;
					if((f&b2)==b2) {
						compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i-1,j,k);
						if((f&b1)==0) compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i+1,j,k);
					} else if((f&b1)==b1) compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i+1,j,k);
					if((f&b4)==b4) {
						compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i,j-1,k);
						if((f&b3)==0) compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i,j+1,k);
					} else if((f&b3)==b3) compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i,j+1,k);
					if((f&b6)==b6) {
						compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i,j,k-1);
						if((f&b5)==0) compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i,j,k+1);
					} else if((f&b5)==b5) compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i,j,k+1);
				}
				q--;
				while(q>0) {
					radp[q]=minr;
					f=e[q];
					i=(f&127)-64;
					j=(f>>7&127)-64;
					k=(f>>14&127)-64;
					compute_minimum(minr,xlo,xhi,ylo,yhi,zlo,zhi,i,j,k);
					q--;
				}
				*radp=minr;
				e+=wl_seq_length;
				radp+=wl_seq_length;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movsd %xmm2, 0x40(%rsp)
movapd %xmm1, 0x60(%rsp)
movapd %xmm0, 0x70(%rsp)
movq %rdi, %rbx
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
imull %esi, %edx
movl %edx, 0xc(%rdi)
imull %ecx, %edx
movl %edx, 0x10(%rdi)
movsd %xmm0, 0x18(%rdi)
movsd %xmm1, 0x20(%rdi)
movsd %xmm2, 0x28(%rdi)
movapd %xmm0, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
movapd 0x9253(%rip), %xmm1     # 0x314e0
divpd %xmm3, %xmm1
movupd %xmm1, 0x30(%rdi)
movsd 0x6d7a(%rip), %xmm0     # 0x2f018
divsd %xmm2, %xmm0
movsd %xmm0, 0x40(%rdi)
movl $0x8000, %edi           # imm = 0x8000
callq 0x2030
movq %rax, %r14
movq %rbx, 0x38(%rsp)
movq %rax, 0x48(%rbx)
movsd 0x875b(%rip), %xmm0     # 0x30a20
movapd 0x70(%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, 0x70(%rsp)
leaq 0x20(%rsp), %rax
andq $0x0, (%rax)
movapd 0x60(%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, 0x60(%rsp)
movsd 0x40(%rsp), %xmm1
mulsd %xmm0, %xmm1
movq %rsp, %rax
movsd %xmm1, 0x40(%rsp)
movsd %xmm1, (%rax)
leaq 0x91e4(%rip), %r15      # 0x314f0
xorl %eax, %eax
cmpl $0x4, %eax
je 0x286b4
andq $0x0, 0x28(%rsp)
movaps 0x60(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %ebp, %ebp
movl %eax, 0x54(%rsp)
cmpl $0x4, %ebp
je 0x28697
andq $0x0, 0x30(%rsp)
movapd 0x70(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r12d, %r12d
movl %ebp, 0x58(%rsp)
cmpl $0x4, %r12d
je 0x28678
movl %r12d, 0x5c(%rsp)
movq %r14, 0x88(%rsp)
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x18(%rsp)
movl (%r15), %eax
leal 0x1(%rax), %ecx
movslq %ecx, %rcx
movq %r15, 0x80(%rsp)
leaq (%r15,%rcx,4), %rcx
leal 0x1(%rax), %r12d
cmpl $0x40, %r12d
jge 0x285ae
movl (%rcx), %ebx
movl %ebx, %r13d
andl $0x7f, %r13d
movl %ebx, %r15d
shrl $0x7, %r15d
andl $0x7f, %r15d
leal -0x40(%r15), %r10d
movl %ebx, %r14d
shrl $0xe, %r14d
andl $0x7f, %r14d
leal -0x40(%r14), %ebp
btl $0x16, %ebx
movq %rcx, 0x90(%rsp)
movq %r10, 0x48(%rsp)
jb 0x283de
btl $0x15, %ebx
jb 0x28423
jmp 0x28464
leal -0x41(%r13), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %rbp
pushq %r10
pushq %rax
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x286c6
addq $0x30, %rsp
btl $0x15, %ebx
jb 0x28464
leal -0x3f(%r13), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %rbp
pushq 0x58(%rsp)
pushq %rax
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x286c6
addq $0x30, %rsp
addl $-0x40, %r13d
btl $0x19, %ebx
jb 0x28479
btl $0x18, %ebx
jb 0x284be
jmp 0x284fe
leal -0x41(%r15), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %rbp
pushq %rax
pushq %r13
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x286c6
addq $0x30, %rsp
btl $0x18, %ebx
jb 0x284fe
addl $-0x3f, %r15d
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %rbp
pushq %r15
pushq %r13
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x286c6
addq $0x30, %rsp
btl $0x1c, %ebx
jb 0x2850f
btl $0x1b, %ebx
jb 0x28557
jmp 0x2859a
leal -0x41(%r14), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %rax
pushq 0x58(%rsp)
pushq %r13
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x286c6
addq $0x30, %rsp
btl $0x1b, %ebx
jb 0x2859a
addl $-0x3f, %r14d
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %r14
pushq 0x58(%rsp)
pushq %r13
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x286c6
addq $0x30, %rsp
movq 0x90(%rsp), %rcx
addq $0x4, %rcx
movl %r12d, %eax
jmp 0x2838b
movl %eax, %ebx
movq 0x88(%rsp), %r14
movq 0x80(%rsp), %r15
movl 0x58(%rsp), %ebp
movl 0x5c(%rsp), %r12d
movsd 0x18(%rsp), %xmm0
testl %ebx, %ebx
jle 0x28641
movsd %xmm0, (%r14,%rbx,8)
movl (%r15,%rbx,4), %eax
movl %eax, %r10d
andl $0x7f, %r10d
addl $-0x40, %r10d
movl %eax, %r11d
shrl $0x7, %r11d
andl $0x7f, %r11d
addl $-0x40, %r11d
shrl $0xe, %eax
andl $0x7f, %eax
addl $-0x40, %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x10(%rsp), %r9
pushq %rax
pushq %r11
pushq %r10
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
callq 0x286c6
addq $0x30, %rsp
decq %rbx
jmp 0x285c9
movsd %xmm0, (%r14)
addq $0x100, %r15            # imm = 0x100
addq $0x200, %r14            # imm = 0x200
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
addsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
incl %r12d
movl 0x54(%rsp), %eax
jmp 0x28350
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
addsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
incl %ebp
jmp 0x2832e
movsd (%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
addsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rsp)
incl %eax
jmp 0x2830e
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq