// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x941f(%rip), %rdi      # 0xf02e
callq 0x5570
movq 0x88(%rbx), %r14
movq 0x90(%rbx), %rax
cmpq %rax, %r14
je 0x5c5e
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5c42
callq 0x5420
movq $0x0, (%r14)
movq 0x90(%rbx), %rax
addq $0x8, %r14
cmpq %rax, %r14
jne 0x5c27
movq 0x88(%rbx), %rcx
cmpq %rcx, %rax
je 0x5c5e
movq %rcx, 0x90(%rbx)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x5c6f
callq 0x5420
movq $0x0, 0xa0(%rbx)
leaq 0xe8(%rbx), %rax
movq %rax, (%rsp)
movq 0x110(%rbx), %rsi
leaq 0x8535(%rip), %rdi      # 0xe1c8
xorl %eax, %eax
callq 0x5060
leaq 0x93a5(%rip), %rdi      # 0xf046
callq 0x5570
movq 0x100(%rbx), %r15
leaq 0xf0(%rbx), %rbp
cmpq %rbp, %r15
je 0x5cfc
leaq 0x8524(%rip), %r12      # 0xe1e4
leaq 0x8525(%rip), %r13      # 0xe1ec
xorl %esi, %esi
leal 0x1(%rsi), %r14d
movq %r12, %rdi
xorl %eax, %eax
callq 0x5060
movq 0x20(%r15), %rsi
movq 0x40(%r15), %rdx
movq %r13, %rdi
xorl %eax, %eax
callq 0x5060
movq %r15, %rdi
callq 0x5200
movq %rax, %r15
movl %r14d, %esi
cmpq %rbp, %rax
jne 0x5cc9
movq (%rsp), %rdi
callq 0x5090
leaq 0x9354(%rip), %rdi      # 0xf060
callq 0x5570
movq 0x10(%rbx), %rsi
leaq 0x84de(%rip), %rdi      # 0xe1fa
xorl %eax, %eax
callq 0x5060
movq 0x48(%rbx), %rsi
leaq 0x84da(%rip), %rdi      # 0xe208
xorl %eax, %eax
callq 0x5060
movq 0x50(%rbx), %rsi
leaq 0x84db(%rip), %rdi      # 0xe21b
xorl %eax, %eax
callq 0x5060
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
leaq 0x84d7(%rip), %rdi      # 0xe231
xorl %eax, %eax
callq 0x5060
movl 0x20(%rbx), %esi
leaq 0x84e6(%rip), %rdi      # 0xe251
xorl %eax, %eax
callq 0x5060
leaq 0x58(%rbx), %r14
movq 0x70(%rbx), %r15
leaq 0x60(%rbx), %r13
cmpq %r13, %r15
je 0x5dac
leaq 0x84e7(%rip), %r12      # 0xe271
movl 0x20(%r15), %esi
movl 0x24(%r15), %edx
movq %r12, %rdi
xorl %eax, %eax
callq 0x5060
movq %r15, %rdi
callq 0x5200
movq %rax, %r15
cmpq %r13, %rax
jne 0x5d8a
leaq 0xa0(%rbx), %r15
leaq 0x30(%rbx), %r12
movq %r14, %rdi
callq 0x5080
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x5dcd
callq 0x5420
xorl %r14d, %r14d
movl %r14d, 0x8(%rbx)
movq %r14, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
movq %r14, 0xe0(%rbx)
movq $-0x1, %rax
movq %rax, 0x18(%rbx)
movl %r14d, 0x28(%rbx)
movq %r14, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
movl $0xffffffff, 0x24(%rbx) # imm = 0xFFFFFFFF
movups %xmm0, 0xb0(%rbx)
movq %rax, 0xc0(%rbx)
movl %r14d, 0x118(%rbx)
movq %r14, 0x138(%rbx)
movups %xmm0, 0x120(%rbx)
movl %r14d, 0x130(%rbx)
movq %rbx, %rdi
callq 0x50f0
movq %r14, 0xc8(%rbx)
movl %r14d, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq