// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/voro++/src/container_prd.cc
// Function: voro::container_periodic_base::put_locate_block(int&, double&, double&, double&, int&, int&, int&)
void container_periodic_base::put_locate_block(int &ijk,double &x,double &y,double &z,int &ai,int &aj,int &ak) {

	// Remap particle in the z direction if necessary
	int k=step_int(z*zsp);
	if(k<0||k>=nz) {
		ak=step_div(k,nz);
		z-=ak*bz;y-=ak*byz;x-=ak*bxz;k-=ak*nz;
	} else ak=0;

	// Remap particle in the y direction if necessary
	int j=step_int(y*ysp);
	if(j<0||j>=ny) {
		aj=step_div(j,ny);
		y-=aj*by;x-=aj*bxy;j-=aj*ny;
	} else aj=0;

	// Remap particle in the x direction if necessary
	ijk=step_int(x*xsp);
	if(ijk<0||ijk>=nx) {
		ai=step_div(ijk,nx);
		x-=ai*bx;ijk-=ai*nx;
	} else ai=0;

	// Compute the block index and check memory allocation
	j+=ey;k+=ez;
	ijk+=nx*(j+oy*k);
	if(co[ijk]==mem[ijk]) add_particle_memory(ijk);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq 0x28(%rsp), %r11
movq 0x20(%rsp), %r14
movsd (%r8), %xmm0
movsd 0x168(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
xorl %eax, %eax
ucomisd %xmm1, %xmm2
seta %al
cvttsd2si %xmm1, %r10d
subl %eax, %r10d
setns %al
movl 0x130(%rdi), %ebp
cmpl %ebp, %r10d
setl %dl
testb %dl, %al
je 0x30f61
movl $0x0, (%r11)
jmp 0x30fc3
testl %r10d, %r10d
js 0x30f6e
movl %r10d, %eax
cltd
idivl %ebp
jmp 0x30f77
leal 0x1(%r10), %eax
cltd
idivl %ebp
decl %eax
movl %eax, (%r11)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x28(%rdi), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, (%r8)
movsd (%rcx), %xmm0
movsd 0x20(%rdi), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, (%rcx)
movsd (%rbx), %xmm0
mulsd 0x18(%rdi), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
imull 0x130(%rdi), %eax
subl %eax, %r10d
movsd (%rcx), %xmm0
movsd 0x160(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
xorl %eax, %eax
ucomisd %xmm1, %xmm2
seta %al
cvttsd2si %xmm1, %r11d
subl %eax, %r11d
setns %al
movl 0x12c(%rdi), %r8d
cmpl %r8d, %r11d
setl %dl
testb %dl, %al
je 0x31005
movl $0x0, (%r14)
jmp 0x31053
testl %r11d, %r11d
js 0x31013
movl %r11d, %eax
cltd
idivl %r8d
jmp 0x3101d
leal 0x1(%r11), %eax
cltd
idivl %r8d
decl %eax
movl %eax, (%r14)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x10(%rdi), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, (%rcx)
movsd (%rbx), %xmm0
mulsd 0x8(%rdi), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
imull 0x12c(%rdi), %eax
subl %eax, %r11d
movsd (%rbx), %xmm0
movsd 0x158(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
xorl %ecx, %ecx
ucomisd %xmm1, %xmm2
seta %cl
cvttsd2si %xmm1, %eax
subl %ecx, %eax
movl %eax, (%rsi)
setns %dl
movl 0x128(%rdi), %ecx
cmpl %ecx, %eax
setl %r8b
testb %r8b, %dl
je 0x31095
movl $0x0, (%r9)
jmp 0x310c4
testl %eax, %eax
js 0x3109e
cltd
idivl %ecx
jmp 0x310a5
incl %eax
cltd
idivl %ecx
decl %eax
movl %eax, (%r9)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd (%rdi), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
imull 0x128(%rdi), %eax
subl %eax, (%rsi)
addl 0x180(%rdi), %r11d
addl 0x184(%rdi), %r10d
imull 0x190(%rdi), %r10d
movslq 0x128(%rdi), %rax
addl %r11d, %r10d
movslq %r10d, %rcx
imulq %rax, %rcx
movslq (%rsi), %rax
addq %rcx, %rax
movl %eax, (%rsi)
movq 0x1b0(%rdi), %rcx
movq 0x1b8(%rdi), %rdx
movl (%rcx,%rax,4), %ecx
cmpl (%rdx,%rax,4), %ecx
jne 0x31114
movl %eax, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3144a
popq %rbx
popq %r14
popq %rbp
retq
nop