// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/report.c
// Function: ReportSummary
void ReportSummary(CHAIN **Chain, int NChain, FILE *Out, COMMAND *Cmd)
{
  int Cn, Width, CurrWidth, NBlocks, Tail, i, j, From, To;
  BUFFER Bf, Tmp, Tmp1;

  PrepareBuffer(Bf,Chain);

  sprintf(Tmp,"REM  -------------------- ");
  strcat(Tmp,"Secondary structure summary");
  strcat(Tmp," -------------------");
  Glue(Bf,Tmp,Out);

  for( Cn=0; Cn<NChain; Cn++ ) {

    if( !Chain[Cn]->Valid )
      continue;

    Width = 50;

    Glue(Bf,"REM",Out);

    strncpy(Tmp1,Chain[Cn]->File,40);
    Tmp1[40] = '\0';
    sprintf(Tmp,"CHN  %s %c",Tmp1,SpaceToDash(Chain[Cn]->Id));
    Glue(Bf,Tmp,Out);

    NBlocks = Chain[Cn]->NRes/Width;
    Tail = Chain[Cn]->NRes % Width;
    if( Tail ) NBlocks++;
    
    for( i=0; i<NBlocks; i++ ) {

      Glue(Bf,"REM",Out);
      From = i*Width;
      if( i == NBlocks-1 && Tail ) 
	CurrWidth = Tail;
      else
	CurrWidth = Width;
      To   = From+CurrWidth;

      sprintf(Tmp,"REM       ");
      for( j=0; j<CurrWidth; j++ )
	if( j && (j+1)%10 == 0 )
	  strcat(Tmp,".");
	else
	  strcat(Tmp," ");
      Glue(Bf,Tmp,Out);

      sprintf(Tmp,"SEQ  %-4d ",From+1);
      for( j=From; j<From+Width; j++ ) {
	if( j < To )
	  sprintf(Tmp1,"%c",ThreeToOne(Chain[Cn]->Rsd[j]->ResType));
	else
	  sprintf(Tmp1," ");
	strcat(Tmp,Tmp1);
      }
      sprintf(Tmp1," %4d",To);
      strcat(Tmp,Tmp1);
      Glue(Bf,Tmp,Out);

      sprintf(Tmp,"STR       ");
      for( j=From; j<To; j++ ) {
	if( Chain[Cn]->Rsd[j]->Prop->Asn == 'C' )
	  sprintf(Tmp1," ");
	else
	  sprintf(Tmp1,"%c",Chain[Cn]->Rsd[j]->Prop->Asn);
	strcat(Tmp,Tmp1);
      }
      strcat(Tmp,"     ");
      Glue(Bf,Tmp,Out);
    }

  }
}

