LdrRscIsTypeExist

NTSTATUS __stdcall LdrRscIsTypeExist(VOID *Config, WCHAR *ResType, UINT64 *RetFlags, UINT64 *a4){
  WCHAR *v5; 
  char v7; 
  int v8; 
  _DWORD *v9; 
  int v11; 
  _DWORD *v12; 
  int v14; 
  const wchar_t *v15; 
  __int64 v16; 
  int v17; 
  char v18; 
  int v19; 
  const wchar_t *v20; 
  __int64 v21; 
  int v22; 

  v5 = ResType;
  if( !Config || !a4 )
    return -1073741811;
  v7 = 1;
  if( (unsigned __int64)ResType >= 0x10000 )
  {
    v14 = *((_DWORD *)Config + 22) >> 1;
    v15 = (const wchar_t *)((char *)Config + *((unsigned int *)Config + 21));
    if( (unsigned int)v15 > 0x10000 )
    {
      while( v14 > 0 )
      {
        if( !*v15 )
          goto LABEL_26;
        if( !wcsicmp(v5, v15) )
        {
          v5 = ResType;
          break;
        }
        v16 = -1i64;
        do
          ++v16;
        while( v15[v16] );
        v17 = v16 + 1;
        v15 += v17;
        v14 -= v17;
        v5 = ResType;
      }
    }
    if( !*v15 || (v18 = 1, v14 <= 0) )
LABEL_26:
      v18 = 0;
    if( !v18 )
      *(_DWORD *)a4 |= 0x40000u;
    v19 = *((_DWORD *)Config + 26) >> 1;
    v20 = (const wchar_t *)((char *)Config + *((unsigned int *)Config + 25));
    if( (unsigned int)v20 > 0x10000 )
    {
      while( v19 > 0 )
      {
        if( !*v20 )
          goto LABEL_38;
        if( !wcsicmp(v5, v20) )
          break;
        v21 = -1i64;
        do
          ++v21;
        while( v20[v21] );
        v22 = v21 + 1;
        v20 += v22;
        v19 -= v22;
        v5 = ResType;
      }
    }
    if( !*v20 || v19 <= 0 )
LABEL_38:
      v7 = 0;
    if( !v7 )
      *(_DWORD *)a4 |= 0x20000u;
  }
  else
  {
    v8 = *((_DWORD *)Config + 24) >> 2;
    v9 = (char *)Config + *((unsigned int *)Config + 23);
    do
    {
      if( --v8 < 0 )
        break;
    }
    while( (_DWORD)v5 - *v9++ );
    if( v8 < 0 )
      *(_DWORD *)a4 |= 0x40000u;
    v11 = *((_DWORD *)Config + 28) >> 2;
    v12 = (char *)Config + *((unsigned int *)Config + 27);
    do
    {
      if( --v11 < 0 )
        break;
    }
    while( (_DWORD)v5 - *v12++ );
    if( v11 < 0 )
      *(_DWORD *)a4 |= 0x20000u;
  }
  return 0;
}

Referenced by:

LdrIsResItemExist