// File: /workspace/github_cpp_makefile_star2_O3/nompelis[P]INTecplotLib/intecplot.cpp
// Function: inTec_File::ParseLoop()
int inTec_File::ParseLoop()
{
#ifdef _DEBUG_
   printf(" i Inside \"ParseLoop()\" \n");
#endif

   if( istate != 1 ) {
      printf(" e File not in a reading state\n");
      return(1);
   }

   char *buf=NULL;
   size_t ibuf_size=0;
   char *buf2=NULL;
   size_t ibuf_size2=0;

   while( !feof( fp ) ) {
      int ic;

      // information about the position in the file
      ipos = ftell( fp );
#ifdef _DEBUG_
      printf(" i Position in file at %ld bytes\n", ipos );
#endif

      // prepare the buffer
      memset( buf, '\0', ibuf_size );
      // read a line of data; get count of bytes read
      ic = inUtils_ReadTextline( &ibuf_size, &buf, fp );
      //// check for errors (negative numbers)
#ifdef _DEBUG3_
      printf("IC= %d, STRING: \"%s\"\n", ic, buf );
#endif

      // copy the string
      if( ibuf_size > ibuf_size2 ) {
//// need a temporary variable here in order to free the memory...
         buf2 = (char *) realloc( buf2, ibuf_size );
         ///// check for errors
         ibuf_size2 = ibuf_size;
      }
      memcpy( buf2, buf, ibuf_size );

      // store string
      if( ic > 0 ) {
         // increase line count
         ++iline;

         // store string in strings map
         // (Presently making the "line number" the key of hte mapping, but
         // it may be more useful to put the position in the file in bytes.)
         strings[ iline ] = buf;
#ifdef _DEBUG2_
         printf(" i Added to strings line %ld \n", iline );
#endif
         // show the line
         printf(" [%ld]  %s", iline, buf );
      }

      // sanitize the line
      inUtils_TrimLeadingSpaceTextline( buf2 );

      // determine what this line signifies
      int itype = IdentifyComponent( buf2 );
      int iret;
#ifdef _DEBUG_
      if( itype == Comment ) printf(" i Component is a comment line \n");
      if( itype == Title ) printf(" i Component is a title line \n");
      if( itype == Filetype ) printf(" i Component is a filetype line \n");
      if( itype == Variables ) printf(" i Component is a variables line \n");
      if( itype == Zone ) printf(" i Component is a zone \n");
      if( itype == Text ) printf(" i Component is a text \n");
      if( itype == Geometry ) printf(" i Component is a geometry \n");
#endif
      if( itype == Title ) iret = ParseComponent_Header( 1, buf2 );
      if( itype == Filetype ) iret = ParseComponent_Header( 2, buf2 );
      if( itype == Variables ) iret = ParseComponent_Header( 3, buf2 );
      if( itype == Zone ) iret = ParseComponent_Zone();
      if( itype == Text ) iret = ParseComponent_Text();
      if( itype == Geometry ) iret = ParseComponent_Geometry();

      // check return code (iret)


   }


   // drop the buffer
   free( buf );
   free( buf2 );

   return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x4a4a(%rip), %rdi      # 0xf712
callq 0x5570
cmpl $0x1, 0x8(%r14)
jne 0xaf39
xorl %r15d, %r15d
movq %r15, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq 0x110(%r14), %rdi
callq 0x5590
movl $0x0, %edi
movl $0x0, %ebx
testl %eax, %eax
jne 0xaf2a
leaq 0x130(%r14), %rax
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0x110(%r14), %rdi
callq 0x5030
movq %rax, 0x128(%r14)
leaq 0x409e(%rip), %rdi      # 0xedcc
movq %rax, %rsi
xorl %eax, %eax
callq 0x5060
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
xorl %esi, %esi
callq 0x51e0
movq 0x110(%r14), %rdx
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5190
movl %eax, %r12d
movq 0x10(%rsp), %rdx
cmpq %r15, %rdx
jbe 0xad82
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x5600
movq %rax, %rbx
movq 0x10(%rsp), %rdx
movq %rdx, %r15
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x52e0
testl %r12d, %r12d
jle 0xadfa
movq 0x120(%r14), %rax
incq %rax
movq %rax, 0x120(%r14)
movq 0x8(%rsp), %r12
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x5560
movq %rax, %r13
movq 0x8(%rax), %rbp
movq %r12, %rdi
callq 0x5150
movq %r13, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x5580
movq 0x120(%r14), %rsi
movq 0x8(%rsp), %rdx
leaq 0x3ffb(%rip), %rdi      # 0xedee
xorl %eax, %eax
callq 0x5060
movq %rbx, %rdi
callq 0x5050
movq %rbx, %rsi
callq 0x53f0
cmpl $0x14, %eax
jle 0xae3f
cmpl $0x28, %eax
jg 0xae8a
cmpl $0x15, %eax
je 0xaebe
cmpl $0x1f, %eax
jne 0xaf0e
leaq 0x4997(%rip), %rdi      # 0xf7c4
callq 0x5570
movq %r14, %rdi
callq 0x5700
jmp 0xaf0e
cmpl $0xb, %eax
je 0xae9d
cmpl $0xc, %eax
je 0xaeea
cmpl $0xd, %eax
jne 0xaf0e
leaq 0x492d(%rip), %rdi      # 0xf78a
callq 0x5570
leaq 0x4a05(%rip), %rdi      # 0xf86e
callq 0x5570
leaq 0x4a27(%rip), %rdi      # 0xf89c
callq 0x5570
movq %r14, %rdi
movq %rbx, %rsi
callq 0x54f0
jmp 0xaf0e
cmpl $0x29, %eax
je 0xaed4
cmpl $0x64, %eax
jne 0xaf0e
leaq 0x4890(%rip), %rdi      # 0xf72b
jmp 0xaf09
leaq 0x48a7(%rip), %rdi      # 0xf74b
callq 0x5570
leaq 0x4967(%rip), %rdi      # 0xf817
callq 0x5570
leaq 0x4a27(%rip), %rdi      # 0xf8e3
jmp 0xaf09
leaq 0x48e7(%rip), %rdi      # 0xf7ac
callq 0x5570
movq %r14, %rdi
callq 0x5140
jmp 0xaf0e
leaq 0x4901(%rip), %rdi      # 0xf7dc
callq 0x5570
movq %r14, %rdi
callq 0x5180
jmp 0xaf0e
leaq 0x4878(%rip), %rdi      # 0xf769
callq 0x5570
leaq 0x4944(%rip), %rdi      # 0xf841
callq 0x5570
leaq 0x49b7(%rip), %rdi      # 0xf8c0
callq 0x5570
movq 0x110(%r14), %rdi
callq 0x5590
testl %eax, %eax
je 0xad14
movq 0x8(%rsp), %rdi
xorl %r15d, %r15d
callq 0x5420
movq %rbx, %rdi
callq 0x5420
jmp 0xaf4b
leaq 0x48b8(%rip), %rdi      # 0xf7f8
callq 0x5570
movl $0x1, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop