// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
movsd %xmm2, 0x50(%rsp)
movapd %xmm1, 0x80(%rsp)
movapd %xmm0, 0x90(%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 0xa349(%rip), %xmm1     # 0x39530
divpd %xmm3, %xmm1
movupd %xmm1, 0x30(%rdi)
movsd 0x7e10(%rip), %xmm0     # 0x37008
divsd %xmm2, %xmm0
movsd %xmm0, 0x40(%rdi)
movl $0x8000, %edi           # imm = 0x8000
callq 0x2030
movq %rax, %rdi
movq %rax, 0x48(%rbx)
movsd 0x9836(%rip), %xmm0     # 0x38a50
movapd 0x90(%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, 0x90(%rsp)
movapd 0x80(%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, 0x80(%rsp)
movsd 0x50(%rsp), %xmm1
mulsd %xmm0, %xmm1
leaq 0x38(%rsp), %rax
movq $0x0, (%rax)
leaq 0x18(%rsp), %rax
movsd %xmm1, 0x50(%rsp)
movsd %xmm1, (%rax)
xorl %eax, %eax
leaq 0xa2cc(%rip), %rcx      # 0x39540
leaq 0x8(%rsp), %r13
leaq 0x30(%rsp), %rbp
leaq 0x10(%rsp), %r15
leaq 0x28(%rsp), %r14
movq %rbx, 0x40(%rsp)
movl %eax, 0x64(%rsp)
movq $0x0, 0x28(%rsp)
movaps 0x80(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
xorl %eax, %eax
movl %eax, 0x68(%rsp)
movq $0x0, 0x30(%rsp)
movapd 0x90(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %eax, %eax
movl %eax, 0x6c(%rsp)
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x8(%rsp)
movl (%rcx), %r12d
leal 0x1(%r12), %eax
cmpl $0x3f, %eax
movq %rcx, 0x78(%rsp)
movq %rdi, 0x70(%rsp)
jg 0x2f558
movslq %eax, %r13
incq %r13
movl -0x4(%rcx,%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, 0x58(%rsp)
movq %r11, 0x48(%rsp)
jb 0x2f33f
btl $0x15, %ebx
jb 0x2f384
jmp 0x2f3c7
leal -0x41(%rbp), %eax
subq $0x8, %rsp
movq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x28(%rsp), %r9
pushq %r11
pushq %r10
pushq %rax
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
callq 0x2f6aa
addq $0x30, %rsp
btl $0x15, %ebx
jb 0x2f3c7
leal -0x3f(%rbp), %eax
subq $0x8, %rsp
movq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x28(%rsp), %r9
pushq 0x50(%rsp)
pushq 0x68(%rsp)
pushq %rax
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
callq 0x2f6aa
addq $0x30, %rsp
addl $-0x40, %ebp
btl $0x19, %ebx
jb 0x2f3db
btl $0x18, %ebx
jb 0x2f422
jmp 0x2f464
leal -0x41(%r14), %eax
subq $0x8, %rsp
movq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x28(%rsp), %r9
pushq 0x50(%rsp)
pushq %rax
pushq %rbp
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
callq 0x2f6aa
addq $0x30, %rsp
btl $0x18, %ebx
jb 0x2f464
addl $-0x3f, %r14d
subq $0x8, %rsp
movq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x28(%rsp), %r9
pushq 0x50(%rsp)
pushq %r14
pushq %rbp
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
callq 0x2f6aa
addq $0x30, %rsp
btl $0x1c, %ebx
jb 0x2f47f
btl $0x1b, %ebx
movq 0x40(%rsp), %rbx
leaq 0x20(%rsp), %r14
jb 0x2f4d9
jmp 0x2f517
leal -0x41(%r15), %eax
subq $0x8, %rsp
movq %r12, 0x50(%rsp)
movq 0x48(%rsp), %r12
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x28(%rsp), %r14
movq %r14, %r9
pushq %rax
pushq 0x68(%rsp)
pushq %rbp
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
callq 0x2f6aa
addq $0x30, %rsp
btl $0x1b, %ebx
movq %r12, %rbx
movq 0x48(%rsp), %r12
jb 0x2f517
addl $-0x3f, %r15d
subq $0x8, %rsp
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %r14, %r9
pushq %r15
pushq 0x68(%rsp)
pushq %rbp
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
callq 0x2f6aa
addq $0x30, %rsp
movl %r13d, %eax
incq %r13
incl %r12d
cmpl $0x40, %eax
movq 0x78(%rsp), %rcx
jne 0x2f2fc
addq $-0x2, %r13
testq %r13, %r13
movq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x30(%rsp), %rbp
leaq 0x10(%rsp), %r15
leaq 0x28(%rsp), %r8
movq %rbx, %r9
jg 0x2f561
jmp 0x2f5fb
movq %r13, %rsi
movq %r14, %r8
movq %rbx, %r9
movl %r12d, %ebx
incq %rbx
movsd 0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rdi,%rbx,8)
movl -0x4(%rcx,%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 %r9, %r12
movq %r9, %rdi
movq %rbp, %rdx
movq %r15, %rcx
movq %r15, %r14
movq %rsi, %r15
movq %r8, %r13
leaq 0x28(%rsp), %r9
pushq %rax
pushq %r11
pushq %r10
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
callq 0x2f6aa
movq %r12, %r9
movq %r13, %r8
movq %r15, %rsi
movq %r14, %r15
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rcx
addq $0x30, %rsp
decq %rbx
cmpq $0x1, %rbx
ja 0x2f567
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rdi)
addq $0x100, %rcx            # imm = 0x100
addq $0x200, %rdi            # imm = 0x200
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
addsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x6c(%rsp), %eax
incl %eax
cmpl $0x4, %eax
movq %rsi, %r13
movq %r8, %r14
movq %r9, %rbx
jne 0x2f2c8
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
addsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movl 0x68(%rsp), %eax
incl %eax
cmpl $0x4, %eax
jne 0x2f2aa
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0x64(%rsp), %eax
incl %eax
cmpl $0x4, %eax
jne 0x2f28d
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop