L L4D2node

CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>::InsertRebalance

0x00096270 · 2800 bytes · __thiscall

_ZN10CUtlRBTreeIN7CUtlMapIPKcitE6Node_tEtNS3_8CKeyLessE10CUtlMemoryI15UtlRBTreeNode_tIS4_tEtEE15InsertRebalanceEt

Decompiled

undefined (2 params)

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

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

{
  ushort uVar1;
  ushort uVar2;
  short sVar3;
  undefined2 *puVar4;
  undefined2 *puVar5;
  int iVar6;
  ushort uVar7;
  ushort *puVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  ushort uVar12;
  uint uVar13;
  
  uVar13 = (uint)param_1;
  do {
    uVar1 = *(ushort *)(this + 0x10);
    uVar12 = (ushort)uVar13;
    if (uVar12 == uVar1) {
LAB_000962d5:
      *(undefined2 *)((uint)uVar1 * 0x10 + *(int *)(this + 4) + 6) = 1;
      return;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar6 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28da = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar12 == 0xffff) goto LAB_00096625;
LAB_000962a2:
      puVar4 = (undefined2 *)(uVar13 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar12 != 0xffff) goto LAB_000962a2;
LAB_00096625:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    uVar1 = puVar4[2];
    if ((Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
      DAT_000d28da = 0xffff;
      Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_000d28dc = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      if (uVar1 == 0xffff) goto LAB_000965f0;
LAB_000962c1:
      puVar4 = (undefined2 *)((uint)uVar1 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar1 != 0xffff) goto LAB_000962c1;
LAB_000965f0:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    if (puVar4[3] != 0) {
      uVar1 = *(ushort *)(this + 0x10);
      goto LAB_000962d5;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar6 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28da = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar12 == 0xffff) goto LAB_00096595;
LAB_00096309:
      puVar4 = (undefined2 *)(uVar13 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar12 != 0xffff) goto LAB_00096309;
LAB_00096595:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    uVar1 = puVar4[2];
    uVar11 = (uint)uVar1;
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar6 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28da = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 == 0xffff) goto LAB_00096565;
LAB_0009632e:
      puVar4 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar1 != 0xffff) goto LAB_0009632e;
LAB_00096565:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    uVar7 = puVar4[2];
    uVar10 = (uint)uVar7;
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar6 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28da = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_00096343;
      }
      if (uVar1 == 0xffff) goto LAB_00096533;
LAB_0009634d:
      puVar4 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
    }
    else {
LAB_00096343:
      if (uVar1 != 0xffff) goto LAB_0009634d;
LAB_00096533:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    uVar2 = puVar4[2];
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar6 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28da = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_00096362;
      }
      if (uVar2 == 0xffff) goto LAB_000964f9;
LAB_0009636c:
      puVar8 = (ushort *)((uint)uVar2 * 0x10 + *(int *)(this + 4));
    }
    else {
LAB_00096362:
      if (uVar2 != 0xffff) goto LAB_0009636c;
LAB_000964f9:
      puVar8 = &Links(unsigned_short)::s_Sentinel;
    }
    if (uVar1 == *puVar8) {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar6 != 0) {
          DAT_000d28da = 0xffff;
          DAT_000d28dc = 0xffff;
          Links(unsigned_short)::s_Sentinel = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_00096386;
        }
        if (uVar7 == 0xffff) goto LAB_0009674b;
LAB_00096390:
        puVar4 = (undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4));
      }
      else {
LAB_00096386:
        if (uVar7 != 0xffff) goto LAB_00096390;
LAB_0009674b:
        puVar4 = &Links(unsigned_short)::s_Sentinel;
      }
      uVar7 = puVar4[1];
      uVar9 = (uint)uVar7;
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28dc = 0xffff;
        DAT_000d28da = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      sVar3 = DAT_000d28de;
      if (uVar7 != 0xffff) {
        sVar3 = *(short *)(uVar9 * 0x10 + *(int *)(this + 4) + 6);
      }
      if (sVar3 == 0) {
LAB_000963c3:
        *(undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4) + 6) = 1;
        *(undefined2 *)(uVar9 * 0x10 + *(int *)(this + 4) + 6) = 1;
        *(undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4) + 6) = 0;
        uVar13 = uVar10;
      }
      else {
        if (Links(unsigned_short)::s_Sentinel == '\0') {
          iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar6 != 0) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_000d28da = 0xffff;
            DAT_000d28dc = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
            goto LAB_000966af;
          }
          if (uVar12 == 0xffff) goto LAB_00096abb;
LAB_000966b9:
          uVar7 = *(ushort *)(uVar13 * 0x10 + *(int *)(this + 4) + 4);
          if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_000966ce;
LAB_00096ad0:
          iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar6 == 0) goto LAB_000966ce;
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_000d28da = 0xffff;
          DAT_000d28dc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          if (uVar7 == 0xffff) goto LAB_00096b30;
