FopValidateFontNameTable

__int64 __fastcall FopValidateFontNameTable(__int64 a1, UINT64 a2, _QWORD *a3){
  _WORD *v4; 
  int TableOffsetAndSize; 
  UINT32 v7; 
  int v8; 
  __int64 v9; 
  __int64 v10; 
  unsigned int v11; 
  unsigned int v12; 
  UINT64 v13; 
  _WORD *v14; 
  unsigned int i; 
  __int64 v16; 
  UINT32 v18; 
  __int64 v19; 
  UINT32 v20; 
  v20 = 0;
  v19 = 0i64;
  v18 = 0;
  v4 = 0i64;
  TableOffsetAndSize = FopGetTableOffsetAndSize(a1, a2, 1851878757i64, &v20, &v18);
  if( TableOffsetAndSize < 0 )
    return(unsigned int)TableOffsetAndSize;
  v7 = v20;
  v8 = FopReadNamingTable(a1, v20, &v19);
  v9 = v19;
  TableOffsetAndSize = v8;
  if( v8 >= 0 )
  {
    v10 = v19 + 6;
    v11 = 0;
    if( !*(_WORD *)(v19 + 2) )
    {
LABEL_17:
      TableOffsetAndSize = -1073741701;
      goto LABEL_12;
    }
    while( *(_DWORD *)v10 != 65539 || *(_DWORD *)(v10 + 4) != 66569 )
    {
      ++v11;
      v10 += 12i64;
      if( v11 >= *(unsigned __int16 *)(v19 + 2) )
        goto LABEL_17;
    }
    v12 = *(unsigned __int16 *)(v10 + 8);
    v13 = v12 + 2;
    if( (unsigned int)v13 < v12 )
    {
      TableOffsetAndSize = -1073741675;
    }
    else
    {
      LODWORD(v14) = BgpFwAllocateMemory(v13);
      v4 = v14;
      if( v14 )
      {
        TableOffsetAndSize = FioFwReadBytesAtOffset(
                               a1,
                               v7 + *(unsigned __int16 *)(v9 + 4) + *(unsigned __int16 *)(v10 + 10),
                               *(unsigned __int16 *)(v10 + 8),
                               v14);
        if( TableOffsetAndSize < 0 )
          goto LABEL_20;
        *(_WORD *)(v10 + 8) >>= 1;
        for( i = 0; i < *(unsigned __int16 *)(v10 + 8); v4[v16] = __ROR2__(v4[v16], 8) )
          v16 = i++;
        v4[i] = 0;
        *a3 = v4;
LABEL_12:
        if( TableOffsetAndSize >= 0 )
          goto LABEL_13;
LABEL_20:
        if( v4 )
          BgpFwFreeMemory(v4);
        goto LABEL_13;
      }
      TableOffsetAndSize = -1073741801;
    }
  }
LABEL_13:
  if( v9 )
    BgpFwFreeMemory(v9);
  return(unsigned int)TableOffsetAndSize;
}

Referenced by:

FopInitializeFonts