PipSortDeviceObjectList

__int64 __fastcall PipSortDeviceObjectList(unsigned int **a1){
  __int64 v1; 
  size_t v3; 
  WCHAR *v4; 
  unsigned int *v5; 
  __int64 v6; 
  _DWORD *v7; 
  INT64 v9; 
  v1 = 0i64;
  v3 = **a1;
  v4 = (WCHAR *)(*a1 + 4);
  if( (_DWORD)v3 )
  {
    v5 = *a1 + 8;
    v6 = (unsigned int)v3;
    do
    {
      *v5 &= ~2u;
      v5 += 6;
      --v6;
    }
    while( v6 );
  }
  LODWORD(v9) = 1;
  if( (_DWORD)v3 )
  {
    v7 = v4 + 8;
    do
    {
      if( (*v7 & 4) != 0 )
        PipVisitDeviceObjectListEntry((INT64)&v4[12 * v1], (INT64 *)*a1, &v9);
      v1 = (unsigned int)(v1 + 1);
      v7 += 6;
    }
    while( (unsigned int)v1 < (unsigned int)v3 );
  }
  qsort(v4, v3, (const WCHAR *)0x18, PipSortDevicesByOrdinal);
  return 0i64;
}

Referenced by:

IopSortRelationListForRemove