// File: /workspace/github_cpp_makefile_star2_O3/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 0x24632
movl %eax, %esi
movq %rbx, %rdi
callq 0x123d4
movq %rbx, 0x60(%rsp)
xorl %ebx, %ebx
movl %ebx, 0x2c(%rsp)
movq 0x58(%rsp), %rdi
callq 0x235b6
cmpl %eax, %ebx
jae 0x1216b
movq 0x58(%rsp), %rdi
leaq 0x2c(%rsp), %rsi
callq 0x235c4
movq %rax, %r14
movq %rax, %rdi
callq 0x204d2
movl %eax, 0x28(%rsp)
xorl %ebx, %ebx
movq %r14, 0x18(%rsp)
movl %ebx, 0xc(%rsp)
movq %r14, %rdi
callq 0x204d2
cmpl %eax, %ebx
jae 0x12160
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x20468
movq %rax, %r12
cmpl $0x2, 0xc(%rsp)
jb 0x11b5d
movq %r12, %rdi
callq 0x14936
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 0x20468
movq %rax, %rdi
callq 0x14936
addl $-0x2, %ebx
cmpl (%rax), %ebx
jne 0x11ab7
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, 0x50(%rsp)
jmp 0x11b66
cmpl $0x2, 0xc(%rsp)
jb 0x11b5d
movq %r12, %rdi
callq 0x14936
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 0x20468
movq %rax, %rdi
callq 0x14936
cmpl (%rax), %ebx
jne 0x11b5d
movq %r12, %rdi
callq 0x1493e
movq %rax, %rbx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x24(%rsp)
movq %r14, %rdi
leaq 0x24(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x1493e
movl $0x1, %edx
movl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11b5d
movl 0xc(%rsp), %eax
addl $-0x2, %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, 0x50(%rsp)
jmp 0x11b66
movq $0x0, 0x50(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0x11c66
movq %r12, %rdi
callq 0x14936
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 0x20468
movq %rax, %rdi
callq 0x14936
decl %ebx
cmpl (%rax), %ebx
jne 0x11bc4
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %r13
jmp 0x11c69
cmpl $0x0, 0xc(%rsp)
je 0x11c66
movq %r12, %rdi
callq 0x14936
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 0x20468
movq %rax, %rdi
callq 0x14936
cmpl (%rax), %ebx
jne 0x11c66
movq %r12, %rdi
callq 0x1493e
movq %rax, %rbx
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x24(%rsp)
movq %r14, %rdi
leaq 0x24(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x1493e
movl $0x1, %edx
movl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11c66
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
jmp 0x11bbc
xorl %r13d, %r13d
movl 0xc(%rsp), %ecx
incl %ecx
cmpl 0x28(%rsp), %ecx
jae 0x11cc6
movq %r12, %rdi
callq 0x14936
movl (%rax), %ebx
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x14936
incl %ebx
movl 0xc(%rsp), %ecx
cmpl (%rax), %ebx
jne 0x11cc4
incl %ecx
movl %ecx, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
jmp 0x11d63
incl %ecx
cmpl 0x28(%rsp), %ecx
jae 0x11d68
movq %r12, %rdi
callq 0x14936
movl (%rax), %ebx
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x14936
cmpl (%rax), %ebx
jne 0x11d68
movq %r12, %rdi
callq 0x1493e
movq %rax, %rbx
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x1493e
movl $0x1, %edx
movl $0x1, %r9d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11d68
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rbx
jmp 0x11d6a
xorl %ebx, %ebx
movl 0xc(%rsp), %ecx
addl $0x2, %ecx
cmpl 0x28(%rsp), %ecx
jae 0x11dcc
movq %r12, %rdi
callq 0x14936
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x14936
addl $0x2, %ebp
movl 0xc(%rsp), %ecx
cmpl (%rax), %ebp
jne 0x11dc9
addl $0x2, %ecx
movl %ecx, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
jmp 0x11e6c
addl $0x2, %ecx
cmpl 0x28(%rsp), %ecx
jae 0x11e71
movq %r12, %rdi
callq 0x14936
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x14936
cmpl (%rax), %ebp
jne 0x11e71
movq %r12, %rdi
callq 0x1493e
movq %rax, %r15
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x1493e
movl $0x1, %edx
movl $0x1, %r9d
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11e71
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %r15
jmp 0x11e74
xorl %r15d, %r15d
movl 0xc(%rsp), %ecx
addl $0x3, %ecx
cmpl 0x28(%rsp), %ecx
jae 0x11ed6
movq %r12, %rdi
callq 0x14936
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x14936
addl $0x3, %ebp
movl 0xc(%rsp), %ecx
cmpl (%rax), %ebp
jne 0x11ed3
addl $0x3, %ecx
movl %ecx, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
jmp 0x11f76
addl $0x3, %ecx
cmpl 0x28(%rsp), %ecx
jae 0x11f7b
movq %r12, %rdi
callq 0x14936
movl (%rax), %ebp
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x14936
cmpl (%rax), %ebp
jne 0x11f7b
movq %r12, %rdi
callq 0x1493e
movq %rax, %rbp
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x20468
movq %rax, %rdi
callq 0x1493e
movl $0x1, %edx
movl $0x1, %r9d
movq %rbp, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
je 0x11f7b
movl 0xc(%rsp), %eax
addl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x20468
movq %rax, %rbp
jmp 0x11f7d
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x11f8e
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 0x12442
testq %r13, %r13
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x12001
movq %r13, %rdi
callq 0x14946
movq %rax, %r13
movq %r12, %rdi
callq 0x14946
movq %rax, %r14
movq %rbx, %rdi
callq 0x14946
movq %r13, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xdac6
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x1219f
movsd %xmm0, (%rax)
testq %rbx, %rbx
je 0x1206a
testq %r15, %r15
je 0x1206a
testq %rbp, %rbp
je 0x1206a
movq %r12, %rdi
callq 0x14946
movq %rax, %r13
movq %rbx, %rdi
callq 0x14946
movq %rax, %rbx
movq %r15, %rdi
callq 0x14946
movq %rax, %r14
movq %rbp, %rdi
callq 0x14946
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rax, %rcx
callq 0xdd4e
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x2, %rdx
jb 0x12191
movsd %xmm0, 0x8(%rax)
testq %r15, %r15
sete %al
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x120c8
callq 0x14946
movq %rax, %rbx
movq %r12, %rdi
callq 0x14946
movq %rax, %r14
movq %r15, %rdi
callq 0x14946
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xdac6
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x3, %rdx
jb 0x12198
movsd %xmm0, 0x10(%rax)
movq %r12, %rdi
callq 0x14996
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 0x121a3
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rdi
movl $0x3, %esi
callq 0x12410
movq %r12, %rdi
callq 0x14996
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 0x121a3
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rdi
leaq 0x30(%rsp), %rsi
callq 0x12476
movl 0xc(%rsp), %ebx
incl %ebx
movq 0x18(%rsp), %r14
jmp 0x11a2e
movl 0x2c(%rsp), %ebx
incl %ebx
jmp 0x119f3
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x12182
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
movl $0x1, %esi
jmp 0x121a3
movl $0x2, %esi
jmp 0x121a3
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2917f(%rip), %rdi     # 0x3b329
xorl %eax, %eax
callq 0x4440
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
jmp 0x121e9
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x12203
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x42e0
movq %rbx, %rdi
callq 0x4550
nop