PopPlInitDevice

INT64 __fastcall PopPlInitDevice(INT64 a1, UINT64 *a2, INT64 a3, UINT64 a4, INT64 *arg20){
  __int64 v5; 
  int inited; 
  VOID *PoolWithTag; 
  _QWORD *v12; 
  __int64 v13; 
  v5 = 0i64;
  if( (unsigned __int64)a2 + 44 <= a4 )
  {
    PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, 0x58ui64, 0x6C506F50ui64);
    v5 = (__int64)PoolWithTag;
    if( PoolWithTag )
    {
      memset((INT64)PoolWithTag, 0i64);
      inited = PopPlInitWString((PUNICODE_STRING)v5);
      if( inited < 0 )
        goto LABEL_9;
      *(_QWORD *)(v5 + 16) = a1;
      v12 = (_QWORD *)(v5 + 36);
      v13 = 4i64;
      do
      {
        *v12 = *(_QWORD *)((char *)v12 + (_QWORD)a2 - v5 - 32);
        ++v12;
        --v13;
      }
      while( v13 );
      inited = PopPlInitComponents(
                 v5,
                 (__int128 *)(a3 + *((unsigned int *)a2 + 10)),
                 *((unsigned int *)a2 + 9),
                 a3,
                 a4,
                 (unsigned __int64 *)(v5 + 72),
                 (_QWORD *)(v5 + 80));
      if( inited < 0 )
      {
LABEL_9:
        ExFreePoolWithTag((PVOID)v5, 0x6C506F50u);
        v5 = 0i64;
      }
    }
    else
    {
      inited = -1073741670;
    }
  }
  else
  {
    inited = -1073741306;
  }
  *arg20 = v5;
  return(unsigned int)inited;
}

Referenced by:

PopPlInitDevices