L L4D2node

CUtlRBTree<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,float,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>::InsertRebalance

0x004b9fb0 · 2399 bytes · __thiscall

_ZN10CUtlRBTreeIN7CUtlMapIjftE6Node_tEtNS1_8CKeyLessE10CUtlMemoryI15UtlRBTreeNode_tIS2_tEtEE15InsertRebalanceEt

Decompiled

undefined (2 params)

/* CUtlRBTree<CUtlMap<unsigned int, float, unsigned short>::Node_t, unsigned short, CUtlMap<unsigned
   int, float, unsigned short>::CKeyLess, CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned int, float,
   unsigned short>::Node_t, unsigned short>, unsigned short> >::InsertRebalance(unsigned short) */

void __thiscall
CUtlRBTree<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,float,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::InsertRebalance(CUtlRBTree<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,float,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,float,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                  *this,ushort param_1)

{
  ushort uVar1;
  ushort uVar2;
  short sVar3;
  undefined2 *puVar4;
  int iVar5;
  ushort uVar6;
  ushort *puVar7;
  uint uVar8;
  uint uVar9;
  uint uVar10;
  ushort local_1e;
  
  local_1e = param_1;
  do {
    uVar1 = *(ushort *)(this + 0x10);
    if (local_1e == uVar1) {
LAB_004ba01f:
      *(undefined2 *)((uint)uVar1 * 0x10 + *(int *)(this + 4) + 6) = 1;
      return;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (local_1e != 0xffff) goto LAB_004b9fef;
LAB_004ba381:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (local_1e == 0xffff) goto LAB_004ba381;
LAB_004b9fef:
      puVar4 = (undefined2 *)((uint)local_1e * 0x10 + *(int *)(this + 4));
    }
    uVar1 = puVar4[2];
    if ((Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
      Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_00f19322 = 0xffff;
      DAT_00f19324 = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      if (uVar1 != 0xffff) goto LAB_004ba00b;
LAB_004ba348:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (uVar1 == 0xffff) goto LAB_004ba348;
LAB_004ba00b:
      puVar4 = (undefined2 *)((uint)uVar1 * 0x10 + *(int *)(this + 4));
    }
    if (puVar4[3] != 0) {
      uVar1 = *(ushort *)(this + 0x10);
      goto LAB_004ba01f;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (local_1e != 0xffff) goto LAB_004ba05d;
LAB_004ba2e9:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (local_1e == 0xffff) goto LAB_004ba2e9;
LAB_004ba05d:
      puVar4 = (undefined2 *)((uint)local_1e * 0x10 + *(int *)(this + 4));
    }
    uVar1 = puVar4[2];
    uVar10 = (uint)uVar1;
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 != 0xffff) goto LAB_004ba07f;
LAB_004ba2b5:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (uVar1 == 0xffff) goto LAB_004ba2b5;
LAB_004ba07f:
      puVar4 = (undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4));
    }
    uVar6 = puVar4[2];
    uVar9 = (uint)uVar6;
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        Links(unsigned_short)::s_Sentinel = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_004ba093;
      }
      if (uVar1 != 0xffff) goto LAB_004ba09d;
LAB_004ba283:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
LAB_004ba093:
      if (uVar1 == 0xffff) goto LAB_004ba283;
LAB_004ba09d:
      puVar4 = (undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4));
    }
    uVar2 = puVar4[2];
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_004ba0b1;
      }
      if (uVar2 != 0xffff) goto LAB_004ba0bb;
LAB_004ba249:
      puVar7 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
LAB_004ba0b1:
      if (uVar2 == 0xffff) goto LAB_004ba249;
LAB_004ba0bb:
      puVar7 = (ushort *)((uint)uVar2 * 0x10 + *(int *)(this + 4));
    }
    if (uVar1 == *puVar7) {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar5 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f19322 = 0xffff;
          DAT_00f19324 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_004ba0d5;
        }
        if (uVar6 != 0xffff) goto LAB_004ba0df;
LAB_004ba4b3:
        puVar4 = &Links(unsigned_short)::s_Sentinel;
      }
      else {
LAB_004ba0d5:
        if (uVar6 == 0xffff) goto LAB_004ba4b3;
LAB_004ba0df:
        puVar4 = (undefined2 *)(uVar9 * 0x10 + *(int *)(this + 4));
      }
      uVar2 = puVar4[1];
      uVar8 = (uint)uVar2;
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      sVar3 = DAT_00f19326;
      if (uVar2 != 0xffff) {
        sVar3 = *(short *)(uVar8 * 0x10 + *(int *)(this + 4) + 6);
      }
      if (sVar3 == 0) {
LAB_004ba112:
        *(undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4) + 6) = 1;
        *(undefined2 *)(uVar8 * 0x10 + *(int *)(this + 4) + 6) = 1;
        *(undefined2 *)(uVar9 * 0x10 + *(int *)(this + 4) + 6) = 0;
        local_1e = uVar6;
      }
      else {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f19322 = 0xffff;
          DAT_00f19324 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        uVar6 = DAT_00f19324;
        if (local_1e != 0xffff) {
          uVar6 = *(ushort *)((uint)local_1e * 0x10 + *(int *)(this + 4) + 4);
        }
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f19322 = 0xffff;
          DAT_00f19324 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        uVar2 = DAT_00f19322;
        if (uVar6 != 0xffff) {
          uVar2 = *(ushort *)((uint)uVar6 * 0x10 + *(int *)(this + 4) + 2);
        }
        if (local_1e == uVar2) {
          RotateLeft(this,uVar1);
          iVar5 = Links(this,uVar1);
          uVar10 = (uint)*(ushort *)(iVar5 + 4);
          iVar5 = Links(this,*(ushort *)(iVar5 + 4));
          uVar9 = (uint)*(ushort *)(iVar5 + 4);
          local_1e = uVar1;
        }
        *(undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4) + 6) = 1;
        *(undefined2 *)(uVar9 * 0x10 + *(int *)(this + 4) + 6) = 0;
        RotateRight(this,(ushort)uVar9);
      }
    }
    else {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar5 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f19322 = 0xffff;
          DAT_00f19324 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_004ba158;
        }
        if (uVar6 != 0xffff) goto LAB_004ba162;
LAB_004ba55b:
        puVar7 = &Links(unsigned_short)::s_Sentinel;
      }
      else {
LAB_004ba158:
        if (uVar6 == 0xffff) goto LAB_004ba55b;
LAB_004ba162:
        puVar7 = (ushort *)(uVar9 * 0x10 + *(int *)(this + 4));
      }
      uVar2 = *puVar7;
      uVar8 = (uint)uVar2;
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar2 != 0xffff) goto LAB_004ba180;
LAB_004ba520:
        puVar4 = &Links(unsigned_short)::s_Sentinel;
      }
      else {
        if (uVar2 == 0xffff) goto LAB_004ba520;
LAB_004ba180:
        puVar4 = (undefined2 *)(uVar8 * 0x10 + *(int *)(this + 4));
      }
      if (puVar4[3] == 0) goto LAB_004ba112;
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar5 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f19322 = 0xffff;
          DAT_00f19324 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_004ba1a3;
        }
        if (local_1e != 0xffff) goto LAB_004ba1b1;
LAB_004ba74f:
        uVar6 = DAT_00f19324;
        if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_004ba1c3;
LAB_004ba760:
        iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar5 == 0) goto LAB_004ba1c3;
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f19322 = 0xffff;
        DAT_00f19324 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar6 != 0xffff) goto LAB_004ba1cd;
LAB_004ba7c0:
        puVar7 = &Links(unsigned_short)::s_Sentinel;
      }
      else {
LAB_004ba1a3:
        if (local_1e == 0xffff) goto LAB_004ba74f;
LAB_004ba1b1:
        uVar6 = *(ushort *)((uint)local_1e * 0x10 + *(int *)(this + 4) + 4);
        if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_004ba760;
LAB_004ba1c3:
        if (uVar6 == 0xffff) goto LAB_004ba7c0;
LAB_004ba1cd:
        puVar7 = (ushort *)((uint)uVar6 * 0x10 + *(int *)(this + 4));
      }
      if (local_1e == *puVar7) {
        RotateRight(this,uVar1);
        iVar5 = Links(this,uVar1);
        uVar10 = (uint)*(ushort *)(iVar5 + 4);
        iVar5 = Links(this,*(ushort *)(iVar5 + 4));
        uVar9 = (uint)*(ushort *)(iVar5 + 4);
        local_1e = uVar1;
      }
      *(undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4) + 6) = 1;
      *(undefined2 *)(uVar9 * 0x10 + *(int *)(this + 4) + 6) = 0;
      RotateLeft(this,(ushort)uVar9);
    }
  } 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)