LAB_000966d8:
          if (uVar12 != *(ushort *)((uint)uVar7 * 0x10 + *(int *)(this + 4) + 2)) goto LAB_000966ee;
LAB_00096b48:
          RotateLeft(this,uVar1);
          if ((Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_000d28da = 0xffff;
            DAT_000d28dc = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (uVar1 == 0xffff) {
            puVar4 = &Links(unsigned_short)::s_Sentinel;
          }
          else {
            puVar4 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
          }
          uVar1 = puVar4[2];
          if ((Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_000d28da = 0xffff;
            DAT_000d28dc = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (uVar1 == 0xffff) {
            puVar4 = &Links(unsigned_short)::s_Sentinel;
            puVar5 = (undefined2 *)(*(int *)(this + 4) + 0xffff0);
          }
          else {
            puVar5 = (undefined2 *)((uint)uVar1 * 0x10 + *(int *)(this + 4));
            puVar4 = puVar5;
          }
          uVar10 = (uint)(ushort)puVar4[2];
        }
        else {
LAB_000966af:
          if (uVar12 != 0xffff) goto LAB_000966b9;
LAB_00096abb:
          uVar7 = DAT_000d28dc;
          if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_00096ad0;
LAB_000966ce:
          if (uVar7 != 0xffff) goto LAB_000966d8;
LAB_00096b30:
          if (uVar12 == DAT_000d28da) goto LAB_00096b48;
LAB_000966ee:
          puVar5 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
          uVar11 = uVar13;
        }
        puVar5[3] = 1;
        *(undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4) + 6) = 0;
        RotateRight(this,(ushort)uVar10);
        uVar13 = uVar11;
      }
    }
    else {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar6 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_000d28da = 0xffff;
          DAT_000d28dc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_00096408;
        }
        if (uVar7 == 0xffff) goto LAB_000967f3;
LAB_00096412:
        puVar8 = (ushort *)(uVar10 * 0x10 + *(int *)(this + 4));
      }
      else {
LAB_00096408:
        if (uVar7 != 0xffff) goto LAB_00096412;
LAB_000967f3:
        puVar8 = &Links(unsigned_short)::s_Sentinel;
      }
      uVar7 = *puVar8;
      uVar9 = (uint)uVar7;
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28da = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar7 == 0xffff) goto LAB_000967b8;
LAB_00096430:
        puVar4 = (undefined2 *)(uVar9 * 0x10 + *(int *)(this + 4));
      }
      else {
        if (uVar7 != 0xffff) goto LAB_00096430;
LAB_000967b8:
        puVar4 = &Links(unsigned_short)::s_Sentinel;
      }
      if (puVar4[3] == 0) goto LAB_000963c3;
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar6 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_000d28da = 0xffff;
          DAT_000d28dc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_00096453;
        }
        if (uVar12 == 0xffff) goto LAB_00096a0b;
LAB_0009645d:
        uVar7 = *(ushort *)(uVar13 * 0x10 + *(int *)(this + 4) + 4);
        if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_00096472;
LAB_00096a20:
        iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar6 == 0) goto LAB_00096472;
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28da = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar7 == 0xffff) goto LAB_00096a80;
LAB_0009647c:
        puVar8 = (ushort *)((uint)uVar7 * 0x10 + *(int *)(this + 4));
      }
      else {
LAB_00096453:
        if (uVar12 != 0xffff) goto LAB_0009645d;
LAB_00096a0b:
        uVar7 = DAT_000d28dc;
        if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_00096a20;
LAB_00096472:
        if (uVar7 != 0xffff) goto LAB_0009647c;
LAB_00096a80:
        puVar8 = &Links(unsigned_short)::s_Sentinel;
      }
      if (uVar12 == *puVar8) {
        RotateRight(this,uVar1);
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_000d28da = 0xffff;
          DAT_000d28dc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        if (uVar1 == 0xffff) {
          puVar4 = &Links(unsigned_short)::s_Sentinel;
        }
        else {
          puVar4 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
        }
        uVar1 = puVar4[2];
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar6 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_000d28da = 0xffff;
          DAT_000d28dc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        if (uVar1 == 0xffff) {
          puVar4 = &Links(unsigned_short)::s_Sentinel;
          puVar5 = (undefined2 *)(*(int *)(this + 4) + 0xffff0);
        }
        else {
          puVar5 = (undefined2 *)((uint)uVar1 * 0x10 + *(int *)(this + 4));
          puVar4 = puVar5;
        }
        uVar10 = (uint)(ushort)puVar4[2];
      }
      else {
        puVar5 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
        uVar11 = uVar13;
      }
      puVar5[3] = 1;
      *(undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4) + 6) = 0;
      RotateLeft(this,(ushort)uVar10);
      uVar13 = uVar11;
    }
  } 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)