// Assembly:
subq $0xc88, %rsp            # imm = 0xC88
movq %rdi, 0xc80(%rsp)
movl %esi, 0xc7c(%rsp)
movq %rdx, 0xc70(%rsp)
movq %rcx, 0xc68(%rsp)
leaq 0x840(%rsp), %rdi
movq 0xc80(%rsp), %rsi
callq 0x1d3d0
leaq 0x430(%rsp), %rdi
leaq 0x10728(%rip), %rsi     # 0x2c282
movb $0x0, %al
callq 0x2200
leaq 0x430(%rsp), %rdi
leaq 0x1072d(%rip), %rsi     # 0x2c29d
callq 0x21e0
leaq 0x430(%rsp), %rdi
leaq 0x10735(%rip), %rsi     # 0x2c2b9
callq 0x21e0
leaq 0x840(%rsp), %rdi
leaq 0x430(%rsp), %rsi
movq 0xc70(%rsp), %rdx
callq 0x1d430
movl $0x0, 0xc64(%rsp)
movl 0xc64(%rsp), %eax
cmpl 0xc7c(%rsp), %eax
jge 0x1c0d1
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x1bbe4
jmp 0x1c0bb
movl $0x32, 0xc60(%rsp)
leaq 0x840(%rsp), %rdi
movq 0xc70(%rsp), %rdx
leaq 0x104eb(%rip), %rsi     # 0x2c0f1
callq 0x1d430
leaq 0x20(%rsp), %rdi
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rsi
movl $0x28, %edx
callq 0x2040
movb $0x0, 0x48(%rsp)
leaq 0x430(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movsbl %al, %ecx
leaq 0x1064f(%rip), %rsi     # 0x2c2ce
movb $0x0, %al
callq 0x2200
leaq 0x840(%rsp), %rdi
leaq 0x430(%rsp), %rsi
movq 0xc70(%rsp), %rdx
callq 0x1d430
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
cltd
idivl 0xc60(%rsp)
movl %eax, 0xc58(%rsp)
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
cltd
idivl 0xc60(%rsp)
movl %edx, 0xc54(%rsp)
cmpl $0x0, 0xc54(%rsp)
je 0x1bd08
movl 0xc58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc58(%rsp)
movl $0x0, 0xc50(%rsp)
movl 0xc50(%rsp), %eax
cmpl 0xc58(%rsp), %eax
jge 0x1c0b9
leaq 0x840(%rsp), %rdi
movq 0xc70(%rsp), %rdx
leaq 0x103b3(%rip), %rsi     # 0x2c0f1
callq 0x1d430
movl 0xc50(%rsp), %eax
imull 0xc60(%rsp), %eax
movl %eax, 0xc48(%rsp)
movl 0xc50(%rsp), %eax
movl 0xc58(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1bd88
cmpl $0x0, 0xc54(%rsp)
je 0x1bd88
movl 0xc54(%rsp), %eax
movl %eax, 0xc5c(%rsp)
jmp 0x1bd96
movl 0xc60(%rsp), %eax
movl %eax, 0xc5c(%rsp)
movl 0xc48(%rsp), %eax
addl 0xc5c(%rsp), %eax
movl %eax, 0xc44(%rsp)
leaq 0x430(%rsp), %rdi
leaq 0x1051f(%rip), %rsi     # 0x2c2d9
movb $0x0, %al
callq 0x2200
movl $0x0, 0xc4c(%rsp)
movl 0xc4c(%rsp), %eax
cmpl 0xc5c(%rsp), %eax
jge 0x1be3c
cmpl $0x0, 0xc4c(%rsp)
je 0x1be13
movl 0xc4c(%rsp), %eax
addl $0x1, %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x1be13
leaq 0x430(%rsp), %rdi
leaq 0x101f8(%rip), %rsi     # 0x2c004
callq 0x21e0
jmp 0x1be27
leaq 0x430(%rsp), %rdi
leaq 0x107bb(%rip), %rsi     # 0x2c5dd
callq 0x21e0
jmp 0x1be29
movl 0xc4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4c(%rsp)
jmp 0x1bdcc
leaq 0x840(%rsp), %rdi
leaq 0x430(%rsp), %rsi
movq 0xc70(%rsp), %rdx
callq 0x1d430
leaq 0x430(%rsp), %rdi
movl 0xc48(%rsp), %edx
addl $0x1, %edx
leaq 0x10472(%rip), %rsi     # 0x2c2e4
movb $0x0, %al
callq 0x2200
movl 0xc48(%rsp), %eax
movl %eax, 0xc4c(%rsp)
movl 0xc4c(%rsp), %eax
movl 0xc48(%rsp), %ecx
addl 0xc60(%rsp), %ecx
cmpl %ecx, %eax
jge 0x1bf3e
movl 0xc4c(%rsp), %eax
cmpl 0xc44(%rsp), %eax
jge 0x1bf03
leaq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0xc4c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0xa, %rdi
callq 0x59f0
movq 0x8(%rsp), %rdi
movsbl %al, %edx
leaq 0x103dc(%rip), %rsi     # 0x2c2d6
movb $0x0, %al
callq 0x2200
jmp 0x1bf16
leaq 0x20(%rsp), %rdi
leaq 0x106ce(%rip), %rsi     # 0x2c5dd
movb $0x0, %al
callq 0x2200
leaq 0x430(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x21e0
movl 0xc4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4c(%rsp)
jmp 0x1be87
leaq 0x20(%rsp), %rdi
movl 0xc44(%rsp), %edx
leaq 0x105aa(%rip), %rsi     # 0x2c4fb
movb $0x0, %al
callq 0x2200
leaq 0x430(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x21e0
leaq 0x840(%rsp), %rdi
leaq 0x430(%rsp), %rsi
movq 0xc70(%rsp), %rdx
callq 0x1d430
leaq 0x430(%rsp), %rdi
leaq 0x10359(%rip), %rsi     # 0x2c2ef
movb $0x0, %al
callq 0x2200
movl 0xc48(%rsp), %eax
movl %eax, 0xc4c(%rsp)
movl 0xc4c(%rsp), %eax
cmpl 0xc44(%rsp), %eax
jge 0x1c072
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0xc4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movsbl 0x1c(%rax), %eax
cmpl $0x43, %eax
jne 0x1c008
leaq 0x20(%rsp), %rdi
leaq 0x105de(%rip), %rsi     # 0x2c5dd
movb $0x0, %al
callq 0x2200
jmp 0x1c04a
leaq 0x20(%rsp), %rdi
movq 0xc80(%rsp), %rax
movslq 0xc64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0xc4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movsbl 0x1c(%rax), %edx
leaq 0x10293(%rip), %rsi     # 0x2c2d6
movb $0x0, %al
callq 0x2200
leaq 0x430(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x21e0
movl 0xc4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4c(%rsp)
jmp 0x1bfab
leaq 0x430(%rsp), %rdi
leaq 0x10558(%rip), %rsi     # 0x2c5d9
callq 0x21e0
leaq 0x840(%rsp), %rdi
leaq 0x430(%rsp), %rsi
movq 0xc70(%rsp), %rdx
callq 0x1d430
movl 0xc50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc50(%rsp)
jmp 0x1bd13
jmp 0x1c0bb
movl 0xc64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc64(%rsp)
jmp 0x1bbb1
addq $0xc88, %rsp            # imm = 0xC88
retq
nopl (%rax)