PnpSelectFirstConfiguration

VOID __fastcall PnpSelectFirstConfiguration(INT64 a1, UINT64 a2, _QWORD *a3, INT64 a4){
  int v4; 
  __int64 v5; 
  INT64 v7; 
  _DWORD **v8; 
  _DWORD *v9; 
  __int64 i; 
  __int64 v11; 
  if( (_DWORD)a2 )
  {
    v4 = a4;
    v5 = (unsigned int)a2;
    v7 = a1 + 32;
    do
    {
      v8 = (_DWORD **)(*(_QWORD *)v7 + 40i64);
      *(_QWORD *)(*(_QWORD *)v7 + 16i64) = v8;
      v9 = *v8;
      if( v4 )
      {
        for( i = 0i64; (unsigned int)i < v9[5]; i = (unsigned int)(i + 1) )
        {
          v11 = *(_QWORD *)&v9[2 * i + 6];
          if( *(_BYTE *)(v11 + 8) )
          {
            if( *v9 == 1 )
              *(_DWORD *)(v11 + 84) |= 1u;
          }
        }
      }
      IopAddRemoveReqDescs((__int64)(v9 + 6), v9[5], a3, 1);
      v7 += 64i64;
      --v5;
    }
    while( v5 );
  }
}

Referenced by:

PnpFindBestConfigurationWorker