// File: nompelis[P]INTecplotLib/intecplot.cpp
// Function: inTec_Zone::ManageInternals()
int inTec_Zone::ManageInternals( void )
{
#ifdef _DEBUG_
   printf(" i Inside ManageInternals() \n");
#endif
   int ierror=0,iret=0;

   // processing individual keywords
   const char *string=NULL,*string2=NULL;
   size_t is;
   int i=0;
   std::map< std::string, std::string > :: iterator imap;
   for( imap = keywords.begin(); imap != keywords.end(); ++imap ) {
      printf("   %d  ", i++ );
      string = (*imap).first.c_str();
      printf("   %s  ", string );
      string2 = (*imap).second.c_str();
      printf("   \"%s\"\n", string2 );

      // keywords by size
      is = strlen( string );

      if( is == 1 ) {
         if( strncasecmp( string, "N", 1 ) == 0 ) {
            iold_n = (unsigned long) atol( string2 );
         }

         if( strncasecmp( string, "E", 1 ) == 0 ) {
            iold_e = (unsigned long) atol( string2 );
         }

         if( strncasecmp( string, "I", 1 ) == 0 ) {
            im = (unsigned long) atol( string2 );
         }
         if( strncasecmp( string, "J", 1 ) == 0 ) {
            jm = (unsigned long) atol( string2 );
         }
         if( strncasecmp( string, "K", 1 ) == 0 ) {
            km = (unsigned long) atol( string2 );
         }
         if( strncasecmp( string, "T", 1 ) == 0 ) {
            iret = HandleKeyword_T( string2 );
            if( iret != 0 ) ierror += 1;
         }
         if( strncasecmp( string, "F", 1 ) == 0 ) {
         // will deal with this later...
         // iret = HandleKeyword_F( string2 );
            if( iret != 0 ) ierror += 1;
         }
      }

      if( is == 2 ) {
         if( strncasecmp( string, "DT", 2 ) == 0 ) {
            // will do this later...
         }

         if( strncasecmp( string, "ET", 2 ) == 0 ) {
            iret = HandleKeyword_ET( string2 );
            if( iret != 0 ) ierror += 1;
         }

         if( strncasecmp( string, "NV", 2 ) == 0 ) {
            // will do this later...
         }

      }

      if( is == 5 ) {
         if( strncasecmp( string, "NODES", 5 ) == 0 ) {
            nodes = (unsigned long) atol( string2 );
         }

      }

      if( is == 8 ) {
         if( strncasecmp( string, "ELEMENTS", 8 ) == 0 ) {
            elems = (unsigned long) atol( string2 );
         }

         if( strncasecmp( string, "ZONETYPE", 8 ) == 0 ) {
            iret = HandleKeyword_Zonetype( string2 );
            if( iret != 0 ) ierror += 1;
         }
      }

      if( is == 10 ) {
         if( strncasecmp( string, "PARENTZONE", 10 ) == 0 ) {
            parent_zone = atoi( string2 );
         }
      }

      if( is == 11 ) {
         if( strncasecmp( string, "VARLOCATION", 11 ) == 0 ) {
            iret = HandleKeyword_Varlocation( string2 );
            if( iret != 0 ) ierror += 1;
         }
         if( strncasecmp( string, "DATAPACKING", 11 ) == 0 ) {
            iret = HandleKeyword_Datapacking( string2 );
            if( iret != 0 ) ierror += 1;
         }

      }

      if( is == 12 ) {
         if( strncasecmp( string, "VARSHARELIST", 12 ) == 0 ) {
            iret = HandleKeyword_Varsharelist( string2 );
            if( iret != 0 ) ierror += 1;
         }
      }

   }

   // sanity checks for the zone's collected keywords
   ierror += ConsistencyCheck();

   // final error check
   if( ierror != 0 ) {
      iret = 1;
#ifdef _DEBUG_
      printf(" e Exiting ManageInternals() in error (return %d) \n",iret);
#endif
      return( iret );
   }

   //
   // allocate memory for variables
   //

   // get a vertex and cell count
   size_t iv=0,ie=0;

   // first try the ordered zone sizes
   if( ietype == ORDERED ) {
      unsigned long imt,jmt,kmt;
#ifdef _DEBUG_
      printf(" i Internal var. \"ietype\" indicates it is an ORDERED zone \n");
#endif
      if( im - 1 == 0 ) { imt = 2; } else { imt = im; }
      if( jm - 1 == 0 ) { jmt = 2; } else { jmt = jm; }
      if( km - 1 == 0 ) { kmt = 2; } else { kmt = km; }

      if( jm > 0 ) {
         if( km > 0 ) {
            iv = (size_t) (im*jm*km);
            ie = (size_t) ((imt-1)*(jmt-1)*(kmt-1));
         } else {
            iv = (size_t) (im*jm);
            ie = (size_t) ((imt-1)*(jmt-1));
         }
      } else {
         iv = (size_t) im;
         ie = (size_t) (imt-1);
      }
   }

   // then try the unstruct. zone sizes
   if( ietype != ORDERED ) {
#ifdef _DEBUG_
      printf(" i Internal var. \"ietype\" indicates it is an unstr. zone \n");
#endif
      iv = (size_t) nodes;
      ie = (size_t) elems;
   }

#ifdef _DEBUG_
   printf(" i Number of vertices  %ld, elements  %ld \n",
          (unsigned long) iv, (unsigned long) ie );
#endif

   // sanity check
   if( iv <= 0 || ie <= 0 ) {
      printf(" e Cannot have zero nodes or zero elements \n");
      iret = 1;
#ifdef _DEBUG_
      printf(" e Exiting ManageInternals() in error (return %d) \n",iret);
#endif
      return( iret );
   }

   // allocate memory for data arrays
   for(int n=1;n<=num_var;++n) {
      if( ivar_loc[n] == 1 ) {
         double *p = (double *) malloc(iv*sizeof(double));
         var_vec.push_back( p );
         if( p == NULL ) ierror += 1;
#ifdef _DEBUG_
         printf(" --- Vertex-data pointer at %p \n", p );
#endif
      } else if( ivar_loc[n] == 2 ) {
         double *p = (double *) malloc(ie*sizeof(double));
         var_vec.push_back( p );
         if( p == NULL ) ierror += 1;
#ifdef _DEBUG_
         printf(" --- Cell-data pointer at %p \n", p );
#endif
      } else {
         // allow for the provision to skip allocating memory for a variable
      }
   }

   // allocate memory for connectivity if needed
   if( ietype != ORDERED ) {
      if( ietype == FETRIANGLE ) ncon = 3;
      if( ietype == FEQUADRILATERAL) ncon = 4;
      if( ietype == FETETRAHEDRON) ncon = 4;
      if( ietype == FEBRICK) ncon = 8;

      size_t isize = (size_t) (elems*ncon);
      if( icon == NULL ) {
         icon = (unsigned long *) malloc(isize*sizeof(unsigned long));
      }
      if( icon == NULL ) ierror += 1;
   }

   // drop all memory on any allocation error
   if( ierror != 0 ) {
#ifdef _DEBUG_
      printf(" e There was an allocation error!\n");
#endif
      if( icon != NULL ) free( icon );

      std::vector< double * > :: iterator dpi;
      for( dpi = var_vec.begin() ; dpi != var_vec.end() ; ++dpi ) {
         if( (*dpi) != NULL ) {
#ifdef _DEBUG_
            printf(" --- Freeing memory at: %p \n", (*dpi) );
#endif
            free( (*dpi) );
         }
      }
      var_vec.clear();

      iret = 1;
#ifdef _DEBUG_
      printf(" e Exiting ManageInternals() in error (return %d) \n",iret);
#endif
   } else {
      istate = 2;    // implies a state of reading numerical values
   }

/*
   // set certain internal counters for numeric data reading (later)
   var_no_cnt = 0;
   var_cc_cnt = 0;
   for(int n=1;n<=num_var;++n) {
      if( ivar_loc[n] == 1 ) {
         var_no_cnt += 1;
      } else if( ivar_loc[n] == 2 ) {
         var_cc_cnt += 1;
      } else {
         // I have not thought about this one...
      }
   }
*///HACK

#ifdef _DEBUG_
   printf(" i Exiting ManageInternals() (return %d) \n",iret);
#endif
//printf("EXITING PREMATURELY IN MANAGE...\n");exit(1);//HACK
   return( iret );
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, (%rsp)
leaq 0x1264d(%rip), %rdi     # 0x284bf
movb $0x0, %al
callq 0x13070
movl $0x0, 0xa4(%rsp)
movl $0x0, 0xa0(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0x90(%rsp)
movl $0x0, 0x84(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x13660
movq (%rsp), %rdi
addq $0xe8, %rdi
callq 0x14600
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x78(%rsp)
movq (%rsp), %rdi
addq $0xe8, %rdi
callq 0x13980
movq %rax, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x13d70
testb $0x1, %al
jne 0x15f08
jmp 0x1643f
movl 0x84(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
leaq 0x12171(%rip), %rdi     # 0x28093
movb $0x0, %al
callq 0x13070
leaq 0x78(%rsp), %rdi
callq 0x13c00
movq %rax, %rdi
callq 0x134f0
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rsi
leaq 0x1258b(%rip), %rdi     # 0x284dd
movb $0x0, %al
callq 0x13070
leaq 0x78(%rsp), %rdi
callq 0x13c00
movq %rax, %rdi
addq $0x20, %rdi
callq 0x134f0
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rsi
leaq 0x1255f(%rip), %rdi     # 0x284e5
movb $0x0, %al
callq 0x13070
movq 0x98(%rsp), %rdi
callq 0x13540
movq %rax, 0x88(%rsp)
cmpq $0x1, 0x88(%rsp)
jne 0x16155
movq 0x98(%rsp), %rdi
leaq 0x12964(%rip), %rsi     # 0x28924
movl $0x1, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x15fea
movq 0x90(%rsp), %rdi
callq 0x143c0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0xb0(%rax)
movq 0x98(%rsp), %rdi
leaq 0x12936(%rip), %rsi     # 0x2892f
movl $0x1, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16023
movq 0x90(%rsp), %rdi
callq 0x143c0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0xb8(%rax)
movq 0x98(%rsp), %rdi
leaq 0x1245f(%rip), %rsi     # 0x28491
movl $0x1, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16059
movq 0x90(%rsp), %rdi
callq 0x143c0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x98(%rsp), %rdi
leaq 0x1242b(%rip), %rsi     # 0x28493
movl $0x1, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x1608f
movq 0x90(%rsp), %rdi
callq 0x143c0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x98(%rsp), %rdi
leaq 0x12872(%rip), %rsi     # 0x28910
movl $0x1, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x160c5
movq 0x90(%rsp), %rdi
callq 0x143c0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x98(%rsp), %rdi
leaq 0x12098(%rip), %rsi     # 0x2816c
movl $0x1, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16118
movq (%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x14590
movl %eax, 0xa0(%rsp)
cmpl $0x0, 0xa0(%rsp)
je 0x16116
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x16118
movq 0x98(%rsp), %rdi
leaq 0x1236e(%rip), %rsi     # 0x28495
movl $0x1, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16153
cmpl $0x0, 0xa0(%rsp)
je 0x16151
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x16153
jmp 0x16155
cmpq $0x2, 0x88(%rsp)
jne 0x161f9
movq 0x98(%rsp), %rdi
leaq 0x11ff8(%rip), %rsi     # 0x2816b
movl $0x2, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16184
jmp 0x16184
movq 0x98(%rsp), %rdi
leaq 0x12304(%rip), %rsi     # 0x28497
movl $0x2, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x161d7
movq (%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x15030
movl %eax, 0xa0(%rsp)
cmpl $0x0, 0xa0(%rsp)
je 0x161d5
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x161d7
movq 0x98(%rsp), %rdi
leaq 0x122b4(%rip), %rsi     # 0x2849a
movl $0x2, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x161f7
jmp 0x161f7
jmp 0x161f9
cmpq $0x5, 0x88(%rsp)
jne 0x1623c
movq 0x98(%rsp), %rdi
leaq 0x1228a(%rip), %rsi     # 0x2849d
movl $0x5, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x1623a
movq 0x90(%rsp), %rdi
callq 0x143c0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x48(%rax)
jmp 0x1623c
cmpq $0x8, 0x88(%rsp)
jne 0x162d6
movq 0x98(%rsp), %rdi
leaq 0x1224f(%rip), %rsi     # 0x284a9
movl $0x8, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16281
movq 0x90(%rsp), %rdi
callq 0x143c0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x98(%rsp), %rdi
leaq 0x11ecb(%rip), %rsi     # 0x2815b
movl $0x8, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x162d4
movq (%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x14030
movl %eax, 0xa0(%rsp)
cmpl $0x0, 0xa0(%rsp)
je 0x162d2
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x162d4
jmp 0x162d6
cmpq $0xa, 0x88(%rsp)
jne 0x16317
movq 0x98(%rsp), %rdi
leaq 0x121fe(%rip), %rsi     # 0x284ee
movl $0xa, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16315
movq 0x90(%rsp), %rdi
callq 0x149b0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x24(%rax)
jmp 0x16317
cmpq $0xb, 0x88(%rsp)
jne 0x163ce
movq 0x98(%rsp), %rdi
leaq 0x11e53(%rip), %rsi     # 0x28188
movl $0xb, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x16379
movq (%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x144f0
movl %eax, 0xa0(%rsp)
cmpl $0x0, 0xa0(%rsp)
je 0x16377
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x16379
movq 0x98(%rsp), %rdi
leaq 0x11dec(%rip), %rsi     # 0x28174
movl $0xb, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x163cc
movq (%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x13340
movl %eax, 0xa0(%rsp)
cmpl $0x0, 0xa0(%rsp)
je 0x163ca
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x163cc
jmp 0x163ce
cmpq $0xc, 0x88(%rsp)
jne 0x1642e
movq 0x98(%rsp), %rdi
leaq 0x120ca(%rip), %rsi     # 0x284b2
movl $0xc, %edx
callq 0x144c0
cmpl $0x0, %eax
jne 0x1642c
movq (%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x14470
movl %eax, 0xa0(%rsp)
cmpl $0x0, 0xa0(%rsp)
je 0x1642a
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x1642c
jmp 0x1642e
jmp 0x16430
leaq 0x78(%rsp), %rdi
callq 0x14ef0
jmp 0x15edb
movq (%rsp), %rdi
callq 0x14240
addl 0xa4(%rsp), %eax
movl %eax, 0xa4(%rsp)
cmpl $0x0, 0xa4(%rsp)
je 0x16493
movl $0x1, 0xa0(%rsp)
movl 0xa0(%rsp), %esi
leaq 0x12080(%rip), %rdi     # 0x284f9
movb $0x0, %al
callq 0x13070
movl 0xa0(%rsp), %eax
movl %eax, 0xb4(%rsp)
jmp 0x16988
movq (%rsp), %rax
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
cmpl $0x0, 0x18(%rax)
jne 0x165e2
leaq 0x12073(%rip), %rdi     # 0x2852d
movb $0x0, %al
callq 0x13070
movq (%rsp), %rax
movq 0x30(%rax), %rax
subq $0x1, %rax
cmpq $0x0, %rax
jne 0x164de
movq $0x2, 0x50(%rsp)
jmp 0x164eb
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x50(%rsp)
movq (%rsp), %rax
movq 0x38(%rax), %rax
subq $0x1, %rax
cmpq $0x0, %rax
jne 0x16508
movq $0x2, 0x48(%rsp)
jmp 0x16515
movq (%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x48(%rsp)
movq (%rsp), %rax
movq 0x40(%rax), %rax
subq $0x1, %rax
cmpq $0x0, %rax
jne 0x16532
movq $0x2, 0x40(%rsp)
jmp 0x1653f
movq (%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x40(%rsp)
movq (%rsp), %rax
cmpq $0x0, 0x38(%rax)
jbe 0x165c5
movq (%rsp), %rax
cmpq $0x0, 0x40(%rax)
jbe 0x16596
movq (%rsp), %rcx
movq 0x30(%rcx), %rax
imulq 0x38(%rcx), %rax
imulq 0x40(%rcx), %rax
movq %rax, 0x60(%rsp)
movq 0x50(%rsp), %rax
subq $0x1, %rax
movq 0x48(%rsp), %rcx
subq $0x1, %rcx
imulq %rcx, %rax
movq 0x40(%rsp), %rcx
subq $0x1, %rcx
imulq %rcx, %rax
movq %rax, 0x58(%rsp)
jmp 0x165c3
movq (%rsp), %rcx
movq 0x30(%rcx), %rax
imulq 0x38(%rcx), %rax
movq %rax, 0x60(%rsp)
movq 0x50(%rsp), %rax
subq $0x1, %rax
movq 0x48(%rsp), %rcx
subq $0x1, %rcx
imulq %rcx, %rax
movq %rax, 0x58(%rsp)
jmp 0x165e0
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x50(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x165e2
movq (%rsp), %rax
cmpl $0x0, 0x18(%rax)
je 0x16610
leaq 0x11f76(%rip), %rdi     # 0x28569
movb $0x0, %al
callq 0x13070
movq (%rsp), %rax
movq 0x48(%rax), %rcx
movq %rcx, 0x60(%rsp)
movq 0x50(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x11f83(%rip), %rdi     # 0x285a4
movb $0x0, %al
callq 0x13070
cmpq $0x0, 0x60(%rsp)
jbe 0x16638
cmpq $0x0, 0x58(%rsp)
ja 0x16679
leaq 0x11f91(%rip), %rdi     # 0x285d0
movb $0x0, %al
callq 0x13070
movl $0x1, 0xa0(%rsp)
movl 0xa0(%rsp), %esi
leaq 0x11e9a(%rip), %rdi     # 0x284f9
movb $0x0, %al
callq 0x13070
movl 0xa0(%rsp), %eax
movl %eax, 0xb4(%rsp)
jmp 0x16988
movl $0x1, 0x3c(%rsp)
movq (%rsp), %rcx
movl 0x3c(%rsp), %eax
cmpl 0x20(%rcx), %eax
jg 0x16782
movq (%rsp), %rdi
addq $0x58, %rdi
leaq 0x3c(%rsp), %rsi
callq 0x138d0
cmpl $0x1, (%rax)
jne 0x166ff
movq 0x60(%rsp), %rdi
shlq $0x3, %rdi
callq 0x145f0
movq (%rsp), %rdi
movq %rax, 0x30(%rsp)
addq $0x88, %rdi
leaq 0x30(%rsp), %rsi
callq 0x14f80
cmpq $0x0, 0x30(%rsp)
jne 0x166ea
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
movq 0x30(%rsp), %rsi
leaq 0x11f07(%rip), %rdi     # 0x285fd
movb $0x0, %al
callq 0x13070
jmp 0x16770
movq (%rsp), %rdi
addq $0x58, %rdi
leaq 0x3c(%rsp), %rsi
callq 0x138d0
cmpl $0x2, (%rax)
jne 0x1676c
movq 0x58(%rsp), %rdi
shlq $0x3, %rdi
callq 0x145f0
movq (%rsp), %rdi
movq %rax, 0x28(%rsp)
addq $0x88, %rdi
leaq 0x28(%rsp), %rsi
callq 0x14f80
cmpq $0x0, 0x28(%rsp)
jne 0x16757
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
movq 0x28(%rsp), %rsi
leaq 0x11ebb(%rip), %rdi     # 0x2861e
movb $0x0, %al
callq 0x13070
jmp 0x1676e
jmp 0x1676e
jmp 0x16770
jmp 0x16772
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x16681
movq (%rsp), %rax
cmpl $0x0, 0x18(%rax)
je 0x16850
movq (%rsp), %rax
cmpl $0x2, 0x18(%rax)
jne 0x167a9
movq (%rsp), %rax
movq $0x3, 0xa8(%rax)
movq (%rsp), %rax
cmpl $0x3, 0x18(%rax)
jne 0x167c2
movq (%rsp), %rax
movq $0x4, 0xa8(%rax)
movq (%rsp), %rax
cmpl $0x5, 0x18(%rax)
jne 0x167db
movq (%rsp), %rax
movq $0x4, 0xa8(%rax)
movq (%rsp), %rax
cmpl $0x6, 0x18(%rax)
jne 0x167f4
movq (%rsp), %rax
movq $0x8, 0xa8(%rax)
movq (%rsp), %rax
movq 0x50(%rax), %rcx
imulq 0xa8(%rax), %rcx
movq %rcx, 0x20(%rsp)
cmpq $0x0, 0xa0(%rax)
jne 0x1682f
movq 0x20(%rsp), %rdi
shlq $0x3, %rdi
callq 0x145f0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0xa0(%rax)
movq (%rsp), %rax
cmpq $0x0, 0xa0(%rax)
jne 0x1684e
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x16850
cmpl $0x0, 0xa4(%rsp)
je 0x1695a
leaq 0x11dd8(%rip), %rdi     # 0x2863d
movb $0x0, %al
callq 0x13070
movq (%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x1688a
movq (%rsp), %rax
movq 0xa0(%rax), %rdi
callq 0x14380
leaq 0x18(%rsp), %rdi
callq 0x14980
movq (%rsp), %rdi
addq $0x88, %rdi
callq 0x149a0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq (%rsp), %rdi
addq $0x88, %rdi
callq 0x13bb0
movq %rax, 0x8(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x14110
testb $0x1, %al
jne 0x168dd
jmp 0x16928
leaq 0x18(%rsp), %rdi
callq 0x137c0
cmpq $0x0, (%rax)
je 0x1691a
leaq 0x18(%rsp), %rdi
callq 0x137c0
movq (%rax), %rsi
leaq 0x11d5f(%rip), %rdi     # 0x28660
movb $0x0, %al
callq 0x13070
leaq 0x18(%rsp), %rdi
callq 0x137c0
movq (%rax), %rdi
callq 0x14380
jmp 0x1691c
leaq 0x18(%rsp), %rdi
callq 0x136f0
jmp 0x168b3
movq (%rsp), %rdi
addq $0x88, %rdi
callq 0x14500
movl $0x1, 0xa0(%rsp)
movl 0xa0(%rsp), %esi
leaq 0x11ba8(%rip), %rdi     # 0x284f9
movb $0x0, %al
callq 0x13070
jmp 0x16965
movq (%rsp), %rax
movl $0x2, 0x8(%rax)
movl 0xa0(%rsp), %esi
leaq 0x11d0a(%rip), %rdi     # 0x2867d
movb $0x0, %al
callq 0x13070
movl 0xa0(%rsp), %eax
movl %eax, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
addq $0xb8, %rsp
retq
nopw (%rax,%rax)