// File: /workspace/github_c_makefile_star2_O0/hyc[P]trek73c/trekx.c
// Function: EStrat
void EStrat()
{
  struct LOC_EStrat V;
  int I;
  boolean Nrm;

  V.Targ = 1;
  V.Sh = TCount;
  if (Ships[0] != NULL) {
    V.Rnge = Range(V.Sh, V.Targ-1);
    V.Bear = Bearing(V.Sh, V.Targ-1);
    V.Bear = RMod(V.Bear - Objects[V.Sh]->Act_Crs);
  }
  if (Win > 0 && Win < 6) {
    switch (Win) {

    case 2:
    case 3:
      Retreat(&V);
      break;

    case 4:
    case 5:
      Desist(&V);
      break;
    }
    return;
  }
  for (I = 0; I < 4; I++) {
    if (Ct[I] > 0 && Ct[I] < 6) {
      switch (I) {

      case 0:
	Ruse(&V);
	break;

      case 1:
	Bluff(&V);
	break;

      case 2:
	Surr(&V);
	break;

      case 3:
	if (Ct[2]<3)
	  ESurr(&V);	/* No contemplation if waiting for your surrender */
	break;
      }
    }
  }
  Nrm = true;
  for (I = 0; I<4; I++)
    if (Ct[I] > 0 && Ct[I] < 6) {
      Nrm = false;
      break;
    }
  if (!Nrm) {	/* Check for unsportsmanlike firing... */
    for (I = 0; I < Phasers; I++)
      if (Ships[0]->Pstat[I] > 99) {
	Nrm = true;
	break;
      }
    if (!Nrm)
      for (I = 0; I < Tubes; I++)
	if (Ships[0]->Tstat[I] > 99) {
	  Nrm = true;
	  break;
	}
    if (Nrm) {
      sprintf(scrstr,"%s:  How dare you fire upon us!  We are resuming our",
	Capt);
      SEndln();
      waddstr(Cmdwin,"   attack!");
      Endln();
      Win = 0;
      for (I = 0; I<4; I++)
	if (Ct[I])
	  Ct[I] = 6;
    } else {
      Nrm = true;
      for (I = 0; I <= 3; I++)
        if (Ct[I] > 0 && Ct[I] < 6) {
          Nrm = false;
	  break;
        }
      if (Win == 4 || Win == 5)
        Nrm = false;
    }
  }
  if (Nrm)
    Normal(&V);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x1, -0x14(%rbp)
movl 0xdfd3(%rip), %eax      # 0x15a28
movl %eax, -0x18(%rbp)
cmpq $0x0, 0xdf20(%rip)      # 0x15980
je 0x7aab
movl -0x18(%rbp), %edi
movl -0x14(%rbp), %esi
subl $0x1, %esi
callq 0x4540
movsd %xmm0, -0x8(%rbp)
movl -0x18(%rbp), %edi
movl -0x14(%rbp), %esi
subl $0x1, %esi
callq 0x4430
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movslq -0x18(%rbp), %rcx
leaq 0xdb48(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
subsd 0x10(%rax), %xmm0
callq 0x4380
movsd %xmm0, -0x10(%rbp)
movzbl 0xdb25(%rip), %eax      # 0x155d7
cmpl $0x0, %eax
jle 0x7afd
movzbl 0xdb19(%rip), %eax      # 0x155d7
cmpl $0x6, %eax
jge 0x7afd
movzbl 0xdb0d(%rip), %eax      # 0x155d7
movl %eax, -0x24(%rbp)
addl $-0x2, %eax
subl $0x2, %eax
jb 0x7ae4
jmp 0x7ad7
movl -0x24(%rbp), %eax
addl $-0x4, %eax
subl $0x2, %eax
jb 0x7aef
jmp 0x7af8
leaq -0x18(%rbp), %rdi
callq 0x7d90
jmp 0x7af8
leaq -0x18(%rbp), %rdi
callq 0x7e30
jmp 0x7d85
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x7ba1
movslq -0x1c(%rbp), %rcx
leaq 0xdaba(%rip), %rax      # 0x155d3
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x7b91
movslq -0x1c(%rbp), %rcx
leaq 0xdaa6(%rip), %rax      # 0x155d3
movzbl (%rax,%rcx), %eax
cmpl $0x6, %eax
jge 0x7b91
movl -0x1c(%rbp), %eax
movq %rax, -0x30(%rbp)
subq $0x3, %rax
ja 0x7b8f
movq -0x30(%rbp), %rax
leaq 0x76a6(%rip), %rcx      # 0xf1f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x18(%rbp), %rdi
callq 0x7e80
jmp 0x7b8f
leaq -0x18(%rbp), %rdi
callq 0x8070
jmp 0x7b8f
leaq -0x18(%rbp), %rdi
callq 0x82c0
jmp 0x7b8f
movzbl 0xda56(%rip), %eax      # 0x155d5
cmpl $0x3, %eax
jge 0x7b8d
leaq -0x18(%rbp), %rdi
callq 0x8530
jmp 0x7b8f
jmp 0x7b91
jmp 0x7b93
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7b04
movb $0x1, -0x1d(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x7bed
movslq -0x1c(%rbp), %rcx
leaq 0xda16(%rip), %rax      # 0x155d3
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x7be0
movslq -0x1c(%rbp), %rcx
leaq 0xda02(%rip), %rax      # 0x155d3
movzbl (%rax,%rcx), %eax
cmpl $0x6, %eax
jge 0x7be0
movb $0x0, -0x1d(%rbp)
jmp 0x7bed
jmp 0x7be2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7bac
cmpb $0x0, -0x1d(%rbp)
jne 0x7d76
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movzbl 0xd5a8(%rip), %ecx      # 0x151b0
cmpl %ecx, %eax
jge 0x7c37
movq 0xdd6d(%rip), %rax      # 0x15980
movslq -0x1c(%rbp), %rcx
movswl 0xd2(%rax,%rcx,2), %eax
cmpl $0x63, %eax
jle 0x7c2a
movb $0x1, -0x1d(%rbp)
jmp 0x7c37
jmp 0x7c2c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7bfe
cmpb $0x0, -0x1d(%rbp)
jne 0x7c7f
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movzbl 0xd563(%rip), %ecx      # 0x151b1
cmpl %ecx, %eax
jge 0x7c7d
movq 0xdd27(%rip), %rax      # 0x15980
movslq -0x1c(%rbp), %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x63, %eax
jle 0x7c70
movb $0x1, -0x1d(%rbp)
jmp 0x7c7d
jmp 0x7c72
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7c44
jmp 0x7c7f
cmpb $0x0, -0x1d(%rbp)
je 0x7d0a
movq 0xdce8(%rip), %rdx      # 0x15978
leaq 0xd809(%rip), %rdi      # 0x154a0
leaq 0x8a34(%rip), %rsi      # 0x106d2
movb $0x0, %al
callq 0x2190
callq 0x4320
movq 0xdd37(%rip), %rdi      # 0x159e8
leaq 0x8a4f(%rip), %rsi      # 0x10707
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x42a0
movb $0x0, 0xd909(%rip)      # 0x155d7
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x7d08
movslq -0x1c(%rbp), %rcx
leaq 0xd8ed(%rip), %rax      # 0x155d3
cmpb $0x0, (%rax,%rcx)
je 0x7cfb
movslq -0x1c(%rbp), %rcx
leaq 0xd8dc(%rip), %rax      # 0x155d3
movb $0x6, (%rax,%rcx)
jmp 0x7cfd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7cd5
jmp 0x7d74
movb $0x1, -0x1d(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x3, -0x1c(%rbp)
jg 0x7d56
movslq -0x1c(%rbp), %rcx
leaq 0xd8ad(%rip), %rax      # 0x155d3
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jle 0x7d49
movslq -0x1c(%rbp), %rcx
leaq 0xd899(%rip), %rax      # 0x155d3
movzbl (%rax,%rcx), %eax
cmpl $0x6, %eax
jge 0x7d49
movb $0x0, -0x1d(%rbp)
jmp 0x7d56
jmp 0x7d4b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7d15
movzbl 0xd87a(%rip), %eax      # 0x155d7
cmpl $0x4, %eax
je 0x7d6e
movzbl 0xd86e(%rip), %eax      # 0x155d7
cmpl $0x5, %eax
jne 0x7d72
movb $0x0, -0x1d(%rbp)
jmp 0x7d74
jmp 0x7d76
cmpb $0x0, -0x1d(%rbp)
je 0x7d85
leaq -0x18(%rbp), %rdi
callq 0x86f0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)