L L4D2node

CLagCompensationManager::FrameUpdatePostEntityThink

0x007ccc60 · 2389 bytes · __thiscall

_ZN23CLagCompensationManager26FrameUpdatePostEntityThinkEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CLagCompensationManager::FrameUpdatePostEntityThink() */

void __thiscall CLagCompensationManager::FrameUpdatePostEntityThink(CLagCompensationManager *this)

{
  CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
  *this_00;
  void *pvVar1;
  int *piVar2;
  ushort uVar3;
  short sVar4;
  CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
  *pCVar5;
  CBaseEntity *pCVar6;
  short *psVar7;
  ushort *puVar8;
  undefined4 *puVar9;
  uint uVar10;
  int iVar11;
  ushort uVar12;
  undefined *puVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  int iVar16;
  uint uVar17;
  CBaseEntity *local_94;
  CBaseEntity *local_84;
  CBaseEntity *local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_70 [2];
  CBaseEntity *local_68 [2];
  CBaseEntity *local_60;
  undefined1 *local_5c;
  undefined4 local_58;
  undefined4 local_54;
  int local_50;
  int local_4c;
  undefined4 local_48;
  undefined4 local_44;
  int local_40;
  int local_3c;
  code *local_38;
  int local_34;
  int local_30;
  undefined4 local_2c;
  ushort local_28;
  undefined2 local_26;
  ushort local_24;
  ushort local_22;
  undefined4 local_20;
  
  if ((*(int *)(gpGlobals + 0x14) < 2) || (*(int *)(sv_unlag._28_4_ + 0x30) == 0)) {
    pCVar5 = (CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
              *)(this + 0x10);
    for (uVar3 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                 ::FirstInorder(pCVar5); uVar3 != 0xffff;
        uVar3 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::NextInorder(pCVar5,uVar3)) {
      pvVar1 = *(void **)((uint)uVar3 * 0x10 + *(int *)(this + 0x14) + 0xc);
      if (pvVar1 != (void *)0x0) {
        CUtlLinkedList<LagRecord,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>>::
        RemoveAll((CUtlLinkedList<LagRecord,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>>
                   *)((int)pvVar1 + 4));
        CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>::Purge();
        operator_delete(pvVar1);
      }
    }
    CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
    ::RemoveAll(pCVar5);
    *(undefined2 *)(this + 0x24) = 0xffff;
    CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
    ::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
             *)(this + 0x14));
    *(undefined2 *)(this + 0x26) = 0xffff;
    return;
  }
  local_7c = 0;
  local_78 = 0;
  if (_towlower == 0) {
    local_50 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_7c,0,0,0,0,"/data/src/game/server/player_lagcompensation.cpp",0xb0,
               &FrameUpdatePostEntityThink()::tm_fmt,"(%s)%s","CLagCompensationManager",
               "FrameUpdatePostEntityThink");
    local_50 = _towlower;
  }
  local_58 = local_7c;
  local_54 = local_78;
                    /* try { // try from 007ccd47 to 007ccd4b has its CatchHandler @ 007cd5fa */
  CVProfile::EnterScope
            ((CVProfile *)&g_VProfCurrentProfile,"FrameUpdatePostEntityThink",0,
             "CLagCompensationManager",false,4);
  local_4c = 0;
  local_48 = 0;
  local_44 = 0;
  local_40 = 0;
  pCVar5 = (CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            *)(this + 0x10);
  local_3c = 0;
  for (uVar3 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
               ::FirstInorder(pCVar5); uVar3 != 0xffff;
      uVar3 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
              ::NextInorder(pCVar5,uVar3)) {
    local_38 = *(code **)((uint)uVar3 * 0x10 + *(int *)(this + 0x14) + 8);
    if ((((local_38 == (code *)0xffffffff) ||
         (puVar13 = g_pEntityList + ((uint)local_38 & 0xfff) * 0x10,
         puVar13 == (undefined *)0xfffffffc)) || (*(uint *)(puVar13 + 8) != (uint)local_38 >> 0xc))
       || (*(int *)(puVar13 + 4) == 0)) {
                    /* try { // try from 007ccdb1 to 007ccef4 has its CatchHandler @ 007cd60f */
      CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::InsertBefore
                ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)&local_4c,
                 local_40,(CHandle *)&local_38);
    }
  }
  iVar16 = 0;
  if (0 < local_40) {
    do {
      local_70[0] = *(undefined4 *)(local_4c + iVar16 * 4);
      uVar3 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
              ::Find(pCVar5,(Node_t *)local_70);
      if (uVar3 != 0xffff) {
        pvVar1 = *(void **)((uint)uVar3 * 0x10 + *(int *)(this + 0x14) + 0xc);
        if (pvVar1 != (void *)0x0) {
          CUtlLinkedList<LagRecord,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>>
          ::RemoveAll((CUtlLinkedList<LagRecord,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>>
                       *)((int)pvVar1 + 4));
          CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>::Purge();
          operator_delete(pvVar1);
        }
        CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::RemoveAt(pCVar5,uVar3);
      }
      iVar16 = iVar16 + 1;
    } while (iVar16 < local_40);
  }
  local_26 = 0;
  local_22 = 0xffff;
  iVar16 = 1;
  local_38 = CDefOps<CBaseEntity*>::LessFunc;
  local_34 = 0;
  local_30 = 0;
  local_2c = 0;
  local_28 = 0xffff;
  local_24 = 0xffff;
  local_20 = 0;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
                    /* try { // try from 007ccfc8 to 007cd168 has its CatchHandler @ 007cd62a */
      while ((pCVar6 = (CBaseEntity *)UTIL_PlayerByIndex(iVar16), pCVar6 == (CBaseEntity *)0x0 ||
             (local_60 = pCVar6,
             sVar4 = CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                     ::Find((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                             *)&local_38,&local_60), sVar4 != -1))) {
        iVar16 = iVar16 + 1;
        if (*(int *)(gpGlobals + 0x14) < iVar16) goto LAB_007cd00a;
      }
      local_60 = pCVar6;
      CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
      ::Insert((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                *)&local_38,&local_60);
      iVar16 = iVar16 + 1;
    } while (iVar16 <= *(int *)(gpGlobals + 0x14));
  }
LAB_007cd00a:
  iVar16 = TheNextBots();
  uVar17 = (uint)*(ushort *)(iVar16 + 0x10);
  if (uVar17 != 0xffff) {
    iVar11 = *(int *)(iVar16 + 4);
    do {
      puVar9 = (undefined4 *)(iVar11 + uVar17 * 8);
      piVar2 = (int *)*puVar9;
      if (piVar2 == (int *)0x0) {
        uVar3 = *(ushort *)((int)puVar9 + 6);
      }
      else {
        pCVar6 = (CBaseEntity *)(**(code **)(*piVar2 + 0xb8))(piVar2);
        if ((pCVar6 != (CBaseEntity *)0x0) &&
           (local_80 = pCVar6,
           sVar4 = CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                   ::Find((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                           *)&local_38,&local_80), sVar4 == -1)) {
          local_84 = pCVar6;
          CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
          ::Insert((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                    *)&local_38,&local_84);
        }
        iVar11 = *(int *)(iVar16 + 4);
        uVar3 = *(ushort *)(iVar11 + uVar17 * 8 + 6);
      }
      uVar17 = (uint)uVar3;
    } while (uVar17 != 0xffff);
  }
  this_00 = (CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
             *)(this + 0x58);
  uVar3 = *(ushort *)(this + 0x68);
  while( true ) {
    uVar17 = (uint)uVar3;
    psVar7 = (short *)CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
                      ::Links(this_00,uVar3);
    if (*psVar7 == -1) break;
    puVar8 = (ushort *)
             CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
             ::Links(this_00,uVar3);
    uVar3 = *puVar8;
  }
  uVar3 = local_28;
  for (; local_28 = uVar3, uVar17 != 0xffff; uVar17 = uVar17 & 0xffff) {
    uVar10 = *(uint *)(uVar17 * 0xc + *(int *)(this + 0x5c) + 8);
    if ((((uVar10 != 0xffffffff) &&
         (puVar13 = g_pEntityList + (uVar10 & 0xfff) * 0x10, puVar13 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar13 + 8) == uVar10 >> 0xc)) &&
       ((local_60 = *(CBaseEntity **)(puVar13 + 4), local_60 != (CBaseEntity *)0x0 &&
        (sVar4 = CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                 ::Find((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                         *)&local_38,&local_60), sVar4 == -1)))) {
      CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
      ::Insert((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                *)&local_38,&local_60);
    }
    uVar17 = CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
             ::NextInorder(this_00,(ushort)uVar17);
    uVar3 = local_28;
  }
  while( true ) {
    uVar17 = (uint)uVar3;
    psVar7 = (short *)CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                      ::Links((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                               *)&local_38,uVar3);
    uVar12 = local_22;
    if (*psVar7 == -1) break;
    puVar8 = (ushort *)
             CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
             ::Links((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                      *)&local_38,uVar3);
    uVar3 = *puVar8;
  }
  for (; local_22 = uVar12, uVar17 != 0xffff; uVar17 = uVar17 & 0xffff) {
    pCVar6 = *(CBaseEntity **)(local_34 + uVar17 * 0xc + 8);
    if (pCVar6 == (CBaseEntity *)0x0) {
      local_94 = (CBaseEntity *)&DAT_ffffffff;
    }
    else {
      puVar9 = (undefined4 *)(**(code **)(*(int *)pCVar6 + 0xc))(pCVar6);
      local_94 = (CBaseEntity *)*puVar9;
    }
    local_68[0] = local_94;
    uVar10 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
             ::Find(pCVar5,(Node_t *)local_68);
    uVar10 = uVar10 & 0xffff;
    if (uVar10 == 0xffff) {
                    /* try { // try from 007cd270 to 007cd555 has its CatchHandler @ 007cd62a */
      local_5c = ::operator_new(0x290);
      puVar9 = (undefined4 *)(local_5c + 0x68);
      *local_5c = 0;
      *(undefined4 *)(local_5c + 4) = 0;
      *(undefined4 *)(local_5c + 8) = 0;
      *(undefined4 *)(local_5c + 0xc) = 0;
      *(undefined4 *)(local_5c + 0x24) = 0;
      *(undefined4 *)(local_5c + 0x28) = 0xffffffff;
      *(undefined4 *)(local_5c + 0x10) = 0;
      *(undefined4 *)(local_5c + 0x14) = 0;
      *(undefined4 *)(local_5c + 0x18) = 0;
      *(undefined4 *)(local_5c + 0x1c) = 0;
      *(undefined4 *)(local_5c + 0x20) = 0;
      *(undefined4 *)(local_5c + 0x2c) = 0;
      puVar15 = puVar9;
      do {
        *puVar15 = 0;
        puVar14 = puVar15 + 4;
        puVar15[1] = 0;
        puVar15[2] = 0;
        puVar15[3] = 0;
        puVar15 = puVar14;
      } while (puVar14 != (undefined4 *)(local_5c + 0x158));
      *(undefined4 *)(local_5c + 0x30) = 0;
      *(undefined4 *)(local_5c + 0x34) = 0;
      *(undefined4 *)(local_5c + 0x38) = 0;
      *(undefined4 *)(local_5c + 0x3c) = 0;
      *(undefined4 *)(local_5c + 0x40) = 0;
      *(undefined4 *)(local_5c + 0x44) = 0;
      *(undefined4 *)(local_5c + 0x48) = 0;
      *(undefined4 *)(local_5c + 0x4c) = 0;
      *(undefined4 *)(local_5c + 0x50) = 0;
      *(undefined4 *)(local_5c + 0x54) = 0;
      *(undefined4 *)(local_5c + 0x58) = 0;
      *(undefined4 *)(local_5c + 0x5c) = 0;
      *(undefined4 *)(local_5c + 0x60) = 0;
      *(undefined4 *)(local_5c + 100) = 0xbf800000;
      *(undefined4 *)(local_5c + 0x158) = 0;
      *(undefined4 *)(local_5c + 0x15c) = 0;
      iVar16 = 0;
      while( true ) {
        *puVar9 = 0;
        puVar9[1] = 0;
        puVar9[2] = 0;
        puVar9[3] = 0;
        if (iVar16 + 0x10 == 0xf0) break;
        puVar9 = (undefined4 *)(local_5c + iVar16 + 0x78);
        iVar16 = iVar16 + 0x10;
      }
      puVar9 = (undefined4 *)(local_5c + 0x198);
      puVar15 = puVar9;
      do {
        *puVar15 = 0;
        puVar14 = puVar15 + 4;
        puVar15[1] = 0;
        puVar15[2] = 0;
        puVar15[3] = 0;
        puVar15 = puVar14;
      } while (puVar14 != (undefined4 *)(local_5c + 0x288));
      *(undefined4 *)(local_5c + 0x160) = 0;
      *(undefined4 *)(local_5c + 0x164) = 0;
      *(undefined4 *)(local_5c + 0x168) = 0;
      *(undefined4 *)(local_5c + 0x16c) = 0;
      *(undefined4 *)(local_5c + 0x170) = 0;
      *(undefined4 *)(local_5c + 0x174) = 0;
      *(undefined4 *)(local_5c + 0x178) = 0;
      *(undefined4 *)(local_5c + 0x17c) = 0;
      *(undefined4 *)(local_5c + 0x180) = 0;
      *(undefined4 *)(local_5c + 0x184) = 0;
      *(undefined4 *)(local_5c + 0x188) = 0;
      *(undefined4 *)(local_5c + 0x18c) = 0;
      *(undefined4 *)(local_5c + 400) = 0;
      *(undefined4 *)(local_5c + 0x194) = 0xbf800000;
      *(undefined4 *)(local_5c + 0x288) = 0;
      *(undefined4 *)(local_5c + 0x28c) = 0;
      iVar16 = 0;
      while( true ) {
        *puVar9 = 0;
        puVar9[1] = 0;
        puVar9[2] = 0;
        puVar9[3] = 0;
        if (iVar16 + 0x10 == 0xf0) break;
        puVar9 = (undefined4 *)(local_5c + iVar16 + 0x1a8);
        iVar16 = iVar16 + 0x10;
      }
      local_60 = local_94;
      uVar10 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
               ::Insert(pCVar5,(Node_t *)&local_60);
      uVar10 = uVar10 & 0xffff;
    }
    RecordDataIntoTrack(this,pCVar6,
                        (CUtlFixedLinkedList *)
                        (*(int *)(uVar10 * 0x10 + *(int *)(this + 0x14) + 0xc) + 4),true);
    uVar17 = CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
             ::NextInorder((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                            *)&local_38,(ushort)uVar17);
    uVar12 = local_22;
  }
  if (uVar12 != 0xffff) {
    iVar16 = 0;
    if (0 < local_30) {
      do {
        uVar3 = (ushort)iVar16;
        if ((iVar16 < local_30) && (uVar3 <= uVar12)) {
          if ((CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
               ::Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar11 = __cxa_guard_acquire(&CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                                            ::Links(unsigned_short)::s_Sentinel), iVar11 != 0)) {
            DAT_00f4ee62 = 0xffff;
            CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
            ::Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f4ee64 = 0xffff;
            __cxa_guard_release(&CUtlRBTree<CBaseEntity*,unsigned_short,bool(*)(CBaseEntity*const&,CBaseEntity*const&),CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>>
                                 ::Links(unsigned_short)::s_Sentinel);
          }
          puVar8 = (ushort *)(local_34 + iVar16 * 0xc);
          uVar12 = local_22;
          if (uVar3 != *puVar8) {
            puVar8[1] = local_24;
            *(ushort *)(local_34 + iVar16 * 0xc) = uVar3;
            local_24 = uVar3;
          }
        }
      } while (((uVar3 != uVar12) && ((int)(iVar16 + 1U & 0xffff) < local_30)) &&
              (iVar16 = iVar16 + 1, iVar16 != 0xffff));
    }
    local_28 = 0xffff;
    local_26 = 0;
  }
  local_24 = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short> *)&local_34);
  local_22 = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CBaseEntity*,unsigned_short>,unsigned_short> *)&local_34);
  local_40 = 0;
  CUtlMemory<CHandle<CBaseEntity>,int>::Purge((CUtlMemory<CHandle<CBaseEntity>,int> *)&local_4c);
  local_3c = local_4c;
  CUtlMemory<CHandle<CBaseEntity>,int>::Purge((CUtlMemory<CHandle<CBaseEntity>,int> *)&local_4c);
  CVProfile::ExitScope((CVProfile *)&g_VProfCurrentProfile);
  Tm_Zone::~Tm_Zone((Tm_Zone *)&local_58);
  return;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)