// File: atfrank[P]PCASA/lib/Molecule.cpp
// Function: Molecule::rotate(double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&)
void Molecule::rotate (const double &r1c1, const double &r1c2, const double &r1c3, const double &r2c1, const double &r2c2, const double &r2c3, const double &r3c1, const double &r3c2, const double &r3c3){
  Atom *atm;
  Coor coor;
  Coor cog;

  cog=Analyze::centerOfGeometry(this, false);

  for (unsigned int i=0; i< this->getNAtom(); i++){
    atm=this->getAtom(i);
    atm->setCoor(atm->getCoor()-cog); //Translate molecule to origin based on selected
    //Apply rotation matrix to entire molecule
    coor.x()=r1c1*atm->getX()+r1c2*atm->getY()+r1c3*atm->getZ();
    coor.y()=r2c1*atm->getX()+r2c2*atm->getY()+r2c3*atm->getZ();
    coor.z()=r3c1*atm->getX()+r3c2*atm->getY()+r3c3*atm->getZ();
    coor+=cog; //Translate molecule back
    atm->setCoor(coor);
  }
}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq 0x168(%rsp), %rax
movq 0x160(%rsp), %rax
movq 0x158(%rsp), %rax
movq 0x150(%rsp), %rax
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movq %rcx, 0x128(%rsp)
movq %r8, 0x120(%rsp)
movq %r9, 0x118(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x76060
leaq 0xe0(%rsp), %rdi
callq 0x76060
movq 0xa0(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
xorl %edx, %edx
callq 0xf1e0
leaq 0xe0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x76110
movl $0x0, 0xc4(%rsp)
movq 0xa0(%rsp), %rdi
movl 0xc4(%rsp), %eax
movl %eax, 0x9c(%rsp)
callq 0x44a80
movl %eax, %ecx
movl 0x9c(%rsp), %eax
cmpl %ecx, %eax
jae 0x45685
movq 0xa0(%rsp), %rdi
leaq 0xc4(%rsp), %rsi
callq 0x43580
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rax
movq %rax, (%rsp)
movq 0x110(%rsp), %rdi
callq 0x1f6e0
movq %rax, %rsi
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x762d0
movq (%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x1ffe0
movq 0x138(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1fa60
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x130(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1fa80
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm2
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x128(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1faa0
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x16f20
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x120(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1fa60
movsd (%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x118(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1fa80
movsd 0x38(%rsp), %xmm1
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm2
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x150(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1faa0
movsd 0x50(%rsp), %xmm0
movsd 0x58(%rsp), %xmm1
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x16f30
movsd 0x60(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x158(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1fa60
movsd (%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x160(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1fa80
movsd 0x68(%rsp), %xmm1
movsd 0x70(%rsp), %xmm0
movsd 0x78(%rsp), %xmm2
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x168(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x110(%rsp), %rdi
callq 0x1faa0
movsd 0x80(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x90(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x16f40
movsd 0x90(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0xf8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x761f0
movq 0x110(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1ffe0
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
jmp 0x45368
addq $0x148, %rsp            # imm = 0x148
retq
nopl (%rax)