//
// GJBaseGameLayer::generateSpawnRemap from 0x1001dfc28 to 0x1001dfd00 (216 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateSpecialGroupData @ 0x1001dfbcc
// > LevelEditorLayer::getLevelString @ 0x10035c3a0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJBaseGameLayer::generateSpawnRemap(GJBaseGameLayer *a1)
{
__int64 end; // x0
std::unordered_map *begin; // x20
cocos2d::CCArray *m_objects; // x8
cocos2d::ccArray *data; // x9
__int64 num; // x8
cocos2d::CCObject **arr; // x20
unsigned __int64 v8; // x21
cocos2d::CCObject *v9; // x22
int v10; // w0
_OWORD v11[2]; // [xsp+0h] [xbp-50h] BYREF
int v12; // [xsp+20h] [xbp-30h]
end = (__int64)a1->m_spawnRemapTriggers.__end_;
begin = a1->m_spawnRemapTriggers.__begin_;
while ( (std::unordered_map *)end != begin )
end = sub_100017A98(end - 40);
a1->m_spawnRemapTriggers.__end_ = begin;
memset(v11, 0, sizeof(v11));
v12 = 1065353216;
sub_1001EDBA4(&a1->m_spawnRemapTriggers, v11);
sub_100017A98((__int64)v11);
m_objects = a1->m_objects;
if ( m_objects )
{
data = m_objects->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v8 = (unsigned __int64)&arr[num - 1];
do
{
v9 = *arr;
if ( !*arr )
break;
if ( v9[18].m_uReference == 1268 )
{
if ( *(cocos2d::CCObject_vtbl **)&v9[32].m_uOrderOfArrival == v9[33].__vftable )
v10 = 0;
else
v10 = GJBaseGameLayer::registerSpawnRemap(a1, (std::vector *)&v9[32].m_uOrderOfArrival);
v9[33].m_nTag = v10;
}
++arr;
}
while ( (unsigned __int64)arr <= v8 );
}
}
}