// File: /workspace/github_c_makefile_star2_O3/josch[P]stride/hydrbond.c
// Function: FindDnr
int FindDnr(CHAIN *Chain, DONOR **Dnr, int *NDnr, COMMAND *Cmd)
{

  int Res, dc;
  char Rsd[RES_FIELD];
  
  dc = *NDnr;

  for( Res=0; Res<Chain->NRes; Res++ ) {

    strcpy(Rsd,Chain->Rsd[Res]->ResType);

    DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Peptide,1.90,0);

    if( !Cmd->SideChainHBond ) continue;

    if( !strcmp(Rsd,"TRP") ) 
      DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Trp,1.90,0); 
    else if( !strcmp(Rsd,"ASN") ) DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Asn,1.90,0); 
    else if( !strcmp(Rsd,"GLN") ) DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Gln,1.90,0); 
    else if( !strcmp(Rsd,"ARG") ) {
      DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Arg,1.90,1);
      DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Arg,1.90,2);
      DefineDnr(Chain,Dnr,&dc,Res,Nsp2,Arg,1.90,3);
    }
    else if( !strcmp(Rsd,"HIS") ) {
      DefineDnr(Chain,Dnr,&dc,Res,Nsp2,His,1.90,1);
      DefineDnr(Chain,Dnr,&dc,Res,Nsp2,His,1.90,2);
    }
    else if( !strcmp(Rsd,"LYS") ) DefineDnr(Chain,Dnr,&dc,Res,Nsp3,Lys,2.10,0); 
    else if( !strcmp(Rsd,"SER") ) DefineDnr(Chain,Dnr,&dc,Res,Osp3,Ser,1.70,0);
    else if( !strcmp(Rsd,"THR") ) DefineDnr(Chain,Dnr,&dc,Res,Osp3,Thr,1.70,0);
    else if( !strcmp(Rsd,"TYR") ) DefineDnr(Chain,Dnr,&dc,Res,Osp2,Tyr,1.70,0); 
  }

  *NDnr = dc;
  return(dc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl (%rdx), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x0, (%rdi)
jle 0x8b3d
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, 0x20(%rsp)
xorl %r13d, %r13d
leaq 0x16(%rsp), %rbp
leaq 0x1c(%rsp), %rbx
movq 0x68(%r12), %rax
movq (%rax,%r13,8), %rsi
addq $0xa, %rsi
movq %rbp, %rdi
callq 0x2070
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
movss 0x115ea(%rip), %xmm0    # 0x19ebc
callq 0x8b4e
cmpl $0x0, 0x1d48(%r14)
je 0x8aac
cmpl $0x505254, 0x16(%rsp)   # imm = 0x505254
je 0x8987
cmpl $0x4e5341, 0x16(%rsp)   # imm = 0x4E5341
je 0x89a8
cmpl $0x4e4c47, 0x16(%rsp)   # imm = 0x4E4C47
je 0x89c9
cmpl $0x475241, 0x16(%rsp)   # imm = 0x475241
je 0x89ea
cmpl $0x534948, 0x16(%rsp)   # imm = 0x534948
je 0x8a5a
cmpl $0x53594c, 0x16(%rsp)   # imm = 0x53594C
je 0x8abe
cmpl $0x524553, 0x16(%rsp)   # imm = 0x524553
je 0x8ae7
cmpl $0x524854, 0x16(%rsp)   # imm = 0x524854
je 0x8b08
cmpl $0x525954, 0x16(%rsp)   # imm = 0x525954
jne 0x8aac
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movl $0x2, %r8d
movl $0x9, %r9d
jmp 0x8b27
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
jmp 0x8a9f
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x2, %r9d
jmp 0x8a9f
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x3, %r9d
jmp 0x8a9f
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x4, %r9d
movss 0x114ae(%rip), %xmm0    # 0x19ebc
callq 0x8b4e
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x4, %r9d
movss 0x11485(%rip), %xmm0    # 0x19ebc
callq 0x8b4e
movl $0x3, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x4, %r9d
jmp 0x8a9f
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x5, %r9d
movss 0x1143e(%rip), %xmm0    # 0x19ebc
callq 0x8b4e
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
xorl %r8d, %r8d
movl $0x5, %r9d
movss 0x11415(%rip), %xmm0    # 0x19ebc
callq 0x8b4e
incq %r13
movslq (%r12), %rax
cmpq %rax, %r13
jl 0x889c
jmp 0x8b34
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movl $0x1, %r8d
movl $0x6, %r9d
movss 0x113df(%rip), %xmm0    # 0x19ec4
jmp 0x8aa7
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movl $0x3, %r8d
movl $0x7, %r9d
jmp 0x8b27
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movl $0x3, %r8d
movl $0x8, %r9d
movss 0x11391(%rip), %xmm0    # 0x19ec0
jmp 0x8aa7
movl 0x1c(%rsp), %eax
movq 0x20(%rsp), %rdx
movl %eax, (%rdx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq