// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq 0xb231(%rip), %rdi      # 0x139f8
leaq 0x6116(%rip), %rsi      # 0xe8e4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x7ad7
testb %al, %al
je 0x8806
movq 0xb1a8(%rip), %rax      # 0x13990
cmpb $0x0, 0xc2(%rax)
je 0x88b3
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7bdf
callq 0x821a
movq 0xb1e6(%rip), %rdi      # 0x139f8
leaq 0x6165(%rip), %rsi      # 0xe97e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x7ad7
testb %al, %al
je 0x8926
movzbl 0xadab(%rip), %eax      # 0x135e2
cmpq $0x2, %rax
jb 0x886f
movl $0x1, %ecx
leaq 0xada7(%rip), %rdx      # 0x135f0
movabsq $0x40c3880000000000, %rsi # imm = 0x40C3880000000000
movq (%rdx,%rcx,8), %rdi
testq %rdi, %rdi
je 0x8867
cmpw $0x14, 0x4a(%rdi)
jne 0x8867
movq %rsi, 0x30(%rdi)
incq %rcx
cmpq %rcx, %rax
jne 0x8853
movq 0xad62(%rip), %rdx      # 0x135d8
leaq 0xac33(%rip), %rbx      # 0x134b0
leaq 0x6111(%rip), %rsi      # 0xe995
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xb163(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3d76
movq 0xb13e(%rip), %rdi      # 0x139f8
leaq 0x6037(%rip), %rsi      # 0xe8f8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xb126(%rip), %rdi      # 0x139f8
leaq 0xabd7(%rip), %rbx      # 0x134b0
movq %rbx, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x5d18(%rip), %rsi      # 0xe605
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
je 0x8ca1
cvtsi2sdl 0x4(%rsp), %xmm0
movq 0xacdf(%rip), %rax      # 0x135f0
ucomisd 0x20(%rax), %xmm0
jbe 0x8a18
callq 0x7bbb
jmp 0x8ca1
movq 0xac9b(%rip), %rdx      # 0x135c8
leaq 0xab7c(%rip), %rbx      # 0x134b0
leaq 0x607c(%rip), %rsi      # 0xe9b7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21a0
movq 0xb0ac(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xb098(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0x1, %edx
callq 0x249f
movq %rbx, %rdi
callq 0x21d0
movl %eax, %ebp
movslq %eax, %rbx
leaq 0xac6f(%rip), %r15      # 0x135f0
movq (%r15,%rbx,8), %rax
testq %rax, %rax
je 0x8a07
cmpw $0x14, 0x4a(%rax)
jne 0x8a07
movq 0xb060(%rip), %rdi      # 0x139f8
leaq 0x602c(%rip), %rsi      # 0xe9cb
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x7ad7
testb %al, %al
je 0x8cae
movq 0xac1b(%rip), %rdx      # 0x135d8
leaq 0xaaec(%rip), %r14      # 0x134b0
leaq 0x6012(%rip), %rsi      # 0xe9dd
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x21a0
movq 0xb01a(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
movq (%r15,%rbx,8), %rax
movabsq $0x40c3880000000000, %rcx # imm = 0x40C3880000000000
movq %rcx, 0x30(%rax)
jmp 0x8ca1
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7b4f
movq 0xafd9(%rip), %rdi      # 0x139f8
leaq 0x5ef6(%rip), %rsi      # 0xe91c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x2(%rsp), %rdi
leaq 0x3(%rsp), %rsi
callq 0x809a
movl %eax, %ebx
movq 0xafb0(%rip), %rdi      # 0x139f8
leaq 0x5ee2(%rip), %rsi      # 0xe931
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xaf98(%rip), %rdi      # 0x139f8
leaq 0xaa49(%rip), %r14      # 0x134b0
movq %r14, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x69e5(%rip), %r15      # 0xf460
leaq 0x20(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x20b0
movq 0xaf61(%rip), %rdi      # 0x139f8
leaq 0x5eae(%rip), %rsi      # 0xe94c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0xaf49(%rip), %rdi      # 0x139f8
movq %r14, %rsi
movl $0x1, %edx
callq 0x249f
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x20b0
movsd (%r12), %xmm0
ucomisd 0x47a4(%rip), %xmm0     # 0xd280
ja 0x8bd5
movsd 0x10(%rsp), %xmm0
movsd 0x46a8(%rip), %xmm1     # 0xd198
ucomisd %xmm0, %xmm1
ja 0x8bd5
ucomisd 0x4786(%rip), %xmm0     # 0xd288
ja 0x8bd5
cmpl $0x9, 0x4(%rsp)
jle 0x8bd5
leaq 0x2c(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x5045
movslq (%r14), %r14
leaq 0xa984(%rip), %r15      # 0x134b0
leaq 0x5e36(%rip), %rsi      # 0xe969
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x21a0
movq 0xaeb1(%rip), %rdi      # 0x139f8
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x3d76
leaq 0xaa90(%rip), %rax      # 0x135f0
movq (%rax,%r14,8), %r14
movaps 0x45b5(%rip), %xmm0     # 0xd120
movups %xmm0, (%r14)
movl 0x4(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%r14)
movq 0xaa69(%rip), %rcx      # 0x135f0
movsd 0x20(%rcx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rcx)
movq 0xadf4(%rip), %rcx      # 0x13990
subb %al, 0x18(%rcx)
movw $0x14, 0x4a(%r14)
cmpb $0x0, 0x3(%rsp)
je 0x8bdf
cmpb $0x0, 0x2(%rsp)
je 0x8bdf
movl %ebx, %eax
incl %eax
movw %ax, 0x48(%r14)
xorl %edi, %edi
movl %ebx, %esi
callq 0x3e93
movsd (%r14), %xmm1
mulsd 0x45d5(%rip), %xmm1     # 0xd1a8
jmp 0x8bee
callq 0x7b4f
jmp 0x8ca1
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd 0x4652(%rip), %xmm1     # 0xd240
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x18(%r14)
movapd %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd 0x45f4(%rip), %xmm0     # 0xd200
addsd 0x45f4(%rip), %xmm0     # 0xd208
movsd %xmm0, 0x30(%r14)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x28(%r14)
movsd %xmm1, 0x10(%r14)
mulsd 0x450c(%rip), %xmm1     # 0xd140
divsd 0x450c(%rip), %xmm1     # 0xd148
movapd %xmm1, %xmm0
movsd %xmm1, 0x18(%rsp)
callq 0x20f0
mulsd 0x8(%rsp), %xmm0
mulsd 0xa557(%rip), %xmm0     # 0x131b0
addsd 0x38(%r14), %xmm0
movsd %xmm0, 0x38(%r14)
movsd (%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x2310
movsd 0x8(%rsp), %xmm1
mulsd 0x4527(%rip), %xmm1     # 0xd1b0
mulsd %xmm0, %xmm1
mulsd 0xa51b(%rip), %xmm1     # 0x131b0
addsd 0x40(%r14), %xmm1
movsd %xmm1, 0x40(%r14)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xad43(%rip), %rdi      # 0x139f8
leaq 0x5d41(%rip), %rsi      # 0xe9fd
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x2(%rsp), %rdi
leaq 0x3(%rsp), %r14
movq %r14, %rsi
callq 0x809a
movq (%r15,%rbx,8), %rbx
cmpb $0x0, (%r14)
je 0x8cfc
cmpb $0x0, 0x2(%rsp)
je 0x8cfc
movl %eax, %ecx
incl %ecx
movw %cx, 0x48(%rbx)
movl %ebp, %edi
movl %eax, %esi
callq 0x3e93
jmp 0x8d06
movw $0x0, 0x48(%rbx)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%rbx)
movq 0xace6(%rip), %rdi      # 0x139f8
leaq 0x5cf5(%rip), %rsi      # 0xea0e
jmp 0x8898