// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %rbp
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x2bf34
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x2bf34
leaq 0x58(%rsp), %r15
xorl %r13d, %r13d
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x8e74
movq %r14, %rdi
movq %r15, %rsi
callq 0x2bf62
movl %r13d, 0x14(%rsp)
movq 0x40(%rbp), %rax
subq 0x38(%rbp), %rax
shrq $0x3, %rax
cmpl %eax, %r13d
jae 0x1be81
movq %rbp, %rdi
leaq 0x14(%rsp), %rsi
callq 0x1ab66
movq %rax, %r12
movq %rax, %rdi
callq 0xea3c
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2c014
movq %r12, %rdi
movq %r15, %rsi
callq 0xee3e
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec26
movq 0x20(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec2e
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x28(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec36
movsd (%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x30(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec26
movq 0x38(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec2e
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xc0(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec36
movsd (%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0xc8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec26
movq 0xd0(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec2e
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xd8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0xec36
movsd (%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2bfac
movq %r12, %rdi
movq %rbx, %rsi
callq 0xee3e
incl %r13d
jmp 0x1bc9b
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop