// File: /workspace/github_cpp_makefile_star2_O2/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 $0x18, %rsp
movq %rdi, %rbx
leaq 0x4192(%rip), %rdi      # 0x10712
callq 0x77b0
cmpl $0x1, 0x8(%rbx)
jne 0xc77d
movq %rsp, %rax
andq $0x0, (%rax)
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
leaq 0x130(%rbx), %r12
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x110(%rbx), %rdi
callq 0x77c0
testl %eax, %eax
jne 0xc768
movq 0x110(%rbx), %rdi
callq 0x7030
movq %rax, 0x128(%rbx)
leaq 0x37f3(%rip), %rdi      # 0xfdcc
movq %rax, %rsi
xorl %eax, %eax
callq 0x7060
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
xorl %esi, %esi
callq 0x72a0
movq 0x110(%rbx), %rdx
movq %r15, %rdi
movq %rsp, %rsi
callq 0x7250
movl %eax, %r13d
movq 0x8(%rsp), %rdx
cmpq %r14, %rdx
jbe 0xc628
movq %rbp, %rdi
movq %rdx, %rsi
callq 0x7850
movq %rax, %rbp
movq 0x8(%rsp), %rdx
movq %rdx, %r14
movq (%rsp), %rsi
movq %rbp, %rdi
callq 0x73e0
testl %r13d, %r13d
jle 0xc684
movq 0x120(%rbx), %rax
incq %rax
movq %rax, 0x120(%rbx)
movq (%rsp), %r13
movq %rax, 0x10(%rsp)
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x77a0
movq %rax, %rdi
movq %r13, %rsi
callq 0x7990
movq 0x120(%rbx), %rsi
movq (%rsp), %rdx
leaq 0x3771(%rip), %rdi      # 0xfdee
xorl %eax, %eax
callq 0x7060
movq %rbp, %rdi
callq 0x7050
movq %rbp, %rsi
callq 0x7580
cmpl $0xb, %eax
je 0xc725
cmpl $0x64, %eax
je 0xc757
cmpl $0xd, %eax
je 0xc738
cmpl $0x15, %eax
je 0xc6da
cmpl $0x1f, %eax
je 0xc70c
cmpl $0x29, %eax
je 0xc6f3
cmpl $0xc, %eax
jne 0xc5ab
leaq 0x409b(%rip), %rdi      # 0x10769
callq 0x77b0
movq %rbx, %rdi
pushq $0x2
jmp 0xc749
leaq 0x40cb(%rip), %rdi      # 0x107ac
callq 0x77b0
movq %rbx, %rdi
callq 0x71e0
jmp 0xc5ab
leaq 0x40e2(%rip), %rdi      # 0x107dc
callq 0x77b0
movq %rbx, %rdi
callq 0x7240
jmp 0xc5ab
leaq 0x40b1(%rip), %rdi      # 0x107c4
callq 0x77b0
movq %rbx, %rdi
callq 0x79f0
jmp 0xc5ab
leaq 0x401f(%rip), %rdi      # 0x1074b
callq 0x77b0
movq %rbx, %rdi
pushq $0x1
jmp 0xc749
leaq 0x404b(%rip), %rdi      # 0x1078a
callq 0x77b0
movq %rbx, %rdi
pushq $0x3
popq %rsi
movq %rbp, %rdx
callq 0x7620
jmp 0xc5ab
leaq 0x3fcd(%rip), %rdi      # 0x1072b
callq 0x77b0
jmp 0xc5ab
movq (%rsp), %rdi
callq 0x75c0
movq %rbp, %rdi
callq 0x75c0
xorl %eax, %eax
jmp 0xc78c
leaq 0x4074(%rip), %rdi      # 0x107f8
callq 0x77b0
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop