// File: /workspace/github_cpp_makefile_star2_O3/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), %r10
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, %r11d
subl %eax, %r11d
setns %al
movl 0x130(%rdi), %ebp
cmpl %ebp, %r11d
setl %dl
testb %dl, %al
je 0x3140b
movl $0x0, (%r10)
jmp 0x3146d
testl %r11d, %r11d
js 0x31418
movl %r11d, %eax
cltd
idivl %ebp
jmp 0x31421
leal 0x1(%r11), %eax
cltd
idivl %ebp
decl %eax
movl %eax, (%r10)
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, %r11d
movsd (%rcx), %xmm0
movsd 0x160(%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 0x12c(%rdi), %r8d
cmpl %r8d, %r10d
setl %dl
testb %dl, %al
je 0x314b3
movl $0x0, (%r14)
movsd (%rbx), %xmm0
jmp 0x31501
testl %r10d, %r10d
js 0x314c1
movl %r10d, %eax
cltd
idivl %r8d
jmp 0x314cb
leal 0x1(%r10), %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, %r10d
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 0x31541
movl $0x0, (%r9)
movl (%rsi), %ecx
jmp 0x31574
testl %eax, %eax
js 0x3154a
cltd
idivl %ecx
jmp 0x31551
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
movl (%rsi), %ecx
subl %eax, %ecx
movl %ecx, (%rsi)
addl 0x180(%rdi), %r10d
addl 0x184(%rdi), %r11d
imull 0x190(%rdi), %r11d
addl %r10d, %r11d
imull 0x128(%rdi), %r11d
addl %ecx, %r11d
movl %r11d, (%rsi)
movslq %r11d, %rax
movq 0x1b0(%rdi), %rcx
movq 0x1b8(%rdi), %rdx
movl (%rcx,%rax,4), %ecx
cmpl (%rdx,%rax,4), %ecx
jne 0x315c0
movl %r11d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x31900
popq %rbx
popq %r14
popq %rbp
retq
nop