// File: /workspace/github_cpp_makefile_star2_O1/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 0x4858(%rip), %rdi      # 0xf67a
callq 0x5580
cmpl $0x1, 0x8(%r14)
jne 0xb096
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq 0x110(%r14), %rdi
callq 0x55a0
movl $0x0, %ebx
testl %eax, %eax
jne 0xb080
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 0x3eb2(%rip), %rdi      # 0xed34
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), %rsi
cmpq %r15, %rsi
jbe 0xaed0
movq %rbx, %rdi
callq 0x5610
movq %rax, %rbx
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x52f0
testl %r12d, %r12d
jle 0xaf4d
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 0x5570
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 0x5590
movq 0x120(%r14), %rsi
movq 0x8(%rsp), %rdx
leaq 0x3e10(%rip), %rdi      # 0xed56
xorl %eax, %eax
callq 0x5060
movq %rbx, %rdi
callq 0x5050
movq %rbx, %rsi
callq 0x5400
movl %eax, %r12d
cmpl $0x64, %eax
jne 0xaf71
leaq 0x4727(%rip), %rdi      # 0xf693
callq 0x5580
cmpl $0xb, %r12d
jne 0xaf83
leaq 0x4735(%rip), %rdi      # 0xf6b3
callq 0x5580
cmpl $0xc, %r12d
jne 0xaf95
leaq 0x4741(%rip), %rdi      # 0xf6d1
callq 0x5580
cmpl $0xd, %r12d
jne 0xafa7
leaq 0x4750(%rip), %rdi      # 0xf6f2
callq 0x5580
cmpl $0x15, %r12d
jne 0xafb9
leaq 0x4760(%rip), %rdi      # 0xf714
callq 0x5580
cmpl $0x1f, %r12d
jne 0xafcb
leaq 0x4766(%rip), %rdi      # 0xf72c
callq 0x5580
cmpl $0x29, %r12d
jne 0xafdd
leaq 0x476c(%rip), %rdi      # 0xf744
callq 0x5580
cmpl $0xb, %r12d
jne 0xaffb
leaq 0x4795(%rip), %rdi      # 0xf77f
callq 0x5580
leaq 0x4855(%rip), %rdi      # 0xf84b
callq 0x5580
cmpl $0xc, %r12d
jne 0xb019
leaq 0x47a1(%rip), %rdi      # 0xf7a9
callq 0x5580
leaq 0x4814(%rip), %rdi      # 0xf828
callq 0x5580
cmpl $0xd, %r12d
jne 0xb042
leaq 0x47b0(%rip), %rdi      # 0xf7d6
callq 0x5580
leaq 0x47d2(%rip), %rdi      # 0xf804
callq 0x5580
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5500
cmpl $0x15, %r12d
jne 0xb050
movq %r14, %rdi
callq 0x5140
cmpl $0x1f, %r12d
jne 0xb05e
movq %r14, %rdi
callq 0x5710
cmpl $0x29, %r12d
jne 0xb06c
movq %r14, %rdi
callq 0x5180
movq 0x110(%r14), %rdi
callq 0x55a0
testl %eax, %eax
je 0xae68
movq 0x8(%rsp), %rdi
callq 0x5430
movq %rbx, %rdi
callq 0x5430
xorl %eax, %eax
jmp 0xb0a7
leaq 0x46c3(%rip), %rdi      # 0xf760
callq 0x5580
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq