// File: nompelis[P]INTecplotLib/intecplot.cpp
// Function: inTec_Zone::clear()
void inTec_Zone::clear()
{
#ifdef _DEBUG_
   printf(" i Zone object clearing\n");
#endif

   // deallocate data arrays
   std::vector< double * > :: iterator dpi;
   for( dpi = var_vec.begin() ; dpi != var_vec.end() ; ++dpi ) {
      if( (*dpi) != NULL ) {
         double *tp = (*dpi);
 //HACK  free( tp );
#warning "CLEAN THIS IF ERROR"
         free( tp );
         (*dpi) = NULL;
      }
   }
   var_vec.clear();

   // deallocate connectivity array
   if( icon != NULL ) free( icon );
   icon = NULL;

#ifdef _DEBUG_
   printf(" i Keywords in zone (%ld) \n", keywords.size());
   printf("   Index  Keyword=String \n");
   std::map< std::string, std::string > :: iterator imap;
   int i=0;
   for( imap = keywords.begin(); imap != keywords.end(); ++imap ) {
      printf("   %d  ", i++ );
      printf("   [%s] = %s\n", (*imap).first.c_str(), (*imap).second.c_str() );
   }
#endif
   keywords.clear();

#ifdef _DEBUG_
   printf("   Other data in zone \n");
   printf("    - T: %s \n", tkey);
   printf("    - Nodes: %ld \n", nodes);
   printf("    - Elements: %ld \n", elems);
   printf("    - im,jm,kn: %ld, %ld, %ld \n", im,jm,km);
   printf("    - Number of variables: %d \n", num_var);
   std::map< int, int > :: iterator it;
   for( it= ivar_loc.begin(); it != ivar_loc.end(); ++it ) {
      printf("      ==> %d location %d \n", (*it).first, (*it).second );
   }
#endif
   ivar_loc.clear();

   // drop T-keyword string
   if( tkey != NULL ) free( tkey );


   // initialize variables as if it were a fresh object
   istate = 0;
   ipos = 0;
   ipos_data = 0;
   ipos_conn = 0;

   // keyword-based variables
   tkey = NULL;
   ietype = -1;
   idatapack = -1;
   im = 0;
   jm = 0;
   km = 0;
   nodes = 0;
   elems = 0;
   nv = 0;
   parent_zone = -1;

   // old-style variables
   iold_n = 0;
   iold_e = 0;
   iold_et = -1;
   iold_f = -1;

   // utility variables
   iparse_num = 0;
   node_cnt = 0;
   elem_cnt = 0;
   var_cnt = 0;
   icon_cnt = 0;

   InitKeywords();

   file = NULL;
   num_var = 0;
   icon = NULL;
   ncon = 0;
   num_var = 0;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x127e9(%rip), %rdi     # 0x28043
movb $0x0, %al
callq 0x13070
leaq 0x68(%rsp), %rdi
callq 0x14980
movq 0x10(%rsp), %rdi
addq $0x88, %rdi
callq 0x149a0
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x10(%rsp), %rdi
addq $0x88, %rdi
callq 0x13bb0
movq %rax, 0x58(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x14110
testb $0x1, %al
jne 0x158b6
jmp 0x15901
leaq 0x68(%rsp), %rdi
callq 0x137c0
cmpq $0x0, (%rax)
je 0x158f3
leaq 0x68(%rsp), %rdi
callq 0x137c0
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x14380
leaq 0x68(%rsp), %rdi
callq 0x137c0
movq $0x0, (%rax)
jmp 0x158f5
leaq 0x68(%rsp), %rdi
callq 0x136f0
jmp 0x1588b
movq 0x10(%rsp), %rdi
addq $0x88, %rdi
callq 0x14500
movq 0x10(%rsp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x15932
movq 0x10(%rsp), %rax
movq 0xa0(%rax), %rdi
callq 0x14380
movq 0x10(%rsp), %rdi
movq $0x0, 0xa0(%rdi)
addq $0xe8, %rdi
callq 0x13970
movq %rax, %rsi
leaq 0x12704(%rip), %rdi     # 0x2805c
movb $0x0, %al
callq 0x13070
leaq 0x12712(%rip), %rdi     # 0x28078
movb $0x0, %al
callq 0x13070
leaq 0x48(%rsp), %rdi
callq 0x13660
movq 0x10(%rsp), %rdi
movl $0x0, 0x44(%rsp)
addq $0xe8, %rdi
callq 0x14600
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x10(%rsp), %rdi
addq $0xe8, %rdi
callq 0x13980
movq %rax, 0x30(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x13d70
testb $0x1, %al
jne 0x159ca
jmp 0x15a37
movl 0x44(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
leaq 0x126b5(%rip), %rdi     # 0x28093
movb $0x0, %al
callq 0x13070
leaq 0x48(%rsp), %rdi
callq 0x13c00
movq %rax, %rdi
callq 0x134f0
movq %rax, 0x8(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x13c00
movq %rax, %rdi
addq $0x20, %rdi
callq 0x134f0
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x1267a(%rip), %rdi     # 0x2809b
movb $0x0, %al
callq 0x13070
leaq 0x48(%rsp), %rdi
callq 0x14ef0
jmp 0x1599f
movq 0x10(%rsp), %rdi
addq $0xe8, %rdi
callq 0x14770
leaq 0x1265a(%rip), %rdi     # 0x280a9
movb $0x0, %al
callq 0x13070
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x1265b(%rip), %rdi     # 0x280c1
movb $0x0, %al
callq 0x13070
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rsi
leaq 0x12652(%rip), %rdi     # 0x280cf
movb $0x0, %al
callq 0x13070
movq 0x10(%rsp), %rax
movq 0x50(%rax), %rsi
leaq 0x1264e(%rip), %rdi     # 0x280e2
movb $0x0, %al
callq 0x13070
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rsi
movq 0x38(%rax), %rdx
movq 0x40(%rax), %rcx
leaq 0x12645(%rip), %rdi     # 0x280f8
movb $0x0, %al
callq 0x13070
movq 0x10(%rsp), %rax
movl 0x20(%rax), %esi
leaq 0x1264f(%rip), %rdi     # 0x28118
movb $0x0, %al
callq 0x13070
leaq 0x28(%rsp), %rdi
callq 0x14e30
movq 0x10(%rsp), %rdi
addq $0x58, %rdi
callq 0x14e00
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%rsp), %rdi
addq $0x58, %rdi
callq 0x141e0
movq %rax, 0x18(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x14950
testb $0x1, %al
jne 0x15b1f
jmp 0x15b5a
leaq 0x28(%rsp), %rdi
callq 0x14290
movl (%rax), %eax
movl %eax, 0x4(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x14290
movl 0x4(%rsp), %esi
movl 0x4(%rax), %edx
leaq 0x125f1(%rip), %rdi     # 0x28138
movb $0x0, %al
callq 0x13070
leaq 0x28(%rsp), %rdi
callq 0x13940
jmp 0x15af7
movq 0x10(%rsp), %rdi
addq $0x58, %rdi
callq 0x132b0
movq 0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x15b82
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x14380
movq 0x10(%rsp), %rdi
movl $0x0, 0x8(%rdi)
movq $0x0, 0xd0(%rdi)
movq $0x0, 0xd8(%rdi)
movq $0x0, 0xe0(%rdi)
movq $0x0, 0x10(%rdi)
movl $0xffffffff, 0x18(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x1c(%rdi) # imm = 0xFFFFFFFF
movq $0x0, 0x30(%rdi)
movq $0x0, 0x38(%rdi)
movq $0x0, 0x40(%rdi)
movq $0x0, 0x48(%rdi)
movq $0x0, 0x50(%rdi)
movl $0x0, 0x28(%rdi)
movl $0xffffffff, 0x24(%rdi) # imm = 0xFFFFFFFF
movq $0x0, 0xb0(%rdi)
movq $0x0, 0xb8(%rdi)
movl $0xffffffff, 0xc0(%rdi) # imm = 0xFFFFFFFF
movl $0xffffffff, 0xc4(%rdi) # imm = 0xFFFFFFFF
movl $0x0, 0x118(%rdi)
movq $0x0, 0x120(%rdi)
movq $0x0, 0x128(%rdi)
movl $0x0, 0x130(%rdi)
movq $0x0, 0x138(%rdi)
callq 0x13470
movq 0x10(%rsp), %rax
movq $0x0, 0xc8(%rax)
movl $0x0, 0x20(%rax)
movq $0x0, 0xa0(%rax)
movq $0x0, 0xa8(%rax)
movl $0x0, 0x20(%rax)
addq $0x78, %rsp
retq
nopl (%rax,%rax)