// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq 0xb5ad(%rip), %rdi      # 0x139f8
leaq 0x641c(%rip), %rsi      # 0xe86e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x10(%rsp), %rdi
callq 0x7d24
movl $0x1010101, 0xc(%rsp)   # imm = 0x1010101
leaq 0x8(%rsp), %rbx
movl $0x4, (%rbx)
movq 0xb578(%rip), %rdi      # 0x139f8
leaq 0x63fe(%rip), %rsi      # 0xe885
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xb560(%rip), %rdi      # 0x139f8
leaq 0xb011(%rip), %r14      # 0x134b0
movq %r14, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x6152(%rip), %rsi      # 0xe605
xorl %r15d, %r15d
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x20b0
xorl %ebx, %ebx
movq 0xb4c4(%rip), %rcx      # 0x13990
movl $0x0, %edx
testl %eax, %eax
sete %al
je 0x84e6
movzwl 0x8(%rsp), %edx
movw %dx, 0xda(%rcx)
movb $0x1, %dl
movb %al, %bl
movsd 0x4cd8(%rip), %xmm0     # 0xd1c8
movsd 0x4cd8(%rip), %xmm1     # 0xd1d0
xorpd %xmm2, %xmm2
xorl %eax, %eax
movl 0x10(%rsp,%rax,4), %esi
leal -0x1(%rsi), %edi
cmpl $0x3, %edi
ja 0x8540
movl %edi, %esi
movzwl 0xd2(%rcx,%rsi,2), %edi
testw %di, %di
js 0x854c
movsd 0x60(%rcx,%rsi,8), %xmm3
ucomisd %xmm0, %xmm3
jbe 0x852b
ucomisd %xmm3, %xmm1
ja 0x854c
ucomisd 0x20(%rcx,%rsi,8), %xmm2
jae 0x854c
addl $0x64, %edi
movw %di, 0xd2(%rcx,%rsi,2)
jmp 0x8553
cmpl $0x5, %esi
movzbl %dl, %edx
cmovgel %r15d, %edx
jmp 0x8553
incl %ebx
movb $0x0, 0xc(%rsp,%rsi)
incq %rax
cmpq $0x4, %rax
jne 0x84fe
movl $0x4, 0x8(%rsp)
testb %dl, %dl
je 0x861f
testl %ebx, %ebx
jle 0x8624
movq 0xb47d(%rip), %rdi      # 0x139f8
leaq 0x6316(%rip), %rsi      # 0xe898
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpl $0x1, %ebx
je 0x85a2
movq 0xb460(%rip), %rdi      # 0x139f8
movl $0x73, %esi
callq 0x2160
movl $0x1, 0x8(%rsp)
movl $0x1, %edx
leaq 0xc(%rsp), %r15
leaq 0xaef5(%rip), %rbx      # 0x134b0
leaq 0x62e8(%rip), %r14      # 0xe8aa
movslq %edx, %rax
cmpb $0x0, -0x1(%rax,%r15)
jne 0x85f2
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0xb417(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movl 0x8(%rsp), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x8(%rsp)
cmpl $0x4, %edx
movl %eax, %edx
jl 0x85c2
movq 0xb3f1(%rip), %rdi      # 0x139f8
leaq 0x62a0(%rip), %rsi      # 0xe8ae
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
jmp 0x8624
callq 0x7b4f
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq