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

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

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

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

	cj+=ey;ck+=ez;
	ijk=ci+nx*(cj+oy*ck);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r10
movq 0x48(%rsp), %r15
movq 0x40(%rsp), %r14
movq 0x38(%rsp), %rbx
movsd (%r15), %xmm0
movsd 0x168(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
xorl %edx, %edx
ucomisd %xmm1, %xmm2
seta %dl
cvttsd2si %xmm1, %eax
movq 0x30(%rsp), %r11
subl %edx, %eax
movl %eax, (%r11)
setns %dl
movl 0x130(%rdi), %ebp
cmpl %ebp, %eax
setl %r12b
testb %r12b, %dl
je 0x33846
movl $0x0, (%rcx)
jmp 0x338a3
testl %eax, %eax
js 0x3384f
cltd
idivl %ebp
jmp 0x33856
incl %eax
cltd
idivl %ebp
decl %eax
movl %eax, (%rcx)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x28(%rdi), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, (%r15)
movsd (%r14), %xmm0
movsd 0x20(%rdi), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, (%r14)
movsd (%rbx), %xmm0
mulsd 0x18(%rdi), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
imull 0x130(%rdi), %eax
subl %eax, (%r11)
movsd (%r14), %xmm0
movsd 0x160(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
xorl %ecx, %ecx
ucomisd %xmm1, %xmm2
seta %cl
cvttsd2si %xmm1, %eax
subl %ecx, %eax
movl %eax, (%r9)
setns %dl
movl 0x12c(%rdi), %ecx
cmpl %ecx, %eax
setl %bpl
testb %bpl, %dl
je 0x338e7
movl $0x0, (%r10)
jmp 0x3392e
testl %eax, %eax
js 0x338f0
cltd
idivl %ecx
jmp 0x338f7
incl %eax
cltd
idivl %ecx
decl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movl %eax, (%r10)
movsd 0x10(%rdi), %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, (%r14)
movsd (%rbx), %xmm0
mulsd 0x8(%rdi), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
imull 0x12c(%rdi), %eax
subl %eax, (%r9)
movsd (%rbx), %xmm0
movsd 0x158(%rdi), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
xorl %edx, %edx
ucomisd %xmm1, %xmm2
seta %dl
cvttsd2si %xmm1, %eax
movq 0x50(%rsp), %rcx
subl %edx, %eax
movl %eax, (%r8)
setns %dl
movl 0x128(%rdi), %r10d
cmpl %r10d, %eax
setl %bpl
testb %bpl, %dl
je 0x33977
movl $0x0, (%rsi)
jmp 0x339a8
testl %eax, %eax
js 0x33981
cltd
idivl %r10d
jmp 0x33989
incl %eax
cltd
idivl %r10d
decl %eax
movl %eax, (%rsi)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd (%rdi), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
imull 0x128(%rdi), %eax
subl %eax, (%r8)
movl 0x180(%rdi), %eax
addl %eax, (%r9)
movl (%r11), %eax
addl 0x184(%rdi), %eax
movl %eax, (%r11)
imull 0x190(%rdi), %eax
addl (%r9), %eax
imull 0x128(%rdi), %eax
addl (%r8), %eax
movl %eax, (%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq