//
// SpawnTriggerGameObject::changeRemap from 0x89d20c to 0x89d4c8 (700 bytes)
//
// 3 xrefs:
// > EditorUI::replaceGroupID @ 0x7c3bcc
// > EditorUI::replaceGroupID @ 0x7c3bf0
// > ??> @ 0xdb4a8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:56:13 +0000
//
__int64 __fastcall SpawnTriggerGameObject::changeRemap(SpawnTriggerGameObject *this, int a2, int a3, char a4)
{
_DWORD *v5; // x0
_DWORD *v6; // x4
char *v7; // x20
char *v8; // x2
__int64 *v9; // x3
int v10; // w19
int v11; // w25
__int64 *v12; // x0
int v13; // w1
int v14; // w1
char *v15; // x0
__int64 v16; // x4
__int64 v17; // x5
__int64 *v18; // x19
char *v19; // x0
__int64 *i; // x0
int v22; // w1
int v23; // w1
__int64 *v24; // x1
__int64 **v25; // x26
__int64 v26; // x0
__int64 *v27; // x1
__int64 **v28; // [xsp+58h] [xbp+58h]
__int64 **v29; // [xsp+60h] [xbp+60h] BYREF
__int64 *v30; // [xsp+68h] [xbp+68h] BYREF
__int64 v31; // [xsp+70h] [xbp+70h]
v5 = *((_DWORD **)this + 230);
v6 = *((_DWORD **)this + 231);
if ( v5 != v6 )
{
do
{
if ( a4 )
{
if ( *v5 == a2 && v5[2] != a3 )
*v5 = a3;
}
else if ( v5[2] == a2 && *v5 != a3 )
{
v5[2] = a3;
}
v5 += 4;
}
while ( v6 != v5 );
v7 = *((char **)this + 230);
v8 = *((char **)this + 231);
v30 = nullptr;
v31 = 0;
v29 = &v30;
if ( v7 != v8 )
{
v9 = nullptr;
while ( 1 )
{
v10 = *(_DWORD *)v7;
v11 = *((_DWORD *)v7 + 2);
if ( !v9 )
{
v28 = &v30;
v25 = &v30;
goto LABEL_35;
}
v12 = v9;
do
{
while ( 1 )
{
v13 = *((_DWORD *)v12 + 7);
if ( v10 >= v13 )
{
if ( v10 > v13 )
goto LABEL_30;
v14 = *((_DWORD *)v12 + 8);
if ( v11 >= v14 )
break;
}
v12 = (__int64 *)*v12;
if ( !v12 )
goto LABEL_23;
}
if ( v11 <= v14 )
{
v15 = v7 + 16;
if ( v8 == v7 + 16 )
{
v18 = v9;
v19 = v7;
}
else
{
do
{
v16 = *(_QWORD *)v15;
v17 = *((_QWORD *)v15 + 1);
v15 += 16;
*((_QWORD *)v15 - 4) = v16;
*((_QWORD *)v15 - 3) = v17;
}
while ( v8 != v15 );
v18 = v30;
v19 = &v7[((v8 - (v7 + 32)) & 0xFFFFFFFFFFFFFFF0LL) + 16];
}
v8 = *((char **)this + 231);
if ( v19 != v8 )
{
v8 += 16 * ~((unsigned __int64)(v8 - 16 - v19) >> 4);
*((_QWORD *)this + 231) = v8;
}
goto LABEL_18;
}
LABEL_30:
v12 = (__int64 *)v12[1];
}
while ( v12 );
LABEL_23:
for ( i = v9; ; i = v24 )
{
v22 = *((_DWORD *)i + 7);
if ( v10 >= v22 )
{
if ( v10 > v22 )
goto LABEL_38;
v23 = *((_DWORD *)i + 8);
if ( v11 >= v23 )
break;
}
v24 = (__int64 *)*i;
if ( !*i )
{
v28 = (__int64 **)i;
v25 = (__int64 **)i;
goto LABEL_35;
}
LABEL_33:
;
}
if ( v11 <= v23 )
{
v18 = v9;
goto LABEL_29;
}
LABEL_38:
v24 = (__int64 *)i[1];
if ( v24 )
goto LABEL_33;
v28 = (__int64 **)i;
v25 = (__int64 **)(i + 1);
LABEL_35:
v26 = operator new(0x28u);
*(_QWORD *)v26 = 0;
*(_QWORD *)(v26 + 16) = v28;
*(_DWORD *)(v26 + 28) = v10;
*(_DWORD *)(v26 + 32) = v11;
*(_QWORD *)(v26 + 8) = 0;
*v25 = (__int64 *)v26;
if ( *v29 )
{
v29 = (__int64 **)*v29;
v27 = *v25;
}
else
{
v27 = (__int64 *)v26;
}
std::__tree_balance_after_insert *>(v30, v27);
v18 = v30;
++v31;
LABEL_29:
v7 += 16;
v8 = *((char **)this + 231);
LABEL_18:
v9 = v18;
if ( v7 == v8 )
{
if ( v18 )
{
std::__tree>::destroy((__int64)&v29, (_QWORD *)*v18);
std::__tree>::destroy((__int64)&v29, (_QWORD *)v18[1]);
operator delete(v18);
}
return _stack_chk_guard;
}
}
}
}
return _stack_chk_guard;
}