CUtlRBTree<ThinkSync,unsigned_short,bool(*)(ThinkSync_const&,ThinkSync_const&),CUtlMemory<UtlRBTreeNode_t<ThinkSync,unsigned_short>,unsigned_short>>::InsertRebalance
0x0047e210 · 2918 bytes · __thiscall
_ZN10CUtlRBTreeI9ThinkSynctPFbRKS0_S2_E10CUtlMemoryI15UtlRBTreeNode_tIS0_tEtEE15InsertRebalanceEt
Decompiled
undefined (2 params)
/* CUtlRBTree<ThinkSync, unsigned short, bool (*)(ThinkSync const&, ThinkSync const&),
CUtlMemory<UtlRBTreeNode_t<ThinkSync, unsigned short>, unsigned short>
>::InsertRebalance(unsigned short) */
void __thiscall
CUtlRBTree<ThinkSync,unsigned_short,bool(*)(ThinkSync_const&,ThinkSync_const&),CUtlMemory<UtlRBTreeNode_t<ThinkSync,unsigned_short>,unsigned_short>>
::InsertRebalance(CUtlRBTree<ThinkSync,unsigned_short,bool(*)(ThinkSync_const&,ThinkSync_const&),CUtlMemory<UtlRBTreeNode_t<ThinkSync,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_0047e285:
*(undefined2 *)(*(int *)(this + 4) + (uint)uVar1 * 0x24 + 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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (local_1e != 0xffff) goto LAB_0047e24f;
LAB_0047e5d1:
puVar3 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (local_1e == 0xffff) goto LAB_0047e5d1;
LAB_0047e24f:
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0x24);
}
uVar1 = puVar3[2];
if ((Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
DAT_00f1624c = 0xffff;
Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
if (uVar1 != 0xffff) goto LAB_0047e271;
LAB_0047e598:
puVar3 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (uVar1 == 0xffff) goto LAB_0047e598;
LAB_0047e271:
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar1 * 0x24);
}
if (puVar3[3] != 0) {
uVar1 = *(ushort *)(this + 0x10);
goto LAB_0047e285;
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (local_1e != 0xffff) goto LAB_0047e2bd;
LAB_0047e539:
puVar3 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (local_1e == 0xffff) goto LAB_0047e539;
LAB_0047e2bd:
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0x24);
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (uVar1 != 0xffff) goto LAB_0047e2e2;
LAB_0047e4c5:
local_20 = DAT_00f1624e;
if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_0047e2fb;
LAB_0047e4e0:
iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
if (iVar2 != 0) {
Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (uVar1 != 0xffff) goto LAB_0047e305;
LAB_0047e505:
puVar3 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (uVar1 == 0xffff) goto LAB_0047e4c5;
LAB_0047e2e2:
local_20 = *(ushort *)(*(int *)(this + 4) + uVar7 * 0x24 + 4);
if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_0047e4e0;
LAB_0047e2fb:
if (uVar1 == 0xffff) goto LAB_0047e505;
LAB_0047e305:
puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x24);
}
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_00f1624e = 0xffff;
DAT_00f1624c = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
goto LAB_0047e31a;
}
if (uVar4 != 0xffff) goto LAB_0047e324;
LAB_0047e493:
puVar5 = &Links(unsigned_short)::s_Sentinel;
}
else {
LAB_0047e31a:
if (uVar4 == 0xffff) goto LAB_0047e493;
LAB_0047e324:
puVar5 = (ushort *)(*(int *)(this + 4) + (uint)uVar4 * 0x24);
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (local_20 != 0xffff) goto LAB_0047e34f;
LAB_0047e799:
puVar3 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (local_20 == 0xffff) goto LAB_0047e799;
LAB_0047e34f:
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x24);
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
if (uVar4 != 0xffff) goto LAB_0047e371;
LAB_0047e6c8:
if (DAT_00f16250 == 0) goto LAB_0047e388;
LAB_0047e6e0:
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (local_1e != 0xffff) goto LAB_0047e6fd;
LAB_0047ea79:
puVar3 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (local_1e == 0xffff) goto LAB_0047ea79;
LAB_0047e6fd:
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0x24);
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
if (uVar4 != 0xffff) goto LAB_0047e71f;
LAB_0047e9d0:
if (local_1e != DAT_00f1624c) goto LAB_0047e739;
LAB_0047e9e8:
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_00f1624c = 0xffff;
DAT_00f1624e = 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 * 0x24);
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (uVar4 == 0xffff) {
puVar6 = &Links(unsigned_short)::s_Sentinel;
puVar3 = (undefined2 *)(*(int *)(this + 4) + 0x23ffdc);
}
else {
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x24);
puVar6 = puVar3;
}
local_20 = puVar6[2];
local_1e = uVar1;
}
else {
if (uVar4 == 0xffff) goto LAB_0047e9d0;
LAB_0047e71f:
if (local_1e == *(ushort *)(*(int *)(this + 4) + (uint)uVar4 * 0x24 + 2))
goto LAB_0047e9e8;
LAB_0047e739:
puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x24);
}
puVar3[3] = 1;
*(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x24 + 6) = 0;
RotateRight(this,local_20);
}
else {
if (uVar4 == 0xffff) goto LAB_0047e6c8;
LAB_0047e371:
if (*(short *)(*(int *)(this + 4) + (uint)uVar4 * 0x24 + 6) != 0) goto LAB_0047e6e0;
LAB_0047e388:
*(undefined2 *)(*(int *)(this + 4) + uVar7 * 0x24 + 6) = 1;
local_1e = local_20;
*(undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x24 + 6) = 1;
*(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x24 + 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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (local_20 != 0xffff) goto LAB_0047e3e6;
LAB_0047e839:
puVar5 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (local_20 == 0xffff) goto LAB_0047e839;
LAB_0047e3e6:
puVar5 = (ushort *)(*(int *)(this + 4) + (uint)local_20 * 0x24);
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
if (uVar4 != 0xffff) goto LAB_0047e407;
LAB_0047e800:
puVar3 = &Links(unsigned_short)::s_Sentinel;
}
else {
if (uVar4 == 0xffff) goto LAB_0047e800;
LAB_0047e407:
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x24);
}
if (puVar3[3] == 0) {
*(undefined2 *)(*(int *)(this + 4) + uVar7 * 0x24 + 6) = 1;
*(undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x24 + 6) = 1;
local_1e = local_20;
*(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x24 + 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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (local_1e != 0xffff) goto LAB_0047e5fd;
LAB_0047eae9:
uVar4 = DAT_00f1624e;
if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_0047e615;
LAB_0047eb00:
iVar2 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
if (iVar2 == 0) goto LAB_0047e615;
Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
if (uVar4 != 0xffff) goto LAB_0047e61f;
LAB_0047eb60:
if (local_1e != Links(unsigned_short)::s_Sentinel) goto LAB_0047e638;
LAB_0047eb78:
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_00f1624c = 0xffff;
DAT_00f1624e = 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 * 0x24);
}
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_00f1624c = 0xffff;
DAT_00f1624e = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
if (uVar4 == 0xffff) {
puVar6 = &Links(unsigned_short)::s_Sentinel;
puVar3 = (undefined2 *)(*(int *)(this + 4) + 0x23ffdc);
}
else {
puVar3 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar4 * 0x24);
puVar6 = puVar3;
}
local_20 = puVar6[2];
local_1e = uVar1;
}
else {
if (local_1e == 0xffff) goto LAB_0047eae9;
LAB_0047e5fd:
uVar4 = *(ushort *)(*(int *)(this + 4) + (uint)local_1e * 0x24 + 4);
if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_0047eb00;
LAB_0047e615:
if (uVar4 == 0xffff) goto LAB_0047eb60;
LAB_0047e61f:
if (local_1e == *(ushort *)(*(int *)(this + 4) + (uint)uVar4 * 0x24)) goto LAB_0047eb78;
LAB_0047e638:
puVar3 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0x24);
}
puVar3[3] = 1;
*(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0x24 + 6) = 0;
RotateLeft(this,local_20);
}
}
} while( true );
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.