// File: /workspace/github_cpp_makefile_star2_O1/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), %r11
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, %r10d
subl %eax, %r10d
setns %al
movl 0xe8(%rdi), %ebp
cmpl %ebp, %r10d
setl %dl
testb %dl, %al
je 0x43c37
movl $0x0, (%r11)
jmp 0x43c99
testl %r10d, %r10d
js 0x43c44
movl %r10d, %eax
cltd
idivl %ebp
jmp 0x43c4d
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 0xe8(%rdi), %eax
subl %eax, %r10d
movsd (%rcx), %xmm0
movsd 0x118(%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 0xe4(%rdi), %r8d
cmpl %r8d, %r11d
setl %dl
testb %dl, %al
je 0x43cdb
movl $0x0, (%r14)
jmp 0x43d29
testl %r11d, %r11d
js 0x43ce9
movl %r11d, %eax
cltd
idivl %r8d
jmp 0x43cf3
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 0xe4(%rdi), %eax
subl %eax, %r11d
movsd (%rbx), %xmm0
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 0x43d6b
movl $0x0, (%r9)
jmp 0x43d9a
testl %eax, %eax
js 0x43d74
cltd
idivl %ecx
jmp 0x43d7b
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 0xe0(%rdi), %eax
subl %eax, (%rsi)
addl 0x130(%rdi), %r11d
addl 0x134(%rdi), %r10d
imull 0x140(%rdi), %r10d
movslq 0xe0(%rdi), %rax
addl %r11d, %r10d
movslq %r10d, %rcx
imulq %rax, %rcx
movslq (%rsi), %rax
addq %rcx, %rax
movl %eax, (%rsi)
movq 0x160(%rdi), %rcx
movq 0x168(%rdi), %rdx
movl (%rcx,%rax,4), %ecx
cmpl (%rdx,%rax,4), %ecx
jne 0x43dea
movl %eax, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x440b4
popq %rbx
popq %r14
popq %rbp
retq
nop