// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/interactions_tnm.c
// Function: Heavy_atom
int Heavy_atom(int *iatom, atom *atoms)
{
  if(atoms[*iatom].name[0]!='H')return(0); // Not hydrogen atoms
  atom *atom1=atoms+*iatom;
  int i, imin=*iatom, res=atom1->res;
  double dmin=100, *r=atom1->r;
  char branch=atom1->name[1];
  if((branch=='N')||(branch=='1')||(branch=='2')||(branch=='3'))branch=' ';
  for(i=*iatom-1; i>=0; i--){
    atom1--; if(atom1->res!=res)break;
    if((atom1->name[0]!='H')&&(atom1->name[1]==branch)){
      double x=r[0]-atom1->r[0], d=x*x;
      x=r[1]-atom1->r[1]; d+=x*x;
      x=r[2]-atom1->r[2]; d+=x*x;
      if(d<dmin){dmin=d; imin=i;}
    }
  }

  if(*iatom==imin){
    printf("WARNING, atom %s %d, no heavy atom found\n",
	   atoms[*iatom].name, *iatom); return(0);
  }else if(dmin > 4){
    printf("WARNING, atom %s %d, heavy atom %s %d has d=%.3f\n",
	   atoms[*iatom].name, *iatom, atoms[imin].name, imin, dmin);
  }
  *iatom=imin; return(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsbl 0x18(%rax), %eax
cmpl $0x48, %eax
je 0x21837
movl $0x0, -0x4(%rbp)
jmp 0x21a64
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq (%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, -0x2c(%rbp)
movsd 0x5a7b8(%rip), %xmm0    # 0x7c020
movsd %xmm0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movb 0x19(%rax), %al
movb %al, -0x41(%rbp)
movsbl -0x41(%rbp), %eax
cmpl $0x4e, %eax
je 0x218a3
movsbl -0x41(%rbp), %eax
cmpl $0x31, %eax
je 0x218a3
movsbl -0x41(%rbp), %eax
cmpl $0x32, %eax
je 0x218a3
movsbl -0x41(%rbp), %eax
cmpl $0x33, %eax
jne 0x218a7
movb $0x20, -0x41(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x219bb
movq -0x20(%rbp), %rax
addq $-0x70, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x64(%rax), %eax
cmpl -0x2c(%rbp), %eax
je 0x218da
jmp 0x219bb
movq -0x20(%rbp), %rax
movsbl 0x18(%rax), %eax
cmpl $0x48, %eax
je 0x219ab
movq -0x20(%rbp), %rax
movsbl 0x19(%rax), %eax
movsbl -0x41(%rbp), %ecx
cmpl %ecx, %eax
jne 0x219ab
movq -0x40(%rbp), %rax
movsd (%rax), %xmm0
movq -0x20(%rbp), %rax
subsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x40(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x20(%rbp), %rax
subsd 0x8(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
movsd -0x58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x40(%rbp), %rax
movsd 0x10(%rax), %xmm0
movq -0x20(%rbp), %rax
subsd 0x10(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
movsd -0x58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x219a9
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x219ab
jmp 0x219ad
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x218b3
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpl -0x28(%rbp), %eax
jne 0x219f9
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movslq (%rax), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x18, %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq 0x5a73d(%rip), %rdi     # 0x7c126
movb $0x0, %al
callq 0x10d0
movl $0x0, -0x4(%rbp)
jmp 0x21a64
movsd -0x38(%rbp), %xmm0
movsd 0x5a622(%rip), %xmm1    # 0x7c028
ucomisd %xmm1, %xmm0
jbe 0x21a52
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movslq (%rax), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x18, %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
movq -0x18(%rbp), %rcx
movslq -0x28(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rcx
addq $0x18, %rcx
movl -0x28(%rbp), %r8d
movsd -0x38(%rbp), %xmm0
leaq 0x5a705(%rip), %rdi     # 0x7c150
movb $0x1, %al
callq 0x10d0
jmp 0x21a54
movl -0x28(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)