// File: /workspace/github_c_makefile_star2_O3/hyc[P]trek73c/trekx.c
// Function: AtPwr
void AtPwr()
{
  double inbuf[4];
  int i;
  boolean Ok;

  sprintf(scrstr,"Scott: Regeneration rate is %0.2f", Ships[0]->Regen);
  SEndln();
  waddstr(Cmdwin,"   Designate shield drains (X,X,X,X).");
  Endln();
  sprintf(scrstr,"   Current drains are: %0.2f %0.2f %0.2f %0.2f", Ships[0]->Sdrns[0],
    Ships[0]->Sdrns[1], Ships[0]->Sdrns[2], Ships[0]->Sdrns[3]);
  SEndln();
  do {
  do {
    Endln();
    sprintf(scrstr,"%s: Shield drains are [0-1] ", Name);
    waddstr(Cmdwin,scrstr);
    mygetstr(Cmdwin,scrstr,true);
    i=sscanf(scrstr," %lg%*[, ]%lg%*[, ]%lg%*[, ]%lg",&inbuf[0],&inbuf[1],
      &inbuf[2], &inbuf[3]);
    if (i<4) {
      sprintf(scrstr,"Scott: A value is needed for each of the 4 shields, %s.",
	Title);
      SEndln();
    } else
      break;
  } while (i<4);
  Ok = true;
  for (i=0; i<4; i++) {
    if (inbuf[i]<0 || inbuf[i]>1) {
      Ok = false;
      break;
    }
    Ships[0]->Sdrns[i] = inbuf[i];
  }
  if (!Ok) {
    sprintf(scrstr,"Scott: Minimum drain for shields is zero, maximum is one, %s.",
      Title);
    SEndln();
    sprintf(scrstr,"%s: Son-of-a-gun, you're right.", Name);
    SEndln();
  } else
    break;
  } while (!Ok);

  waddstr(Cmdwin,"Scott: Designate phaser charge/discharge (X,X,X,X).");
  Endln();
  sprintf(scrstr,"   current rates are: %0.2f %0.2f %0.2f %0.2f",Ships[0]->PCrts[0],
    Ships[0]->PCrts[1], Ships[0]->PCrts[2], Ships[0]->PCrts[3]);
  SEndln();
  do {
  do {
    Endln();
    sprintf(scrstr,"%s: Phaser C/D rates [-10 to 10] ", Name);
    waddstr(Cmdwin,scrstr);
    mygetstr(Cmdwin,scrstr,true);
    Endln();
    i=sscanf(scrstr," %lg%*[, ]%lg%*[, ]%lg%*[, ]%lg",&inbuf[0],&inbuf[1],
      &inbuf[2], &inbuf[3]);
    if (i<4) {
      sprintf(scrstr,"Scott: A value is needed for each of the 4 phasers, %s.",
	Title);
      SEndln();
    } else
      break;
  } while (i<4);
  Ok = true;
  for (i=0; i<4; i++) {
    if (inbuf[i]<-10 || inbuf[i]>10) {
      Ok = false;
      break;
    }
    Ships[0]->PCrts[i] = inbuf[i];
  }
  if (!Ok) {
    sprintf(scrstr,"Scott: I remind you, %s, maximum discharge rate is -10 and",
      Title);
    SEndln();
    waddstr(Cmdwin,"   maximum charge rate is 10.");
    Endln();
  } else
    break;
  } while (!Ok);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x92ee(%rip), %rax      # 0x13990
movsd (%rax), %xmm0
leaq 0x8e03(%rip), %rbx      # 0x134b0
leaq 0x4cfc(%rip), %rsi      # 0xf3b0
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
movq 0x9333(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0x931a(%rip), %rdi      # 0x139f8
leaq 0x4ced(%rip), %rsi      # 0xf3d2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0x9295(%rip), %rax      # 0x13990
movsd 0x80(%rax), %xmm0
movsd 0x88(%rax), %xmm1
movsd 0x90(%rax), %xmm2
movsd 0x98(%rax), %xmm3
leaq 0x4cd6(%rip), %rsi      # 0xf3f8
movq %rbx, %rdi
movb $0x4, %al
callq 0x21a0
movq 0x92c5(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x10(%rsp), %r15
leaq 0x18(%rsp), %r12
leaq 0x4cd1(%rip), %r13      # 0xf427
leaq 0x4ce7(%rip), %rbp      # 0xf444
movq %rsp, %r14
callq 0x3d76
movq 0x8e5c(%rip), %rdx      # 0x135c8
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0x9278(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x9264(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0x1, %edx
callq 0x249f
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x20b0
cmpl $0x4, %eax
jge 0xa7d4
movq 0x8e10(%rip), %rdx      # 0x135d8
movq %rbx, %rdi
leaq 0x4c92(%rip), %rsi      # 0xf464
jmp 0xa850
movq 0x91b5(%rip), %rax      # 0x13990
xorl %ecx, %ecx
xorpd %xmm1, %xmm1
movsd 0x294f(%rip), %xmm2     # 0xd138
movsd (%rsp,%rcx,8), %xmm0
ucomisd %xmm0, %xmm1
ja 0xa80e
ucomisd %xmm2, %xmm0
ja 0xa80e
movsd %xmm0, 0x80(%rax,%rcx,8)
incq %rcx
cmpq $0x4, %rcx
jne 0xa7e9
jmp 0xa875
movq 0x8dc3(%rip), %rdx      # 0x135d8
movq %rbx, %rdi
leaq 0x4c7d(%rip), %rsi      # 0xf49c
xorl %eax, %eax
callq 0x21a0
movq 0x91cb(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0x8d82(%rip), %rdx      # 0x135c8
movq %rbx, %rdi
leaq 0x4c8a(%rip), %rsi      # 0xf4da
xorl %eax, %eax
callq 0x21a0
movq 0x919a(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
jmp 0xa760
movq 0x917c(%rip), %rdi      # 0x139f8
leaq 0x4c77(%rip), %rsi      # 0xf4fa
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq 0x90f7(%rip), %rax      # 0x13990
movsd 0x40(%rax), %xmm0
movsd 0x48(%rax), %xmm1
movsd 0x50(%rax), %xmm2
movsd 0x58(%rax), %xmm3
leaq 0x4c7a(%rip), %rsi      # 0xf52e
movq %rbx, %rdi
movb $0x4, %al
callq 0x21a0
leaq 0x4c97(%rip), %r14      # 0xf55c
leaq 0x4b78(%rip), %r13      # 0xf444
movq %rsp, %rbp
movq %rbx, %rsi
movq 0x911f(%rip), %rdi      # 0x139f8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
callq 0x3d76
movq 0x8cd4(%rip), %rdx      # 0x135c8
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0x90f0(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x90dc(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0x1, %edx
callq 0x249f
callq 0x3d76
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x20b0
cmpl $0x4, %eax
jl 0xa9c8
movq 0x903b(%rip), %rax      # 0x13990
xorl %ecx, %ecx
movapd 0x27a1(%rip), %xmm2     # 0xd100
movsd 0x27c9(%rip), %xmm3     # 0xd130
movsd (%rsp,%rcx,8), %xmm0
movapd %xmm0, %xmm1
andpd %xmm2, %xmm1
ucomisd %xmm3, %xmm1
ja 0xa98b
movsd %xmm0, 0x40(%rax,%rcx,8)
incq %rcx
cmpq $0x4, %rcx
jne 0xa967
jmp 0xa9e5
movq 0x8c46(%rip), %rdx      # 0x135d8
movq %rbx, %rdi
leaq 0x4c1a(%rip), %rsi      # 0xf5b6
xorl %eax, %eax
callq 0x21a0
movq 0x904e(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0x4c2e(%rip), %rsi      # 0xf5f1
jmp 0xa8d2
movq 0x8c09(%rip), %rdx      # 0x135d8
movq %rbx, %rdi
leaq 0x4ba5(%rip), %rsi      # 0xf57e
xorl %eax, %eax
callq 0x21a0
jmp 0xa8cf
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq