// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0xb302(%rip), %rdi      # 0x129e8
leaq 0x517f(%rip), %rsi      # 0xc86c
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x6aab
testb %al, %al
je 0x7721
movq 0xb27b(%rip), %rax      # 0x12980
cmpb $0x0, 0xc2(%rax)
je 0x7786
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bb2
callq 0x7194
movq 0xb2bb(%rip), %rdi      # 0x129e8
leaq 0x51d2(%rip), %rsi      # 0xc906
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x6aab
testb %al, %al
je 0x7824
movzbl 0xae82(%rip), %eax      # 0x125d2
pushq $0x1
popq %rcx
leaq 0xae86(%rip), %rdx      # 0x125e0
movabsq $0x40c3880000000000, %rsi # imm = 0x40C3880000000000
cmpq %rax, %rcx
jae 0x77f5
movq (%rdx,%rcx,8), %rdi
testq %rdi, %rdi
je 0x7781
cmpw $0x14, 0x4a(%rdi)
jne 0x7781
movq %rsi, 0x30(%rdi)
incq %rcx
jmp 0x7764
movq 0xb25b(%rip), %rdi      # 0x129e8
leaq 0x50ec(%rip), %rsi      # 0xc880
pushq $-0x1
popq %rdx
callq 0x2200
movq 0xb245(%rip), %rdi      # 0x129e8
leaq 0xacf6(%rip), %rbx      # 0x124a0
pushq $0x1
popq %rdx
movq %rbx, %rsi
callq 0x246d
leaq 0x4dd1(%rip), %rsi      # 0xc58d
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20a0
testl %eax, %eax
je 0x7b61
cvtsi2sdl 0xc(%rsp), %xmm0
movq 0xae00(%rip), %rax      # 0x125e0
ucomisd 0x20(%rax), %xmm0
jbe 0x78fb
callq 0x6b90
jmp 0x7b61
movq 0xadcc(%rip), %rdx      # 0x125c8
leaq 0xac9d(%rip), %rdi      # 0x124a0
leaq 0x5113(%rip), %rsi      # 0xc91d
xorl %eax, %eax
callq 0x2190
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x399b
movq 0xad8d(%rip), %rdx      # 0x125b8
leaq 0xac6e(%rip), %rbx      # 0x124a0
leaq 0x5106(%rip), %rsi      # 0xc93f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2190
movq 0xb19e(%rip), %rdi      # 0x129e8
pushq $-0x1
popq %rdx
movq %rbx, %rsi
callq 0x2200
movq 0xb18c(%rip), %rdi      # 0x129e8
pushq $0x1
popq %rdx
movq %rbx, %rsi
callq 0x246d
movq %rbx, %rdi
callq 0x21c0
movl %eax, %ebp
movslq %eax, %rbx
leaq 0xad65(%rip), %r15      # 0x125e0
movq (%r15,%rbx,8), %rax
testq %rax, %rax
je 0x78e8
cmpw $0x14, 0x4a(%rax)
jne 0x78e8
movq 0xb156(%rip), %rdi      # 0x129e8
leaq 0x50ba(%rip), %rsi      # 0xc953
pushq $-0x1
popq %rdx
callq 0x2200
callq 0x6aab
testb %al, %al
je 0x7b70
movq 0xad13(%rip), %rdx      # 0x125c8
leaq 0xabe4(%rip), %rdi      # 0x124a0
leaq 0x50a2(%rip), %rsi      # 0xc965
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2190
callq 0x399b
movq (%r15,%rbx,8), %rax
movabsq $0x40c3880000000000, %rcx # imm = 0x40C3880000000000
movq %rcx, 0x30(%rax)
jmp 0x7b61
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6b2a
movq 0xb0e6(%rip), %rdi      # 0x129e8
leaq 0x4f9b(%rip), %rsi      # 0xc8a4
pushq $-0x1
popq %rbp
movl %ebp, %edx
callq 0x2200
leaq 0xa(%rsp), %rdi
leaq 0xb(%rsp), %rsi
callq 0x702f
movl %eax, %ebx
movq 0xb0bd(%rip), %rdi      # 0x129e8
leaq 0x4f87(%rip), %rsi      # 0xc8b9
movl %ebp, %edx
callq 0x2200
movq 0xb0a8(%rip), %rdi      # 0x129e8
leaq 0xab59(%rip), %r14      # 0x124a0
pushq $0x1
popq %r15
movq %r14, %rsi
movl %r15d, %edx
callq 0x246d
leaq 0x5a8b(%rip), %r12      # 0xd3e8
leaq 0x28(%rsp), %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x20a0
movq 0xb06f(%rip), %rdi      # 0x129e8
leaq 0x4f54(%rip), %rsi      # 0xc8d4
movl %ebp, %edx
callq 0x2200
movq 0xb05a(%rip), %rdi      # 0x129e8
movq %r14, %rsi
movl %r15d, %edx
callq 0x246d
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x20a0
movsd (%r13), %xmm0
ucomisd 0x378f(%rip), %xmm0     # 0xb148
ja 0x7a98
movsd 0x18(%rsp), %xmm0
movsd 0x3693(%rip), %xmm1     # 0xb060
ucomisd %xmm0, %xmm1
ja 0x7a98
ucomisd 0x3771(%rip), %xmm0     # 0xb150
ja 0x7a98
cmpl $0x9, 0xc(%rsp)
jle 0x7a98
leaq 0x34(%rsp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x48c0
movslq (%r14), %r14
leaq 0xaa97(%rip), %rdi      # 0x124a0
leaq 0x4ee1(%rip), %rsi      # 0xc8f1
movl %r14d, %edx
xorl %eax, %eax
callq 0x2190
callq 0x399b
leaq 0xabba(%rip), %rax      # 0x125e0
movq (%rax,%r14,8), %r14
movaps 0x382f(%rip), %xmm0     # 0xb260
movups %xmm0, (%r14)
movl 0xc(%rsp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%r14)
movq 0xab96(%rip), %rcx      # 0x125e0
movsd 0x20(%rcx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rcx)
movq 0xaf21(%rip), %rcx      # 0x12980
subb %al, 0x18(%rcx)
movw $0x14, 0x4a(%r14)
cmpb $0x0, 0xb(%rsp)
je 0x7aa2
cmpb $0x0, 0xa(%rsp)
je 0x7aa2
movl %ebx, %eax
incl %eax
movw %ax, 0x48(%r14)
xorl %edi, %edi
movl %ebx, %esi
callq 0x3a49
movsd (%r14), %xmm1
mulsd 0x35da(%rip), %xmm1     # 0xb070
jmp 0x7aae
callq 0x6b2a
jmp 0x7b61
cvtsi2sd %ebx, %xmm0
movsd 0x365a(%rip), %xmm1     # 0xb108
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x18(%r14)
movapd %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
mulsd 0x35fc(%rip), %xmm0     # 0xb0c8
addsd 0x35fc(%rip), %xmm0     # 0xb0d0
movsd %xmm0, 0x30(%r14)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x28(%r14)
movsd %xmm1, 0x10(%r14)
mulsd 0x3524(%rip), %xmm1     # 0xb018
divsd 0x3524(%rip), %xmm1     # 0xb020
movapd %xmm1, %xmm0
movsd %xmm1, 0x20(%rsp)
callq 0x20e0
mulsd 0x10(%rsp), %xmm0
mulsd 0xa687(%rip), %xmm0     # 0x121a0
addsd 0x38(%r14), %xmm0
movsd %xmm0, 0x38(%r14)
movsd (%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x2300
movsd 0x10(%rsp), %xmm1
mulsd 0x352f(%rip), %xmm1     # 0xb078
mulsd %xmm0, %xmm1
mulsd 0xa64b(%rip), %xmm1     # 0x121a0
addsd 0x40(%r14), %xmm1
movsd %xmm1, 0x40(%r14)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xae71(%rip), %rdi      # 0x129e8
leaq 0x4e07(%rip), %rsi      # 0xc985
pushq $-0x1
popq %rdx
callq 0x2200
leaq 0xa(%rsp), %rdi
leaq 0xb(%rsp), %r14
movq %r14, %rsi
callq 0x702f
movq (%r15,%rbx,8), %rbx
cmpb $0x0, (%r14)
je 0x7bbc
cmpb $0x0, 0xa(%rsp)
je 0x7bbc
movl %eax, %ecx
incl %ecx
movw %cx, 0x48(%rbx)
movl %ebp, %edi
movl %eax, %esi
callq 0x3a49
jmp 0x7bc5
andw $0x0, 0x48(%rbx)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%rbx)
movq 0xae17(%rip), %rdi      # 0x129e8
leaq 0x4dbe(%rip), %rsi      # 0xc996
pushq $-0x1
popq %rdx
callq 0x2200
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3933