L L4D2node

CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>>::InsertRebalance

0x001bb640 · 2800 bytes · __thiscall

_ZN10CUtlRBTreeIN8CNetChan13SplitPlayer_tEtPFbRKS1_S3_E10CUtlMemoryI15UtlRBTreeNode_tIS1_tEtEE15InsertRebalanceEt

Decompiled

undefined (2 params)

/* CUtlRBTree<CNetChan::SplitPlayer_t, unsigned short, bool (*)(CNetChan::SplitPlayer_t const&,
   CNetChan::SplitPlayer_t const&), CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t, unsigned
   short>, unsigned short> >::InsertRebalance(unsigned short) */

void __thiscall
CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>>
::InsertRebalance(CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_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_001bb6a5:
      *(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_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar12 == 0xffff) goto LAB_001bb9f5;
LAB_001bb672:
      puVar4 = (undefined2 *)(uVar13 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar12 != 0xffff) goto LAB_001bb672;
LAB_001bb9f5:
      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_00341692 = 0xffff;
      Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_00341694 = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      if (uVar1 == 0xffff) goto LAB_001bb9c0;
LAB_001bb691:
      puVar4 = (undefined2 *)((uint)uVar1 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar1 != 0xffff) goto LAB_001bb691;
LAB_001bb9c0:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    if (puVar4[3] != 0) {
      uVar1 = *(ushort *)(this + 0x10);
      goto LAB_001bb6a5;
    }
    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_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar12 == 0xffff) goto LAB_001bb965;
LAB_001bb6d9:
      puVar4 = (undefined2 *)(uVar13 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar12 != 0xffff) goto LAB_001bb6d9;
LAB_001bb965:
      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_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 == 0xffff) goto LAB_001bb935;
LAB_001bb6fe:
      puVar4 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
    }
    else {
      if (uVar1 != 0xffff) goto LAB_001bb6fe;
LAB_001bb935:
      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_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_001bb713;
      }
      if (uVar1 == 0xffff) goto LAB_001bb903;
LAB_001bb71d:
      puVar4 = (undefined2 *)(uVar11 * 0x10 + *(int *)(this + 4));
    }
    else {
LAB_001bb713:
      if (uVar1 != 0xffff) goto LAB_001bb71d;
LAB_001bb903:
      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_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_001bb732;
      }
      if (uVar2 == 0xffff) goto LAB_001bb8c9;
LAB_001bb73c:
      puVar8 = (ushort *)((uint)uVar2 * 0x10 + *(int *)(this + 4));
    }
    else {
LAB_001bb732:
      if (uVar2 != 0xffff) goto LAB_001bb73c;
LAB_001bb8c9:
      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_00341692 = 0xffff;
          DAT_00341694 = 0xffff;
          Links(unsigned_short)::s_Sentinel = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_001bb756;
        }
        if (uVar7 == 0xffff) goto LAB_001bbb1b;
LAB_001bb760:
        puVar4 = (undefined2 *)(uVar10 * 0x10 + *(int *)(this + 4));
      }
      else {
LAB_001bb756:
        if (uVar7 != 0xffff) goto LAB_001bb760;
LAB_001bbb1b:
        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_00341694 = 0xffff;
        DAT_00341692 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      sVar3 = DAT_00341696;
      if (uVar7 != 0xffff) {
        sVar3 = *(short *)(uVar9 * 0x10 + *(int *)(this + 4) + 6);
      }
      if (sVar3 == 0) {
LAB_001bb793:
        *(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_00341692 = 0xffff;
            DAT_00341694 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
            goto LAB_001bba7f;
          }
          if (uVar12 == 0xffff) goto LAB_001bbe8b;
LAB_001bba89:
          uVar7 = *(ushort *)(uVar13 * 0x10 + *(int *)(this + 4) + 4);
          if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_001bba9e;
LAB_001bbea0:
          iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar6 == 0) goto LAB_001bba9e;
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00341692 = 0xffff;
          DAT_00341694 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          if (uVar7 == 0xffff) goto LAB_001bbf00;
LAB_001bbaa8:
          if (uVar12 != *(ushort *)((uint)uVar7 * 0x10 + *(int *)(this + 4) + 2)) goto LAB_001bbabe;
LAB_001bbf18:
          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_00341692 = 0xffff;
            DAT_00341694 = 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_00341692 = 0xffff;
            DAT_00341694 = 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_001bba7f:
          if (uVar12 != 0xffff) goto LAB_001bba89;
LAB_001bbe8b:
          uVar7 = DAT_00341694;
          if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_001bbea0;
LAB_001bba9e:
          if (uVar7 != 0xffff) goto LAB_001bbaa8;
LAB_001bbf00:
          if (uVar12 == DAT_00341692) goto LAB_001bbf18;
LAB_001bbabe:
          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_00341692 = 0xffff;
          DAT_00341694 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_001bb7d8;
        }
        if (uVar7 == 0xffff) goto LAB_001bbbc3;
LAB_001bb7e2:
        puVar8 = (ushort *)(uVar10 * 0x10 + *(int *)(this + 4));
      }
      else {
LAB_001bb7d8:
        if (uVar7 != 0xffff) goto LAB_001bb7e2;
LAB_001bbbc3:
        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_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar7 == 0xffff) goto LAB_001bbb88;
LAB_001bb800:
        puVar4 = (undefined2 *)(uVar9 * 0x10 + *(int *)(this + 4));
      }
      else {
        if (uVar7 != 0xffff) goto LAB_001bb800;
LAB_001bbb88:
        puVar4 = &Links(unsigned_short)::s_Sentinel;
      }
      if (puVar4[3] == 0) goto LAB_001bb793;
      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_00341692 = 0xffff;
          DAT_00341694 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          goto LAB_001bb823;
        }
        if (uVar12 == 0xffff) goto LAB_001bbddb;
LAB_001bb82d:
        uVar7 = *(ushort *)(uVar13 * 0x10 + *(int *)(this + 4) + 4);
        if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_001bb842;
LAB_001bbdf0:
        iVar6 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar6 == 0) goto LAB_001bb842;
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar7 == 0xffff) goto LAB_001bbe50;
LAB_001bb84c:
        puVar8 = (ushort *)((uint)uVar7 * 0x10 + *(int *)(this + 4));
      }
      else {
LAB_001bb823:
        if (uVar12 != 0xffff) goto LAB_001bb82d;
LAB_001bbddb:
        uVar7 = DAT_00341694;
        if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_001bbdf0;
LAB_001bb842:
        if (uVar7 != 0xffff) goto LAB_001bb84c;
LAB_001bbe50:
        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_00341692 = 0xffff;
          DAT_00341694 = 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_00341692 = 0xffff;
          DAT_00341694 = 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)