// File: /workspace/github_c_makefile_star2_O3/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, 0xd68b(%rip)      # 0x135e8
ja 0x5f94
movzbl 0xd67c(%rip), %eax      # 0x135e2
cmpq $0x2, %rax
jb 0x5f94
movl $0x1, %ecx
leaq 0xd678(%rip), %rdx      # 0x135f0
movq (%rdx,%rcx,8), %rsi
testq %rsi, %rsi
je 0x5f8c
cmpw $0x9, 0x4a(%rsi)
jg 0x6414
incq %rcx
cmpq %rcx, %rax
jne 0x5f78
callq 0x3d76
movq 0xd638(%rip), %r14      # 0x135d8
movq 0xd251(%rip), %r15      # 0x131f8
movq 0xd242(%rip), %r12      # 0x131f0
cmpq %r12, %r14
leaq 0x8385(%rip), %rax      # 0xe33d
leaq 0x838a(%rip), %rcx      # 0xe349
cmoveq %rax, %rcx
cmpq %r15, %r14
leaq 0x8378(%rip), %rbx      # 0xe345
cmovneq %rcx, %rbx
movq 0xda20(%rip), %rdi      # 0x139f8
leaq 0x836e(%rip), %rsi      # 0xe34d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movzbl 0xd5f8(%rip), %eax      # 0x135e8
decl %eax
cmpl $0x5, %eax
ja 0x6313
leaq 0x730a(%rip), %rcx      # 0xd30c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xd9e6(%rip), %rdi      # 0x139f8
leaq 0x834a(%rip), %rsi      # 0xe363
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0xd901(%rip), %rdx      # 0x13930
movq 0xd592(%rip), %rcx      # 0x135c8
leaq 0xd473(%rip), %rbx      # 0x134b0
leaq 0x8346(%rip), %rsi      # 0xe38a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd9a3(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0xd912(%rip), %rdx      # 0x13980
leaq 0x8342(%rip), %rsi      # 0xe3b7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd972(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x8349(%rip), %rbx      # 0xe3e8
jmp 0x62ff
movq 0xd885(%rip), %rdx      # 0x13930
leaq 0xd3fe(%rip), %rbx      # 0x134b0
leaq 0x8499(%rip), %rsi      # 0xe552
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd92e(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0xd89d(%rip), %rdx      # 0x13980
leaq 0x8497(%rip), %rsi      # 0xe581
movq %rbx, %rdi
jmp 0x6290
movq 0xd4cf(%rip), %rdx      # 0x135c8
movq 0xd830(%rip), %rcx      # 0x13930
leaq 0xd3a9(%rip), %r14      # 0x134b0
leaq 0x839a(%rip), %rsi      # 0xe4a8
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd8d9(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0xd848(%rip), %rdx      # 0x13980
leaq 0x8389(%rip), %rsi      # 0xe4c8
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x21a0
movq 0xd8a5(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x8385(%rip), %rbx      # 0xe4f1
jmp 0x62ff
movq 0xd450(%rip), %rdx      # 0x135c8
movq 0xd7b1(%rip), %rcx      # 0x13930
leaq 0xd32a(%rip), %r14      # 0x134b0
leaq 0x831b(%rip), %rsi      # 0xe4a8
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd85a(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0xd7c9(%rip), %rcx      # 0x13980
leaq 0x8348(%rip), %rsi      # 0xe506
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21a0
movq 0xd826(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x834d(%rip), %rbx      # 0xe538
jmp 0x62ff
cmpq %r12, %r14
leaq 0x8148(%rip), %rax      # 0xe342
leaq 0x87d9(%rip), %rcx      # 0xe9da
cmoveq %rax, %rcx
cmpq %r15, %r14
leaq 0x8132(%rip), %r14      # 0xe341
cmovneq %rcx, %r14
movq 0xd3ae(%rip), %rdx      # 0x135c8
leaq 0xd28f(%rip), %rbx      # 0x134b0
leaq 0x81ec(%rip), %rsi      # 0xe414
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd7bf(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0xd6de(%rip), %rdx      # 0x13930
movq 0xd727(%rip), %rcx      # 0x13980
leaq 0x81de(%rip), %rsi      # 0xe43e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xd787(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x81e5(%rip), %rsi      # 0xe46f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x21a0
jmp 0x62ff
cmpb $0x1, 0xd340(%rip)      # 0x135e0
leaq 0x7a43(%rip), %rax      # 0xdcea
leaq 0x7d87(%rip), %r14      # 0xe035
cmoveq %rax, %r14
movq 0xd73f(%rip), %rdi      # 0x139f8
leaq 0x82de(%rip), %rsi      # 0xe59e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0xd65a(%rip), %rdx      # 0x13930
movzbl 0xd303(%rip), %ecx      # 0x135e0
movq 0xd69c(%rip), %r8       # 0x13980
leaq 0xd1c5(%rip), %rbx      # 0x134b0
leaq 0x82d9(%rip), %rsi      # 0xe5cb
movq %rbx, %rdi
movq %r14, %r9
xorl %eax, %eax
callq 0x21a0
movq 0xd6f2(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
callq 0x3d76
movb $0x1, %bpl
xorl %eax, %eax
leaq 0xd667(%rip), %r12      # 0x13990
leaq 0xd180(%rip), %r14      # 0x134b0
leaq 0x82c9(%rip), %r15      # 0xe600
movzbl 0xd2a2(%rip), %ecx      # 0x135e0
leaq (,%rax,8), %r13
movq %rax, %rbx
movq (%r13,%r12), %rax
testq %rax, %rax
jne 0x6365
leaq 0x1(%rbx), %rax
addq $0x8, %r13
cmpq %rcx, %rbx
movq %rax, %rbx
jb 0x6349
jmp 0x63db
testb $0x1, %bpl
je 0x638d
movq 0xd686(%rip), %rdi      # 0x139f8
leaq 0x8273(%rip), %rsi      # 0xe5ec
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq (%r13,%r12), %rax
leaq 0xd59c(%rip), %rcx      # 0x13930
movq (%r13,%rcx), %rdx
movswl 0x1a(%rax), %ecx
xorl %ebp, %ebp
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0xd645(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x1(%rbx), %rax
movzbl 0xd210(%rip), %ecx      # 0x135e0
cmpq %rcx, %rbx
jb 0x6337
jmp 0x63fe
testb $0x1, %bpl
je 0x63fe
movq 0xd610(%rip), %rdi      # 0x139f8
leaq 0x8219(%rip), %rsi      # 0xe608
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movb $0x1, 0xd62f(%rip)      # 0x13a34
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3d76
movzbl 0xd1c8(%rip), %eax      # 0x135e8
cmpl %eax, 0xd60a(%rip)      # 0x13a30
je 0x6405
movl %eax, 0xd602(%rip)      # 0x13a30
decl %eax
cmpl $0x4, %eax
ja 0x6553
leaq 0x6eb8(%rip), %rcx      # 0xd2f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xd538(%rip), %rcx      # 0x13988
leaq 0xd059(%rip), %rbx      # 0x134b0
leaq 0x7ceb(%rip), %rsi      # 0xe149
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x21a0
callq 0x3de3
movq 0xd509(%rip), %rdx      # 0x13980
movq 0xd4b2(%rip), %rcx      # 0x13930
leaq 0x7cfd(%rip), %rsi      # 0xe182
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
callq 0x3de3
leaq 0x7d1a(%rip), %rsi      # 0xe1b5
jmp 0x6542
movq 0xd4d9(%rip), %rdx      # 0x13980
leaq 0xd002(%rip), %rdi      # 0x134b0
leaq 0x7e22(%rip), %rsi      # 0xe2d7
xorl %eax, %eax
callq 0x21a0
callq 0x3de3
leaq 0x7e44(%rip), %rsi      # 0xe30c
jmp 0x6542
movq 0xd4af(%rip), %rdx      # 0x13980
leaq 0xcfd8(%rip), %rdi      # 0x134b0
leaq 0x7d6c(%rip), %rsi      # 0xe24b
xorl %eax, %eax
callq 0x21a0
callq 0x3de3
leaq 0x7d8b(%rip), %rsi      # 0xe27d
jmp 0x6542
leaq 0x7da0(%rip), %rsi      # 0xe29b
jmp 0x6542
movq 0xd47c(%rip), %rdx      # 0x13980
leaq 0xcfa5(%rip), %rdi      # 0x134b0
leaq 0x7cbe(%rip), %rsi      # 0xe1d0
xorl %eax, %eax
callq 0x21a0
callq 0x3de3
movq 0xd4d3(%rip), %rdi      # 0x139f8
leaq 0x7cd8(%rip), %rsi      # 0xe204
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x7cff(%rip), %rsi      # 0xe241
movq 0xd4af(%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 0x3d76