// File: /workspace/github_c_makefile_star2_O1/josch[P]stride/pdbasn.c
// Function: GetPdbAsn
void GetPdbAsn(CHAIN **Chain, int NChain)
{

  register int i, j, k;
  int Cn, Beg, End;
  char SecondStr;
  CHAIN *c;

  for( Cn=0; Cn<NChain; Cn++ ) {

    c = Chain[Cn];

    for( i=0; i<c->NHelix; i++ ) {

      switch( c->Helix[i]->Class ) {
      case 1:  SecondStr = 'H';
	break;
      case 3:  SecondStr = 'I';
	break;
      case 5:  SecondStr = 'G';
	break;
      }

      if( PdbN2SeqN(c,c->Helix[i]->PDB_ResNumb1,&Beg) &&
	  PdbN2SeqN(c,c->Helix[i]->PDB_ResNumb2,&End) )
	for( j=Beg; j<=End; j++ )
	  if( c->Rsd[j]->Prop->PdbAsn != 'H' )
	    c->Rsd[j]->Prop->PdbAsn = SecondStr;
    }
    
    for( i=0; i<c->NSheet; i++ )
      for( j=0; j<c->Sheet[i]->NStrand; j++ ) {
	  if( PdbN2SeqN(c,c->Sheet[i]->PDB_ResNumb1[j],&Beg) &&
	      PdbN2SeqN(c,c->Sheet[i]->PDB_ResNumb2[j],&End) )
	    for( k=Beg; k<=End; k++ )
	      if( c->Rsd[k]->Prop->PdbAsn != 'H' )
		c->Rsd[k]->Prop->PdbAsn = 'E';
	}

    for( i=0; i<c->NTurn; i++ ) { 
      if( PdbN2SeqN(c,c->Turn[i]->PDB_ResNumb1,&Beg) &&
	  PdbN2SeqN(c,c->Turn[i]->PDB_ResNumb2,&End) )
	for( j=Beg; j<=End; j++ )
	  if( c->Rsd[j]->Prop->PdbAsn != 'H' &&  c->Rsd[j]->Prop->PdbAsn != 'E' )
	    c->Rsd[j]->Prop->PdbAsn = 'T';
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
testl %esi, %esi
jle 0x159bb
movl %esi, %eax
movq %rax, 0x10(%rsp)
xorl %ecx, %ecx
leaq 0xc(%rsp), %r14
leaq 0x8(%rsp), %r15
movq 0x18(%rsp), %rax
movq (%rax,%rcx,8), %r12
cmpl $0x0, 0x1c(%r12)
movq %rcx, 0x20(%rsp)
jle 0x15827
xorl %ebx, %ebx
movq 0x80(%r12), %rax
movq (%rax,%rbx,8), %rsi
movl 0x1c(%rsi), %eax
cmpl $0x5, %eax
je 0x157a6
cmpl $0x3, %eax
je 0x157a1
cmpl $0x1, %eax
jne 0x157a9
movb $0x48, %bpl
jmp 0x157a9
movb $0x49, %bpl
jmp 0x157a9
movb $0x47, %bpl
addq $0xc, %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x4f1c
testl %eax, %eax
je 0x15816
movq 0x80(%r12), %rax
movq (%rax,%rbx,8), %rsi
addq $0x12, %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x4f1c
testl %eax, %eax
je 0x15816
movslq 0xc(%rsp), %rdx
movl 0x8(%rsp), %eax
cmpl %eax, %edx
jg 0x15816
movq %rdx, %rcx
shlq $0x3, %rcx
addq 0x68(%r12), %rcx
subl %edx, %eax
incl %eax
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq 0x768(%rsi), %rsi
cmpb $0x48, 0x1d(%rsi)
je 0x1580f
movb %bpl, 0x1d(%rsi)
incq %rdx
cmpl %edx, %eax
jne 0x157fa
incq %rbx
movslq 0x1c(%r12), %rax
cmpq %rax, %rbx
jl 0x1577e
movb %bpl, 0x7(%rsp)
cmpl $0x0, 0x20(%r12)
jle 0x15903
xorl %ebx, %ebx
movq 0x88(%r12), %rax
movq (%rax,%rbx,8), %rax
cmpl $0x0, (%rax)
jle 0x158f2
xorl %ebp, %ebp
leaq (,%rbp,2), %r13
addq %rbp, %r13
leaq (%rax,%r13,2), %rsi
addq $0xfa, %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x4f1c
testl %eax, %eax
je 0x158d7
movq 0x88(%r12), %rax
movq (%rax,%rbx,8), %rax
leaq (%rax,%r13,2), %rsi
addq $0x172, %rsi            # imm = 0x172
movq %r12, %rdi
movq %r15, %rdx
callq 0x4f1c
testl %eax, %eax
je 0x158d7
movslq 0xc(%rsp), %rdx
movl 0x8(%rsp), %eax
cmpl %eax, %edx
jg 0x158d7
movq %rdx, %rcx
shlq $0x3, %rcx
addq 0x68(%r12), %rcx
subl %edx, %eax
incl %eax
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq 0x768(%rsi), %rsi
cmpb $0x48, 0x1d(%rsi)
je 0x158d0
movb $0x45, 0x1d(%rsi)
incq %rdx
cmpl %edx, %eax
jne 0x158bb
incq %rbp
movq 0x88(%r12), %rax
movq (%rax,%rbx,8), %rax
movslq (%rax), %rcx
cmpq %rcx, %rbp
jl 0x15851
incq %rbx
movslq 0x20(%r12), %rax
cmpq %rax, %rbx
jl 0x1583a
cmpl $0x0, 0x24(%r12)
movb 0x7(%rsp), %bpl
jle 0x159a8
xorl %ebx, %ebx
movq 0x90(%r12), %rax
movq (%rax,%rbx,8), %rsi
addq $0xc, %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x4f1c
testl %eax, %eax
je 0x15997
movq 0x90(%r12), %rax
movq (%rax,%rbx,8), %rsi
addq $0x12, %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x4f1c
testl %eax, %eax
je 0x15997
movslq 0xc(%rsp), %rdx
movl 0x8(%rsp), %eax
cmpl %eax, %edx
jg 0x15997
movq %rdx, %rcx
shlq $0x3, %rcx
addq 0x68(%r12), %rcx
subl %edx, %eax
incl %eax
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq 0x768(%rsi), %rsi
movzbl 0x1d(%rsi), %edi
cmpl $0x45, %edi
je 0x15990
cmpl $0x48, %edi
je 0x15990
movb $0x54, 0x1d(%rsi)
incq %rdx
cmpl %edx, %eax
jne 0x15973
incq %rbx
movslq 0x24(%r12), %rax
cmpq %rax, %rbx
jl 0x15916
movq 0x20(%rsp), %rcx
incq %rcx
cmpq 0x10(%rsp), %rcx
jne 0x15762
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop