// File: /workspace/github_c_makefile_star2_O2/josch[P]stride/p_helix.c
// Function: Process_HELIX
int Process_HELIX(BUFFER Buffer, CHAIN **Chain, int *ChainNumber, COMMAND *Cmd)
{
  int CC, HC;
  char *Field[MAX_FIELD];
  BUFFER Tmp;

  if( Cmd->NActive && !ChInStr(Cmd->Active,SpaceToDash(Buffer[19])) )
     return(SUCCESS);
     
  for( CC=0; CC < *ChainNumber && Chain[CC]->Id != Buffer[19]; CC++ );

  if( CC == *ChainNumber ) {
    InitChain(&Chain[CC]); 
    Chain[CC]->Id = Buffer[19];
    (*ChainNumber)++;
  }

  HC = Chain[CC]->NHelix;
  Chain[CC]->Helix[HC] =  (HELIX *)ckalloc(sizeof(HELIX));

  SplitString(Buffer+15,Field,1);

  strcpy(Chain[CC]->Helix[HC]->Res1,Field[0]);

  SplitString(Buffer+27,Field,1);

  strcpy(Chain[CC]->Helix[HC]->Res2,Field[0]);

  strcpy(Tmp,Buffer);
  Tmp[25] = ' ';
  Tmp[37] = ' ';
  SplitString(Tmp+21,Field,1);
  strcpy(Chain[CC]->Helix[HC]->PDB_ResNumb1,Field[0]);
  SplitString(Tmp+33,Field,1);
  strcpy(Chain[CC]->Helix[HC]->PDB_ResNumb2,Field[0]);

  Chain[CC]->Helix[HC]->InsCode1 = Buffer[25];
  Chain[CC]->Helix[HC]->InsCode2 = Buffer[37];

  Tmp[40] = ' ';
  SplitString(Tmp+38,Field,1);
  Chain[CC]->Helix[HC]->Class = atoi(Field[0]);

  Chain[CC]->NHelix++;

  return(SUCCESS);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5a8, %rsp            # imm = 0x5A8
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x1cf8(%rcx)
je 0xf50a
movq %rcx, %r12
addq $0x1c08, %r12           # imm = 0x1C08
movsbl 0x13(%r14), %edi
callq 0x4969
movsbl %al, %esi
movq %r12, %rdi
callq 0x4974
testl %eax, %eax
je 0xf69a
movl (%r15), %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %r13d
cmovgl %eax, %r13d
cmpq %rcx, %r13
je 0xf535
movq (%rbx,%rcx,8), %rdx
movb 0x40(%rdx), %dl
cmpb 0x13(%r14), %dl
je 0xf532
incq %rcx
jmp 0xf51b
movl %ecx, %r13d
cmpl %eax, %r13d
jne 0xf554
leaq (%rbx,%rax,8), %r12
movq %r12, %rdi
callq 0x3798
movb 0x13(%r14), %al
movq (%r12), %rcx
movb %al, 0x40(%rcx)
incl (%r15)
movl %r13d, %r13d
movq (%rbx,%r13,8), %rax
movslq 0x1c(%rax), %rbp
pushq $0x20
popq %rdi
callq 0x50f4
movq (%rbx,%r13,8), %rcx
movq 0x80(%rcx), %rcx
movq %rax, (%rcx,%rbp,8)
leaq 0xf(%r14), %rdi
leaq 0x410(%rsp), %r15
pushq $0x1
popq %r12
movq %r15, %rsi
movl %r12d, %edx
callq 0x311c
movq (%rbx,%r13,8), %rax
movq 0x80(%rax), %rax
movq (%rax,%rbp,8), %rdi
movq (%r15), %rsi
callq 0x2070
leaq 0x1b(%r14), %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x311c
movq (%rbx,%r13,8), %rax
movq 0x80(%rax), %rax
movq (%rax,%rbp,8), %rdi
addq $0x6, %rdi
movq (%r15), %rsi
callq 0x2070
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2070
movb $0x20, %al
movb %al, 0x19(%r12)
movb %al, 0x25(%r12)
leaq 0x15(%rsp), %rdi
movq %r15, %rsi
pushq $0x1
popq %r12
movl %r12d, %edx
callq 0x311c
movq (%rbx,%r13,8), %rax
movq 0x80(%rax), %rax
movq (%rax,%rbp,8), %rdi
addq $0xc, %rdi
movq (%r15), %rsi
callq 0x2070
leaq 0x21(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x311c
movq (%rbx,%r13,8), %rax
movq 0x80(%rax), %rax
movq (%rax,%rbp,8), %rdi
addq $0x12, %rdi
movq (%r15), %rsi
callq 0x2070
movb 0x19(%r14), %al
movq (%rbx,%r13,8), %rcx
movq 0x80(%rcx), %rcx
movq (%rcx,%rbp,8), %rcx
movb %al, 0x18(%rcx)
movb 0x25(%r14), %al
movb %al, 0x19(%rcx)
movb $0x20, %al
leaq 0x21(%rsp), %rcx
movb %al, 0x7(%rcx)
leaq 0x26(%rsp), %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x311c
movq (%r15), %rdi
callq 0x2200
movq (%rbx,%r13,8), %rcx
movq 0x80(%rcx), %rdx
movq (%rdx,%rbp,8), %rdx
movl %eax, 0x1c(%rdx)
incl 0x1c(%rcx)
pushq $0x1
popq %rax
addq $0x5a8, %rsp            # imm = 0x5A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop