// File: /workspace/github_c_makefile_star2_O0/hyc[P]trek73c/trekx.c
// Function: Pstts
void Pstts()
{
  Digs temp;
  int i, shp, bad;
  boolean ok, Ship;
  Char *Junk;
  double B;
  boolean Stat[4];
  reg Srec *WITH;

  TCount = (-1);
  werase(Scnwin);
  mvwaddstr(Scnwin, 0, 0, "Phasers  Control  Turned  Levels");
  WITH = Ships[0];
  for (i = 0; i < Phasers; i++) {
    sprintf(scrstr,"%4d", i+1);
    mvwaddstr(Scnwin,i+1,0,scrstr);
    if (WITH->Pstat[i] < 0)
      waddstr(Scnwin,"     Damaged  ");
    else if (WITH->Pstat[i] == 0)
      waddstr(Scnwin,"      Manual  ");
    else {
      Junk = Snams[WITH->Pstat[i] - 1];
      shp = strlen(Junk) / 2 + 9;
      sprintf(scrstr,"%*s%*s", shp, Junk, 14 - shp, "");
      waddstr(Scnwin,scrstr);
    }
    if (WITH->Pstat[i] < 0)
      waddstr(Scnwin,"  --      --");
    else {
      sprintf(scrstr,"%4ld%8ld",
	     (long)floor(WITH->Pdepl[i] + 0.5),
	     (long)floor(WITH->PChrg[i] + 0.5));
      waddstr(Scnwin,scrstr);
    }
  }
  mvwaddstr(Scnwin,Phasers+2,0,"Charge rates: ");
  for (i = 0; i <= 3; i++) {
    sprintf(scrstr,"%4.0f", Ships[0]->PCrts[i]);
    waddstr(Scnwin,scrstr);
  }
  sprintf(scrstr,"Firing percentage: %d", Ships[0]->Pstat[5]);
  mvwaddstr(Scnwin,Phasers+3,0,scrstr);
  wrefresh(Scnwin);
  waddstr(Cmdwin,"   Lock Phasers [1-4] ");
  Indigits(temp);
  bad = 0;
  for (i = 0; i <= 3; i++)
    Stat[i] = false;
  if (temp[0] > 0) {
    TCount++;
    waddstr(Cmdwin,"   on ");
    shp = GetShp(&ok, &Ship);
    WITH = Ships[0];
    if (Ship) {
      B = Bearing(0, shp) - Objects[0]->Act_Crs;
      B = RMod(B);
      for (i = 0; i <= 3; i++) {
	if (temp[i] > 0 && temp[i] < 5) {
	  if (WITH->Pstat[temp[i] - 1] < 0 || !ok) {
	    bad++;
	    Stat[temp[i] - 1] = true;
	  } else {
	    WITH->Pstat[temp[i] - 1] = shp+1;
	    WITH->Pdepl[temp[i] - 1] = B;
	  }
	}
      }
    } else {
      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] = shp % 360;
	    WITH->Pstat[temp[i] - 1] = 0;
	  }
	}
      }
    }
  }
  if (bad <= 0)
    return;
  waddstr(Cmdwin,"Computer: Phaser");
  if (bad > 1)
    waddch(Cmdwin,'s');
  for (i = 0; i < Phasers; i++) {
    if (Stat[i]) {
      sprintf(scrstr,"%2d", i+1);
      waddstr(Cmdwin,scrstr);
    }
  }
  waddstr(Cmdwin," unable to turn.");
  Endln();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl $0xffffffff, 0xa666(%rip) # imm = 0xFFFFFFFF
movq 0xa637(%rip), %rdi      # 0x15a00
callq 0x2090
movq 0xa62b(%rip), %rdi      # 0x15a00
xorl %edx, %edx
movl %edx, %esi
callq 0x21d0
cmpl $-0x1, %eax
jne 0xb3e5
jmp 0xb3fd
movq 0xa614(%rip), %rdi      # 0x15a00
leaq 0x5f27(%rip), %rsi      # 0x1131a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0xa57c(%rip), %rax      # 0x15980
movq %rax, -0x60(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movzbl 0x9d97(%rip), %ecx      # 0x151b0
cmpl %ecx, %eax
jge 0xb603
movl -0x34(%rbp), %edx
addl $0x1, %edx
leaq 0xa072(%rip), %rdi      # 0x154a0
leaq 0x53fe(%rip), %rsi      # 0x10833
movb $0x0, %al
callq 0x2190
movq 0xa5bd(%rip), %rdi      # 0x15a00
movl -0x34(%rbp), %esi
addl $0x1, %esi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
jne 0xb457
jmp 0xb46f
movq 0xa5a2(%rip), %rdi      # 0x15a00
leaq 0xa03b(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0xd2(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jge 0xb4a1
movq 0xa575(%rip), %rdi      # 0x15a00
leaq 0x5ea9(%rip), %rsi      # 0x1133b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xb54f
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0xd2(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0xb4d0
movq 0xa543(%rip), %rdi      # 0x15a00
leaq 0x5e86(%rip), %rsi      # 0x1134a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xb54d
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0xd2(%rax,%rcx,2), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xa433(%rip), %rax      # 0x15920
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2140
shrq %rax
addq $0x9, %rax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %edx
movq -0x48(%rbp), %rcx
movl $0xe, %r8d
subl -0x38(%rbp), %r8d
leaq 0x9f80(%rip), %rdi      # 0x154a0
leaq 0x53b8(%rip), %rsi      # 0x108df
leaq 0x4806(%rip), %r9       # 0xfd34
movb $0x0, %al
callq 0x2190
movq 0xa4c4(%rip), %rdi      # 0x15a00
leaq 0x9f5d(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xb54f
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0xd2(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jge 0xb57e
movq 0xa495(%rip), %rdi      # 0x15a00
leaq 0x5de7(%rip), %rsi      # 0x11359
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xb5f3
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd 0x3afa(%rip), %xmm0     # 0xf088
addsd 0x60(%rax,%rcx,8), %xmm0
callq 0x22c0
cvttsd2si %xmm0, %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd 0x3ad6(%rip), %xmm0     # 0xf088
addsd 0x20(%rax,%rcx,8), %xmm0
callq 0x22c0
movq -0x68(%rbp), %rdx
cvttsd2si %xmm0, %rcx
leaq 0x9ed3(%rip), %rdi      # 0x154a0
leaq 0x5d92(%rip), %rsi      # 0x11366
movb $0x0, %al
callq 0x2190
movq 0xa41e(%rip), %rdi      # 0x15a00
leaq 0x9eb7(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xb5f5
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb40f
movq 0xa3f6(%rip), %rdi      # 0x15a00
movzbl 0x9b9f(%rip), %esi      # 0x151b0
addl $0x2, %esi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
jne 0xb622
jmp 0xb63a
movq 0xa3d7(%rip), %rdi      # 0x15a00
leaq 0x5d3f(%rip), %rsi      # 0x1136f
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jg 0xb690
movq 0xa332(%rip), %rax      # 0x15980
movslq -0x34(%rbp), %rcx
movsd 0x40(%rax,%rcx,8), %xmm0
leaq 0x9e41(%rip), %rdi      # 0x154a0
leaq 0x5268(%rip), %rsi      # 0x108ce
movb $0x1, %al
callq 0x2190
movq 0xa38c(%rip), %rdi      # 0x15a00
leaq 0x9e25(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb641
movq 0xa2e9(%rip), %rax      # 0x15980
movswl 0xdc(%rax), %edx
leaq 0x9dfb(%rip), %rdi      # 0x154a0
leaq 0x5cd2(%rip), %rsi      # 0x1137e
movb $0x0, %al
callq 0x2190
movq 0xa346(%rip), %rdi      # 0x15a00
movzbl 0x9aef(%rip), %esi      # 0x151b0
addl $0x3, %esi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
jne 0xb6d2
jmp 0xb6ea
movq 0xa327(%rip), %rdi      # 0x15a00
leaq 0x9dc0(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0xa30f(%rip), %rdi      # 0x15a00
callq 0x2180
movq 0xa2eb(%rip), %rdi      # 0x159e8
leaq 0x5c90(%rip), %rsi      # 0x11394
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
leaq -0x30(%rbp), %rdi
callq 0x8f30
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jg 0xb73f
movslq -0x34(%rbp), %rax
movb $0x0, -0x54(%rbp,%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb725
cmpl $0x0, -0x30(%rbp)
jle 0xb926
movl 0xa2d9(%rip), %eax      # 0x15a28
addl $0x1, %eax
movl %eax, 0xa2d0(%rip)      # 0x15a28
movq 0xa289(%rip), %rdi      # 0x159e8
leaq 0x5c45(%rip), %rsi      # 0x113ab
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
leaq -0x3d(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
callq 0x93b0
movl %eax, -0x38(%rbp)
movq 0xa1f9(%rip), %rax      # 0x15980
movq %rax, -0x60(%rbp)
cmpb $0x0, -0x3e(%rbp)
je 0xb887
movl -0x38(%rbp), %esi
xorl %edi, %edi
callq 0x4430
movq 0x9e3a(%rip), %rax      # 0x155e0
subsd 0x10(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x4380
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jg 0xb882
movslq -0x34(%rbp), %rax
cmpl $0x0, -0x30(%rbp,%rax,4)
jle 0xb872
movslq -0x34(%rbp), %rax
cmpl $0x5, -0x30(%rbp,%rax,4)
jge 0xb872
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0xd2(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0xb813
cmpb $0x0, -0x3d(%rbp)
jne 0xb830
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movslq -0x34(%rbp), %rax
movl -0x30(%rbp,%rax,4), %eax
subl $0x1, %eax
cltq
movb $0x1, -0x54(%rbp,%rax)
jmp 0xb870
movl -0x38(%rbp), %eax
addl $0x1, %eax
movw %ax, %dx
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movw %dx, 0xd2(%rax,%rcx,2)
movsd -0x50(%rbp), %xmm0
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, 0x60(%rax,%rcx,8)
jmp 0xb872
jmp 0xb874
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb7c6
jmp 0xb924
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jg 0xb922
movslq -0x34(%rbp), %rax
cmpl $0x0, -0x30(%rbp,%rax,4)
jle 0xb912
movslq -0x34(%rbp), %rax
cmpl $0x5, -0x30(%rbp,%rax,4)
jge 0xb912
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0xd2(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0xb910
movl -0x38(%rbp), %eax
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
cvtsi2sd %edx, %xmm0
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, 0x60(%rax,%rcx,8)
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movw $0x0, 0xd2(%rax,%rcx,2)
jmp 0xb912
jmp 0xb914
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb88e
jmp 0xb924
jmp 0xb926
cmpl $0x0, -0x3c(%rbp)
jg 0xb931
jmp 0xb9dd
movq 0xa0b0(%rip), %rdi      # 0x159e8
leaq 0x4fde(%rip), %rsi      # 0x1091d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
cmpl $0x1, -0x3c(%rbp)
jle 0xb960
movq 0xa092(%rip), %rdi      # 0x159e8
movl $0x73, %esi
callq 0x2150
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movzbl 0x983f(%rip), %ecx      # 0x151b0
cmpl %ecx, %eax
jge 0xb9c0
movslq -0x34(%rbp), %rax
cmpb $0x0, -0x54(%rbp,%rax)
je 0xb9b3
movl -0x34(%rbp), %edx
addl $0x1, %edx
leaq 0x9b13(%rip), %rdi      # 0x154a0
leaq 0x4f9a(%rip), %rsi      # 0x1092e
movb $0x0, %al
callq 0x2190
movq 0xa046(%rip), %rdi      # 0x159e8
leaq 0x9af7(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xb9b5
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xb967
movq 0xa021(%rip), %rdi      # 0x159e8
leaq 0x59e4(%rip), %rsi      # 0x113b2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x42a0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)