// File: /workspace/github_c_makefile_star2_O1/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 0xb628(%rip), %rdi      # 0x139f8
leaq 0x63df(%rip), %rsi      # 0xe7b6
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x10(%rsp), %rdi
callq 0x7c6a
movl $0x1010101, 0xc(%rsp)   # imm = 0x1010101
leaq 0x8(%rsp), %rbx
movl $0x4, (%rbx)
movq 0xb5f3(%rip), %rdi      # 0x139f8
leaq 0x63c1(%rip), %rsi      # 0xe7cd
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xb5db(%rip), %rdi      # 0x139f8
leaq 0xb08c(%rip), %r14      # 0x134b0
movq %r14, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x6115(%rip), %rsi      # 0xe54d
xorl %r15d, %r15d
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x20b0
xorl %ebx, %ebx
movl $0x0, %ecx
testl %eax, %eax
sete %al
je 0x846b
movzwl 0x8(%rsp), %ecx
movq 0xb52e(%rip), %rdx      # 0x13990
movw %cx, 0xda(%rdx)
movb $0x1, %cl
movb %al, %bl
movq 0xb51c(%rip), %rax      # 0x13990
movsd 0x4c04(%rip), %xmm0     # 0xd080
movsd 0x4c04(%rip), %xmm1     # 0xd088
xorpd %xmm2, %xmm2
xorl %edx, %edx
movslq 0x10(%rsp,%rdx,4), %rsi
leal -0x1(%rsi), %edi
cmpl $0x3, %edi
ja 0x84cf
decq %rsi
movl %esi, %edi
cmpw $0x0, 0xd2(%rax,%rdi,2)
js 0x84db
movsd 0x60(%rax,%rdi,8), %xmm3
ucomisd %xmm0, %xmm3
jbe 0x84b9
ucomisd %xmm3, %xmm1
ja 0x84db
movslq %edi, %rdi
ucomisd 0x20(%rax,%rdi,8), %xmm2
jae 0x84db
addw $0x64, 0xd2(%rax,%rdi,2)
jmp 0x84e2
cmpl $0x5, %esi
movzbl %cl, %ecx
cmovgel %r15d, %ecx
jmp 0x84e2
incl %ebx
movb $0x0, 0xc(%rsp,%rsi)
incq %rdx
cmpq $0x4, %rdx
jne 0x848a
movl $0x4, 0x8(%rsp)
testb %cl, %cl
je 0x85ac
testl %ebx, %ebx
jle 0x85b1
movq 0xb4ee(%rip), %rdi      # 0x139f8
leaq 0x62cf(%rip), %rsi      # 0xe7e0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpl $0x1, %ebx
je 0x8531
movq 0xb4d1(%rip), %rdi      # 0x139f8
movl $0x73, %esi
callq 0x2160
movl $0x1, 0x8(%rsp)
movl $0x1, %edx
leaq 0xc(%rsp), %r15
leaq 0xaf66(%rip), %rbx      # 0x134b0
leaq 0x62a1(%rip), %r14      # 0xe7f2
movslq %edx, %rax
cmpb $0x0, -0x1(%rax,%r15)
jne 0x857d
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0xb488(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movl 0x8(%rsp), %eax
leal 0x1(%rax), %edx
movl %edx, 0x8(%rsp)
cmpl $0x4, %eax
jl 0x8551
movq 0xb464(%rip), %rdi      # 0x139f8
leaq 0x625b(%rip), %rsi      # 0xe7f6
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
jmp 0x85b1
callq 0x7a95
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq