// File: WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::get_absDistance(int, int)
double CMolecularSystem::get_absDistance(int ti ,int tj)
{
  double abs,diffx,diffy,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;};
  abs = sqrt(diffx*diffx + diffy*diffy + diffz*diffz);
  return abs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%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
movsd %xmm0, -0x20(%rbp)
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
movsd %xmm0, -0x28(%rbp)
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
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
movsd 0x3218(%rax), %xmm1
movsd 0x58d7(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x68a8
movq -0x38(%rbp), %rax
movsd -0x20(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
subsd 0x3218(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x38(%rbp), %rax
movsd -0x20(%rbp), %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3218(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x5879(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6906
movq -0x38(%rbp), %rax
movsd -0x20(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
addsd 0x3218(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x38(%rbp), %rax
movsd -0x28(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
movsd 0x3220(%rax), %xmm1
movsd 0x5832(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x694d
movq -0x38(%rbp), %rax
movsd -0x28(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
subsd 0x3220(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x38(%rbp), %rax
movsd -0x28(%rbp), %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3220(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x57d4(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x69ab
movq -0x38(%rbp), %rax
movsd -0x28(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
addsd 0x3220(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x38(%rbp), %rax
movsd -0x30(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
movsd 0x3228(%rax), %xmm1
movsd 0x578d(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x69f2
movq -0x38(%rbp), %rax
movsd -0x30(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
subsd 0x3228(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x38(%rbp), %rax
movsd -0x30(%rbp), %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3228(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x572f(%rip), %xmm2     # 0xc158
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6a50
movq -0x38(%rbp), %rax
movsd -0x30(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rax
addsd 0x3228(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm1
movsd -0x20(%rbp), %xmm2
movsd -0x28(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
movsd -0x30(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x31a0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)