// File: WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::get_distance(int, int, double&, double&, double&)
void CMolecularSystem::get_distance(int ti ,int tj ,double &diffx ,double &diffy,double &diffz)
{
  diffx = this->molecules[tj].posx - this->molecules[ti].posx;
  diffy = this->molecules[tj].posy - this->molecules[ti].posy;
  diffz = this->molecules[tj].posz - this->molecules[ti].posz;

  //nearest image
  if (diffx >  this->parameter->boxx/2.0) {diffx = diffx - this->parameter->boxx;};
  if (diffx < -this->parameter->boxx/2.0) {diffx = diffx + this->parameter->boxx;};
  if (diffy >  this->parameter->boxy/2.0) {diffy = diffy - this->parameter->boxy;};
  if (diffy < -this->parameter->boxy/2.0) {diffy = diffy + this->parameter->boxy;};
  if (diffz >  this->parameter->boxz/2.0) {diffz = diffz - this->parameter->boxz;};
  if (diffz < -this->parameter->boxz/2.0) {diffz = diffz + this->parameter->boxz;};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0xb4e8b8(%rax), %rcx
movslq -0x10(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movsd 0x8(%rcx), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
subsd 0x8(%rcx), %xmm0
movq -0x18(%rbp), %rcx
movsd %xmm0, (%rcx)
movq 0xb4e8b8(%rax), %rcx
movslq -0x10(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movsd 0x10(%rcx), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
subsd 0x10(%rcx), %xmm0
movq -0x20(%rbp), %rcx
movsd %xmm0, (%rcx)
movq 0xb4e8b8(%rax), %rcx
movslq -0x10(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movsd 0x18(%rcx), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
subsd 0x18(%rcx), %xmm0
movq -0x28(%rbp), %rcx
movsd %xmm0, (%rcx)
movq -0x18(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
movsd 0x3218(%rax), %xmm1
movsd 0x50d3(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x70b2
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
subsd 0x3218(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rcx), %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3218(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x506c(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7119
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
addsd 0x3218(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
movsd 0x3220(%rax), %xmm1
movsd 0x501c(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x7169
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
subsd 0x3220(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movsd (%rcx), %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3220(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x4fb5(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x71d0
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
addsd 0x3220(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
movsd 0x3228(%rax), %xmm1
movsd 0x4f65(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x7220
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
subsd 0x3228(%rax), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movsd (%rcx), %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3228(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x4efe(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7287
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movsd (%rcx), %xmm0
movq 0xb4e8c0(%rax), %rax
addsd 0x3228(%rax), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
popq %rbp
retq
nopl (%rax)