// File: matallui[P]nibble-curses/src/CNibbles.cpp
// Function: CNibbles::Menu()
void CNibbles::Menu ( void )
{ 
  nodelay ( stdscr, false );
  
  // Mode menu
  char title[30] = "Select the Mode:\0";
  char menu[5][30] = {
			      "       Single Player       \0",
			      "  Multi-Player on same PC  \0",
			      " Multi-Player over Network \0",
			      "\0","\0"
  }; 

  int key, item;
  item = 0;
  DrawMenu ( menu, title, 3, item );
  do
  {
    key = getch();
    switch ( key )
    {
      case KEY_DOWN:
	item = (item+1) % 3;
	break;
      case KEY_UP:
	item = (item+2) % 3;
	break;
    }
    DrawMenu ( menu, title, 3, item );
  }while ( key != '\n' );
  
  switch ( item )
  {
    case 0:
      m_nplayers = 1;
      m_mode = 1;
      break;
    case 1:
      m_nplayers = 2;
      m_mode = 2;
      break;
    case 2:
      m_nplayers = 2;
      m_mode = 3;
      
      sprintf ( title, "Select the Connection:" );
      sprintf ( menu[0], "    Receive Connection     ");
      sprintf ( menu[1], "       Conncect To         ");
      item = 0; 
      DrawMenu ( menu, title, 2, item );
      do
      {
	key = getch();
	switch ( key )
	{
	  case KEY_DOWN:
	    item = (item+1) % 2;
	    break;
	  case KEY_UP:
	    item = (item+1) % 2;
	    break;
	}
	DrawMenu ( menu, title, 2, item );
      }while ( key != '\n' );
      
      int port;
      if ( item == 0 )
      {
	port = (rand()%1000) + 50000;
	sprintf ( title, "Waiting in Port: %d", port );
	DrawMenu ( menu, title, 0, item );
	m_socket = new CSocketServer;
	if ( ! m_socket->Initialize ( port, NULL ) )	throw CException( "Unable to initialize socket." );
	  
	if ( ! m_socket->EstablishConnection () )	throw CException( "Unable to establish connection." );
      }
      else
      {
	char hostname[50];
	bzero ( hostname, 50 );
	m_master = false;
	sprintf ( title, " " );
	DrawMenu ( menu, title, 0, item );
	echo();
	mvaddstr ( 12, 20, "Hostame Address: " );
	scanw ( (char*)"%s", hostname );
	mvaddstr ( 14, 20, "Insert Port: " );
	scanw ( (char*)"%d", &port );
	m_socket = new CSocketClient;
	if ( ! m_socket->Initialize ( port, hostname ) )	throw CException ( "Unable to Initialize socket." );
	if ( ! m_socket->EstablishConnection() )		throw CException ( "Unable to establish connection." );
      }
  }

  if ( m_master )
  {
    // Difficulty menu
    sprintf ( title, "Select the Difficulty:" );
    sprintf ( menu[0], "         Beginner          ");
    sprintf ( menu[1], "           Easy            ");
    sprintf ( menu[2], "          Normal           ");
    sprintf ( menu[3], "           Hard            ");
    sprintf ( menu[4], "          Expert           ");
    
    item = 0;
    DrawMenu ( menu, title, 5, item );
    do
    {
      key = getch();
      switch ( key )
      {
	case KEY_DOWN:
	  item = (item+1) % 5;
	  break;
	case KEY_UP:
	  item = (item+4) % 5;
	  break;
      }
      DrawMenu ( menu, title, 5, item );
    }while ( key != '\n' );
    
    switch ( item )
    {
      case 0:
	m_speed = 135000; 
	break;
      case 1:
	m_speed = 115000;
	break;
      case 2:
	m_speed = 90000;
      case 3:
	m_speed = 65000;
	break;
      case 4:
	m_speed = 50000;
	break;
    }
  }
  else
  {
    sprintf ( title, "Wait for Start ..." );
      DrawMenu ( menu, title, 0, item );
  }

  // allocate player snake(s) according to mode
  switch ( m_mode )
  {
    case 1:
      m_snakes[0] = new CSingle;
      break;
    case 2:
      m_snakes[0] = new CMultPC (1);
      m_snakes[1] = new CMultPC (2);
      break;
    case 3:
      m_snakes[0] = new CMultNet ( 1, m_socket, m_master );
      m_snakes[1] = new CMultNet ( 2, m_socket, !m_master );
      
      char buffer[3];
      bzero ( buffer, 3 );
      
      if ( m_master )
      {
	if ( ! m_socket->Send ( (char*) &m_speed, sizeof(m_speed) ) )		throw CException( "Problems with communication." );
	if ( ! m_socket->Recv ( buffer, 3 ) )					throw CException( "Problems with communication." );
	if ( buffer[0] != 'O' || buffer[1] != 'K' )				throw CException( "Problems with communication." );
      }
      else
      {
	if ( ! m_socket->Recv ( (char*) &m_speed, sizeof(m_speed) ) )		throw CException( "Problems with communication." );
	sprintf ( buffer, "OK" );
	if ( m_speed >= 50000 && m_speed <= 135000 )
	  m_socket->Send ( buffer, 3 );
	else
	  throw CException( "Problems with communication." );
      }
  }
  
  noecho();
  nodelay ( stdscr, true );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq 0x97af(%rip), %rax      # 0xffd0
movq (%rax), %rdi
xorl %esi, %esi
callq 0x31c0
movq 0x5a6e(%rip), %rax      # 0xc2a0
movq %rax, -0x30(%rbp)
movq 0x5a6b(%rip), %rax      # 0xc2a8
movq %rax, -0x28(%rbp)
movq 0x5a68(%rip), %rax      # 0xc2b0
movq %rax, -0x20(%rbp)
movl 0x5a66(%rip), %eax      # 0xc2b8
movl %eax, -0x18(%rbp)
movw 0x5a60(%rip), %ax       # 0xc2bc
movw %ax, -0x14(%rbp)
leaq -0xd0(%rbp), %rdi
leaq 0x5a52(%rip), %rsi      # 0xc2c0
movl $0x96, %edx
callq 0x3250
movq -0x2c8(%rbp), %rdi
movl $0x0, -0xd8(%rbp)
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x3, -0xdc(%rbp)
leaq -0xdc(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
movq 0x9718(%rip), %rax      # 0xffd0
movq (%rax), %rdi
callq 0x3130
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x2cc(%rbp)
subl $0x102, %eax            # imm = 0x102
je 0x68ea
jmp 0x68db
movl -0x2cc(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
je 0x6903
jmp 0x691a
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0xd8(%rbp)
jmp 0x691a
movl -0xd8(%rbp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0xd8(%rbp)
movq -0x2c8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x3, -0xe0(%rbp)
leaq -0xe0(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
cmpl $0xa, -0xd4(%rbp)
jne 0x68b1
movl -0xd8(%rbp), %eax
movl %eax, -0x2d0(%rbp)
testl %eax, %eax
je 0x6985
jmp 0x6968
movl -0x2d0(%rbp), %eax
subl $0x1, %eax
je 0x699f
jmp 0x6975
movl -0x2d0(%rbp), %eax
subl $0x2, %eax
je 0x69b9
jmp 0x711d
movq -0x2c8(%rbp), %rax
movl $0x1, 0x10(%rax)
movl $0x1, 0x14(%rax)
jmp 0x711d
movq -0x2c8(%rbp), %rax
movl $0x2, 0x10(%rax)
movl $0x2, 0x14(%rax)
jmp 0x711d
movq -0x2c8(%rbp), %rax
movl $0x2, 0x10(%rax)
movl $0x3, 0x14(%rax)
leaq -0x30(%rbp), %rdi
leaq 0x59ac(%rip), %rsi      # 0xc385
movb $0x0, %al
callq 0x3090
leaq -0xd0(%rbp), %rdi
leaq 0x59ae(%rip), %rsi      # 0xc39c
movb $0x0, %al
callq 0x3090
leaq -0xd0(%rbp), %rdi
addq $0x1e, %rdi
leaq 0x59b1(%rip), %rsi      # 0xc3b8
movb $0x0, %al
callq 0x3090
movq -0x2c8(%rbp), %rdi
movl $0x0, -0xd8(%rbp)
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x2, -0xe4(%rbp)
leaq -0xe4(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
movq 0x9582(%rip), %rax      # 0xffd0
movq (%rax), %rdi
callq 0x3130
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x2d4(%rbp)
subl $0x102, %eax            # imm = 0x102
je 0x6a80
jmp 0x6a71
movl -0x2d4(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
je 0x6a99
jmp 0x6ab0
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0xd8(%rbp)
jmp 0x6ab0
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0xd8(%rbp)
movq -0x2c8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x2, -0xe8(%rbp)
leaq -0xe8(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
cmpl $0xa, -0xd4(%rbp)
jne 0x6a47
cmpl $0x0, -0xd8(%rbp)
jne 0x6dcc
callq 0x30c0
movl %eax, %ecx
movslq %ecx, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rax
addl %edx, %eax
imull $0x3e8, %eax, %edx      # imm = 0x3E8
movl %ecx, %eax
negl %edx
movl %edx, %ecx
leal 0xc350(%rax,%rcx), %eax
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %edx
leaq 0x5897(%rip), %rsi      # 0xc3d4
xorl %eax, %eax
leaq -0x30(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x3090
movq -0x2c8(%rbp), %rdi
movq -0x2e8(%rbp), %rdx
movl $0x0, -0xf0(%rbp)
leaq -0xd0(%rbp), %rsi
leaq -0xf0(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
movl $0x40, %edi
callq 0x32d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2e0(%rbp)
callq 0x5dc0
jmp 0x6b9f
movq -0x2c8(%rbp), %rax
movq -0x2e0(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq 0x48(%rax), %rdi
movq (%rdi), %rax
leaq -0xec(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *0x10(%rax)
testb $0x1, %al
jne 0x6cd2
movb $0x1, -0x122(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x2f8(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x34f0
movq -0x2f0(%rbp), %rdx
leaq 0x57e1(%rip), %rsi      # 0xc3e8
leaq -0x120(%rbp), %rdi
callq 0x3880
jmp 0x6c15
movq -0x2f8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x3770
jmp 0x6c2a
movq -0x2f8(%rbp), %rdi
movb $0x0, -0x122(%rbp)
leaq 0x9131(%rip), %rsi      # 0xfd70
leaq 0x4fea(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq -0x2e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x40, %esi
callq 0x32f0
jmp 0x7b7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x6caa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x31d0
leaq -0x121(%rbp), %rdi
callq 0x3340
testb $0x1, -0x122(%rbp)
jne 0x6cc1
jmp 0x6ccd
movq -0x2f8(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
movq -0x2c8(%rbp), %rax
movq 0x48(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb $0x1, %al
jne 0x6dc7
movb $0x1, -0x14a(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x308(%rbp)
leaq -0x149(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x34f0
movq -0x300(%rbp), %rdx
leaq 0x56e1(%rip), %rsi      # 0xc405
leaq -0x148(%rbp), %rdi
callq 0x3880
jmp 0x6d32
movq -0x308(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x3770
jmp 0x6d47
movq -0x308(%rbp), %rdi
movb $0x0, -0x14a(%rbp)
leaq 0x9014(%rip), %rsi      # 0xfd70
leaq 0x4ecd(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x6d9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x31d0
leaq -0x149(%rbp), %rdi
callq 0x3340
testb $0x1, -0x14a(%rbp)
jne 0x6db6
jmp 0x6dc2
movq -0x308(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
jmp 0x711b
leaq -0x180(%rbp), %rdi
xorl %esi, %esi
movl $0x32, %edx
callq 0x31b0
movq -0x2c8(%rbp), %rax
movb $0x0, 0x18(%rax)
leaq -0x30(%rbp), %rdi
leaq 0x56f5(%rip), %rsi      # 0xc4ea
movb $0x0, %al
callq 0x3090
movq -0x2c8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x0, -0x184(%rbp)
leaq -0x184(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
callq 0x3100
movq 0x9199(%rip), %rax      # 0xffd0
movq (%rax), %rdi
movl $0xc, %esi
movl $0x14, %edx
callq 0x3300
cmpl $-0x1, %eax
jne 0x6e50
jmp 0x6e6b
movq 0x9179(%rip), %rax      # 0xffd0
movq (%rax), %rdi
leaq 0x55c4(%rip), %rsi      # 0xc425
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3110
leaq -0x180(%rbp), %rsi
leaq 0x55be(%rip), %rdi      # 0xc437
movb $0x0, %al
callq 0x31e0
movq 0x9149(%rip), %rax      # 0xffd0
movq (%rax), %rdi
movl $0xe, %esi
movl $0x14, %edx
callq 0x3300
cmpl $-0x1, %eax
jne 0x6ea0
jmp 0x6ebb
movq 0x9129(%rip), %rax      # 0xffd0
movq (%rax), %rdi
leaq 0x5589(%rip), %rsi      # 0xc43a
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3110
leaq 0x5523(%rip), %rdi      # 0xc3e5
xorl %eax, %eax
leaq -0xec(%rbp), %rsi
callq 0x31e0
movl $0x30, %edi
callq 0x32d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x310(%rbp)
callq 0x5fa0
jmp 0x6eee
movq -0x2c8(%rbp), %rax
movq -0x310(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq 0x48(%rax), %rdi
leaq -0x180(%rbp), %rdx
movq (%rdi), %rax
leaq -0xec(%rbp), %rsi
callq *0x10(%rax)
testb $0x1, %al
jne 0x7024
movb $0x1, -0x1aa(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x320(%rbp)
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x34f0
movq -0x318(%rbp), %rdx
leaq 0x54ef(%rip), %rsi      # 0xc448
leaq -0x1a8(%rbp), %rdi
callq 0x3880
jmp 0x6f67
movq -0x320(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x3770
jmp 0x6f7c
movq -0x320(%rbp), %rdi
movb $0x0, -0x1aa(%rbp)
leaq 0x8ddf(%rip), %rsi      # 0xfd70
leaq 0x4c98(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq -0x310(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x30, %esi
callq 0x32f0
jmp 0x7b7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x6ffc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x31d0
leaq -0x1a9(%rbp), %rdi
callq 0x3340
testb $0x1, -0x1aa(%rbp)
jne 0x7013
jmp 0x701f
movq -0x320(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
movq -0x2c8(%rbp), %rax
movq 0x48(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb $0x1, %al
jne 0x7119
movb $0x1, -0x1d2(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x330(%rbp)
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x34f0
movq -0x328(%rbp), %rdx
leaq 0x538f(%rip), %rsi      # 0xc405
leaq -0x1d0(%rbp), %rdi
callq 0x3880
jmp 0x7084
movq -0x330(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x3770
jmp 0x7099
movq -0x330(%rbp), %rdi
movb $0x0, -0x1d2(%rbp)
leaq 0x8cc2(%rip), %rsi      # 0xfd70
leaq 0x4b7b(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x70f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x31d0
leaq -0x1d1(%rbp), %rdi
callq 0x3340
testb $0x1, -0x1d2(%rbp)
jne 0x7108
jmp 0x7114
movq -0x330(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
jmp 0x711b
jmp 0x711d
movq -0x2c8(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x730f
leaq -0x30(%rbp), %rdi
leaq 0x532c(%rip), %rsi      # 0xc465
movb $0x0, %al
callq 0x3090
leaq -0xd0(%rbp), %rdi
leaq 0x532e(%rip), %rsi      # 0xc47c
movb $0x0, %al
callq 0x3090
leaq -0xd0(%rbp), %rdi
addq $0x1e, %rdi
leaq 0x5331(%rip), %rsi      # 0xc498
movb $0x0, %al
callq 0x3090
leaq -0xd0(%rbp), %rdi
addq $0x3c, %rdi
leaq 0x5334(%rip), %rsi      # 0xc4b4
movb $0x0, %al
callq 0x3090
leaq -0xd0(%rbp), %rdi
addq $0x5a, %rdi
leaq 0x5337(%rip), %rsi      # 0xc4d0
movb $0x0, %al
callq 0x3090
leaq -0xd0(%rbp), %rdi
addq $0x78, %rdi
leaq 0x533a(%rip), %rsi      # 0xc4ec
movb $0x0, %al
callq 0x3090
movq -0x2c8(%rbp), %rdi
movl $0x0, -0xd8(%rbp)
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x5, -0x1d8(%rbp)
leaq -0x1d8(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
movq 0x8dd7(%rip), %rax      # 0xffd0
movq (%rax), %rdi
callq 0x3130
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x334(%rbp)
subl $0x102, %eax            # imm = 0x102
je 0x722b
jmp 0x721c
movl -0x334(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
je 0x7244
jmp 0x725b
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl $0x5, %ecx
cltd
idivl %ecx
movl %edx, -0xd8(%rbp)
jmp 0x725b
movl -0xd8(%rbp), %eax
addl $0x4, %eax
movl $0x5, %ecx
cltd
idivl %ecx
movl %edx, -0xd8(%rbp)
movq -0x2c8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x5, -0x1dc(%rbp)
leaq -0x1dc(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
cmpl $0xa, -0xd4(%rbp)
jne 0x71f2
movl -0xd8(%rbp), %eax
movq %rax, -0x340(%rbp)
subq $0x4, %rax
ja 0x730d
movq -0x340(%rbp), %rax
leaq 0x4fa8(%rip), %rcx      # 0xc260
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x2c8(%rbp), %rax
movl $0x20f58, 0x1c(%rax)    # imm = 0x20F58
jmp 0x730d
movq -0x2c8(%rbp), %rax
movl $0x1c138, 0x1c(%rax)    # imm = 0x1C138
jmp 0x730d
movq -0x2c8(%rbp), %rax
movl $0x15f90, 0x1c(%rax)    # imm = 0x15F90
movq -0x2c8(%rbp), %rax
movl $0xfde8, 0x1c(%rax)     # imm = 0xFDE8
jmp 0x730d
movq -0x2c8(%rbp), %rax
movl $0xc350, 0x1c(%rax)     # imm = 0xC350
jmp 0x7350
leaq -0x30(%rbp), %rdi
leaq 0x51ee(%rip), %rsi      # 0xc508
movb $0x0, %al
callq 0x3090
movq -0x2c8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x0, -0x1e0(%rbp)
leaq -0x1e0(%rbp), %rcx
leaq -0xd8(%rbp), %r8
callq 0xa1a0
movq -0x2c8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x344(%rbp)
subl $0x1, %eax
je 0x7388
jmp 0x7367
movl -0x344(%rbp), %eax
subl $0x2, %eax
je 0x73e8
jmp 0x7374
movl -0x344(%rbp), %eax
subl $0x3, %eax
je 0x74c6
jmp 0x7b58
movl $0x38, %edi
callq 0x32d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x350(%rbp)
callq 0x45e0
jmp 0x73a6
movq -0x350(%rbp), %rcx
movq -0x2c8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
jmp 0x7b58
movq -0x350(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x38, %esi
callq 0x32f0
jmp 0x7b7a
movl $0x40, %edi
callq 0x32d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x358(%rbp)
movl $0x1, -0x1e4(%rbp)
leaq -0x1e4(%rbp), %rsi
callq 0x4e20
jmp 0x7417
movq -0x358(%rbp), %rcx
movq -0x2c8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movl $0x40, %edi
callq 0x32d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x360(%rbp)
movl $0x2, -0x1e8(%rbp)
leaq -0x1e8(%rbp), %rsi
callq 0x4e20
jmp 0x745b
movq -0x360(%rbp), %rcx
movq -0x2c8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x7b58
movq -0x358(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x40, %esi
callq 0x32f0
jmp 0x7b7a
movq -0x360(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x40, %esi
callq 0x32f0
jmp 0x7b7a
movl $0x48, %edi
callq 0x32d0
movq -0x2c8(%rbp), %rcx
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x368(%rbp)
movl $0x1, -0x1ec(%rbp)
movq 0x48(%rcx), %rdx
addq $0x18, %rcx
leaq -0x1ec(%rbp), %rsi
callq 0x59d0
jmp 0x7504
movq -0x2c8(%rbp), %rax
movq -0x368(%rbp), %rcx
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movl $0x48, %edi
callq 0x32d0
movq %rax, %rdi
movq -0x2c8(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x370(%rbp)
movl $0x2, -0x1f0(%rbp)
movq 0x48(%rax), %rdx
movb 0x18(%rax), %al
notb %al
andb $0x1, %al
movb %al, -0x1f1(%rbp)
leaq -0x1f0(%rbp), %rsi
leaq -0x1f1(%rbp), %rcx
callq 0x59d0
jmp 0x7567
movq -0x2c8(%rbp), %rax
movq -0x370(%rbp), %rcx
movq 0x30(%rax), %rax
movq %rcx, 0x8(%rax)
leaq -0x1f4(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x31b0
movq -0x2c8(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x790b
movq -0x2c8(%rbp), %rsi
movq 0x48(%rsi), %rdi
addq $0x1c, %rsi
movl $0x4, -0x1f8(%rbp)
movq (%rdi), %rax
leaq -0x1f8(%rbp), %rdx
callq *0x20(%rax)
xorb $-0x1, %al
testb $0x1, %al
jne 0x75d2
jmp 0x76fe
movb $0x1, -0x21a(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x380(%rbp)
leaq -0x219(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x34f0
movq -0x378(%rbp), %rdx
leaq 0x4f10(%rip), %rsi      # 0xc51b
leaq -0x218(%rbp), %rdi
callq 0x3880
jmp 0x7619
movq -0x380(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x3770
jmp 0x762e
movq -0x380(%rbp), %rdi
movb $0x0, -0x21a(%rbp)
leaq 0x872d(%rip), %rsi      # 0xfd70
leaq 0x45e6(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq -0x368(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x48, %esi
callq 0x32f0
jmp 0x7b7a
movq -0x370(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x48, %esi
callq 0x32f0
jmp 0x7b7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x76d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x31d0
leaq -0x219(%rbp), %rdi
callq 0x3340
testb $0x1, -0x21a(%rbp)
jne 0x76ed
jmp 0x76f9
movq -0x380(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
movq -0x2c8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq -0x1f4(%rbp), %rsi
movl $0x3, -0x220(%rbp)
movq (%rdi), %rax
leaq -0x220(%rbp), %rdx
callq *0x28(%rax)
xorb $-0x1, %al
testb $0x1, %al
jne 0x7732
jmp 0x780e
movb $0x1, -0x242(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x390(%rbp)
leaq -0x241(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x34f0
movq -0x388(%rbp), %rdx
leaq 0x4db0(%rip), %rsi      # 0xc51b
leaq -0x240(%rbp), %rdi
callq 0x3880
jmp 0x7779
movq -0x390(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x3770
jmp 0x778e
movq -0x390(%rbp), %rdi
movb $0x0, -0x242(%rbp)
leaq 0x85cd(%rip), %rsi      # 0xfd70
leaq 0x4486(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x77e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x31d0
leaq -0x241(%rbp), %rdi
callq 0x3340
testb $0x1, -0x242(%rbp)
jne 0x77fd
jmp 0x7809
movq -0x390(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
movsbl -0x1f4(%rbp), %eax
cmpl $0x4f, %eax
jne 0x782a
movsbl -0x1f3(%rbp), %eax
cmpl $0x4b, %eax
je 0x7906
movb $0x1, -0x26a(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x3a0(%rbp)
leaq -0x269(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x34f0
movq -0x398(%rbp), %rdx
leaq 0x4cb8(%rip), %rsi      # 0xc51b
leaq -0x268(%rbp), %rdi
callq 0x3880
jmp 0x7871
movq -0x3a0(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x3770
jmp 0x7886
movq -0x3a0(%rbp), %rdi
movb $0x0, -0x26a(%rbp)
leaq 0x84d5(%rip), %rsi      # 0xfd70
leaq 0x438e(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x78de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x31d0
leaq -0x269(%rbp), %rdi
callq 0x3340
testb $0x1, -0x26a(%rbp)
jne 0x78f5
jmp 0x7901
movq -0x3a0(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
jmp 0x7b56
movq -0x2c8(%rbp), %rsi
movq 0x48(%rsi), %rdi
addq $0x1c, %rsi
movl $0x4, -0x270(%rbp)
movq (%rdi), %rax
leaq -0x270(%rbp), %rdx
callq *0x28(%rax)
xorb $-0x1, %al
testb $0x1, %al
jne 0x793c
jmp 0x7a18
movb $0x1, -0x292(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x3b0(%rbp)
leaq -0x291(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x34f0
movq -0x3a8(%rbp), %rdx
leaq 0x4ba6(%rip), %rsi      # 0xc51b
leaq -0x290(%rbp), %rdi
callq 0x3880
jmp 0x7983
movq -0x3b0(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x3770
jmp 0x7998
movq -0x3b0(%rbp), %rdi
movb $0x0, -0x292(%rbp)
leaq 0x83c3(%rip), %rsi      # 0xfd70
leaq 0x427c(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x79f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x31d0
leaq -0x291(%rbp), %rdi
callq 0x3340
testb $0x1, -0x292(%rbp)
jne 0x7a07
jmp 0x7a13
movq -0x3b0(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
leaq -0x1f4(%rbp), %rdi
leaq 0x4808(%rip), %rsi      # 0xc22e
movb $0x0, %al
callq 0x3090
movq -0x2c8(%rbp), %rax
cmpl $0xc350, 0x1c(%rax)     # imm = 0xC350
jl 0x7a7b
movq -0x2c8(%rbp), %rax
cmpl $0x20f58, 0x1c(%rax)    # imm = 0x20F58
jg 0x7a7b
movq -0x2c8(%rbp), %rax
movq 0x48(%rax), %rdi
leaq -0x1f4(%rbp), %rsi
movl $0x3, -0x298(%rbp)
movq (%rdi), %rax
leaq -0x298(%rbp), %rdx
callq *0x20(%rax)
jmp 0x7b54
movb $0x1, -0x2ba(%rbp)
movl $0x20, %edi
callq 0x31a0
movq %rax, -0x3c0(%rbp)
leaq -0x2b9(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x34f0
movq -0x3b8(%rbp), %rdx
leaq 0x4a67(%rip), %rsi      # 0xc51b
leaq -0x2b8(%rbp), %rdi
callq 0x3880
jmp 0x7ac2
movq -0x3c0(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x3770
jmp 0x7ad7
movq -0x3c0(%rbp), %rdi
movb $0x0, -0x2ba(%rbp)
leaq 0x8284(%rip), %rsi      # 0xfd70
leaq 0x413d(%rip), %rdx      # 0xbc30
callq 0x34d0
jmp 0x7b86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x7b2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x31d0
leaq -0x2b9(%rbp), %rdi
callq 0x3340
testb $0x1, -0x2ba(%rbp)
jne 0x7b46
jmp 0x7b52
movq -0x3c0(%rbp), %rdi
callq 0x3220
jmp 0x7b7a
jmp 0x7b56
jmp 0x7b58
callq 0x33a0
movq 0x846c(%rip), %rax      # 0xffd0
movq (%rax), %rdi
movl $0x1, %esi
callq 0x31c0
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
movq -0xf8(%rbp), %rdi
callq 0x34e0
nopw %cs:(%rax,%rax)