// File: /workspace/github_c_makefile_star2_O3/josch[P]stride/report.c
// Function: ReportDetailed
void ReportDetailed(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd)
{
  register int i, Cn;
  RESIDUE *p;
  BUFFER Bf, Tmp, Tmp1;

  PrepareBuffer(Bf,Chain);

  Glue(Bf,"REM",Out);
  sprintf(Tmp,"REM  --------------- ");
  strcat(Tmp,"Detailed secondary structure assignment");
  strcat(Tmp,"-------------");
  Glue(Bf,Tmp,Out);
  Glue(Bf,"REM",Out);
  Glue(Bf,"REM  |---Residue---|    |--Structure--|   |-Phi-|   |-Psi-|  |-Area-|      ",Out);

  for( Cn=0; Cn<NChain; Cn++ ) {

    if( !Chain[Cn]->Valid )
      continue;
    
    for( i=0; i<Chain[Cn]->NRes; i++ ) {
      p = Chain[Cn]->Rsd[i];
      sprintf(Tmp,"ASG  %3s %c %4s %4d    %c   %11s   %7.2f   %7.2f   %7.1f",
	      p->ResType,SpaceToDash(Chain[Cn]->Id),p->PDB_ResNumb,i+1,
	      p->Prop->Asn,Translate(p->Prop->Asn),p->Prop->Phi,
	      p->Prop->Psi,p->Prop->Solv);

      if( Cmd->BrookhavenAsn ) {
	Tmp[26] = p->Prop->PdbAsn;
	Tmp[25] = ' ';
	Tmp[27] = ' ';
      }

      if( Cmd->DsspAsn ) {
	Tmp[28] = p->Prop->DsspAsn;
	Tmp[27] = ' ';
	Tmp[29] = ' ';
	sprintf(Tmp1," %6.1f ",p->Prop->DsspSolv);
	strcat(Tmp,Tmp1);
      }
      Glue(Bf,Tmp,Out);
    }
  }
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc58, %rsp            # imm = 0xC58
movq %rcx, 0x8(%rsp)
movq %rdx, %rbx
movl %esi, %ebp
movaps 0x9511(%rip), %xmm0     # 0x1a1d0
leaq 0x48b(%rsp), %r12
movaps %xmm0, -0x4b(%r12)
movaps %xmm0, -0x3b(%r12)
movaps %xmm0, -0x2b(%r12)
movaps %xmm0, -0x1b(%r12)
movaps %xmm0, -0xb(%r12)
movl $0xb0, %esi
movq %rdi, (%rsp)
addq (%rdi), %rsi
movq %r12, %rdi
callq 0x2070
movw $0xa, 0x4(%r12)
leaq 0x953f(%rip), %r14      # 0x1a247
leaq 0x440(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x114b3
movabsq $0x202d2d2d2d2d2d, %rax # imm = 0x202D2D2D2D2D2D
leaq 0x30(%rsp), %r13
movq %rax, 0xe(%r13)
movups 0x9718(%rip), %xmm0     # 0x1a450
movaps %xmm0, (%r13)
movq %r13, %rdi
callq 0x20b0
movabsq $0x746e656d6e6769, %rcx # imm = 0x746E656D6E6769
movq %rcx, 0x50(%rsp,%rax)
movups 0x970b(%rip), %xmm0     # 0x1a466
movups %xmm0, 0x30(%rsp,%rax)
movups 0x970f(%rip), %xmm0     # 0x1a476
movups %xmm0, 0x40(%rsp,%rax)
movq %r13, %rdi
callq 0x20b0
movabsq $0x2d2d2d2d2d2d2d2d, %rcx # imm = 0x2D2D2D2D2D2D2D2D
movq %rcx, 0x30(%rsp,%rax)
movabsq $0x2d2d2d2d2d2d2d, %rcx # imm = 0x2D2D2D2D2D2D2D
movq %rcx, 0x36(%rsp,%rax)
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x114b3
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x114b3
leaq 0x96d9(%rip), %rsi      # 0x1a48e
movq %r12, %rdi
movq %rbx, 0x18(%rsp)
movq %rbx, %rdx
callq 0x114b3
testl %ebp, %ebp
jle 0x10f37
movl %ebp, %eax
movq %rax, 0x10(%rsp)
xorl %edx, %edx
leaq 0x30(%rsp), %rbx
movq (%rsp), %rax
movq (%rax,%rdx,8), %rax
cmpl $0x0, 0x58(%rax)
je 0x10f29
cmpl $0x0, (%rax)
jle 0x10f29
xorl %ebp, %ebp
movq %rdx, 0x20(%rsp)
movq 0x68(%rax), %rcx
movq (%rcx,%rbp,8), %r13
leaq 0xa(%r13), %rcx
movq %rcx, 0x28(%rsp)
movsbl 0x40(%rax), %edi
callq 0x50a2
movsbl %al, %r14d
leaq 0x4(%r13), %r15
incq %rbp
movq 0x768(%r13), %rax
movsbl 0x1c(%rax), %r12d
movl %r12d, %edi
callq 0x4fec
movq %rax, %r10
movq 0x768(%r13), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rax), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x14(%rax), %xmm2
movq %rbx, %rdi
leaq 0x9679(%rip), %rsi      # 0x1a4da
movq 0x28(%rsp), %rdx
movl %r14d, %ecx
movq %r15, %r8
movl %ebp, %r9d
movb $0x3, %al
pushq %r10
pushq %r12
callq 0x2220
addq $0x10, %rsp
movq 0x8(%rsp), %rax
cmpl $0x0, 0x1d74(%rax)
je 0x10ea4
movq 0x768(%r13), %rax
movb 0x1d(%rax), %al
movb %al, 0x4a(%rsp)
movb $0x20, %al
movb %al, 0x49(%rsp)
movb %al, 0x4b(%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, 0x1d78(%rax)
leaq 0x30(%rsp), %rbx
je 0x10efb
movq 0x768(%r13), %rax
movb 0x1e(%rax), %cl
movb %cl, 0x4c(%rsp)
movb $0x20, %cl
movb %cl, 0x4b(%rsp)
movb %cl, 0x4d(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x18(%rax), %xmm0
leaq 0x850(%rsp), %r14
movq %r14, %rdi
leaq 0x97f4(%rip), %rsi      # 0x1a6dd
movb $0x1, %al
callq 0x2220
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
leaq 0x440(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rdx
callq 0x114b3
movq (%rsp), %rax
movq 0x20(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movslq (%rax), %rcx
cmpq %rcx, %rbp
jl 0x10dfd
incq %rdx
cmpq 0x10(%rsp), %rdx
jne 0x10ddb
addq $0xc58, %rsp            # imm = 0xC58
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq