PopPepComponentSetResidency

INT64 __fastcall PopPepComponentSetResidency(UINT64 *a1, INT64 a2, UINT64 a3){
  UINT64 v3; 
  UINT64 *v5; 
  int ResidencyIdleState; 
  CHAR v7; 
  CHAR v8; 
  unsigned int ready; 
  unsigned int v10; 
  UINT8 v12; 
  v3 = 0i64;
  v5 = &a1[25 * (unsigned int)a2 + 23];
  v12 = 0;
  if( a3 != -1i64 )
    v3 = a3;
  ResidencyIdleState = PopPepComponentGetResidencyIdleState((INT64)v5, v3);
  v7 = PopPepLockActivityLink((INT64)a1, (volatile INT64 *)v5, 6ui64, 1ui64, &v12);
  v5[16] = v3;
  v8 = v7;
  v5[15] = v3;
  if( *((_DWORD *)v5 + 40) != ResidencyIdleState )
  {
    *((_DWORD *)v5 + 40) = ResidencyIdleState;
    ready = PopPepCountReadyActivities(a1, (INT64)v5, 2i64);
    PopPepUpdateIdleState((INT64)a1, v5, 1);
    PopPepPromoteActivities((INT64)a1, (INT64)v5, 2i64);
    v10 = PopPepCountReadyActivities(a1, (INT64)v5, 2i64);
    PopPepRequestWork(ready, v10);
  }
  return PopPepReleaseActivityLink((INT64)a1, (volatile INT64 *)v5, v8, v12);
}

Referenced by:

PoFxSetComponentResidency