// File: /workspace/github_c_makefile_star2_O2/hyc[P]trek73c/trekx.c
// Function: TrekInit
void TrekInit()
{
  register int I, J, K;
  int FORLIM;
  double Junk;
  Object *WITH;
  Srec *WITH1;
  int FORLIM1;
  WINDOW *Twin, *subwin();
  boolean Intro, Ok;
  char *Trash, *Temp, *Temp2, c;

  clear();
  mvaddstr(0,31,"*** Star Trek ***");
  mvaddstr(2,29,"Version 1.01 - curses:");
  refresh();
  mvaddstr(3,10,
	 "\"Novice\" has 60 seconds for response, otherwise 10 seconds.");
  
  mvaddstr(6,0,"Captain: My last name is ");
  do {
    move(6,25);
    clrtoeol();
    mygetstr(stdscr,scrstr,true);
     J = strlen(scrstr);
  } while (J <= 1);
  Name=Namebuf;
  strncpy(Name,scrstr,20);

  cheat = false;
  if (Name[0] == '*' || Name[0] == '!') {
    if (Name[0] == '!')
	cheat = true;
    Name++;
    J--;
    Intro = false;
  } else
    Intro = true;
  for (I = 0; I < J; I++) {
    if (isupper(Name[I]))
      Name[I] = tolower(Name[I]);
  }
  if (!strcmp(Name, "novice"))
    Timer = 59;
  else
    Timer = 10;
  Name[0] = toupper(Name[0]);

  mvaddstr(8,0, Name);
  addstr(": My sex is ");
  mygetstr(stdscr,scrstr,true);
  scrstr[0] = toupper(scrstr[0]);
  if (scrstr[0] == 'M')
    Title = Male;
  else if (scrstr[0] == 'F')
    Title = Female;
  else
    Title = Slurs[_randint(5)];
  do {
    Ok = true;
    move(9,3);
    addstr("I'm expecting [1-9] enemy vessels: ");
    clrtobot();
    mygetstr(stdscr,scrstr,true);
    I=atoi(scrstr);
    if (I < 1 || I > 9) {
      Ok = false;
      sprintf(scrstr,"Uhura: %s, Starfleet Command reports that it can only\n",
	     Title);
      mvaddstr(11,0,scrstr);
      addstr("   be from 1 to 9.\n\n");
      refresh();

      Delay(500L);

      addstr(Name);
      addstr(": Correct, Lieutenant - just testing your attention.");
      refresh();
      getch();
    }
  } while (!Ok);
  Enemies = I;
  Vessels = Enemies + 1;
  ObjCount = Vessels;
  for (I = 0; I < 4; I++)
    Ct[I] = 0;
  Win = 0;
  for (I = 0; I < 100; I++)
    Objects[I] = NULL;
  FORLIM = Vessels;
  for (I = 0; I < FORLIM; I++) {
    Objects[I] = (Object *)Malloc(sizeof(Object));
    WITH = Objects[I];
    WITH->Act_Spd = 0.0;
    WITH->Des_Spd = 0.0;
    WITH->Act_Crs = 0.0;
    WITH->Des_Crs = 0.0;
    WITH->Fuel = 150.0;
    WITH->Tim_Del = 0.0;
    WITH->Prx_Del = 0.0;
    WITH->XPos = 0.0;
    WITH->YPos = 0.0;
    WITH->Trgt = 0;
    WITH->ObTyp = I;
  }
  for (I = 0; I < 10; I++)
    Shps[I] = I;
  for (I = 1; I < 9; I++) {
    J = _randint(10 - I) + I;
    K = Shps[I];
    Shps[I] = Shps[J];
    Shps[J] = K;
  }
  FORLIM = Vessels;
  for (I = 1; I < FORLIM; I++)
    Snams[I] = Badguys[Shps[I]-1];
  Snams[0] = Feds[_randint(12)];

  for (I = 1; I < FORLIM; I++)
    Objects[I]->ObTyp = Shps[I];
  Enemy = EnemNms[_randint(5)];
  Capt = Captains[_randint(10)];
  Twin = subwin(stdscr, 0, 0, 0, 7);
  scrollok(Twin,TRUE);

  clear();
  refresh();
  if (Intro) {
    mvwaddstr(Twin,1,6,"Space, the final frontier.");
    mvwaddstr(Twin,2,6,"These are the voyages of the Starship ** ");
    waddstr(Twin,Snams[0]);
    waddstr(Twin," **.");
    mvwaddstr(Twin,3,6,"Its five year mission: To explore strange new worlds,");
    mvwaddstr(Twin,4,6,"to seek out new life and new civilizations,");
    mvwaddstr(Twin,5,6,"to boldly go where no man has gone before!");
    mvwaddstr(Twin,7,24,"S T A R   T R E K");
    wmove(Twin,8,0);
    wrefresh(Twin);
    Delay(3000);

    Junk = (_randint(50) + 50) * 100 + _randint(1000) / 10.0;
    sprintf(scrstr,"\nCaptain's Log, stardate %6.1f\n\n", Junk);
    waddstr(Twin, scrstr);

    J = 0;
    FORLIM = _randint(20);
    for (I = 0; I <= FORLIM;) {
      if (Missions[J][0] == ' ')
	 I++;
      J++;
    }
    Temp = Missions[J-1];
    sprintf(scrstr,"  %s\n", Temp);
    waddstr(Twin, scrstr);
    do {
      Temp = Missions[J];
      J++;
      if (Temp[0] != ' ') {        
	sprintf(scrstr,"   %s\n", Temp);
        waddstr(Twin,scrstr);
      }
    } while (Temp[0] != ' ');
    c="a23456789"[Enemies - 1];
    if (Enemies > 1)
      Trash = "s";
    else
      Trash = "";
    wrefresh(Twin);
    Delay(2000);
    sprintf(scrstr,"\nSulu: %s, I'm picking up %c vessel%s on interception\n",
	   Title, c, Trash);
    waddstr(Twin,scrstr);
    sprintf(scrstr,"   course%s with the %s.\n\n", Trash, Snams[0]);
    waddstr(Twin,scrstr);
    wrefresh(Twin);
    Delay(1500);
    if (Enemies > 1) {
      Temp = "them";
      Temp2 = "";
    } else {
      Temp = "it";
      Temp2 = "a ";
    }
    sprintf(scrstr,"Spock: Sensors identify %s as %s%s battle\n", Temp, Temp2,
	 Enemy);
    waddstr(Twin,scrstr);
    sprintf(scrstr,"   cruiser%s, probably under the command of Captain %s.\n",
	   Trash, Capt);
    waddstr(Twin,scrstr);
    wrefresh(Twin);
    Delay(1000);
    sprintf(scrstr,"\n%s: Sound General Quarters, Lieutenant!\n", Name);
    waddstr(Twin,scrstr);
    wrefresh(Twin);
    Delay(1000);
    sprintf(scrstr,"\nUhura: Aye, %s!\n", Title);
    waddstr(Twin,scrstr);
    wrefresh(Twin);
    Delay(1000);
  }
  sprintf(scrstr,"\nComputer: The %ss are attacking the %s with the\n",
	 Enemy, Snams[0]);
  waddstr(Twin,scrstr);
  waddstr(Twin,"  ");
  FORLIM = Vessels;
  for (I = 1; I < FORLIM; I++) {
    if (I == 7)
      waddstr(Twin,"\n  ");
    waddch(Twin,' ');
    waddstr(Twin,Snams[I]);
    if (I != Enemies) {
      if (Enemies > 2)
	waddch(Twin,',');
      if (I == Vessels - 2)
	waddstr(Twin," and the");
    }
  }
  waddstr(Twin,".\n\n\n[Press a key to continue]");
  wrefresh(Twin);
  getch();
  for (I = 0; I < 10; I++)
    Ships[I] = NULL;
  FORLIM = Vessels;
  for (I = 0; I < FORLIM; I++) {
    Ships[I] = (Srec *)Malloc(sizeof(Srec));
    WITH1 = Ships[I];
    WITH1->Weff = 0.75;
    WITH1->Fcap = 200;
    WITH1->Regen = 10.0;
    FORLIM1 = Phasers;
    for (J = 0; J < FORLIM1; J++) {
      WITH1->PChrg[J] = 10.0;
      WITH1->PCrts[J] = 10.0;
      WITH1->Pstat[J] = 0;
    }
    WITH1->Pstat[Phasers] = 10;
    WITH1->Pstat[Phasers + 1] = 100;
    WITH1->Pdepl[0] = 90.0;
    WITH1->Pdepl[1] = 0.0;
    WITH1->Pdepl[2] = 0.0;
    WITH1->Pdepl[3] = 270.0;
    for (J = 0; J < 6; J++) {
      WITH1->Tstat[J] = 0;
      WITH1->Tengy[J] = 0;
    }
    WITH1->Tstat[Tubes] = 12;
    WITH1->Tstat[Tubes + 1] = 10;
    WITH1->Tstat[Tubes + 2] = 200;
    WITH1->TDepl[0] = 120.0;
    WITH1->TDepl[1] = 60.0;
    WITH1->TDepl[2] = 0.0;
    WITH1->TDepl[3] = 0.0;
    WITH1->TDepl[4] = 300.0;
    WITH1->TDepl[5] = 240.0;
    for (CC = Comp; (long)CC <= (long)Engn; CC = (Damages)((long)CC + 1))
      WITH1->Dmge[(long)CC] = false;
    for (J = 0; J < 4; J++) {
      WITH1->Sdrns[J] = 1.0;
      WITH1->Seff[J] = 100.0;
    }
    WITH1->Crew = 350;
  }
  WITH1 = Ships[0];
  WITH1->Fcap = 250;
  WITH1->Crew = 450;
  WITH1->Weff = 1.0;
  FORLIM = Vessels;
  for (I = 0; I < FORLIM; I++) {
    WITH = Objects[I];
    WITH->Act_Spd = 1.0;
    WITH->Des_Spd = 1.0;
    WITH->Act_Crs = _randint(360);
    WITH->Des_Crs = WITH->Act_Crs;
    WITH->Trgt = 0;
    WITH->Tim_Del = 1.0;
    WITH->Prx_Del = 0.0;
    J = _randint(500) + 4300;
    Junk = _randint(360) * M_PI / 180.0;
    WITH->XPos = J * cos(Junk);
    WITH->YPos = -J * sin(Junk);
  }
  WITH = Objects[0];
  WITH->Act_Crs = 0.0;
  WITH->Des_Crs = 0.0;
  WITH->Tim_Del = 0.0;
  WITH->Fuel = 200.0;
  WITH->XPos = 0.0;
  WITH->YPos = 0.0;
  delwin(Twin);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0xf9cc(%rip), %rbx      # 0x11fe8
movq (%rbx), %rdi
callq 0x2040
movq (%rbx), %rdi
pushq $0x1f
popq %rdx
xorl %esi, %esi
callq 0x21d0
cmpl $-0x1, %eax
je 0x2648
movq (%rbx), %rdi
leaq 0x9530(%rip), %rsi      # 0xbb70
pushq $-0x1
popq %rdx
callq 0x2200
movq (%rbx), %rdi
pushq $0x2
popq %rsi
pushq $0x1d
popq %rdx
callq 0x21d0
cmpl $-0x1, %eax
je 0x266d
movq (%rbx), %rdi
leaq 0x951d(%rip), %rsi      # 0xbb82
pushq $-0x1
popq %rdx
callq 0x2200
movq (%rbx), %rdi
callq 0x2180
movq (%rbx), %rdi
pushq $0x3
popq %rsi
pushq $0xa
popq %rdx
callq 0x21d0
cmpl $-0x1, %eax
je 0x269a
movq (%rbx), %rdi
leaq 0x9507(%rip), %rsi      # 0xbb99
pushq $-0x1
popq %rdx
callq 0x2200
movq (%rbx), %rdi
pushq $0x6
popq %rsi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
je 0x26be
movq (%rbx), %rdi
leaq 0x951f(%rip), %rsi      # 0xbbd5
pushq $-0x1
popq %rdx
callq 0x2200
pushq $0x6
popq %rbp
pushq $0x19
popq %r15
leaq 0xfdd4(%rip), %r12      # 0x124a0
pushq $0x1
popq %r13
movq (%rbx), %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x21d0
movq (%rbx), %rdi
callq 0x2210
movq (%rbx), %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x246d
movq %r12, %rdi
callq 0x2140
movq %rax, %r14
cmpl $0x2, %r14d
jl 0x26d0
leaq 0xfe95(%rip), %rdi      # 0x125a0
movq %rdi, 0xfea6(%rip)      # 0x125b8
leaq 0xfd87(%rip), %rsi      # 0x124a0
pushq $0x14
popq %rdx
callq 0x2260
movb $0x0, 0xfe98(%rip)      # 0x125c0
movzbl 0xfe71(%rip), %eax      # 0x125a0
cmpl $0x2a, %eax
je 0x2740
cmpl $0x21, %eax
jne 0x2761
movb $0x1, 0xfe80(%rip)      # 0x125c0
leaq 0xfe5a(%rip), %rax      # 0x125a1
movq %rax, 0xfe6a(%rip)      # 0x125b8
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq %rax, %r14
incq %r14
movb $0x1, %al
movl %eax, 0x8(%rsp)
jmp 0x2769
movl $0x0, 0x8(%rsp)
movl %r14d, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x27a5
callq 0x2160
movq (%rax), %rax
movq 0xfe35(%rip), %r12      # 0x125b8
movsbq (%r12,%r15), %r13
testb $0x1, 0x1(%rax,%r13,2)
je 0x27a0
callq 0x2250
movq (%rax), %rax
movb (%rax,%r13,4), %al
movb %al, (%r12,%r15)
incq %r15
jmp 0x276f
movq 0xfe0c(%rip), %r14      # 0x125b8
leaq 0x943c(%rip), %rsi      # 0xbbef
movq %r14, %rdi
callq 0x2220
testl %eax, %eax
pushq $0x3b
popq %rax
pushq $0xa
popq %rcx
cmovel %eax, %ecx
movb %cl, 0xfdf5(%rip)       # 0x125c1
callq 0x2100
movq %rax, %rbx
movq (%rax), %rax
movsbq (%r14), %rcx
movb (%rax,%rcx,4), %al
movb %al, (%r14)
movq 0xf800(%rip), %r14      # 0x11fe8
movq (%r14), %rdi
pushq $0x8
popq %rsi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
je 0x280c
movq (%r14), %rdi
movq 0xfdb4(%rip), %rsi      # 0x125b8
pushq $-0x1
popq %rdx
callq 0x2200
movq (%r14), %rdi
leaq 0x93e0(%rip), %rsi      # 0xbbf6
pushq $-0x1
popq %rdx
callq 0x2200
movq (%r14), %rdi
leaq 0xfc78(%rip), %rsi      # 0x124a0
pushq $0x1
popq %rdx
callq 0x246d
movq (%rbx), %rax
movsbq 0xfc65(%rip), %rcx      # 0x124a0
movzbl (%rax,%rcx,4), %eax
movb %al, 0xfc5b(%rip)       # 0x124a0
cmpl $0x4d, %eax
je 0x2858
cmpl $0x46, %eax
jne 0x2861
leaq 0xf992(%rip), %rax      # 0x121e8
jmp 0x2876
leaq 0xf981(%rip), %rax      # 0x121e0
jmp 0x2876
pushq $0x5
popq %rdi
callq 0x245b
cltq
leaq 0xfa5e(%rip), %rcx      # 0x122d0
leaq (%rcx,%rax,8), %rax
movq (%rax), %rax
movq %rax, 0xfd48(%rip)      # 0x125c8
pushq $0x9
popq %rbx
pushq $-0x1
popq %r15
leaq 0xfc12(%rip), %r12      # 0x124a0
pushq $0x1
popq %r13
leaq 0x93da(%rip), %rbp      # 0xbc73
movq 0xf748(%rip), %r14      # 0x11fe8
movq (%r14), %rdi
movl %ebx, %esi
pushq $0x3
popq %rdx
callq 0x21d0
movq (%r14), %rdi
leaq 0x934c(%rip), %rsi      # 0xbc03
movl %r15d, %edx
callq 0x2200
movq (%r14), %rdi
callq 0x22b0
movq (%r14), %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x246d
movq %r12, %rdi
callq 0x21c0
leal -0xa(%rax), %ecx
cmpl $-0xa, %ecx
ja 0x297a
movq 0xfcd8(%rip), %rdx      # 0x125c8
movq %r12, %rdi
leaq 0x932d(%rip), %rsi      # 0xbc27
xorl %eax, %eax
callq 0x2190
movq (%r14), %rdi
pushq $0xb
popq %rsi
xorl %edx, %edx
callq 0x21d0
cmpl $-0x1, %eax
je 0x2921
movq (%r14), %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x2200
movq (%r14), %rdi
leaq 0x9333(%rip), %rsi      # 0xbc5e
movl %r15d, %edx
callq 0x2200
movq (%r14), %rdi
callq 0x2180
movl $0x1f4, %edi            # imm = 0x1F4
callq 0x241c
movq (%r14), %rdi
movq 0xfc69(%rip), %rsi      # 0x125b8
movl %r15d, %edx
callq 0x2200
movq (%r14), %rdi
movq %rbp, %rsi
movl %r15d, %edx
callq 0x2200
movq (%r14), %rdi
callq 0x2180
movq (%r14), %rdi
callq 0x22f0
jmp 0x28a0
movb %al, 0xfc50(%rip)       # 0x125d0
incb %al
movb %al, 0xfc49(%rip)       # 0x125d1
movb %al, 0xfc44(%rip)       # 0x125d2
xorl %ecx, %ecx
leaq 0xfc3c(%rip), %rdx      # 0x125d3
cmpq $0x4, %rcx
je 0x29a6
movb $0x0, (%rcx,%rdx)
incq %rcx
jmp 0x2997
movb $0x0, 0xfc2a(%rip)      # 0x125d7
xorl %ecx, %ecx
leaq 0xfc2a(%rip), %r15      # 0x125e0
cmpq $0x320, %rcx            # imm = 0x320
je 0x29ca
andq $0x0, (%rcx,%r15)
addq $0x8, %rcx
jmp 0x29b6
movzbl %al, %r12d
xorl %r13d, %r13d
pushq $0x50
popq %r14
movabsq $0x4062c00000000000, %rbp # imm = 0x4062C00000000000
cmpq %r13, %r12
je 0x2a1d
movq %r14, %rdi
callq 0x20d0
movq %rax, (%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq %rbp, 0x20(%rax)
movupd %xmm0, 0x38(%rax)
andw $0x0, 0x48(%rax)
movupd %xmm0, 0x28(%rax)
movw %r13w, 0x4a(%rax)
incq %r13
addq $0x8, %r15
jmp 0x29df
leaq 0xfedc(%rip), %rax      # 0x12900
xorl %ecx, %ecx
cmpq $0xa, %rcx
je 0x2a38
movw %cx, (%rax)
incq %rcx
addq $0x2, %rax
jmp 0x2a26
pushq $0x1
popq %r15
leaq 0xfebd(%rip), %r14      # 0x12900
cmpq $0x9, %r15
je 0x2a70
movl %ebx, %edi
callq 0x245b
addl %r15d, %eax
movzwl (%r14,%r15,2), %ecx
cltq
movzwl (%r14,%rax,2), %edx
movw %dx, (%r14,%r15,2)
movw %cx, (%r14,%rax,2)
incq %r15
decl %ebx
jmp 0x2a43
movzbl 0xfb5a(%rip), %ebx      # 0x125d1
pushq $0x1
popq %rax
leaq 0xf76f(%rip), %rcx      # 0x121f0
leaq 0xfe98(%rip), %rsi      # 0x12920
cmpq %rbx, %rax
jae 0x2aa0
movswq (%r14,%rax,2), %rdx
movq -0x8(%rcx,%rdx,8), %rdx
movq %rdx, (%rsi,%rax,8)
incq %rax
jmp 0x2a88
pushq $0xc
popq %rdi
callq 0x245b
cltq
leaq 0xf78f(%rip), %rcx      # 0x12240
movq (%rcx,%rax,8), %rax
movq %rax, 0xfe64(%rip)      # 0x12920
pushq $0x1
popq %rax
leaq 0xfb1a(%rip), %rsi      # 0x125e0
cmpq %rbx, %rax
jae 0x2add
movzwl (%r14,%rax,2), %ecx
movq (%rsi,%rax,8), %rdx
movw %cx, 0x4a(%rdx)
incq %rax
jmp 0x2ac6
pushq $0x5
popq %rdi
callq 0x245b
cltq
leaq 0xf7b2(%rip), %rcx      # 0x122a0
movq (%rcx,%rax,8), %rax
movq %rax, 0xfe77(%rip)      # 0x12970
pushq $0xa
popq %rdi
callq 0x245b
cltq
leaq 0xf7f6(%rip), %rcx      # 0x12300
movq (%rcx,%rax,8), %rax
movq %rax, 0xfe63(%rip)      # 0x12978
movq 0xf4cc(%rip), %rbx      # 0x11fe8
movq (%rbx), %rdi
pushq $0x7
popq %r8
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2310
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2240
movq (%rbx), %rdi
callq 0x2040
movq (%rbx), %rdi
movq %r14, %rbx
callq 0x2180
cmpb $0x0, 0x8(%rsp)
movq %r14, 0x8(%rsp)
jne 0x2f3d
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x2b84
leaq 0x912f(%rip), %rsi      # 0xbca8
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2200
pushq $0x2
popq %rsi
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x2ba9
leaq 0x9125(%rip), %rsi      # 0xbcc3
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2200
movq 0xfd70(%rip), %rsi      # 0x12920
pushq $-0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %edx
callq 0x2200
leaq 0x9129(%rip), %rsi      # 0xbced
movq %rbx, %rdi
movl %ebp, %edx
callq 0x2200
pushq $0x3
popq %rsi
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x2bf3
leaq 0x910a(%rip), %rsi      # 0xbcf2
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2200
pushq $0x4
popq %rsi
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x2c18
leaq 0x911b(%rip), %rsi      # 0xbd28
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2200
pushq $0x5
popq %rsi
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x2c3d
leaq 0x9122(%rip), %rsi      # 0xbd54
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2200
pushq $0x7
popq %rsi
pushq $0x18
popq %rdx
movq %rbx, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x2c62
leaq 0x9128(%rip), %rsi      # 0xbd7f
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2200
pushq $0x8
popq %rsi
movq %rbx, %r15
xorl %ebx, %ebx
movq %r15, %rdi
xorl %edx, %edx
callq 0x21d0
movq %r15, %rdi
callq 0x2180
movl $0xbb8, %edi            # imm = 0xBB8
callq 0x241c
pushq $0x32
popq %rdi
callq 0x245b
imull $0x64, %eax, %eax
addl $0x1388, %eax           # imm = 0x1388
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x245b
cvtsi2sd %eax, %xmm0
divsd 0x8352(%rip), %xmm0     # 0xb008
addsd 0x10(%rsp), %xmm0
leaq 0xf7dd(%rip), %r14      # 0x124a0
leaq 0x90c7(%rip), %rsi      # 0xbd91
movq %r14, %rdi
movb $0x1, %al
callq 0x2190
pushq $-0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2200
pushq $0x14
popq %rdi
callq 0x245b
leaq 0xf65f(%rip), %r13      # 0x12350
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpl %eax, %ebx
jg 0x2d20
movq (%r13), %rdx
xorl %esi, %esi
cmpb $0x20, (%rdx)
sete %sil
addl %esi, %ebx
addq $0x8, %r13
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
addq %rdx, %rcx
addq $0x2, %rcx
jmp 0x2cfb
sarq $0x1d, %rcx
leaq 0xf625(%rip), %rax      # 0x12350
movq (%rcx,%rax), %rdx
leaq 0xf76a(%rip), %r14      # 0x124a0
leaq 0x9076(%rip), %rsi      # 0xbdb3
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
pushq $-0x1
popq %rbp
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
leaq 0x904f(%rip), %r15      # 0xbdb2
movq (%r13), %r12
cmpb $0x20, (%r12)
je 0x2d96
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2190
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
addq $0x8, %r13
cmpb $0x20, (%r12)
jne 0x2d63
movzbl 0xf833(%rip), %eax      # 0x125d0
cmpq $0x2, %rax
leaq 0x9011(%rip), %rcx      # 0xbdb9
movsbl -0x1(%rax,%rcx), %ebp
leaq 0x9209(%rip), %r15      # 0xbfbd
leaq 0x8eb7(%rip), %rbx      # 0xbc72
cmovbq %rbx, %r15
movq 0x8(%rsp), %rdi
callq 0x2180
movl $0x7d0, %edi            # imm = 0x7D0
callq 0x241c
movq 0xf7ee(%rip), %rdx      # 0x125c8
leaq 0xf6bf(%rip), %r14      # 0x124a0
leaq 0x8fdb(%rip), %rsi      # 0xbdc3
movq %r14, %rdi
movl %ebp, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x2190
pushq $-0x1
popq %rbp
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movq 0xfb10(%rip), %rcx      # 0x12920
leaq 0x8fe3(%rip), %rsi      # 0xbdfa
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2190
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movq 0x8(%rsp), %rdi
callq 0x2180
movl $0x5dc, %edi            # imm = 0x5DC
callq 0x241c
cmpb $0x2, 0xf782(%rip)      # 0x125d0
leaq 0x8fc0(%rip), %rax      # 0xbe15
leaq 0x9b06(%rip), %rdx      # 0xc962
cmovaeq %rax, %rdx
leaq 0x8fb3(%rip), %rcx      # 0xbe1a
cmovaeq %rbx, %rcx
movq 0x8(%rsp), %rbx
movq 0xfaf9(%rip), %r8       # 0x12970
leaq 0x8f9f(%rip), %rsi      # 0xbe1d
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movq 0xfadc(%rip), %rcx      # 0x12978
leaq 0x8fa5(%rip), %rsi      # 0xbe48
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2190
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movq %rbx, %rdi
callq 0x2180
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x241c
movq 0xf6e2(%rip), %rdx      # 0x125b8
leaq 0x8fa4(%rip), %rsi      # 0xbe81
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movq %rbx, %rdi
callq 0x2180
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x241c
movq 0xf6bb(%rip), %rdx      # 0x125c8
leaq 0x8f97(%rip), %rsi      # 0xbeab
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movq %rbx, %rdi
callq 0x2180
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x241c
movq 0xfa2c(%rip), %rdx      # 0x12970
movq 0xf9d5(%rip), %rcx      # 0x12920
leaq 0xf54e(%rip), %r14      # 0x124a0
leaq 0x8f64(%rip), %rsi      # 0xbebd
movq %r14, %rdi
xorl %eax, %eax
callq 0x2190
pushq $-0x1
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
leaq 0x8f76(%rip), %rsi      # 0xbef0
movq %rbx, %rdi
movl %ebp, %edx
callq 0x2200
movzbl 0xf646(%rip), %ebx      # 0x125d1
pushq $0x1
popq %r13
leaq 0x8f59(%rip), %r14      # 0xbeef
pushq $0x20
popq %r15
movq 0x8(%rsp), %r12
cmpq %rbx, %r13
jae 0x3028
cmpq $0x7, %r13
jne 0x2fbd
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x2200
movq %r12, %rdi
movl %r15d, %esi
callq 0x2150
leaq 0xf951(%rip), %rax      # 0x12920
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
movl %ebp, %edx
callq 0x2200
movzbl 0xf5ec(%rip), %eax      # 0x125d0
cmpq %rax, %r13
je 0x3020
cmpb $0x3, %al
jb 0x2ffa
movq 0x8(%rsp), %rdi
pushq $0x2c
popq %rsi
callq 0x2150
movzbl 0xf5d0(%rip), %eax      # 0x125d1
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
addl %ecx, %eax
cmpq %rax, %r13
jne 0x3020
movq 0x8(%rsp), %rdi
leaq 0x8eda(%rip), %rsi      # 0xbef3
movl %ebp, %edx
callq 0x2200
incq %r13
jmp 0x2f9f
leaq 0x8ecd(%rip), %rsi      # 0xbefc
pushq $-0x1
popq %rdx
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x2180
movq 0xef9a(%rip), %rax      # 0x11fe8
movq (%rax), %rdi
callq 0x22f0
xorl %eax, %eax
leaq 0xf921(%rip), %r13      # 0x12980
cmpq $0x50, %rax
je 0x3070
andq $0x0, (%rax,%r13)
addq $0x8, %rax
jmp 0x305f
movzbl 0xf55a(%rip), %eax      # 0x125d1
movq %rax, 0x10(%rsp)
movzbl 0xf12c(%rip), %r12d     # 0x121b0
movzbl 0xf126(%rip), %eax      # 0x121b1
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movabsq $0x3ff0000000000000, %rbx # imm = 0x3FF0000000000000
movabsq $0x4059000000000000, %r14 # imm = 0x4059000000000000
movabsq $0x4024000000000000, %r15 # imm = 0x4024000000000000
cmpq 0x10(%rsp), %rbp
je 0x31d7
movl $0x128, %edi            # imm = 0x128
callq 0x20d0
movq %rax, (%r13,%rbp,8)
movb $-0x38, 0x18(%rax)
movapd 0x80da(%rip), %xmm0     # 0xb1b0
movupd %xmm0, (%rax)
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x30fd
movq %r15, 0x20(%rax,%rcx,8)
movq %r15, 0x40(%rax,%rcx,8)
andw $0x0, 0xd2(%rax,%rcx,2)
incq %rcx
jmp 0x30e0
movl $0x64000a, 0xd2(%rax,%r12,2) # imm = 0x64000A
movabsq $0x4056800000000000, %rcx # imm = 0x4056800000000000
movq %rcx, 0x60(%rax)
movupd %xmm0, 0x68(%rax)
movabsq $0x4070e00000000000, %rcx # imm = 0x4070E00000000000
movq %rcx, 0x78(%rax)
pushq $-0xc
popq %rcx
testq %rcx, %rcx
je 0x314a
andw $0x0, 0x11c(%rax,%rcx)
andw $0x0, 0xd2(%rax,%rcx)
addq $0x2, %rcx
jmp 0x312d
movq 0x18(%rsp), %rcx
movl $0xa000c, 0x110(%rax,%rcx,2) # imm = 0xA000C
movw $0xc8, 0x114(%rax,%rcx,2)
movapd 0x8054(%rip), %xmm1     # 0xb1c0
movupd %xmm1, 0xe0(%rax)
movupd %xmm0, 0xf0(%rax)
movapd 0x804c(%rip), %xmm0     # 0xb1d0
movupd %xmm0, 0x100(%rax)
pushq $-0x5
popq %rcx
testq %rcx, %rcx
je 0x31a1
movb $0x0, 0xc5(%rax,%rcx)
incq %rcx
jmp 0x318f
movl $0x5, 0xf825(%rip)      # 0x129d0
pushq $-0x20
popq %rcx
testq %rcx, %rcx
je 0x31c9
movq %rbx, 0xa0(%rax,%rcx)
movq %r14, 0xc0(%rax,%rcx)
addq $0x8, %rcx
jmp 0x31ae
movw $0x15e, 0x1a(%rax)      # imm = 0x15E
incq %rbp
jmp 0x30b0
movq 0xf7a2(%rip), %rax      # 0x12980
movb $-0x6, 0x18(%rax)
movw $0x1c2, 0x1a(%rax)      # imm = 0x1C2
movq %rbx, 0x8(%rax)
movq 0x10(%rsp), %r13
shll $0x3, %r13d
xorl %ebx, %ebx
xorpd %xmm0, %xmm0
movhpd 0x7e0d(%rip), %xmm0     # xmm0 = xmm0[0],mem[0]
movapd %xmm0, 0x20(%rsp)
leaq 0xf3d0(%rip), %r12      # 0x125e0
cmpq %rbx, %r13
je 0x32d7
movq (%rbx,%r12), %r15
movaps 0x7fbc(%rip), %xmm0     # 0xb1e0
movups %xmm0, (%r15)
movl $0x168, %edi            # imm = 0x168
callq 0x245b
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x10(%r15)
movsd %xmm0, 0x18(%r15)
andw $0x0, 0x48(%r15)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x28(%r15)
movl $0x1f4, %edi            # imm = 0x1F4
callq 0x245b
movl %eax, %r14d
leal 0x10cc(%r14), %ebp
movl $0x168, %edi            # imm = 0x168
callq 0x245b
cvtsi2sd %eax, %xmm0
mulsd 0x7d9c(%rip), %xmm0     # 0xb018
divsd 0x7d9c(%rip), %xmm0     # 0xb020
movsd %xmm0, 0x10(%rsp)
cvtsi2sd %ebp, %xmm1
movsd %xmm1, 0x18(%rsp)
callq 0x20e0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x38(%r15)
movl $0xffffef34, %eax       # imm = 0xFFFFEF34
subl %r14d, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x2300
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x40(%r15)
addq $0x8, %rbx
jmp 0x3210
movq 0xf302(%rip), %rax      # 0x125e0
andq $0x0, 0x30(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rax)
movabsq $0x4069000000000000, %rcx # imm = 0x4069000000000000
movq %rcx, 0x20(%rax)
movupd %xmm0, 0x38(%rax)
movq 0x8(%rsp), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0