// File: /workspace/github_c_makefile_star2_O1/hyc[P]trek73c/trekx.c
// Function: Ender
void Ender()
{
  int I;
  boolean Debris;
  Char *X1, *X2;
  char *plur;

  Debris = false;
  if (Win < 6) {		/* Check for flying antimatter */
    for (I = 1; I < ObjCount; I++) {
      if (Objects[I] && (Objects[I]->ObTyp >= 10)) {
        Debris = true;
        break;
      }
    }
  }
  Endln();
  if (Debris) {
    if (Win == Win2)
      return;

    Win2 = Win;
    switch (Win) {

    case 1:
      sprintf(scrstr,"%s:  Message to the Federation:  This is commander %s of",
	Capt, Capt);
      SEndln();
      sprintf(scrstr,"   the %s empire.  We have defeated the %s and are",
	Enemy, Snams[0]);
      SEndln();
      waddstr(Cmdwin,"   departing the quadrant.");
      break;

    case 2:
      sprintf(scrstr,"Spock:  All %s vessels have been either crippled or",
	Enemy);
      SEndln();
      waddstr(Cmdwin,"   destroyed.  We still, however, have antimatter devices to");
      Endln();
      waddstr(Cmdwin,"   avoid.");
      break;

    case 3:
      sprintf(scrstr,"Sulu:  The %ss are falling behind, and seem to be",
	Enemy);
      SEndln();
      waddstr(Cmdwin,"   breaking off their attack.");
      break;

    case 4:
      waddstr(Cmdwin,"Uhura:  I'm informing Starfleet Command of our disposition.");
      break;

    case 5:
      sprintf(scrstr,"Spock:  Although the %ss have surrendered, there are",
	Enemy);
      SEndln();
      waddstr(Cmdwin,"   still anti-matter devices floating around us.");
      break;
    }
    Endln();
    return;
  }
  X1 = "he";
  X2 = "his";
  if (Title == Female) {
    X1 = "she";
    X2 = "her";
  } else if (Title != Male) {
    X1 = "it";
    X2 = "its";
  }
  waddstr(Cmdwin,"Starfleet Command:   ");
  switch (Win) {

  case 1:
    waddstr(Cmdwin,"We have received confirmation that the");
    Endln();
    sprintf(scrstr,"   U.S.S. %s, Captained by %s, was destroyed",
      Snams[0], Name);
    SEndln();
    sprintf(scrstr,"   by %s battle cruisers.  May future Federation",
      Enemy);
    SEndln();
    waddstr(Cmdwin,"   officers perform better in their duties.");
    break;

  case 2:
    sprintf(scrstr,"We commend Captain %s and the crew of the", Name);
    SEndln();
    sprintf(scrstr,"   %s on their fine performance against the %ss.",
      Snams[0], Enemy);
    SEndln();
    sprintf(scrstr,"   May %s be an inspiration to future starship captains.",
      X1); 
    waddstr(Cmdwin,scrstr);
    break;

  case 3:
    sprintf(scrstr,"Captain %s of the U.S.S. %s has", Name, Snams[0]);
    SEndln();
    sprintf(scrstr,"   out-maneuvered %s foes. We commend %s",
      Enemy, X2);
    SEndln();
    waddstr(Cmdwin,"   tactical ability.");
    break;

  case 4:
    sprintf(scrstr,"Captain %s of the U.S.S. %s has", Name, Snams[0]);
    SEndln();
    sprintf(scrstr,"   surrendered %s vessel to the %ss.  May Captain",
      X2, Enemy);
    SEndln();
    waddstr(Cmdwin,"   Dunsell be remembered.");
    break;

  case 5:
    sprintf(scrstr,"We have received confirmation from the %s that",
      Snams[0]);
    SEndln();
    sprintf(scrstr,"   the %ss have surrendered.", Enemy);
    waddstr(Cmdwin,scrstr);
    break;

  case 6:
    if (Enemies != 1)
      plur = "s";
    else
      plur = "";
    waddstr(Cmdwin,"One of our vessels has reported the wreckage");
    Endln();
    sprintf(scrstr,"   of the %s and %d %s vessel%s.", Snams[0],
      Enemies, Enemy, plur);
    waddstr(Cmdwin,scrstr);
  }
  Endln();
  Endln();
  Debris = false;
  for (I = 0; I <= Enemies; I++) {
    if (Ships[I] != NULL) {
      if (!Debris) {
	Debris = true;
	waddstr(Cmdwin,"Survivors reported:");
	Endln();
      }
      sprintf(scrstr,"%s - %d", Snams[I], Ships[I]->Crew);
      SEndln();
    }
  }
  if (!Debris) {
    waddstr(Cmdwin,"*** No survivors reported ***");
    Endln();
  }
  Stop = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x5, 0xd6a9(%rip)      # 0x135e8
ja 0x5f76
movzbl 0xd69a(%rip), %eax      # 0x135e2
cmpq $0x2, %rax
jb 0x5f76
movl $0x1, %ecx
leaq 0xd696(%rip), %rdx      # 0x135f0
movq (%rdx,%rcx,8), %rsi
testq %rsi, %rsi
je 0x5f6e
cmpw $0x9, 0x4a(%rsi)
jg 0x63cc
incq %rcx
cmpq %rcx, %rax
jne 0x5f5a
callq 0x3c58
movq 0xd656(%rip), %r14      # 0x135d8
movq 0xd26f(%rip), %r15      # 0x131f8
movq 0xd260(%rip), %r12      # 0x131f0
cmpq %r12, %r14
leaq 0x82eb(%rip), %rax      # 0xe285
leaq 0x82f0(%rip), %rcx      # 0xe291
cmoveq %rax, %rcx
cmpq %r15, %r14
leaq 0x82de(%rip), %rbx      # 0xe28d
cmovneq %rcx, %rbx
movq 0xda3e(%rip), %rdi      # 0x139f8
leaq 0x82d4(%rip), %rsi      # 0xe295
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movzbl 0xd616(%rip), %eax      # 0x135e8
decl %eax
cmpl $0x5, %eax
ja 0x62f5
leaq 0x7270(%rip), %rcx      # 0xd254
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xda04(%rip), %rdi      # 0x139f8
leaq 0x82b0(%rip), %rsi      # 0xe2ab
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq 0xd91f(%rip), %rdx      # 0x13930
movq 0xd5b0(%rip), %rcx      # 0x135c8
leaq 0xd491(%rip), %rbx      # 0x134b0
leaq 0x82ac(%rip), %rsi      # 0xe2d2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd9c1(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq 0xd930(%rip), %rdx      # 0x13980
leaq 0x82a8(%rip), %rsi      # 0xe2ff
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd990(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
leaq 0x82af(%rip), %rbx      # 0xe330
jmp 0x62e1
movq 0xd8a3(%rip), %rdx      # 0x13930
leaq 0xd41c(%rip), %rbx      # 0x134b0
leaq 0x83ff(%rip), %rsi      # 0xe49a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd94c(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq 0xd8bb(%rip), %rdx      # 0x13980
leaq 0x83fd(%rip), %rsi      # 0xe4c9
movq %rbx, %rdi
jmp 0x6272
movq 0xd4ed(%rip), %rdx      # 0x135c8
movq 0xd84e(%rip), %rcx      # 0x13930
leaq 0xd3c7(%rip), %r14      # 0x134b0
leaq 0x8300(%rip), %rsi      # 0xe3f0
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd8f7(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq 0xd866(%rip), %rdx      # 0x13980
leaq 0x82ef(%rip), %rsi      # 0xe410
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x21a0
movq 0xd8c3(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
leaq 0x82eb(%rip), %rbx      # 0xe439
jmp 0x62e1
movq 0xd46e(%rip), %rdx      # 0x135c8
movq 0xd7cf(%rip), %rcx      # 0x13930
leaq 0xd348(%rip), %r14      # 0x134b0
leaq 0x8281(%rip), %rsi      # 0xe3f0
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd878(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq 0xd7e7(%rip), %rcx      # 0x13980
leaq 0x82ae(%rip), %rsi      # 0xe44e
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21a0
movq 0xd844(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
leaq 0x82b3(%rip), %rbx      # 0xe480
jmp 0x62e1
cmpq %r12, %r14
leaq 0x80ae(%rip), %rax      # 0xe28a
leaq 0x873f(%rip), %rcx      # 0xe922
cmoveq %rax, %rcx
cmpq %r15, %r14
leaq 0x8098(%rip), %r14      # 0xe289
cmovneq %rcx, %r14
movq 0xd3cc(%rip), %rdx      # 0x135c8
leaq 0xd2ad(%rip), %rbx      # 0x134b0
leaq 0x8152(%rip), %rsi      # 0xe35c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd7dd(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq 0xd6fc(%rip), %rdx      # 0x13930
movq 0xd745(%rip), %rcx      # 0x13980
leaq 0x8144(%rip), %rsi      # 0xe386
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd7a5(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
leaq 0x814b(%rip), %rsi      # 0xe3b7
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x21a0
jmp 0x62e1
cmpb $0x1, 0xd35e(%rip)      # 0x135e0
leaq 0x79a9(%rip), %rax      # 0xdc32
leaq 0x7ced(%rip), %r14      # 0xdf7d
cmoveq %rax, %r14
movq 0xd75d(%rip), %rdi      # 0x139f8
leaq 0x8244(%rip), %rsi      # 0xe4e6
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq 0xd678(%rip), %rdx      # 0x13930
movzbl 0xd321(%rip), %ecx      # 0x135e0
movq 0xd6ba(%rip), %r8       # 0x13980
leaq 0xd1e3(%rip), %rbx      # 0x134b0
leaq 0x823f(%rip), %rsi      # 0xe513
movq %rbx, %rdi
movq %r14, %r9
xorl %eax, %eax
callq 0x21a0
movq 0xd710(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
callq 0x3c58
movq $-0x1, %r12
xorl %eax, %eax
leaq 0xd681(%rip), %r13      # 0x13990
leaq 0xd61a(%rip), %rbp      # 0x13930
leaq 0xd193(%rip), %r14      # 0x134b0
leaq 0x8224(%rip), %r15      # 0xe548
xorl %ebx, %ebx
cmpq $0x0, (%rbx,%r13)
je 0x6382
testb %al, %al
jne 0x634e
movq 0xd6c0(%rip), %rdi      # 0x139f8
leaq 0x81f5(%rip), %rsi      # 0xe534
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movq (%rbx,%rbp), %rdx
movq (%rbx,%r13), %rax
movswl 0x1a(%rax), %ecx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0xd68a(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movb $0x1, %al
movzbl 0xd257(%rip), %ecx      # 0x135e0
incq %r12
addq $0x8, %rbx
cmpq %rcx, %r12
jb 0x6326
testb %al, %al
jne 0x63b6
movq 0xd658(%rip), %rdi      # 0x139f8
leaq 0x81a9(%rip), %rsi      # 0xe550
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movb $0x1, 0xd677(%rip)      # 0x13a34
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3c58
movzbl 0xd210(%rip), %eax      # 0x135e8
cmpl %eax, 0xd652(%rip)      # 0x13a30
je 0x63bd
movl %eax, 0xd64a(%rip)      # 0x13a30
decl %eax
cmpl $0x4, %eax
ja 0x650b
leaq 0x6e48(%rip), %rcx      # 0xd240
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xd580(%rip), %rcx      # 0x13988
leaq 0xd0a1(%rip), %rbx      # 0x134b0
leaq 0x7c7b(%rip), %rsi      # 0xe091
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x21a0
callq 0x3cc5
movq 0xd551(%rip), %rdx      # 0x13980
movq 0xd4fa(%rip), %rcx      # 0x13930
leaq 0x7c8d(%rip), %rsi      # 0xe0ca
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
callq 0x3cc5
leaq 0x7caa(%rip), %rsi      # 0xe0fd
jmp 0x64fa
movq 0xd521(%rip), %rdx      # 0x13980
leaq 0xd04a(%rip), %rdi      # 0x134b0
leaq 0x7db2(%rip), %rsi      # 0xe21f
xorl %eax, %eax
callq 0x21a0
callq 0x3cc5
leaq 0x7dd4(%rip), %rsi      # 0xe254
jmp 0x64fa
movq 0xd4f7(%rip), %rdx      # 0x13980
leaq 0xd020(%rip), %rdi      # 0x134b0
leaq 0x7cfc(%rip), %rsi      # 0xe193
xorl %eax, %eax
callq 0x21a0
callq 0x3cc5
leaq 0x7d1b(%rip), %rsi      # 0xe1c5
jmp 0x64fa
leaq 0x7d30(%rip), %rsi      # 0xe1e3
jmp 0x64fa
movq 0xd4c4(%rip), %rdx      # 0x13980
leaq 0xcfed(%rip), %rdi      # 0x134b0
leaq 0x7c4e(%rip), %rsi      # 0xe118
xorl %eax, %eax
callq 0x21a0
callq 0x3cc5
movq 0xd51b(%rip), %rdi      # 0x139f8
leaq 0x7c68(%rip), %rsi      # 0xe14c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
leaq 0x7c8f(%rip), %rsi      # 0xe189
movq 0xd4f7(%rip), %rdi      # 0x139f8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3c58