// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/outseq.c
// Function: OutSeq
int OutSeq(CHAIN **Chain, int NChain, COMMAND *Cmd)
{
  int Cn, Res;
  FILE *Seq;

  if( (int)strlen(Cmd->SeqFile) == 0 )
    Seq = stdout;
  else 
    if( (Seq = fopen(Cmd->SeqFile,"a")) == NULL )
      die("Error writing sequence file %s\n",Cmd->SeqFile);

  for( Cn=0; Cn<NChain; Cn++ ) {

    if( !Chain[Cn]->Valid )
       continue;

    fprintf(Seq,">%s %c  %d %7.3f\n",
	    Chain[Cn]->File,SpaceToDash(Chain[Cn]->Id),Chain[Cn]->NRes,
	    Chain[Cn]->Resolution);

    for( Res=0; Res<Chain[Cn]->NRes; Res++ ) {
      if( Res%60 == 0 && Res != 0 ) fprintf(Seq,"\n");
      fprintf(Seq,"%c",ThreeToOne(Chain[Cn]->Rsd[Res]->ResType));
    }
    fprintf(Seq,"\n");
  }
  fclose(Seq);
  exit(0);

  return(SUCCESS);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x30(%rsp), %rdi
addq $0x802, %rdi            # imm = 0x802
callq 0x20b0
cmpl $0x0, %eax
jne 0x25d59
movq 0xa289(%rip), %rax      # 0x2ffd8
movq (%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x25d98
movq 0x30(%rsp), %rdi
addq $0x802, %rdi            # imm = 0x802
leaq 0x5cd9(%rip), %rsi      # 0x2ba45
callq 0x2190
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
jne 0x25d96
movq 0x30(%rsp), %rsi
addq $0x802, %rsi            # imm = 0x802
leaq 0x6dba(%rip), %rdi      # 0x2cb49
movb $0x0, %al
callq 0xc970
jmp 0x25d98
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jge 0x25f02
movq 0x40(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x25dc7
jmp 0x25ef2
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x40(%rax), %edi
callq 0x6550
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movsbl %al, %ecx
movq 0x40(%rsp), %rax
movslq 0x2c(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movl (%rax), %r8d
movq 0x40(%rsp), %rax
movslq 0x2c(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movss 0x50(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x6d2e(%rip), %rsi      # 0x2cb69
movb $0x1, %al
callq 0x2140
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
movq 0x40(%rsp), %rcx
movslq 0x2c(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x25edf
movl 0x28(%rsp), %eax
movl $0x3c, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x25e8b
cmpl $0x0, 0x28(%rsp)
je 0x25e8b
movq 0x20(%rsp), %rdi
leaq 0x5edf(%rip), %rsi      # 0x2bd63
movb $0x0, %al
callq 0x2140
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0xa, %rdi
callq 0x59f0
movq 0x8(%rsp), %rdi
movsbl %al, %edx
leaq 0x640e(%rip), %rsi      # 0x2c2d6
movb $0x0, %al
callq 0x2140
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x25e4a
movq 0x20(%rsp), %rdi
leaq 0x5e78(%rip), %rsi      # 0x2bd63
movb $0x0, %al
callq 0x2140
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x25da0
movq 0x20(%rsp), %rdi
callq 0x20a0
xorl %edi, %edi
callq 0x2210
nopw %cs:(%rax,%rax)
nopl (%rax)