// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x250aa
movq 0x30(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x24e41
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1c(%rax), %eax
movl %eax, 0x4(%rsp)
subl $0x1, %eax
je 0x24d59
jmp 0x24d43
movl 0x4(%rsp), %eax
subl $0x3, %eax
je 0x24d60
jmp 0x24d4e
movl 0x4(%rsp), %eax
subl $0x5, %eax
je 0x24d67
jmp 0x24d6c
movb $0x48, 0x13(%rsp)
jmp 0x24d6c
movb $0x49, 0x13(%rsp)
jmp 0x24d6c
movb $0x47, 0x13(%rsp)
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0xc, %rsi
leaq 0x18(%rsp), %rdx
callq 0x60b0
cmpl $0x0, %eax
je 0x24e2f
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x12, %rsi
leaq 0x14(%rsp), %rdx
callq 0x60b0
cmpl $0x0, %eax
je 0x24e2f
movl 0x18(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x14(%rsp), %eax
jg 0x24e2d
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movsbl 0x1d(%rax), %eax
cmpl $0x48, %eax
je 0x24e1e
movb 0x13(%rsp), %cl
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x24(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x768(%rax), %rax
movb %cl, 0x1d(%rax)
jmp 0x24e20
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x24dd2
jmp 0x24e2f
jmp 0x24e31
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x24d0e
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x24f86
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movq 0x8(%rsp), %rcx
movq 0x88(%rcx), %rcx
movslq 0x28(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x24f74
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0xfa, %rsi
movslq 0x24(%rsp), %rax
imulq $0x6, %rax, %rax
addq %rax, %rsi
leaq 0x18(%rsp), %rdx
callq 0x60b0
cmpl $0x0, %eax
je 0x24f62
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x172, %rsi            # imm = 0x172
movslq 0x24(%rsp), %rax
imulq $0x6, %rax, %rax
addq %rax, %rsi
leaq 0x14(%rsp), %rdx
callq 0x60b0
cmpl $0x0, %eax
je 0x24f62
movl 0x18(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x14(%rsp), %eax
jg 0x24f60
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movsbl 0x1d(%rax), %eax
cmpl $0x48, %eax
je 0x24f51
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movb $0x45, 0x1d(%rax)
jmp 0x24f53
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x24f08
jmp 0x24f62
jmp 0x24f64
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x24e63
jmp 0x24f76
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x24e49
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x24(%rcx), %eax
jge 0x25098
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x90(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0xc, %rsi
leaq 0x18(%rsp), %rdx
callq 0x60b0
cmpl $0x0, %eax
je 0x25086
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x90(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x12, %rsi
leaq 0x14(%rsp), %rdx
callq 0x60b0
cmpl $0x0, %eax
je 0x25086
movl 0x18(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x14(%rsp), %eax
jg 0x25084
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movsbl 0x1d(%rax), %eax
cmpl $0x48, %eax
je 0x25075
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movsbl 0x1d(%rax), %eax
cmpl $0x45, %eax
je 0x25075
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movb $0x54, 0x1d(%rax)
jmp 0x25077
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x2500a
jmp 0x25086
jmp 0x25088
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x24f8e
jmp 0x2509a
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x24ce5
addq $0x38, %rsp
retq
nop