// File: /workspace/github_c_makefile_star2_O1/hyc[P]trek73c/trekx.c
// Function: Tstts
void Tstts()
{
  Digs temp;
  int i, shp, bad;
  boolean ok, Ship;
  Char *Junk;
  double B;
  boolean Stat[6];
  reg Srec *WITH;

  TCount = (-1);
  werase(Scnwin);
  mvwaddstr(Scnwin, 0, 0, " Tubes   Control  Turned  Levels");
  WITH = Ships[0];
  for (i = 0; i < Tubes; i++) {
    sprintf(scrstr,"%4d", i+1);
    mvwaddstr(Scnwin,i+1,0,scrstr);
    if (WITH->Tstat[i] < 0)
      waddstr(Scnwin,"     Damaged  ");
    else if (WITH->Tstat[i] < 1)
      waddstr(Scnwin,"      Manual  ");
    else {
      Junk = Snams[WITH->Tstat[i] - 1];
      shp = strlen(Junk) / 2 + 9;
      sprintf(scrstr,"%*s%*s", shp, Junk, 14 - shp, "");
      waddstr(Scnwin,scrstr);
    }
    if (WITH->Tstat[i] < 0)
      waddstr(Scnwin,"  --      --");
    else {
      sprintf(scrstr,"%4ld%8d",
	     (long)floor(WITH->TDepl[i] + 0.5), WITH->Tengy[i]);
      waddstr(Scnwin,scrstr);
    }
  }
  sprintf(scrstr,"Launch speed: %d", Ships[0]->Tstat[6]);
  mvwaddstr(Scnwin,Tubes+2,0,scrstr);
  sprintf(scrstr,"  Time delay: %d", Ships[0]->Tstat[7]);
  mvwaddstr(Scnwin,Tubes+3,0,scrstr);
  sprintf(scrstr,"  Prox delay: %d", Ships[0]->Tstat[8]);
  mvwaddstr(Scnwin,Tubes+4,0,scrstr);
  wrefresh(Scnwin);
  waddstr(Cmdwin,"   Lock Tubes [1-6] ");
  Indigits(temp);
  bad = 0;
  for (i = 0; i <= 5; i++)
    Stat[i] = false;
  if (temp[0] > 0) {
    TCount++;
    waddstr(Cmdwin,"   on ");
    shp = GetShp(&ok, &Ship);
    WITH = Ships[0];
    if (Ship) {
      B = Bearing(0, shp) - Objects[0]->Act_Crs;
      B = RMod(B);
      for (i = 0; i <= 5; i++) {
	if (temp[i] > 0 && temp[i] < 7) {
	  if (WITH->Tstat[temp[i] - 1] < 0 || !ok) {
	    bad++;
	    Stat[temp[i] - 1] = true;
	  } else {
	    WITH->Tstat[temp[i] - 1] = shp + 1;
	    WITH->TDepl[temp[i] - 1] = B;
	  }
	}
      }
    } else {
      for (i = 0; i <= 5; i++) {
	if (temp[i] > 0 && temp[i] < 7) {
	  if (WITH->Tstat[temp[i] - 1] >= 0) {
	    WITH->TDepl[temp[i] - 1] = shp % 360;
	    WITH->Tstat[temp[i] - 1] = 0;
	  }
	}
      }
    }
  }
  if (bad <= 0)
    return;
  waddstr(Cmdwin,"Computer: Tube");
  if (bad > 1)
    waddch(Cmdwin,'s');
  for (i = 0; i < Tubes; i++) {
    if (Stat[i]) {
      sprintf(scrstr,"%2d", i+1);
      waddstr(Cmdwin,scrstr);
    }
  }
  waddstr(Cmdwin," unable to turn.");
  Endln();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl $0xffffffff, 0x99a7(%rip) # imm = 0xFFFFFFFF
movq 0x9978(%rip), %rdi      # 0x13a10
callq 0x2090
movq 0x996c(%rip), %rdi      # 0x13a10
xorl %esi, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa0ca
movq 0x9957(%rip), %rdi      # 0x13a10
leaq 0x51c7(%rip), %rsi      # 0xf287
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpb $0x0, 0x90f0(%rip)      # 0x131c1
je 0xa220
movq 0x98b2(%rip), %r13      # 0x13990
leaq 0x93cb(%rip), %rbx      # 0x134b0
leaq 0x460b(%rip), %r12      # 0xe6f7
leaq 0x510c(%rip), %r14      # 0xf1ff
xorl %ebp, %ebp
leaq 0x1(%rbp), %r15
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x21a0
movq 0x9900(%rip), %rdi      # 0x13a10
movl %r15d, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa133
movq 0x98ea(%rip), %rdi      # 0x13a10
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movswq 0x110(%r13,%rbp,2), %rax
movq %r14, %rsi
testq %rax, %rax
js 0xa19f
leaq 0x50c3(%rip), %rsi      # 0xf20e
testw %ax, %ax
je 0xa19f
decl %eax
movq %r12, %r14
leaq 0x97d4(%rip), %rcx      # 0x13930
movq (%rcx,%rax,8), %r12
movq %r12, %rdi
callq 0x2150
shrq %rax
movl $0x5, %r8d
subl %eax, %r8d
leal 0x9(%rax), %edx
movq %rbx, %rdi
leaq 0x4622(%rip), %rsi      # 0xe7a3
movq %r12, %rcx
movq %r14, %r12
leaq 0x5071(%rip), %r14      # 0xf1ff
leaq 0x3a9d(%rip), %r9       # 0xdc32
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rsi
movq 0x986a(%rip), %rdi      # 0x13a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpw $0x0, 0x110(%r13,%rbp,2)
leaq 0x505c(%rip), %rsi      # 0xf21d
js 0xa1fc
movsd 0xe0(%r13,%rbp,8), %xmm0
addsd 0x2e73(%rip), %xmm0     # 0xd048
callq 0x22d0
cvttsd2si %xmm0, %rdx
movswl 0xc6(%r13,%rbp,2), %ecx
movq %rbx, %rdi
leaq 0x50b6(%rip), %rsi      # 0xf2a8
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rsi
movq 0x980d(%rip), %rdi      # 0x13a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movzbl 0x8fad(%rip), %eax      # 0x131c1
movq %r15, %rbp
cmpq %rax, %r15
jb 0xa0f5
movq 0x9769(%rip), %rax      # 0x13990
movswl 0x11c(%rax), %edx
leaq 0x927b(%rip), %rdi      # 0x134b0
leaq 0x5074(%rip), %rsi      # 0xf2b0
xorl %eax, %eax
callq 0x21a0
movq 0x97c6(%rip), %rdi      # 0x13a10
movzbl 0x8f70(%rip), %esi      # 0x131c1
addl $0x2, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa278
movq 0x97a9(%rip), %rdi      # 0x13a10
leaq 0x9242(%rip), %rsi      # 0x134b0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x9711(%rip), %rax      # 0x13990
movswl 0x11e(%rax), %edx
leaq 0x9223(%rip), %rdi      # 0x134b0
leaq 0x502d(%rip), %rsi      # 0xf2c1
xorl %eax, %eax
callq 0x21a0
movq 0x976e(%rip), %rdi      # 0x13a10
movzbl 0x8f18(%rip), %esi      # 0x131c1
addl $0x3, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa2d0
movq 0x9751(%rip), %rdi      # 0x13a10
leaq 0x91ea(%rip), %rsi      # 0x134b0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x96b9(%rip), %rax      # 0x13990
movswl 0x120(%rax), %edx
leaq 0x91cb(%rip), %rdi      # 0x134b0
leaq 0x4fe6(%rip), %rsi      # 0xf2d2
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x21a0
movq 0x9714(%rip), %rdi      # 0x13a10
movzbl 0x8ebe(%rip), %esi      # 0x131c1
addl $0x4, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa32a
movq 0x96f7(%rip), %rdi      # 0x13a10
leaq 0x9190(%rip), %rsi      # 0x134b0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x96df(%rip), %rdi      # 0x13a10
callq 0x2190
movq 0x96bb(%rip), %rdi      # 0x139f8
leaq 0x4f9f(%rip), %rsi      # 0xf2e3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x7c6a
movw $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
cmpl $0x0, (%rbx)
jle 0xa4f2
incl 0x96bf(%rip)            # 0x13a38
movq 0x9678(%rip), %rdi      # 0x139f8
leaq 0x4ee8(%rip), %rsi      # 0xf26f
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x6(%rsp), %rdi
leaq 0x7(%rsp), %r14
movq %r14, %rsi
callq 0x7fe0
movl %eax, %ebx
movq 0x95e4(%rip), %r15      # 0x13990
cmpb $0x0, (%r14)
je 0xa490
xorl %r12d, %r12d
xorl %edi, %edi
movl %ebx, %esi
callq 0x3d75
movq 0x9227(%rip), %rax      # 0x135f0
subsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x2c44(%rip), %xmm2     # 0xd020
divsd %xmm2, %xmm0
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x22b0
movsd 0x2c33(%rip), %xmm0     # 0xd028
movsd (%r14), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd 0x2c10(%rip), %xmm3     # 0xd020
movapd %xmm3, %xmm2
cmpnlesd %xmm1, %xmm2
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
addsd %xmm2, %xmm3
xorpd %xmm1, %xmm1
movapd %xmm2, %xmm0
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm3
andnpd %xmm2, %xmm0
orpd %xmm3, %xmm0
movb 0x6(%rsp), %al
incl %ebx
xorl %ebp, %ebp
movl 0x20(%rsp,%r12,4), %ecx
decl %ecx
cmpl $0x5, %ecx
ja 0xa485
cmpw $0x0, 0x110(%r15,%rcx,2)
js 0xa47e
testb %al, %al
je 0xa47e
movw %bx, 0x110(%r15,%rcx,2)
movslq %ecx, %rcx
movsd %xmm0, 0xe0(%r15,%rcx,8)
jmp 0xa485
incl %ebp
movb $0x1, 0x8(%rsp,%rcx)
incq %r12
cmpq $0x6, %r12
jne 0xa44a
jmp 0xa4f2
movslq %ebx, %rax
imulq $-0x49f49f49, %rax, %rax # imm = 0xB60B60B7
shrq $0x20, %rax
addl %ebx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
sarl $0x8, %eax
addl %ecx, %eax
imull $0x168, %eax, %eax      # imm = 0x168
subl %eax, %ebx
cvtsi2sd %ebx, %xmm0
xorl %eax, %eax
movl 0x20(%rsp,%rax,4), %ecx
decl %ecx
cmpl $0x5, %ecx
ja 0xa4e7
cmpw $0x0, 0x110(%r15,%rcx,2)
js 0xa4e7
movsd %xmm0, 0xe0(%r15,%rcx,8)
movslq %ecx, %rcx
movw $0x0, 0x110(%r15,%rcx,2)
incq %rax
cmpq $0x6, %rax
jne 0xa4b8
xorl %ebp, %ebp
testl %ebp, %ebp
jle 0xa5a9
movq 0x94f7(%rip), %rdi      # 0x139f8
leaq 0x4315(%rip), %rsi      # 0xe81d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpl $0x1, %ebp
je 0xa528
movq 0x94da(%rip), %rdi      # 0x139f8
movl $0x73, %esi
callq 0x2160
cmpb $0x0, 0x8c92(%rip)      # 0x131c1
je 0xa57e
leaq 0x8f78(%rip), %rbx      # 0x134b0
leaq 0x42b3(%rip), %r14      # 0xe7f2
xorl %r15d, %r15d
cmpb $0x0, 0x8(%rsp,%r15)
je 0xa56f
leal 0x1(%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0x9496(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
incq %r15
movzbl 0x8c48(%rip), %eax      # 0x131c1
cmpq %rax, %r15
jb 0xa542
movq 0x9473(%rip), %rdi      # 0x139f8
leaq 0x4cea(%rip), %rsi      # 0xf276
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3c58
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq