// File: /workspace/github_cpp_makefile_star2_O2/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 $0x78, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movq %rdi, 0x68(%rsp)
callq 0x1ac18
movl %eax, %esi
movq %rbx, %rdi
callq 0xca00
movq %rbx, 0x70(%rsp)
xorl %ebx, %ebx
movl %ebx, 0x3c(%rsp)
movq 0x68(%rsp), %rdi
callq 0x19fa2
cmpl %eax, %ebx
jae 0xc6c7
movq 0x68(%rsp), %rdi
leaq 0x3c(%rsp), %rsi
callq 0x19fb0
movq %rax, %r14
movq %rax, %rdi
callq 0x1785e
movl %eax, 0x2c(%rsp)
xorl %ebx, %ebx
movq %r14, 0x20(%rsp)
movl %ebx, 0xc(%rsp)
movq %r14, %rdi
callq 0x1785e
cmpl %eax, %ebx
jae 0xc6bc
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x177da
movq %rax, %rbp
cmpl $0x2, 0xc(%rsp)
jb 0xc105
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %ebx
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
addl $-0x2, %ebx
cmpl (%rax), %ebx
jne 0xc064
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, 0x30(%rsp)
jmp 0xc10e
cmpl $0x2, 0xc(%rsp)
jb 0xc105
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %ebx
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
cmpl (%rax), %ebx
jne 0xc105
movq %rbp, %rdi
callq 0xea34
movq %rax, %rbx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x1c(%rsp)
movq %r14, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea34
movq %rbx, %rdi
xorl %esi, %esi
pushq $0x1
popq %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movq %rdx, %r9
callq 0x4060
testl %eax, %eax
je 0xc105
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, 0x30(%rsp)
jmp 0xc10e
movq $0x0, 0x30(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0xc209
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %ebx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
decl %ebx
cmpl (%rax), %ebx
jne 0xc16c
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rbx
jmp 0xc20b
cmpl $0x0, 0xc(%rsp)
je 0xc209
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %ebx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
cmpl (%rax), %ebx
jne 0xc209
movq %rbp, %rdi
callq 0xea34
movq %rax, %rbx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x1c(%rsp)
movq %r14, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea34
movq %rbx, %rdi
xorl %esi, %esi
pushq $0x1
popq %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movq %rdx, %r9
callq 0x4060
testl %eax, %eax
je 0xc209
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
jmp 0xc164
xorl %ebx, %ebx
movl 0xc(%rsp), %ecx
incl %ecx
cmpl 0x2c(%rsp), %ecx
jae 0xc26c
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %r14d
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
incl %r14d
movl 0xc(%rsp), %ecx
cmpl (%rax), %r14d
jne 0xc26a
incl %ecx
movl %ecx, 0x10(%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
jmp 0xc305
incl %ecx
cmpl 0x2c(%rsp), %ecx
jae 0xc30a
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %r14d
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
cmpl (%rax), %r14d
jne 0xc30a
movq %rbp, %rdi
callq 0xea34
movq %rax, %r14
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x1c(%rsp)
movq %r15, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea34
movq %r14, %rdi
xorl %esi, %esi
pushq $0x1
popq %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movq %rdx, %r9
callq 0x4060
testl %eax, %eax
je 0xc30a
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %r13
jmp 0xc30d
xorl %r13d, %r13d
movl 0xc(%rsp), %ecx
addl $0x2, %ecx
cmpl 0x2c(%rsp), %ecx
jae 0xc372
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %r14d
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
addl $0x2, %r14d
movl 0xc(%rsp), %ecx
cmpl (%rax), %r14d
jne 0xc36f
addl $0x2, %ecx
movl %ecx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
jmp 0xc40f
addl $0x2, %ecx
cmpl 0x2c(%rsp), %ecx
jae 0xc414
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %r14d
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
cmpl (%rax), %r14d
jne 0xc414
movq %rbp, %rdi
callq 0xea34
movq %rax, %r14
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x1c(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea34
movq %r14, %rdi
xorl %esi, %esi
pushq $0x1
popq %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movq %rdx, %r9
callq 0x4060
testl %eax, %eax
je 0xc414
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %r14
jmp 0xc417
xorl %r14d, %r14d
movl 0xc(%rsp), %ecx
addl $0x3, %ecx
cmpl 0x2c(%rsp), %ecx
jae 0xc47c
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %r15d
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
addl $0x3, %r15d
movl 0xc(%rsp), %ecx
cmpl (%rax), %r15d
jne 0xc479
addl $0x3, %ecx
movl %ecx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
jmp 0xc519
addl $0x3, %ecx
cmpl 0x2c(%rsp), %ecx
jae 0xc51e
movq %rbp, %rdi
callq 0xea2c
movl (%rax), %r15d
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea2c
cmpl (%rax), %r15d
jne 0xc51e
movq %rbp, %rdi
callq 0xea34
movq %rax, %r15
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x1c(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x177da
movq %rax, %rdi
callq 0xea34
movq %r15, %rdi
xorl %esi, %esi
pushq $0x1
popq %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movq %rdx, %r9
callq 0x4060
testl %eax, %eax
je 0xc51e
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x177da
movq %rax, %r15
jmp 0xc521
xorl %r15d, %r15d
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0xc532
movq %rax, 0x48(%rsp)
movabsq $0x40c387f333333333, %rax # imm = 0x40C387F333333333
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
pushq $0x3
popq %rsi
leaq 0x10(%rsp), %rdx
callq 0xca68
testq %rbx, %rbx
sete %al
testq %r13, %r13
sete %cl
orb %al, %cl
jne 0xc5ab
movq %rbx, %rdi
callq 0xea3c
movq %rax, %rbx
movq %rbp, %rdi
callq 0xea3c
movq %rax, %r12
movq %r13, %rdi
callq 0xea3c
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x930c
movsd %xmm0, 0x60(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0xc916
movsd 0x60(%rsp), %xmm0
movsd %xmm0, (%rax)
testq %r13, %r13
je 0xc611
testq %r14, %r14
je 0xc611
testq %r15, %r15
je 0xc611
movq %rbp, %rdi
callq 0xea3c
movq %rax, %rbx
movq %r13, %rdi
callq 0xea3c
movq %rax, %r13
movq %r14, %rdi
callq 0xea3c
movq %rax, %r12
movq %r15, %rdi
callq 0xea3c
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0x952e
movsd %xmm0, 0x60(%rsp)
leaq 0x40(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xc916
movsd 0x60(%rsp), %xmm0
movsd %xmm0, (%rax)
testq %r14, %r14
sete %al
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0xc66c
callq 0xea3c
movq %rax, %rbx
movq %rbp, %rdi
callq 0xea3c
movq %rax, %r15
movq %r14, %rdi
callq 0xea3c
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x930c
movsd %xmm0, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0xc916
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbp, %rdi
callq 0xea8c
movl (%rax), %esi
movq 0x70(%rsp), %rdi
callq 0xc8f8
movq %rax, %rdi
pushq $0x3
popq %rsi
callq 0xca36
movq %rbp, %rdi
callq 0xea8c
movl (%rax), %esi
movq 0x70(%rsp), %rdi
callq 0xc8f8
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0xca9c
movl 0xc(%rsp), %ebx
incl %ebx
movq 0x20(%rsp), %r14
jmp 0xbfdb
movl 0x3c(%rsp), %ebx
incl %ebx
jmp 0xbfa0
leaq 0x40(%rsp), %rdi
callq 0x5a00
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
jmp 0xc718
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5a00
movq %rbx, %rdi
callq 0x4560
nop