// File: /workspace/github_cpp_makefile_star2_O2/Chrom3D[P]Chrom3D/src/Chromosome.cpp
// Function: Chromosome::armRotate(unsigned int, double, bool)
CoordinateMatrix Chromosome::armRotate(uint pos, double theta, bool goRight) {
  assert( (pos >= 1) && (pos < this->size()-1) );
  assert( (theta >= 0) && (theta <= 2*util::PI) );
  
  CoordinateVector beadPos = this->getBeadCoordinates(pos);
  CoordinateMatrix mat;
  CoordinateVector point1;
  CoordinateVector point2;
  if(goRight) {
    mat = this->getBeadCoordinates(pos+1, this->size()-1);
    point1 = this->getBeadCoordinates(pos-1);
    point2 = this->getBeadCoordinates(pos);
  }
  else {
    mat = this->getBeadCoordinates(0, pos-1);
    point1 = this->getBeadCoordinates(pos);
    point2 = this->getBeadCoordinates(pos+1);    
  }
  CoordinateMatrix rotated = util::rotatePointsAroundArbitraryAxis(theta, point1, point2, mat);  
  return rotated;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movsd %xmm0, 0x28(%rsp)
testl %edx, %edx
je 0xafda
movl %edx, %r14d
movq %rsi, %r15
movl 0x75328(%rsi), %eax
decl %eax
cmpl %edx, %eax
jbe 0xafda
xorpd %xmm0, %xmm0
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0xaff3
movsd 0x15221(%rip), %xmm0    # 0x20018
ucomisd %xmm1, %xmm0
jb 0xaff3
movl %ecx, %ebp
movq %rdi, %rbx
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xa92a
xorpd %xmm0, %xmm0
movupd %xmm0, 0x78(%rsp)
movapd %xmm0, 0x60(%rsp)
movupd %xmm0, 0x50(%rsp)
movupd %xmm0, 0x38(%rsp)
testb %bpl, %bpl
je 0xaeaa
leal 0x1(%r14), %edx
movl 0x75328(%r15), %ecx
decl %ecx
movq %rsp, %rdi
movq %r15, %rsi
callq 0xa79a
leaq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0xb528
leaq 0x10(%rsp), %rdi
callq 0x8012
leal -0x1(%r14), %edx
movq %rsp, %rdi
movq %r15, %rsi
callq 0xa92a
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
callq 0xbbc8
movq %rsp, %rdi
callq 0x8012
movq %rsp, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xa92a
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0xbbc8
jmp 0xaf13
leal -0x1(%r14), %ecx
movq %rsp, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xa79a
leaq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0xb528
leaq 0x10(%rsp), %rdi
callq 0x8012
movq %rsp, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xa92a
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
callq 0xbbc8
movq %rsp, %rdi
callq 0x8012
incl %r14d
movq %rsp, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xa92a
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0xbbc8
movq %rsp, %rdi
callq 0x8012
leaq 0xa0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x8932
leaq 0x88(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x8932
leaq 0xd0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x7eea
leaq 0xa0(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
movq %rbx, %rdi
movsd 0x28(%rsp), %xmm0
callq 0x6a77
leaq 0xe0(%rsp), %rdi
callq 0x8012
leaq 0x88(%rsp), %rdi
callq 0x8012
leaq 0xa0(%rsp), %rdi
callq 0x8012
leaq 0x30(%rsp), %rdi
callq 0x8012
leaq 0x48(%rsp), %rdi
callq 0x8012
leaq 0x70(%rsp), %rdi
callq 0x8012
leaq 0xb8(%rsp), %rdi
callq 0x8012
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15822(%rip), %rdi     # 0x20803
leaq 0x156f4(%rip), %rsi     # 0x206dc
leaq 0x15839(%rip), %rcx     # 0x20828
pushq $0x73
jmp 0xb00a
leaq 0x15869(%rip), %rdi     # 0x20863
leaq 0x156db(%rip), %rsi     # 0x206dc
leaq 0x15820(%rip), %rcx     # 0x20828
pushq $0x74
popq %rdx
callq 0x6250
jmp 0xb01a
jmp 0xb01a
jmp 0xb06c
jmp 0xb06c
jmp 0xb01a
movq %rax, %rbx
movq %rsp, %rdi
jmp 0xb065
jmp 0xb06c
jmp 0xb06c
jmp 0xb028
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xb065
jmp 0xb06c
jmp 0xb06c
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x8012
jmp 0xb04b
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x8012
jmp 0xb05d
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x8012
jmp 0xb06f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x8012
leaq 0x48(%rsp), %rdi
callq 0x8012
leaq 0x70(%rsp), %rdi
callq 0x8012
leaq 0xb8(%rsp), %rdi
callq 0x8012
movq %rbx, %rdi
callq 0x65d0