PnpNeedToReleaseBootResources

__int64 __fastcall PnpNeedToReleaseBootResources(__int64 a1, _DWORD *a2, _DWORD *a3){
  unsigned int v3; 
  unsigned int *v4; 
  unsigned int v5; 
  _DWORD *v6; 
  unsigned int v7; 
  _DWORD *v8; 
  unsigned int v9; 
  unsigned __int8 v10; 
  __int64 v11; 
  unsigned int v12; 
  _CM_PARTIAL_RESOURCE_DESCRIPTOR *v13; 
  unsigned int v14; 
  int v15; 
  unsigned int v17; 
  unsigned int v18; 
  unsigned int v19; 
  _DWORD *v20; 
  int v22; 
  v20 = a2;
  v3 = 0;
  *a3 = 0;
  if( *a2 != 1 )
    return v3;
  v4 = *(unsigned int **)(a1 + 544);
  if( !v4 )
    return v3;
  v5 = *v4;
  if( !*v4 )
    return v3;
  v6 = v4 + 1;
  v7 = 0;
  if( !v5 )
    return v3;
  while( 1 )
  {
    v8 = v6 + 4;
    v9 = 0;
    v18 = v6[3];
    if( v18 )
      break;
LABEL_22:
    ++v7;
    v6 = v8;
    if( v7 >= v5 )
      return v3;
  }
  while( 1 )
  {
    v10 = *(_BYTE *)v8;
    v11 = 0i64;
    if( !*(_BYTE *)v8 )
      goto LABEL_21;
    if( v10 != 5 )
      break;
    v11 = (unsigned int)v8[1];
LABEL_21:
    ++v9;
    v8 = (_DWORD *)((char *)v8 + v11 + 20);
    if( v9 >= v18 )
      goto LABEL_22;
  }
  if( v10 >= 8u )
    goto LABEL_21;
  v12 = 0;
  v22 = 0;
  v19 = 0;
  v17 = a2[4];
  if( !v17 )
    return 1;
  v13 = (_CM_PARTIAL_RESOURCE_DESCRIPTOR *)(a2 + 5);
  while( 1 )
  {
    v14 = 0;
    if( *(_BYTE *)v13 == 5 )
    {
      v14 = *((_DWORD *)v13 + 1);
      goto LABEL_15;
    }
    if( v10 == *(_BYTE *)v13 )
      break;
LABEL_15:
    ++v12;
    v13 = (_CM_PARTIAL_RESOURCE_DESCRIPTOR *)((char *)v13 + v14 + 20);
    v19 = v12;
    if( v12 >= v17 )
    {
      v15 = 1;
      goto LABEL_18;
    }
  }
  v22 = 1;
  if( !(unsigned int)PnpIsRangeWithin((_CM_PARTIAL_RESOURCE_DESCRIPTOR *)v8, v13) )
  {
    v12 = v19;
    goto LABEL_15;
  }
  v15 = 0;
LABEL_18:
  if( !v22 )
    return 1;
  if( !v15 )
  {
    a2 = v20;
    v11 = 0i64;
    goto LABEL_21;
  }
  *a3 = 1;
  return v3;
}

Referenced by:

IopReleaseFilteredBootResources