// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/report.c
// Function: ReportHydrBonds
void ReportHydrBonds(CHAIN **Chain, int NChain, HBOND **HBond, FILE *Out,
		     COMMAND *Cmd)
{
  register int i, k, Cn;
  int Cnt, Res;
  BUFFER Bf, Tmp, Tmp1;
  HBOND *p;
  RESIDUE *r;

  PrepareBuffer(Bf,Chain);

  Glue(Bf,"REM",Out);
  sprintf(Tmp,"REM  ------------------ ");
  strcat(Tmp,"Mainchain hydrogen bonds");
  strcat(Tmp," ------------------------");
  Glue(Bf,Tmp,Out);
  Glue(Bf,"REM",Out);

  Glue(Bf,"REM  Definition of Stickle et al., J.Mol.Biol. 226:1143-1159, 1992",Out);
  Glue(Bf,"REM  A1 is the angle between the planes of donor complex and O..N-C",Out);
  Glue(Bf,"REM  A2 is the angle between the planes of acceptor complex and N..O=C",Out);
  Glue(Bf,"REM",Out);

  sprintf(Tmp,"HBT  %-6d",Chain[0]->NHydrBondTotal);
  Glue(Bf,Tmp,Out);
  sprintf(Tmp,"HBI  %-6d",Chain[0]->NHydrBondInterchain);
  Glue(Bf,Tmp,Out);
  for( Cn=0; Cn<NChain; Cn++ )
    if( Chain[Cn]->Valid ) {

      sprintf(Tmp,"HBC  %-6d  %s %c %4d",
	      Chain[Cn]->NHydrBond,Chain[Cn]->File,SpaceToDash(Chain[Cn]->Id),Chain[Cn]->NRes);
      Glue(Bf,Tmp,Out);
    }
  Glue(Bf,"REM",Out);

  Glue(Bf,"REM  |--Residue 1--|     |--Residue 2--|  N-O N..O=C O..N-C     A1     A2",Out);

  for( Cn=0; Cn<NChain; Cn++ ) {

    if( !Chain[Cn]->Valid )
      continue;
    
    for( i=0; i<Chain[Cn]->NRes; i++ ) {

      r = Chain[Cn]->Rsd[i];

      Cnt = 0;
      for( k=0; k<r->Inv->NBondDnr; k++ ) {
	p = HBond[r->Inv->HBondDnr[k]];
	if( p->ExistHydrBondRose ) {
	  Res = p->Acc->A_Res;
	  sprintf(Tmp,"DNR %4s %c %4s %4d -> ",
		  r->ResType,SpaceToDash(Chain[Cn]->Id),r->PDB_ResNumb,i);

	  sprintf(Tmp1,"%4s %c %4s %4d %4.1f %6.1f %6.1f %6.1f %6.1f ",
		  p->Acc->Chain->Rsd[Res]->ResType,
		  /* patch replace SpaceToDash(Chain[Cn]->Id), */
		  SpaceToDash(p->Acc->Chain->Id),
		  p->Acc->Chain->Rsd[Res]->PDB_ResNumb,Res,p->AccDonDist,p->AccAng,
		  p->DonAng,p->AccDonAng,p->DonAccAng);
	  strcat(Tmp,Tmp1);
	  Glue(Bf,Tmp,Out);
	  Cnt++;
	}
      }

      Cnt = 0;
      for( k=0; k<r->Inv->NBondAcc; k++ ) {
	p = HBond[r->Inv->HBondAcc[k]];
	if( p->ExistHydrBondRose ) {
	  Res = p->Dnr->D_Res;
	  sprintf(Tmp,"ACC %4s %c %4s %4d -> ",
		  r->ResType,SpaceToDash(Chain[Cn]->Id),r->PDB_ResNumb,i);

	  sprintf(Tmp1,"%4s %c %4s %4d %4.1f %6.1f %6.1f %6.1f %6.1f ",
		  p->Dnr->Chain->Rsd[Res]->ResType,
		  /* patch replace SpaceToDash(Chain[Cn]->Id), */
		  SpaceToDash(p->Dnr->Chain->Id),
		  p->Dnr->Chain->Rsd[Res]->PDB_ResNumb,Res,p->AccDonDist,
		  p->AccAng,p->DonAng,p->AccDonAng,p->DonAccAng);
	  strcat(Tmp,Tmp1);
	  Glue(Bf,Tmp,Out);
	  Cnt++;
	}
      }

    }
  }

}

// Assembly:
subq $0xcd8, %rsp            # imm = 0xCD8
movq %rdi, 0xcd0(%rsp)
movl %esi, 0xccc(%rsp)
movq %rdx, 0xcc0(%rsp)
movq %rcx, 0xcb8(%rsp)
movq %r8, 0xcb0(%rsp)
leaq 0x890(%rsp), %rdi
movq 0xcd0(%rsp), %rsi
callq 0x1d3d0
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf4b7(%rip), %rsi      # 0x2c0f1
callq 0x1d430
leaq 0x480(%rsp), %rdi
leaq 0xf76f(%rip), %rsi      # 0x2c3bd
movb $0x0, %al
callq 0x2200
leaq 0x480(%rsp), %rdi
leaq 0xf772(%rip), %rsi      # 0x2c3d6
callq 0x21e0
leaq 0x480(%rsp), %rdi
leaq 0xf777(%rip), %rsi      # 0x2c3ef
callq 0x21e0
leaq 0x890(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq 0xcb8(%rsp), %rdx
callq 0x1d430
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf440(%rip), %rsi      # 0x2c0f1
callq 0x1d430
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf73c(%rip), %rsi      # 0x2c409
callq 0x1d430
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf763(%rip), %rsi      # 0x2c44c
callq 0x1d430
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf78b(%rip), %rsi      # 0x2c490
callq 0x1d430
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf3d0(%rip), %rsi      # 0x2c0f1
callq 0x1d430
leaq 0x480(%rsp), %rdi
movq 0xcd0(%rsp), %rax
movq (%rax), %rax
movl 0x38(%rax), %edx
leaq 0xf794(%rip), %rsi      # 0x2c4d7
movb $0x0, %al
callq 0x2200
leaq 0x890(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq 0xcb8(%rsp), %rdx
callq 0x1d430
leaq 0x480(%rsp), %rdi
movq 0xcd0(%rsp), %rax
movq (%rax), %rax
movl 0x34(%rax), %edx
leaq 0xf75d(%rip), %rsi      # 0x2c4e1
movb $0x0, %al
callq 0x2200
leaq 0x890(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq 0xcb8(%rsp), %rdx
callq 0x1d430
movl $0x0, 0xca4(%rsp)
movl 0xca4(%rsp), %eax
cmpl 0xccc(%rsp), %eax
jge 0x1ceb3
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
je 0x1ce9b
leaq 0x480(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x30(%rax), %eax
movl %eax, 0x54(%rsp)
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movq 0x48(%rsp), %rdi
movl 0x54(%rsp), %edx
movq 0x58(%rsp), %rcx
movsbl %al, %r8d
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movl (%rax), %r9d
leaq 0xf674(%rip), %rsi      # 0x2c4eb
movb $0x0, %al
callq 0x2200
leaq 0x890(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq 0xcb8(%rsp), %rdx
callq 0x1d430
jmp 0x1ce9d
movl 0xca4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xca4(%rsp)
jmp 0x1cdb3
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf227(%rip), %rsi      # 0x2c0f1
callq 0x1d430
leaq 0x890(%rsp), %rdi
movq 0xcb8(%rsp), %rdx
leaq 0xf61a(%rip), %rsi      # 0x2c500
callq 0x1d430
movl $0x0, 0xca4(%rsp)
movl 0xca4(%rsp), %eax
cmpl 0xccc(%rsp), %eax
jge 0x1d3b9
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x1cf29
jmp 0x1d3a3
movl $0x0, 0xcac(%rsp)
movl 0xcac(%rsp), %eax
movq 0xcd0(%rsp), %rcx
movslq 0xca4(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x1d3a1
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0xcac(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x60(%rsp)
movl $0x0, 0xca0(%rsp)
movl $0x0, 0xca8(%rsp)
movl 0xca8(%rsp), %eax
movq 0x60(%rsp), %rcx
movq 0x770(%rcx), %rcx
cmpl 0x30(%rcx), %eax
jge 0x1d186
movq 0xcc0(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x770(%rcx), %rcx
movslq 0xca8(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x1d16e
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc9c(%rsp)
leaq 0x480(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
addq $0xa, %rax
movq %rax, 0x30(%rsp)
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movsbl %al, %ecx
movq 0x60(%rsp), %r8
addq $0x4, %r8
movl 0xcac(%rsp), %r9d
leaq 0xf4f0(%rip), %rsi      # 0x2c54a
movb $0x0, %al
callq 0x2200
leaq 0x70(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x68(%rax), %rax
movslq 0xc9c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0xa, %rax
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rdx
movsbl %al, %ecx
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x68(%rax), %rax
movslq 0xc9c(%rsp), %rsi
movq (%rax,%rsi,8), %r8
addq $0x4, %r8
movl 0xc9c(%rsp), %r9d
movq 0x68(%rsp), %rax
movss 0x38(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x68(%rsp), %rax
movss 0x48(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movq 0x68(%rsp), %rax
movss 0x4c(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
movq 0x68(%rsp), %rax
movss 0x50(%rax), %xmm3
cvtss2sd %xmm3, %xmm3
movq 0x68(%rsp), %rax
movss 0x54(%rax), %xmm4
cvtss2sd %xmm4, %xmm4
leaq 0xf43a(%rip), %rsi      # 0x2c561
movb $0x5, %al
callq 0x2200
leaq 0x480(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x21e0
leaq 0x890(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq 0xcb8(%rsp), %rdx
callq 0x1d430
movl 0xca0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xca0(%rsp)
jmp 0x1d170
movl 0xca8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xca8(%rsp)
jmp 0x1cf96
movl $0x0, 0xca0(%rsp)
movl $0x0, 0xca8(%rsp)
movl 0xca8(%rsp), %eax
movq 0x60(%rsp), %rcx
movq 0x770(%rcx), %rcx
cmpl 0x34(%rcx), %eax
jge 0x1d389
movq 0xcc0(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x770(%rcx), %rcx
movslq 0xca8(%rsp), %rdx
movslq 0x18(%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x1d371
movq 0x68(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc9c(%rsp)
leaq 0x480(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rax
addq $0xa, %rax
movq %rax, 0x10(%rsp)
movq 0xcd0(%rsp), %rax
movslq 0xca4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movsbl %al, %ecx
movq 0x60(%rsp), %r8
addq $0x4, %r8
movl 0xcac(%rsp), %r9d
leaq 0xf32f(%rip), %rsi      # 0x2c58f
movb $0x0, %al
callq 0x2200
leaq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x68(%rax), %rax
movslq 0xc9c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0xa, %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movsbl %al, %ecx
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x68(%rax), %rax
movslq 0xc9c(%rsp), %rsi
movq (%rax,%rsi,8), %r8
addq $0x4, %r8
movl 0xc9c(%rsp), %r9d
movq 0x68(%rsp), %rax
movss 0x38(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x68(%rsp), %rax
movss 0x48(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movq 0x68(%rsp), %rax
movss 0x4c(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
movq 0x68(%rsp), %rax
movss 0x50(%rax), %xmm3
cvtss2sd %xmm3, %xmm3
movq 0x68(%rsp), %rax
movss 0x54(%rax), %xmm4
cvtss2sd %xmm4, %xmm4
leaq 0xf237(%rip), %rsi      # 0x2c561
movb $0x5, %al
callq 0x2200
leaq 0x480(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x21e0
leaq 0x890(%rsp), %rdi
leaq 0x480(%rsp), %rsi
movq 0xcb8(%rsp), %rdx
callq 0x1d430
movl 0xca0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xca0(%rsp)
jmp 0x1d373
movl 0xca8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xca8(%rsp)
jmp 0x1d19c
jmp 0x1d38b
movl 0xcac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcac(%rsp)
jmp 0x1cf34
jmp 0x1d3a3
movl 0xca4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xca4(%rsp)
jmp 0x1cef6
addq $0xcd8, %rsp            # imm = 0xCD8
retq
nopw %cs:(%rax,%rax)