ReadString

NTSTATUS __stdcall ReadString(
        INT64 Flags,
        PSTR table,
        INT64 ch,
        INT64 pCharCount,
        PVOID *Pointer,
        INT64 width,
        FILE *File,
        INT64 stream,
        INT64 array_width){
  PVOID *v9; 
  char v10; 
  _WORD *v13; 
  int v14; 
  int v15; 
  INT64 v16; 
  int v17; 
  int v18; 
  FILE *v19; 
  int v20; 
  int v21; 
  _WORD *v22; 
  _WORD *v24; 
  char v25; 
  PSTR v26; 
  int v27; 
  v26 = table;
  v9 = Pointer;
  v10 = Flags;
  v13 = *Pointer;
  v14 = -((Flags & 8) != 0);
  --*(_DWORD *)pCharCount;
  v15 = *(_DWORD *)ch;
  v27 = v14;
  if( v15 != -1 )
    ungetc_nolock(v15, File);
  v16 = stream - 1;
  if( (v10 & 0x10) != 0 )
    v16 = stream;
  v17 = v10 & 1;
  LODWORD(Pointer) = v17;
  while( 1 )
  {
    if( v17 )
    {
      v18 = width;
      LODWORD(width) = width - 1;
      if( !v18 )
        goto LABEL_31;
    }
    v19 = File;
    ++*(_DWORD *)pCharCount;
    v20 = inc(v19, 0i64);
    *(_DWORD *)ch = v20;
    if( v20 == -1 )
      break;
    if( (v10 & 0x10) == 0 && ((v10 & 0x20) == 0 || v20 >= 9 && v20 <= 13 || v20 == 32) )
    {
      if( (v10 & 0x40) == 0 )
        break;
      if( v20 < 0 )
        break;
      if( v20 < v20 >> 3 )
        break;
      v21 = v27 ^ v26[v20 >> 3];
      if( !_bittest(&v21, v20 & 7) )
        break;
    }
    if( (v10 & 4) != 0 )
    {
      v13 = (_WORD *)((char *)v13 + 1);
    }
    else
    {
      if( !v16 )
      {
        if( (v10 & 2) != 0 )
          *v13 = 0;
        else
          *(_BYTE *)v13 = 0;
        return -1;
      }
      v22 = *v9;
      --v16;
      if( (v10 & 2) != 0 )
      {
        *v22 = (unsigned __int16)&v25;
        *v9 = (char *)*v9 + 2;
      }
      else
      {
        *(_BYTE *)v22 = *(_BYTE *)ch;
        *v9 = (char *)*v9 + 1;
      }
    }
    v17 = (int)Pointer;
  }
  --*(_DWORD *)pCharCount;
  if( *(_DWORD *)ch != -1 )
    ungetc_nolock(*(_DWORD *)ch, File);
LABEL_31:
  if( v13 == *v9 )
    return -1;
  if( (v10 & 4) == 0 )
  {
    ++*(_DWORD *)array_width;
    if( (v10 & 0x10) == 0 )
    {
      v24 = *v9;
      if( (v10 & 2) != 0 )
        *v24 = 0;
      else
        *(_BYTE *)v24 = 0;
    }
  }
  return 0;
}

Referenced by:

ReadStringDelimited
input_s