// File: /workspace/github_c_makefile_star2_O3/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, 0x98cd(%rip) # imm = 0xFFFFFFFF
movq 0x989e(%rip), %rdi      # 0x13a10
callq 0x2090
movq 0x9892(%rip), %rdi      # 0x13a10
xorl %esi, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa1a4
movq 0x987d(%rip), %rdi      # 0x13a10
leaq 0x51a5(%rip), %rsi      # 0xf33f
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpb $0x0, 0x9016(%rip)      # 0x131c1
je 0xa2fa
movq 0x97d8(%rip), %r13      # 0x13990
leaq 0x92f1(%rip), %rbx      # 0x134b0
leaq 0x45e9(%rip), %r12      # 0xe7af
leaq 0x50ea(%rip), %r14      # 0xf2b7
xorl %ebp, %ebp
leaq 0x1(%rbp), %r15
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x21a0
movq 0x9826(%rip), %rdi      # 0x13a10
movl %r15d, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa20d
movq 0x9810(%rip), %rdi      # 0x13a10
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movzwl 0x110(%r13,%rbp,2), %eax
movq %r14, %rsi
testw %ax, %ax
js 0xa279
leaq 0x50a1(%rip), %rsi      # 0xf2c6
je 0xa279
decl %eax
movzwl %ax, %eax
movq %r12, %r14
leaq 0x96fa(%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 0x4600(%rip), %rsi      # 0xe85b
movq %r12, %rcx
movq %r14, %r12
leaq 0x504f(%rip), %r14      # 0xf2b7
leaq 0x3a7b(%rip), %r9       # 0xdcea
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rsi
movq 0x9790(%rip), %rdi      # 0x13a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpw $0x0, 0x110(%r13,%rbp,2)
leaq 0x503a(%rip), %rsi      # 0xf2d5
js 0xa2d6
movsd 0xe0(%r13,%rbp,8), %xmm0
addsd 0x2ec9(%rip), %xmm0     # 0xd178
callq 0x22d0
cvttsd2si %xmm0, %rdx
movswl 0xc6(%r13,%rbp,2), %ecx
movq %rbx, %rdi
leaq 0x5094(%rip), %rsi      # 0xf360
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rsi
movq 0x9733(%rip), %rdi      # 0x13a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movzbl 0x8ed3(%rip), %eax      # 0x131c1
movq %r15, %rbp
cmpq %rax, %r15
jb 0xa1cf
movq 0x968f(%rip), %rax      # 0x13990
movswl 0x11c(%rax), %edx
leaq 0x91a1(%rip), %rdi      # 0x134b0
leaq 0x5052(%rip), %rsi      # 0xf368
xorl %eax, %eax
callq 0x21a0
movq 0x96ec(%rip), %rdi      # 0x13a10
movzbl 0x8e96(%rip), %esi      # 0x131c1
addl $0x2, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa352
movq 0x96cf(%rip), %rdi      # 0x13a10
leaq 0x9168(%rip), %rsi      # 0x134b0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x9637(%rip), %rax      # 0x13990
movswl 0x11e(%rax), %edx
leaq 0x9149(%rip), %rdi      # 0x134b0
leaq 0x500b(%rip), %rsi      # 0xf379
xorl %eax, %eax
callq 0x21a0
movq 0x9694(%rip), %rdi      # 0x13a10
movzbl 0x8e3e(%rip), %esi      # 0x131c1
addl $0x3, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa3aa
movq 0x9677(%rip), %rdi      # 0x13a10
leaq 0x9110(%rip), %rsi      # 0x134b0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x95df(%rip), %rax      # 0x13990
movswl 0x120(%rax), %edx
leaq 0x90f1(%rip), %rdi      # 0x134b0
leaq 0x4fc4(%rip), %rsi      # 0xf38a
xorl %eax, %eax
callq 0x21a0
movq 0x963c(%rip), %rdi      # 0x13a10
movzbl 0x8de6(%rip), %esi      # 0x131c1
addl $0x4, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0xa402
movq 0x961f(%rip), %rdi      # 0x13a10
leaq 0x90b8(%rip), %rsi      # 0x134b0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x9607(%rip), %rdi      # 0x13a10
callq 0x2190
movq 0x95e3(%rip), %rdi      # 0x139f8
leaq 0x4f7f(%rip), %rsi      # 0xf39b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x7d24
movw $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
cmpl $0x0, (%rbx)
jle 0xa67e
incl 0x95e7(%rip)            # 0x13a38
movq 0x95a0(%rip), %rdi      # 0x139f8
leaq 0x4ec8(%rip), %rsi      # 0xf327
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x6(%rsp), %rdi
leaq 0x7(%rsp), %r14
movq %r14, %rsi
callq 0x809a
movl %eax, %ebx
movq 0x950c(%rip), %r15      # 0x13990
cmpb $0x0, (%r14)
je 0xa61f
xorl %r12d, %r12d
xorl %edi, %edi
movl %ebx, %esi
callq 0x3e93
movq 0x914f(%rip), %rax      # 0x135f0
subsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x2c9c(%rip), %xmm2     # 0xd150
divsd %xmm2, %xmm0
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x22b0
movsd 0x2c8b(%rip), %xmm0     # 0xd158
movsd (%r14), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd 0x2c68(%rip), %xmm3     # 0xd150
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 0xa55c
movl %ecx, %ecx
cmpw $0x0, 0x110(%r15,%rcx,2)
js 0xa555
testb %al, %al
je 0xa555
movw %bx, 0x110(%r15,%rcx,2)
movsd %xmm0, 0xe0(%r15,%rcx,8)
jmp 0xa55c
incl %ebp
movb $0x1, 0x8(%rsp,%rcx)
incq %r12
cmpq $0x6, %r12
jne 0xa522
testl %ebp, %ebp
jle 0xa67e
movq 0x9484(%rip), %rdi      # 0x139f8
leaq 0x435a(%rip), %rsi      # 0xe8d5
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
cmpl $0x1, %ebp
je 0xa59b
movq 0x9467(%rip), %rdi      # 0x139f8
movl $0x73, %esi
callq 0x2160
movb 0x8c20(%rip), %al       # 0x131c1
testb %al, %al
je 0xa5f4
leaq 0x8f04(%rip), %rbx      # 0x134b0
leaq 0x42f7(%rip), %r14      # 0xe8aa
xorl %r15d, %r15d
cmpb $0x0, 0x8(%rsp,%r15)
je 0xa5e9
leal 0x1(%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x21a0
movq 0x9422(%rip), %rdi      # 0x139f8
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movb 0x8bd8(%rip), %al       # 0x131c1
incq %r15
movzbl %al, %ecx
cmpq %rcx, %r15
jb 0xa5b6
movq 0x93fd(%rip), %rdi      # 0x139f8
leaq 0x4d2c(%rip), %rsi      # 0xf32e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d76
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 0xa675
movl %ecx, %ecx
cmpw $0x0, 0x110(%r15,%rcx,2)
js 0xa675
movsd %xmm0, 0xe0(%r15,%rcx,8)
movw $0x0, 0x110(%r15,%rcx,2)
incq %rax
cmpq $0x6, %rax
jne 0xa647
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq