// File: 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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0xf7030
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jae 0xf6d9b
movq -0x10(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0xf7050
movq (%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0xf7050
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x105b11(%rip), %xmm0   # 0x1fc6c8
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movslq -0x54(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
callq 0xf7030
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0xf6d80
movq -0x10(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0xf7050
movq (%rax), %rcx
movq %rcx, -0x70(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x68(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x54(%rbp), %rsi
callq 0xf7050
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0xfb416(%rip), %xmm1    # 0x1f2048
ucomisd %xmm1, %xmm0
jb 0xf6d70
movsd 0x105a8c(%rip), %xmm0   # 0x1fc6d0
ucomisd -0x40(%rbp), %xmm0
jb 0xf6d70
movsd -0x78(%rbp), %xmm0
movsd 0xfb3ec(%rip), %xmm1    # 0x1f2048
ucomisd %xmm1, %xmm0
jb 0xf6d6e
movsd 0x105a62(%rip), %xmm0   # 0x1fc6d0
ucomisd -0x78(%rbp), %xmm0
jb 0xf6d6e
movl -0x1c(%rbp), %eax
cmpl -0x54(%rbp), %eax
je 0xf6d6c
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movsd (%rax), %xmm0
movsd %xmm0, -0xc0(%rbp)
leaq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movsd (%rax), %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq -0x38(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movsd (%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movsd (%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq -0x88(%rbp), %rdi
movsd -0xc0(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
movsd -0xb0(%rbp), %xmm2
movsd -0xa8(%rbp), %xmm3
movsd -0xa0(%rbp), %xmm4
movsd (%rax), %xmm5
callq 0x97a10
movsd %xmm0, -0x80(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x64f50
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0xf6d6e
jmp 0xf6d70
jmp 0xf6d72
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xf6bc3
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x105c0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xf6b45
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop