VOID __stdcall MiInitializeInPageSupport(VOID *Support, UINT64 Flags){
char v2;
char v4;
_ETHREAD *CurrentThread;
unsigned int SameThreadApcFlags;
unsigned int PagePriorityThread;
int v8;
_BYTE *v9;
v2 = Flags;
memset(Support, 0i64, 0x110u);
*(_WORD *)((char *)Support + 33) = 1536;
*((_QWORD *)Support + 6) = (char *)Support + 40;
v4 = 0;
*((_QWORD *)Support + 5) = (char *)Support + 40;
*((_DWORD *)Support + 9) = 0;
*((_QWORD *)Support + 9) = (char *)Support + 64;
*((_QWORD *)Support + 8) = (char *)Support + 64;
*((_WORD *)Support + 28) = 0;
*((_BYTE *)Support + 58) = 6;
*((_DWORD *)Support + 15) = 0;
if( (v2 & 1) != 0 )
*((_DWORD *)Support + 48) |= 0x40u;
*((_DWORD *)Support + 44) = 1;
*((_QWORD *)Support + 3) = (char *)Support + 16;
*((_QWORD *)Support + 2) = (char *)Support + 16;
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
*((_QWORD *)Support + 19) = CurrentThread;
SameThreadApcFlags = CurrentThread->SameThreadApcFlags;
if( (SameThreadApcFlags & 0x100) != 0 )
PagePriorityThread = (SameThreadApcFlags >> 9) & 7;
else
PagePriorityThread = PsGetPagePriorityThread(CurrentThread);
v8 = *((_DWORD *)Support + 48);
if( PagePriorityThread > 5 )
{
LOBYTE(PagePriorityThread) = 5;
v4 = 5;
}
else
{
v8 |= 0x80000u;
if( PagePriorityThread )
v4 = PagePriorityThread - 1;
}
*((_DWORD *)Support + 48) = v8 & 0xFFFF81FF | ((PagePriorityThread & 7 | (8 * (v4 & 7))) << 9);
if( (v2 & 2) != 0 )
{
v9 = KeAbPreAcquire(Support, 0i64, 0i64);
*((_QWORD *)Support + 27) = v9;
if( v9 )
v9[26] |= 1u;
}
}