// File: /workspace/github_cpp_makefile_star2_O3/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
movq 0x8(%rsi), %rcx
cmpq %rax, %rcx
je 0x8c249
movq %rsi, %r14
xorl %r12d, %r12d
movq %rdx, 0x10(%rsp)
movq %r12, %rdx
shlq $0x5, %rdx
movq 0x10(%rax,%rdx), %rsi
movq %rsi, 0x80(%rsp)
movups (%rax,%rdx), %xmm0
movaps %xmm0, 0x70(%rsp)
movsd 0x18(%rax,%rdx), %xmm0
movq $0x0, 0x8(%rsp)
cmpq %rax, %rcx
je 0x8c1fb
movsd 0xc9a09(%rip), %xmm1    # 0x155aa0
cmplepd %xmm0, %xmm1
movsd 0xc99f4(%rip), %xmm2    # 0x155a98
cmplepd %xmm2, %xmm0
andpd %xmm1, %xmm0
movd %xmm0, %ebx
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
xorl %r13d, %r13d
movsd 0xc99e5(%rip), %xmm3    # 0x155aa8
movq 0x10(%rax,%r15), %rdx
movq %rdx, 0x60(%rsp)
movupd (%rax,%r15), %xmm1
movapd %xmm1, 0x50(%rsp)
testb $0x1, %bl
je 0x8c1df
cmpq %r13, %r12
je 0x8c1df
movsd 0x18(%rax,%r15), %xmm1
ucomisd 0xc99a6(%rip), %xmm1    # 0x155aa0
jb 0x8c1df
movsd 0xc9990(%rip), %xmm2    # 0x155a98
ucomisd %xmm1, %xmm2
jb 0x8c1df
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
movsd %xmm3, 0x48(%rsp)
callq 0x83f9a
movsd (%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbp, %rdi
movl $0x1, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movq %rbp, %rdi
movl $0x2, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %rbp, %rdi
movl $0x1, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbp, %rdi
movl $0x2, %esi
callq 0x83f9a
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 0x5364c
minsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%r14), %rax
movq 0x8(%r14), %rcx
movapd %xmm0, %xmm3
incq %r13
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
addq $0x20, %r15
cmpq %r13, %rdx
ja 0x8c0c3
jmp 0x8c202
xorpd %xmm0, %xmm0
movq %rax, %rcx
movq 0x10(%rsp), %rbx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x8c21f
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x8c233
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x1481e
movq (%r14), %rax
movq 0x8(%r14), %rcx
incq %r12
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r12, %rdx
ja 0x8c05a
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop