// File: /workspace/github_c_makefile_star2_O0/hyc[P]trek73c/trekx.c
// Function: main
int main(argc, argv)
int argc;
Char *argv[];
{
  int I;

  SysInit();
again:
  TrekInit();
  Radius = 5000;
  TCount = (-1);
  Win = 0;
  Win2 = 0;
  LKnt = 0;
  DrawScr();
  Stop = false;
  Redo = false;
  do {
    TCount++;
    if (TCount > Enemies)
      Execute();
    else if (Objects[TCount] != NULL) {
      I = Objects[TCount]->ObTyp;
      if (I < 10 && Ships[TCount] != NULL) {
	if (Ships[TCount]->Crew != 0) {
	  if (!I)
	    Command();
	  else
	    EStrat();
	}
      }
    }
  } while (!Stop);

  waddstr(Cmdwin,"Computer:  Do you desire another battle");
  if (Yes())
  {
    delwin(Prbwin);
    delwin(Scnwin);
    delwin(Diswin);
    delwin(Cmdwin);
    delwin(Repwin);
    delwin(Radwin);
    for (I = ObjCount; I >= 0; I--)
    {
      if (Objects[I])
      {
	free(Objects[I]);
	Objects[I] = NULL;
      }
    }
    for (I = 0; I<10; I++)
    {
      if (Ships[I])
      {
      	free(Ships[I]);
	Ships[I] = NULL;
      }
    }
    goto again;
  }
  endwin();
  exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2690
callq 0x2790
movl $0x1388, 0x850e(%rip)   # imm = 0x1388
movl $0xffffffff, 0x8514(%rip) # imm = 0xFFFFFFFF
movb $0x0, 0x80bc(%rip)      # 0x155d7
movl $0x0, 0x84fb(%rip)      # 0x15a20
movl $0x0, 0x84e5(%rip)      # 0x15a14
callq 0x3cd0
movb $0x0, 0x84e9(%rip)      # 0x15a24
movb $0x0, 0x84da(%rip)      # 0x15a1c
movl 0x84e0(%rip), %eax      # 0x15a28
addl $0x1, %eax
movl %eax, 0x84d7(%rip)      # 0x15a28
movl 0x84d1(%rip), %eax      # 0x15a28
movzbl 0x8072(%rip), %ecx      # 0x155d0
cmpl %ecx, %eax
jle 0xd569
callq 0x7250
jmp 0xd5e7
movslq 0x84b8(%rip), %rcx      # 0x15a28
leaq 0x8069(%rip), %rax      # 0x155e0
cmpq $0x0, (%rax,%rcx,8)
je 0xd5e5
movslq 0x84a3(%rip), %rcx      # 0x15a28
leaq 0x8054(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rax
movswl 0x4a(%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0xa, -0x14(%rbp)
jge 0xd5e3
movslq 0x8484(%rip), %rcx      # 0x15a28
leaq 0x83d5(%rip), %rax      # 0x15980
cmpq $0x0, (%rax,%rcx,8)
je 0xd5e3
movslq 0x846f(%rip), %rcx      # 0x15a28
leaq 0x83c0(%rip), %rax      # 0x15980
movq (%rax,%rcx,8), %rax
movswl 0x1a(%rax), %eax
cmpl $0x0, %eax
je 0xd5e1
cmpl $0x0, -0x14(%rbp)
jne 0xd5da
callq 0xd240
jmp 0xd5df
callq 0x7a40
jmp 0xd5e1
jmp 0xd5e3
jmp 0xd5e5
jmp 0xd5e7
jmp 0xd5e9
movb 0x8435(%rip), %al       # 0x15a24
xorb $-0x1, %al
testb $0x1, %al
jne 0xd542
movq 0x83e8(%rip), %rdi      # 0x159e8
leaq 0x4b65(%rip), %rsi      # 0x1216c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2200
callq 0x8c40
cmpb $0x0, %al
je 0xd714
movq 0x83e3(%rip), %rdi      # 0x15a08
callq 0x21b0
movq 0x83cf(%rip), %rdi      # 0x15a00
callq 0x21b0
movq 0x83bb(%rip), %rdi      # 0x159f8
callq 0x21b0
movq 0x839f(%rip), %rdi      # 0x159e8
callq 0x21b0
movq 0x8383(%rip), %rdi      # 0x159d8
callq 0x21b0
movq 0x837f(%rip), %rdi      # 0x159e0
callq 0x21b0
movzbl 0x7f65(%rip), %eax      # 0x155d2
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0xd6bc
movslq -0x14(%rbp), %rcx
leaq 0x7f5f(%rip), %rax      # 0x155e0
cmpq $0x0, (%rax,%rcx,8)
je 0xd6af
movslq -0x14(%rbp), %rcx
leaq 0x7f4d(%rip), %rax      # 0x155e0
movq (%rax,%rcx,8), %rdi
callq 0x2120
movslq -0x14(%rbp), %rcx
leaq 0x7f39(%rip), %rax      # 0x155e0
movq $0x0, (%rax,%rcx,8)
jmp 0xd6b1
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xd670
movl $0x0, -0x14(%rbp)
cmpl $0xa, -0x14(%rbp)
jge 0xd70f
movslq -0x14(%rbp), %rcx
leaq 0x82ac(%rip), %rax      # 0x15980
cmpq $0x0, (%rax,%rcx,8)
je 0xd702
movslq -0x14(%rbp), %rcx
leaq 0x829a(%rip), %rax      # 0x15980
movq (%rax,%rcx,8), %rdi
callq 0x2120
movslq -0x14(%rbp), %rcx
leaq 0x8286(%rip), %rax      # 0x15980
movq $0x0, (%rax,%rcx,8)
jmp 0xd704
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xd6c3
jmp 0xd4fb
callq 0x21f0
xorl %edi, %edi
callq 0x20d0