CUtlRBTree<ConVar*,int,bool(*)(ConVar*const&,ConVar*const&),CUtlMemory<UtlRBTreeNode_t<ConVar*,int>,int>>::InsertRebalance
0x0012be70 · 2562 bytes · __thiscall
_ZN10CUtlRBTreeIP6ConVariPFbRKS1_S3_E10CUtlMemoryI15UtlRBTreeNode_tIS1_iEiEE15InsertRebalanceEi
Decompiled
undefined (2 params)
/* CUtlRBTree<ConVar*, int, bool (*)(ConVar* const&, ConVar* const&),
CUtlMemory<UtlRBTreeNode_t<ConVar*, int>, int> >::InsertRebalance(int) */
void __thiscall
CUtlRBTree<ConVar*,int,bool(*)(ConVar*const&,ConVar*const&),CUtlMemory<UtlRBTreeNode_t<ConVar*,int>,int>>
::InsertRebalance(CUtlRBTree<ConVar*,int,bool(*)(ConVar*const&,ConVar*const&),CUtlMemory<UtlRBTreeNode_t<ConVar*,int>,int>>
*this,int param_1)
{
int iVar1;
int *piVar2;
int iVar3;
int iVar4;
int iVar5;
undefined4 *puVar6;
undefined4 *puVar7;
do {
iVar1 = *(int *)(this + 0x10);
if (param_1 == iVar1) {
LAB_0012bed4:
*(undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14 + 0xc) = 1;
return;
}
if (Links(int)::s_Sentinel == '\0') {
iVar1 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar1 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (param_1 == -1) goto LAB_0012c205;
LAB_0012bea1:
puVar6 = (undefined4 *)(*(int *)(this + 4) + param_1 * 0x14);
}
else {
if (param_1 != -1) goto LAB_0012bea1;
LAB_0012c205:
puVar6 = &Links(int)::s_Sentinel;
}
iVar1 = puVar6[2];
if ((Links(int)::s_Sentinel == '\0') &&
(iVar5 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar5 != 0)) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
if (iVar1 == -1) goto LAB_0012c1d0;
LAB_0012bec1:
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14);
}
else {
if (iVar1 != -1) goto LAB_0012bec1;
LAB_0012c1d0:
puVar6 = &Links(int)::s_Sentinel;
}
if (puVar6[3] != 0) {
iVar1 = *(int *)(this + 0x10);
goto LAB_0012bed4;
}
if (Links(int)::s_Sentinel == '\0') {
iVar1 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar1 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (param_1 == -1) goto LAB_0012c175;
LAB_0012bf09:
puVar6 = (undefined4 *)(*(int *)(this + 4) + param_1 * 0x14);
}
else {
if (param_1 != -1) goto LAB_0012bf09;
LAB_0012c175:
puVar6 = &Links(int)::s_Sentinel;
}
iVar1 = puVar6[2];
if (Links(int)::s_Sentinel == '\0') {
iVar5 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar5 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar1 == -1) goto LAB_0012c144;
LAB_0012bf29:
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14);
}
else {
if (iVar1 != -1) goto LAB_0012bf29;
LAB_0012c144:
puVar6 = &Links(int)::s_Sentinel;
}
iVar5 = puVar6[2];
if (Links(int)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar4 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar1 == -1) goto LAB_0012c10c;
LAB_0012bf46:
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14);
}
else {
if (iVar1 != -1) goto LAB_0012bf46;
LAB_0012c10c:
puVar6 = &Links(int)::s_Sentinel;
}
iVar4 = puVar6[2];
if (Links(int)::s_Sentinel == '\0') {
iVar3 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar3 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
goto LAB_0012bf5a;
}
if (iVar4 == -1) goto LAB_0012c0da;
LAB_0012bf63:
piVar2 = (int *)(*(int *)(this + 4) + iVar4 * 0x14);
}
else {
LAB_0012bf5a:
if (iVar4 != -1) goto LAB_0012bf63;
LAB_0012c0da:
piVar2 = &Links(int)::s_Sentinel;
}
if (iVar1 == *piVar2) {
if (Links(int)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar4 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar5 == -1) goto LAB_0012c314;
LAB_0012bf85:
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar5 * 0x14);
}
else {
if (iVar5 != -1) goto LAB_0012bf85;
LAB_0012c314:
puVar6 = &Links(int)::s_Sentinel;
}
iVar4 = puVar6[1];
if ((Links(int)::s_Sentinel == '\0') &&
(iVar3 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar3 != 0)) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
iVar3 = DAT_00340db0;
if (iVar4 != -1) {
iVar3 = *(int *)(*(int *)(this + 4) + iVar4 * 0x14 + 0xc);
}
if (iVar3 == 0) {
LAB_0012bfb6:
*(undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14 + 0xc) = 1;
*(undefined4 *)(*(int *)(this + 4) + iVar4 * 0x14 + 0xc) = 1;
*(undefined4 *)(*(int *)(this + 4) + iVar5 * 0x14 + 0xc) = 0;
param_1 = iVar5;
}
else {
if (Links(int)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar4 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (param_1 == -1) goto LAB_0012c605;
LAB_0012c289:
iVar4 = *(int *)(*(int *)(this + 4) + param_1 * 0x14 + 8);
if (Links(int)::s_Sentinel != '\0') goto LAB_0012c2a0;
LAB_0012c618:
iVar3 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar3 == 0) goto LAB_0012c2a0;
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
if (iVar4 == -1) goto LAB_0012c670;
LAB_0012c2a9:
if (param_1 != *(int *)(*(int *)(this + 4) + iVar4 * 0x14 + 4)) goto LAB_0012c2be;
LAB_0012c688:
RotateLeft(this,iVar1);
if ((Links(int)::s_Sentinel == '\0') &&
(iVar5 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar5 != 0)) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar1 == -1) {
puVar6 = &Links(int)::s_Sentinel;
}
else {
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14);
}
iVar5 = puVar6[2];
if ((Links(int)::s_Sentinel == '\0') &&
(iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar4 != 0)) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar5 == -1) {
puVar7 = &Links(int)::s_Sentinel;
puVar6 = (undefined4 *)(*(int *)(this + 4) + -0x14);
}
else {
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar5 * 0x14);
puVar7 = puVar6;
}
iVar5 = puVar7[2];
param_1 = iVar1;
}
else {
if (param_1 != -1) goto LAB_0012c289;
LAB_0012c605:
iVar4 = DAT_00340dac;
if (Links(int)::s_Sentinel == '\0') goto LAB_0012c618;
LAB_0012c2a0:
if (iVar4 != -1) goto LAB_0012c2a9;
LAB_0012c670:
if (param_1 == DAT_00340da8) goto LAB_0012c688;
LAB_0012c2be:
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14);
}
puVar6[3] = 1;
*(undefined4 *)(*(int *)(this + 4) + iVar5 * 0x14 + 0xc) = 0;
RotateRight(this,iVar5);
}
}
else {
if (Links(int)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar4 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar5 == -1) goto LAB_0012c3a4;
LAB_0012c001:
piVar2 = (int *)(*(int *)(this + 4) + iVar5 * 0x14);
}
else {
if (iVar5 != -1) goto LAB_0012c001;
LAB_0012c3a4:
piVar2 = &Links(int)::s_Sentinel;
}
iVar4 = *piVar2;
if ((Links(int)::s_Sentinel == '\0') &&
(iVar3 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar3 != 0)) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
if (iVar4 == -1) goto LAB_0012c370;
LAB_0012c01d:
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar4 * 0x14);
}
else {
if (iVar4 != -1) goto LAB_0012c01d;
LAB_0012c370:
puVar6 = &Links(int)::s_Sentinel;
}
if (puVar6[3] == 0) goto LAB_0012bfb6;
if (Links(int)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar4 != 0) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (param_1 == -1) goto LAB_0012c565;
LAB_0012c046:
iVar4 = *(int *)(*(int *)(this + 4) + param_1 * 0x14 + 8);
if (Links(int)::s_Sentinel != '\0') goto LAB_0012c05d;
LAB_0012c578:
iVar3 = __cxa_guard_acquire(&Links(int)::s_Sentinel);
if (iVar3 == 0) goto LAB_0012c05d;
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
if (iVar4 == -1) goto LAB_0012c5d0;
LAB_0012c066:
piVar2 = (int *)(*(int *)(this + 4) + iVar4 * 0x14);
}
else {
if (param_1 != -1) goto LAB_0012c046;
LAB_0012c565:
iVar4 = DAT_00340dac;
if (Links(int)::s_Sentinel == '\0') goto LAB_0012c578;
LAB_0012c05d:
if (iVar4 != -1) goto LAB_0012c066;
LAB_0012c5d0:
piVar2 = &Links(int)::s_Sentinel;
}
if (param_1 == *piVar2) {
RotateRight(this,iVar1);
if ((Links(int)::s_Sentinel == '\0') &&
(iVar5 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar5 != 0)) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar1 == -1) {
puVar6 = &Links(int)::s_Sentinel;
}
else {
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14);
}
iVar5 = puVar6[2];
if ((Links(int)::s_Sentinel == '\0') &&
(iVar4 = __cxa_guard_acquire(&Links(int)::s_Sentinel), iVar4 != 0)) {
Links(int)::s_Sentinel = 0xffffffff;
DAT_00340da8 = -1;
DAT_00340dac = -1;
__cxa_guard_release(&Links(int)::s_Sentinel);
}
if (iVar5 == -1) {
puVar7 = &Links(int)::s_Sentinel;
puVar6 = (undefined4 *)(*(int *)(this + 4) + -0x14);
}
else {
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar5 * 0x14);
puVar7 = puVar6;
}
iVar5 = puVar7[2];
param_1 = iVar1;
}
else {
puVar6 = (undefined4 *)(*(int *)(this + 4) + iVar1 * 0x14);
}
puVar6[3] = 1;
*(undefined4 *)(*(int *)(this + 4) + iVar5 * 0x14 + 0xc) = 0;
RotateLeft(this,iVar5);
}
} 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.