// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq 0xc199(%rip), %rdi      # 0x159e8
leaq 0x709c(%rip), %rsi      # 0x108f2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
leaq -0x30(%rbp), %rdi
callq 0x8f30
movb $0x1, -0x35(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
cmpl $0x3, -0x4(%rbp)
jg 0x9895
movslq -0x4(%rbp), %rax
movb $0x1, -0x34(%rbp,%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x987b
movq 0xc14c(%rip), %rdi      # 0x159e8
leaq 0x7066(%rip), %rsi      # 0x10909
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0xc134(%rip), %rdi      # 0x159e8
leaq 0xbbe5(%rip), %rsi      # 0x154a0
movl $0x1, %edx
callq 0x24a0
leaq 0xbbd4(%rip), %rdi      # 0x154a0
leaq 0x6db6(%rip), %rsi      # 0x10689
leaq -0x4(%rbp), %rdx
movb $0x0, %al
callq 0x20a0
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jle 0x98f8
movb $0x0, -0x35(%rbp)
jmp 0x990c
movl -0x4(%rbp), %eax
movw %ax, %cx
movq 0xc07b(%rip), %rax      # 0x15980
movw %cx, 0xda(%rax)
movq 0xc06d(%rip), %rax      # 0x15980
movq %rax, -0x40(%rbp)
movl $0x0, -0x4(%rbp)
cmpl $0x3, -0x4(%rbp)
jg 0x9a2f
movslq -0x4(%rbp), %rax
cmpl $0x0, -0x30(%rbp,%rax,4)
jle 0x9a0e
movslq -0x4(%rbp), %rax
cmpl $0x5, -0x30(%rbp,%rax,4)
jge 0x9a0e
movq -0x40(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0xd2(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0x99ca
movq -0x40(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x60(%rax,%rcx,8), %xmm0
movsd 0x572b(%rip), %xmm1     # 0xf0b0
ucomisd %xmm1, %xmm0
jbe 0x99ad
movq -0x40(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x5713(%rip), %xmm0     # 0xf0b8
ucomisd 0x60(%rax,%rcx,8), %xmm0
ja 0x99ca
movq -0x40(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
xorps %xmm0, %xmm0
ucomisd 0x20(%rax,%rcx,8), %xmm0
jb 0x99e7
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movslq -0x4(%rbp), %rax
movl -0x30(%rbp,%rax,4), %eax
subl $0x1, %eax
cltq
movb $0x0, -0x34(%rbp,%rax)
jmp 0x9a0c
movq -0x40(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0xd2(%rax,%rcx,2), %edx
addl $0x64, %edx
movw %dx, 0xd2(%rax,%rcx,2)
jmp 0x9a1f
movslq -0x4(%rbp), %rax
cmpl $0x4, -0x30(%rbp,%rax,4)
jle 0x9a1d
movb $0x0, -0x35(%rbp)
jmp 0x9a1f
jmp 0x9a21
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x991e
cmpb $0x0, -0x35(%rbp)
jne 0x9a3f
callq 0x8cd0
jmp 0x9aef
cmpl $0x0, -0x8(%rbp)
jg 0x9a4a
jmp 0x9aef
movq 0xbf97(%rip), %rdi      # 0x159e8
leaq 0x6ec4(%rip), %rsi      # 0x1091c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
cmpl $0x1, -0x8(%rbp)
jle 0x9a79
movq 0xbf79(%rip), %rdi      # 0x159e8
movl $0x73, %esi
callq 0x2150
movl $0x1, -0x4(%rbp)
cmpl $0x4, -0x4(%rbp)
jg 0x9ad2
movl -0x4(%rbp), %eax
subl $0x1, %eax
cltq
cmpb $0x0, -0x34(%rbp,%rax)
jne 0x9ac5
movl -0x4(%rbp), %edx
leaq 0xba01(%rip), %rdi      # 0x154a0
leaq 0x6e88(%rip), %rsi      # 0x1092e
movb $0x0, %al
callq 0x2190
movq 0xbf34(%rip), %rdi      # 0x159e8
leaq 0xb9e5(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0x9ac7
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x9a80
movq 0xbf0f(%rip), %rdi      # 0x159e8
leaq 0x6e52(%rip), %rsi      # 0x10932
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x42a0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)