// File: /workspace/github_c_makefile_star2_O2/hyc[P]trek73c/trekx.c
// Function: PFire
void PFire()
{
  int I, Bad;
  Digs Temp;
  boolean Stat[4];
  boolean Ok;
  reg Srec *WITH;

  waddstr(Cmdwin,"   Fire Phasers [1-4] ");
  Indigits(Temp);
  Ok = true;
  Bad = 0;
  for (I = 0; I <= 3; I++)
    Stat[I] = true;
  waddstr(Cmdwin,"   Spread [10-45] ");
  mygetstr(Cmdwin,scrstr,true);
  Bad = (sscanf(scrstr, "%d", &I) == 0);
  if (Bad > 0)
    Ok = false;
  else
    Ships[0]->Pstat[4] = I;
  WITH = Ships[0];
  for (I = 0; I <= 3; I++) {
    if (Temp[I] > 0 && Temp[I] < 5) {
      if (WITH->Pstat[Temp[I] - 1] < 0 ||
	  WITH->Pdepl[Temp[I] - 1] > 125 && WITH->Pdepl[Temp[I] - 1] < 235 ||
	  WITH->PChrg[Temp[I] - 1] <= 0) {
	Bad++;
	Stat[Temp[I] - 1] = false;
      } else
	WITH->Pstat[Temp[I] - 1] += 100;
    } else if (Temp[I] > 4)
      Ok = false;
  }
  if (!Ok) {
    BParam();
    return;
  }
  if (Bad <= 0)
    return;
  waddstr(Cmdwin," Computer: Phaser");
  if (Bad > 1)
    waddch(Cmdwin,'s');
  for (I = 1; I <= 4; I++) {
    if (!Stat[I - 1]) {
      sprintf(scrstr,"%2d", I);
      waddstr(Cmdwin,scrstr);
    }
  }
  waddstr(Cmdwin," unable to fire.");
  Endln();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq 0xb67e(%rip), %rdi      # 0x129e8
leaq 0x5485(%rip), %rsi      # 0xc7f6
pushq $-0x1
popq %rdx
callq 0x2200
leaq 0x10(%rsp), %rdi
callq 0x6cd8
xorl %eax, %eax
cmpq $0x4, %rax
je 0x7395
movb $0x1, 0xc(%rsp,%rax)
incq %rax
jmp 0x7385
leaq 0x8(%rsp), %r14
movl $0x4, (%r14)
movq 0xb640(%rip), %rdi      # 0x129e8
leaq 0x545e(%rip), %rsi      # 0xc80d
pushq $-0x1
popq %rdx
callq 0x2200
movq 0xb62a(%rip), %rdi      # 0x129e8
leaq 0xb0db(%rip), %r15      # 0x124a0
pushq $0x1
popq %rbx
movq %r15, %rsi
movl %ebx, %edx
callq 0x246d
leaq 0x51b4(%rip), %rsi      # 0xc58d
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x20a0
xorl %ebp, %ebp
movq 0xb58e(%rip), %rcx      # 0x12980
movl $0x0, %edx
testl %eax, %eax
sete %al
je 0x740c
movzwl 0x8(%rsp), %edx
movw %dx, 0xda(%rcx)
movb $0x1, %dl
movb %al, %bpl
movsd 0x3c79(%rip), %xmm0     # 0xb090
movsd 0x3c79(%rip), %xmm1     # 0xb098
xorpd %xmm2, %xmm2
xorl %eax, %eax
cmpq $0x4, %rax
je 0x7485
movl 0x10(%rsp,%rax,4), %esi
leal -0x1(%rsi), %edi
cmpl $0x3, %edi
ja 0x746d
movl %edi, %esi
movzwl 0xd2(%rcx,%rsi,2), %edi
testw %di, %di
js 0x7479
movsd 0x60(%rcx,%rsi,8), %xmm3
ucomisd %xmm0, %xmm3
jbe 0x7458
ucomisd %xmm3, %xmm1
ja 0x7479
ucomisd 0x20(%rcx,%rsi,8), %xmm2
jae 0x7479
addl $0x64, %edi
movw %di, 0xd2(%rcx,%rsi,2)
jmp 0x7480
cmpl $0x5, %esi
movzbl %dl, %edx
cmovgel %r12d, %edx
jmp 0x7480
incl %ebp
movb $0x0, 0xc(%rsp,%rsi)
incq %rax
jmp 0x7425
movl $0x4, 0x8(%rsp)
testb %dl, %dl
je 0x7536
testl %ebp, %ebp
jle 0x753b
movq 0xb544(%rip), %rdi      # 0x129e8
leaq 0x5375(%rip), %rsi      # 0xc820
pushq $-0x1
popq %rdx
callq 0x2200
cmpl $0x1, %ebp
je 0x74c7
movq 0xb529(%rip), %rdi      # 0x129e8
pushq $0x73
popq %rsi
callq 0x2150
leaq 0xc(%rsp), %r12
leaq 0xafcd(%rip), %r14      # 0x124a0
leaq 0x5358(%rip), %r15      # 0xc832
pushq $-0x1
popq %rbp
movl %ebx, 0x8(%rsp)
cmpl $0x4, %ebx
jg 0x7519
movslq %ebx, %rax
cmpb $0x0, -0x1(%rax,%r12)
jne 0x7515
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2190
movq 0xb4e1(%rip), %rdi      # 0x129e8
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movl 0x8(%rsp), %ebx
incl %ebx
jmp 0x74dd
movq 0xb4c8(%rip), %rdi      # 0x129e8
leaq 0x530f(%rip), %rsi      # 0xc836
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x3933
jmp 0x753b
callq 0x6b2a
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq