// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl $0xffffffff, 0xa026(%rip) # imm = 0xFFFFFFFF
movq 0x9ff7(%rip), %rdi      # 0x15a00
callq 0x2090
movq 0x9feb(%rip), %rdi      # 0x15a00
xorl %edx, %edx
movl %edx, %esi
callq 0x21d0
cmpl $-0x1, %eax
jne 0xba25
jmp 0xba3d
movq 0x9fd4(%rip), %rdi      # 0x15a00
leaq 0x5990(%rip), %rsi      # 0x113c3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0x9f3c(%rip), %rax      # 0x15980
movq %rax, -0x60(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movzbl 0x9758(%rip), %ecx      # 0x151b1
cmpl %ecx, %eax
jge 0xbc2e
movl -0x34(%rbp), %edx
addl $0x1, %edx
leaq 0x9a32(%rip), %rdi      # 0x154a0
leaq 0x4dbe(%rip), %rsi      # 0x10833
movb $0x0, %al
callq 0x2190
movq 0x9f7d(%rip), %rdi      # 0x15a00
movl -0x34(%rbp), %esi
addl $0x1, %esi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
jne 0xba97
jmp 0xbaaf
movq 0x9f62(%rip), %rdi      # 0x15a00
leaq 0x99fb(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jge 0xbae1
movq 0x9f35(%rip), %rdi      # 0x15a00
leaq 0x5869(%rip), %rsi      # 0x1133b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xbb8f
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x1, %eax
jge 0xbb10
movq 0x9f03(%rip), %rdi      # 0x15a00
leaq 0x5846(%rip), %rsi      # 0x1134a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xbb8d
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0x110(%rax,%rcx,2), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x9df3(%rip), %rax      # 0x15920
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2140
shrq %rax
addq $0x9, %rax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %edx
movq -0x48(%rbp), %rcx
movl $0xe, %r8d
subl -0x38(%rbp), %r8d
leaq 0x9940(%rip), %rdi      # 0x154a0
leaq 0x4d78(%rip), %rsi      # 0x108df
leaq 0x41c6(%rip), %r9       # 0xfd34
movb $0x0, %al
callq 0x2190
movq 0x9e84(%rip), %rdi      # 0x15a00
leaq 0x991d(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xbb8f
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jge 0xbbbe
movq 0x9e55(%rip), %rdi      # 0x15a00
leaq 0x57a7(%rip), %rsi      # 0x11359
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xbc1e
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd 0x34ba(%rip), %xmm0     # 0xf088
addsd 0xe0(%rax,%rcx,8), %xmm0
callq 0x22c0
cvttsd2si %xmm0, %rdx
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movswl 0xc6(%rax,%rcx,2), %ecx
leaq 0x98a8(%rip), %rdi      # 0x154a0
leaq 0x57e5(%rip), %rsi      # 0x113e4
movb $0x0, %al
callq 0x2190
movq 0x9df3(%rip), %rdi      # 0x15a00
leaq 0x988c(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xbc20
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xba4f
movq 0x9d4b(%rip), %rax      # 0x15980
movswl 0x11c(%rax), %edx
leaq 0x985d(%rip), %rdi      # 0x154a0
leaq 0x57a2(%rip), %rsi      # 0x113ec
movb $0x0, %al
callq 0x2190
movq 0x9da8(%rip), %rdi      # 0x15a00
movzbl 0x9552(%rip), %esi      # 0x151b1
addl $0x2, %esi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
jne 0xbc70
jmp 0xbc88
movq 0x9d89(%rip), %rdi      # 0x15a00
leaq 0x9822(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0x9cf1(%rip), %rax      # 0x15980
movswl 0x11e(%rax), %edx
leaq 0x9803(%rip), %rdi      # 0x154a0
leaq 0x5759(%rip), %rsi      # 0x113fd
movb $0x0, %al
callq 0x2190
movq 0x9d4e(%rip), %rdi      # 0x15a00
movzbl 0x94f8(%rip), %esi      # 0x151b1
addl $0x3, %esi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
jne 0xbcca
jmp 0xbce2
movq 0x9d2f(%rip), %rdi      # 0x15a00
leaq 0x97c8(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0x9c97(%rip), %rax      # 0x15980
movswl 0x120(%rax), %edx
leaq 0x97a9(%rip), %rdi      # 0x154a0
leaq 0x5710(%rip), %rsi      # 0x1140e
movb $0x0, %al
callq 0x2190
movq 0x9cf4(%rip), %rdi      # 0x15a00
movzbl 0x949e(%rip), %esi      # 0x151b1
addl $0x4, %esi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
jne 0xbd24
jmp 0xbd3c
movq 0x9cd5(%rip), %rdi      # 0x15a00
leaq 0x976e(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movq 0x9cbd(%rip), %rdi      # 0x15a00
callq 0x2180
movq 0x9c99(%rip), %rdi      # 0x159e8
leaq 0x56c9(%rip), %rsi      # 0x1141f
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
leaq -0x30(%rbp), %rdi
callq 0x8f30
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x5, -0x34(%rbp)
jg 0xbd91
movslq -0x34(%rbp), %rax
movb $0x0, -0x56(%rbp,%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbd77
cmpl $0x0, -0x30(%rbp)
jle 0xbf7e
movl 0x9c87(%rip), %eax      # 0x15a28
addl $0x1, %eax
movl %eax, 0x9c7e(%rip)      # 0x15a28
movq 0x9c37(%rip), %rdi      # 0x159e8
leaq 0x55f3(%rip), %rsi      # 0x113ab
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
leaq -0x3d(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
callq 0x93b0
movl %eax, -0x38(%rbp)
movq 0x9ba7(%rip), %rax      # 0x15980
movq %rax, -0x60(%rbp)
cmpb $0x0, -0x3e(%rbp)
je 0xbedc
movl -0x38(%rbp), %esi
xorl %edi, %edi
callq 0x4430
movq 0x97e8(%rip), %rax      # 0x155e0
subsd 0x10(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
callq 0x4380
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x5, -0x34(%rbp)
jg 0xbed7
movslq -0x34(%rbp), %rax
cmpl $0x0, -0x30(%rbp,%rax,4)
jle 0xbec7
movslq -0x34(%rbp), %rax
cmpl $0x7, -0x30(%rbp,%rax,4)
jge 0xbec7
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0xbe65
cmpb $0x0, -0x3d(%rbp)
jne 0xbe82
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movslq -0x34(%rbp), %rax
movl -0x30(%rbp,%rax,4), %eax
subl $0x1, %eax
cltq
movb $0x1, -0x56(%rbp,%rax)
jmp 0xbec5
movl -0x38(%rbp), %eax
addl $0x1, %eax
movw %ax, %dx
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movw %dx, 0x110(%rax,%rcx,2)
movsd -0x50(%rbp), %xmm0
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, 0xe0(%rax,%rcx,8)
jmp 0xbec7
jmp 0xbec9
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbe18
jmp 0xbf7c
movl $0x0, -0x34(%rbp)
cmpl $0x5, -0x34(%rbp)
jg 0xbf7a
movslq -0x34(%rbp), %rax
cmpl $0x0, -0x30(%rbp,%rax,4)
jle 0xbf6a
movslq -0x34(%rbp), %rax
cmpl $0x7, -0x30(%rbp,%rax,4)
jge 0xbf6a
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0xbf68
movl -0x38(%rbp), %eax
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
cvtsi2sd %edx, %xmm0
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, 0xe0(%rax,%rcx,8)
movq -0x60(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl -0x30(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movw $0x0, 0x110(%rax,%rcx,2)
jmp 0xbf6a
jmp 0xbf6c
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbee3
jmp 0xbf7c
jmp 0xbf7e
cmpl $0x0, -0x3c(%rbp)
jg 0xbf89
jmp 0xc035
movq 0x9a58(%rip), %rdi      # 0x159e8
leaq 0x49c2(%rip), %rsi      # 0x10959
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
cmpl $0x1, -0x3c(%rbp)
jle 0xbfb8
movq 0x9a3a(%rip), %rdi      # 0x159e8
movl $0x73, %esi
callq 0x2150
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movzbl 0x91e8(%rip), %ecx      # 0x151b1
cmpl %ecx, %eax
jge 0xc018
movslq -0x34(%rbp), %rax
cmpb $0x0, -0x56(%rbp,%rax)
je 0xc00b
movl -0x34(%rbp), %edx
addl $0x1, %edx
leaq 0x94bb(%rip), %rdi      # 0x154a0
leaq 0x4942(%rip), %rsi      # 0x1092e
movb $0x0, %al
callq 0x2190
movq 0x99ee(%rip), %rdi      # 0x159e8
leaq 0x949f(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xc00d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbfbf
movq 0x99c9(%rip), %rdi      # 0x159e8
leaq 0x538c(%rip), %rsi      # 0x113b2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x42a0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)