// File: /workspace/github_c_makefile_star2_O2/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 %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, 0x18(%rsp)
movl (%rdx), %eax
leaq 0x14(%rsp), %r13
movl %eax, (%r13)
xorl %ebp, %ebp
pushq $0x2
popq %rbx
movq %rcx, 0x20(%rsp)
movslq (%r12), %rax
cmpq %rax, %rbp
jge 0x8609
movq 0x68(%r12), %rax
movq (%rax,%rbp,8), %rsi
addq $0xa, %rsi
leaq 0xe(%rsp), %rdi
callq 0x2070
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
xorl %r9d, %r9d
movss 0x10abf(%rip), %xmm0    # 0x18e90
callq 0x8623
cmpl $0x0, 0x1d48(%r14)
je 0x85c7
cmpl $0x534948, 0xe(%rsp)    # imm = 0x534948
je 0x8487
cmpl $0x524553, 0xe(%rsp)    # imm = 0x524553
je 0x84d1
cmpl $0x524854, 0xe(%rsp)    # imm = 0x524854
je 0x84e8
cmpl $0x4e5341, 0xe(%rsp)    # imm = 0x4E5341
je 0x850c
cmpl $0x4e4c47, 0xe(%rsp)    # imm = 0x4E4C47
je 0x8526
cmpl $0x505341, 0xe(%rsp)    # imm = 0x505341
je 0x853c
cmpl $0x554c47, 0xe(%rsp)    # imm = 0x554C47
je 0x857b
cmpl $0x525954, 0xe(%rsp)    # imm = 0x525954
je 0x85cf
cmpl $0x54454d, 0xe(%rsp)    # imm = 0x54454D
je 0x85e8
cmpl $0x535943, 0xe(%rsp)    # imm = 0x535943
jne 0x85c7
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
pushq $0x4
popq %r8
pushq $0xd
jmp 0x84fd
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
xorl %r8d, %r8d
movl %ebx, %r14d
pushq $0x5
popq %rbx
movl %ebx, %r9d
movss 0x109e6(%rip), %xmm0    # 0x18e90
callq 0x8623
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
xorl %r8d, %r8d
movl %ebx, %r9d
movl %r14d, %ebx
movq 0x20(%rsp), %r14
jmp 0x85ba
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
pushq $0x3
popq %r8
pushq $0x7
jmp 0x84fd
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
pushq $0x3
popq %r8
pushq $0x8
popq %r9
movss 0x10981(%rip), %xmm0    # 0x18e88
jmp 0x85c2
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
movl %ebx, %r9d
jmp 0x85ba
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
pushq $0x3
jmp 0x85b8
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
pushq $0xa
popq %r9
movss 0x10933(%rip), %xmm0    # 0x18e90
callq 0x8623
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
pushq $0xa
jmp 0x85b8
movl $0x1, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
pushq $0xb
popq %r9
movss 0x108f4(%rip), %xmm0    # 0x18e90
callq 0x8623
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
pushq $0xb
popq %r9
movss 0x108ce(%rip), %xmm0    # 0x18e90
callq 0x8623
incq %rbp
jmp 0x8390
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
pushq $0x9
jmp 0x84fd
andl $0x0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
pushq $0x4
popq %r8
pushq $0xc
popq %r9
movss 0x1088d(%rip), %xmm0    # 0x18e94
jmp 0x85c2
movl 0x14(%rsp), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq