// File: Luthaf[P]zeopp/voro++/src/container_prd.cc
// Function: voro::container_periodic_base::create_side_image(int, int, int)
void container_periodic_base::create_side_image(int di,int dj,int dk) {
	int l,dijk=di+nx*(dj+oy*dk),odijk,ima=step_div(dj-ey,ny);
	int qua=di+step_int(-ima*bxy*xsp),quadiv=step_div(qua,nx);
	int fi=qua-quadiv*nx,fijk=fi+nx*(dj-ima*ny+oy*dk);
	double dis=ima*bxy+quadiv*bx,switchx=di*boxx-ima*bxy-quadiv*bx,adis;

	// Left image computation
	if((img[dijk]&1)==0) {
		if(di>0) {
			odijk=dijk-1;adis=dis;
		} else {
			odijk=dijk+nx-1;adis=dis+bx;
		}
		img[odijk]|=2;
		for(l=0;l<co[fijk];l++) {
			if(p[fijk][ps*l]>switchx) put_image(dijk,fijk,l,dis,by*ima,0);
			else put_image(odijk,fijk,l,adis,by*ima,0);
		}
	}

	// Right image computation
	if((img[dijk]&2)==0) {
		if(fi==nx-1) {
			fijk+=1-nx;switchx+=(1-nx)*boxx;dis+=bx;
		} else {
			fijk++;switchx+=boxx;
		}
		if(di==nx-1) {
			odijk=dijk-nx+1;adis=dis-bx;
		} else {
			odijk=dijk+1;adis=dis;
		}
		img[odijk]|=1;
		for(l=0;l<co[fijk];l++) {
			if(p[fijk][ps*l]<switchx) put_image(dijk,fijk,l,dis,by*ima,0);
			else put_image(odijk,fijk,l,adis,by*ima,0);
		}
	}

	// All contributions to the block now added, so set both two bits of
	// the image information
	img[dijk]=3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0xc(%rbp), %ecx
movl 0x128(%rax), %edx
movl -0x10(%rbp), %esi
movl 0x190(%rax), %edi
imull -0x14(%rbp), %edi
addl %edi, %esi
imull %esi, %edx
addl %edx, %ecx
movl %ecx, -0x1c(%rbp)
movq %rax, %rdi
addq $0x128, %rdi            # imm = 0x128
movl -0x10(%rbp), %esi
subl 0x180(%rax), %esi
movl 0x12c(%rax), %edx
callq 0x1ee80
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, -0x24(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, -0x5c(%rbp)
movq %rax, %rdi
addq $0x128, %rdi            # imm = 0x128
xorl %ecx, %ecx
subl -0x24(%rbp), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x8(%rax), %xmm0
mulsd 0x158(%rax), %xmm0
callq 0x1f4a0
movl -0x5c(%rbp), %ecx
movl %eax, %edx
movq -0x58(%rbp), %rax
addl %edx, %ecx
movl %ecx, -0x28(%rbp)
movq %rax, %rdi
addq $0x128, %rdi            # imm = 0x128
movl -0x28(%rbp), %esi
movl 0x128(%rax), %edx
callq 0x1ee80
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, -0x2c(%rbp)
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %edx
imull 0x128(%rax), %edx
subl %edx, %ecx
movl %ecx, -0x30(%rbp)
movl -0x30(%rbp), %ecx
movl 0x128(%rax), %edx
movl -0x10(%rbp), %esi
movl -0x24(%rbp), %edi
imull 0x12c(%rax), %edi
subl %edi, %esi
movl 0x190(%rax), %edi
imull -0x14(%rbp), %edi
addl %edi, %esi
imull %esi, %edx
addl %edx, %ecx
movl %ecx, -0x34(%rbp)
cvtsi2sdl -0x24(%rbp), %xmm0
movsd 0x8(%rax), %xmm2
cvtsi2sdl -0x2c(%rbp), %xmm1
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
cvtsi2sdl -0xc(%rbp), %xmm1
movsd 0x140(%rax), %xmm2
cvtsi2sdl -0x24(%rbp), %xmm0
mulsd 0x8(%rax), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsi2sdl -0x2c(%rbp), %xmm0
movsd (%rax), %xmm2
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movq 0x1c0(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x508a1
cmpl $0x0, -0xc(%rbp)
jle 0x507b5
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0x507d6
movq -0x58(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl 0x128(%rax), %ecx
subl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movsd -0x40(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq 0x1c0(%rax), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edx
orl $0x2, %edx
movb %dl, (%rax,%rcx)
movl $0x0, -0x18(%rbp)
movq -0x58(%rbp), %rcx
movl -0x18(%rbp), %eax
movq 0x1b0(%rcx), %rcx
movslq -0x34(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x5089f
movq -0x58(%rbp), %rcx
movq 0x1a8(%rcx), %rax
movslq -0x34(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl 0x1cc(%rcx), %ecx
imull -0x18(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x50867
movq -0x58(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x34(%rbp), %edx
movl -0x18(%rbp), %ecx
movsd -0x40(%rbp), %xmm0
movsd 0x10(%rdi), %xmm1
cvtsi2sdl -0x24(%rbp), %xmm2
mulsd %xmm2, %xmm1
xorps %xmm2, %xmm2
callq 0x50a80
jmp 0x5088f
movq -0x58(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x34(%rbp), %edx
movl -0x18(%rbp), %ecx
movsd -0x50(%rbp), %xmm0
movsd 0x10(%rdi), %xmm1
cvtsi2sdl -0x24(%rbp), %xmm2
mulsd %xmm2, %xmm1
xorps %xmm2, %xmm2
callq 0x50a80
jmp 0x50891
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x507f6
jmp 0x508a1
movq -0x58(%rbp), %rax
movq 0x1c0(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x50a5a
movq -0x58(%rbp), %rcx
movl -0x30(%rbp), %eax
movl 0x128(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x50922
movq -0x58(%rbp), %rax
movl $0x1, %ecx
subl 0x128(%rax), %ecx
addl -0x34(%rbp), %ecx
movl %ecx, -0x34(%rbp)
movl $0x1, %ecx
subl 0x128(%rax), %ecx
cvtsi2sd %ecx, %xmm0
movsd 0x140(%rax), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd (%rax), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
jmp 0x50941
movq -0x58(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movsd 0x140(%rax), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x58(%rbp), %rcx
movl -0xc(%rbp), %eax
movl 0x128(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x50978
movq -0x58(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl 0x128(%rax), %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movsd -0x40(%rbp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0x5098b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq 0x1c0(%rax), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edx
orl $0x1, %edx
movb %dl, (%rax,%rcx)
movl $0x0, -0x18(%rbp)
movq -0x58(%rbp), %rcx
movl -0x18(%rbp), %eax
movq 0x1b0(%rcx), %rcx
movslq -0x34(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x50a58
movq -0x58(%rbp), %rcx
movq 0x1a8(%rcx), %rax
movslq -0x34(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl 0x1cc(%rcx), %ecx
imull -0x18(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x50a20
movq -0x58(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x34(%rbp), %edx
movl -0x18(%rbp), %ecx
movsd -0x40(%rbp), %xmm0
movsd 0x10(%rdi), %xmm1
cvtsi2sdl -0x24(%rbp), %xmm2
mulsd %xmm2, %xmm1
xorps %xmm2, %xmm2
callq 0x50a80
jmp 0x50a48
movq -0x58(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x34(%rbp), %edx
movl -0x18(%rbp), %ecx
movsd -0x50(%rbp), %xmm0
movsd 0x10(%rdi), %xmm1
cvtsi2sdl -0x24(%rbp), %xmm2
mulsd %xmm2, %xmm1
xorps %xmm2, %xmm2
callq 0x50a80
jmp 0x50a4a
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x509ab
jmp 0x50a5a
movq -0x58(%rbp), %rax
movq 0x1c0(%rax), %rax
movslq -0x1c(%rbp), %rcx
movb $0x3, (%rax,%rcx)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)