// File: /workspace/github_c_makefile_star2_O1/hyc[P]trek73c/trekx.c
// Function: PCtrl
void PCtrl()
{
  int I, Code, R, Shp;
  double TD, Pr, X;
  boolean Ok, Ship;
  Object *WITH;

  waddstr(Cmdwin,"\nSulu: Launch Probe");
  if (Yes()) {
    if (Ships[0]->Dmge[(long)Prob]) {
      NoProb();
      return;
    }
    waddstr(Cmdwin,"   Number of pods to launch: [10+] ");
    mygetstr(Cmdwin,scrstr,true);
    Code = (sscanf(scrstr, "%d", &I) == 0);
    if (Code != 0)
      return;
    if (I > Objects[0]->Fuel) {
      NoEngy();
      return;
    }
    waddstr(Cmdwin,"   Launch probe at: ");
    Shp = GetShp(&Ok, &Ship);
    waddstr(Cmdwin,"   Set time delay: [0-15] ");
    mygetstr(Cmdwin,scrstr,true);
    sscanf(scrstr,"%lg", &TD);
    waddstr(Cmdwin,"   Proximity fuse: [50-500] ");
    mygetstr(Cmdwin,scrstr,true);
    sscanf(scrstr,"%lg", &Pr);
    if (TD > 15 || Pr < 50 || Pr > 500 || I < 10) {
      BParam();
      return;
    }
    Launch(0, &R);
    sprintf(scrstr,"Sulu: Probe %d away!", R);
    SEndln();
    WITH = Objects[R];
    WITH->Act_Spd = 2.0;
    WITH->Des_Spd = WITH->Act_Spd;
    WITH->Fuel = I;
    Objects[0]->Fuel -= I;
    Ships[0]->Fcap -= I;
    WITH->ObTyp = 20;
    if (Ship && Ok) {
      WITH->Trgt = Shp+1;
      WITH->Des_Crs = Bearing(0, Shp);
    } else
      WITH->Des_Crs = Shp;
    WITH->Tim_Del = 10000 - TD * 4;
    WITH->Prx_Del = Pr;
    WITH->Act_Crs = WITH->Des_Crs;
    X = Radians(WITH->Act_Crs);
    WITH->XPos += WITH->Act_Spd * 100 * cos(X) * Iter;
    WITH->YPos -= WITH->Act_Spd * 100 * sin(X) * Iter;
    return;
  }
  PRStt();
  waddstr(Cmdwin,"   Detonate all probes");
  if (Yes()) {
    for (I = 1; I < ObjCount; I++) {
      if (Objects[I] && (Objects[I]->ObTyp == 20))
	Objects[I]->Tim_Del = 10000.0;
    }
    sprintf(scrstr,"   Aye, %s detonating all probes.", Title);
    SEndln();
    return;
  }
  sprintf(scrstr,"%s: Control probe #", Name);
  waddstr(Cmdwin,scrstr);
  mygetstr(Cmdwin,scrstr,true);
  I = atoi(scrstr);
  if (Objects[I] == NULL || Objects[I]->ObTyp != 20) {
    BParam();
    return;
  }
  waddstr(Cmdwin,"Sulu: Detonate it");
  if (Yes()) {
    sprintf(scrstr,"   Aye, %s detonating probe %d.", Title, I);
    SEndln();
    Objects[I]->Tim_Del = 10000.0;
    return;
  }
  waddstr(Cmdwin,"   Lock it onto ");
  Shp = GetShp(&Ok, &Ship);
  WITH = Objects[I];
  if (Ship && Ok) {
    WITH->Trgt = Shp+1;
    WITH->Des_Crs = Bearing(I, Shp);
  } else {
    WITH->Trgt = 0;
    WITH->Des_Crs = Shp;
  }
  waddstr(Cmdwin,"Sulu: Locking...");
  Endln();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0xb2a2(%rip), %rdi      # 0x139f8
leaq 0x60cf(%rip), %rsi      # 0xe82c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x7a1d
testb %al, %al
je 0x8794
movq 0xb219(%rip), %rax      # 0x13990
cmpb $0x0, 0xc2(%rax)
je 0x8849
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7b25
callq 0x8163
movq 0xb258(%rip), %rdi      # 0x139f8
leaq 0x611f(%rip), %rsi      # 0xe8c6
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x7a1d
testb %al, %al
je 0x88bc
movzbl 0xae1d(%rip), %ecx      # 0x135e2
movl $0x1, %eax
cmpq $0x2, %rcx
jb 0x8802
movl $0x1, %eax
leaq 0xae14(%rip), %rdx      # 0x135f0
movabsq $0x40c3880000000000, %rsi # imm = 0x40C3880000000000
movq (%rdx,%rax,8), %rdi
testq %rdi, %rdi
je 0x87fa
cmpw $0x14, 0x4a(%rdi)
jne 0x87fa
movq %rsi, 0x30(%rdi)
incq %rax
cmpq %rax, %rcx
jne 0x87e6
movl %eax, 0xc(%rsp)
movq 0xadcb(%rip), %rdx      # 0x135d8
leaq 0xac9c(%rip), %rbx      # 0x134b0
leaq 0x60c2(%rip), %rsi      # 0xe8dd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xb1cc(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3c58
movq 0xb1a8(%rip), %rdi      # 0x139f8
leaq 0x5fe9(%rip), %rsi      # 0xe840
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xb190(%rip), %rdi      # 0x139f8
leaq 0xac41(%rip), %rbx      # 0x134b0
movq %rbx, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x5cca(%rip), %rsi      # 0xe54d
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
je 0x8c40
cvtsi2sdl 0xc(%rsp), %xmm0
movq 0xad49(%rip), %rax      # 0x135f0
ucomisd 0x20(%rax), %xmm0
jbe 0x89b9
callq 0x7b01
jmp 0x8c40
movq 0xad05(%rip), %rdx      # 0x135c8
leaq 0xabe6(%rip), %rbx      # 0x134b0
leaq 0x602e(%rip), %rsi      # 0xe8ff
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xb116(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xb102(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0x1, %edx
callq 0x249f
movq %rbx, %rdi
callq 0x21d0
movl %eax, 0xc(%rsp)
cltq
leaq 0xacd8(%rip), %r14      # 0x135f0
movq (%r14,%rax,8), %rax
testq %rax, %rax
je 0x89a9
cmpw $0x14, 0x4a(%rax)
jne 0x89a9
movq 0xb0c5(%rip), %rdi      # 0x139f8
leaq 0x5fd9(%rip), %rsi      # 0xe913
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x7a1d
testb %al, %al
je 0x8c4c
movq 0xac80(%rip), %rdx      # 0x135d8
movl 0xc(%rsp), %ecx
leaq 0xab4d(%rip), %rbx      # 0x134b0
leaq 0x5fbb(%rip), %rsi      # 0xe925
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xb07d(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
movslq 0xc(%rsp), %rax
movq (%r14,%rax,8), %rax
movabsq $0x40c3880000000000, %rcx # imm = 0x40C3880000000000
movq %rcx, 0x30(%rax)
jmp 0x8c40
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7a95
movq 0xb038(%rip), %rdi      # 0x139f8
leaq 0x5e9d(%rip), %rsi      # 0xe864
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0xa(%rsp), %rdi
leaq 0xb(%rsp), %rsi
callq 0x7fe0
movl %eax, %ebx
movq 0xb00f(%rip), %rdi      # 0x139f8
leaq 0x5e89(%rip), %rsi      # 0xe879
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xaff7(%rip), %rdi      # 0x139f8
leaq 0xaaa8(%rip), %r14      # 0x134b0
movq %r14, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x698c(%rip), %r15      # 0xf3a8
leaq 0x28(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x20b0
movq 0xafc0(%rip), %rdi      # 0x139f8
leaq 0x5e55(%rip), %rsi      # 0xe894
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xafa8(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x20b0
movsd (%r12), %xmm0
ucomisd 0x46d3(%rip), %xmm0     # 0xd150
ja 0x8b6f
movsd 0x18(%rsp), %xmm0
movsd 0x46c7(%rip), %xmm1     # 0xd158
ucomisd %xmm0, %xmm1
ja 0x8b6f
ucomisd 0x46bd(%rip), %xmm0     # 0xd160
ja 0x8b6f
cmpl $0x9, 0xc(%rsp)
jle 0x8b6f
leaq 0x34(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x4f71
movslq (%r14), %r14
leaq 0xa9e3(%rip), %r15      # 0x134b0
leaq 0x5ddd(%rip), %rsi      # 0xe8b1
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x21a0
movq 0xaf10(%rip), %rdi      # 0x139f8
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3c58
leaq 0xaaef(%rip), %rax      # 0x135f0
movq (%rax,%r14,8), %r14
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, (%r14)
movq %rax, 0x8(%r14)
movl 0xc(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%r14)
movq 0xaac2(%rip), %rcx      # 0x135f0
movsd 0x20(%rcx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rcx)
movq 0xae4d(%rip), %rcx      # 0x13990
subb %al, 0x18(%rcx)
movw $0x14, 0x4a(%r14)
cmpb $0x0, 0xb(%rsp)
je 0x8b79
cmpb $0x0, 0xa(%rsp)
je 0x8b79
movl %ebx, %eax
incl %eax
movw %ax, 0x48(%r14)
xorl %edi, %edi
movl %ebx, %esi
callq 0x3d75
jmp 0x8b80
callq 0x7a95
jmp 0x8c40
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x18(%r14)
movapd %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
mulsd 0x4528(%rip), %xmm0     # 0xd0c0
addsd 0x4528(%rip), %xmm0     # 0xd0c8
movsd %xmm0, 0x30(%r14)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x28(%r14)
movsd %xmm1, 0x10(%r14)
mulsd 0x4450(%rip), %xmm1     # 0xd010
divsd 0x4450(%rip), %xmm1     # 0xd018
movapd %xmm1, %xmm0
movsd %xmm1, 0x20(%rsp)
movsd (%r14), %xmm1
mulsd 0x44b1(%rip), %xmm1     # 0xd090
movsd %xmm1, 0x10(%rsp)
callq 0x20f0
mulsd 0x10(%rsp), %xmm0
mulsd 0xa5b8(%rip), %xmm0     # 0x131b0
addsd 0x38(%r14), %xmm0
movsd %xmm0, 0x38(%r14)
movsd (%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x2310
movsd 0x10(%rsp), %xmm1
mulsd 0x4440(%rip), %xmm1     # 0xd068
mulsd %xmm0, %xmm1
mulsd 0xa57c(%rip), %xmm1     # 0x131b0
addsd 0x40(%r14), %xmm1
movsd %xmm1, 0x40(%r14)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0xada5(%rip), %rdi      # 0x139f8
leaq 0x5ceb(%rip), %rsi      # 0xe945
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0xa(%rsp), %rdi
leaq 0xb(%rsp), %rbx
movq %rbx, %rsi
callq 0x7fe0
movslq 0xc(%rsp), %rdi
movq (%r14,%rdi,8), %r14
cmpb $0x0, (%rbx)
je 0x8c9d
cmpb $0x0, 0xa(%rsp)
je 0x8c9d
movl %eax, %ecx
incl %ecx
movw %cx, 0x48(%r14)
movl %eax, %esi
callq 0x3d75
jmp 0x8ca8
movw $0x0, 0x48(%r14)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%r14)
movq 0xad43(%rip), %rdi      # 0x139f8
leaq 0x5c9a(%rip), %rsi      # 0xe956
jmp 0x882f