// File: /workspace/github_c_makefile_star2_O0/hyc[P]trek73c/trekx.c
// Function: TLoad
void TLoad()
{
  int I, J, k, X, Y;
  Digs Temp;
  reg Srec *WITH;

  waddstr(Cmdwin,"   [Load or Unload] ");
  getyx(Cmdwin, Y, X);
  mygetstr(Cmdwin,scrstr,false);
  scrstr[0] = toupper(scrstr[0]);
  wmove(Cmdwin, Y, X);
  if (scrstr[0]=='L') {
	waddstr(Cmdwin,"Load");
	I = 0;
  } else if (scrstr[0]=='U') {
	waddstr(Cmdwin,"Unload");
	I = 1;
  } else {
	Whatt();
	return;
  }
  waddstr(Cmdwin,"\n   Tubes [1-6] ");
  Indigits(Temp);
  WITH = Ships[0];
  if (!I) {
    for (I = 0; I <= 5; I++) {
      if (Temp[I] > 0 && Temp[I] < 7) {
	if (WITH->Tstat[Temp[I] - 1] >= 0) {
	  J = WITH->Tstat[7];
	  k = 10 - WITH->Tengy[Temp[I] - 1];
	  if (J > k)
	    J = k;
	  if (J > Objects[0]->Fuel)
	    J = (long)Objects[0]->Fuel;
	  WITH->Tengy[Temp[I] - 1] += J;
	  Objects[0]->Fuel -= J;
	  if (!cheat)
	    WITH->Fcap -= J;
	}
      }
    }
  } else {
    for (I = 0; I <= 5; I++) {
      J = WITH->Tengy[Temp[I] - 1];
      Objects[0]->Fuel += J;
      if (!cheat)
      	WITH->Fcap += J;
      else
	if (Objects[0]->Fuel > WITH->Fcap)
	  Objects[0]->Fuel = WITH->Fcap;
      WITH->Tengy[Temp[I] - 1] = 0;
    }
  }
  Endln();
  waddstr(Cmdwin,"Scott: Tube units now ");
  for (I = 0; I <= 5; I++) {
    if (WITH->Tstat[I] < 0)
      waddstr(Cmdwin,"  --");
    else {
      sprintf(scrstr,"%4d", WITH->Tengy[I]);
      waddstr(Cmdwin,scrstr);
    }
  }
  sprintf(scrstr,"  Fuel @ %0.0f", Objects[0]->Fuel);
  SEndln();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0xb659(%rip), %rdi      # 0x159e8
leaq 0x670d(%rip), %rsi      # 0x10aa3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
xorl %eax, %eax
cmpq 0xb63f(%rip), %rax      # 0x159e8
je 0xa3ba
movq 0xb636(%rip), %rax      # 0x159e8
movswl (%rax), %eax
movl %eax, -0x4c(%rbp)
jmp 0xa3c4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x4c(%rbp)
jmp 0xa3c4
movl -0x4c(%rbp), %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpq 0xb615(%rip), %rax      # 0x159e8
je 0xa3e5
movq 0xb60c(%rip), %rax      # 0x159e8
movswl 0x2(%rax), %eax
movl %eax, -0x50(%rbp)
jmp 0xa3ef
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x50(%rbp)
jmp 0xa3ef
movl -0x50(%rbp), %eax
movl %eax, -0x10(%rbp)
movq 0xb5ec(%rip), %rdi      # 0x159e8
leaq 0xb09d(%rip), %rsi      # 0x154a0
xorl %edx, %edx
callq 0x24a0
movsbl 0xb08f(%rip), %edi      # 0x154a0
callq 0x20b0
movb %al, 0xb084(%rip)       # 0x154a0
movq 0xb5c5(%rip), %rdi      # 0x159e8
movl -0x14(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x21d0
movsbl 0xb06b(%rip), %eax      # 0x154a0
cmpl $0x4c, %eax
jne 0xa45b
movq 0xb5a7(%rip), %rdi      # 0x159e8
leaq 0x6670(%rip), %rsi      # 0x10ab8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movl $0x0, -0x4(%rbp)
jmp 0xa494
movsbl 0xb03e(%rip), %eax      # 0x154a0
cmpl $0x55, %eax
jne 0xa488
movq 0xb57a(%rip), %rdi      # 0x159e8
leaq 0x6648(%rip), %rsi      # 0x10abd
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movl $0x1, -0x4(%rbp)
jmp 0xa492
callq 0x8d00
jmp 0xa77e
jmp 0xa494
movq 0xb54d(%rip), %rdi      # 0x159e8
leaq 0x6622(%rip), %rsi      # 0x10ac4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
leaq -0x40(%rbp), %rdi
callq 0x8f30
movq 0xb4c4(%rip), %rax      # 0x15980
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0xa5f2
movl $0x0, -0x4(%rbp)
cmpl $0x5, -0x4(%rbp)
jg 0xa5ed
movslq -0x4(%rbp), %rax
cmpl $0x0, -0x40(%rbp,%rax,4)
jle 0xa5dd
movslq -0x4(%rbp), %rax
cmpl $0x7, -0x40(%rbp,%rax,4)
jge 0xa5dd
movq -0x48(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x40(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jl 0xa5db
movq -0x48(%rbp), %rax
movswl 0x11e(%rax), %eax
movl %eax, -0x8(%rbp)
movq -0x48(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x40(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0xc6(%rax,%rcx,2), %ecx
movl $0xa, %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
cmpl -0xc(%rbp), %eax
jle 0xa55c
movl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
cvtsi2sdl -0x8(%rbp), %xmm0
movq 0xb078(%rip), %rax      # 0x155e0
ucomisd 0x20(%rax), %xmm0
jbe 0xa57f
movq 0xb06a(%rip), %rax      # 0x155e0
cvttsd2si 0x20(%rax), %rax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %esi
movq -0x48(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x40(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0xc6(%rax,%rcx,2), %edx
addl %esi, %edx
movw %dx, 0xc6(%rax,%rcx,2)
cvtsi2sdl -0x8(%rbp), %xmm1
movq 0xb02e(%rip), %rax      # 0x155e0
movsd 0x20(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
cmpb $0x0, 0xaff9(%rip)      # 0x155c0
jne 0xa5d9
movl -0x8(%rbp), %edx
movq -0x48(%rbp), %rax
movzbl 0x18(%rax), %ecx
subl %edx, %ecx
movb %cl, 0x18(%rax)
jmp 0xa5db
jmp 0xa5dd
jmp 0xa5df
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xa4d1
jmp 0xa6b5
movl $0x0, -0x4(%rbp)
cmpl $0x5, -0x4(%rbp)
jg 0xa6b3
movq -0x48(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x40(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movswl 0xc6(%rax,%rcx,2), %eax
movl %eax, -0x8(%rbp)
cvtsi2sdl -0x8(%rbp), %xmm0
movq 0xafb4(%rip), %rax      # 0x155e0
addsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rax)
cmpb $0x0, 0xaf83(%rip)      # 0x155c0
jne 0xa651
movl -0x8(%rbp), %edx
movq -0x48(%rbp), %rax
movzbl 0x18(%rax), %ecx
addl %edx, %ecx
movb %cl, 0x18(%rax)
jmp 0xa689
movq 0xaf88(%rip), %rax      # 0x155e0
movsd 0x20(%rax), %xmm0
movq -0x48(%rbp), %rax
movzbl 0x18(%rax), %eax
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xa687
movq -0x48(%rbp), %rax
movzbl 0x18(%rax), %eax
cvtsi2sd %eax, %xmm0
movq 0xaf5e(%rip), %rax      # 0x155e0
movsd %xmm0, 0x20(%rax)
jmp 0xa689
movq -0x48(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl -0x40(%rbp,%rcx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movw $0x0, 0xc6(%rax,%rcx,2)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xa5f9
jmp 0xa6b5
callq 0x42a0
movq 0xb327(%rip), %rdi      # 0x159e8
leaq 0x640d(%rip), %rsi      # 0x10ad5
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
movl $0x0, -0x4(%rbp)
cmpl $0x5, -0x4(%rbp)
jg 0xa758
movq -0x48(%rbp), %rax
movslq -0x4(%rbp), %rcx
movswl 0x110(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jge 0xa70e
movq 0xb2ed(%rip), %rdi      # 0x159e8
leaq 0x6c5f(%rip), %rsi      # 0x11361
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xa74b
movq -0x48(%rbp), %rax
movslq -0x4(%rbp), %rcx
movswl 0xc6(%rax,%rcx,2), %edx
leaq 0xad7b(%rip), %rdi      # 0x154a0
leaq 0x6107(%rip), %rsi      # 0x10833
movb $0x0, %al
callq 0x2190
movq 0xb2ae(%rip), %rdi      # 0x159e8
leaq 0xad5f(%rip), %rsi      # 0x154a0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
jmp 0xa74d
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xa6d9
movq 0xae81(%rip), %rax      # 0x155e0
movsd 0x20(%rax), %xmm0
leaq 0xad35(%rip), %rdi      # 0x154a0
leaq 0x637a(%rip), %rsi      # 0x10aec
movb $0x1, %al
callq 0x2190
callq 0x4320
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)