L L4D2node

CUtlRBTree<CGameEvent,unsigned_short,bool(*)(CGameEvent_const&,CGameEvent_const&),CUtlMemory<UtlRBTreeNode_t<CGameEvent,unsigned_short>,unsigned_short>>::InsertRebalance

0x006dd9d0 · 2918 bytes · __thiscall

_ZN10CUtlRBTreeI10CGameEventtPFbRKS0_S2_E10CUtlMemoryI15UtlRBTreeNode_tIS0_tEtEE15InsertRebalanceEt

Decompiled

undefined (2 params)

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

void __thiscall
CUtlRBTree<CGameEvent,unsigned_short,bool(*)(CGameEvent_const&,CGameEvent_const&),CUtlMemory<UtlRBTreeNode_t<CGameEvent,unsigned_short>,unsigned_short>>
::InsertRebalance(CUtlRBTree<CGameEvent,unsigned_short,bool(*)(CGameEvent_const&,CGameEvent_const&),CUtlMemory<UtlRBTreeNode_t<CGameEvent,unsigned_short>,unsigned_short>>
                  *this,ushort param_1)

{
  ushort uVar1;
  int iVar2;
  undefined2 *puVar3;
  ushort uVar4;
  ushort *puVar5;
  undefined2 *puVar6;
  uint uVar7;
  ushort local_20;
  ushort local_1e;
  
  local_1e = param_1;
  do {
    uVar1 = *(ushort *)(this + 0x10);
    if (local_1e == uVar1) {
LAB_006dda45:
      *(undefined2 *)(*(int *)(this + 4) + (uint)uVar1 * 0x14 + 6) = 1;
      return;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f3c852 = 0xffff;
        DAT_00f3c854 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (local_1e != 0xffff) goto LAB_006dda0f;
LAB_006ddd91:
      puVar3 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (local_1e == 0xffff) goto LAB_006ddd91;
LAB_006dda0f:
      puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0x14);
    }
    uVar1 = puVar3[2];
    if ((Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
      DAT_00f3c852 = 0xffff;
      Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_00f3c854 = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      if (uVar1 != 0xffff) goto LAB_006dda31;
LAB_006ddd58:
      puVar3 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (uVar1 == 0xffff) goto LAB_006ddd58;
LAB_006dda31:
      puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar1 * 0x14);
    }
    if (puVar3[3] != 0) {
      uVar1 = *(ushort *)(this + 0x10);
      goto LAB_006dda45;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f3c852 = 0xffff;
        DAT_00f3c854 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (local_1e != 0xffff) goto LAB_006dda7d;
LAB_006ddcf9:
      puVar3 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (local_1e == 0xffff) goto LAB_006ddcf9;
LAB_006dda7d:
      puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0x14);
    }
    uVar1 = puVar3[2];
    uVar7 = (uint)uVar1;
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f3c852 = 0xffff;
        DAT_00f3c854 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 != 0xffff) goto LAB_006ddaa2;
LAB_006ddc85:
      local_20 = DAT_00f3c854;
      if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_006ddabb;
LAB_006ddca0:
      iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f3c852 = 0xffff;
        DAT_00f3c854 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 != 0xffff) goto LAB_006ddac5;
LAB_006ddcc5:
      puVar3 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (uVar1 == 0xffff) goto LAB_006ddc85;
LAB_006ddaa2:
      local_20 = *(ushort *)(*(int *)(this + 4) + uVar7 * 0x14 + 4);
      if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_006ddca0;
LAB_006ddabb:
      if (uVar1 == 0xffff) goto LAB_006ddcc5;
LAB_006ddac5:
      puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x14);
    }
    uVar4 = puVar3[2];
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f3c854 = 0xffff;
        DAT_00f3c852 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_006ddada;
      }
      if (uVar4 != 0xffff) goto LAB_006ddae4;
LAB_006ddc53:
      puVar5 = &Links(unsigned_short)::s_Sentinel;
    }
    else {
LAB_006ddada:
      if (uVar4 == 0xffff) goto LAB_006ddc53;
LAB_006ddae4:
      puVar5 = (ushort *)(*(int *)(this + 4) + (uint)uVar4 * 0x14);
    }
    if (uVar1 == *puVar5) {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar2 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f3c852 = 0xffff;
          DAT_00f3c854 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        if (local_20 != 0xffff) goto LAB_006ddb0f;
LAB_006ddf59:
        puVar3 = &Links(unsigned_short)::s_Sentinel;
      }
      else {
        if (local_20 == 0xffff) goto LAB_006ddf59;
LAB_006ddb0f:
        puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x14);
      }
      uVar4 = puVar3[1];
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f3c852 = 0xffff;
        DAT_00f3c854 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar4 != 0xffff) goto LAB_006ddb31;
LAB_006dde88:
        if (DAT_00f3c856 == 0) goto LAB_006ddb48;
LAB_006ddea0:
        if (Links(unsigned_short)::s_Sentinel == '\0') {
          iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar2 != 0) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f3c852 = 0xffff;
            DAT_00f3c854 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (local_1e != 0xffff) goto LAB_006ddebd;
LAB_006de239:
          puVar3 = &Links(unsigned_short)::s_Sentinel;
        }
        else {
          if (local_1e == 0xffff) goto LAB_006de239;
LAB_006ddebd:
          puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0x14);
        }
        uVar4 = puVar3[2];
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f3c852 = 0xffff;
          DAT_00f3c854 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          if (uVar4 != 0xffff) goto LAB_006ddedf;
LAB_006de190:
          if (local_1e != DAT_00f3c852) goto LAB_006ddef9;
LAB_006de1a8:
          RotateLeft(this,uVar1);
          if ((Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f3c852 = 0xffff;
            DAT_00f3c854 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (uVar1 == 0xffff) {
            puVar3 = &Links(unsigned_short)::s_Sentinel;
          }
          else {
            puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x14);
          }
          uVar4 = puVar3[2];
          if ((Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f3c852 = 0xffff;
            DAT_00f3c854 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (uVar4 == 0xffff) {
            puVar6 = &Links(unsigned_short)::s_Sentinel;
            puVar3 = (undefined2 *)(*(int *)(this + 4) + 0x13ffec);
          }
          else {
            puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x14);
            puVar6 = puVar3;
          }
          local_20 = puVar6[2];
          local_1e = uVar1;
        }
        else {
          if (uVar4 == 0xffff) goto LAB_006de190;
LAB_006ddedf:
          if (local_1e == *(ushort *)(*(int *)(this + 4) + (uint)uVar4 * 0x14 + 2))
          goto LAB_006de1a8;
LAB_006ddef9:
          puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x14);
        }
        puVar3[3] = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x14 + 6) = 0;
        RotateRight(this,local_20);
      }
      else {
        if (uVar4 == 0xffff) goto LAB_006dde88;
LAB_006ddb31:
        if (*(short *)(*(int *)(this + 4) + (uint)uVar4 * 0x14 + 6) != 0) goto LAB_006ddea0;
LAB_006ddb48:
        *(undefined2 *)(*(int *)(this + 4) + uVar7 * 0x14 + 6) = 1;
        local_1e = local_20;
        *(undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x14 + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x14 + 6) = 0;
      }
    }
    else {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar2 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f3c852 = 0xffff;
          DAT_00f3c854 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        if (local_20 != 0xffff) goto LAB_006ddba6;
LAB_006ddff9:
        puVar5 = &Links(unsigned_short)::s_Sentinel;
      }
      else {
        if (local_20 == 0xffff) goto LAB_006ddff9;
LAB_006ddba6:
        puVar5 = (ushort *)(*(int *)(this + 4) + (uint)local_20 * 0x14);
      }
      uVar4 = *puVar5;
      if ((Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f3c852 = 0xffff;
        DAT_00f3c854 = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar4 != 0xffff) goto LAB_006ddbc7;
LAB_006ddfc0:
        puVar3 = &Links(unsigned_short)::s_Sentinel;
      }
      else {
        if (uVar4 == 0xffff) goto LAB_006ddfc0;
LAB_006ddbc7:
        puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x14);
      }
      if (puVar3[3] == 0) {
        *(undefined2 *)(*(int *)(this + 4) + uVar7 * 0x14 + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x14 + 6) = 1;
        local_1e = local_20;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x14 + 6) = 0;
      }
      else {
        if (Links(unsigned_short)::s_Sentinel == '\0') {
          iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar2 != 0) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f3c852 = 0xffff;
            DAT_00f3c854 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (local_1e != 0xffff) goto LAB_006dddbd;
LAB_006de2a9:
          uVar4 = DAT_00f3c854;
          if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_006dddd5;
LAB_006de2c0:
          iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar2 == 0) goto LAB_006dddd5;
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f3c852 = 0xffff;
          DAT_00f3c854 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          if (uVar4 != 0xffff) goto LAB_006ddddf;
LAB_006de320:
          if (local_1e != Links(unsigned_short)::s_Sentinel) goto LAB_006dddf8;
LAB_006de338:
          RotateRight(this,uVar1);
          if ((Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f3c852 = 0xffff;
            DAT_00f3c854 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (uVar1 == 0xffff) {
            puVar3 = &Links(unsigned_short)::s_Sentinel;
          }
          else {
            puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x14);
          }
          uVar4 = puVar3[2];
          if ((Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f3c852 = 0xffff;
            DAT_00f3c854 = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
          if (uVar4 == 0xffff) {
            puVar6 = &Links(unsigned_short)::s_Sentinel;
            puVar3 = (undefined2 *)(*(int *)(this + 4) + 0x13ffec);
          }
          else {
            puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x14);
            puVar6 = puVar3;
          }
          local_20 = puVar6[2];
          local_1e = uVar1;
        }
        else {
          if (local_1e == 0xffff) goto LAB_006de2a9;
LAB_006dddbd:
          uVar4 = *(ushort *)(*(int *)(this + 4) + (uint)local_1e * 0x14 + 4);
          if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_006de2c0;
LAB_006dddd5:
          if (uVar4 == 0xffff) goto LAB_006de320;
LAB_006ddddf:
          if (local_1e == *(ushort *)(*(int *)(this + 4) + (uint)uVar4 * 0x14)) goto LAB_006de338;
LAB_006dddf8:
          puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x14);
        }
        puVar3[3] = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x14 + 6) = 0;
        RotateLeft(this,local_20);
      }
    }
  } 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)