// File: /workspace/github_cpp_makefile_star2_O3/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), %r8d
imull 0x190(%rdi), %r15d
addl %edx, %r15d
movl %r15d, %edi
imull %r12d, %edi
subl 0x180(%rbx), %eax
js 0x32f30
cltd
idivl %r8d
movl %eax, %ecx
jmp 0x32f3a
incl %eax
cltd
idivl %r8d
movl %eax, %ecx
decl %ecx
addl %esi, %edi
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, %r9d
addl %esi, %r9d
subl %eax, %r9d
js 0x32f7c
movl %r9d, %eax
cltd
idivl %r12d
jmp 0x32f86
leal 0x1(%r9), %eax
cltd
idivl %r12d
decl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
imull %r12d, %eax
subl %eax, %r9d
imull %ecx, %r8d
subl %r8d, %r15d
imull %r12d, %r15d
movq %r9, 0x30(%rsp)
addl %r9d, %r15d
cvtsi2sd %ecx, %xmm3
movsd (%rbx), %xmm0
mulsd %xmm0, %xmm1
movl %esi, 0xc(%rsp)
cvtsi2sd %esi, %xmm4
mulsd 0x140(%rbx), %xmm4
movsd %xmm3, 0x28(%rsp)
mulsd %xmm3, %xmm2
subsd %xmm2, %xmm4
addsd %xmm1, %xmm2
movsd %xmm2, (%rsp)
subsd %xmm1, %xmm4
movsd %xmm4, 0x10(%rsp)
movq 0x1c0(%rbx), %rax
movl %edi, %r13d
movslq %edi, %rcx
movq %rcx, 0x20(%rsp)
testb $0x1, (%rax,%rcx)
jne 0x330b2
decl %r12d
movsd (%rsp), %xmm1
movsd %xmm1, 0x18(%rsp)
cmpl $0x0, 0xc(%rsp)
jg 0x33020
addsd (%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovgl %ecx, %r12d
addl %r13d, %r12d
movslq %r12d, %rcx
orb $0x2, (%rax,%rcx)
movslq %r15d, %rbp
movq 0x1b0(%rbx), %rax
cmpl $0x0, (%rax,%rbp,4)
jle 0x330b2
xorl %r14d, %r14d
movq 0x1a8(%rbx), %rax
movq (%rax,%rbp,8), %rax
movslq 0x1cc(%rbx), %rcx
movslq %r14d, %rdx
imulq %rcx, %rdx
movsd (%rax,%rdx,8), %xmm0
ucomisd 0x10(%rsp), %xmm0
movsd 0x10(%rbx), %xmm1
mulsd 0x28(%rsp), %xmm1
xorpd %xmm2, %xmm2
movq %rbx, %rdi
jbe 0x3308e
movl %r13d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movsd (%rsp), %xmm0
jmp 0x3309d
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movsd 0x18(%rsp), %xmm0
callq 0x3320c
incl %r14d
movq 0x1b0(%rbx), %rax
cmpl (%rax,%rbp,4), %r14d
jl 0x33046
movq 0x1c0(%rbx), %rax
movq 0x20(%rsp), %rcx
testb $0x2, (%rax,%rcx)
jne 0x331ec
movl %r13d, %ebp
movl 0x128(%rbx), %ecx
leal -0x1(%rcx), %edx
cmpl %edx, 0x30(%rsp)
jne 0x33113
movl $0x1, %r12d
subl %ecx, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
mulsd 0x140(%rbx), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%rbx), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
jmp 0x33131
movsd 0x10(%rsp), %xmm1
addsd 0x140(%rbx), %xmm1
movsd (%rbx), %xmm0
movl $0x1, %r12d
movsd %xmm1, 0x10(%rsp)
movl 0xc(%rsp), %edi
addl %r15d, %r12d
xorl %esi, %esi
cmpl %edi, %edx
cmovel %ecx, %esi
je 0x3314e
movsd (%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x3315d
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movl %ebp, %ecx
subl %esi, %ecx
movslq %ecx, %r14
orb $0x1, 0x1(%rax,%r14)
movslq %r12d, %r13
movq 0x1b0(%rbx), %rax
cmpl $0x0, (%rax,%r13,4)
jle 0x331ec
incq %r14
xorl %r15d, %r15d
movq 0x1a8(%rbx), %rax
movq (%rax,%r13,8), %rax
movslq 0x1cc(%rbx), %rcx
movslq %r15d, %rdx
imulq %rcx, %rdx
movsd 0x10(%rsp), %xmm0
ucomisd (%rax,%rdx,8), %xmm0
movsd 0x10(%rbx), %xmm1
mulsd 0x28(%rsp), %xmm1
xorpd %xmm2, %xmm2
movq %rbx, %rdi
jbe 0x331c8
movl %ebp, %esi
movl %r12d, %edx
movl %r15d, %ecx
movsd (%rsp), %xmm0
jmp 0x331d7
movl %r14d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movsd 0x18(%rsp), %xmm0
callq 0x3320c
incl %r15d
movq 0x1b0(%rbx), %rax
cmpl (%rax,%r13,4), %r15d
jl 0x33181
movq 0x1c0(%rbx), %rax
movq 0x20(%rsp), %rcx
movb $0x3, (%rax,%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop