PnpLookupArbitersNewResources

VOID __stdcall PnpLookupArbitersNewResources(
        _PNP_RESOURCE_REQUEST *RequestTable,
        UINT64 RequestTableCount,
        _DEVICE_NODE *DeviceNode,
        UINT8 ResourceType){
  unsigned int v4; 
  unsigned int v6; 
  _DEVICE_OBJECT *v7; 
  unsigned int v8; 
  __int64 *v9; 
  __int64 v10; 
  unsigned int v11; 
  __int64 v12; 
  __int64 v13; 
  char v14; 
  _DWORD *PoolWithTag; 
  __int64 v16; 
  char v17; 
  _QWORD *v18; 
  unsigned int *v19; 
  v4 = 0;
  v6 = 0;
  if( (_DWORD)RequestTableCount )
  {
    v7 = (_DEVICE_OBJECT *)*((_QWORD *)DeviceNode + 4);
    do
    {
      if( RequestTable[(unsigned __int64)v6].PhysicalDevice == v7 )
        break;
      ++v6;
    }
    while( v6 < (unsigned int)RequestTableCount );
    if( v6 < (unsigned int)RequestTableCount )
    {
      _mm_lfence();
      v8 = 0;
      v9 = (__int64 *)*((_QWORD *)RequestTable[(unsigned __int64)v6].ReqList + 2);
      v10 = *v9;
      v11 = *(_DWORD *)(*v9 + 20);
      if( v11 )
      {
        v12 = v10 + 24;
        v13 = v11;
        do
        {
          v14 = *(_BYTE *)(*(_QWORD *)(*(_QWORD *)v12 + 32i64) + 136i64);
          if( v14 == ResourceType || v14 == 7 && ResourceType == 3 )
            ++v8;
          v12 += 8i64;
          --v13;
        }
        while( v13 );
        if( v8 )
        {
          PoolWithTag = ExAllocatePoolWithTag(PagedPool, 20i64 * v8, 0x20207050ui64);
          if( PoolWithTag )
          {
            *v19 = v8;
            *v18 = PoolWithTag;
            if( *(_DWORD *)(v10 + 20) )
            {
              do
              {
                v16 = *(_QWORD *)(*(_QWORD *)(v10 + 8i64 * v4 + 24) + 32i64);
                v17 = *(_BYTE *)(v16 + 136);
                if( v17 == ResourceType || v17 == 7 && ResourceType == 3 )
                {
                  *(_OWORD *)PoolWithTag = *(_OWORD *)(v16 + 136);
                  PoolWithTag[4] = *(_DWORD *)(v16 + 152);
                  PoolWithTag += 5;
                }
                ++v4;
              }
              while( v4 < *(_DWORD *)(v10 + 20) );
            }
          }
        }
      }
    }
  }
}

Referenced by:

IopRetestConfiguration
IopTestConfiguration