PopPlInitPowerPlane

INT64 __fastcall PopPlInitPowerPlane(UINT64 *a1, INT64 a2, UINT64 a3, INT64 *a4){
  INT64 v4; 
  int inited; 
  VOID *PoolWithTag; 
  void *v11; 
  INT64 result; 
  v4 = 0i64;
  if( (unsigned __int64)a1 + 52 <= a3 )
  {
    PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, 0x40ui64, 0x6C506F50ui64);
    v4 = (INT64)PoolWithTag;
    if( PoolWithTag )
    {
      memset((INT64)PoolWithTag, 0i64);
      inited = PopPlInitWString((PUNICODE_STRING)v4);
      if( inited >= 0 )
      {
        *(_QWORD *)(v4 + 16) = 0i64;
        inited = PopPlInitDevices(
                   v4,
                   a1 + 1,
                   *((unsigned int *)a1 + 1),
                   a2,
                   a3,
                   (UINT64 *)(v4 + 48),
                   (CHAR **)(v4 + 56));
        if( inited >= 0 )
          goto LABEL_11;
        v11 = *(void **)(v4 + 8);
        if( v11 )
          ExFreePoolWithTag(v11, 0x6C506F50u);
        *(_OWORD *)v4 = 0i64;
      }
      ExFreePoolWithTag((PVOID)v4, 0x6C506F50u);
      v4 = 0i64;
      goto LABEL_11;
    }
    inited = -1073741670;
  }
  else
  {
    inited = -1073741306;
  }
LABEL_11:
  result = (unsigned int)inited;
  *a4 = v4;
  return result;
}

Referenced by:

PopPlRegisterPowerPlane