Skip to content

Instantly share code, notes, and snippets.

@leoetlino
Created October 27, 2020 23:09
Show Gist options
  • Save leoetlino/c9e5ee039258277302ff2b0a2e1880a6 to your computer and use it in GitHub Desktop.
Save leoetlino/c9e5ee039258277302ff2b0a2e1880a6 to your computer and use it in GitHub Desktop.
BaseProcEvent *__fastcall BaseProcTaskPrioritizer::invoked(__int64 a1, TaskPrioritizerContext *ctx)
{
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
begin = ctx->it_begin;
end = ctx->it_end;
v5 = (BaseProcEvent *)begin->mPtr;
v6 = end->mPtr;
if ( begin->mPtr == end->mPtr )
return (BaseProcEvent *)ctx->it_begin->mPtr;
v7 = begin->mOffset;
min = 3.4028e38;
v9 = (unsigned __int8 *)(unsigned int)-(signed int)v7;
v10 = 0LL;
v11 = 0LL;
v12 = (signed int)v9;
do
{
v13 = __ldar(v9);
if ( !((unsigned __int8)v9 & 1) && _cxa_guard_acquire_0(&unk_71026003D8) )
{
BaseProcEvent::rttiInfo = (__int64)&off_71024DB980;
_cxa_guard_release_0(&unk_71026003D8);
}
v14 = v5->_.vptr->_.rtti1((ksys::util::ManagedTask *)v5, &BaseProcEvent::rttiInfo);
if ( !v5 )
return v5;
if ( !v14 )
return v5;
if ( (unsigned __int8)ksys::util::Task::getLaneId((ksys::util::Task *)v5) == 2 )
return v5;
v15 = v5->placementObj;
if ( v15 )
{
if ( !(v15->flags0 & 4) )
return v5;
}
v16 = v5->distanceToLoadSphere;
v17 = v16 >= 0.0;
v18 = min > v16;
if ( v17 && v18 )
v10 = v5;
if ( v17 && v18 )
min = v5->distanceToLoadSphere;
v19 = ksys::util::Task::getLaneId((ksys::util::Task *)v5);
v9 = *(unsigned __int8 **)(&v5->_.b.entryId + v7);
if ( v19 == 1 )
v11 = v5;
v5 = (BaseProcEvent *)&v9[v12];
}
while ( &v9[v12] != (unsigned __int8 *)v6 );
if ( v10 )
return v10;
v10 = v11;
if ( !v11 )
return (BaseProcEvent *)ctx->it_begin->mPtr;
return v10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment