// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/dof_tnm.c
// Function: Axe_prot_side
void Axe_prot_side(struct axe *axe_side, int *N_side, struct side_chain *sc,
		   struct bond *bond, int ibond,
		   atom *atoms, int natoms, int *refatom)
{
  if(bond->atom->res!=sc->res){
    // Residue start
    sc->res=bond->atom->res;
    sc->aa= bond->atom->aa;
    if((sc->aa=='G')||(sc->aa=='A')||(sc->aa=='P'))return;
    
    // Find first and last atom in side chain
    sc->first_atom=-1;
    sc->last_atom=-1;
    sc->first_ref=-1;
    sc->last_ref=-1;
    int i;
    for(i=bond->i_atom; i<natoms; i++){
      atom *atom_i=atoms+i;
      if((atom_i->res>sc->res)||
	 (strncmp(atom_i->name,"OT", 2)==0)||
	 (strncmp(atom_i->name,"OX", 2)==0))
	break;
      if((strncmp(atom_i->name,"N ", 2)==0)||
	 (strncmp(atom_i->name,"CA", 2)==0)||
	 (strncmp(atom_i->name,"CB", 2)==0))continue;
      if((strncmp(atom_i->name,"C ", 2)!=0)&&
	 (strncmp(atom_i->name,"O ", 2)!=0)){
	sc->last_atom=i;
	if(sc->first_atom<0)sc->first_atom=i;
	int iref=refatom[i];
	if(iref>=0){
	  sc->last_ref=iref; if(sc->first_ref<0)sc->first_ref=iref;
	}
      }
    }
    sc->ndof=0; sc->numdof=0; sc->oldref=0;
  }
  
  if((bond->terminal)||
     (strncmp(bond->atom->name,"N ", 2)==0)||
     (strncmp(bond->atom->name,"CA", 2)==0)||
     (strncmp(bond->atom->name,"C ", 2)==0)||
     (strncmp(bond->atom->name,"O ", 2)==0))
    return;
    
  if((sc->first_atom<0)||(sc->first_ref<0)||
     (sc->aa=='G')||(sc->aa=='A')||(sc->aa=='P'))return;
  
  if(((strncmp(bond->atom->name,"CB", 2)!=0)&&
      (strncmp(bond->atom->name,"CG", 2)==0))&&
     ((sc->aa=='F')||(sc->aa=='W')||(sc->aa=='Y')||(sc->aa=='H'))){
    return;  // if aromatic ring, exit
  }

  //sprintf(type, "%1d", sc->numdof);
  struct axe *axe=axe_side+*N_side;
  int first_atom=(Next_bond(bond, ibond, natoms))->i_atom;
  if(Set_dof(&axe, N_side, 's', bond, first_atom, &sc->ndof,
	     &sc->oldref, refatom, natoms, sc->last_atom, sc->last_ref)){
    sc->numdof++;
  }
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movl %r8d, -0x34(%rbp)
movq %r9, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl 0x64(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x1ac74
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl 0x64(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movb 0x68(%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x47, %eax
je 0x1aaa9
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
je 0x1aaa9
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x50, %eax
jne 0x1aaae
jmp 0x1ae59
movq -0x28(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl 0x10(%rbp), %eax
jge 0x1ac53
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl 0x64(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jg 0x1ab4f
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
leaq 0x60514(%rip), %rsi     # 0x7b036
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1ab4f
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
leaq 0x604f9(%rip), %rsi     # 0x7b039
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x1ab54
jmp 0x1ac53
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
leaq 0x604ca(%rip), %rsi     # 0x7b02d
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1abae
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
leaq 0x5b787(%rip), %rsi     # 0x76308
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1abae
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
leaq 0x5b7aa(%rip), %rsi     # 0x76349
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x1abb3
jmp 0x1ac45
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
leaq 0x6046e(%rip), %rsi     # 0x7b030
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1ac43
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
leaq 0x60453(%rip), %rsi     # 0x7b033
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1ac43
movl -0x44(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jge 0x1ac0d
movl -0x44(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xc(%rax)
movq 0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jl 0x1ac41
movl -0x54(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jge 0x1ac3f
movl -0x54(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0x1ac41
jmp 0x1ac43
jmp 0x1ac45
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1aae4
movq -0x28(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x1ad06
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x60399(%rip), %rsi     # 0x7b02d
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1ad06
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x5b653(%rip), %rsi     # 0x76308
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1ad06
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x6035a(%rip), %rsi     # 0x7b030
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1ad06
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x6033c(%rip), %rsi     # 0x7b033
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x1ad0b
jmp 0x1ae59
movq -0x28(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jl 0x1ad43
movq -0x28(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jl 0x1ad43
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x47, %eax
je 0x1ad43
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
je 0x1ad43
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x50, %eax
jne 0x1ad48
jmp 0x1ae59
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x5b5ef(%rip), %rsi     # 0x76349
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1adbf
movq -0x30(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x60391(%rip), %rsi     # 0x7b10c
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x1adbf
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
je 0x1adba
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x57, %eax
je 0x1adba
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x59, %eax
je 0x1adba
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x48, %eax
jne 0x1adbf
jmp 0x1ae59
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x158, %rcx, %rcx      # imm = 0x158
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movl 0x10(%rbp), %edx
callq 0x1af00
movl 0x20(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rcx
movl -0x64(%rbp), %r8d
movq -0x28(%rbp), %r9
addq $0x1c, %r9
movq -0x28(%rbp), %r14
addq $0x20, %r14
movq 0x18(%rbp), %rbx
movl 0x10(%rbp), %r11d
movq -0x28(%rbp), %rax
movl 0x14(%rax), %r10d
movq -0x28(%rbp), %rax
movl 0x18(%rax), %eax
leaq -0x60(%rbp), %rdi
movl $0x73, %edx
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
callq 0x1a3e0
cmpl $0x0, %eax
je 0x1ae57
movq -0x28(%rbp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
jmp 0x1ae59
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)