// File: /workspace/github_c_makefile_star2_O2/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, 0xd224(%rip)      # 0x125d7
ja 0x53e4
movzbl 0xd216(%rip), %eax      # 0x125d2
pushq $0x1
popq %rcx
leaq 0xd21a(%rip), %rdx      # 0x125e0
cmpq %rax, %rcx
jae 0x53e4
movq (%rdx,%rcx,8), %rsi
testq %rsi, %rsi
je 0x53df
cmpw $0x9, 0x4a(%rsi)
jg 0x54c8
incq %rcx
jmp 0x53c6
callq 0x3933
movq 0xd1d8(%rip), %r14      # 0x125c8
movq 0xcdf1(%rip), %r15      # 0x121e8
movq 0xcde2(%rip), %r12      # 0x121e0
cmpq %r12, %r14
leaq 0x6ebd(%rip), %rax      # 0xc2c5
leaq 0x6ec2(%rip), %rcx      # 0xc2d1
cmoveq %rax, %rcx
cmpq %r15, %r14
leaq 0x6eb0(%rip), %rbx      # 0xc2cd
cmovneq %rcx, %rbx
movq 0xd5c0(%rip), %rdi      # 0x129e8
leaq 0x6ea6(%rip), %rsi      # 0xc2d5
pushq $-0x1
popq %rdx
callq 0x2200
movzbl 0xd199(%rip), %eax      # 0x125d7
decl %eax
cmpl $0x5, %eax
ja 0x5737
leaq 0x5e30(%rip), %rcx      # 0xb280
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xd588(%rip), %rdi      # 0x129e8
leaq 0x6e84(%rip), %rsi      # 0xc2eb
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x3933
movq 0xd4a5(%rip), %rdx      # 0x12920
movq 0xd136(%rip), %rcx      # 0x125b8
leaq 0xd017(%rip), %rbx      # 0x124a0
leaq 0x6e82(%rip), %rsi      # 0xc312
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq 0xd4ca(%rip), %rdx      # 0x12970
leaq 0x6e92(%rip), %rsi      # 0xc33f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0x6ead(%rip), %rbx      # 0xc370
jmp 0x5725
callq 0x3933
movzbl 0xd103(%rip), %eax      # 0x125d7
cmpl %eax, 0xd546(%rip)      # 0x12a20
je 0x57ee
movl %eax, 0xd53a(%rip)      # 0x12a20
decl %eax
cmpl $0x4, %eax
ja 0x58ac
leaq 0x5da0(%rip), %rcx      # 0xb298
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xd470(%rip), %rcx      # 0x12978
leaq 0xcf91(%rip), %rbx      # 0x124a0
leaq 0x6bbb(%rip), %rsi      # 0xc0d1
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq 0xd441(%rip), %rdx      # 0x12970
movq 0xd3ea(%rip), %rcx      # 0x12920
leaq 0x6bcd(%rip), %rsi      # 0xc10a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0x6bea(%rip), %rsi      # 0xc13d
jmp 0x589d
movq 0xd3c1(%rip), %rdx      # 0x12920
leaq 0xcf3a(%rip), %rbx      # 0x124a0
leaq 0x6f6d(%rip), %rsi      # 0xc4da
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq 0xd3ed(%rip), %rdx      # 0x12970
leaq 0x6f7f(%rip), %rsi      # 0xc509
movq %rbx, %rdi
jmp 0x56b8
movq 0xd01f(%rip), %rdx      # 0x125b8
movq 0xd380(%rip), %rcx      # 0x12920
leaq 0xcef9(%rip), %r14      # 0x124a0
leaq 0x6e82(%rip), %rsi      # 0xc430
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq 0xd3ac(%rip), %rdx      # 0x12970
leaq 0x6e85(%rip), %rsi      # 0xc450
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0x6e95(%rip), %rbx      # 0xc479
jmp 0x5725
movq 0xcfc8(%rip), %rdx      # 0x125b8
movq 0xd329(%rip), %rcx      # 0x12920
leaq 0xcea2(%rip), %r14      # 0x124a0
leaq 0x6e2b(%rip), %rsi      # 0xc430
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq 0xd355(%rip), %rcx      # 0x12970
leaq 0x6e6c(%rip), %rsi      # 0xc48e
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0x6e85(%rip), %rbx      # 0xc4c0
jmp 0x5725
cmpq %r12, %r14
leaq 0x6c80(%rip), %rax      # 0xc2ca
leaq 0x7311(%rip), %rcx      # 0xc962
cmoveq %rax, %rcx
cmpq %r15, %r14
leaq 0x6c6a(%rip), %r14      # 0xc2c9
cmovneq %rcx, %r14
movq 0xcf4e(%rip), %rdx      # 0x125b8
leaq 0xce2f(%rip), %rbx      # 0x124a0
leaq 0x6d24(%rip), %rsi      # 0xc39c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq 0xd292(%rip), %rdx      # 0x12920
movq 0xd2db(%rip), %rcx      # 0x12970
leaq 0x6d2a(%rip), %rsi      # 0xc3c6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0x6d45(%rip), %rsi      # 0xc3f7
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2190
jmp 0x5725
cmpb $0x1, 0xcf08(%rip)      # 0x125d0
leaq 0x65a3(%rip), %rax      # 0xbc72
leaq 0x68e7(%rip), %r14      # 0xbfbd
cmoveq %rax, %r14
movq 0xd307(%rip), %rdi      # 0x129e8
leaq 0x6e3e(%rip), %rsi      # 0xc526
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x3933
movq 0xd224(%rip), %rdx      # 0x12920
movzbl 0xcecd(%rip), %ecx      # 0x125d0
movq 0xd266(%rip), %r8       # 0x12970
leaq 0xcd8f(%rip), %rbx      # 0x124a0
leaq 0x6e3b(%rip), %rsi      # 0xc553
movq %rbx, %rdi
movq %r14, %r9
xorl %eax, %eax
callq 0x2190
movq 0xd2bc(%rip), %rdi      # 0x129e8
pushq $-0x1
popq %rdx
movq %rbx, %rsi
callq 0x2200
callq 0x3933
callq 0x3933
xorl %eax, %eax
movb 0xce87(%rip), %cl       # 0x125d0
leaq 0xd230(%rip), %r12      # 0x12980
leaq 0xd1c9(%rip), %r13      # 0x12920
leaq 0xcd42(%rip), %r14      # 0x124a0
leaq 0x6e23(%rip), %r15      # 0xc588
xorl %ebx, %ebx
xorl %ebp, %ebp
movzbl %cl, %edx
cmpq %rdx, %rbp
ja 0x57c8
movq (%rbx,%r12), %rsi
testq %rsi, %rsi
je 0x57bf
testb %al, %al
jne 0x579d
movq 0xd263(%rip), %rdi      # 0x129e8
leaq 0x6de8(%rip), %rsi      # 0xc574
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x3933
movq (%rbx,%r12), %rsi
movq (%rbx,%r13), %rdx
movswl 0x1a(%rsi), %ecx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2190
callq 0x399b
movb $0x1, %al
movb 0xce11(%rip), %cl       # 0x125d0
incq %rbp
addq $0x8, %rbx
jmp 0x5769
testb %al, %al
jne 0x57e7
movq 0xd215(%rip), %rdi      # 0x129e8
leaq 0x6db6(%rip), %rsi      # 0xc590
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x3933
movb $0x1, 0xd236(%rip)      # 0x12a24
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd16c(%rip), %rdx      # 0x12970
leaq 0xcc95(%rip), %rdi      # 0x124a0
leaq 0x6a4d(%rip), %rsi      # 0xc25f
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0x6a6f(%rip), %rsi      # 0xc294
jmp 0x589d
movq 0xd142(%rip), %rdx      # 0x12970
leaq 0xcc6b(%rip), %rdi      # 0x124a0
leaq 0x6997(%rip), %rsi      # 0xc1d3
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0x69b6(%rip), %rsi      # 0xc205
jmp 0x589d
leaq 0x69cb(%rip), %rsi      # 0xc223
jmp 0x589d
movq 0xd10f(%rip), %rdx      # 0x12970
leaq 0xcc38(%rip), %rdi      # 0x124a0
leaq 0x68e9(%rip), %rsi      # 0xc158
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq 0xd166(%rip), %rdi      # 0x129e8
leaq 0x6903(%rip), %rsi      # 0xc18c
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x3933
leaq 0x692c(%rip), %rsi      # 0xc1c9
movq 0xd144(%rip), %rdi      # 0x129e8
pushq $-0x1
popq %rdx
callq 0x2200
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3933