// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/voro++/src/unitcell.cc
// Function: voro::unitcell::images(std::vector<int, std::allocator<int>>&, std::vector<double, std::allocator<double>>&)
void unitcell::images(std::vector<int> &vi,std::vector<double> &vd) {
	const int ms2=max_unit_voro_shells*2+1,mss=ms2*ms2*ms2;
	bool *a=new bool[mss],*ac=a+max_unit_voro_shells*(1+ms2*(1+ms2)),*ap=a;
	int i,j,k;
	double vol;

	// Initialize mask
	while(ap<ac) *(ap++)=true;
	*(ap++)=false;
	while(ap<a+mss) *(ap++)=true;

	// Set up the queue and add (0,0,0) image to it
	std::queue<int> q;
	q.push(0);q.push(0);q.push(0);

	while(!q.empty()) {

		// Read the next entry on the queue
		i=q.front();q.pop();
		j=q.front();q.pop();
		k=q.front();q.pop();

		// Check intersection of this image
		if(intersects_image(i,j,k,vol)) {

			// Add this entry to the output vectors
			vi.push_back(i);
			vi.push_back(j);
			vi.push_back(k);
			vd.push_back(vol);

			// Add neighbors to the queue if they have not been
			// tested
			ap=ac+i+ms2*(j+ms2*k);
			if(k>-max_unit_voro_shells&&*(ap-ms2*ms2)) {q.push(i);q.push(j);q.push(k-1);*(ap-ms2*ms2)=false;}
			if(j>-max_unit_voro_shells&&*(ap-ms2)) {q.push(i);q.push(j-1);q.push(k);*(ap-ms2)=false;}
			if(i>-max_unit_voro_shells&&*(ap-1)) {q.push(i-1);q.push(j);q.push(k);*(ap-1)=false;}
			if(i<max_unit_voro_shells&&*(ap+1)) {q.push(i+1);q.push(j);q.push(k);*(ap+1)=false;}
			if(j<max_unit_voro_shells&&*(ap+ms2)) {q.push(i);q.push(j+1);q.push(k);*(ap+ms2)=false;}
			if(k<max_unit_voro_shells&&*(ap+ms2*ms2)) {q.push(i);q.push(j);q.push(k+1);*(ap+ms2*ms2)=false;}
		}
	}

	// Remove mask memory
	delete [] a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movl $0x242d, %edi           # imm = 0x242D
callq 0x2030
movq %rax, %r12
movq %rax, 0x10(%rsp)
xorl %eax, %eax
cmpq $0x1216, %rax           # imm = 0x1216
je 0x2d38d
movb $0x1, (%r12,%rax)
incq %rax
jmp 0x2d37b
movb $0x0, (%r12,%rax)
movl $0x1217, %eax           # imm = 0x1217
cmpq $0x242d, %rax           # imm = 0x242D
je 0x2d3a9
movb $0x1, (%r12,%rax)
incq %rax
jmp 0x2d397
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x2db28
movq %rsp, %rsi
andl $0x0, (%rsi)
movq %rbx, %rdi
callq 0x2de02
movq %rsp, %rsi
andl $0x0, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x2de02
movq %rsp, %rsi
andl $0x0, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0x2de02
addq $0x1216, 0x10(%rsp)     # imm = 0x1216
leaq 0x28(%rsp), %rbp
movq 0x38(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0x2d654
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq %rbp, %rdi
callq 0x2e05c
movq 0x38(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movq %rbp, %rdi
callq 0x2e05c
movq 0x38(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq %rbp, %rdi
callq 0x2e05c
cvtsi2sdl 0xc(%rsp), %xmm0
cvtsi2sdl 0x4(%rsp), %xmm1
cvtsi2sdl 0x8(%rsp), %xmm2
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2d0b0
testb %al, %al
je 0x2d3f2
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0xe918
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe918
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe918
movq 0x18(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2db44
movslq 0xc(%rsp), %r13
addq 0x10(%rsp), %r13
movl 0x4(%rsp), %eax
movl 0x8(%rsp), %ecx
imull $0x15, %ecx, %edx
addl %eax, %edx
movslq %edx, %rdx
imulq $0x15, %rdx, %rbx
cmpl $-0x9, %ecx
jl 0x2d4f8
cmpb $0x1, -0x1b9(%r13,%rbx)
jne 0x2d4f8
movq %rbp, %rdi
leaq 0xc(%rsp), %rsi
callq 0x2e178
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2e178
movl 0x8(%rsp), %eax
decl %eax
movl %eax, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x2de02
movb $0x0, -0x1b9(%r13,%rbx)
movl 0x4(%rsp), %eax
cmpl $-0x9, %eax
jl 0x2d539
cmpb $0x1, -0x15(%r13,%rbx)
jne 0x2d539
movq %rbp, %rdi
leaq 0xc(%rsp), %rsi
callq 0x2e178
movl 0x4(%rsp), %eax
decl %eax
movl %eax, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x2de02
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2e178
movb $0x0, -0x15(%r13,%rbx)
movl 0xc(%rsp), %eax
cmpl $-0x9, %eax
jl 0x2d583
cmpb $0x1, -0x1(%r13,%rbx)
jne 0x2d57e
decl %eax
movl %eax, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x2de02
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2e178
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2e178
movb $0x0, -0x1(%r13,%rbx)
movl 0xc(%rsp), %eax
cmpl $0x9, %eax
jg 0x2d5bb
cmpb $0x1, 0x1(%r13,%rbx)
jne 0x2d5bb
incl %eax
movl %eax, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x2de02
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2e178
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2e178
movb $0x0, 0x1(%r13,%rbx)
cmpl $0x9, 0x4(%rsp)
jg 0x2d5fe
cmpb $0x1, 0x15(%r13,%rbx)
jne 0x2d5fe
movq %rbp, %rdi
leaq 0xc(%rsp), %rsi
callq 0x2e178
movl 0x4(%rsp), %eax
incl %eax
movl %eax, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x2de02
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2e178
movb $0x0, 0x15(%r13,%rbx)
cmpl $0x9, 0x8(%rsp)
jg 0x2d3f2
cmpb $0x1, 0x1b9(%r13,%rbx)
jne 0x2d3f2
movq %rbp, %rdi
leaq 0xc(%rsp), %rsi
callq 0x2e178
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2e178
movl 0x8(%rsp), %eax
incl %eax
movl %eax, (%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x2de02
movb $0x0, 0x1b9(%r13,%rbx)
jmp 0x2d3f2
movq %r12, %rdi
callq 0x2170
leaq 0x28(%rsp), %rdi
callq 0x2dbfa
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d687
jmp 0x2d687
jmp 0x2d687
jmp 0x2d687
jmp 0x2d687
jmp 0x2d687
jmp 0x2d687
jmp 0x2d687
jmp 0x2d687
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2dbfa
movq %rbx, %rdi
callq 0x2220