// File: /workspace/github_cpp_makefile_star2_O1/atfrank[P]PCASA/lib/Analyze.cpp
// Function: Analyze::allAnglesDihedrals(Molecule*, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&)
void Analyze::allAnglesDihedrals(Molecule *mol, std::vector<std::vector<double> >& anglesin){
  unsigned int i, j;
  Chain *c;
  Atom *atmI, *iMinusTwo, *iMinusOne, *iPlusOne, *iPlusTwo, *iPlusThree;
  unsigned int size;
  std::vector<double> angles;

  anglesin.resize(mol->getAtmVecSize());

  for (i=0; i< mol->getChnVecSize(); i++){
    c=mol->getChain(i);
    size=c->getAtmVecSize();
    for (j=0; j< c->getAtmVecSize(); j++){
      atmI=c->getAtom(j);
      iMinusTwo=NULL;
      iMinusOne=NULL;
      iPlusOne=NULL;
      iPlusTwo=NULL;
      iPlusThree=NULL;

      if (j > 1 && atmI->getResId()-2 == c->getAtom(j-2)->getResId()){
        iMinusTwo=c->getAtom(j-2);
      }
      else{
        if (j > 1 && atmI->getResId() == c->getAtom(j-2)->getResId() && (atmI->getICode().compare(0,1,c->getAtom(j-1)->getICode(),0,1) != 0)){
          iMinusTwo=c->getAtom(j-2);
        }
      }

      if (j > 0 && atmI->getResId()-1 == c->getAtom(j-1)->getResId()){
        iMinusOne=c->getAtom(j-1);
      }
      else{
        if (j > 0 && atmI->getResId() == c->getAtom(j-1)->getResId() && (atmI->getICode().compare(0,1,c->getAtom(j-1)->getICode(),0,1) != 0)){
          iMinusOne=c->getAtom(j-1);
        }
      }

      if (j+1 < size && atmI->getResId()+1 == c->getAtom(j+1)->getResId()){
        iPlusOne=c->getAtom(j+1);
      }
      else{
        if (j+1 < size && atmI->getResId() == c->getAtom(j+1)->getResId() && (atmI->getICode().compare(0,1,c->getAtom(j+1)->getICode(),0,1) != 0)){
          iPlusOne=c->getAtom(j+1);
        }
      }

      if (j+2 < size && atmI->getResId()+2 == c->getAtom(j+2)->getResId()){
        iPlusTwo=c->getAtom(j+2);
      }
      else{
        if (j+2 < size && atmI->getResId() == c->getAtom(j+2)->getResId() && (atmI->getICode().compare(0,1,c->getAtom(j+2)->getICode(),0,1) != 0)){
          iPlusTwo=c->getAtom(j+2);
        }
      }

      if (j+3 < size && atmI->getResId()+3 == c->getAtom(j+3)->getResId()){
        iPlusThree=c->getAtom(j+3);
      }
      else{
        if (j+3 < size && atmI->getResId() == c->getAtom(j+3)->getResId() && (atmI->getICode().compare(0,1,c->getAtom(j+3)->getICode(),0,1) !=0)){
          iPlusThree=c->getAtom(j+3);
        }
      }
      
      angles.clear();
      angles.resize(3, 9999.9);
      if (iMinusOne != NULL && iPlusOne != NULL){
        //Get Angle
        angles.at(0)=Analyze::angle(iMinusOne->getCoor(), atmI->getCoor(), iPlusOne->getCoor());
      }
      if (iPlusOne != NULL && iPlusTwo != NULL && iPlusThree != NULL){
        //Get Dihedral
        angles.at(1)=Analyze::dihedral(atmI->getCoor(), iPlusOne->getCoor(), iPlusTwo->getCoor(), iPlusThree->getCoor());
      }
      if (iMinusTwo != NULL && iPlusTwo != NULL){
        //Get Wide Angle (i-2, i, i+2)
        angles.at(2)=Analyze::angle(iMinusTwo->getCoor(), atmI->getCoor(), iPlusTwo->getCoor());
      }
      anglesin.at(atmI->getAtmInx()).resize(3);
      anglesin.at(atmI->getAtmInx())=angles;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq %rdi, 0x58(%rsp)
callq 0x24830
movl %eax, %esi
movq %rbx, %rdi
callq 0x1257a
movq %rbx, 0x60(%rsp)
xorl %ebx, %ebx
movl %ebx, 0x2c(%rsp)
movq 0x58(%rsp), %rdi
callq 0x237a6
cmpl %eax, %ebx
jae 0x12318
movq 0x58(%rsp), %rdi
leaq 0x2c(%rsp), %rsi
callq 0x237b4
movq %rax, %r14
movq %rax, %rdi
callq 0x20656
movl %eax, 0x28(%rsp)
xorl %ebx, %ebx
movq %r14, 0x18(%rsp)
movl %ebx, 0xc(%rsp)
movq %r14, %rdi
callq 0x20656
cmpl %eax, %ebx
jae 0x1230d
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x205ec
movq %rax, %r12
cmpl $0x2, 0xc(%rsp)
jb 0x11c5f
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebx
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
addl $-0x2, %ebx
cmpl (%rax), %ebx
jne 0x11c5f
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, 0x50(%rsp)
jmp 0x11d0e
cmpl $0x2, 0xc(%rsp)
jb 0x11d05
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebx
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
cmpl (%rax), %ebx
jne 0x11d05
movq %r12, %rdi
callq 0x14ab6
movq %rax, %rbx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x24(%rsp)
movq %r14, %rdi
leaq 0x24(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14ab6
movl $0x1, %edx
movl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11d05
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, 0x50(%rsp)
jmp 0x11d0e
movq $0x0, 0x50(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0x11d65
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
decl %ebx
cmpl (%rax), %ebx
jne 0x11d65
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
jmp 0x11e02
cmpl $0x0, 0xc(%rsp)
je 0x11e07
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
cmpl (%rax), %ebx
jne 0x11e07
movq %r12, %rdi
callq 0x14ab6
movq %rax, %rbx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x24(%rsp)
movq %r14, %rdi
leaq 0x24(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14ab6
movl $0x1, %edx
movl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11e07
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %r13
jmp 0x11e0a
xorl %r13d, %r13d
movl 0xc(%rsp), %eax
incl %eax
cmpl 0x28(%rsp), %eax
jae 0x11e65
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebx
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
incl %ebx
cmpl (%rax), %ebx
jne 0x11e65
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
jmp 0x11f08
movl 0xc(%rsp), %eax
incl %eax
cmpl 0x28(%rsp), %eax
jae 0x11f0d
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebx
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
cmpl (%rax), %ebx
jne 0x11f0d
movq %r12, %rdi
callq 0x14ab6
movq %rax, %rbx
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14ab6
movl $0x1, %edx
movl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11f0d
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rbx
jmp 0x11f0f
xorl %ebx, %ebx
movl 0xc(%rsp), %eax
addl $0x2, %eax
cmpl 0x28(%rsp), %eax
jae 0x11f6e
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
addl $0x2, %ebp
cmpl (%rax), %ebp
jne 0x11f6e
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
jmp 0x12015
movl 0xc(%rsp), %eax
addl $0x2, %eax
cmpl 0x28(%rsp), %eax
jae 0x1201a
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
cmpl (%rax), %ebp
jne 0x1201a
movq %r12, %rdi
callq 0x14ab6
movq %rax, %r15
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14ab6
movl $0x1, %edx
movl $0x1, %r9d
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x1201a
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %r15
jmp 0x1201d
xorl %r15d, %r15d
movl 0xc(%rsp), %eax
addl $0x3, %eax
cmpl 0x28(%rsp), %eax
jae 0x1207c
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
addl $0x3, %ebp
cmpl (%rax), %ebp
jne 0x1207c
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
jmp 0x12123
movl 0xc(%rsp), %eax
addl $0x3, %eax
cmpl 0x28(%rsp), %eax
jae 0x12128
movq %r12, %rdi
callq 0x14aae
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14aae
cmpl (%rax), %ebp
jne 0x12128
movq %r12, %rdi
callq 0x14ab6
movq %rax, %rbp
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x205ec
movq %rax, %rdi
callq 0x14ab6
movl $0x1, %edx
movl $0x1, %r9d
movq %rbp, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x12128
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x205ec
movq %rax, %rbp
jmp 0x1212a
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x1213b
movq %rax, 0x38(%rsp)
movabsq $0x40c387f333333333, %rax # imm = 0x40C387F333333333
movq %rax, 0x10(%rsp)
movl $0x3, %esi
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x125e8
testq %r13, %r13
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x121ae
movq %r13, %rdi
callq 0x14abe
movq %rax, %r13
movq %r12, %rdi
callq 0x14abe
movq %rax, %r14
movq %rbx, %rdi
callq 0x14abe
movq %r13, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xdc46
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x1233e
movsd %xmm0, (%rax)
testq %rbx, %rbx
je 0x12217
testq %r15, %r15
je 0x12217
testq %rbp, %rbp
je 0x12217
movq %r12, %rdi
callq 0x14abe
movq %rax, %r13
movq %rbx, %rdi
callq 0x14abe
movq %rax, %rbx
movq %r15, %rdi
callq 0x14abe
movq %rax, %r14
movq %rbp, %rdi
callq 0x14abe
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rax, %rcx
callq 0xdece
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jb 0x12344
movsd %xmm0, 0x8(%rax)
testq %r15, %r15
sete %al
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x12275
callq 0x14abe
movq %rax, %rbx
movq %r12, %rdi
callq 0x14abe
movq %rax, %r14
movq %r15, %rdi
callq 0x14abe
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xdc46
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jb 0x1234b
movsd %xmm0, 0x10(%rax)
movq %r12, %rdi
callq 0x14b0e
movl (%rax), %esi
movq 0x60(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %rsi, %rdx
jbe 0x12350
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rdi
movl $0x3, %esi
callq 0x125b6
movq %r12, %rdi
callq 0x14b0e
movl (%rax), %esi
movq 0x60(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %rsi, %rdx
jbe 0x12350
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1261c
movl 0xc(%rsp), %ebx
incl %ebx
movq 0x18(%rsp), %r14
jmp 0x11bda
movl 0x2c(%rsp), %ebx
incl %ebx
jmp 0x11b9f
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1232f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x42e0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %esi, %esi
xorl %edx, %edx
jmp 0x12350
movl $0x1, %esi
jmp 0x12350
movl $0x2, %esi
leaq 0x29fd2(%rip), %rdi     # 0x3c329
xorl %eax, %eax
callq 0x4440
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
jmp 0x12396
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x123b0
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x42e0
movq %rbx, %rdi
callq 0x4550