// File: /workspace/github_cpp_makefile_star2_O2/icemiliang[P]vot/src/vot/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 0x120(%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 0xe8(%rdi), %ebp
cmpl %ebp, %r11d
setl %dl
testb %dl, %al
je 0x398da
andl $0x0, (%r10)
jmp 0x39939
testl %r11d, %r11d
js 0x398e7
movl %r11d, %eax
cltd
idivl %ebp
jmp 0x398f0
leal 0x1(%r11), %eax
cltd
idivl %ebp
decl %eax
movl %eax, (%r10)
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 0xe8(%rdi), %eax
subl %eax, %r11d
movsd (%rcx), %xmm0
movsd 0x118(%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 0xe4(%rdi), %r8d
cmpl %r8d, %r10d
setl %dl
testb %dl, %al
je 0x3997c
andl $0x0, (%r14)
movsd (%rbx), %xmm0
jmp 0x399c7
testl %r10d, %r10d
js 0x3998a
movl %r10d, %eax
cltd
idivl %r8d
jmp 0x39994
leal 0x1(%r10), %eax
cltd
idivl %r8d
decl %eax
movl %eax, (%r14)
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 0xe4(%rdi), %eax
subl %eax, %r10d
movsd 0x110(%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 0xe0(%rdi), %ecx
cmpl %ecx, %eax
setl %r8b
testb %r8b, %dl
je 0x39a04
andl $0x0, (%r9)
movl (%rsi), %ecx
jmp 0x39a34
testl %eax, %eax
js 0x39a0d
cltd
idivl %ecx
jmp 0x39a14
incl %eax
cltd
idivl %ecx
decl %eax
movl %eax, (%r9)
cvtsi2sd %eax, %xmm1
mulsd (%rdi), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
imull 0xe0(%rdi), %eax
movl (%rsi), %ecx
subl %eax, %ecx
movl %ecx, (%rsi)
addl 0x130(%rdi), %r10d
addl 0x134(%rdi), %r11d
imull 0x140(%rdi), %r11d
addl %r10d, %r11d
imull 0xe0(%rdi), %r11d
addl %ecx, %r11d
movl %r11d, (%rsi)
movslq %r11d, %rax
movq 0x160(%rdi), %rcx
movq 0x168(%rdi), %rdx
movl (%rcx,%rax,4), %ecx
cmpl (%rdx,%rax,4), %ecx
jne 0x39a80
movl %r11d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x39d1e
popq %rbx
popq %r14
popq %rbp
retq
nop