// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/psd.cc
// Function: calcSpheresDistance(ATOM_NETWORK, std::vector<std::pair<Point, double>, std::allocator<std::pair<Point, double>>>&, std::vector<double, std::allocator<double>>&)
void calcSpheresDistance(ATOM_NETWORK atomnetwork, vector <pair <Point, double> > &sphereAndRadii, vector <double> &distanceBetweenSpheres){
	for (int a=0; a<sphereAndRadii.size(); a++){
		Point coord1 = sphereAndRadii.at(a).first; double Radius1 = sphereAndRadii.at(a).second;
		double SpheresDistanceCalc = 0;
		double minDistance = 1000000;
		for (int b=0; b<sphereAndRadii.size(); b++){
			Point coord2 = sphereAndRadii.at(b).first; double Radius2 = sphereAndRadii.at(b).second;
			if (Radius1>=2 && Radius1<=2.15){
				if (Radius2>=2 && Radius2<=2.15){
					if (a !=b){
						double checkDistance = atomnetwork.calcDistanceXYZ(coord1[0], coord1[1], coord1[2], coord2[0], coord2[1], coord2[2]);
						minDistance = min(minDistance, checkDistance);
						SpheresDistanceCalc = minDistance; 
					}
				}
			}
		}
		distanceBetweenSpheres.push_back(SpheresDistanceCalc);
	}	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, 0x18(%rsp)
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x8e201
movq %rsi, %r14
xorl %r12d, %r12d
movq %rdx, 0x10(%rsp)
movq %r12, %rcx
shlq $0x5, %rcx
movq 0x10(%rax,%rcx), %rdx
movq %rdx, 0x80(%rsp)
movups (%rax,%rcx), %xmm0
movaps %xmm0, 0x70(%rsp)
movsd 0x18(%rax,%rcx), %xmm0
movq $0x0, 0x8(%rsp)
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x8e1b7
movsd 0xc98e4(%rip), %xmm1    # 0x157940
cmplepd %xmm0, %xmm1
movsd 0xc98cf(%rip), %xmm2    # 0x157938
cmplepd %xmm2, %xmm0
andpd %xmm1, %xmm0
movd %xmm0, %ebx
xorl %r15d, %r15d
xorl %r13d, %r13d
movsd 0xc98c4(%rip), %xmm2    # 0x157948
movq 0x10(%rax,%r15), %rcx
movq %rcx, 0x60(%rsp)
movupd (%rax,%r15), %xmm0
movapd %xmm0, 0x50(%rsp)
testb $0x1, %bl
je 0x8e199
cmpq %r13, %r12
je 0x8e199
movsd 0x18(%rax,%r15), %xmm0
ucomisd 0xc9885(%rip), %xmm0    # 0x157940
jb 0x8e199
movsd 0xc986f(%rip), %xmm1    # 0x157938
ucomisd %xmm0, %xmm1
jb 0x8e199
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
movsd %xmm2, 0x48(%rsp)
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbp, %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movq %rbp, %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %rbp, %rdi
movl $0x1, %esi
callq 0x85478
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbp, %rdi
movl $0x2, %esi
callq 0x85478
movsd (%rax), %xmm5
movq 0x18(%rsp), %rdi
movsd 0x40(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
movsd 0x20(%rsp), %xmm4
callq 0x5394a
minsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movapd %xmm0, %xmm2
incq %r13
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r15
cmpq %r13, %rcx
ja 0x8e084
movq 0x10(%rsp), %rbx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x8e1da
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x8e1e7
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x148c4
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r12, %rcx
ja 0x8e01b
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop