// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x9931(%rip), %rax      # 0x15980
movsd (%rax), %xmm0
leaq 0x9446(%rip), %rdi      # 0x154a0
leaq 0x53d3(%rip), %rsi      # 0x11434
movb $0x1, %al
callq 0x2190
callq 0x4320
movq 0x9974(%rip), %rdi      # 0x159e8
leaq 0x53db(%rip), %rsi      # 0x11456
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x42a0
movq 0x98ef(%rip), %rax      # 0x15980
movsd 0x80(%rax), %xmm0
movq 0x98e0(%rip), %rax      # 0x15980
movsd 0x88(%rax), %xmm1
movq 0x98d1(%rip), %rax      # 0x15980
movsd 0x90(%rax), %xmm2
movq 0x98c2(%rip), %rax      # 0x15980
movsd 0x98(%rax), %xmm3
leaq 0x93d3(%rip), %rdi      # 0x154a0
leaq 0x53a8(%rip), %rsi      # 0x1147c
movb $0x4, %al
callq 0x2190
callq 0x4320
jmp 0xc0e2
callq 0x42a0
movq 0x94ca(%rip), %rdx      # 0x155b8
leaq 0x93ab(%rip), %rdi      # 0x154a0
leaq 0x53af(%rip), %rsi      # 0x114ab
movb $0x0, %al
callq 0x2190
movq 0x98de(%rip), %rdi      # 0x159e8
leaq 0x938f(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0x98c6(%rip), %rdi      # 0x159e8
leaq 0x9377(%rip), %rsi      # 0x154a0
movl $0x1, %edx
callq 0x24a0
leaq -0x20(%rbp), %rdx
leaq -0x20(%rbp), %rcx
addq $0x8, %rcx
leaq -0x20(%rbp), %r8
addq $0x10, %r8
leaq -0x20(%rbp), %r9
addq $0x18, %r9
leaq 0x934a(%rip), %rdi      # 0x154a0
leaq 0x536b(%rip), %rsi      # 0x114c8
movb $0x0, %al
callq 0x20a0
movl %eax, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0xc190
movq 0x9454(%rip), %rdx      # 0x155c8
leaq 0x9325(%rip), %rdi      # 0x154a0
leaq 0x5366(%rip), %rsi      # 0x114e8
movb $0x0, %al
callq 0x2190
callq 0x4320
jmp 0xc192
jmp 0xc19e
jmp 0xc194
cmpl $0x4, -0x24(%rbp)
jl 0xc0e2
movb $0x1, -0x25(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0xc205
movslq -0x24(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd -0x20(%rbp,%rax,8), %xmm0
ja 0xc1d6
movslq -0x24(%rbp), %rax
movsd -0x20(%rbp,%rax,8), %xmm0
movsd 0x2e40(%rip), %xmm1     # 0xf010
ucomisd %xmm1, %xmm0
jbe 0xc1dc
movb $0x0, -0x25(%rbp)
jmp 0xc205
movslq -0x24(%rbp), %rax
movsd -0x20(%rbp,%rax,8), %xmm0
movq 0x9793(%rip), %rax      # 0x15980
movslq -0x24(%rbp), %rcx
movsd %xmm0, 0x80(%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc1a9
cmpb $0x0, -0x25(%rbp)
jne 0xc24f
movq 0x93b6(%rip), %rdx      # 0x155c8
leaq 0x9287(%rip), %rdi      # 0x154a0
leaq 0x5300(%rip), %rsi      # 0x11520
movb $0x0, %al
callq 0x2190
callq 0x4320
movq 0x9385(%rip), %rdx      # 0x155b8
leaq 0x9266(%rip), %rdi      # 0x154a0
leaq 0x531d(%rip), %rsi      # 0x1155e
movb $0x0, %al
callq 0x2190
callq 0x4320
jmp 0xc251
jmp 0xc264
jmp 0xc253
cmpb $0x0, -0x25(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xc0e0
movq 0x977d(%rip), %rdi      # 0x159e8
leaq 0x530c(%rip), %rsi      # 0x1157e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x42a0
movq 0x96f8(%rip), %rax      # 0x15980
movsd 0x40(%rax), %xmm0
movq 0x96ec(%rip), %rax      # 0x15980
movsd 0x48(%rax), %xmm1
movq 0x96e0(%rip), %rax      # 0x15980
movsd 0x50(%rax), %xmm2
movq 0x96d4(%rip), %rax      # 0x15980
movsd 0x58(%rax), %xmm3
leaq 0x91e8(%rip), %rdi      # 0x154a0
leaq 0x52f3(%rip), %rsi      # 0x115b2
movb $0x4, %al
callq 0x2190
callq 0x4320
jmp 0xc2cd
callq 0x42a0
movq 0x92df(%rip), %rdx      # 0x155b8
leaq 0x91c0(%rip), %rdi      # 0x154a0
leaq 0x52f9(%rip), %rsi      # 0x115e0
movb $0x0, %al
callq 0x2190
movq 0x96f3(%rip), %rdi      # 0x159e8
leaq 0x91a4(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0x96db(%rip), %rdi      # 0x159e8
leaq 0x918c(%rip), %rsi      # 0x154a0
movl $0x1, %edx
callq 0x24a0
callq 0x42a0
leaq -0x20(%rbp), %rdx
leaq -0x20(%rbp), %rcx
addq $0x8, %rcx
leaq -0x20(%rbp), %r8
addq $0x10, %r8
leaq -0x20(%rbp), %r9
addq $0x18, %r9
leaq 0x915a(%rip), %rdi      # 0x154a0
leaq 0x517b(%rip), %rsi      # 0x114c8
movb $0x0, %al
callq 0x20a0
movl %eax, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0xc380
movq 0x9264(%rip), %rdx      # 0x155c8
leaq 0x9135(%rip), %rdi      # 0x154a0
leaq 0x5290(%rip), %rsi      # 0x11602
movb $0x0, %al
callq 0x2190
callq 0x4320
jmp 0xc382
jmp 0xc38e
jmp 0xc384
cmpl $0x4, -0x24(%rbp)
jl 0xc2cd
movb $0x1, -0x25(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0xc3f7
movslq -0x24(%rbp), %rax
movsd 0x2dc5(%rip), %xmm0     # 0xf170
ucomisd -0x20(%rbp,%rax,8), %xmm0
ja 0xc3cb
movslq -0x24(%rbp), %rax
movsd -0x20(%rbp,%rax,8), %xmm0
movsd 0x2c43(%rip), %xmm1     # 0xf008
ucomisd %xmm1, %xmm0
jbe 0xc3d1
movb $0x0, -0x25(%rbp)
jmp 0xc3f7
movslq -0x24(%rbp), %rax
movsd -0x20(%rbp,%rax,8), %xmm0
movq 0x959e(%rip), %rax      # 0x15980
movslq -0x24(%rbp), %rcx
movsd %xmm0, 0x40(%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc399
cmpb $0x0, -0x25(%rbp)
jne 0xc43d
movq 0x91c4(%rip), %rdx      # 0x155c8
leaq 0x9095(%rip), %rdi      # 0x154a0
leaq 0x5228(%rip), %rsi      # 0x1163a
movb $0x0, %al
callq 0x2190
callq 0x4320
movq 0x95c3(%rip), %rdi      # 0x159e8
leaq 0x5249(%rip), %rsi      # 0x11675
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x42a0
jmp 0xc43f
jmp 0xc452
jmp 0xc441
cmpb $0x0, -0x25(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xc2cb
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)