L L4D2node

CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>::RemoveRebalance

0x007d2490 · 2257 bytes · __thiscall

_ZN10CUtlRBTreeI7CHandleI11CBaseEntityEtPFbRKS2_S4_E10CUtlMemoryI15UtlRBTreeNode_tIS2_tEtEE15RemoveRebalanceEt

Decompiled

undefined (2 params)

/* WARNING: Type propagation algorithm not settling */
/* CUtlRBTree<CHandle<CBaseEntity>, unsigned short, bool (*)(CHandle<CBaseEntity> const&,
   CHandle<CBaseEntity> const&), CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>, unsigned short>,
   unsigned short> >::RemoveRebalance(unsigned short) */

void __thiscall
CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
::RemoveRebalance(CUtlRBTree<CHandle<CBaseEntity>,unsigned_short,bool(*)(CHandle<CBaseEntity>const&,CHandle<CBaseEntity>const&),CUtlMemory<UtlRBTreeNode_t<CHandle<CBaseEntity>,unsigned_short>,unsigned_short>>
                  *this,ushort param_1)

{
  ushort uVar1;
  uint uVar2;
  ushort *puVar3;
  int iVar4;
  undefined2 *puVar5;
  short sVar6;
  ushort uVar7;
  ushort uVar8;
  uint local_28;
  uint local_20;
  
  uVar2 = (uint)*(ushort *)(this + 0x10);
  local_20 = (uint)param_1;
LAB_007d24b0:
  do {
    sVar6 = (short)local_20;
    if (sVar6 == (short)uVar2) {
LAB_007d24bb:
      *(undefined2 *)(*(int *)(this + 4) + local_20 * 0xc + 6) = 1;
      return;
    }
    if ((Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
      Links(unsigned_short)::s_Sentinel = -1;
      DAT_00f4ee6a = 0xffff;
      DAT_00f4ee6c = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      if (sVar6 == -1) goto LAB_007d2af0;
LAB_007d24f7:
      puVar5 = (undefined2 *)(*(int *)(this + 4) + local_20 * 0xc);
    }
    else {
      if (sVar6 != -1) goto LAB_007d24f7;
LAB_007d2af0:
      puVar5 = &Links(unsigned_short)::s_Sentinel;
      local_20 = 0xffff;
    }
    if (puVar5[3] != 1) goto LAB_007d24bb;
    uVar8 = (ushort)local_20;
    if (Links(unsigned_short)::s_Sentinel != '\0') {
LAB_007d251c:
      if (sVar6 != -1) goto LAB_007d2526;
LAB_007d26d3:
      local_20 = (uint)DAT_00f4ee6c;
      if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_007d26f0;
LAB_007d2541:
      if ((short)local_20 != -1) goto LAB_007d254b;
LAB_007d2748:
      if (sVar6 == Links(unsigned_short)::s_Sentinel) goto LAB_007d2760;
LAB_007d255d:
      uVar7 = (ushort)local_20;
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar4 != 0) {
          Links(unsigned_short)::s_Sentinel = -1;
          DAT_00f4ee6a = 0xffff;
          DAT_00f4ee6c = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        if (uVar7 == 0xffff) goto LAB_007d2a7d;
LAB_007d2576:
        puVar3 = (ushort *)(*(int *)(this + 4) + local_20 * 0xc);
      }
      else {
        if (uVar7 != 0xffff) goto LAB_007d2576;
LAB_007d2a7d:
        puVar3 = (ushort *)&Links(unsigned_short)::s_Sentinel;
      }
      uVar1 = *puVar3;
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
        DAT_00f4ee6a = 0xffff;
        DAT_00f4ee6c = 0xffff;
        Links(unsigned_short)::s_Sentinel = -1;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar1 == 0xffff) goto LAB_007d28c0;
LAB_007d259c:
        local_28 = (uint)uVar1;
        sVar6 = *(short *)(*(int *)(this + 4) + local_28 * 0xc + 6);
      }
      else {
        if (uVar1 != 0xffff) goto LAB_007d259c;
LAB_007d28c0:
        local_28 = 0xffff;
        sVar6 = DAT_00f4ee6e;
      }
      if (sVar6 == 0) {
        *(undefined2 *)(*(int *)(this + 4) + local_28 * 0xc + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + local_20 * 0xc + 6) = 0;
        RotateRight(this,uVar7);
        iVar4 = Links(this,uVar8);
        local_20 = (uint)*(ushort *)(iVar4 + 4);
        puVar3 = (ushort *)Links(this,*(ushort *)(iVar4 + 4));
        uVar1 = *puVar3;
        local_28 = (uint)uVar1;
      }
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
        Links(unsigned_short)::s_Sentinel = -1;
        DAT_00f4ee6a = 0xffff;
        DAT_00f4ee6c = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      uVar7 = DAT_00f4ee6a;
      if (uVar1 != 0xffff) {
        uVar7 = *(ushort *)(*(int *)(this + 4) + local_28 * 0xc + 2);
      }
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
        Links(unsigned_short)::s_Sentinel = -1;
        DAT_00f4ee6a = 0xffff;
        DAT_00f4ee6c = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      sVar6 = DAT_00f4ee6e;
      if (uVar7 != 0xffff) {
        sVar6 = *(short *)(*(int *)(this + 4) + (uint)uVar7 * 0xc + 6);
      }
      uVar7 = (ushort)local_28;
      if (sVar6 == 1) {
        puVar3 = (ushort *)Links(this,uVar7);
        iVar4 = Links(this,*puVar3);
        if (*(short *)(iVar4 + 6) == 1) {
LAB_007d2a2c:
          if (uVar1 == 0xffff) {
            uVar2 = (uint)*(ushort *)(this + 0x10);
          }
          else {
            *(undefined2 *)(*(int *)(this + 4) + local_28 * 0xc + 6) = 0;
            uVar2 = (uint)*(ushort *)(this + 0x10);
          }
          goto LAB_007d24b0;
        }
      }
      puVar3 = (ushort *)Links(this,uVar7);
      iVar4 = Links(this,*puVar3);
      if (*(short *)(iVar4 + 6) == 1) {
        iVar4 = Links(this,uVar7);
        *(undefined2 *)(*(int *)(this + 4) + (uint)*(ushort *)(iVar4 + 2) * 0xc + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + local_28 * 0xc + 6) = 0;
        RotateLeft(this,uVar7);
        iVar4 = Links(this,uVar8);
        local_20 = (uint)*(ushort *)(iVar4 + 4);
        puVar3 = (ushort *)Links(this,*(ushort *)(iVar4 + 4));
        local_28 = (uint)*puVar3;
      }
      iVar4 = Links(this,(ushort)local_20);
      *(undefined2 *)(*(int *)(this + 4) + local_28 * 0xc + 6) = *(undefined2 *)(iVar4 + 6);
      *(undefined2 *)(*(int *)(this + 4) + local_20 * 0xc + 6) = 1;
      puVar3 = (ushort *)Links(this,(ushort)local_28);
      *(undefined2 *)(*(int *)(this + 4) + (uint)*puVar3 * 0xc + 6) = 1;
      RotateRight(this,(ushort)local_20);
      uVar2 = (uint)*(ushort *)(this + 0x10);
      local_20 = uVar2;
      goto LAB_007d24b0;
    }
    iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
    if (iVar4 != 0) {
      Links(unsigned_short)::s_Sentinel = -1;
      DAT_00f4ee6a = 0xffff;
      DAT_00f4ee6c = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      goto LAB_007d251c;
    }
    if (sVar6 == -1) goto LAB_007d26d3;
LAB_007d2526:
    local_20 = (uint)*(ushort *)(*(int *)(this + 4) + local_20 * 0xc + 4);
    if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_007d2541;
LAB_007d26f0:
    iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
    if (iVar4 == 0) goto LAB_007d2541;
    Links(unsigned_short)::s_Sentinel = -1;
    DAT_00f4ee6a = 0xffff;
    DAT_00f4ee6c = 0xffff;
    __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
    if ((short)local_20 == -1) goto LAB_007d2748;
LAB_007d254b:
    if (sVar6 != *(short *)(*(int *)(this + 4) + local_20 * 0xc)) goto LAB_007d255d;
LAB_007d2760:
    iVar4 = Links(this,(ushort)local_20);
    uVar1 = *(ushort *)(iVar4 + 2);
    if ((Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
      Links(unsigned_short)::s_Sentinel = -1;
      DAT_00f4ee6a = 0xffff;
      DAT_00f4ee6c = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      if (uVar1 == 0xffff) goto LAB_007d2c00;
LAB_007d278f:
      local_28 = (uint)uVar1;
      puVar5 = (undefined2 *)(*(int *)(this + 4) + local_28 * 0xc);
    }
    else {
      if (uVar1 != 0xffff) goto LAB_007d278f;
LAB_007d2c00:
      puVar5 = &Links(unsigned_short)::s_Sentinel;
      local_28 = 0xffff;
    }
    if (puVar5[3] == 0) {
      *(undefined2 *)(*(int *)(this + 4) + local_28 * 0xc + 6) = 1;
      *(undefined2 *)(*(int *)(this + 4) + local_20 * 0xc + 6) = 0;
      RotateLeft(this,(ushort)local_20);
      iVar4 = Links(this,uVar8);
      local_20 = (uint)*(ushort *)(iVar4 + 4);
      iVar4 = Links(this,*(ushort *)(iVar4 + 4));
      uVar1 = *(ushort *)(iVar4 + 2);
      local_28 = (uint)uVar1;
    }
    uVar7 = (ushort)local_28;
    puVar3 = (ushort *)Links(this,uVar7);
    iVar4 = Links(this,*puVar3);
    if (*(short *)(iVar4 + 6) == 1) {
      iVar4 = Links(this,uVar7);
      iVar4 = Links(this,*(ushort *)(iVar4 + 2));
      if (*(short *)(iVar4 + 6) != 1) goto LAB_007d27d2;
      goto LAB_007d2a2c;
    }
LAB_007d27d2:
    iVar4 = Links(this,uVar7);
    iVar4 = Links(this,*(ushort *)(iVar4 + 2));
    if (*(short *)(iVar4 + 6) == 1) {
      puVar3 = (ushort *)Links(this,uVar7);
      *(undefined2 *)(*(int *)(this + 4) + (uint)*puVar3 * 0xc + 6) = 1;
      *(undefined2 *)(*(int *)(this + 4) + local_28 * 0xc + 6) = 0;
      RotateRight(this,uVar7);
      iVar4 = Links(this,uVar8);
      local_20 = (uint)*(ushort *)(iVar4 + 4);
      iVar4 = Links(this,*(ushort *)(iVar4 + 4));
      local_28 = (uint)*(ushort *)(iVar4 + 2);
    }
    iVar4 = Links(this,(ushort)local_20);
    *(undefined2 *)(*(int *)(this + 4) + local_28 * 0xc + 6) = *(undefined2 *)(iVar4 + 6);
    *(undefined2 *)(*(int *)(this + 4) + local_20 * 0xc + 6) = 1;
    iVar4 = Links(this,(ushort)local_28);
    *(undefined2 *)(*(int *)(this + 4) + (uint)*(ushort *)(iVar4 + 2) * 0xc + 6) = 1;
    RotateLeft(this,(ushort)local_20);
    uVar2 = (uint)*(ushort *)(this + 0x10);
    local_20 = uVar2;
  } while( true );
}

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)