// File: /workspace/github_c_makefile_star2_O3/josch[P]stride/hydrbond.c
// Function: FindAcc
int FindAcc(CHAIN *Chain, ACCEPTOR **Acc, int *NAcc, COMMAND *Cmd)
{

  int Res, ac;
  char Rsd[RES_FIELD];
  
  ac = *NAcc;

  for( Res=0; Res<Chain->NRes; Res++ ) {
    strcpy(Rsd,Chain->Rsd[Res]->ResType);

    DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Peptide,1.60,0);

    if( !Cmd->SideChainHBond ) continue;

    if( !strcmp(Rsd,"HIS") ) {
      DefineAcceptor(Chain,Acc,&ac,Res,Nsp2,His,1.60,0);
      DefineAcceptor(Chain,Acc,&ac,Res,Nsp2,His,1.60,0);
    }
    else if( !strcmp(Rsd,"SER") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp3,Ser,1.70,0);
    else if( !strcmp(Rsd,"THR") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp3,Thr,1.70,0);
    else if( !strcmp(Rsd,"ASN") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Asn,1.60,0);
    else if( !strcmp(Rsd,"GLN") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Gln,1.60,0);
    else if( !strcmp(Rsd,"ASP") ) {
      DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Asp,1.60,1);
      DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Asp,1.60,2);
    }
    else if( !strcmp(Rsd,"GLU") ) {
      DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Glu,1.60,1);
      DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Glu,1.60,2);
    }
    else if( !strcmp(Rsd,"TYR") ) DefineAcceptor(Chain,Acc,&ac,Res,Osp2,Tyr,1.70,0);
    else if( !strcmp(Rsd,"MET") ) DefineAcceptor(Chain,Acc,&ac,Res,Ssp3,Met,1.95,0);
    else if( !strcmp(Rsd,"CYS") ) DefineAcceptor(Chain,Acc,&ac,Res,Ssp3,Cys,1.70,0);
    }

  *NAcc = ac;
  return(ac);
}

// 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 0x9291
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, 0x20(%rsp)
leaq 0x16(%rsp), %r13
leaq 0x1c(%rsp), %rbp
xorl %ebx, %ebx
movq 0x68(%r12), %rax
movq (%rax,%rbx,8), %rsi
addq $0xa, %rsi
movq %r13, %rdi
callq 0x2070
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
movss 0x10edb(%rip), %xmm0    # 0x19ec8
callq 0x92a2
cmpl $0x0, 0x1d48(%r14)
je 0x9143
cmpl $0x534948, 0x16(%rsp)   # imm = 0x534948
je 0x90af
cmpl $0x524553, 0x16(%rsp)   # imm = 0x524553
je 0x90f8
cmpl $0x524854, 0x16(%rsp)   # imm = 0x524854
je 0x9118
cmpl $0x4e5341, 0x16(%rsp)   # imm = 0x4E5341
je 0x9158
cmpl $0x4e4c47, 0x16(%rsp)   # imm = 0x4E4C47
je 0x917b
cmpl $0x505341, 0x16(%rsp)   # imm = 0x505341
je 0x919e
cmpl $0x554c47, 0x16(%rsp)   # imm = 0x554C47
je 0x91ec
cmpl $0x525954, 0x16(%rsp)   # imm = 0x525954
je 0x923a
cmpl $0x54454d, 0x16(%rsp)   # imm = 0x54454D
je 0x925d
cmpl $0x535943, 0x16(%rsp)   # imm = 0x535943
jne 0x9143
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x4, %r8d
movl $0xd, %r9d
jmp 0x9136
xorl %eax, %eax
movl %eax, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
xorl %r8d, %r8d
movl $0x5, %r9d
movss 0x10df8(%rip), %xmm0    # 0x19ec8
callq 0x92a2
xorl %eax, %eax
movl %eax, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
xorl %r8d, %r8d
movl $0x5, %r9d
movss 0x10dd2(%rip), %xmm0    # 0x19ec8
jmp 0x913e
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x3, %r8d
movl $0x7, %r9d
jmp 0x9136
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x3, %r8d
movl $0x8, %r9d
movss 0x10d82(%rip), %xmm0    # 0x19ec0
callq 0x92a2
incq %rbx
movslq (%r12), %rax
cmpq %rax, %rbx
jl 0x8fb5
jmp 0x9288
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0x2, %r9d
jmp 0x90ee
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0x3, %r9d
jmp 0x90ee
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xa, %r9d
movss 0x10d04(%rip), %xmm0    # 0x19ec8
callq 0x92a2
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xa, %r9d
jmp 0x90ee
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xb, %r9d
movss 0x10cb6(%rip), %xmm0    # 0x19ec8
callq 0x92a2
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xb, %r9d
jmp 0x90ee
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0x9, %r9d
jmp 0x9136
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x4, %r8d
movl $0xc, %r9d
movss 0x10c49(%rip), %xmm0    # 0x19ecc
jmp 0x913e
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