// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %r15d
movl %edx, %eax
movq %rdi, %rbx
movl 0x128(%rdi), %r12d
movl 0x12c(%rdi), %edi
imull 0x190(%rbx), %r15d
addl %edx, %r15d
movl %r15d, %ebp
imull %r12d, %ebp
subl 0x180(%rbx), %eax
js 0x2b68e
cltd
idivl %edi
movl %eax, %ecx
jmp 0x2b697
incl %eax
cltd
idivl %edi
movl %eax, %ecx
decl %ecx
addl %esi, %ebp
movl %ecx, %eax
negl %eax
cvtsi2sd %eax, %xmm0
movsd 0x8(%rbx), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm0
mulsd 0x158(%rbx), %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
cvttsd2si %xmm0, %r8d
addl %esi, %r8d
subl %eax, %r8d
js 0x2b6d9
movl %r8d, %eax
cltd
idivl %r12d
jmp 0x2b6e3
leal 0x1(%r8), %eax
cltd
idivl %r12d
decl %eax
cvtsi2sd %eax, %xmm1
imull %r12d, %eax
subl %eax, %r8d
imull %ecx, %edi
subl %edi, %r15d
imull %r12d, %r15d
addl %r8d, %r15d
cvtsi2sd %ecx, %xmm3
movsd (%rbx), %xmm0
mulsd %xmm0, %xmm1
cvtsi2sd %esi, %xmm4
mulsd 0x140(%rbx), %xmm4
movsd %xmm3, 0x28(%rsp)
mulsd %xmm3, %xmm2
subsd %xmm2, %xmm4
addsd %xmm1, %xmm2
subsd %xmm1, %xmm4
movsd %xmm4, 0x8(%rsp)
movq 0x1c0(%rbx), %rax
movslq %ebp, %rdi
movb (%rax,%rdi), %cl
testb $0x1, %cl
movsd %xmm2, (%rsp)
movq %rdi, 0x20(%rsp)
jne 0x2b80c
movq %r8, 0x30(%rsp)
decl %r12d
movsd %xmm2, 0x10(%rsp)
movl %esi, 0x1c(%rsp)
testl %esi, %esi
jg 0x2b770
addsd (%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
pushq $-0x1
popq %rcx
cmovgl %ecx, %r12d
addl %ebp, %r12d
movslq %r12d, %rcx
orb $0x2, (%rax,%rcx)
movslq %r15d, %r13
xorl %r14d, %r14d
movq 0x1b0(%rbx), %rax
cmpl (%rax,%r13,4), %r14d
jge 0x2b7f4
movq 0x1a8(%rbx), %rax
movq (%rax,%r13,8), %rax
movslq 0x1cc(%rbx), %rcx
movslq %r14d, %rdx
imulq %rcx, %rdx
movsd (%rax,%rdx,8), %xmm0
ucomisd 0x8(%rsp), %xmm0
movsd 0x10(%rbx), %xmm1
mulsd 0x28(%rsp), %xmm1
xorpd %xmm2, %xmm2
movq %rbx, %rdi
jbe 0x2b7db
movl %ebp, %esi
movl %r15d, %edx
movl %r14d, %ecx
movsd (%rsp), %xmm0
jmp 0x2b7ea
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movsd 0x10(%rsp), %xmm0
callq 0x2b944
incl %r14d
jmp 0x2b787
movq 0x1c0(%rbx), %rax
movq 0x20(%rsp), %rdi
movb (%rax,%rdi), %cl
movl 0x1c(%rsp), %esi
movq 0x30(%rsp), %r8
testb $0x2, %cl
jne 0x2b931
movl 0x128(%rbx), %ecx
leal -0x1(%rcx), %edx
cmpl %edx, %r8d
jne 0x2b857
pushq $0x1
popq %r12
subl %ecx, %r12d
cvtsi2sd %r12d, %xmm0
mulsd 0x140(%rbx), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rbx), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
jmp 0x2b873
movsd 0x8(%rsp), %xmm1
addsd 0x140(%rbx), %xmm1
movsd (%rbx), %xmm0
pushq $0x1
popq %r12
movsd %xmm1, 0x8(%rsp)
addl %r15d, %r12d
xorl %r15d, %r15d
cmpl %esi, %edx
cmovnel %r15d, %ecx
je 0x2b88e
movsd (%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0x2b8a5
movsd (%rsp), %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movapd %xmm1, %xmm0
movl %ebp, %edx
subl %ecx, %edx
movslq %edx, %r14
orb $0x1, 0x1(%rax,%r14)
incq %r14
movslq %r12d, %r13
movq 0x1b0(%rbx), %rax
cmpl (%rax,%r13,4), %r15d
jge 0x2b925
movq 0x1a8(%rbx), %rax
movq (%rax,%r13,8), %rax
movslq 0x1cc(%rbx), %rcx
movslq %r15d, %rdx
imulq %rcx, %rdx
movsd 0x8(%rsp), %xmm1
ucomisd (%rax,%rdx,8), %xmm1
movsd 0x10(%rbx), %xmm1
mulsd 0x28(%rsp), %xmm1
xorpd %xmm2, %xmm2
movq %rbx, %rdi
jbe 0x2b907
movl %ebp, %esi
movl %r12d, %edx
movl %r15d, %ecx
jmp 0x2b916
movl %r14d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movsd 0x10(%rsp), %xmm0
callq 0x2b944
incl %r15d
movsd (%rsp), %xmm0
jmp 0x2b8b8
movq 0x1c0(%rbx), %rax
movq 0x20(%rsp), %rdi
movb $0x3, (%rax,%rdi)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq