// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movq 0x10974(%rip), %r13     # 0x12fe8
movq (%r13), %rdi
callq 0x2050
movq (%r13), %rdi
xorl %esi, %esi
movl $0x1f, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x26a7
movq (%r13), %rdi
leaq 0xb54b(%rip), %rsi      # 0xdbe8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
movl $0x2, %esi
movl $0x1d, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x26d4
movq (%r13), %rdi
leaq 0xb530(%rip), %rsi      # 0xdbfa
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
callq 0x2190
movq (%r13), %rdi
movl $0x3, %esi
movl $0xa, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x270a
movq (%r13), %rdi
leaq 0xb511(%rip), %rsi      # 0xdc11
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
movl $0x6, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x2734
movq (%r13), %rdi
leaq 0xb523(%rip), %rsi      # 0xdc4d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0x10d75(%rip), %rbx     # 0x134b0
movq (%r13), %rdi
movl $0x6, %esi
movl $0x19, %edx
callq 0x21e0
movq (%r13), %rdi
callq 0x2220
movq (%r13), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x249f
movq %rbx, %rdi
callq 0x2150
movq %rax, %r14
cmpl $0x2, %r14d
jl 0x273b
leaq 0x10e30(%rip), %rbx     # 0x135b0
movq %rbx, 0x10e41(%rip)     # 0x135c8
leaq 0x10d22(%rip), %rsi     # 0x134b0
movl $0x14, %edx
movq %rbx, %rdi
callq 0x2270
movb $0x0, 0x10e2e(%rip)     # 0x135d0
movzbl 0x10e07(%rip), %eax     # 0x135b0
cmpl $0x2a, %eax
je 0x27ba
cmpl $0x21, %eax
jne 0x27da
movb $0x1, 0x10e16(%rip)     # 0x135d0
leaq 0x10df0(%rip), %rbx     # 0x135b1
movq %rbx, 0x10e00(%rip)     # 0x135c8
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq %rax, %r14
incq %r14
movb $0x1, %al
movl %eax, (%rsp)
jmp 0x27e1
movl $0x0, (%rsp)
callq 0x2170
movq %rax, %r15
movl %r14d, %r14d
xorl %r12d, %r12d
movq (%r15), %rax
movsbq (%rbx,%r12), %rbp
testb $0x1, 0x1(%rax,%rbp,2)
je 0x2814
callq 0x2260
movq (%rax), %rax
movb (%rax,%rbp,4), %al
movb %al, (%rbx,%r12)
movq 0x10db4(%rip), %rbx     # 0x135c8
incq %r12
cmpq %r12, %r14
jne 0x27ef
leaq 0xb444(%rip), %rsi      # 0xdc67
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
movl $0x3b, %eax
movl $0xa, %ecx
cmovel %eax, %ecx
movb %cl, 0x10d91(%rip)      # 0x135d1
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movsbq (%rbx), %rcx
movb (%rax,%rcx,4), %al
movb %al, (%rbx)
movq (%r13), %rdi
movl $0x8, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x287e
movq (%r13), %rdi
movq 0x10d54(%rip), %rsi     # 0x135c8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
leaq 0xb3e5(%rip), %rsi      # 0xdc6e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
leaq 0x10c12(%rip), %rsi     # 0x134b0
movl $0x1, %edx
callq 0x249f
movq (%r14), %rax
movsbq 0x10bfd(%rip), %rcx     # 0x134b0
movzbl (%rax,%rcx,4), %eax
movb %al, 0x10bf3(%rip)      # 0x134b0
cmpl $0x4d, %eax
je 0x28d0
cmpl $0x46, %eax
jne 0x28d9
leaq 0x1092a(%rip), %rax     # 0x131f8
jmp 0x2909
leaq 0x10919(%rip), %rax     # 0x131f0
jmp 0x2909
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cltq
leaq 0x109db(%rip), %rcx     # 0x132e0
leaq (%rcx,%rax,8), %rax
movq (%rax), %rax
movq %rax, 0x10cc5(%rip)     # 0x135d8
leaq 0x10b96(%rip), %r14     # 0x134b0
leaq 0xb3b5(%rip), %r12      # 0xdcd6
leaq 0x18(%rsp), %rbx
leaq 0xb3be(%rip), %rbp      # 0xdceb
movq (%r13), %rdi
movl $0x9, %esi
movl $0x3, %edx
callq 0x21e0
movq (%r13), %rdi
leaq 0xb330(%rip), %rsi      # 0xdc7b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
callq 0x22c0
movq (%r13), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x249f
movq %r14, %rdi
callq 0x21d0
movl %eax, %r15d
leal -0xa(%r15), %eax
cmpl $-0xa, %eax
ja 0x2a3e
movq 0x10c4a(%rip), %rdx     # 0x135d8
movq %r14, %rdi
leaq 0xb307(%rip), %rsi      # 0xdc9f
xorl %eax, %eax
callq 0x21a0
movq (%r13), %rdi
movl $0xb, %esi
xorl %edx, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x29c5
movq (%r13), %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
callq 0x2190
movq $0x7a120, 0x20(%rsp)    # imm = 0x7A120
movq $0x0, 0x18(%rsp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x20c0
movq (%r13), %rdi
movq 0x10bbc(%rip), %rsi     # 0x135c8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
movq %rbp, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq (%r13), %rdi
callq 0x2190
movq (%r13), %rdi
callq 0x2300
jmp 0x292d
movb %r15b, 0x10b9b(%rip)    # 0x135e0
incb %r15b
movb %r15b, 0x10b92(%rip)    # 0x135e1
movb %r15b, 0x10b8c(%rip)    # 0x135e2
movl $0x0, 0x10b84(%rip)     # 0x135e4
movb $0x0, 0x10b81(%rip)     # 0x135e8
leaq 0x10b82(%rip), %rbx     # 0x135f0
xorl %r14d, %r14d
movl $0x320, %edx            # imm = 0x320
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2040
movzbl %r15b, %r15d
movabsq $0x4062c00000000000, %r12 # imm = 0x4062C00000000000
movl $0x50, %edi
callq 0x20e0
movq %rax, (%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, (%rax)
movdqu %xmm0, 0x10(%rax)
movq %r12, 0x20(%rax)
movdqu %xmm0, 0x38(%rax)
movdqu %xmm0, 0x28(%rax)
movw $0x0, 0x48(%rax)
movw %r14w, 0x4a(%rax)
incq %r14
addq $0x8, %rbx
cmpq %r14, %r15
jne 0x2a8e
movdqa 0xa53b(%rip), %xmm0     # 0xd010
xorl %eax, %eax
movdqa 0xa551(%rip), %xmm1     # 0xd030
pshufd $0xf5, %xmm1, %xmm2     # xmm2 = xmm1[1,1,3,3]
leaq 0x10e25(%rip), %rbx     # 0x13910
movdqa %xmm0, %xmm3
pxor 0xa529(%rip), %xmm3     # 0xd020
movdqa %xmm1, %xmm4
pcmpgtd %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pcmpeqd %xmm2, %xmm3
pand %xmm4, %xmm3
movd %xmm3, %ecx
testb $0x1, %cl
je 0x2b19
movw %ax, (%rbx,%rax,2)
pextrw $0x4, %xmm3, %ecx
testb $0x1, %cl
je 0x2b2b
leal 0x1(%rax), %ecx
movw %cx, 0x2(%rbx,%rax,2)
addq $0x2, %rax
paddq 0xa509(%rip), %xmm0     # 0xd040
cmpq $0xa, %rax
jne 0x2aeb
movl $0x1, %r14d
movl $0x9, %ebp
callq 0x22e0
sarl $0x3, %eax
cltd
idivl %ebp
movzwl (%rbx,%r14,2), %eax
movslq %edx, %rcx
addq %r14, %rcx
movzwl (%rbx,%rcx,2), %edx
movw %dx, (%rbx,%r14,2)
movw %ax, (%rbx,%rcx,2)
incq %r14
decl %ebp
cmpq $0x9, %r14
jne 0x2b48
movzbl 0x10a63(%rip), %r14d    # 0x135e1
cmpq $0x2, %r14
jb 0x2c16
movl $0x1, %eax
leaq 0x1066c(%rip), %rcx     # 0x13200
leaq 0x10d95(%rip), %rdx     # 0x13930
movl (%rsp), %ebp
movswq (%rbx,%rax,2), %rsi
movq -0x8(%rcx,%rsi,8), %rsi
movq %rsi, (%rdx,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x2b9e
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x21, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cltq
leaq 0x1066d(%rip), %rcx     # 0x13250
movq (%rcx,%rax,8), %rax
movq %rax, 0x10d42(%rip)     # 0x13930
cmpb $0x2, %r14b
jb 0x2c53
movl $0x1, %eax
leaq 0x109f0(%rip), %rcx     # 0x135f0
movzwl (%rbx,%rax,2), %edx
movq (%rcx,%rax,8), %rsi
movw %dx, 0x4a(%rsi)
incq %rax
cmpq %rax, %r14
jne 0x2c00
jmp 0x2c53
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x21, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cltq
leaq 0x1060b(%rip), %rcx     # 0x13250
movq (%rcx,%rax,8), %rax
movq %rax, 0x10ce0(%rip)     # 0x13930
movl (%rsp), %ebp
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cltq
leaq 0x10631(%rip), %rcx     # 0x132b0
movq (%rcx,%rax,8), %rax
movq %rax, 0x10cf6(%rip)     # 0x13980
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cltq
leaq 0x10658(%rip), %rcx     # 0x13310
movq (%rcx,%rax,8), %rax
movq %rax, 0x10cc5(%rip)     # 0x13988
movq (%r13), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x7, %r8d
callq 0x2320
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x2250
movq (%r13), %rdi
callq 0x2050
movq (%r13), %rdi
callq 0x2190
testb %bpl, %bpl
jne 0x31f4
movq %rbx, %rdi
movl $0x1, %esi
movl $0x6, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x2d2e
leaq 0xafff(%rip), %rsi      # 0xdd20
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
movl $0x2, %esi
movl $0x6, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x2d59
leaq 0xafef(%rip), %rsi      # 0xdd3b
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x10bd0(%rip), %rsi     # 0x13930
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0xaff1(%rip), %rsi      # 0xdd65
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
movl $0x3, %esi
movl $0x6, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x2dac
leaq 0xafcb(%rip), %rsi      # 0xdd6a
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
movl $0x4, %esi
movl $0x6, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x2dd7
leaq 0xafd6(%rip), %rsi      # 0xdda0
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
movl $0x5, %esi
movl $0x6, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x2e02
leaq 0xafd7(%rip), %rsi      # 0xddcc
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
movl $0x7, %esi
movl $0x18, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x2e2d
leaq 0xafd7(%rip), %rsi      # 0xddf7
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x8, %esi
xorl %edx, %edx
callq 0x21e0
movq %rbx, %rdi
callq 0x2190
leaq 0x18(%rsp), %r8
movq $0x0, 0x8(%r8)
movq $0x3, (%r8)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x20c0
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
imull $0x32, %ecx, %ecx
subl %ecx, %eax
imull $0x64, %eax, %eax
addl $0x1388, %eax           # imm = 0x1388
cvtsi2sd %eax, %xmm0
movsd %xmm0, (%rsp)
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0xa25f(%rip), %xmm0     # 0xd130
addsd (%rsp), %xmm0
leaq 0x105d3(%rip), %r14     # 0x134b0
leaq 0xaf25(%rip), %rsi      # 0xde09
movq %r14, %rdi
movb $0x1, %al
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x23, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
js 0x2f4b
leaq 0x10433(%rip), %rcx     # 0x13360
xorl %r15d, %r15d
xorl %edx, %edx
movq (%rcx), %rsi
xorl %edi, %edi
cmpb $0x20, (%rsi)
sete %dil
addl %edi, %edx
addq $0x8, %rcx
incl %r15d
cmpl %eax, %edx
jle 0x2f32
movslq %r15d, %r15
leaq 0x1040b(%rip), %r12     # 0x13360
movq -0x8(%r12,%r15,8), %rdx
leaq 0x1054f(%rip), %r14     # 0x134b0
leaq 0xaec3(%rip), %rsi      # 0xde2b
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movl %r15d, %eax
leaq (%r12,%rax,8), %rbp
leaq 0xae9a(%rip), %r15      # 0xde2a
movq (%rbp), %r12
cmpb $0x20, (%r12)
je 0x2fc6
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
addq $0x8, %rbp
cmpb $0x20, (%r12)
jne 0x2f90
movzbl 0x10613(%rip), %eax     # 0x135e0
cmpq $0x2, %rax
leaq 0xae59(%rip), %rcx      # 0xde31
movsbl -0x1(%rax,%rcx), %ebp
leaq 0xb051(%rip), %r15      # 0xe035
leaq 0xacff(%rip), %rax      # 0xdcea
cmovbq %rax, %r15
movq %rbx, %rdi
callq 0x2190
xorl %eax, %eax
leaq 0x18(%rsp), %r12
movq %rax, 0x8(%r12)
movq $0x2, (%r12)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x20c0
movq 0x105b6(%rip), %rdx     # 0x135d8
leaq 0x10487(%rip), %r14     # 0x134b0
leaq 0xae0b(%rip), %rsi      # 0xde3b
movq %r14, %rdi
movl %ebp, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x108da(%rip), %rcx     # 0x13930
leaq 0xae15(%rip), %rsi      # 0xde72
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
callq 0x2190
movq $0x7a120, 0x8(%r12)     # imm = 0x7A120
movl $0x1, %eax
movq %rax, (%r12)
leaq 0x18(%rsp), %r12
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x20c0
cmpb $0x2, 0x10530(%rip)     # 0x135e0
leaq 0xadd6(%rip), %rax      # 0xde8d
leaq 0xb91c(%rip), %rdx      # 0xe9da
cmovaeq %rax, %rdx
leaq 0xadc9(%rip), %rcx      # 0xde92
leaq 0xac1a(%rip), %rax      # 0xdcea
cmovaeq %rax, %rcx
movq 0x108a5(%rip), %r8      # 0x13980
leaq 0xadb3(%rip), %rsi      # 0xde95
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq 0x10885(%rip), %rcx     # 0x13988
leaq 0xadb6(%rip), %rsi      # 0xdec0
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
callq 0x2190
xorl %ebp, %ebp
movq %r12, %rax
movq %rbp, 0x8(%r12)
movl $0x1, %r12d
movq %r12, (%rax)
leaq 0x18(%rsp), %r15
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x20c0
movq 0x1046a(%rip), %rdx     # 0x135c8
leaq 0xad94(%rip), %rsi      # 0xdef9
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
callq 0x2190
movq %rbp, 0x8(%r15)
xorl %ebp, %ebp
movq %r12, (%r15)
movl $0x1, %r12d
leaq 0x18(%rsp), %r15
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x20c0
movq 0x10426(%rip), %rdx     # 0x135d8
leaq 0xad6a(%rip), %rsi      # 0xdf23
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
callq 0x2190
movq %rbp, 0x8(%r15)
movq %r12, (%r15)
leaq 0x18(%rsp), %r8
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x20c0
movq 0x10785(%rip), %rdx     # 0x13980
movq 0x1072e(%rip), %rcx     # 0x13930
leaq 0x102a7(%rip), %r14     # 0x134b0
leaq 0xad25(%rip), %rsi      # 0xdf35
movq %r14, %rdi
xorl %eax, %eax
callq 0x21a0
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
leaq 0xad37(%rip), %rsi      # 0xdf68
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movzbl 0x1039b(%rip), %r12d    # 0x135e1
cmpq $0x2, %r12
jb 0x32e3
movl $0x1, %ebp
leaq 0xad0b(%rip), %r14      # 0xdf67
leaq 0x106cd(%rip), %r15     # 0x13930
cmpq $0x7, %rbp
jne 0x3279
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
movl $0x20, %esi
callq 0x2160
movq (%r15,%rbp,8), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movzbl 0x10342(%rip), %eax     # 0x135e0
cmpq %rax, %rbp
je 0x32db
cmpb $0x3, %al
jb 0x32b4
movq %rbx, %rdi
movl $0x2c, %esi
callq 0x2160
movzbl 0x10326(%rip), %eax     # 0x135e1
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
addl %ecx, %eax
cmpq %rax, %rbp
jne 0x32db
movq %rbx, %rdi
leaq 0xac9a(%rip), %rsi      # 0xdf6b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
incq %rbp
cmpq %rbp, %r12
jne 0x3263
leaq 0xac8a(%rip), %rsi      # 0xdf74
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2210
movq %rbx, %rdi
callq 0x2190
movq (%r13), %rdi
callq 0x2300
pxor %xmm0, %xmm0
movdqa %xmm0, 0x1067c(%rip)    # 0x13990
movdqa %xmm0, 0x10684(%rip)    # 0x139a0
movdqa %xmm0, 0x1068c(%rip)    # 0x139b0
movdqa %xmm0, 0x10694(%rip)    # 0x139c0
movdqa %xmm0, 0x1069c(%rip)    # 0x139d0
movzbl 0x102a5(%rip), %r14d    # 0x135e1
testq %r14, %r14
je 0x368f
movzbl 0xfe73(%rip), %r15d     # 0x131c0
movzbl 0xfe6c(%rip), %r12d     # 0x131c1
xorl %r13d, %r13d
movdqa 0x9d00(%rip), %xmm2     # 0xd060
pshufd $0xf5, %xmm2, %xmm7     # xmm7 = xmm2[1,1,3,3]
movabsq $0x4024000000000000, %rbp # imm = 0x4024000000000000
movdqa %xmm7, (%rsp)
movl $0x128, %edi            # imm = 0x128
callq 0x20e0
leaq 0x1060b(%rip), %rcx     # 0x13990
movq %rax, (%rcx,%r13,8)
movb $-0x38, 0x18(%rax)
movdqa 0x9cbb(%rip), %xmm0     # 0xd050
movdqu %xmm0, (%rax)
testq %r15, %r15
je 0x33bc
xorl %ecx, %ecx
movq %rbp, 0x20(%rax,%rcx,8)
movq %rbp, 0x40(%rax,%rcx,8)
movw $0x0, 0xd2(%rax,%rcx,2)
incq %rcx
cmpq %rcx, %r15
jne 0x33a0
movl $0x64000a, 0xd2(%rax,%r15,2) # imm = 0x64000A
movabsq $0x4056800000000000, %rcx # imm = 0x4056800000000000
movq %rcx, 0x60(%rax)
xorps %xmm5, %xmm5
movups %xmm5, 0x68(%rax)
movabsq $0x4070e00000000000, %rcx # imm = 0x4070E00000000000
movq %rcx, 0x78(%rax)
movq $0x0, 0xc6(%rax)
movl $0x0, 0xce(%rax)
xorl %ecx, %ecx
movdqa 0x9c06(%rip), %xmm0     # 0xd010
movdqa 0x9c0e(%rip), %xmm3     # 0xd020
movdqa 0x9c26(%rip), %xmm4     # 0xd040
movdqa 0x9c3e(%rip), %xmm6     # 0xd060
movdqa (%rsp), %xmm7
movdqa %xmm0, %xmm1
pxor %xmm3, %xmm1
movdqa %xmm6, %xmm2
pcmpgtd %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pcmpeqd %xmm7, %xmm1
pand %xmm2, %xmm1
movd %xmm1, %edx
testb $0x1, %dl
je 0x3457
movw $0x0, 0x110(%rax,%rcx,2)
pextrw $0x4, %xmm1, %edx
testb $0x1, %dl
je 0x346b
movw $0x0, 0x112(%rax,%rcx,2)
addq $0x2, %rcx
paddq %xmm4, %xmm0
cmpq $0x6, %rcx
jne 0x3427
movl $0xa000c, 0x110(%rax,%r12,2) # imm = 0xA000C
movw $0xc8, 0x114(%rax,%r12,2)
movaps 0x9bd9(%rip), %xmm0     # 0xd070
movups %xmm0, 0xe0(%rax)
movups %xmm5, 0xf0(%rax)
movaps 0x9bd4(%rip), %xmm0     # 0xd080
movups %xmm0, 0x100(%rax)
movl $0x0, 0xc0(%rax)
movb $0x0, 0xc4(%rax)
movq $-0x4, %rcx
movdqa 0x9bbd(%rip), %xmm0     # 0xd090
movapd 0x9bc5(%rip), %xmm1     # 0xd0a0
movdqu %xmm0, 0xa0(%rax,%rcx,8)
movupd %xmm1, 0xc0(%rax,%rcx,8)
addq $0x2, %rcx
jne 0x34db
movw $0x15e, 0x1a(%rax)      # imm = 0x15E
incq %r13
cmpq %r14, %r13
jne 0x3374
movl $0x5, 0x104d1(%rip)     # 0x139e0
movq 0x1047a(%rip), %rax     # 0x13990
movb $-0x6, 0x18(%rax)
movw $0x1c2, 0x1a(%rax)      # imm = 0x1C2
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x8(%rax)
testq %r14, %r14
je 0x36b3
leal (,%r14,8), %r14d
xorl %r15d, %r15d
xorpd %xmm1, %xmm1
movhpd 0x9bea(%rip), %xmm1     # xmm1 = xmm1[0],mem[0]
movapd %xmm1, 0x30(%rsp)
leaq 0x10095(%rip), %rax     # 0x135f0
movq (%r15,%rax), %r13
movdqu %xmm0, (%r13)
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $-0x49f49f49, %rax, %rcx # imm = 0xB60B60B7
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x8, %ecx
addl %edx, %ecx
imull $0x168, %ecx, %ecx      # imm = 0x168
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x10(%r13)
movsd %xmm0, 0x18(%r13)
movw $0x0, 0x48(%r13)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x28(%r13)
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
sarl $0x5, %ecx
addl %edx, %ecx
imull $0x1f4, %ecx, %ecx      # imm = 0x1F4
movl %eax, %edx
subl %ecx, %edx
movl $0xffffef34, %ebp       # imm = 0xFFFFEF34
subl %edx, %ebp
negl %ecx
leal (%rax,%rcx), %r12d
addl $0x10cc, %r12d          # imm = 0x10CC
callq 0x22e0
sarl $0x3, %eax
cltq
imulq $-0x49f49f49, %rax, %rcx # imm = 0xB60B60B7
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x8, %ecx
addl %edx, %ecx
imull $0x168, %ecx, %ecx      # imm = 0x168
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x9b17(%rip), %xmm0     # 0xd140
divsd 0x9b17(%rip), %xmm0     # 0xd148
movsd %xmm0, (%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
movsd %xmm1, 0x28(%rsp)
callq 0x20f0
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x38(%r13)
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x28(%rsp)
movsd (%rsp), %xmm0
callq 0x2310
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x40(%r13)
movdqa 0x9a10(%rip), %xmm0     # 0xd090
addq $0x8, %r15
cmpq %r15, %r14
jne 0x3554
jmp 0x36b3
movb $-0x6, 0x18
movw $0x1c2, 0x1a            # imm = 0x1C2
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x8
movq 0xff36(%rip), %rax      # 0x135f0
movq $0x0, 0x30(%rax)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rax)
movabsq $0x4069000000000000, %rcx # imm = 0x4069000000000000
movq %rcx, 0x20(%rax)
movdqu %xmm0, 0x38(%rax)
movq %rbx, %rdi
callq 0x21c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq