//
// SpawnTriggerGameObject::changeRemap from 0x1001b4120 to 0x1001b42f9 (473 bytes)
//
// 2 xrefs:
// > EditorUI::replaceGroupID @ 0x10001630e
// > EditorUI::replaceGroupID @ 0x10001632e
//
// This function is hookable on this platform (idp: pc, 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:26:11 +0000
//
void __fastcall SpawnTriggerGameObject::changeRemap(__int64 a1, int a2, unsigned int a3, char a4)
{
unsigned int *v4; // r14
unsigned int *v5; // r8
unsigned int *v6; // rax
__int64 v7; // rbx
__int64 v8; // r13
__int128 *v9; // r15
__int64 **v10; // r14
__int64 *v11; // rax
int v12; // ecx
int v13; // ecx
size_t v14; // r8
size_t v15; // rbx
__int64 v16; // rax
int v17; // eax
int v18; // eax
__int64 *v19; // rax
__int128 *v20; // [rsp+8h] [rbp-48h] BYREF
__int128 v21; // [rsp+10h] [rbp-40h] BYREF
void *__dst; // [rsp+20h] [rbp-30h]
v4 = *(unsigned int **)(a1 + 1840);
v5 = *(unsigned int **)(a1 + 1848);
if ( v4 != v5 )
{
v6 = *(unsigned int **)(a1 + 1840);
if ( a4 )
{
do
{
if ( *v6 == a2 && v6[2] != a3 )
*v6 = a3;
v6 += 4;
}
while ( v6 != v5 );
}
else
{
do
{
if ( v6[2] == a2 && *v6 != a3 )
v6[2] = a3;
v6 += 4;
}
while ( v6 != v5 );
}
v21 = 0;
v20 = &v21;
while ( 1 )
{
while ( 1 )
{
v7 = *v4;
__dst = v4;
v8 = v4[2];
v9 = &v21;
v10 = (__int64 **)&v21;
if ( (_QWORD)v21 )
break;
LABEL_33:
v19 = (__int64 *)operator new(0x28u);
*(__int64 *)((char *)v19 + 28) = v7 | (v8 << 32);
*(_OWORD *)v19 = 0;
v19[2] = (__int64)v9;
*v10 = v19;
if ( *(_QWORD *)v20 )
v20 = *(__int128 **)v20;
sub_10001B680((__int64 *)v21, v19);
++*((_QWORD *)&v21 + 1);
v5 = *(unsigned int **)(a1 + 1848);
LABEL_36:
v4 = (unsigned int *)((char *)__dst + 16);
if ( (char *)__dst + 16 == (char *)v5 )
{
LABEL_37:
sub_10001ADF0((__int64)&v20, (_QWORD *)v21);
return;
}
}
v11 = (__int64 *)v21;
while ( 1 )
{
v12 = *((_DWORD *)v11 + 7);
if ( (int)v7 < v12 )
goto LABEL_16;
if ( (int)v7 <= v12 )
{
v13 = *((_DWORD *)v11 + 8);
if ( (int)v8 < v13 )
goto LABEL_16;
if ( (int)v8 <= v13 )
break;
}
++v11;
LABEL_16:
v11 = (__int64 *)*v11;
if ( !v11 )
{
v16 = v21;
while ( 1 )
{
v9 = (__int128 *)v16;
v17 = *(_DWORD *)(v16 + 28);
if ( (int)v7 < v17 )
goto LABEL_26;
if ( (int)v7 > v17 )
{
LABEL_31:
v16 = *((_QWORD *)v9 + 1);
if ( !v16 )
{
v10 = (__int64 **)v9 + 1;
goto LABEL_33;
}
}
else
{
v18 = *((_DWORD *)v9 + 8);
if ( (int)v8 >= v18 )
{
if ( (int)v8 <= v18 )
goto LABEL_36;
goto LABEL_31;
}
LABEL_26:
v16 = *(_QWORD *)v9;
v10 = (__int64 **)v9;
if ( !*(_QWORD *)v9 )
goto LABEL_33;
}
}
}
}
v4 = (unsigned int *)__dst;
v14 = (char *)v5 - ((_BYTE *)__dst + 16);
if ( v14 )
{
v15 = v14;
memmove(__dst, (char *)__dst + 16, v14);
v14 = v15;
}
v5 = (unsigned int *)((char *)v4 + v14);
*(_QWORD *)(a1 + 1848) = v5;
if ( v4 == v5 )
goto LABEL_37;
}
}
}