EmonReserveProfileResources

NTSTATUS __stdcall EmonReserveProfileResources(_KINTERRUPT *Interrupt, VOID *ServiceContext){
  _QWORD *v2; 
  INT64 v3; 
  INT64 v5; 
  __int64 v6; 
  unsigned int v7; 
  __int64 v8; 
  unsigned int v9; 
  char *v10; 
  int v11; 
  int v12; 
  int v13; 
  unsigned int v14; 

  *v2 = -1i64;
  v3 = 0i64;
  v5 = 0i64;
  v6 = (1i64 << *(&CmpDummyThreadEvent + 4892)) - 1;
  if( ServiceContext )
  {
    v7 = *(_DWORD *)ServiceContext;
    v8 = 0i64;
    v9 = 0;
    if( *(_DWORD *)ServiceContext )
    {
      v10 = (char *)ServiceContext + 16;
      do
      {
        v11 = *((_DWORD *)v10 - 2);
        if( v11 )
        {
          v12 = v11 - 1;
          if( v12 )
          {
            v13 = v12 - 2;
            if( v13 )
            {
              if( v13 != 1 || !*(&CmpDummyThreadEvent + 4921) )
                return -1073741637;
              if( !*(&CmpDummyThreadEvent + 1245) && !*((_DWORD *)v10 + 2) || !*((_DWORD *)v10 + 3) )
                return -1073741811;
              v5 = (INT64)v10;
            }
            else
            {
              if( *(&CmpDummyThreadEvent + 1216) < 2u )
                return -1073741637;
              if( v3 )
                return -1073741811;
              v3 = *(_QWORD *)v10;
            }
          }
          else
          {
            v14 = *((_DWORD *)v10 + 1);
            if( v14 > 0x40 || v14 < *(_DWORD *)v10 )
              return -1073741811;
            v8 |= ((1i64 << ((unsigned __int8)v14 - (unsigned __int8)*(_DWORD *)v10 + 1)) - 1) << *(_DWORD *)v10;
          }
        }
        else
        {
          if( *(_DWORD *)v10 > 0x40u )
            return -1073741811;
          v8 |= 1i64 << *(_DWORD *)v10;
        }
        ++v9;
        v10 += 24;
      }
      while( v9 < v7 );
    }
  }
  else
  {
    v8 = v6 | (((1i64 << *(&CmpDummyThreadEvent + 4976)) - 1) << 32);
  }
  if( (v8 & (v6 | (((1i64 << *(&CmpDummyThreadEvent + 4976)) - 1) << 32))) == v8 )
    return EmonAllocateResources((_XSTATE_CONFIGURATION *)v8, v3, (PFN_CLIPSP_CLEAR *)Interrupt, v5, (INT64)v2);
  else
    return -1073741811;
}

Referenced by:

No references.