// File: /workspace/github_cpp_makefile_star2_O1/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), %rdi
callq 0x3a27c
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x3a27c
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xd65c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3a2ae
movq 0x38(%rbp), %rax
movq 0x40(%rbp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
shrq $0x3, %rdx
testl %edx, %edx
je 0x260b5
xorl %r13d, %r13d
leaq 0x58(%rsp), %rbx
leaq 0x70(%rsp), %r14
leaq 0x40(%rsp), %r15
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0x25ecc
movq (%rax,%r13,8), %r12
jmp 0x25ecf
xorl %r12d, %r12d
movq %r12, %rdi
callq 0x14abe
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x3a360
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1504e
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d4e
movq 0x20(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d56
movsd 0x10(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x28(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d5e
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x30(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d4e
movq 0x38(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d56
movsd 0x10(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xc0(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d5e
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0xc8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d4e
movq 0xd0(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d56
movsd 0x10(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xd8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x14d5e
movsd 0x8(%rsp), %xmm0
mulsd (%rax), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3a2f8
movq %r12, %rdi
movq %r15, %rsi
callq 0x1504e
incq %r13
movq 0x38(%rbp), %rax
movq 0x40(%rbp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
shrq $0x3, %rdx
movl %edx, %edx
cmpq %rdx, %r13
jb 0x25ebd
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop