// File: /workspace/github_c_makefile_star2_O1/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
movq %rdx, 0x20(%rsp)
movl (%rdx), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x0, (%rdi)
jle 0x9384
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
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 0x10dcf(%rip), %xmm0    # 0x19eb8
callq 0x939e
cmpl $0x0, 0x1d48(%r14)
je 0x923f
cmpl $0x534948, 0x16(%rsp)   # imm = 0x534948
je 0x91ab
cmpl $0x524553, 0x16(%rsp)   # imm = 0x524553
je 0x91f4
cmpl $0x524854, 0x16(%rsp)   # imm = 0x524854
je 0x9214
cmpl $0x4e5341, 0x16(%rsp)   # imm = 0x4E5341
je 0x9254
cmpl $0x4e4c47, 0x16(%rsp)   # imm = 0x4E4C47
je 0x9277
cmpl $0x505341, 0x16(%rsp)   # imm = 0x505341
je 0x929a
cmpl $0x554c47, 0x16(%rsp)   # imm = 0x554C47
je 0x92e8
cmpl $0x525954, 0x16(%rsp)   # imm = 0x525954
je 0x9336
cmpl $0x54454d, 0x16(%rsp)   # imm = 0x54454D
je 0x9359
cmpl $0x535943, 0x16(%rsp)   # imm = 0x535943
jne 0x923f
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x4, %r8d
movl $0xd, %r9d
jmp 0x9232
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 0x10cec(%rip), %xmm0    # 0x19eb8
callq 0x939e
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 0x10cc6(%rip), %xmm0    # 0x19eb8
jmp 0x923a
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x3, %r8d
movl $0x7, %r9d
jmp 0x9232
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x3, %r8d
movl $0x8, %r9d
movss 0x10c76(%rip), %xmm0    # 0x19eb0
callq 0x939e
incq %rbx
movslq (%r12), %rax
cmpq %rax, %rbx
jl 0x90b1
jmp 0x9384
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0x2, %r9d
jmp 0x91ea
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0x3, %r9d
jmp 0x91ea
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xa, %r9d
movss 0x10bf8(%rip), %xmm0    # 0x19eb8
callq 0x939e
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xa, %r9d
jmp 0x91ea
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xb, %r9d
movss 0x10baa(%rip), %xmm0    # 0x19eb8
callq 0x939e
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0xb, %r9d
jmp 0x91ea
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x2, %r8d
movl $0x9, %r9d
jmp 0x9232
movl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl %ebx, %ecx
movl $0x4, %r8d
movl $0xc, %r9d
movss 0x10b3d(%rip), %xmm0    # 0x19ebc
jmp 0x923a
movl 0x1c(%rsp), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq