// File: /workspace/github_cpp_makefile_star2_O1/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 $0x88, %rsp
movsd %xmm2, 0x50(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd %xmm0, 0x48(%rsp)
movq %rdi, %r14
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)
movsd 0x83f7(%rip), %xmm4     # 0x37008
movapd %xmm4, %xmm3
divsd %xmm0, %xmm3
movsd %xmm3, 0x30(%rdi)
movapd %xmm4, %xmm3
divsd %xmm1, %xmm3
movsd %xmm3, 0x38(%rdi)
divsd %xmm2, %xmm4
movsd %xmm4, 0x40(%rdi)
movl $0x8000, %edi           # imm = 0x8000
callq 0x2030
movq %rax, 0x48(%r14)
movsd 0x9d96(%rip), %xmm0     # 0x389e0
movsd 0x48(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x48(%rsp)
movsd 0x40(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x40(%rsp)
movsd 0x50(%rsp), %xmm1
mulsd %xmm0, %xmm1
leaq 0x28(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0x10(%rsp), %rcx
movsd %xmm1, 0x50(%rsp)
movsd %xmm1, (%rcx)
xorl %ecx, %ecx
leaq 0xa818(%rip), %r8       # 0x394b0
movq %r14, 0x38(%rsp)
movl %ecx, 0x6c(%rsp)
movq $0x0, 0x30(%rsp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
xorl %ecx, %ecx
movl %ecx, 0x70(%rsp)
movq $0x0, 0x20(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, (%rsp)
xorl %edx, %edx
movq %rax, 0x78(%rsp)
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x8(%rsp)
movl (%r8), %r12d
leal 0x1(%r12), %eax
cmpl $0x3f, %eax
movq %r8, 0x80(%rsp)
movl %edx, 0x74(%rsp)
jg 0x2ef2f
movslq %eax, %r13
incq %r13
movl -0x4(%r8,%r13,4), %ebx
movl %ebx, %ebp
andl $0x7f, %ebp
movl %ebx, %r14d
shrl $0x7, %r14d
andl $0x7f, %r14d
leal -0x40(%r14), %r10d
movl %ebx, %r15d
shrl $0xe, %r15d
andl $0x7f, %r15d
leal -0x40(%r15), %r11d
btl $0x16, %ebx
movq %r10, 0x60(%rsp)
movq %r11, 0x58(%rsp)
jb 0x2ed4c
btl $0x15, %ebx
jb 0x2ed91
jmp 0x2edd4
leal -0x41(%rbp), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x38(%rsp), %r8
leaq 0x20(%rsp), %r9
pushq %r11
pushq %r10
pushq %rax
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x2f088
addq $0x30, %rsp
btl $0x15, %ebx
jb 0x2edd4
leal -0x3f(%rbp), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x38(%rsp), %r8
leaq 0x20(%rsp), %r9
pushq 0x60(%rsp)
pushq 0x70(%rsp)
pushq %rax
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x2f088
addq $0x30, %rsp
addl $-0x40, %ebp
btl $0x19, %ebx
jb 0x2ede8
btl $0x18, %ebx
jb 0x2ee2f
jmp 0x2ee71
leal -0x41(%r14), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x38(%rsp), %r8
leaq 0x20(%rsp), %r9
pushq 0x60(%rsp)
pushq %rax
pushq %rbp
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x2f088
addq $0x30, %rsp
btl $0x18, %ebx
jb 0x2ee71
addl $-0x3f, %r14d
subq $0x8, %rsp
movq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x38(%rsp), %r8
leaq 0x20(%rsp), %r9
pushq 0x60(%rsp)
pushq %r14
pushq %rbp
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x2f088
addq $0x30, %rsp
btl $0x1c, %ebx
jb 0x2ee87
btl $0x1b, %ebx
movq 0x38(%rsp), %r14
jb 0x2eed1
jmp 0x2ef11
leal -0x41(%r15), %eax
subq $0x8, %rsp
movq 0x40(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x38(%rsp), %r8
leaq 0x20(%rsp), %r9
pushq %rax
pushq 0x70(%rsp)
pushq %rbp
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x2f088
addq $0x30, %rsp
btl $0x1b, %ebx
jb 0x2ef11
addl $-0x3f, %r15d
subq $0x8, %rsp
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x38(%rsp), %r8
leaq 0x20(%rsp), %r9
pushq %r15
pushq 0x70(%rsp)
pushq %rbp
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x2f088
addq $0x30, %rsp
incl %r12d
movq %r13, %rax
incq %rax
cmpl $0x40, %r13d
movq %rax, %r13
movq 0x80(%rsp), %r8
jne 0x2ed09
testl %r12d, %r12d
movq 0x78(%rsp), %rax
leaq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
leaq 0x30(%rsp), %r15
leaq 0x18(%rsp), %r13
movq %r14, %rbp
jle 0x2efe9
movl %r12d, %ebx
incq %rbx
movsd 0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rax,%rbx,8)
movl -0x4(%r8,%rbx,4), %r11d
movl %r11d, %r10d
andl $0x7f, %r10d
addl $-0x40, %r10d
movl %r11d, %r14d
shrl $0x7, %r14d
andl $0x7f, %r14d
addl $-0x40, %r14d
shrl $0xe, %r11d
andl $0x7f, %r11d
addl $-0x40, %r11d
subq $0x8, %rsp
movq %rbp, %rdi
movq %rsi, %r12
movq %r15, %r8
movq %r13, %r9
pushq %r11
pushq %r14
pushq %r10
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x2f088
movq 0xa8(%rsp), %rax
leaq 0x30(%rsp), %rcx
leaq 0x50(%rsp), %rdx
movq %r12, %rsi
movq 0xb0(%rsp), %r8
addq $0x30, %rsp
decq %rbx
cmpq $0x1, %rbx
jg 0x2ef5d
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x100, %r8             # imm = 0x100
addq $0x200, %rax            # imm = 0x200
movsd (%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
addsd 0x48(%rsp), %xmm0
movsd %xmm0, (%rsp)
movl 0x74(%rsp), %edx
incl %edx
cmpl $0x4, %edx
movq %rbp, %r14
jne 0x2ecd2
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
addsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0x70(%rsp), %ecx
incl %ecx
cmpl $0x4, %ecx
jne 0x2ecb8
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x6c(%rsp), %ecx
incl %ecx
cmpl $0x4, %ecx
jne 0x2ec9d
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq